Re: [Rdkit-discuss] Catching errors in SMILES files

2019-06-06 Thread Greg Landrum
For what it's worth, I think I fixed this (and cleared up some other problems) in this PR: https://github.com/rdkit/rdkit/pull/2482 On Tue, Jun 4, 2019 at 1:44 PM Paolo Tosco wrote: > Hi David, > > I think I already have a fix for this bug, I'll submit a PR later. If you > can create a ?GitHub

Re: [Rdkit-discuss] Catching errors in SMILES files

2019-06-04 Thread Paolo Tosco
Hi David, I think I already have a fix for this bug, I'll submit a PR later. If you can create a ?GitHub issue it would be great so I can link my PR to the bug. Thanks, cheers p. On 06/04/19 12:10, David Cosgrove wrote: Hi Paolo, Many thanks for the speedy reply.  I'll do as you suggest

Re: [Rdkit-discuss] Catching errors in SMILES files

2019-06-04 Thread David Cosgrove
Hi Paolo, Many thanks for the speedy reply. I'll do as you suggest for now. Do you want me to file an issue on github, or even, maybe, see if I can fix it myself? Cheers, Dave On Mon, Jun 3, 2019 at 5:32 PM Paolo Tosco wrote: > Hi David, > > a workaround could be adding a final check after

Re: [Rdkit-discuss] Catching errors in SMILES files

2019-06-03 Thread Paolo Tosco
Hi David, a workaround could be adding a final check after the for loop: #!/usr/bin/env python from rdkit import Chem suppl1 = Chem.SmilesMolSupplier('test1.smi', titleLine=False, nameColumn=1) rec_num = 0 print("len(suppl1) = {0:d}".format(len(suppl1))) for mol in suppl1:     rec_num += 1    

[Rdkit-discuss] Catching errors in SMILES files

2019-06-03 Thread David Cosgrove
Hi, I'm trying to catch the line numbers of lines in a SMILES file that aren't parsed by the SmilesMolSupplier. Example code is attached, along with 2 SMILES files. When there is a bad SMILES string on the last line, the error is not reported, as in test2.smi. I've tried iterating through the