Revision: 20767
          http://sourceforge.net/p/jmol/code/20767
Author:   hansonr
Date:     2015-09-09 12:52:37 +0000 (Wed, 09 Sep 2015)
Log Message:
-----------
TODO: Although isolated polyhedra are working in SMARTS searching, 
      for a SMILES representation, it will be important to allow a given atom 
      to be in more than one polyhedron (edge- or face-connected polyhedra). 
      But then that will require to references to the same atom. The solution
      is probabably something like [(3)], indicating that this atom is equated 
with 
      another in the SMILES string:
      
      [Fe][O(1)].[Fe][O(1)]
      
      then bond references to that oxygen from some other source would be to 
both?
      
        ....C(2) ....C(4) ???   
      
Jmol.___JmolVersion="14.3.16_2015.09.09"

code: javajs.util reconciled with swingjs project

bug fix: polyhedra.stereoSmiles --> polyhedra.polySmiles; central atom added in

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java
    trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java
    trunk/Jmol/src/org/jmol/smiles/SmilesParser.java
    trunk/Jmol/src/org/jmol/smiles/SmilesStereo.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java
===================================================================
--- trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java        2015-09-09 
11:50:30 UTC (rev 20766)
+++ trunk/Jmol/src/org/jmol/shapespecial/Polyhedron.java        2015-09-09 
12:52:37 UTC (rev 20767)
@@ -36,7 +36,7 @@
   private V3[] normals;
   private short[] normixes;
 
-  public String smiles, smarts, stereoSmiles;
+  public String smiles, smarts, polySmiles;
   private SymmetryInterface pointGroup;
   private Float volume;
 
@@ -89,8 +89,8 @@
         info.put("smarts", smarts);
       if (smiles != null)
         info.put("smiles", smiles);
-      if (stereoSmiles != null)
-        info.put("stereoSmiles", stereoSmiles);
+      if (polySmiles != null)
+        info.put("polySmiles", polySmiles);
       if (pointGroup != null)
         info.put("pointGroup", pointGroup.getPointGroupName());
       Object energy = vwr.ms.getInfo(centralAtom.mi, "Energy");
@@ -181,7 +181,7 @@
       if (smarts == null) {
         smarts = sm.polyhedronToSmiles(centralAtom, faces, nVertices, null, 
JC.SMILES_TOPOLOGY | JC.SMILES_NOSTEREO, null);
         smiles = sm.polyhedronToSmiles(centralAtom, faces, nVertices, 
vertices, JC.SMILES_TYPE_SMILES | JC.SMILES_NOSTEREO, null);
-        stereoSmiles = sm.polyhedronToSmiles(centralAtom, faces, nVertices, 
vertices,  JC.SMILES_TYPE_SMILES | JC.SMILES_ATOM_COMMENT, details);
+        polySmiles = sm.polyhedronToSmiles(centralAtom, faces, nVertices, 
vertices,  JC.SMILES_TYPE_SMILES | JC.SMILES_ATOM_COMMENT, details);
       }
     } catch (Exception e) {
     }

Modified: trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java
===================================================================
--- trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java   2015-09-09 11:50:30 UTC 
(rev 20766)
+++ trunk/Jmol/src/org/jmol/smiles/SmilesMatcher.java   2015-09-09 12:52:37 UTC 
(rev 20767)
@@ -412,9 +412,9 @@
         null, flags | JC.SMILES_EXPLICIT_H | JC.SMILES_NOAROMATIC
             | JC.SMILES_NOSTEREO);
     if (!JC.checkFlag(flags, JC.SMILES_NOSTEREO)) {
-      s = "//* " + center + " ["
+      s = "//* " + center + " *//\t["
           + Elements.elementSymbolFromNumber(center.getElementNumber()) + "@PH"
-          + atomCount + (details == null ? "" : "/" + details + "/") + "] *//" 
+ s;
+          + atomCount + (details == null ? "" : "/" + details + "/") + "]" + s;
     }
     return s;
   }

Modified: trunk/Jmol/src/org/jmol/smiles/SmilesParser.java
===================================================================
--- trunk/Jmol/src/org/jmol/smiles/SmilesParser.java    2015-09-09 11:50:30 UTC 
(rev 20766)
+++ trunk/Jmol/src/org/jmol/smiles/SmilesParser.java    2015-09-09 12:52:37 UTC 
(rev 20767)
@@ -1305,6 +1305,7 @@
       break;
     case '"':
     case '%':
+    case '/':
       ch2 = ch;
       break;
     case '(':

