Psivant / femto

A comprehensive toolkit for predicting free energies
https://psivant.github.io/femto/
MIT License
49 stars 7 forks source link

Fix indexing of ligand 2 #16

Closed slochower closed 3 months ago

slochower commented 4 months ago

Description

There are two bugs, I think. See #15.

  1. The first bug is using ligand_1_ref_idxs with ligand_2 when checking for receptor reference atoms.
  2. The second bug happens when naively replacing ligand_1_ref_idxs with ligand_2_ref_idxs. The reference indices for ligand 2 are offset by the number of atoms in ligand 1 (I guess this probably happens to index into a combined topology of both ligands at some point in the code). But check_receptor_idxs will eventually try to index the provided ligand with the provided index. So, before calling this function, the indices need to be "un-offset" so you don't end up with an IndexError.

Status

asilveirastx commented 4 months ago

@slochower the fix looks good! Thanks!

ajsilveira commented 3 months ago

@slochower Could you please merge the main branch into this PR? I’ve pushed a change that should fix the GitHub Actions failures.

ajsilveira commented 3 months ago

@SimonBoothroyd yeah let's merge

slochower commented 3 months ago

Yes -- thanks both.