38 #include <basic/Tracer.hh>
40 #include <utility/io/izstream.hh>
46 #include <basic/options/option.hh>
47 #include <basic/options/keys/score.OptionKeys.gen.hh>
51 #include <numeric/deriv/distance_deriv.hh>
53 #include <utility/vector1.hh>
62 static basic::Tracer
tr(
"core.scoring.methods.CustomAtomPairEnergy" );
82 max_cst_seq_sep_( max_cst_seq_sep )
105 if ( seqpos1 > seqpos2 ) {
120 using namespace basic::options;
121 using namespace basic::options::OptionKeys;
122 using namespace core::scoring::constraints;
135 tr.Debug <<
"reading from " <<
filename << std::endl;
136 utility::io::izstream data(
filename.c_str() );
137 if ( !data.good() ) {
138 utility_exit_with_message(
139 "ERROR: Unable to open input file: '" +
filename +
"'"
151 while( getline(data,line) ) {
152 if ( line.substr(0,1) ==
"#" )
continue;
153 std::istringstream line_stream(line);
154 string atomi, atomj, cst_tag, func_tag;
156 line_stream >> cst_tag >> atomi >> resi >> atomj >> resj
159 if ( cst_tag ==
"AtomPair" && func_tag ==
"SOGFUNC" ) {
165 funcs_[resj][resi] = func;
166 funcs_[resi][resj] = func;
169 tr.Error << cst_tag <<
"," << func_tag << std::endl;
170 tr.Error <<
"Ignoring function on line " << line << std::endl;
173 tr.Debug <<
"finished reading." << std::endl;
175 tr.flush_all_channels();
218 using namespace basic::options;
219 using namespace basic::options::OptionKeys;
231 if ( !
have_cst_[seqpos1][seqpos2] )
return;
237 if ( !( rsd1.
type().
has(atom_name) && rsd2.
type().
has(atom_name) ) )
return;
238 Distance dist( rsd1.
xyz(atom_name).distance( rsd2.
xyz(atom_name) ) );
261 Size const seqpos1( atom_id.
rsd() );
262 if ( atom_id.
atomno() != 2 )
return;
265 if ( seqpos1 != seqpos2 &&
have_cst_[seqpos1][seqpos2] ) {
270 numeric::deriv::distance_f1_f2_deriv(