Hi,

I am trying to use CDK to generate structure data for SMILES codes and write it 
to a MDL file. However, I have a problem with aromatic rings.

If I write the file using the property WriteAromaticBondTypes set to true, the 
aromatic bonds are correctly stored as aromatic-type.
If I write the file with the property not set (or set to false), I get only 
single bonds instead.
Applying DeduceBondSystemTool::fixAromaticBondOrders doesn't change anything, 
apparently. In fact, DeduceBondSystemTool::isOK returns false both before and 
after the call to fixAromaticBondOrders.

My actual code is written in R with rcdk and direct calls with rJava, but for 
convenience the "java-translated" untested version of what I do:

String s = "C1(=Nc2c(Nc3c1cccc3)ccc(c2)Cl)N1CCN(CC1)C";
SmilesParser p = new SmilesParser(builder);
IMolecule m = p.parseSmiles(s);
// Here follows, in this or any other order:
CDKHueckelAromaticityDetector::detectAromaticity(m);

AtomContainerManipulator::percieveAtomTypesAndConfigureAtoms(m);

i.configureAtoms(m); // i is an IsotopeFactory

AtomContainerManipulator::convertImplicitToExplicitHydrogens(m);

StructureDiagramGenerator g = new StructureDiagramGenerator();
g.setMolecule(m);
g.generateCoordinates();
m = g.getMolecule();

DeduceBondSystemTool d = new DeduceBondSystemTool();
bool beforeOK = d.isOK(m); // false
m = d.fixAromaticBondOrder(m);
bool afterOK = d.isOK(m); // still false!!!!

// And finally le write:
// (I don't use the built-in Rcdk writing function)
MDLV2000Writer w = new MDLV2000Writer(new FileWriter("blablubfilename"));
Property aromatic = new Property();
aromatic.setProperty("WriteAromaticBondTypes", "true"); // or alternatively, 
"false"
PropertiesListener pl = new PropertiesListener(aromatic);
w.addChemObjectListener(pl);
w.customizeJob();
w.write(m);
w.close();

If WriteAromaticBondTypes is set to "true", the bonds are written with type 4 
as expected.
However, with "false", all aromatic bonds are of order 1; common double bonds 
are 2, of course.
Am I using fixAromaticBondOrder() in a wrong way? All steps above have been 
tried in various order.

Best regards
-Michael
------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to