MolecularAI / aizynthfinder

A tool for retrosynthetic planning
https://molecularai.github.io/aizynthfinder/
MIT License
562 stars 128 forks source link

create stock: Failed to convert to inchi key. Probably due to sanitation. #136

Closed hongxianglics closed 10 months ago

hongxianglics commented 10 months ago

Hi,

I am trying to ues the command line to create stock file smiles2stock --files molecules.txt --output stock.hdf5 the molecules.txt only contains a single SMILES CCC then I got this output Processing molecules.txt Failed to convert to inchi key. Probably due to sanitation. Created HDF5 stock with 1 unique compounds I do got the hdf5file generated, and I am just wondering if the fail to generate inchi key affaect loading this stock molecule? if so, how can I make it right?

Many thanks!

hongxianglics commented 10 months ago

I tried to use the rdkit to do sanitize as follows

from rdkit import Chem m = Chem.MolFromSmiles('CCC') Chem.SanitizeMol(m) Chem.MolToSmiles(m)

but I just got the same output CCC

SGenheden commented 10 months ago

Hello Did you happen to insert a column header in your molecules.txt file? If so, that is probably causing the error message you see about the non-sanitizable compound

hongxianglics commented 10 months ago

Got it! That's true! Thanks!