Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomBasedConstraintsScore.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/scores/AtomBasedConstraintsScore.hh
11 /// @brief
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 #ifndef INCLUDED_protocols_frag_picker_scores_AtomBasedConstraintsScore_hh
15 #define INCLUDED_protocols_frag_picker_scores_AtomBasedConstraintsScore_hh
16 
18 
19 // package headers
23 // mini
24 #include <numeric/xyzVector.hh>
25 #include <utility/vector1_bool.hh>
26 #include <map>
27 
28 #include <utility/vector1.hh>
29 
30 
31 
32 namespace protocols {
33 namespace frag_picker {
34 namespace scores {
35 
36 /// @brief A base class for all scoring methods that need atom coordinates
37 /// @detailed The base class provides an access to atom coordinates from the current chunk
38 /// It takes care of caching proper atoms from the pose for fast access.
40 public:
41 
42  /// @brief Prepare an atom-based score that utilizes some user-defined atoms
43  /// @detailed User may provide names of atoms that will be cached when a new
44  /// chunk is considered (i.e. at every do_caching() call)
47 
48  /// @brief Prepare an atom-based score that utilizes the following predefined atoms: N, CA, C, O and CB
49  /// @detailed These atoms that will be cached when a new
50  /// chunk is considered (i.e. at every do_caching() call)
52 
53  /// @brief In this case caching means copying coordinates of relevant atoms from a chunk's pose
54  void do_caching(VallChunkOP);
55 
56  /// @brief Erases the internal array of coordinates
57  void clean_up();
58 
59  /// @brief Returns true if a given atom has been successfully cached and one can use its coordinates
60  /// @param residue_id the residue order number. The first is 1,
61  /// the last one depends on the size of a pose i.e. the size of the current chunk
62  /// @param atom_id the residue order number, the first is 1
63  inline bool has_atom(Size residue_id, Size atom_id) {
64  assert(residue_id<=atom_flags_.size());
65  assert(atom_id<=atom_flags_[residue_id].size());
66  return atom_flags_[residue_id][atom_id];
67  }
68 
69  /// @brief Returns coordinates for a given atom
70  /// @param residue_id the residue order number. The first is 1,
71  /// the last one depends on the size of a pose i.e. the size of the current chunk
72  /// @param atom_id the residue order number, the first is 1
74  Size atom_id) {
75  assert(residue_id<=chunk_atoms_xyz_.size());
76  assert(atom_id<=chunk_atoms_xyz_[residue_id].size());
77  return chunk_atoms_xyz_[residue_id][atom_id];
78  }
79 
80  /// @brief Returns a map that defines all constrained atoms used by this scoring method
81  /// @detailed Returned map defines the order of atoms as they are stored inside this object.
82  /// Indexes defined y this map can be used as arguments for has_atom() and get_atom_coordinates() methods.
83  inline std::map<std::string, Size> get_constrainable_atoms_map() {
84  return constrainable_atoms_;
85  }
86 
87  /// @brief returns an internal ID assigned to a given atom name
88  /// @detailed this ID remains the same for all residues
90  return constrainable_atoms_.find(atom_name)->second;
91  }
92 
93  /// @brief returns a name of a constrained atom when its internal ID is known
94  /// @detailed this is the oposite to get_constrained_atom_id(std::string)
96 
97  /// @brief provides an access to the size of the length of a query sequence
98  inline Size get_query_size() {
99  return query_size_;
100  }
101 
102 private:
107  Size get_atom_type(std::string atom_name);
108  std::map<std::string, Size> constrainable_atoms_;
109 };
110 
111 } // scores
112 } // frag_picker
113 } // protocols
114 
115 #endif /* INCLUDED_protocols_frag_picker_scores_AtomBasedConstraintsScore_HH */
116