Skip to content

Commit

Permalink
small change in reorient: set new position of H to 90% of acceptor - …
Browse files Browse the repository at this point in the history
…donated H instead of exactly 1A if distance < 1.1A
  • Loading branch information
godenymarta committed Oct 27, 2023
1 parent c83fe0f commit 4f30f12
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions protex/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,17 @@ def _reorient_atoms(self, candidate, positions, positions_copy):
else:
pos_donated_H[i] = pos_donated_H[i] - self.boxl_vec

newbond_factor = (np.sqrt((pos_donated_H[0] - pos_acceptor_atom[0])**2+(pos_donated_H[1] - pos_acceptor_atom[1])**2+(pos_donated_H[2] - pos_acceptor_atom[2])**2) - 0.1)/(np.sqrt((pos_donated_H[0] - pos_acceptor_atom[0])**2+(pos_donated_H[1] - pos_acceptor_atom[1])**2+(pos_donated_H[2] - pos_acceptor_atom[2])**2))
# set position at exactly 1A from acceptor if r > 1.1A, otherwise at 90% of the distance
# NOTE we may have to adjust the criterion (is H-DUMH distance large enough?)
dist = np.sqrt((pos_donated_H[0] - pos_acceptor_atom[0])**2+(pos_donated_H[1] - pos_acceptor_atom[1])**2+(pos_donated_H[2] - pos_acceptor_atom[2])**2)
if dist > 0.11:
newbond_factor = (dist - 0.1)/dist
else:
newbond_factor = 0.1

pos_accepted_H = pos_donated_H - newbond_factor * (
pos_donated_H - pos_acceptor_atom
) # set position at exactly 1 angstrom from acceptor -> more stable
)

# atom name of acceptor alternative is the H that used to be the dummy H
idx_accepted_H = acceptor.get_idx_for_atom_name(
Expand Down

0 comments on commit 4f30f12

Please sign in to comment.