Skip to content

Commit

Permalink
Ignore the terminal residues in creating hydrogen bond restraints
Browse files Browse the repository at this point in the history
  • Loading branch information
xingjiepan committed Jan 8, 2020
1 parent c0d3b96 commit 817b950
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion loop_helix_loop_reshaping/build_loop_helix_loop_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def residue_direction_vector(pose, res):

def find_bb_hbonds_involving_residues(pose, residues):
'''Find backbone hbonds involving a given set of residues.
An Hbond is defined as (donor_res, acceptor_res)
An Hbond is defined as (donor_res, acceptor_res).
Ignore the terminal residues.
'''
hbset = rosetta.core.scoring.hbonds.HBondSet(pose, bb_only=True)
hbonds = []
Expand All @@ -65,6 +66,10 @@ def find_bb_hbonds_involving_residues(pose, residues):
acc = hbset.hbond(i).acc_res()
don = hbset.hbond(i).don_res()

# Ignore terminal residues
if acc in [1, pose.size()] or don in [1, pose.size()]:
continue

if acc in residues or don in residues:
hbonds.append((don, acc))

Expand Down

0 comments on commit 817b950

Please sign in to comment.