Skip to content

Commit

Permalink
Modification to a previous patch: cis/trans correction should be done…
Browse files Browse the repository at this point in the history
… before refined by wedges should be done after.
  • Loading branch information
johnmay committed Jun 26, 2016
1 parent 9401728 commit 86af265
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,19 @@ private void generateCoordinates(Vector2d firstBondVector, boolean isConnected,
throw new CDKException("Could not generate layout? If a set of 'fixed' atoms were provided"
+ " try removing these and regenerating the layout.");

if (!isSubLayout) {
// correct double-bond stereo, this changes the layout and in reality
// should be done during the initial placement
if (molecule.stereoElements().iterator().hasNext())
CorrectGeometricConfiguration.correct(molecule);
}

refinePlacement(molecule);
finalizeLayout(molecule);

if (!isSubLayout)
assignStereochem(molecule);

}

/**
Expand Down Expand Up @@ -705,10 +713,6 @@ private void assignStereochem(IAtomContainer molecule) {
if (!molecule.stereoElements().iterator().hasNext())
return;

// correct double-bond stereo, this changes the layout and in reality
// should be done during the initial placement
CorrectGeometricConfiguration.correct(molecule);

// assign up/down labels, this doesn't not alter layout and could be
// done on-demand (e.g. when writing a MDL Molfile)
NonplanarBonds.assign(molecule);
Expand Down Expand Up @@ -950,6 +954,11 @@ private void generateFragmentCoordinates(IAtomContainer mol, List<IAtomContainer
dest.x - curr.x, dest.y - curr.y);
}

// correct double-bond stereo, this changes the layout and in reality
// should be done during the initial placement
if (molecule.stereoElements().iterator().hasNext())
CorrectGeometricConfiguration.correct(molecule);

// finalize
assignStereochem(mol);
finalizeLayout(mol);
Expand Down

0 comments on commit 86af265

Please sign in to comment.