16 #include <basic/options/option.hh>
20 #include <basic/datacache/BasicDataCache.hh>
22 #include <basic/Tracer.hh>
23 #include <utility/excn/Exceptions.hh>
32 #include <basic/options/keys/in.OptionKeys.gen.hh>
33 #include <basic/options/keys/rdc.OptionKeys.gen.hh>
36 #include <utility/io/izstream.hh>
38 #include <utility/vector1.hh>
41 static basic::Tracer
tr(
"core.scoring.ResidualDipolarCoupling_Rohl");
74 using namespace basic::options;
75 using namespace basic::options::OptionKeys;
78 utility::io::izstream infile( filename.c_str() );
82 tr.Info <<
"Reading RDC file " << filename << std::endl;
84 while( getline( infile, line ) ) {
85 std::istringstream line_stream( line );
89 line_stream >> res1 >> atom1 >> res2 >> atom2 >> Jdipolar;
90 if ( line_stream.fail() ) {
91 tr.Error <<
"couldn't read line " << line <<
" in rdc-file " << filename <<
"\n";
92 throw( utility::excn::EXCN_BadInput(
" invalid line "+line+
" in rdc-file "+filename));
96 line_stream >> weight;
97 if ( line_stream.fail() ) {
98 tr.Debug <<
" set weight for RDC " << res1 <<
" to 1.0 " << std::endl;
102 if ( res1 != res2 ) {
103 std::cout <<
"Dipolar couplings only between atoms in the same residue are acceptable !" << std::endl;
113 if ( option[ OptionKeys::rdc::weights ].user() ) {
115 std::ifstream infile( filename.c_str() );
116 while( getline( infile, line ) ) {
117 std::istringstream line_stream( line );
119 line_stream >> res1 >> weight;
120 if ( line_stream.fail() ) {
121 tr.Error <<
"[Error] reading rdc-weight-file " << filename << std::endl;
122 throw( utility::excn::EXCN_BadInput(
" invalid line "+line+
" in rdc-weight-file "+filename));
125 if ( it->res() == res1 ) it->weight( weight );
145 if ( ( atom1 ==
"N" && atom2 ==
"H" ) || ( atom1 ==
"H" && atom2 ==
"N" ) )
148 else if ( ( atom1 ==
"C" && atom2 ==
"H" ) || ( atom1 ==
"H" && atom2 ==
"C" ) )
150 else if ( ( atom1 ==
"C" && atom2 ==
"N" ) || ( atom1 ==
"N" && atom2 ==
"C" ) )
152 else if ( ( atom1 ==
"C" && atom2 ==
"C" ) )
154 else if ( atom1 ==
"H" && atom2 ==
"H" )
159 assert(RDC_type != 0 );