Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Giovanni Tricarico
! Giovanni From: Ivan Tubert-Brohman Sent: 14 April 2022 12:58 To: Giovanni Tricarico Cc: rdkit-discuss@lists.sourceforge.net Subject: Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None? You don't often get email from ivan.tubert-broh...@schrodinger.com

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Andrew Dalke
On Apr 14, 2022, at 12:57, Ivan Tubert-Brohman wrote: > How about splitting the file on lines consisting of "", and then parsing > each record? If the parsing fails, you can write out the bad record for > future inspection. (This addresses the basic use case, but not the "even > better"

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Ivan Tubert-Brohman
How about splitting the file on lines consisting of "", and then parsing each record? If the parsing fails, you can write out the bad record for future inspection. (This addresses the basic use case, but not the "even better" one.) Here's a proof of concept: from rdkit import Chem def

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Andrew Dalke
On Apr 14, 2022, at 09:16, Gyro Funch wrote: > I don't know the sdf format well, so please excuse my ignorance, but instead > of a custom parser, would it be possible to write a preprocessor to eliminate > the offending information? Perhaps something using regular expressions in > python,

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Gyro Funch
will then have to read them in another application for inspection. Thanks Giovanni -Original Message- From: Nils Weskamp Sent: 13 April 2022 22:55 To: Giovanni Tricarico ; rdkit-discuss@lists.sourceforge.net Subject: Re: [Rdkit-discuss] how to report SDF records for which

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-14 Thread Giovanni Tricarico
for inspection. Thanks Giovanni -Original Message- From: Nils Weskamp Sent: 13 April 2022 22:55 To: Giovanni Tricarico ; rdkit-discuss@lists.sourceforge.net Subject: Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None? [You don't often get

Re: [Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-13 Thread Nils Weskamp
Hello Giovanni, have you tried using the ForwardSDMolSupplier with sanitize = False and / or strictParsing = False ? This should at least reduce the number of cases where molecules are not accepted. You would then have to sanitize the structures yourself afterwards and handle possible

[Rdkit-discuss] how to report SDF records for which Chem.ForwardSDMolSupplier returns None?

2022-04-13 Thread Giovanni Tricarico
Hello, I am using rdkit to read data from SD files. My goal is to extract both the molecules and their associated properties (which for our purposes are separate entities) from the SDF. [For 100% clarity: by 'properties' I don't mean calculated properties or atom or bond properties, but the