Previously, we have provided a Python script (vs_analysis.py) to analyze the virtual screening (VS) results of Autodock Vina. Now, we have updated this script to sort binding affinities based on user inputted cutoff value.
As explained in the previous article, users can easily get the binding affinities of top poses of a desired number of compounds after VS using Vina. This updated script also allows sorting log files based on a binding affinity cutoff provided by the user.
This is an interactive Python script, so users can choose whether they want to sort on the basis of a binding affinity threshold or just get the desired number of compounds having the lowest binding affinities.
Download the file from our GitHub and Bitbucket accounts (details are given in the following section) and save it in the directory where you have kept all log files. If you will save it elsewhere, don’t forget to provide the full path to this file. It will run on Linux as well as on Windows.
Run it using Python 3.x.
$ python3 vs_analysis.py
OR if Python 3.x is in your path then just type the following:
$ python vs_analysis.py
If you have chosen to sort on the basis of a cutoff value, then the output will be provided in an output file named ‘ba_output.txt’. Otherwise, the output will be in a file named ‘output.txt’. These files will be consisting of the filename and the corresponding binding affinity in front.
Example (with a threshold):
You have the same number of log files in your directory and you want to fetch the results/poses sorted with the lowest binding affinities based on a threshold. Then run the above command and while prompted, type ‘y’ or ‘yes’ and then enter a cutoff value, for instance, enter -9. It will provide the compounds having binding affinity higher than -9 in the ‘ba_output.txt’ file.
To sort without a cutoff value, read this article.
The script is freely available to download from our GitHub account.
- This script screens for the log files containing the word ‘log’ in their filenames, e.g., “log_compound1.txt” or “log_methanol.txt”
- It is recommended to name your log files along with the name of a compound. That would make the results more presentable and easy to understand. For example, you can name them as “log_naphthalene.txt” or so.