Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct ligand-receptor energy when no_refine is enabled. #178

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

shishaochen
Copy link
Contributor

@shishaochen shishaochen commented Feb 18, 2023

According to vina.cpp#L719-L722, function igrid.eval() should return energy between receptor and ligand when vina/vinardo score function is selected.

// Inter
if (m_no_refine || !m_receptor_initialized)
    all_grids = m_grid.eval(m_model, authentic_v[1]); // [1] ligand & flex -- grid
else
    all_grids = m_non_cache.eval(m_model, authentic_v[1]); // [1] ligand & flex -- grid
lig_grids = all_grids - flex_grids;

In default, m_no_refine is false and the behavior of function non_cache.eval() is correct. However, this is not true in function cache.eval().

Since ligand-receptor energy is calculated from all_grids minus flex_grids, this fix is necessary for a correct energy report when no_refine option is enabled in Vina.

Since both non_cache.eval() and cache.eval() are called only when scoring a model, search & optimization procedures won't be affected.

We can quickly verify the behavior change in Vina's score_only mode:

cd example/flexible_docking/solution
vina \
  --receptor 1fpu_receptor_rigid.pdbqt \
  --flex 1fpu_receptor_flex.pdbqt \
  --ligand ../data/1iep_ligand.pdbqt \
  --config 1fpu_receptor_rigid_vina_box.txt \
  --score_only \
  --seed 137 \
  --no_refine \
  --verbosity 2

Inserting extra log lines in vina.cpp, value delta of all_grids between unfixed and fixed equals exactly the value of flex_grids.

  • Vina without this fix
[no_refine] all_grids=-4.38079
[no_refine] flex_grids=1.32849
  • Vina with this fix
[no_refine] all_grids=-3.0523
[no_refine] flex_grids=1.32849

@diogomart
Copy link
Member

Good catch, thank you!

@diogomart diogomart merged commit cff9d7f into ccsb-scripps:develop Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants