Revision: 21491 http://sourceforge.net/p/jmol/code/21491 Author: hansonr Date: 2017-04-07 02:55:42 +0000 (Fri, 07 Apr 2017) Log Message: -----------
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-07 00:38:50 UTC (rev 21490) +++ trunk/Jmol/src/org/jmol/symmetry/CIPChirality.java 2017-04-07 02:55:42 UTC (rev 21491) @@ -14,6 +14,31 @@ /** * A relatively simple implementation of Cohen-Ingold-Prelog rules for assigning R/S chirality * + * [1] getChirality(Node) + * new CIPAtom(Node) + * set() + * return getRorS(); + * + * [2] CIPAtom.getRorS() + * sortSubstituents() + * return f(SmilesMatcher().getChirality()) + * + * + * [3] sortSubstituents() + * if (necessary) + * breakTie(a,b) + * + * [4] breakTie(a,b) + * a.set(), b.set() + * for each substituent... + * compareAB(a.atoms[i], b.atoms[i]) + * if (all are tied) ... + * sortSubstituents(a.atoms) + * sortSubstituents(b.atoms) + * for each substituent... + * breakTie(a.atoms[i], b.atoms[i]) + * + * * Introduced in Jmol 14.12.0 * * @author Bob Hanson hans...@stolaf.edu @@ -79,14 +104,15 @@ if (atom.getCovalentBondCount() != 4) return ""; CIPAtom a = new CIPAtom(atom, null, false); - - String rs = (a.set() ? getRorS(a) : ""); + if (!a.set()) + return ""; + String rs = getRorS(a); if (Logger.debugging) Logger.info(atom + " " + rs); return rs; } - public String getRorS(CIPAtom a) { + private String getRorS(CIPAtom a) { try { CIPAtom[] atoms = sortSubstituents(a.atoms, false); if (atoms == null) 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