Hi Christoph,
We don't currently have a SMARTS writer but if you want to write aromatic
SMILES you just need to tell the generator. It takes exactly what you put
it, so I can set the arom flags myself on a substrcture and then create the
SMILES:
> * IAtomContainer mol = new AtomContainer();*
> * IAtom a1 = new Atom("C");*
> * a1.setImplicitHydrogenCount(0);*
> * a1.setIsAromatic(true);*
> * IAtom a2 = new Atom("O");*
> * a2.setImplicitHydrogenCount(0);*
> * a2.setIsAromatic(true);*
> * IAtom a3 = new Atom("C");*
> * a3.setImplicitHydrogenCount(0);*
> * a3.setIsAromatic(true);*
> * IBond b1 = new Bond(a1, a2);*
> * b1.setIsAromatic(true);*
> * IBond b2 = new Bond(a2, a3);*
> * b2.setIsAromatic(true);*
> * mol.addAtom(a1);*
> * mol.addAtom(a2);*
> * mol.addAtom(a3);*
> * mol.addBond(b1);** mol.addBond(b2);*
>
> * SmilesGenerator smigen = SmilesGenerator.generic()*
> * .aromatic();**
> String smi = smigen.create(mol);*
[c]o[c]
Note you have to watch out for hydrogens! *[nH]1ccc2c1cccc2 *is indole but
as a SMARTS won't match Cn1ccc2c1cccc2.
Thanks,
John
Regards,
John W May
john.wilkinson...@gmail.com
On 9 February 2016 at 08:42, cruttkie <crutt...@ipb-halle.de> wrote:
> Hi,
>
> I am using CDK to find substructures within an AtomContainer and write
> them out as SMILES. The problem I have with this workflow is related to
> the loss of aromaticity information when writing those substructure
> SMILES in case the substructure has matched within an aromatic ring for
> example.
>
> Is there a way to write out SMARTS instead of SMILES? If not, do you
> think it is a nice idea to adapt the SmilesGenerator to write out SMARTS
> including aromaticity information?
>
> Best regards,
> Christoph
>
> --
>
> Christoph Ruttkies
> Group Bioinformatics & Mass Spectrometry
> Leibniz Institute of Plant Biochemistry
> Weinberg 3
> 06120 Halle, Germany
>
> email: crutt...@ipb-halle.de
> phone: +49-345-5582-1471
> fax: +49-345-5582-1409
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> Cdk-user mailing list
> Cdk-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user