Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inelegant exit for smiles file with no names #9

Open
MikeBowerReverie opened this issue Feb 11, 2020 · 3 comments · May be fixed by #27
Open

inelegant exit for smiles file with no names #9

MikeBowerReverie opened this issue Feb 11, 2020 · 3 comments · May be fixed by #27

Comments

@MikeBowerReverie
Copy link

using a *.smi file which contains smiles strings but no names causes an inelegant error.

benzene.smi =
c1ccccc1

rd_filters filter --in benzene.smi --prefix foo
using 8 cores
Using alerts from Inpharmatica
Wrote SMILES for molecules passing filters to foo.smi
Wrote detailed data to foo.csv
Traceback (most recent call last):
File "/Users/mikebower/anaconda3/envs/reverie_env/bin/rd_filters", line 8, in
sys.exit(main())
File "/Users/mikebower/anaconda3/envs/reverie_env/lib/python3.6/site-packages/rd_filters/rd_filters.py", line 202, in main
fraction_passed = "%.1f" % (num_output_rows / num_input_rows * 100.0)
ZeroDivisionError: division by zero

but benzene.smi =
c1ccccc1 benzene

rd_filters filter --in benzene.smi --prefix foo
using 8 cores
Using alerts from Inpharmatica
Wrote SMILES for molecules passing filters to foo.smi
Wrote detailed data to foo.csv
1 of 1 passed filters 100.0%
Elapsed time 0.31 seconds

people who have worked with your code before will know to have the compound id or name there, but others may not understand what the error comes from.

@hyoo
Copy link

hyoo commented Jul 17, 2020

I had the same issue. If the test.smi was given or error message was clear to the real source of the problem, I would find the solution a lot easier.

@UnixJunkie
Copy link
Contributor

Or, maybe, a crash-proof behavior. Such as: if a SMILES has no name, use the SMILES itself as a default name.

@PatWalters
Copy link
Owner

Good idea, I'll make this change

@dmyersturnbull dmyersturnbull linked a pull request Jul 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants