Dear Christian,

Please send RDKit questions to the mailing list, not directly to me.

2010/6/30 Christian de BouillĂ© <[email protected]>:
>
> From our web server with 11 million chemicals
> basically unique, I would like to have
> the 3D to compute some descriptors
>
> I do not need to compute each structure
>
> You recommand to use Chem.CanonSmiles
> but it would be fine to include a boolean function
> as for Chem.MolFromSmiles to raise the error

I think what you are asking is how to find out if processing a
molecule failed. Is that correct?

The answer to that question is that Chem.MolFromSmiles() return None,
so you can test like this:

In [2]: from rdkit import Chem
In [3]: m = Chem.MolFromSmiles('c1ccccc1')
In [4]: m is None
Out[4]: False
In [5]: m = Chem.MolFromSmiles('c1cccc1')
[20:58:28] Can't kekulize mol
In [6]: m is None
Out[6]: True

If you are using Supplier (either an SDMolSupplier or a
SmilesMolSupplier), you can just do:

for mol in supplier:
    if mol is None: continue
    # do whatever else you want to do with the molecule here.

Best Regards,
-greg

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to