diff --git a/modules/mol/alg/pymod/wrap_mol_alg.cc b/modules/mol/alg/pymod/wrap_mol_alg.cc index bdf141aa55b89e2a3a28235f8432c87b21702045..b775b6396338c2ee45357bcfd56d259e6704b002 100644 --- a/modules/mol/alg/pymod/wrap_mol_alg.cc +++ b/modules/mol/alg/pymod/wrap_mol_alg.cc @@ -167,7 +167,8 @@ BOOST_PYTHON_MODULE(_ost_mol_alg) def("PrintGlobalRDMap",&mol::alg::PrintGlobalRDMap); def("PrintResidueRDMap",&mol::alg::PrintResidueRDMap); - def("ResidueNamesMatch",&mol::alg::ResidueNamesMatch); + def("ResidueNamesMatch",&mol::alg::ResidueNamesMatch, + (arg("probe"), arg("reference"), arg("log_as_error")=false)); } diff --git a/modules/mol/alg/src/consistency_checks.cc b/modules/mol/alg/src/consistency_checks.cc index 8cafbe6ba802864b77be37b399e7c324bbd3abc3..bdc0ab646f8fb4bb42762034fa6c618b54a8ca98 100644 --- a/modules/mol/alg/src/consistency_checks.cc +++ b/modules/mol/alg/src/consistency_checks.cc @@ -24,19 +24,8 @@ namespace ost { namespace mol { namespace alg { -/// \brief Checks that residue types with the same ResNum in the two structures match -/// -/// Requires a reference structure and a probe structure. The function checks that all the -/// residues in the reference structure that appear in the probe structure (i.e., that have the -/// same ResNum) are of the same residue type. Chains are paired by index, not by chain name -/// (i.e., the first chain of the reference will be compared with the first chain of the probe, -/// the second with the second, etc.) - - - - - -bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& reference, bool consistency_checks) +bool ResidueNamesMatch(const EntityView& probe, const EntityView& reference, + bool log_as_error) { bool return_value = true; ChainViewList ref_chains = reference.GetChainList(); @@ -51,7 +40,7 @@ bool ResidueNamesMatch (const mol::EntityView& probe, const mol::EntityView& ref if (probe_residue.IsValid()) { if (probe_residue.GetName()!=rri->GetName()) { return_value = false; - if (consistency_checks==true) { + if (log_as_error) { 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()); diff --git a/modules/mol/alg/src/consistency_checks.hh b/modules/mol/alg/src/consistency_checks.hh index 5da6a281fdf3a97de78ecc6ff0236048e01bea80..34eb4568b82f54cdfba2e5b2423d176d322d9a2f 100644 --- a/modules/mol/alg/src/consistency_checks.hh +++ b/modules/mol/alg/src/consistency_checks.hh @@ -31,8 +31,9 @@ namespace ost { namespace mol { namespace alg { /// same ResNum) are of the same residue type. Chains are comapred by order, not by chain name /// (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 consistency_checks); +bool DLLEXPORT_OST_MOL_ALG ResidueNamesMatch(const EntityView& probe, + const EntityView& reference, + bool log_as_error=false); }}}