tanimoto_similarities_one_vs_all.py – Python script to calculate Tanimoto Similarities of multiple compounds

Dr. Muniba Faiza
1 Min Read

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

  1. Landrum, G. (2013). Rdkit documentation. Release1 (1-79), 4.

Further Reading

tanimoto_similarities.py: A Python script to calculate Tanimoto similarities of multiple compounds using RDKit.

Share This Article
Dr. Muniba is a Bioinformatician based in New Delhi, India. She has completed her PhD in Bioinformatics from South China University of Technology, Guangzhou, China. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba
Leave a Comment

Leave a Reply