Adrian,
Thanks, it works.
Yingfeng
On Mon, Feb 17, 2014 at 12:50 PM, Adrian Jasiński <jasinski.adr...@gmail.com
> wrote:
> If you read all from tutorial you will find a example:
>
> >>> suppl = Chem.SDMolSupplier('data/cdk2.sdf')>>> ms = [x for x in suppl if
> >>> x is not None]>>> for m in ms: tmp=AllChem.Compute2DCoords(m)>>> from
> >>> rdkit.Chem import Draw>>> Draw.MolToFile(ms[0],'images/cdk2_mol1.png')>>>
> >>> Draw.MolToFile(ms[1],'images/cdk2_mol2.png')
>
>
> for this example with you pasted you can just write mol to file:
>
>
> >>> from rdkit.Chem import AllChem
>
> >>> from rdkit import Chem
> >>> m = Chem.MolFromSmiles('c1nccc2n1ccc2')
>
> >>> AllChem.Compute2DCoords(m)
>
> Draw.MolToFile(m,'example.png')
>
>
>
>
>
> pozdrawiam
> Adrian Jasiński
>
>
> 2014-02-17 18:34 GMT+01:00 Yingfeng Wang <ywang...@gmail.com>:
>
>> I want to draw a 2D figure of a compound. And I follow the example given
>> at the following link,
>>
>> http://www.rdkit.org/docs/GettingStartedInPython.html
>>
>> My code is given as follows,
>>
>> >>> from rdkit.Chem import AllChem
>> >>> from rdkit import Chem
>> >>> m = Chem.MolFromSmiles('c1nccc2n1ccc2')
>> >>> AllChem.Compute2DCoords(m)
>> 0
>> >>> template = Chem.MolFromSmiles('c1nccc2n1ccc2')
>> >>> AllChem.Compute2DCoords(template)
>> 0
>> >>> AllChem.GenerateDepictionMatching2DStructure(m,template)
>> >>>
>>
>>
>> However, I got nothing. I am wondering what the correct way is to
>> generate the 2D figure of "c1nccc2n1ccc2". Thanks.
>>
>> Yingfeng
>>
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Rdkit-discuss mailing list
>> Rdkit-discuss@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>>
>>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss