Ejemplo n.º 1
0
  private Object finish() {
    String s = (String) htParams.get("loadState");
    atomSetCollection.setAtomSetCollectionAuxiliaryInfo("loadState", s == null ? "" : s);
    s = (String) htParams.get("smilesString");
    if (s != null) atomSetCollection.setAtomSetCollectionAuxiliaryInfo("smilesString", s);
    if (!htParams.containsKey("templateAtomCount"))
      htParams.put("templateAtomCount", Integer.valueOf(atomSetCollection.getAtomCount()));
    if (htParams.containsKey("bsFilter"))
      htParams.put(
          "filteredAtomCount",
          Integer.valueOf(BitSetUtil.cardinalityOf((BitSet) htParams.get("bsFilter"))));
    if (!calculationType.equals("?"))
      atomSetCollection.setAtomSetCollectionAuxiliaryInfo("calculationType", calculationType);

    String name = atomSetCollection.getFileTypeName();
    String fileType = name;
    if (fileType.indexOf("(") >= 0) fileType = fileType.substring(0, fileType.indexOf("("));
    for (int i = atomSetCollection.getAtomSetCount(); --i >= 0; ) {
      atomSetCollection.setAtomSetAuxiliaryInfo("fileName", filePath, i);
      atomSetCollection.setAtomSetAuxiliaryInfo("fileType", fileType, i);
    }
    atomSetCollection.freeze(reverseModels);
    if (atomSetCollection.errorMessage != null)
      return atomSetCollection.errorMessage + "\nfor file " + filePath + "\ntype " + name;
    if ((atomSetCollection.bsAtoms == null
                ? atomSetCollection.getAtomCount()
                : atomSetCollection.bsAtoms.cardinality())
            == 0
        && fileType.indexOf("DataOnly") < 0)
      return "No atoms found\nfor file " + filePath + "\ntype " + name;
    return atomSetCollection;
  }
Ejemplo n.º 2
0
 public void setIsPDB() {
   atomSetCollection.setGlobalBoolean(AtomSetCollection.GLOBAL_ISPDB);
   atomSetCollection.setAtomSetAuxiliaryInfo("isPDB", Boolean.TRUE);
   if (htParams.get("pdbNoHydrogens") != null)
     atomSetCollection.setAtomSetCollectionAuxiliaryInfo(
         "pdbNoHydrogens", htParams.get("pdbNoHydrogens"));
 }
Ejemplo n.º 3
0
 @SuppressWarnings("unchecked")
 public void setMOData(Map<String, Object> moData) {
   atomSetCollection.setAtomSetAuxiliaryInfo("moData", moData);
   if (moData == null) return;
   List<Map<String, Object>> orbitals = (List<Map<String, Object>>) moData.get("mos");
   if (orbitals != null)
     Logger.info(
         orbitals.size()
             + " molecular orbitals read in model "
             + atomSetCollection.getAtomSetCount());
 }
Ejemplo n.º 4
0
 protected void newAtomSet(String name) {
   if (atomSetCollection.getCurrentAtomSetIndex() >= 0) {
     atomSetCollection.newAtomSet();
     atomSetCollection.setCollectionName(
         "<collection of " + (atomSetCollection.getCurrentAtomSetIndex() + 1) + " models>");
   } else {
     atomSetCollection.setCollectionName(name);
   }
   atomSetCollection.setAtomSetAuxiliaryInfo(
       "name", name, Math.max(0, atomSetCollection.getCurrentAtomSetIndex()));
 }
Ejemplo n.º 5
0
 protected void addSites(Map<String, Map<String, Object>> htSites) {
   atomSetCollection.setAtomSetAuxiliaryInfo("pdbSites", htSites);
   String sites = "";
   for (Map.Entry<String, Map<String, Object>> entry : htSites.entrySet()) {
     String name = entry.getKey();
     Map<String, Object> htSite = entry.getValue();
     char ch;
     for (int i = name.length(); --i >= 0; )
       if (!Character.isLetterOrDigit(ch = name.charAt(i)) && ch != '\'')
         name = name.substring(0, i) + "_" + name.substring(i + 1);
     // String seqNum = (String) htSite.get("seqNum");
     String groups = (String) htSite.get("groups");
     if (groups.length() == 0) continue;
     addSiteScript("@site_" + name + " " + groups);
     // addJmolScript("@" + seqNum + " " + groups);
     addSiteScript("site_" + name + " = \"" + groups + "\".split(\",\")");
     sites += (sites == "" ? "" : ",") + "site_" + name;
   }
   addSiteScript("site_list = \"" + sites + "\".split(\",\")");
 }