Skip to content

Commit

Permalink
Critical Patch: stereochemistry must be assigned after molecule has b…
Browse files Browse the repository at this point in the history
…een flipped! Otherwise it may be wrong.
  • Loading branch information
johnmay committed Jun 7, 2016
1 parent e3c401d commit 308c34e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,16 @@ private void generateCoordinates(Vector2d firstBondVector, boolean isConnected,
layoutCyclicParts();
}

if (!isSubLayout)
assignStereochem(molecule);
// display reasonable error on failed layout, otherwise we'll have a NPE somewhere
if (iter == numAtoms && !AtomPlacer.allPlaced(molecule))
throw new CDKException("Could not generate layout? If a set of 'fixed' atoms were provided"
+ " try removing these and regenerating the layout.");

refinePlacement(molecule);
finalizeLayout(molecule);

if (!isSubLayout)
assignStereochem(molecule);
}

/**
Expand Down

0 comments on commit 308c34e

Please sign in to comment.