Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
All tests pass in the CIP module but the CIPTool needs updating to ha…
…ndle the implicit hydrogen / lone pair scheme. For the meantime we have a sanity check incase such a case is attempted.

Change-Id: Ia4fc8cfca0fca122b039356ab761af3cd425eb26
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Sep 29, 2013
1 parent a9f35c6 commit f30223d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/org/openscience/cdk/geometry/cip/CIPTool.java
Expand Up @@ -107,6 +107,14 @@ public static CIP_CHIRALITY getCIPChirality(LigancyFourChirality stereoCenter) {
@TestMethod("testGetCIPChirality_ILigancyFourChirality,testGetCIPChirality_Anti_ILigancyFourChirality")
public static CIP_CHIRALITY getCIPChirality(
IAtomContainer container, ITetrahedralChirality stereoCenter) {

// TODO allow implicit hydrogen / lone pair
for (IAtom atom : stereoCenter.getLigands()) {
if (atom.equals(stereoCenter.getChiralAtom()))
throw new UnsupportedOperationException("Tetrahedral centre has an implicit hydrogen or lone pair" +
" - CIPTool does not yet support for this.");
}

LigancyFourChirality cipLigancy = new LigancyFourChirality(container, stereoCenter);
ILigand[] ligands = order(cipLigancy.getLigands());
LigancyFourChirality rsChirality = cipLigancy.project(ligands);
Expand Down

0 comments on commit f30223d

Please sign in to comment.