18 #include <basic/Tracer.hh>
21 #include <utility/exit.hh>
27 namespace frag_picker {
31 static basic::Tracer
tracer(
"protocols.frag_picker.LAMBEGO_IO");
34 bin_names_.push_back(
'L' );
35 bin_names_.push_back(
'A' );
36 bin_names_.push_back(
'M' );
37 bin_names_.push_back(
'B' );
38 bin_names_.push_back(
'E' );
39 bin_names_.push_back(
'G' );
40 bin_names_.push_back(
'O' );
49 using std::istringstream;
52 getline( input, line );
53 tracer.Debug <<
"read header " << line << std::endl;
57 while( getline( input, line ) ) {
58 if ( line.substr(0,1) ==
"#" )
continue;
59 istringstream line_stream( line );
60 tracer.Debug <<
"line " << line << std::endl;
68 for (
Size ii = 1, n_bins = bin_names_.size(); ii <= n_bins; ++ii ) {
69 line_stream >> per_residue_probs[ii];
71 if ( line_stream.fail() ) {
72 utility_exit_with_message(
"Error reading in LAMBEGO_IO::read()!" );
74 runtime_assert( per_residue_probs.size() == bin_names_.size() );
75 probs_.push_back( per_residue_probs );
85 end = bin_names_.end(); it !=
end; ++it
88 if ( it + 1 !=
end ) output <<
' ';
94 row_end = probs_.end(); row_it != row_end; ++row_it
96 output << seq_idx <<
' ' << sequence_[seq_idx-1] <<
' ';
98 end = row_it->end(); it !=
end; ++it
101 if ( it + 1 !=
end ) output <<
' ';
110 runtime_assert( idx <= probs_.size() );
111 return probs_[ idx ];
119 return probs_.size();