Modified: trunk/Jmol/src/org/jmol/smiles/SmilesStereo.java
===================================================================
--- trunk/Jmol/src/org/jmol/smiles/SmilesStereo.java    2015-09-09 11:50:30 UTC 
(rev 20766)
+++ trunk/Jmol/src/org/jmol/smiles/SmilesStereo.java    2015-09-09 12:52:37 UTC 
(rev 20767)
@@ -205,7 +205,9 @@
         sAtom.stereo = null;
       break;
     case STEREOCHEMISTRY_POLYHEDRAL:
-      if (nBonds != atomCount)
+      // we allow no bonds here, indicating that the next N atoms are 
associated (but not connected)
+      // with this atom
+      if (nBonds != 0 && nBonds != atomCount)
         sAtom.stereo = null;
       break;
     case STEREOCHEMISTRY_ALLENE:
@@ -473,8 +475,8 @@
       case STEREOCHEMISTRY_POLYHEDRAL:
         if (sAtom.stereo.isNot)
           isNot = !isNot;
-        if (nH > 1)
-          continue; // no chirality for [CH2@]
+        if (nH > 1 || sAtom.bondCount == 0)
+          continue; // no chirality for [CH2@]; skip if just an indicator
         if (isSmilesFind) {
           // TODO
           continue;
@@ -842,11 +844,14 @@
             int n = Integer.parseInt(pattern.substring(index, pt));
             if (isPoly) {
               atomCount = n;
-              // we may have more to get? Distance?
               if (pt < len && pattern.charAt(pt) == '(') {
                 details = SmilesParser.getSubPattern(pattern, pt, '(');
                 pt += details.length() + 2;
               }
+              if (pt < len && pattern.charAt(pt) == '/') {
+                directives = SmilesParser.getSubPattern(pattern, pt, '/');
+                pt += directives.length() + 2;
+              }
             } else {
               order = n;
             }

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-09-09 11:50:30 UTC 
(rev 20766)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-09-09 12:52:37 UTC 
(rev 20767)
@@ -58,8 +58,28 @@
 
 TODO: image off  stops JSmol
 
-Jmol.___JmolVersion="14.3.16_2015.09.08"
+TODO: Although isolated polyhedra are working in SMARTS searching, 
+      for a SMILES representation, it will be important to allow a given atom 
+      to be in more than one polyhedron (edge- or face-connected polyhedra). 
+      But then that will require to references to the same atom. The solution
+      is probabably something like [(3)], indicating that this atom is equated 
with 
+      another in the SMILES string:
+      
+      [Fe][O(1)].[Fe][O(1)]
+      
+      then bond references to that oxygen from some other source would be to 
both?
+      
+        ....C(2) ....C(4) ???   
+      
+Jmol.___JmolVersion="14.3.16_2015.09.09"
 
+code: javajs.util reconciled with swingjs project
+
+bug fix: polyhedra.stereoSmiles --> polyhedra.polySmiles; central atom added in
+
+
+JmolVersion="14.3.16_2015.09.08"
+
 code: Efficient JSON parser javajs.util.JSONParser
 
 JmolVersion="14.3.16_2015.09.06"
@@ -190,7 +210,7 @@
 bug fix: plot property  with nothing more throws Exception
 bug fix: Gaussian Dialog does not add final line ending when saving
 
-new feature: Jmol SMILES/SMARTS generic stereoSMILES polyhedron option 
@PHn(....)
+new feature: Jmol SMILES/SMARTS generic polySMILES polyhedron option @PHn(....)
  -- totally generic; will work with any number of connected atoms
  -- suitable replacement for all TP, OH, etc. 
  -- standard equivalence to [C@] is [C@PH4(234)]
@@ -244,7 +264,7 @@
                $ calculate symmetry polyhedra 
                C1 #1 Td
                
-               $ print @1.polyhedra.stereoSmiles
+               $ print @1.polyhedra.polySmiles
                //* C1 #1 *//   [C@PH4].
                //* H5 #5 *//   [H]123.
                //* H2 #2 *//   [H]245.
@@ -262,7 +282,7 @@
                color chlorine blue
                polyhedra 4 bonds distancefactor 3.0
                calculate symmetry polyhedra
-               print @1.polyhedra.stereoSmiles
+               print @1.polyhedra.polySmiles
 
                C1 #1 C1
                
@@ -274,7 +294,7 @@
                $ invertselected
                $ polyhedra 4 bonds distancefactor 3.0
                calculate symmetry polyhedra
-               print @1.polyhedra.stereoSmiles
+               print @1.polyhedra.polySmiles
                
                C1 #1 C1
                

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


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to