diff --git a/loop_helix_loop_reshaping/build_loop_helix_loop_unit.py b/loop_helix_loop_reshaping/build_loop_helix_loop_unit.py index b159509..e3a69a1 100644 --- a/loop_helix_loop_reshaping/build_loop_helix_loop_unit.py +++ b/loop_helix_loop_reshaping/build_loop_helix_loop_unit.py @@ -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 = [] @@ -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))