Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CSTalosIO.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file protocols/frag_picker/CSTalosIO.hh
10 /// @brief Class that reads and writes chemical shifts in TALOS format
11 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
12 
13 #ifndef INCLUDED_protocols_frag_picker_CSTalosIO_hh
14 #define INCLUDED_protocols_frag_picker_CSTalosIO_hh
15 
16 // utility headers
17 #include <core/types.hh>
18 
19 #include <string>
20 #include <map>
21 
22 // boost headers
23 #include <boost/tuple/tuple.hpp>
24 // AUTO-REMOVED #include <utility/vector1.hh>
25 
26 #include <utility/vector1_bool.hh>
27 
28 
29 namespace protocols {
30 namespace frag_picker {
31 
32 using namespace core;
33 
34 class CSTalosIO {
35 public:
36 
38  first_residue_index_ = 1;
39  set_up_atom_order();
40  }
41 
42  CSTalosIO(std::string file_name) {
43  first_residue_index_ = 1;
44  set_up_atom_order();
45  read(file_name);
46  }
47 
49  repack_to_matrix();
50 
52  return first_residue_index_;
53  }
54 
56  return first_residue_index_ + sequence_.length() - 1;
57  }
58 
60  return sequence_;
61  }
62 
63  bool has_entry(Size residue_id) {
64  if (resids_to_entries_map_.find(residue_id)
65  != resids_to_entries_map_.end())
66  return true;
67  return false;
68  }
69 
70  void get_tuples(Size, utility::vector1<boost::tuple<Size, char,
71  std::string, Real> >);
72 
73  void get_tuples(Size, utility::vector1<boost::tuple<Size, char,
74  std::string, Real> > &) const;
75 
77  return entries_;
78  }
79 
80  void write(std::ostream&);
81  void read(std::string const&);
82  Real get_shift(Size, std::string const &) const;
83  bool has_atom(Size, std::string const &) const;
84 
85 private:
91  std::multimap<Size, Size> resids_to_entries_map_;
92  std::map<std::string, Size> order_of_atoms_;
93  void print_sequence(std::string const &, std::ostream &) const;
96  void set_up_atom_order();
97 };
98 
99 } // frag_picker
100 } // protocols
101 
102 #endif /* INCLUDED_protocols_frag_picker_CSTalosIO_HH */
103