Skip to content
Snippets Groups Projects
Commit 40485d76 authored by Valerio Mariani's avatar Valerio Mariani Committed by Bienchen
Browse files

Changed logging logic of consistency checks

parent 8fe41d10
No related branches found
No related tags found
No related merge requests found
......@@ -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;
ChainViewList ref_chains = reference.GetChainList();
......@@ -51,8 +51,12 @@ bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& ref
if (probe_residue.IsValid()) {
if (probe_residue.GetName()!=rri->GetName()) {
return_value = false;
LOG_VERBOSE("Name mismatch for residue " << probe_residue.GetNumber() << " in chain " << rci);
LOG_VERBOSE("In reference: " << rri->GetName() << ", in compared structure: " << probe_residue.GetName());
if (consistency_checks==true) {
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 {
/// (i.e.: the first chain of the reference will be compared with the first chain of the probe
/// 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)
EntityView outv=model.GetChainList()[0].Select("peptide=true");
for (std::vector<EntityView>::const_iterator ref_list_it = ref_list.begin();
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 (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);
} 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