Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VallChunk.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 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/frag_picker/VallChunk.hh
11 /// @brief a contiguous chunk of residues taken from a vall.
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 
15 #ifndef INCLUDED_protocols_frag_picker_VallChunk_hh
16 #define INCLUDED_protocols_frag_picker_VallChunk_hh
17 
18 // unit headers
20 
21 // package headers
24 
25 // mini
27 
28 #include <core/pose/Pose.fwd.hh>
29 #include <utility/vector1.hh>
30 #include <utility/exit.hh>
31 
32 namespace protocols {
33 namespace frag_picker {
34 
35 /// @brief represents a chunk of residues extracted from a vall.
36 /// @detailed VallChunk contains a vector of VallResidue objects and provides a basic ways to access them
38 public:
39  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
40  virtual ~VallChunk();
41 
42  VallChunk(VallProviderAP provider);
43 
44  /// @brief returns a PDB id (a string of four letters, e.g. "4mba")
45  inline std::string get_pdb_id() const {
46  return at(1)->id().substr(0, 4);
47  }
48 
49  /// @brief returns protein chain ID
50  inline char get_chain_id() const {
51  return at(1)->id()[4];
52  }
53 
54  /// @brief returns integer key of this chunk, which is the key of this chunk's first residue
55  inline Size key() const {
56  return at(1)->key();
57  }
58 
59  /// @brief returns the size of this chunk i.e. the number of residues stored in there
60  inline Size size() const {
61  return residues_.size();
62  }
63 
64  /// @brief returns i-th residue form this chunk. The first residue has index 1
65  inline VallResidueOP at(Size index) const {
66  runtime_assert( index <= residues_.size() );
67  runtime_assert( index >= 1 );
68  return residues_.at(index);
69  }
70 
71  /// @brief appends a residue to this chunk
72  inline void push_back(VallResidueOP what) {
73  residues_.push_back(what);
74  }
75 
76  /// @brief returns amino acid sequence of this chunk
78 
79  /// @brief returns amino acid profile of this chunk
80  /// @detailed the profile object is created when this function is called for the first time
81  /// and then cached within a VallProvider object.
82  /// Every time this method is called for a new chunk, VallProvider caches new data
84 
85  /// @brief returns a pose created for this chunk
86  /// @detailed the pose object is created when this function is called for the first time
87  /// and then cached within a VallProvider object
88  /// Every time this method is called for a new chunk, VallProvider caches new data
90 
91  /// @brief returns a string that is unique for each chunk in vall
93 private:
98  bool has_key_;
99 
100  void create_key();
101 };
102 
103 } // frag_picker
104 } // protocols
105 
106 
107 #endif /* INCLUDED_protocols_frag_picker_VallChunk_HH */