Skip to content
Snippets Groups Projects
Commit ee9141e2 authored by Marco Biasini's avatar Marco Biasini Committed by Bienchen
Browse files

unfail unittests

parent 66b15e04
Branches
Tags
No related merge requests found
......@@ -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));
}
......@@ -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());
......
......@@ -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);
}}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment