Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MMBondAngleResidueTypeParam.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 core/scoring/mm/MMBondAngleResidueTypeParam.hh
11 /// @brief Class to store bond angle parameters for a particular ResidueType
12 /// @author Colin A. Smith (colin.smith@ucsf.edu)
13 
14 
15 #ifndef INCLUDED_core_scoring_mm_MMBondAngleResidueTypeParam_hh
16 #define INCLUDED_core_scoring_mm_MMBondAngleResidueTypeParam_hh
17 
18 // Unit headers
20 
21 // Project headers
24 #include <core/types.hh>
25 
26 // Utility header
27 #include <utility/keys/Key2Tuple.hh>
28 #include <utility/keys/Key3Tuple.hh>
29 // AUTO-REMOVED #include <utility/vector1.hh>
30 
31 // C++ headers
32 // AUTO-REMOVED #include <string>
33 #include <map>
34 
35 #include <utility/vector1_bool.hh>
36 
37 
38 namespace core {
39 namespace scoring {
40 namespace mm {
41 
42 typedef utility::keys::Key2Tuple< Size, Size > two_atom_set;
43 typedef utility::keys::Key3Tuple< Size, Size, Size > three_atom_set;
44 
46 {
47 
48 public:
49 
50  /// @brief Default ctor
52 
53  /// @brief initialize the parameters
54  void
55  init(
56  core::chemical::ResidueType const & residue_type,
58  bool use_residue_type_theta0,
59  utility::vector1<std::string> const & central_atoms_to_score
60  );
61 
62  /// @brief get number of intraresidue bond angles
63  Size
65  {
66  return bondangle_atom_sets_.size();
67  }
68 
69  /// @brief Return the indices for the set of atoms that define a particular
70  /// intraresidue angle
71  three_atom_set const &
72  bondangle( Size const bondang ) const
73  {
74  return bondangle_atom_sets_[ bondang ];
75  }
76 
77  /// @brief get Ktheta for a particular intraresidue angle
79  Ktheta( Size const bondang ) const
80  {
81  return Ktheta_[ bondang ];
82  }
83 
84  /// @brief get Ktheta for a particular intraresidue angle
86  theta0( Size const bondang ) const
87  {
88  return theta0_[ bondang ];
89  }
90 
91  /// @brief Returns the list of all of the indices of all the intraresidue
92  /// bond angles a particular atom is involved in.
93  /// Useful for calculating the derivatives for an atom.
95  bondangles_for_atom( Size atomno ) const
96  {
97  return bondangles_for_atom_[ atomno ];
98  }
99 
100  /// @brief Returns the index of the intraresidue bond angle, 0 if not found
101  core::Size
102  bondangle_index( three_atom_set const & atom_set ) const
103  {
104  std::map< three_atom_set, core::Size >::const_iterator iter(bondangle_index_.find(atom_set));
105 
106  if (iter == bondangle_index_.end()) return 0;
107 
108  return iter->second;
109  }
110 
111  /// @brief number of ResidueConnections, counting polymeric residue connections
112  Size
114  {
115  return connection_atom_sets_.size();
116  }
117 
118  /// @brief number of ResidueConnections, counting polymeric residue connections
119  Size
120  n_connection_pairs( Size const connection ) const
121  {
122  return connection_atom_sets_[ connection ].size();
123  }
124 
125  /// @brief Return the indices for the set of two atoms that form part of a interresidue bond angle
126  two_atom_set const &
127  connection_pair( Size const connection, Size const bondang ) const
128  {
129  return connection_atom_sets_[ connection ][ bondang ];
130  }
131 
132  /// @brief Return ResidueType derived theta0 for a interresidue bond angle
133  core::Real
134  connection_theta0( Size const connection, Size const bondang ) const
135  {
136  return connection_theta0_[ connection ][ bondang ];
137  }
138 
139  /// @brief Return whether to use ResidueType derived theta0 for a interresidue bond angle
140  bool
141  connection_use_theta0( Size const connection, Size const bondang ) const
142  {
143  return connection_use_theta0_[ connection ][ bondang ];
144  }
145 
146  /// @brief Returns the index of the interresidue bond angle, 0 if not found
147  core::Size
148  connection_index( Size const connection, two_atom_set const & atom_set ) const
149  {
150  std::map< two_atom_set, core::Size >::const_iterator iter(connection_index_[ connection ].find(atom_set));
151 
152  if (iter == connection_index_[ connection ].end()) return 0;
153 
154  return iter->second;
155  }
156 
157  /// @brief stream << MMBondAngleResidueTypeParam
158  friend
159  std::ostream &
160  operator <<(
161  std::ostream & os,
162  MMBondAngleResidueTypeParam const & residue_type_param
163  );
164 
165 private:
166 
167  /// @brief vector of sets of atoms that make up bond angles in the residue
169  /// @brief vector of Ktheta values for each set
171  /// @brief vector of theta0 values for each set
173  /// @brief all intra-residue bond angles that each atom "participates" in.
175  /// @brief map to lookup a bondangle given its three atoms
176  std::map< three_atom_set, core::Size > bondangle_index_;
177 
178  /// @brief vector of vector of pairs of atoms that take part in interresidue bond angles
180  /// @brief vector of vector of theta0 values for pairs of atoms that take part in interresidue bond angles
182  /// @brief vector of vector of booleans indicating whether to use theta0_ or lookup on the fly
184  /// @brief vector of maps for lookup of interresidue theta0 parameters
186 
187  // The case in which a bond spanse two residue connections simultaneously should be able to be handled. One would
188  // need to write code to detect multiple residue connections to the same atom, build both connected atoms
189  // simultaneously, then calculate the theta0 value. Some additional instance variable data structures would need to
190  // be incorporated to store/lookup the information.
191 
192 };
193 
194 } // namespace mm
195 } // namespace scoring
196 } // namespace core
197 
198 
199 #endif // INCLUDED_core_mm_MMBondAngleResidueTypeParam_HH