diff --git a/src/main/java/gov/nih/ncats/molwitch/cdk/CdkChemicalImpl.java b/src/main/java/gov/nih/ncats/molwitch/cdk/CdkChemicalImpl.java index 7814c6e..6cfd813 100644 --- a/src/main/java/gov/nih/ncats/molwitch/cdk/CdkChemicalImpl.java +++ b/src/main/java/gov/nih/ncats/molwitch/cdk/CdkChemicalImpl.java @@ -253,7 +253,7 @@ public static void setMaxUndefinedStereoCenters(int maxUndefinedStereoCenters) { CIPTool.label(cimp.getContainer()); } else { Logger.getLogger(this.getClass().getName()).fine("This molecule is considered NOT complex"); - CIPToolMod.label(cimp.getContainer(), cimp); + CIPToolMod.label(cimp.getContainer()); } for (int i = 0; i < container.getAtomCount(); i++) { diff --git a/src/main/java/org/openscience/cdk/geometry/cip/CIPToolMod.java b/src/main/java/org/openscience/cdk/geometry/cip/CIPToolMod.java index dcd17ca..fd45e38 100644 --- a/src/main/java/org/openscience/cdk/geometry/cip/CIPToolMod.java +++ b/src/main/java/org/openscience/cdk/geometry/cip/CIPToolMod.java @@ -75,28 +75,28 @@ * the ligand ordering can go *
  * Possibility 1: both sub-ligands in right order
- *    3 vs 5 =>
- *    [2,3'] vs [6,5'] => 
- *    2 vs 6 => 2 is higher priority
+ *    3 vs 5 as follows
+ *    [2,3'] vs [6,5'] yields
+ *    2 vs 6 yields 2 is higher priority
  *    therefore 3 is higher priority (correct)
  * 
  * Possibility 2: 3 sub-ligands wrong order, 5 right order
- *    3 vs 5 =>
- *    [3',2] vs [6,5'] => 
- *    3' vs 6 => 6 is higher priority
+ *    3 vs 5 as follows
+ *    [3',2] vs [6,5'] results in
+ *    3' vs 6 yields 6 is higher priority
  *    therefore 5 is higher priority (incorrect)
  * 
  * Possibility 3: 3 sub-ligands RIGHT order, 5 wrong order
- *    3 vs 5 =>
- *    [2,3'] vs [5',6] => 
- *    2 vs 5' => 2 is higher priority
+ *    3 vs 5 as follows
+ *    [2,3'] vs [5',6] gives
+ *    2 vs 5' yields 2 is higher priority
  *    therefore 3 is higher priority (correct)
  * 
  * Possibility 4: both sub-ligands in WRONG order
- *    3 vs 5 =>
- *    [3',2] vs [5',6] => 
- *    3' vs 5' => TIE, go to next
- *    2 vs 6 => 2 is higher priority
+ *    3 vs 5 as follows:
+ *    [3',2] vs [5',6] yields
+ *    3' vs 5' gives a TIE, go to next
+ *    2 vs 6 results in 2 as higher priority
  *    therefore 3 is higher priority (correct)
  * 
*

@@ -137,7 +137,7 @@ public static void setUseNewCentres(boolean centresRule) { * * @param container structure to label */ - public static void label(IAtomContainer container, CdkChemicalImpl chemical) { + public static void label(IAtomContainer container) { //Experimental new labeller com.simolecule.centres.CdkLabeller.label(container); @@ -161,6 +161,8 @@ public static void label(IAtomContainer container, CdkChemicalImpl chemical) { * GSRS-MODIFIED: Temporary bug fix for {@link CIPTool#getCIPChirality(IAtomContainer, ITetrahedralChirality)} * * @param container structure to label + * @param stereoCenter one atom to identify + * @return type of chirality identified */ public static CIP_CHIRALITY getCIPChirality(IAtomContainer container, ITetrahedralChirality stereoCenter) { @@ -184,6 +186,8 @@ public static CIP_CHIRALITY getCIPChirality(IAtomContainer container, ITetrahedr * GSRS-MODIFIED: Temporary bug fix for {@link CIPTool#getCIPChirality(IAtomContainer, IDoubleBondStereochemistry)} * * @param container structure to label + * @param stereoCenter one atom to process + * @return which type chirality was identified */ public static CIP_CHIRALITY getCIPChirality(IAtomContainer container, IDoubleBondStereochemistry stereoCenter) { diff --git a/src/test/java/TestChiralRead.java b/src/test/java/TestChiralRead.java index b3425dd..219f410 100644 --- a/src/test/java/TestChiralRead.java +++ b/src/test/java/TestChiralRead.java @@ -1565,7 +1565,7 @@ public void testSlowChiralityFalse() throws Exception { System.out.printf("total atoms: %d bonds: %d; rings: %d\n", c1.getAtomCount(), c1.getBondCount(), ringCount); CdkChemicalImpl chem = (CdkChemicalImpl)c1.getImpl(); - CIPToolMod.label(chem.getContainer(), chem); + CIPToolMod.label(chem.getContainer()); assertTrue(chem.getAtomCount()>0); //List chiralities= chem.getTetrahedrals(); /*List listChi=c1.atoms() @@ -1795,7 +1795,7 @@ public void testSlowChiralityTrue() throws Exception { CdkChemicalImpl chem = (CdkChemicalImpl)c1.getImpl(); long before = (new Date()).getTime(); - CIPToolMod.label(chem.getContainer(), chem); + CIPToolMod.label(chem.getContainer()); long after =(new Date()).getTime(); System.out.printf("duration of 'label' call %d\n", (after-before)); assertTrue(chem.getAtomCount() >0); @@ -1900,7 +1900,7 @@ public void testSlowChiralitySmall() throws Exception { System.out.printf("total atoms: %d bonds: %d; rings: %d\n", c1.getAtomCount(), c1.getBondCount(), ringCount); CdkChemicalImpl chem = (CdkChemicalImpl)c1.getImpl(); - CIPToolMod.label(chem.getContainer(), chem); + CIPToolMod.label(chem.getContainer()); List listChi= chem.getTetrahedrals();/*c1.atoms() .filter(ca->ca.getChirality()!=Chirality.Non_Chiral) .map(ca->ca.getChirality())