From 817b950654486d8896a9cd8c8dc3fba51f976821 Mon Sep 17 00:00:00 2001 From: xingjiepan Date: Wed, 8 Jan 2020 14:30:55 -0800 Subject: [PATCH] Ignore the terminal residues in creating hydrogen bond restraints --- loop_helix_loop_reshaping/build_loop_helix_loop_unit.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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))