22 #include <basic/database/open.hh>
23 #include <basic/Tracer.hh>
26 #include <utility/io/izstream.hh>
31 static basic::Tracer
tr(
"protocols.noesy_assign.crosspeaks");
34 namespace noesy_assign {
41 load_database_table();
45 if ( instance_ == 0 ) {
52 MethylNameTable::const_iterator it = methyl_names_.find( aa );
53 if ( it == methyl_names_.end() ) {
54 utility_exit_with_message(
name_from_aa( aa )+
" is not a known aminoacid-type in NMR proton Database" );
60 utility::io::izstream db_stream;
61 basic::database::open(db_stream,
"chemical/residue_type_sets/fa_standard/nmr_nameing_conventions.txt" );
65 MethylNameTable::iterator current;
66 while ( getline( db_stream, line ) ) {
67 if ( line[0] ==
'#' )
continue;
68 std::istringstream line_stream( line );
69 line_stream >> aa_name;
70 if ( !line_stream.good() && aa_name.size() != 1 )
continue;
71 if ( last_aa != aa_name ) {
75 current = methyl_names_.find( aa );
78 line_stream >> nmr >> rosetta;
79 if ( nmr.size() && rosetta.size() ) {
80 current->second.add_proton( nmr, rosetta);
84 line_stream >> tag >> methyl;
85 tr.Trace <<
"read: " << tag <<
" " << methyl << std::endl;
86 if ( !line_stream.bad() && tag ==
">" ) {
87 current->second.add_methyl( methyl, rosetta );
89 if ( line_stream.good() ) {
90 line_stream >> methyl;
91 if ( !line_stream.bad() ) {
92 current->second.add_methyl( methyl, rosetta );
103 tr.Trace <<
aa_ <<
" add proton " << nmr <<
" " << rosetta << std::endl;
109 tr.Trace <<
aa_ <<
" add methyl " << methyl <<
" " << rosetta << std::endl;
113 rit->second.push_back( methyl );
120 it->second.push_back( rosetta );
131 std::map< std::string, std::string >::const_iterator it =
rosetta2nmr_.find( proton );
139 NameTable::const_iterator it =
nmr2rosetta_.find( proton );
156 for ( NameTable::const_iterator it =
begin(); it !=
end(); ++it, ++ct ) {
157 if ( it->first == proton )
return ct;