Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomType.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 /// @begin AtomType
11 ///
12 /// @brief
13 /// A class for defining atom parameters, known as atom_types
14 ///
15 /// @detailed
16 /// This class contains the "chemical" information for atoms. This does not contain the actual
17 /// xyz coordinates of the class (xyz found in core/conformation/Atom.hh. The atom_type properties
18 /// are assigned by the class AtomTypeSet which is initiated from the ChemicalManager. Atom type properties
19 /// are currently are read in from the file located chemical/atom_type_sets/fa_standard/atom_properties.txt.
20 /// These properties contain the the properties of LJ_RADIUS, LJ_WDEPTH, LK_DGRFREE, LK_LAMBDA, LK_VOLUME.
21 /// These properties are used in the scoring function fa_atr, fa_rep, fa_sol, which is located in the Etable (core/scoring/etable/Etable.hh)
22 /// Additional parameters are acceptor/donor, hybridzation, and orbital paramaters.
23 ///
24 ///
25 ///
26 /// @authors
27 /// Phil Bradley
28 /// Steven Combs - comments
29 ///
30 ///
31 /// @last_modified December 6 2010
32 /////////////////////////////////////////////////////////////////////////
33 
34 
35 #ifndef INCLUDED_core_chemical_AtomType_hh
36 #define INCLUDED_core_chemical_AtomType_hh
37 
38 
39 // Unit headers
41 #include <core/types.hh>
42 
43 // Package headers
44 #include <core/chemical/types.hh>
45 
46 // Utility headers
47 #include <utility/vector1_bool.hh>
48 
49 // C++ headers
50 #include <string>
51 
52 namespace core {
53 namespace chemical {
54 
55 /// @brief Maximum distance between a heavy atom and a hydrogen atom
56 /// to which it is chemically bound Set in .cc file.
58 
59 
60 /// @brief basic atom type
61 ///
62 /// @details name, element, certain properties and parameters
63 ///
64 class AtomType {
65 
66 public:
67 
68  /// @brief Construct a new atom type with its name and element.
69  ///
70  /// @details All its properties are unset by default.
71  ///
72  AtomType( std::string const & name_in, std::string const element_in ):
73  name_( name_in ),
74  element_( element_in ),
75  is_acceptor_( false ),
76  is_donor_( false ),
77  is_polar_hydrogen_( false ),
78  is_h2o_( name_in == "HOH" ),
79  is_aromatic_( false ),
80  atom_has_orbitals_(false),
81  atom_is_virtual_(false),
83  {}
84 
85  AtomType(AtomType const & src) :
86  name_(src.name_ ),
87  element_(src.element_),
89  is_donor_(src.is_donor_),
91  is_h2o_(src.is_h2o_),
96  {}
97 
98  void
99  print( std::ostream & out ) const;
100 
101  friend
102  std::ostream &
103  operator<< ( std::ostream & out, const AtomType & atom_type );
104 
105  /// @brief Lazaridis and Karplus solvation parameter -- lambda
106  Real
107  lk_lambda() const
108  {
109  return lk_lambda_;
110  }
111 
112  /// @brief Lazaridis and Karplus solvation parameter -- dgfree
113  Real
114  lk_dgfree() const
115  {
116  return lk_dgfree_;
117  }
118 
119  /// @brief Lazaridis and Karplus solvation parameter -- volume
120  Real
121  lk_volume() const
122  {
123  return lk_volume_;
124  }
125 
126  /// @brief Lennard-Jones 6-12 potential parameter -- atom radius
127  Real
128  lj_radius() const
129  {
130  return lj_radius_;
131  }
132 
133  /// @brief Lennard-Jones 6-12 potential parameter -- well depth
134  Real
135  lj_wdepth() const
136  {
137  return lj_wdepth_;
138  }
139 
140 
141  /// @brief whether atom is a hydrogen bond acceptor
142  bool
143  is_acceptor() const
144  {
145  return is_acceptor_;
146  }
147 
148  /// @brief whether atom is a hydrogen bond donor
149  bool
150  is_donor() const
151  {
152  return is_donor_;
153  }
154 
155  /// @brief whether atom is a polar hydrogen atom
156  bool
158  {
159  return is_polar_hydrogen_;
160  }
161 
162  /// @brief whether atom is a hydrogen atom
163  bool
164  is_hydrogen() const
165  {
166  return ( element_ == "H" );
167  }
168 
169  // this is a little silly
170  /// @brief whether atom is a heavy atom
171  bool
172  is_heavyatom() const
173  {
174  return ( element_ != "H" );
175  }
176 
177  ///@brief is atom type virtual?
178  bool is_virtual() const;
179 
180  /// @brief whether atom is a water
181  bool
182  is_h2o() const
183  {
184  return is_h2o_;
185  }
186 
187  /// @brief whether atom is aromatic
188  bool
189  is_aromatic() const
190  {
191  return is_aromatic_;
192  }
193 
194  /// @brief atom has an orbital attached
195  bool
197  {
198  return atom_has_orbitals_;
199  }
200 
201  /// @brief is the H atom aromatic?
202  bool is_haro() const
203  {
204  return ( name_ == "Haro" );
205  }
206 
207 
208 
209  /// @brief set LJ and LK solvation parameter for this atom type
210  void
212  std::string const & param,
213  Real const setting
214  );
215 
216 
217  /// @brief set relevant properties for this atom type hh
218  void
219  set_property(
220  std::string const & property,
221  bool const setting
222  );
223 
224  /// @brief retrieve an atom's hybridization status.
225  Hybridization const &
227  {
228  return hybridization_;
229  }
230 
231  ///@brief set all standard properties to false, set hybridization to
232  ///UNKNOWN_HYBRID, and clear extra properties
233  ///
234  void
236 
237  ///@brief set standard property to true, or set the specified hybridization
238  void
239  add_property(
240  std::string const & property);
241 
243  get_all_properties() const;
244 
245  /// @brief returns the one- or two-letter element type
247  element() const
248  {
249  return element_;
250  }
251 
254  {
255  return name_;
256  }
257 
258  /// @brief return an additional, non-hardcoded property
259  Real
260  extra_parameter( Size const index ) const
261  {
262  return extra_parameters_[ index ];
263  }
264 
265  /// @brief return an additional, non-hardcoded property
266  void
267  set_extra_parameter( Size const index, Real const setting )
268  {
269  if ( extra_parameters_.size() < index ) extra_parameters_.resize( index, 0.0 );
270  extra_parameters_[ index ] = setting;
271  }
272 
273  /// @set all the extra parameters at once
274  void
276  utility::vector1< Real > const & extra_parameters);
277 
278  std::string const& name() const { return name_; };
279 
280  // data
281 private:
282 
283  // name
284  std::string const name_;
285 
286  // element
288 
289  // lj
292 
293  // lk
297 
298  // extras
300 
301  // props -- false by default
302  // doh! gccdebug does not default construct bools to false!
303  // so if you add anything here and you want it to be false by default,
304  // set it in the constructor!!!!
306  bool is_donor_;
308  bool is_h2o_;
312 
314 
315 };
316 
317 
318 } // chemical
319 } // core
320 
321 
322 
323 #endif // INCLUDED_core_chemical_AtomType_HH