Hi all,
I would like to mine the MCS and print it as aromatic smarts. Unfortunately,
the aromaticity information gets lost, even though the mcs-fragment has arom
flags asigned (see code example below).
IMHO, the problem is that the smiles writer (is there a smarts writer?) has
its own armaticity detection.
Thanks for helping, regards,
Martin
Example:
output
[[
is mcs atom arom: true
is mcs atom arom: true
is mcs atom arom: true
is mcs atom arom: true
is mcs atom arom: true
mcs smiles: CCCCC
]]
code
[[
SmilesParser sp = new
SmilesParser(DefaultChemObjectBuilder.getInstance());
IAtomContainer mol1 = sp.parseSmiles("c1ccccc1NC");
IAtomContainer mol2 = sp.parseSmiles("c1cccnc1");
org.openscience.cdk.smsd.Isomorphism mcs = new
org.openscience.cdk.smsd.Isomorphism(
org.openscience.cdk.smsd.interfaces.Algorithm.DEFAULT,
true);
mcs.init(mol1, mol2, true, true);
mcs.setChemFilters(true, true, true);
mol1 = mcs.getReactantMolecule();
IMolecule mcsmolecule =
DefaultChemObjectBuilder.getInstance().newInstance(IMolecule.class, mol1);
List<IAtom> atomsToBeRemoved = new ArrayList<IAtom>();
for (IAtom atom : mcsmolecule.atoms())
{
int index = mcsmolecule.getAtomNumber(atom);
if (!mcs.getFirstMapping().containsKey(index))
atomsToBeRemoved.add(atom);
}
for (IAtom atom : atomsToBeRemoved)
mcsmolecule.removeAtomAndConnectedElectronContainers(atom);
for (int i = 0; i < mcsmolecule.getAtomCount(); i++)
System.out.println("is mcs atom aromtic: " +
mcsmolecule.getAtom(i).getFlag(CDKConstants.ISAROMATIC));
SmilesGenerator g = new SmilesGenerator();
g.setUseAromaticityFlag(true);
System.out.println("mcs smiles: " + g.createSMILES(mcsmolecule));
]]
--
Dipl-Inf. Martin Gütlein
Phone:
+49 (0)761 203 7633 (office)
+49 (0)177 623 9499 (mobile)
Email:
[email protected]
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user