18 #include <basic/Tracer.hh>
19 #include <utility/tag/Tag.hh>
26 #include <utility/vector1.hh>
27 #include <boost/foreach.hpp>
30 #define foreach BOOST_FOREACH
33 namespace simple_filters {
35 static basic::Tracer
tr(
"protocols.simple_filters.ResidueIEFilter" );
49 bool const whole_pose,
50 bool const whole_interface,
56 filters::
Filter(
"ResidueIE" ),
59 score_type_( score_type ),
60 threshold_( threshold ),
61 whole_pose_ ( whole_pose ),
62 whole_interface_ ( whole_interface ),
64 interface_distance_cutoff_ ( interface_distance_cutoff ),
65 max_penalty_ (max_penalty),
66 penalty_factor_ (penalty_factor)
68 using namespace core::scoring;
93 using namespace core::scoring;
142 using namespace core::scoring;
147 whole_pose_ = tag->getOption<
bool>(
"whole_pose" , 0 );
155 if(tag->hasOption(
"residues")) {
156 tr <<
" the tag residues is seen by the program" << std::endl;
162 tr<<
"Failed to parse residues: " << tag->getOption<
std::string> (
"residues") <<
". Using whole pose." << std::endl;
173 use_resE_ = tag->getOption<
bool>(
"use_resE" , 0 );
190 out <<
"Total penalty for restype "<<
restype_ <<
"is "<< penalty << std::endl;
207 using namespace core::scoring;
208 using namespace core::graph;
213 tr <<
"Detecting target resnums from interface." << std::endl;
217 tr <<
"pose must contain at least two chains!" << std::endl;
223 (*scorefxn_)(in_pose);
229 interface_obj.calculate( in_pose );
241 tr <<
"Detecting target resnums from whole pose." << std::endl;
252 tr <<
"The following residues will be considered for interaction energy calculation:"<< std::endl;
256 tr <<
"Residue " << res <<
" in pose is of type "<< pose.
residue_type( res ).
name3() <<
". Requested restype3 is "<<
restype_<<
". Skipping!"<<std::endl;
262 (*scorefxn_)(in_pose);
264 EnergyMap const curr_weights = in_pose.energies().weights();
267 tr <<
"No residues found. Skipping calculation."<< std::endl;
281 res_intE = eprf.
compute( pose );
288 int res_chain = in_pose.chain(res);
294 res_intE += Eedge->
dot( curr_weights );
300 res_intE_samechain += Eedge->
dot( curr_weights );
304 res_intE_differentchain += Eedge->
dot( curr_weights );
307 tr <<
"Residue "<< pose.
residue_type( res ).
name3()<<res<<
" has a intra-chain interaction energy "<< res_intE_samechain << std::endl;
308 tr <<
"Residue "<< pose.
residue_type( res ).
name3()<<res<<
" has a inter-chain interaction energy "<< res_intE_differentchain << std::endl;
311 tr <<
"Residue "<< pose.
residue_type( res ).
name3()<<res<<
" has an (interaction) energy "<< res_intE <<
", threshold is "<<
threshold_<<
" and penalty is ";
313 if (res_intE > threshold_)
320 tr <<
" 0"<<std::endl;