ccsb-scripps / AutoDock-Vina

AutoDock Vina
http://vina.scripps.edu
Apache License 2.0
596 stars 209 forks source link

error while running AutoDock Vina (batch ligand) #270

Closed serenafrancisco closed 8 months ago

serenafrancisco commented 8 months ago

Hello, I am trying to perform a virtual screening on a library of compounds. Everytime Vina tries to dock a compound with B/Si/etc atoms it prints the following error and stops working without moving to the next ligand:

PDBQT parsing error: Atom type B is not a valid AutoDock type (atom types are case-sensitive)

And this is the command I launched:

*$ vina --config conf.txt --batch ligands/.pdbqt > my.log**

I was wondering whether there is a way to make Vina move on to the next molecule after such error.

Thank you!

diogomart commented 8 months ago

Hello,

One option, which I'm not sure works, is to run Vina from Python and include the .dock() call inside a try/except block. This only works if this error in particular can be handled at the Python level. People have contributed code to do this for some errors, but we haven't gone through the code to do this comprehensively.

Another option is to write the PDBQT files of the ligands with meeko and assign type "C" to Boron:

mk_prepare_ligand.py -i hasb.sdf -aa '{"smarts": "[B]", "atype": "C"}'

After docking, meeko automagically reverts back to carbon either with the command line script mk_export.py or by making RDKit molecules using meeko from Python.

serenafrancisco commented 8 months ago

Thank you so much @diogomart!

serenafrancisco commented 8 months ago

Hello, I gave a try to this:

python .\Scripts\mk_prepare_ligand.py -i .\my_multimol.sdf -aa '{"smarts": "[B]", "atype": "C"}' --multimol_outdir .\my_folder_path

This is what the terminal printed back:

I repeated the procedure by changing the parentheses following the help page, also checking online for JSON file formats, but without any success. Do you have any ideas? Is it due to my input multi-mol SDF file?

Thank you once again

Il giorno mar 30 gen 2024 alle ore 04:26 Diogo @.***> ha scritto:

Hello,

One option, which I'm not sure works, is to run Vina from Python and include the .dock() call inside a try/except block. This only works if this error in particular can be handled at the Python level. People have contributed code to do this for some errors, but we haven't gone through the code to do this comprehensively.

Another option is to write the PDBQT files of the ligands with meeko and assign type "C" to Boron:

mk_prepare_ligand.py -i hasb.sdf -aa '{"smarts": "[B]", "atype": "C"}'

After docking, meeko automagically reverts back to carbon either with the command line script mk_export.py or by making RDKit molecules using meeko from Python.

— Reply to this email directly, view it on GitHub https://github.com/ccsb-scripps/AutoDock-Vina/issues/270#issuecomment-1916007293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYFDAUK4UDQCIG7S5ZVAWG3YRBR7XAVCNFSM6AAAAABCQK53V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGAYDOMRZGM . You are receiving this because you authored the thread.Message ID: @.***>

--

Indirizzo istituzionale di posta elettronica degli studenti e dei laureati dell'Università di TorinoOfficial University of Turin email address for students and graduates 

diogomart commented 8 months ago

It looks like the Windows terminal is parsing the JSON string differently from Unix. @psharma-sr could you take a look?

psharma-sr commented 8 months ago

Hello! For the Windows terminal, it looks like you have to escape the internal quotation marks in the JSON string to get them to be parsed correctly:

python meeko\mk_prepare_ligand.py -i hasboron.sdf -aa "{\"smarts\":\"[B]\", \"atype\":\"C\"}" -

This fixed the issue on my end, hopefully it will work for you too.