We previously provided a Python script to calculate the Tanimoto similarities of multiple compounds against each other. In this article, we are providing another Python script to calculate the Tanimoto similarities of one compound with multiple compounds.
The script tanimoto_similarities_one_vs_all.py is a part of our tanimoto_similarities Python package. The similarities are calculated using RDKit [1]. This script takes multiple compounds as input in the form of sdf format. All the compounds in sdf format are merged together in a single file (here, lig.sdf). The query compound is provided in the form of SMILES.
Availability
The script is available on GitHub under the package ‘tanimoto_similarities‘.
Usage
keep the input sdf file in the same directory or provide a full path to the file in the script. Run the script as shown below:
$ python3 tanimoto_similarities_one_vs_all.py
It will create a new file named ‘sims_vs_all.txt’. This file will contain all calculated similarities.
Note: If you still get an error stating “rdkit not found”, then perhaps you have not activated the rdkit environment. Run the conda activate my-rdkit-env
command again and then run the script.
References
- Landrum, G. (2013). Rdkit documentation. Release, 1 (1-79), 4.