PatWalters / rd_filters

A script to run structural alerts using the RDKit and ChEMBL
MIT License
128 stars 36 forks source link

fix RDFilters.evaluate return value when smiles conversion fails #12

Closed JohnRyanAudio closed 3 years ago

JohnRyanAudio commented 3 years ago

RDFilters.evalute returns two different lists depending on whether or not the call to Chem.MolFromSmiles was successful. A successful call will eventually result in returning a list with nine values, as defined in the assignment to desc_list, while a failed call would result in returning a list with eight "placeholder" values. This mismatch of list length would then result in an error during creation of a Pandas dataframe using the return value with a columns list having a length of nine.

This fix adds a ninth value to the list returned in the case of a failing call to Chem.MolFromSmiles, preventing the error in Pandas DataFrame creation.