Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomType.cc
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 
36 
37 
38 
39 // Rosetta headers
41 
42 // Utility headers
43 #include <utility/exit.hh>
44 #include <basic/Tracer.hh>
45 
46 // C++ headers
47 #include <algorithm>
48 
49 namespace core {
50 namespace chemical {
51 
52 /// @details S-H bond length in CYS.
54 
55 void
57  std::ostream & out
58 ) const {
59 
60  out
61  << "Atom Type: " << name() << std::endl
62  << " element: " << element() << std::endl
63  << " Lennard Jones: radius=" << lj_radius() << " wdepth=" << lj_wdepth() << std::endl
64  << " Lazaridis Karplus: lambda=" << lk_lambda() << " "
65  << "volume=" << lk_volume() << " "
66  << "dgfree=" << lk_dgfree() << std::endl
67  << " properties: "
68  << (is_acceptor() ? "ACCEPTOR " : "")
69  << (is_donor() ? "DONOR " : "")
70  << (is_polar_hydrogen() ? "POLAR_HYDROGEN " : "")
71  << (is_h2o() ? "H2O " : "")
72  << (is_aromatic() ? "AROMATIC " : "")
73  << (atom_has_orbital() ? "ORBITALS " : "");
74  switch(hybridization()){
75  case SP2_HYBRID: out << "SP2_HYBRID "; break;
76  case SP3_HYBRID: out << "SP3_HYBRID "; break;
77  case RING_HYBRID: out << "RING_HYBRID "; break;
78  case UNKNOWN_HYBRID: break;
79  default:
80  utility_exit_with_message("Attempting retrive hydrid for atom type '" + name() + "', however the hybridization type is not recognized.");
81  }
82  out << std::endl;
83  out << "Extra Parameters:";
84  for(Size i = 1; i <= extra_parameters_.size(); ++i){
85  out << " " << extra_parameters_[i];
86  }
87  out << std::endl;
88 }
89 
90 std::ostream &
91 operator<< (std::ostream & out, const AtomType & atom_type ){
92  atom_type.print( out );
93  return out;
94 }
95 
96 
97 ///@brief is atom type virtual?
99 {
100  assert( (name_ == "VIRT") ? atom_is_virtual_ : true ); // Raise an error if an atom type named VIRT is not virtual.
101  return (atom_is_virtual_);
102 }
103 
104 ///////////////////////////////////////////////////////////////////////////////
105 /// @brief set LJ and LK solvation parameter for this atom type
106 ///
107 /// @details currently parameters are "LJ_RADIUS","LJ_WDEPTH","LK_VOLUME",
108 /// "LK_DGFREE","LK_LAMBDA".It will abort if the parameter name is not
109 /// recoganized. Supplemented by membrane specific solvation parameters:
110 /// "MEMB_LK_DGFREE","MEMB_LK_DGREFCE","LK_DGREFCE". These are the header files
111 /// in atom_properties.txt
112 ///
113 void
115  std::string const & param,
116  Real const setting
117 )
118 {
119  if ( param == "LJ_RADIUS" ) {
120  lj_radius_ = setting;
121  } else if ( param == "LJ_WDEPTH" ) {
122  lj_wdepth_ = setting;
123  } else if ( param == "LK_VOLUME" ) {
124  lk_volume_ = setting;
125  } else if ( param == "LK_DGFREE" ) {
126  lk_dgfree_ = setting;
127  } else if ( param == "LK_LAMBDA" ) {
128  lk_lambda_ = setting;
129  /*} else if ( param == "MEMB_LK_DGFREE" ) { //pba
130  memb_lk_dgfree_ = setting;
131  } else if ( param == "LK_DGREFCE" ) { //pba
132  lk_dgrefce_ = setting;
133  } else if ( param == "MEMB_LK_DGREFCE" ) { //pba
134  memb_lk_dgrefce_ = setting;*/
135  } else {
136  utility_exit_with_message( "unrecognized atomtype parameter "+param );
137  }
138 }
139 
140 ///////////////////////////////////////////////////////////////////////////////
141 /// @brief set relevant properties for this atom type
142 ///
143 /// @details currently properties are "ACCEPTOR","DONOR","POLAR_HYDROGEN",
144 /// "H2O", and hybridization types including "SP2_HYBRID", "SP3_HYBRID" and
145 /// "RING_HYBRID". It will abort if the property name is not recoganized. To add
146 /// properties, edit atom_properties.txt and add your property to the last column
147 /// then add code here that will read the property.
148 ///
149 void
151  std::string const & property,
152  bool const setting
153 )
154 {
155  if ( property == "ACCEPTOR" ) {
156  is_acceptor_ = setting;
157  } else if ( property == "DONOR" ) {
158  is_donor_ = setting;
159  } else if ( property == "POLAR_HYDROGEN" ) {
160  is_polar_hydrogen_ = setting;
161  } else if(property == "AROMATIC"){
162  is_aromatic_ = setting;
163  } else if ( property == "H2O" ) {
164  is_h2o_ = setting;
165  } else if (property == "ORBITALS"){ //is the atom type orbital? defined in atom_properties.txt
166  atom_has_orbitals_ = setting;
167  } else if(property == "VIRTUAL"){ //is the atom type virtual? defined in atom_properties.txt
168  atom_is_virtual_ = setting;
169  } else if ( property == "SP2_HYBRID" ) {
171  } else if ( property == "SP3_HYBRID" ) {
173  } else if ( property == "RING_HYBRID" ) {
175  } else {
176  utility_exit_with_message( "unrecognized atomtype property "+property );
177  }
178 }
179 
180 void
182  is_acceptor_ = false;
183  is_donor_ = false;
184  is_polar_hydrogen_ = false;
185  is_aromatic_ = false;
186  is_h2o_ = false;
187  atom_has_orbitals_ = false;
188  atom_is_virtual_ = false;
190  extra_parameters_.clear();
191 }
192 
193 void
195  std::string const & property
196 ) {
197  if ( property == "ACCEPTOR" ) {
198  is_acceptor_ = true;
199  } else if ( property == "DONOR" ) {
200  is_donor_ = true;
201  } else if ( property == "POLAR_HYDROGEN" ) {
202  is_polar_hydrogen_ = true;
203  } else if(property == "AROMATIC"){
204  is_aromatic_ = true;
205  } else if ( property == "H2O" ) {
206  is_h2o_ = true;
207  } else if (property == "ORBITALS"){
208  atom_has_orbitals_ = true;
209  } else if(property == "VIRTUAL"){
210  atom_is_virtual_ = true;
211  } else if ( property == "SP2_HYBRID" ) {
213  } else if ( property == "SP3_HYBRID" ) {
215  } else if ( property == "RING_HYBRID" ) {
217  } else {
218  utility_exit_with_message("Attempting to set non-existant property '" + property + "' on atom type '" + name() + "'.");
219  }
220 }
221 
222 
226  if(is_acceptor()) properties.push_back("ACCEPTOR");
227  if(is_donor()) properties.push_back("DONOR");
228  if(is_polar_hydrogen()) properties.push_back("POLAR_HYDROGEN");
229  if(is_aromatic()) properties.push_back("AROMATIC");
230  if(is_h2o()) properties.push_back("H2O");
231  if(atom_has_orbital()) properties.push_back("ORBITALS");
232  if(is_virtual()) properties.push_back("VIRTUAL");
233 
234  switch(hybridization()){
235  case SP2_HYBRID: properties.push_back("SP2_HYBRID"); break;
236  case SP3_HYBRID: properties.push_back("SP3_HYBRID"); break;
237  case RING_HYBRID: properties.push_back("RING_HYBRID"); break;
238  case UNKNOWN_HYBRID: break;
239  default:
240  utility_exit_with_message("Attempting retrive hydrid for atom type '" + name() + "', however the hybridization type is not recognized.");
241  }
242  return properties;
243 }
244 
245 void
247  utility::vector1< Real > const & extra_parameters
248 ) {
249  extra_parameters_ = extra_parameters;
250 }
251 
252 
253 ///////////////////////////////////////////////////////////////////////////////
254 ///////////////////////////////////////////////////////////////////////////////
255 ///////////////////////////////////////////////////////////////////////////////
256 
257 
258 } // pose
259 } // core