20 #include <basic/options/option.hh>
21 #include <basic/options/keys/in.OptionKeys.gen.hh>
22 #include <basic/Tracer.hh>
36 #include <utility/string_util.hh>
37 #include <utility/file/file_sys_util.hh>
38 #include <utility/tag/Tag.hh>
39 #include <utility/vector1.hh>
42 #include <utility/vector0.hh>
45 static basic::Tracer
tr(
"protocols.toolbox.tas_operations.SeqprofConsensusOperation");
49 namespace task_operations{
61 seqprof_filename_( basic::options::option[ basic::options::OptionKeys::in::file::pssm ][1] ),
63 min_aa_probability_(0.0),
64 prob_larger_current_(true),
65 ignore_pose_profile_length_mismatch_(false)
69 seqprof->convert_profile_to_probs();
98 if( !
seqprof_) utility_exit_with_message(
"No sequence profile set. option -in:file:pssm not specified? no filename in tag specified?");
103 dynamic_cast<core::conformation::symmetry::SymmetricConformation const &> ( pose.
conformation()) );
104 asymmetric_unit_res = SymmConf.
Symmetry_Info()->num_independent_residues();
120 if( prob >= current_prob ) keep_aas[ aa ] =
true;
122 else keep_aas[ aa ] =
true;
133 bool prot_res_without_profile_information_exist(
false);
134 for(
core::Size i = last_res + 1; i <= asymmetric_unit_res; ++i){
139 if( prot_res_without_profile_information_exist ){
140 if(
ignore_pose_profile_length_mismatch_ )
tr <<
"WARNING WARNING: the passed in pose is longer than the sequence profile specified. Double check whether the used sequence profile is correct. Setting every excess pose residue to repacking.";
142 else utility_exit_with_message(
"The passed in pose is longer than the sequence profile specified. Double check whether the used sequence profile is correct.");
149 if( tag->hasOption(
"filename") ){
152 seqprof->convert_profile_to_probs();
155 if( tag->hasOption(
"min_aa_probability") )
min_aa_probability_ = tag->getOption<
Real >(
"min_aa_probability" );
156 if( tag->hasOption(
"probability_larger_than_current") )
prob_larger_current_ = tag->getOption<
bool >(
"probability_larger_than_current");
172 reweightedprof->convert_profile_to_probs();
187 ddG_predictions_filename_(basic::options::option[ basic::options::OptionKeys::in::file::ddg_predictions_file ].value()),
188 conservation_cutoff_(0.6),
211 if( tag->hasOption(
"ddG_filename") ){
217 if( tag->hasOption(
"ddG_cutoff") )
ddG_cutoff_ = tag->getOption<
Real >(
"ddG_cutoff" );
218 if( tag->hasOption(
"verbose") )
verbose_ = tag->getOption<
bool >(
"verbose" );
227 if( !this->
seqprof()) utility_exit_with_message(
"No sequence profile set. option -in:file:pssm not specified? no filename in tag specified?");
229 if(
position_ddGs_.size() == 0 ) utility_exit_with_message(
"No ddG infos were read in. option -in:file:ddg_predictions_file not specified? no filename in tag specified?");
265 std::map< core::Size, core::io::PositionDdGInfo::PositionDdGInfoOP >::const_iterator posddg_it(
position_ddGs_.find( seqpos ) );
273 tr <<
"Warning: no ddG information read for sequence position " << seqpos <<
". This could either mean that the ddG predictions input file is incomplete or that the original PDB had a disulfide cys or other modified residue at this position. Decision whether residue is untouchable will be made based on sequence conservation alone." << std::endl;
279 if( seqprof_wt != pos_ddg.
wt_aa() ) utility_exit_with_message (
"The wildtype aa for position "+utility::to_string( seqpos ) +
" is different in the ddG file and the pssm file. Something's unclean somewhere." );
281 if( ala_it == pos_ddg.
mutation_ddGs().end() ) utility_exit_with_message(
"The ddG of mutating to Ala was not found for position "+utility::to_string( seqpos )+
" in file "+
ddG_predictions_filename_ +
".");
284 if(
verbose_ )
tr <<
"Pos " << seqprof_wt << seqpos <<
" has ddG_cutoff of " << ala_it->second <<
" and profile frequency of " << (
seqprof()->profile())[ seqpos ][ seqprof_wt ] <<
", considered untouchable." << std::endl;
301 std::map< core::Size, core::io::PositionDdGInfo::PositionDdGInfoOP >::const_iterator posddg_it(
position_ddGs_.find( seqpos ) );
302 if( posddg_it ==
position_ddGs_.end() ) utility_exit_with_message(
"no ddg information read for sequence position "+ utility::to_string( seqpos ) );
305 if( ala_it == pos_ddg.
mutation_ddGs().end() ) utility_exit_with_message(
"The ddG of mutating to Ala was not found for position "+utility::to_string( seqpos )+
" in file "+
ddG_predictions_filename_ +
".");
306 return ala_it->second;