Skip to content
Snippets Groups Projects
Commit d3ea6ede authored by Studer Gabriel's avatar Studer Gabriel
Browse files

slightly change the logic of sidechain atom constructor

After running through this function, ALL heavy atoms are guaranteed to
be set.
parent 6522205a
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,26 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
throw promod3::Error("Invalid res_idx in ConstructSidechainAtoms!");
}
ost::conop::AminoAcid aa = all_pos.GetAA(res_idx);
// We make sure that ALL backbone positions are present of ALL heavy atoms
// This way we can guarantee that all heavy atoms of the FULL residue are
// set when this function ran through.
if(!(all_pos.IsSet(res_idx, BB_N_INDEX) &&
all_pos.IsSet(res_idx, BB_CA_INDEX) &&
all_pos.IsSet(res_idx, BB_CB_INDEX))){
throw promod3::Error("N, CA and CB must be set in ConstructSidechainAtoms!");
all_pos.IsSet(res_idx, BB_C_INDEX) &&
all_pos.IsSet(res_idx, BB_O_INDEX)) ||
(aa != ost::conop::GLY && !all_pos.IsSet(res_idx, BB_CB_INDEX))) {
throw promod3::Error("All backbone heavy atoms must be set in "
"ConstructSidechainAtoms!");
}
const std::vector<SidechainAtomRule>& rules =
SidechainAtomRuleLookup::GetInstance().GetRules(aa);
if(rules.empty()) {
// no sidechain atoms to construct! (e.g. ALA or GLY)
return;
}
Real chi_angles[5];
......@@ -80,9 +96,6 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
chi_angles[3] = chi4;
chi_angles[4] = 0.0;
const std::vector<SidechainAtomRule>& rules =
SidechainAtomRuleLookup::GetInstance().GetRules(all_pos.GetAA(res_idx));
for(uint rule_idx = 0; rule_idx < rules.size(); ++rule_idx){
const SidechainAtomRule& rule = rules[rule_idx];
......@@ -90,7 +103,7 @@ void ConstructSidechainAtoms(AllAtomPositions& all_pos, uint res_idx,
Real dihedral_angle = chi_angles[rule.dihedral_idx];
if(dihedral_angle != dihedral_angle){
if(all_pos.GetAA(res_idx) == ost::conop::PRO && rule.dihedral_idx == 1){
if(aa == ost::conop::PRO && rule.dihedral_idx == 1){
dihedral_angle = ProlineChi2Fallback(all_pos, res_idx, rule);
}
else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment