18 #include <basic/Tracer.hh>
19 #include <utility/tag/Tag.hh>
25 #include <basic/MetricValue.hh>
28 #include <utility/string_util.hh>
29 #include <boost/foreach.hpp>
30 #define foreach BOOST_FOREACH
33 namespace simple_filters {
44 Filter(
"BuriedUnsatHbonds" ),
45 upper_threshold_( upper_threshold ),
46 jump_num_( jump_num ),
61 if ( datamap.
has(
"scorefxns", scorefxn_key ) ) {
68 buried_unsat_hbond_filter_tracer<<
"Buried Unsatisfied Hbond filter over jump number " <<
jump_num_ <<
" with cutoff " << upper_threshold_ << std::endl;
75 buried_unsat_hbond_filter_tracer<<
"# unsatisfied hbonds: "<<unsat_hbonds<<
". ";
76 if( unsat_hbonds <= upper_threshold_ ){
77 buried_unsat_hbond_filter_tracer<<
"passing." <<std::endl;
81 buried_unsat_hbond_filter_tracer<<
"failing."<<std::endl;
89 out<<
"# unsatisfied hbonds: "<< unsat_hbonds<<
'\n';
95 return( unsat_hbonds );
107 ( *scorefxn )( bound );
108 bound.update_residue_neighbors();
116 trans_mover.
apply( unbound );
121 basic::MetricValue< core::Size > mv_bound, mv_unbound;
122 basic::MetricValue< std::string > mv_bound_str, mv_unbound_str;
124 using namespace protocols::toolbox::pose_metric_calculators;
127 calc_bound.get(
"all_bur_unsat_polars", mv_bound, bound);
129 bound_string = calc_bound.get(
"residue_bur_unsat_polars", bound );
130 buried_unsat_hbond_filter_tracer <<
"BOUND: " << bound_string << std::endl;
134 calc_unbound.
get(
"all_bur_unsat_polars", mv_unbound, unbound);
135 unsat_hbonds = mv_bound.value() - mv_unbound.value();
136 buried_unsat_hbond_filter_tracer <<
"unbound_unsat=" << mv_unbound.value() <<
" " <<
"bound_unsat=" << mv_bound.value() << std::endl;
137 unbound_string = calc_unbound.
get(
"residue_bur_unsat_polars", unbound );
138 buried_unsat_hbond_filter_tracer <<
"UNBOUND: " << unbound_string << std::endl;
140 else unsat_hbonds = mv_bound.value();
145 for(
core::Size i=0; i<unbound_string.length(); ++i ){
146 if( unbound_string.c_str()[ i ]<=
'9' && unbound_string.c_str()[ i ]>=
'0' )
147 unbound_tmp+=unbound_string.c_str()[i];
149 for(
core::Size i=0; i<bound_string.length(); ++i ){
150 if( bound_string.c_str()[ i ]<=
'9' && bound_string.c_str()[ i ]>=
'0' )
151 bound_tmp+=bound_string.c_str()[i];
156 if( selected_residues.size() == 0 )
158 foreach(
core::Size const sr, selected_residues ){
160 total_in_selected_residues += std::max( (bound_tmp[ sr-1 ]) - (unbound_tmp[ sr-1 ]), 0 );
162 return( total_in_selected_residues );
165 return( unsat_hbonds );