John,
I need some insight here... Consider the following code (which runs fine):
parser = new SmilesParser(SilentChemObjectBuilder.newInstance())
mol = parser.parseSmiles("[F]C([F])([F])[H]")
builder3d = ModelBuilder3D.getInstance(mol.getBuilder());
However, when I change the SMILES to replace all fluorides with hydrogens, it throws an Exception... the "mol" does have 5 atoms... and atom type perception and setting does not help either...
Do you have any clue why the hydrogens can mess up the 3D coordinate generation (it worked fine in 1.4 and I think in 1.5.7 too...
This may not be a bug, but I just spent half an hour trying to figure out what goes wrong, but no luck yet...
I think model builder want something will all explicit hydrogens. But it
should give a better warning message.
Oh right I see....
[H]C([H])([H])[H]
Okay found the bug.
C([H])([H])([H])[H]
Your example would not have worked before :-).
See here:
https://github.com/egonw/cdk/blob/772d55af778fc05407233680d414ca8a68793d23/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L182
Having one heavy atom does not mean that atom is in position 0. A work
around is to remove and then re-add hydrogens (they are added at the end).
J
Last edit: John May 2015-02-19
Needs fixing of course but the workaround was if you needed this ASAP.
No rush!