Hello Dave,

Thanks! I use the version 2022.03.05 but you are of course right, I had 
attached the wrong mol-file. Sorry for that. But now two files where it 
actually does not work.

Best Rüdiger

Von: David Cosgrove <davidacosgrov...@gmail.com>
Gesendet: Samstag, 3. September 2022 09:12
An: Rüdiger Lang <r.l...@abcr.com>
Cc: rdkit-discuss@lists.sourceforge.net
Betreff: Re: [Rdkit-discuss] Draw.MolToFile catch programm termination

Hi Rüdiger,
That file works fine for me using 2022.03.5.  What version are you using?

Also, I note that your script reads 191131.mol, but the one you have provided 
is 191133.mol.  Can you check that this is the file that is causing the problem.

Dave


On Fri, Sep 2, 2022 at 1:40 PM Rüdiger Lang 
<r.l...@abcr.com<mailto:r.l...@abcr.com>> wrote:
Hello everybody,

I am trying to convert a large amount of mol files to png. Some mol files cause 
the following error with "Draw.MolToFile":

<<
Could not convert io integer: 3221225477. Path 'exitCode'.
Der Wert für einen Int32 war zu groß oder klein.
(The value for an Int32 was too large or small.)
>>

I would like to catch this error to simply omit these files but despite "try" 
the program exits with the above error.
I have attached a problematic mol-file as an example.
The program code looks like this:

from rdkit import Chem
from rdkit.Chem import Draw
from try_parse.utils import ParseUtils

Testmol = Chem.MolFromMolFile('C:\\Struct\\191131.mol')

try:
   print('now we test: ')
   Draw.MolToFile(Testmol,'C:\\Struct\\Test191131.png')
   # i also tried this:
   
#test=ParseUtils.try_parse_int(Draw.MolToFile(Testmol,'C:\\Struct\\Test191131.png'))
   #print(test)
except:
    print('I never reach this except but the programm stopps')

Many thanks!

Rüdiger Lang



Freundliche Grüße / Kind regards

Rüdiger Lang
Data Analyst

abcr GmbH
Im Schlehert 10
76187 Karlsruhe
Germany

r.l...@abcr.com<mailto:r.l...@abcr.com>





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


--
David Cosgrove
Freelance computational chemistry and chemoinformatics developer
http://cozchemix.co.uk

Attachment: 191131.mol
Description: 191131.mol

Attachment: 168571.mol
Description: 168571.mol

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

Reply via email to