21 #include <basic/MetricValue.hh>
22 #include <basic/Tracer.hh>
25 #include <utility/exit.hh>
26 #include <utility/string_util.hh>
35 #include <utility/vector1.hh>
42 namespace pose_metric_calculators {
44 HPatchCalculator::HPatchCalculator(
bool remove_nonprotein_res )
45 : total_hpatch_score_(0.0), remove_nonprotein_res_(remove_nonprotein_res )
53 if ( key ==
"total_hpatch" ) {
57 }
else if ( key ==
"patch_scores" ) {
58 basic::check_cast( valptr, &
patch_scores_,
"patch_scores expects to return a std::map< Size, Real >" );
59 (
static_cast<basic::MetricValue<std::map< Size, std::pair< Real, Real >
> > *>(valptr) )->set(
patch_scores_ );
61 }
else if ( key ==
"atoms_in_patches" ) {
62 basic::check_cast( valptr, &
atoms_in_patches_,
"atoms_in_patches expects to return a std::map< Size, utility::vector1< id::AtomID > >" );
63 (
static_cast<basic::MetricValue< std::map< Size, utility::vector1< id::AtomID >
> > *>(valptr) )->set(
atoms_in_patches_ );
66 basic::Error() <<
"This Calculator cannot compute metric " << key << std::endl;
76 if ( key ==
"total_hpatch" ) {
77 std::ostringstream ss;
84 basic::Error() <<
"This Calculator cannot compute metric " << key << std::endl;
99 bool has_nonprot_res(
false);
102 has_nonprot_res =
true;
106 if ( has_nonprot_res ) {