Revision: 20690
          http://sourceforge.net/p/jmol/code/20690
Author:   hansonr
Date:     2015-08-12 06:12:07 +0000 (Wed, 12 Aug 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.16_2015.08.11"

bug fix: a = {*}.label("%[xxx]") does not work.
bug fix: "".format([a,b]) crashes Jmol

new feature: load <mmCIF file> filter "addBonds"
 -- processes _struct_conn records
 -- inter-group connections only
 -- includes _struct_conn bond types:
                covale           covalent bond
                covale_base      covalent modification of a nucleotide base
                covale_phosphate covalent modification of a nucleotide phosphate
                covale_sugar     covalent modification of a nucleotide sugar
                disulf           disulfide bridge
                metalc           metal coordination
 -- ignores _struct_conn bond types: 
                hydrog  hydrogen bond
                mismat  mismatched base pairs
                modres  covalent residue modification
                saltbr  ionic interaction
 
new feature: load *1crn*
 -- loads PDBe "updated" CIF files to allow CONECT-like bond creation
 -- for example, http://www.ebi.ac.uk/pdbe/static/entry/1h68_updated.cif
 -- suitable replacement for PDB CONECT
 -- processes _chem_comp_bond and _struct_conn categories
 -- presence of _chem_comp_bond will process _struct_conn as well, regardless 
of filter "addbonds"
      (because _chem_comp bonds are only intra-group, and for full CONECT-like 
behavior, we need all bonds)
 

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifReader.java
    trunk/Jmol/src/org/jmol/scriptext/MathExt.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifReader.java        
2015-08-11 21:13:26 UTC (rev 20689)
+++ trunk/Jmol/src/org/jmol/adapter/readers/cif/MMCifReader.java        
2015-08-12 06:12:07 UTC (rev 20690)
@@ -1002,6 +1002,7 @@
       String key2 = vwr.getChainID(getField(STRUCT_CONN_ASYM2), true) + 
getField(STRUCT_CONN_COMP2)
           + parseFloatStr(getField(STRUCT_CONN_SEQ2))
           + getField(STRUCT_CONN_ATOM2) + getField(STRUCT_CONN_ALT2);
+      System.out.println(type + "\t" + key1 + " " + key2);
       int order = getBondOrder(getField(STRUCT_CONN_ORDER));
       if (structConnMap == null)
         structConnMap = new Lst<Object[]>();
@@ -1035,8 +1036,6 @@
   private boolean processCompBondLoopBlock() throws Exception {
     doSetBonds = true;
     parseLoopParametersFor(FAMILY_COMPBOND, chemCompBondFields);
-    if (!checkAllFieldsPresent(chemCompBondFields, true))
-      return false;
     while (parser.getData()) {
       String comp = getField(CHEM_COMP_BOND_ID);
       String atom1 = getField(CHEM_COMP_BOND_ATOM_ID_1);

Modified: trunk/Jmol/src/org/jmol/scriptext/MathExt.java
===================================================================
--- trunk/Jmol/src/org/jmol/scriptext/MathExt.java      2015-08-11 21:13:26 UTC 
(rev 20689)
+++ trunk/Jmol/src/org/jmol/scriptext/MathExt.java      2015-08-12 06:12:07 UTC 
(rev 20690)
@@ -1347,7 +1347,7 @@
     // format("array", x)
     SV x1 = (args.length < 2 || intValue == T.format ? mp.getX() : null);
     String format = (args.length == 0 ? "%U" : args[0].tok == T.varray ? null 
: SV.sValue(args[0]));
-    if (args.length > 0 && x1 != null && format != null) {
+    if (!isLabel && args.length > 0 && x1 != null && format != null) {
       // x1.format(["energy", "pointGroup"]);
       // x1.format("%5.3f %5s", ["energy", "pointGroup"])
       // but not x1.format()
@@ -1386,7 +1386,7 @@
     
     BS bs = SV.getBitSet(x1, true);
     boolean asArray = T.tokAttr(intValue, T.minmaxmask); // "all"
-    return mp.addXObj(bs == null ? SV.sprintf(PT.formatCheck(format), x1) : e
+    return mp.addXObj(format == null ? "" : bs == null ? 
SV.sprintf(PT.formatCheck(format), x1) : e
         .getCmdExt().getBitsetIdent(bs, format, x1.value, true, x1.index,
             asArray));
     
@@ -1394,20 +1394,36 @@
 
   /**
    * [ {...},{...}... ] ==> [[...],[...]]
+   * 
    * @param listIn
    * @param formatList
    * @return sublist
    */
   private Lst<SV> getSublist(Lst<SV> listIn, Lst<SV> formatList) {
     Lst<SV> listOut = new Lst<SV>();
+    Map<String, SV> map;
+    SV v;
+    Lst<SV> list;
     for (int i = 0, n = listIn.size(); i < n; i++) {
-      Lst<SV> list = new Lst<SV>();
-      Map<String, SV> map = listIn.get(i).getMap();
-      for (int j = 0, n1 = formatList.size(); j < n1; j++) {
-        SV v = map.get(SV.sValue(formatList.get(j)));
-        list.addLast(v == null ? SV.newS("") : v);
+      SV element = listIn.get(i);
+      switch (element.tok) {
+      case T.hash:
+        map = element.getMap();
+        list = new Lst<SV>();
+        for (int j = 0, n1 = formatList.size(); j < n1; j++) {
+          v = map.get(SV.sValue(formatList.get(j)));
+          list.addLast(v == null ? SV.newS("") : v);
+        }
+        listOut.addLast(SV.getVariableList(list));
+        break;
+      case T.varray:
+        map = new Hashtable<String, SV>();
+        list = element.getList();
+        for (int j = 0, n1 = Math.min(list.size(), formatList.size()); j < n1; 
j++) {
+          map.put(SV.sValue(formatList.get(j)), list.get(j));
+        }
+        listOut.addLast(SV.getVariable(map));
       }
-      listOut.addLast(SV.getVariableList(list));
     }
     return listOut;
   }

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-11 21:13:26 UTC 
(rev 20689)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-12 06:12:07 UTC 
(rev 20690)
@@ -51,6 +51,9 @@
 
 Jmol.___JmolVersion="14.3.16_2015.08.11"
 
+bug fix: a = {*}.label("%[xxx]") does not work.
+bug fix: "".format([a,b]) crashes Jmol
+
 new feature: load <mmCIF file> filter "addBonds"
  -- processes _struct_conn records
  -- inter-group connections only

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to