Skip to content

Commit

Permalink
Added control 'isref' creating a CML with reaction and listmolecules
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Rojas Cherto authored and egonw committed Feb 27, 2010
1 parent 5944d6a commit d9d20c2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/main/org/openscience/cdk/libio/cml/Convertor.java
Expand Up @@ -511,17 +511,19 @@ private CMLMolecule cdkAtomContainerToCMLMolecule(IAtomContainer structure, bool
ident.setCMLValue(structure.getProperty(CDKConstants.INCHI).toString());
cmlMolecule.appendChild(ident);
}
for (int i = 0; i < structure.getAtomCount(); i++) {
IAtom cdkAtom = structure.getAtom(i);
CMLAtom cmlAtom = cdkAtomToCMLAtom(structure, cdkAtom);
if (structure.getConnectedSingleElectronsCount(cdkAtom) > 0) {
cmlAtom.setSpinMultiplicity(structure.getConnectedSingleElectronsCount(cdkAtom) + 1);
}
cmlMolecule.addAtom(cmlAtom);
}
for (int i = 0; i < structure.getBondCount(); i++) {
CMLBond cmlBond = cdkBondToCMLBond(structure.getBond(i));
cmlMolecule.addBond(cmlBond);
if(!isRef){
for (int i = 0; i < structure.getAtomCount(); i++) {
IAtom cdkAtom = structure.getAtom(i);
CMLAtom cmlAtom = cdkAtomToCMLAtom(structure, cdkAtom);
if (structure.getConnectedSingleElectronsCount(cdkAtom) > 0) {
cmlAtom.setSpinMultiplicity(structure.getConnectedSingleElectronsCount(cdkAtom) + 1);
}
cmlMolecule.addAtom(cmlAtom);
}
for (int i = 0; i < structure.getBondCount(); i++) {
CMLBond cmlBond = cdkBondToCMLBond(structure.getBond(i));
cmlMolecule.addBond(cmlBond);
}
}

// ok, output molecular properties, but not TITLE, INCHI, or DictRef's
Expand Down

0 comments on commit d9d20c2

Please sign in to comment.