19 #include <basic/Tracer.hh>
25 #include <utility/exit.hh>
26 #include <utility/io/izstream.hh>
27 #include <utility/file/FileName.hh>
30 #include <basic/database/open.hh>
35 #include <utility/vector1.hh>
41 static basic::Tracer
tr(
"core.sequence.MatrixScoringScheme" );
47 using namespace core::chemical;
49 while( getline( input, line ) ) {
50 if ( line.substr(0,1) ==
"#" )
continue;
52 std::istringstream line_stream( line );
53 if ( line.substr(0,1) ==
" " ) {
55 while ( line_stream >> aa, !line_stream.fail() ) {
66 line_stream >> aa_name;
76 if ( line_stream.fail() ) {
77 std::string message =
"Error reading line " + line +
'\n';
78 utility_exit_with_message( message );
92 utility::io::izstream input( fn );
94 utility_exit_with_message(
95 "ERROR: Unable to open MatrixScoringScheme file!" +
std::string(fn)
104 read_from_file( basic::database::full_name(
"sequence/substitution_matrix/" + name ) );
132 runtime_assert( pos1 <= seq1->length() );
133 runtime_assert( pos2 <= seq2->length() );
141 tr.Error <<
"returning score of zero for comparing amino acids "
142 << (*seq1)[pos1] <<
" and " << (*seq2)[pos2] << std::endl;