27 #include <ObjexxFCL/string.functions.hh>
29 #include <utility/io/izstream.hh>
30 #include <utility/exit.hh>
33 #include <basic/Tracer.hh>
39 #include <utility/vector1.hh>
48 static basic::Tracer
tr(
"protocols.rna.rna_structure_parameters" ) ;
62 if ( rna_data_file.length() == 0 )
return;
66 backbone_burial_.dimension( nres,
false );
67 backbone_exposed_.dimension( nres,
false );
69 read_data_from_file( rna_data_file );
71 for (
Size i = 1; i <= nres; i++ ) {
72 if ( backbone_burial_( i ) && backbone_exposed_( i ) ) {
73 utility_exit_with_message(
"Cannot ask for both backbone exposure and burial: "+ObjexxFCL::string_of(i) );
77 setup_rna_data( pose );
86 using namespace core::scoring::rna;
91 while ( !line_stream.fail() ) {
95 if ( pos > array_to_fill.size() ) {
96 utility_exit_with_message(
"Problem with data format on BACKBONE_BURIAL line. " );
99 array_to_fill( pos ) =
true;
111 using namespace core::scoring::rna;
117 while ( !line_stream.fail() ) {
119 line_stream >> pos >> edge >> weight;
123 }
else if ( edge ==
'H' ) {
125 }
else if ( edge ==
'S' ) {
127 }
else if ( edge ==
'X' ) {
132 utility_exit_with_message(
"Problem with data format on DATA line. " );
144 tr <<
"Reading RNA data file: " << filename << std::endl;
148 utility::io::izstream data_stream( filename );
149 if ( !data_stream ) {
151 utility_exit_with_message(
"Data file? " + filename );
156 while ( getline( data_stream, line ) ) {
158 std::istringstream line_stream( line );
161 if (line_stream.fail() )
continue;
163 if ( tag ==
"EXPOSE" ) {
165 read_data_info( line_stream );
167 }
else if ( tag ==
"BACKBONE_BURIAL" ) {
169 read_burial_info( line_stream, backbone_burial_ );
171 }
else if ( tag ==
"BACKBONE_EXPOSE" ) {
173 read_burial_info( line_stream, backbone_exposed_ );
175 }
else if ( tag[0] ==
'#' ) {
179 utility_exit_with_message(
"Unrecognized tag in data file: " + tag );
191 rna_data_info_.set_backbone_burial( backbone_burial_ );
192 rna_data_info_.set_backbone_exposed( backbone_exposed_ );
196 rna_data_info = rna_data_info_;