Adrian,
I meet a weird case.
>>> import matplotlib.offsetbox
>>> from rdkit import Chem
>>> from rdkit.Chem import AllChem
>>> from rdkit.Chem import Draw
>>> m = Chem.MolFromSmiles('ccc[nH]c')
I got
non-ring atom 0 marked aromatic
>>> AllChem.Compute2DCoords(m)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
rdkit.Chem.rdDepictor.Compute2DCoords(NoneType)
did not match C++ signature:
Compute2DCoords(RDKit::ROMol {lvalue} mol, bool canonOrient=True, bool
clearConfs=True, boost::python::dict {lvalue} coordMap={}, unsigned int
nFlipsPerSample=0, unsigned int nSample=0, int sampleSeed=0, bool
permuteDeg4Nodes=False, double bondLength=-1.0)
Actually, "ccc[nH]c" is a fragment. Could you please help me to know
whether there is a work around to this case?
Thanks.
Yingfeng
On Mon, Feb 17, 2014 at 2:58 PM, Yingfeng Wang <[email protected]> wrote:
> Adrian,
>
> Thanks, it works.
>
> Yingfeng
>
>
> On Mon, Feb 17, 2014 at 12:50 PM, Adrian Jasiński <
> [email protected]> 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 <[email protected]>:
>>
>>> 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
>>> [email protected]
>>> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss