Prepare a compound database for substructure and similarity searches.
The workflow described in this repository starts with a compound database in SMILES format. Using RDkit, fingerprints for substructure as well as similarity searches will be calculated.
- Compound database in SMILES format
- RDkit
- Numpy
- Pandas
- Scipy
- Glob (for chunked workflow)
For larger compound sets (upwards of 6 M compounds), this workflow might fail due to insufficient memory, and the use of a proper database, such as the RDkit database cartridge, is recommended. I haven't had the opportunity to play with the cartridge yet, so as a workaround, calculation of Morgan Fingerprints can be performed in chunks.
An example file with 58 compounds is provided (58_smiles.smi).
-
Convert SMILES into RDkit
molobject:python smiles2molobj.pyDefine
smiles_name,pickle_name,failed_namein script -
Calculate Morgan Fingerprints as Bit Vectors:
python molobj2morganbv.pyDefine
pickle_in,bv_pickle_out,radiusin script -
Convert Morgan FP Bit Vectors into Scipy Sparse Matrices:
bv2csr.pyDefine
filein script
-
Convert SMILES into RDkit
molobject:python smiles2molobj.pyDefine
smiles_name,pickle_name,failed_namein script -
Calculate Morgan Fingerprints as Bit Vectors:
python molobj2morganbv.pyDefine
pickle_in,bv_pickle_out,radiusin script -
Split the Morgan bv pickle into chunks:
python splitmorganbv.pyDefine
bv_pickle_in,n_chunksin script -
Convert Morgan FP Bit Vectors into Scipy Sparse Matrices:
python bv2csr_chunks.pyDefine
path,filesin script -
Concatenate the chunks:
python concatchunks.pyDefine
path,file,giant_picklein script
- Improve UI: move arguments from inside scripts to proper command line arguments