56 #include <basic/Tracer.hh>
57 #include <utility/exit.hh>
58 #include <utility/stream_util.hh>
59 #include <utility/string_util.hh>
60 #include <basic/MetricValue.hh>
66 #include <utility/vector1.hh>
71 using namespace core::pose;
72 using namespace core::pose::metrics;
74 static basic::Tracer
TR(
"protocols.toolbox.PoseMetricCalculators.BuriedUnsatisfiedPolarsCalculator");
78 namespace pose_metric_calculators {
80 BuriedUnsatisfiedPolarsCalculator::BuriedUnsatisfiedPolarsCalculator(
84 ) : all_bur_unsat_polars_( 0 ),
85 special_region_bur_unsat_polars_(0),
86 name_of_hbond_calc_( hbond_calc ),
87 name_of_sasa_calc_( sasa_calc ),
88 burial_sasa_cutoff_( burial_cutoff )
101 std::set< core::Size >
const & special_region,
103 ) : all_bur_unsat_polars_(0),
104 special_region_bur_unsat_polars_(0),
105 name_of_hbond_calc_( hbond_calc ),
106 name_of_sasa_calc_( sasa_calc ),
107 burial_sasa_cutoff_( burial_cutoff ),
108 special_region_( special_region )
140 basic::MetricValueBase * valptr
144 if ( key ==
"all_bur_unsat_polars" ) {
145 basic::check_cast( valptr, &
all_bur_unsat_polars_,
"all_bur_unsat_polars expects to return a Size" );
148 }
else if ( key ==
"special_region_bur_unsat_polars" ) {
152 }
else if ( key ==
"atom_bur_unsat" ) {
153 basic::check_cast( valptr, &
atom_bur_unsat_,
"atom_bur_unsat expects to return a id::AtomID_Map< bool >" );
154 (
static_cast<basic::MetricValue<id::AtomID_Map< bool >
> *>(valptr))->set(
atom_bur_unsat_ );
156 }
else if ( key ==
"residue_bur_unsat_polars" ) {
157 basic::check_cast( valptr, &
residue_bur_unsat_polars_,
"residue_bur_unsat_polars expects to return a utility::vector1< Size >" );
161 basic::Error() <<
"NumberHbondsCalculator cannot compute the requested metric " << key << std::endl;
173 if ( key ==
"all_bur_unsat_polars" ) {
175 }
else if ( key ==
"special_region_bur_unsat_polars" ) {
177 }
else if ( key ==
"atom_Hbonds" ) {
178 basic::Error() <<
"id::AtomID_Map< bool > has no output operator, for metric " << key << std::endl;
180 }
else if ( key ==
"residue_bur_unsat_polars" ) {
184 basic::Error() <<
"NumberHbondsCalculator cannot compute metric " << key << std::endl;
205 basic::MetricValue< id::AtomID_Map< Real > > atom_sasa;
206 basic::MetricValue< id::AtomID_Map< Size > > atom_hbonds;
225 bool this_atom_bur_unsat(
false);
229 Real cursasa = atom_sasa.value()[ atid ];
237 if( ( bonded_heavyatoms + atom_hbonds.value()[ atid ] ) < satisfac_cut ){
243 this_atom_bur_unsat =
true;
261 if( atom_type ==
"OH" )
return 2;
264 else if (atom_type ==
"OCbb")
return 2;
266 else if( atom_type ==
"S")
return 2;