Skip to content

inelegant exit for smiles file with no names #9

@MikeBowerReverie

Description

@MikeBowerReverie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions