rdkit-scripts icon indicating copy to clipboard operation
rdkit-scripts copied to clipboard

How to test the vina_dock.py program

Open NavyaR13 opened this issue 2 years ago • 9 comments

I am trying to run : python vina_dock.py -i smiles.smi --no_protonation -o/ --output output.txt

Traceback (most recent call last): File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 473, in main() File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 453, in main add_protonation(args.output) File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 54, in add_protonation protonate, done = list(cur.execute('SELECT protonation, protonation_done FROM setup'))[0] sqlite3.OperationalError: no such table: setup

Could you please help me resolve it or do I have to give more information while running it ?

Thanks in advance, Navya

NavyaR13 avatar Apr 22 '22 22:04 NavyaR13

Dear Navya, could you please show the full path of the command line you used to run vina_dock.py ?

GuzelMinibaeva avatar Apr 24 '22 20:04 GuzelMinibaeva

Hi,

I am trying to run the command : python vina_dock.py -i smiles.smi --no_protonation -o/ --output output.txt Terminal is in the same folder as rdkit-scripts.

NavyaR13 avatar Apr 25 '22 15:04 NavyaR13

Hi,

please run command: python vina_dock.py -i smiles.smi --no_protonation -o output.db You may need to check the existing database, remove it before starting.

GuzelMinibaeva avatar May 06 '22 10:05 GuzelMinibaeva

Hi GuzelMinibaeva,

Thank you for your response. I am still facing this error after deleting the existing database. ~/Desktop/rdkit-scripts$ python vina_dock.py -i AXL_smiles.smi --no_protonation -o output.db Traceback (most recent call last): File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 473, in main() File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 451, in main create_db(args.output, args.input, not args.no_protonation, args.protein, args.protein_setup, args.prefix) File "/home/ubuntu/Desktop/rdkit-scripts/vina_dock.py", line 356, in create_db pdbqt_string = open(pdbqt_fname).read() TypeError: expected str, bytes or os.PathLike object, not NoneType

Am I missing a pdbqt file ? Please help me with this.

Thank you, Navya

NavyaR13 avatar May 17 '22 11:05 NavyaR13

Hi Navya,

for the first run you should use -p with a path for your pdbqt file and -s with a path for your setup file with grid box coordinates, these command line arguments are necessary for docking. Example: python vina_dock.py -i AXL_smiles.smi --no_protonation -o output.db -p protein.pdbqt -s setup.txt If docking stops for any reason and you want to continue calculation, you may call the same command once more and docking will continue from the last checkpoint. Please note, you may omit arguments: -p, -s, -i, --no_protonation in the repeated call, because the corresponding data is already saved in the database and will be read from there automatically.

Protein and setup files can be prepared in a standard way.

Example of a file with grid box coordinates:

size_x =  22.50
size_y =  22.50
size_z =  22.50
center_x = -18.77
center_y = -10.06
center_z =   8.12

Kind regards, Guzel

GuzelMinibaeva avatar May 17 '22 12:05 GuzelMinibaeva

Hi @GuzelMinibaeva, I am getting the same error. It seems that database isn't being created at first run.

  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/content/rdkit-scripts/vina_dock.py", line 473, in <module>
    main()
  File "/content/rdkit-scripts/vina_dock.py", line 453, in main
    add_protonation(args.output)
  File "/content/rdkit-scripts/vina_dock.py", line 54, in add_protonation
    protonate, done = list(cur.execute('SELECT protonation, protonation_done FROM setup'))[0]
sqlite3.OperationalError: no such table: setup

The command I am trying to execute:

!python -m vina_dock \
-i <ligand file name>.sdf \
-o output.db \
-s <receptor box coordinates file name>.txt \
-p <receptor file name>.pdbqt \
--no_protonation \
-c 4 \
-v

If I solve this issue then I promise that i will send PR.

AnzorGozalishvili avatar Jun 09 '22 13:06 AnzorGozalishvili

Hi, @AnzorGozalishvili, could you attach your input files to reproduce this behavior? It seems like a simple issue.

DrrDom avatar Jun 09 '22 14:06 DrrDom

It worked locally on my laptop. I amn't able to run it in Google Colab. This is the issue, probably.

AnzorGozalishvili avatar Jun 09 '22 14:06 AnzorGozalishvili

Hi @DrrDom There was some issue related to creating DB. I run this in advance to manually create db.

from vina_dock import create_db
import sqlite3

def test_create_db():
    if os.path.isfile("output.db"):
        os.remove("output.db")

    create_db(
        db_fname="output.db",
        input_fname="/content/CHEMBL218068.sdf",
        protonation=False,
        pdbqt_fname="/content/cp2c9_1r9o_DUDE_2_0A.pdbqt",
        protein_setup_fname="/content/cp2c9_1r9o_receptor_vina_box.txt",
        prefix=None
    )
    conn = sqlite3.connect("output.db")

    assert conn.execute('select * from mols')
    assert conn.execute('select * from setup')

test_create_db()

protonation is set to False since I didn't have an license for cxcalc

Here is the command I was running

!python -m vina_dock \
-i /content/CHEMBL218068.sdf \
-o output.db \
-s /content/cp2c9_1r9o_receptor_vina_box.txt \
-p /content/cp2c9_1r9o_DUDE_2_0A.pdbqt \
--no_protonation \
-c=4 \
-v

AnzorGozalishvili avatar Jun 14 '22 05:06 AnzorGozalishvili