Anyone? I could really need some help on this..
Thanks,
Martin
On Fri, Sep 2, 2011 at 12:12 PM, Martin Guetlein <
[email protected]> wrote:
> 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]
>
--
Dipl-Inf. Martin Gütlein
Phone:
+49 (0)761 203 7633 (office)
+49 (0)177 623 9499 (mobile)
Email:
[email protected]
------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops? How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user