On 2014-05-07 17:26, [email protected] wrote:
*Gesendet:* Mittwoch, 07. Mai 2014 um 15:56 Uhr
*Von:* [email protected]
*An:* [email protected]
*Betreff:* how can I test if a molecule already has 2D coordinates?
for a given molecule, how can I test if it already has 2D coordinates?
I would like to calculate these coordinates only for molecules that do
not yet have them.
Many thanks in advance.
Kind regards,
Axel
I think I found a way: if I call
mol.GetConformer()
I get a ValueError, if no 2D coordinates are present. This error I can
catch.
Kind regards,
Axel
Hi Axel,
And even more straightforward: mol.GetNumConformers().
>>> from rdkit import Chem
>>> from rdkit.Chem import AllChem
>>> mol = Chem.MolFromSmiles('CCF')
>>> mol.GetNumConformers()
0
>>> AllChem.Compute2DCoords(mol)
0
>>> mol.GetNumConformers()
1
>>>
Cheers
-- Jan
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss