26 #include <basic/database/open.hh>
28 #include <basic/Tracer.hh>
46 using namespace coarse;
50 : atom_set_(atom_set) {
54 basic::database::full_name(
"scoring/score_functions/etable/resolve_etable.twobead.txt" ),
55 basic::database::full_name(
"scoring/score_functions/etable/etable.twobead.lj.dat" ),
56 basic::database::full_name(
"etable.twobead.dlj.dat" )
59 std::string msg =
"do not know how to load etable "+tag;
60 utility_exit_with_message( msg );
69 for (
Size i=1;i<=normal->n_atomtypes();i++) {
70 string name = (*normal)[i].name();
71 Size ii=coarse->atom_type_index(name);
73 cerr <<
" --------------- WARNING --------------------- " << endl;
74 cerr <<
" incompatible atomtype indexes -- reorder coarse atomset or change program " << endl;
75 cerr <<
" if you go on, the wrong entries from the normal full-atom etable might be used " << endl;
76 cerr <<
" ------WARNING-----------------WARNING---------" << endl;
78 cerr << i <<
' ' << ii <<
' ' << name << endl;
89 T(
"coarse.scoring") <<
"prepare coarse scoring for " << rsd1.
type().
name() <<
" " << rsd2.
type().
name() <<
"\n";
96 os << i <<
' ' << (*atom_set_)[i].name() << endl;
99 for (
int aa = 1; aa<=20; aa++) {
100 for (
int ibead = 1;ibead<=nBeads;ibead++) {
101 os << -((aa-1)*nBeads+ibead) <<
' '
102 << rsd_set.
aa_map(static_cast<chemical::AA>(aa)).front()->name3() <<
"_B" << ibead+1 << endl;
117 const int TABLE_LENGTH ( 721 );
119 std::ifstream resolve( fn_resolve.c_str() );
127 while (getline( resolve, line )) {
128 std::istringstream l( line );
132 for (
int i=0;i<2;i++) {
134 if ( l.fail() )
goto error;
139 if ( l.fail() )
goto error;
141 if ( l.fail() )
goto error;
142 entries.push_back(entry);
148 utility_exit_with_message(
"CoarseEtable::read_file: bad line: "+ line );
150 cerr <<
"creating resolve_table with " <<
maxType <<
' ' <<
maxDist+1 << endl;
153 cerr <<
"fill resolve_table " << endl;
154 for (Entries::const_iterator it=entries.begin(), eit=entries.end(); it!=eit; ++it) {
155 resolve_(it->type[0],it->type[1],it->seq_dist_+1)=it->ID;
156 resolve_(it->type[1],it->type[0],it->seq_dist_+1)=it->ID;
161 cerr <<
"fill missing entries in resolve table ... " << endl;
163 for (
int ti=1;ti<=
maxType;ti++) {
164 for (
int tj=1;tj<=
maxType;tj++) {
174 std::ifstream eet( fn_etable.c_str() );
175 std::ifstream det( fn_dtable.c_str() );
177 cerr <<
"read etable data " << endl;
178 for (
int i=1;i<=
maxID;i++) {
179 for (
int k=1;k<=TABLE_LENGTH;k++) {
186 cerr <<
"check table " <<
maxID << endl;
187 for (
int k=1;k<TABLE_LENGTH;k++) {
211 int const l1 =
etable_.index( disbin, eID ),
l2 = l1 + 1;
213 bb = ( e1 + frac * (
etable_[
l2 ] - e1 ) );
232 int const l1 =
dtable_.index( disbin, eID),
l2 = l1 + 1;