Open rwxayheee opened 1 month ago
I had the same error on Colab and on conda env (Ubuntu PC). On my PC, I ran these commands
conda create -n vina conda activate vina conda config --env --add channels conda-forge conda install -c conda-forge numpy swig boost-cpp sphinx sphinx_rtd_theme pip install vina
the long msg error is attached vina_error.txt
Hi @Jameel9
Thanks for reporting this. conda install vina
works for me. Please see this example Colab notebook from me ^^
https://colab.research.google.com/drive/1527GlrL-AHn4irrg19129PH4YvvabqNW?usp=sharing
I'm not sure why pip kept failing.. but we have had multiple reports on different platforms and we should look into that in the near future
pip
thank you!
Hi all,
I would be deeply grateful to receive help for this code issue (not vina itself). I have been trying to run virtual screening using the following code, but I couldn't capture the output for each molecule into a .log file.
import os
import glob
from vina import Vina
import gc
Directory = "/home/shirehorse/Desktop/VS"
ligand_files = glob.glob(f'{Directory}/ligands/*.pdbqt')
receptor_file = f"{Directory}/receptor_0.pdbqt"
for ligand_file in ligand_files:
ligand_name = os.path.basename(ligand_file).replace('.pdbqt', '')
result_file = f'{Directory}/results/{ligand_name}_out.pdbqt'
if os.path.exists(result_file):
print(f"Result file already exists: {result_file}. Skipping.")
continue
try:
print(f"Starting docking for {ligand_file}...")
# Initialize Vina
vina = Vina(sf_name="vina", seed=4)
vina.set_receptor(receptor_file)
# Compute docking maps
vina.compute_vina_maps(Center=[5.84, 3.44, 2.09], box=[26, 38, 30] )
# Set ligand and perform docking
vina.set_ligand_from_file(ligand_file)
vina.randomize()
vina.dock(exhaustiveness=8, n_poses=9)
# Write docking results
vina.write_poses(
result_file,
energy_range=10000.0,
overwrite=True,
n_poses=9
)
print(f"Finished docking for {ligand_file}. Results saved to {result_file}.")
except Exception as e:
print(f"Exception occurred for {ligand_file}: {e}")
finally:
gc.collect()
Hi @Jameel9
vina.compute_vina_maps(Center=[5.84, 3.44, 2.09], box=[26, 38, 30] )
should be
vina.compute_vina_maps(center=[5.84, 3.44, 2.09], box_size=[26, 38, 30] )
Have you tried running this interactively? Doing this on a certain pair of receptor and ligand might be helpful for troubleshooting your own codes.
Thank you so much @rwxayheee for your response.
Sorry about this. I actually defined those parameters as individual variables.
BOX_SIZE = [26, 38, 30]
CENTER = [5.84, 3.44, 2.09]
and
vina.compute_vina_maps(center=CENTER, box_size=BOX_SIZE)
But when I copied the code to GitHub, I thought I would make it shorter and less messy but i successfully missed up with arguments wording :).
I did ran it interactively before and I kept getting something like this on the terminal as in the image below. The issue here is that I can't capture the affinities of each molecule into an independent log file.
Hi @Jameel9
I see :) a quick way to redirect standard output and error is:
python virtual_screen.py &> virtual_screen.log
virtual_screen.log will have the contents that are printed to terminal
Ok. Thank you so much.
The installation was attempted from Google Colaboratory, following a similar procedure to this.
!pip install vina
givesThe connected Python 3 Google Compute Engine backend is Linux.
On the other hand,
conda install
worked ^^after installing condacolab
Hope the information is helpful anyone who run Jupyter Notebook with Google Colab