39 #include <basic/Tracer.hh>
42 #include <utility/exit.hh>
60 basic::Tracer
TR_PCS_d_i(
"protocols.scoring.methods.pcs.PCS_data_input");
68 utility_exit_with_message(
"You shouldn't call the empty constructor for PCS_line_data class" );
72 residue_num_(other.residue_num_),
73 atom_name_(other.atom_name_),
74 PCS_experimental_(other.PCS_experimental_),
75 PCS_tolerance_(other.PCS_tolerance_)
82 if (
this != &other ) {
92 filename_(
""), weight_(0)
94 utility_exit_with_message(
"You shouldn't call the empty constructor for PCS_file_data class" );
101 filename_(other.filename_), weight_(other.weight_)
108 if (
this != &other ) {
116 utility_exit_with_message(
"You shouldn't call the empty constructor for PCS_data_input class" );
128 if (
this != &other ) {
160 residue_num_( residue_num ),
161 atom_name_(atom_name),
162 PCS_experimental_(PCS_experimental),
163 PCS_tolerance_(PCS_tolerance)
167 std::map< std::string, PCS_file_data > &
183 filename_(std::
string(filename)), weight_(my_weight)
194 for (i = 1; i <= filenames.size(); i++){
195 weight_sum += weight[i];
198 for (i = 1; i <= filenames.size(); i++){
213 std::ifstream myfile;
219 if (!myfile.is_open ()){
220 std::cerr <<
"Unable to open the file '" <<
get_filename().c_str() <<
"'" << std::endl;
224 while( getline( myfile, line ) ) {
226 std::istringstream line_stream( line ,std::istringstream::in);
227 if( (line_stream >> residue_num >> atom_name >> PCS_experimental >> PCS_tolerance).fail()){
228 TR_PCS_d_i <<
"Ignoring line " <<line_number <<
": `" << line <<
"` from file " <<
get_filename() <<std::endl;
245 out <<
"Residue: " << std::setw(4) << PCS_l_d.
residue_num();
246 out <<
" Atom: " << std::setw(4) << PCS_l_d.
atom_name();
248 out <<
" Tolerance: " << std::setw(7) << PCS_l_d.
PCS_tolerance()<< std::endl;
258 for ( it = PCS_d_l_a.begin(); it != PCS_d_l_a.end(); ++it){
261 out<< PCS_d_l_a.size() <<
" PCS in total for this file" << std::endl;
268 std::map< std::string, PCS_file_data >::iterator it;
269 std::map< std::string, PCS_file_data > mymap;
272 for ( it = mymap.begin(); it != mymap.end(); ++it ) {
273 out <<
"For the file '" << it->first <<
"' the PCS are:" << std::endl;
275 out <<
"The relative weight is " << (it->second).get_weight() << std::endl;
298 for(i = 1; i <= filenames.size(); ++i){
302 std::map< std::string, PCS_data_input >::iterator it;
312 file_2_data_map_.insert(it, std::pair< std::string , PCS_data_input >(
id ,pcs_d_i));