Dear Manuel, if you open the mol file in a text editor, there are clearly 31 C atoms in the file. So the CDK is “right”. I also opened the file in Marvin Sketch and it output the analysis below.
ChemDraw uses a fishy trick, as it seems, to create the illusion of a multi-center attachment. Clearly, they focus on publication-ready drawing of chemical structures and not one creating correct file representations of the chemistry. Fact is that the end of the line to the center of the benzene ring is a carbon atom and nothing else. Kind regards, Chris — Prof. Dr. Christoph Steinbeck Analytical Chemistry - Cheminformatics and Chemometrics Friedrich-Schiller-University Jena, Germany Phone Secretariat: +49-3641-948171 http://cheminf.uni-jena.de http://orcid.org/0000-0001-6966-0814 What is man but that lofty spirit - that sense of enterprise. ... Kirk, "I, Mudd," stardate 4513.3..
> On 2. Dec 2020, at 14:38, Stesycki, Manuel <[email protected]> > wrote: > > Dear CDK users, > > we are using CDK version 2.3 in our application. > As a user tried to add a structure (see attachment) we found a difference in > the molecular formula of the structure. > > The original structure was draw with ChemDraw 18. > A multi-center attachment was added to the structure and ChemDraw shows this > molecular formula: C30H46Cl2PRu > > Whereas our application takes the mol-version of the cdx-file and computes > this formula: C31H49Cl2PRu > To get the formula we use this piece of code: > > IMolecularFormula form = MolecularFormulaManipulator.getMolecularFormula(mol); > sumFormula = MolecularFormulaManipulator.getString(form); > > Did we missed something by creating the AtomContainer? > We create the atomcontainer directly by parsing the mol-file: > try (StringReader sr = new StringReader(molFile); MDLV2000Reader mr = new > MDLV2000Reader(sr, mode)) { > > AtomContainer mol = new AtomContainer(); > AtomContainer ac = mr.read(mol); > } > > Maybe someone can give us a hint, what we are doing wrong. > > Best regards, > Manuel Stesycki > > IT > 0208 / 306-2146 > Physikbau, Büro 117 > [email protected] > > Max-Planck-Institut für Kohlenforschung > Kaiser-Wilhelm-Platz 1 > D-45470 Mülheim an der Ruhr > http://www.kofo.mpg.de/de >
structure.cdx
Description: chemical/cdx
structure.mol
Description: MOL mdl chemical test
> _______________________________________________ > Cdk-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cdk-user
_______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

