26 #include <utility/string_util.hh>
27 #include <utility/io/izstream.hh>
30 #include <boost/lexical_cast.hpp>
33 #include <utility/tag/Tag.hh>
35 #include <basic/Tracer.hh>
37 #include <utility/vector0.hh>
38 #include <utility/vector1.hh>
43 namespace potentials {
46 static basic::Tracer
TR(
"protocols.fldsgn.potentials.SetAACompositionPotential" );
68 return "SetAACompositionPotential";
74 Super(
"SetAACompositionPotential" ),
82 comp_constraint_aas_( rval.comp_constraint_aas_ ),
83 weight_( rval.weight_ ),
85 loaded_( rval.loaded_ )
112 utility::io::izstream data( file );
114 TR.Error <<
"can not open file " << file << std::endl;
120 while( getline( data, line ) ) {
124 if( tokens[1][0] ==
'#' )
continue;
125 runtime_assert( tokens.size() == 3 );
128 Real const lower_threshold = boost::lexical_cast<
Real>( tokens[2] );
129 Real const upper_threshold = boost::lexical_cast<
Real>( tokens[3] );
131 runtime_assert( lower_threshold <= upper_threshold );
133 std::pair< Real, Real > thresholds( lower_threshold, upper_threshold );
140 Real checkL( 0.0 ), checkU( 0.0 );
148 runtime_assert( checkL <= 1.0 && checkU <= 1.0 );
165 std::map< ScoreType, Real > new_weights;
169 sfx_->add_extra_method( new_weights, cce );
192 TR <<
"No input of file ! " << std::endl;
193 runtime_assert(
false );
197 weight_ = ( tag->getOption<
Real>(
"weight", 1.0 ) );
200 String const sfxn ( tag->getOption<
String>(
"scorefxn",
"" ) );
203 TR <<
"No input of sfxn ! " << std::endl;
204 runtime_assert(
false );