Skip to content
Snippets Groups Projects
Commit 7295281c authored by Valerio Mariani's avatar Valerio Mariani
Browse files

Partial fix of the residue by residue ldt score

parent 6674be51
No related branches found
No related tags found
No related merge requests found
...@@ -81,7 +81,14 @@ std::pair<long int, long int> calc_overlap1(const ResidueRDMap& res_distance_lis ...@@ -81,7 +81,14 @@ std::pair<long int, long int> calc_overlap1(const ResidueRDMap& res_distance_lis
const UniqueAtomIdentifier& first_atom=uais.first; const UniqueAtomIdentifier& first_atom=uais.first;
const UniqueAtomIdentifier& second_atom=uais.second; const UniqueAtomIdentifier& second_atom=uais.second;
String name=swap ? swapped_name(first_atom.GetAtomName()) : first_atom.GetAtomName(); String name=swap ? swapped_name(first_atom.GetAtomName()) : first_atom.GetAtomName();
AtomView av1=mdl_res ? mdl_res.FindAtom(name) : AtomView(); AtomView av1;
int rindex1=0, rindex2=0;
if (mdl_res) {
rindex1=mdl_res.GetIndex();
overlap_list[rindex1].second+=tol_list.size();
av1=mdl_res.FindAtom(name);
}
if (only_fixed) { if (only_fixed) {
if (std::abs(first_atom.GetResNum().GetNum()-second_atom.GetResNum().GetNum())<sequence_separation) { if (std::abs(first_atom.GetResNum().GetNum()-second_atom.GetResNum().GetNum())<sequence_separation) {
...@@ -97,19 +104,16 @@ std::pair<long int, long int> calc_overlap1(const ResidueRDMap& res_distance_lis ...@@ -97,19 +104,16 @@ std::pair<long int, long int> calc_overlap1(const ResidueRDMap& res_distance_lis
} }
} }
AtomView av2=mdl_chain.FindAtom(second_atom.GetResNum(),second_atom.GetAtomName()); AtomView av2;
overlap.second+=tol_list.size(); ResidueView mdl_res_av2=mdl_chain.FindResidue(second_atom.GetResNum());
int rindex1=0, rindex2=0; if (mdl_res_av2) {
if (av1) { rindex2=mdl_res_av2.GetIndex();
rindex1=av1.GetResidue().GetIndex();
overlap_list[rindex1].second+=tol_list.size();
}
if (av2) {
rindex2=av2.GetResidue().GetIndex();
overlap_list[rindex2].second+=tol_list.size(); overlap_list[rindex2].second+=tol_list.size();
av2=mdl_res_av2.FindAtom(second_atom.GetAtomName());
} }
overlap.second+=tol_list.size();
if (!(av1 && av2)) { if (!(av1 && av2)) {
continue; continue;
} }
...@@ -495,17 +499,17 @@ std::pair<long int,long int> LocalDistDiffTest(const EntityView& mdl, const Glob ...@@ -495,17 +499,17 @@ std::pair<long int,long int> LocalDistDiffTest(const EntityView& mdl, const Glob
total_ov.first+=ov1.first; total_ov.first+=ov1.first;
total_ov.second+=ov1.second; total_ov.second+=ov1.second;
} }
if(local_lddt_property_string!="") {
ResidueView mdlr=mdl_chain.FindResidue(rn);
if (mdlr.IsValid()) {
int mdl_res_index =mdlr.GetIndex();
Real local_lddt=static_cast<Real>(overlap_list[mdl_res_index].first)/(static_cast<Real>(overlap_list[mdl_res_index].second) ? static_cast<Real>(overlap_list[mdl_res_index].second) : 1);
mdlr.SetFloatProp(local_lddt_property_string, local_lddt);
mdlr.SetIntProp(local_lddt_property_string+"_conserved", overlap_list[mdl_res_index].first);
mdlr.SetIntProp(local_lddt_property_string+"_total", overlap_list[mdl_res_index].second);
}
}
} }
if(local_lddt_property_string!="") {
ResidueViewList rlist = mdl_chain.GetResidueList();
for (ResidueViewList::iterator rit=rlist.begin(); rit!=rlist.end();++rit) {
int mdl_res_index =rit->GetIndex();
Real local_lddt=static_cast<Real>(overlap_list[mdl_res_index].first)/(static_cast<Real>(overlap_list[mdl_res_index].second) ? static_cast<Real>(overlap_list[mdl_res_index].second) : 1);
rit->SetFloatProp(local_lddt_property_string, local_lddt);
rit->SetIntProp(local_lddt_property_string+"_conserved", overlap_list[mdl_res_index].first);
rit->SetIntProp(local_lddt_property_string+"_total", overlap_list[mdl_res_index].second);
}
}
overlap_list.clear(); overlap_list.clear();
return std::make_pair<long int,long int>(total_ov.first,total_ov.second); return std::make_pair<long int,long int>(total_ov.first,total_ov.second);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment