Revision: 21558
          http://sourceforge.net/p/jmol/code/21558
Author:   hansonr
Date:     2017-04-27 04:34:08 +0000 (Thu, 27 Apr 2017)
Log Message:
-----------
CIP validates for Rules 1-5 for 86 compounds -- 763 lines

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/symmetry/CIPChirality.java

Modified: trunk/Jmol/src/org/jmol/symmetry/CIPChirality.java
===================================================================
--- trunk/Jmol/src/org/jmol/symmetry/CIPChirality.java  2017-04-27 04:06:58 UTC 
(rev 21557)
+++ trunk/Jmol/src/org/jmol/symmetry/CIPChirality.java  2017-04-27 04:34:08 UTC 
(rev 21558)
@@ -641,7 +641,6 @@
               break;
             }
           }
-
           if (currentRule == 5)
             cipAtom.isPseudo = true;
         }
@@ -648,9 +647,9 @@
         if (isChiral) {
           rs = (!isAlkene ? cipAtom.checkHandedness()
               : cipAtom.atoms[0].isDuplicate ? STEREO_S : STEREO_R);
+          if (cipAtom.isPseudo && !isAlkene)
+            rs = rs | JC.CIP_CHIRALITY_PSEUDO_FLAG;
         }
-        if (cipAtom.isPseudo && !isAlkene)
-          rs = rs | JC.CIP_CHIRALITY_PSEUDO_FLAG;
         if (Logger.debugging)
           Logger.info(atom + " " + rs);
         if (Logger.debugging)
@@ -2130,21 +2129,11 @@
      * @return 0 (TIED), -1 (A_WINS), or 1 (B_WINS)
      */
     private int checkRule5(CIPAtom b) {
-      // TODO
-      System.out.println("Rule 5 for " + this + " vs. " + b);
+      if (isTerminal || isDuplicate)
+        return TIED;
       int isRa = ";srSR;".indexOf(getWorkingChirality());
       int isRb = ";srSR;".indexOf(b.getWorkingChirality());
-      if (isRa != isRb) 
-          return   (isRa > isRb ? A_WINS : B_WINS);
-      if (rule4List == null || b.rule4List == null)
-        return TIED;
-      for (int  i = 0; i < 4; i++)
-        if (rule4List[i] != null) {
-          System.out.println(PT.toJSON(this + ".rule4List",  rule4List));
-          System.out.println(PT.toJSON(b + ".rule4List",  b.rule4List));
-          break;
-        }
-      return TIED;
+      return (isRa == isRb ? TIED : isRa > isRb ? A_WINS : B_WINS);
     }
 
     /**

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to