ccsb-scripps / AutoDock-Vina

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

Vina_map size #246

Open Dadiao-shuai opened 9 months ago

Dadiao-shuai commented 9 months ago

I wonder what is the unit of vina's map size. Typically the CNN scoring functions only accept box as 202020 A to score, but when I use this size in vina, some ligands seem to be out of it.(center set as the ligand center)

For example, 6hai_ligand.sdf is one molecule for the target(pdb_id 6hai), and I used v.compute_vina_maps(center=center, box_size=[35,35,35]) to get its score. Once I reduce the size into [25,25,25], it raises incredible result: enery:441675.338.

So I am wondering how CNN models score it normally without the ligand out of [20,20,20] box, if the unit of size is the same as vina.

Kerro-junior commented 9 months ago

Oh! If the vina and other CNN scoring function model are all use 1Aas unit of box_size, there must be some unreasonable data in their paper using 202020 to dock every ligand in PDBbind dataset! They fake the data?

I also noticed that ligands like 6hai_ligand.sdf is very long, it is hard to score it in 202020 in vina.

rwxayheee commented 9 months ago

Hi @Kerro-junior and @Dadiao-shuai, If you are talking about gnina, you should take a look at the way they suggested to build the box which is explained on their paper. When autobox_ligand is used to define the binding site, a rectangular prism is constructed using the minimum and maximum values for the x, y, and z coordinates of the ligand to which additional spacing (autobox_add) is added in every dimension (Figs. [1](https://jcheminf.biomedcentral.com/articles/10.1186/s13321-021-00522-2#Fig1), [2](https://jcheminf.biomedcentral.com/articles/10.1186/s13321-021-00522-2#Fig2)). In Gnina, if any side of this auto-generated box is smaller than the longest distance between any two atoms in the ligand, then those sides are extended to that longest distance, ensuring that the ligand can rotate freely within the defined box without incurring an out-of-box penalty that is applied to all docked poses to constrain them to the specified binding site search space.

Dadiao-shuai commented 9 months ago

Thanks for your invaluable explanation, it helps a lot @rwxayheee

RJ-Li commented 6 months ago

Hi, I want to ask you about how to getting the center xyz of many ligands automatically in python script, when computing map. @rwxayheee

rwxayheee commented 6 months ago

Hi, I want to ask you about how to getting the center xyz of many ligands automatically in python script, when computing map. @rwxayheee

Hi @RJ-Li , it seems like you can use the -y option to center maps at your ligand, when using prepare_gpf.py: https://github.com/ccsb-scripps/AutoDock-Vina/blob/develop/example/autodock_scripts/prepare_gpf.py#L28

RJ-Li commented 6 months ago

Sorry, I was using vina python API, not ad4, to try automatically set the center as ligand's center.

  v.set_receptor(rec_file)
  vina_box_size=[37,37,37]
  v.set_ligand_from_file(lig_file)
  v.compute_vina_maps(center=center, box_size=vina_box_size)
rwxayheee commented 6 months ago

Sorry, I was using vina python API, not ad4, to try automatically set the center as ligand's center.

  v.set_receptor(rec_file)
  vina_box_size=[37,37,37]
  v.set_ligand_from_file(lig_file)
  v.compute_vina_maps(center=center, box_size=vina_box_size)

In that case you can calculate the center from lig_file. Read the X, Y, Z coordinates from it and calculate the arithmetic mean for each column.

Edit: I looked at other repositories to see if there are better answers. I came across this post you opened at a fork of Vina-GPU: https://github.com/DeltaGroupNJUPT/Vina-GPU/issues/45 My answer is the same. I don't think there is currently a built-in function in the Vina API to calculate ligand center but it's very easy to in Python.