Hello RDKit gurus,

 

I've found an interesting issue with V2000 SDF files which have a carbon marked 
as "Either or unmarked stereocentre", a 3 in the atom-block.

 

The enclosed molecule throws these errors – note also that the word “begining" 
is spelt wrong in the stderr.

 

Is there a way to “try-catch” when I run these commands, as the program crashes 
when it hits a molecule it can not pass.

suppl = Chem.SDMolSupplier(‘sdf_file.sdf’)

Chem.MolTo-whatever(suppl[x])

 

So that if a molecule fails here it can be sent to sdterr?

 

Thanks,

mike

 

Python command line:

 

****

Pre-condition Violation

bad dir

Violation occurred on line 1755 in file 
/opt/conda/conda-bld/rdkit_1561471048963/work/Code/GraphMol/Chirality.cpp

Failed Expression: dir == Bond::ENDUPRIGHT || dir == Bond::ENDDOWNRIGHT

****

 

[14:34:59] Unexpected error hit on line 317044

[14:34:59] ERROR: moving to the begining of the next molecule

Traceback (most recent call last):

  File "AllChem_prop.py", line 178, in <module>

    main()

  File "AllChem_prop.py", line 170, in main

    calc_values = calc_SDF(file_names)

  File "AllChem_prop.py", line 105, in calc_SDF

    orig = Chem.MolToSmiles(suppl[i])

Boost.Python.ArgumentError: Python argument types in

    rdkit.Chem.rdmolfiles.MolToSmiles(NoneType)

did not match C++ signature:

    MolToSmiles(RDKit::ROMol mol, bool isomericSmiles=True, bool 
kekuleSmiles=False, int rootedAtAtom=-1, bool canonical=True, bool 
allBondsExplicit=False, bool allHsExplicit=False, bool doRandom=False)

 

 

 

Jupyter-notebook

 

ArgumentError                             Traceback (most recent call last)

<ipython-input-400-56f3f05e3048> in <module>

      1 suppl = Chem.SDMolSupplier('enamine_fail_3.sdf')

----> 2 Chem.MolToSmiles(suppl[0],kekuleSmiles=True)

      3 Chem.rdDepictor.Compute2DCoords(suppl[0])

      4 Draw.MolToImage(suppl[0], size=(300, 300))

 

ArgumentError: Python argument types in

    rdkit.Chem.rdmolfiles.MolToSmiles(NoneType)

did not match C++ signature:

    MolToSmiles(RDKit::ROMol mol, bool isomericSmiles=True, bool 
kekuleSmiles=False, int rootedAtAtom=-1, bool canonical=True, bool 
allBondsExplicit=False, bool allHsExplicit=False, bool doRandom=False)

 

 

 

 

 

Dr Mike Mazanetz, FRSC

Director

 

Honorary Lecturer

School of Natural and Computing Sciences

University of Aberdeen

 

+44 (0) 141 533 0930

+44 (0) 7780 672509

mi...@novadatasolutions.co.uk

www.novadatasolutions.co.uk

skype michael.mazanetz

 

NovaData Solutions Ltd.

PO Box 639

Abingdon-on-Thames

Oxfordshire

OX14 9JD

United Kingdom

 

Attachment: enamine_fail_3.sdf
Description: chemical/mdl-sdfile

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to