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

Changed logging logic of consistency checks

parent 7030b108
No related branches found
No related tags found
Loading
...@@ -36,7 +36,7 @@ namespace ost { namespace mol { namespace alg { ...@@ -36,7 +36,7 @@ namespace ost { namespace mol { namespace alg {
bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& reference) bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& reference, bool consistency_checks)
{ {
bool return_value = true; bool return_value = true;
ChainViewList ref_chains = reference.GetChainList(); ChainViewList ref_chains = reference.GetChainList();
...@@ -51,8 +51,12 @@ bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& ref ...@@ -51,8 +51,12 @@ bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& ref
if (probe_residue.IsValid()) { if (probe_residue.IsValid()) {
if (probe_residue.GetName()!=rri->GetName()) { if (probe_residue.GetName()!=rri->GetName()) {
return_value = false; return_value = false;
LOG_VERBOSE("Name mismatch for residue " << probe_residue.GetNumber() << " in chain " << rci); if (consistency_checks==true) {
LOG_VERBOSE("In reference: " << rri->GetName() << ", in compared structure: " << probe_residue.GetName()); LOG_ERROR("Name mismatch for residue " << probe_residue.GetNumber() << ": in the reference structure(s) is " << rri->GetName() << ", in the model " << probe_residue.GetName());
} else {
LOG_WARNING("Name mismatch for residue " << probe_residue.GetNumber() << ": in the reference structure(s) is " << rri->GetName() << ", in the model " << probe_residue.GetName());
}
} }
} }
} }
......
...@@ -32,7 +32,7 @@ namespace ost { namespace mol { namespace alg { ...@@ -32,7 +32,7 @@ namespace ost { namespace mol { namespace alg {
/// (i.e.: the first chain of the reference will be compared with the first chain of the probe /// (i.e.: the first chain of the reference will be compared with the first chain of the probe
/// structure, etc.) /// structure, etc.)
bool DLLEXPORT_OST_MOL_ALG ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& reference); bool DLLEXPORT_OST_MOL_ALG ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& reference, bool consistency_checks);
}}} }}}
......
...@@ -314,13 +314,13 @@ int main (int argc, char **argv) ...@@ -314,13 +314,13 @@ int main (int argc, char **argv)
EntityView outv=model.GetChainList()[0].Select("peptide=true"); EntityView outv=model.GetChainList()[0].Select("peptide=true");
for (std::vector<EntityView>::const_iterator ref_list_it = ref_list.begin(); for (std::vector<EntityView>::const_iterator ref_list_it = ref_list.begin();
ref_list_it != ref_list.end(); ++ref_list_it) { ref_list_it != ref_list.end(); ++ref_list_it) {
bool cons_check = ResidueNamesMatch(v,*ref_list_it); bool cons_check = ResidueNamesMatch(v,*ref_list_it,consistency_checks);
if (cons_check==false) { if (cons_check==false) {
if (consistency_checks==true) { if (consistency_checks==true) {
LOG_ERROR("Residue names in model: " << files[i] << " are inconsistent with one or more references"); LOG_ERROR("Residue names in model: " << files[i] << " and in reference structure(s) are inconsistent.");
exit(-1); exit(-1);
} else { } else {
LOG_WARNING("Residue names in model: " << files[i] << " are inconsistent with one or more references"); LOG_WARNING("Residue names in model: " << files[i] << " and in reference structure(s) are inconsistent.");
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment