Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OrbitalType.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 OrbitalType.cc
11 ///
12 /// @brief
13 /// A class that contains orbital parameters
14 ///
15 /// @details
16 /// This class contains the "chemical" information for orbitals. This does not contain the actual
17 /// xyz coordinates of the class which is managed by the conformation/Residue.hh. The orbital_type properties
18 /// are assigned by the class OrbitalTypeSet which is initiated from the ChemicalManager. Orbital type properties
19 /// are currently are read in from the file located chemical/orbital_type_sets/fa_standard/orbital_properties.txt.
20 /// These properties contain the the parameters of distance, but can be modified. Currently this is a very small
21 /// class that will be added on as more and more properties are identified and added.
22 /// Note that information about the atomtype is stored along with the orbital type. This may or may not be useful
23 /// later. Just adding the functionality for shits and giggles.
24 ///
25 /// Orbital type name: the orbital type name contains the hybridization, orbital name, and element associated with the orbital
26 ///
27 /// Hybridization: the hybridiztion of the atom that the orbital is bonded to (sp, sp2, sp3)
28 ///
29 /// Orbital Name: the name of the orbital. This usually is p, d, pi, sigma. The orbital name is different than the orbital type name
30 ///
31 /// Atom Type Name: the type of atom associated with an orbital
32 ///
33 /// Distance: distance the orbital comes off of the atom. Currently, for residues, the distance is the Bohr radius of Hydrogen+element
34 ///
35 /// Donor: does the orbital donate electrons? currently not implemented
36 ///
37 /// Acceptor: is the orbital accept electrons? currently not implemented
38 ///
39 /// @author Steven Combs
40 ///
41 ///
42 /// @last_modified December 15 2010
43 /////////////////////////////////////////////////////////////////////////
45 #include <utility/exit.hh>
46 #include <utility/string_util.hh>
47 #include <vector>
49 #include <core/types.hh>
50 
51 #include <utility/vector1.hh>
52 
53 
54 
55 
56 namespace core{
57 namespace chemical{
58 namespace orbitals{
59 
60 //mjo commenting out 'atom_type_name' because it is not used and cause a warnings
61 ///@brief Constructor that is generally initialized in OrbitalTypeSet.hh. If you add a property,
62 /// you must initialize that property as false!!!!!!!!
63 OrbitalType::OrbitalType(std::string & orbital_name, std::string & /*atom_type_name*/):
64  is_orbital_acceptor_(false),
65  is_orbital_donor_(false),
66  distance_(0.0)
67 
68 {
69 
70 
71  utility::vector1<std::string> name_split(utility::string_split(orbital_name, '.'));
74  orbital_name_= name_split[2];
75  hybridization_= name_split[3];
76 
77  name_split=utility::string_split(orbital_name, '_');
78  for(core::Size i=1; i <= name_split.size(); ++i){
79  atom_type_name_.push_back(name_split[i]);
80  }
81 
82 }
83 
84 
85 
86 
87 ///@brief The parameters are the actual headings in the orbital_properties.txt. If you want to add more paramters,
88 /// you must edit orbital_properties.txt and add another heading. You also need to edit AtomTypeSet.txt so that
89 /// it recognizes that parameter and parses it. The parameters are different form the properties in that they
90 /// are Reals/Size and properties are strings.
91 void
93  std::string const & param,
94  core::Real const setting
95 )
96 {
97  if ( param == "distance" ) {
98  distance_ = setting;
99  } else {
100  utility_exit_with_message( "unrecognized orbital_type parameter "+param );
101  }
102 }
103 
104 
105 
106 ///@brief Currently, these properties are not actually in the orbital_properties.txt. I have them here
107 /// as an example on how to add properties. This is also a place holder as the ligand code will
108 /// soon be using these properties. The Acceptor/Donor could refer to orbitals that have a lone pair
109 /// and are donating to a hydrogen, or an electron defficient region. In order to add properties, one
110 /// must add the properties to the last line of orbital_properties.txt and make a private member variable
111 /// for that property in the header file. Then do a string match comparision, like seen below. These properties
112 /// are set via OrbitalTypeSet.hh
113 void
115  std::string const & property,
116  bool const setting
117 )
118 {
119  if(property == "DONOR"){
120  is_orbital_donor_=setting;
121  }else if(property == "ACCEPTOR"){
122  is_orbital_acceptor_=setting;
123  } else {
124  utility_exit_with_message( "unrecognized atomtype property "+property );
125 }
126 
127 
128 }
129 
130 
131 ///@brief returns the name of the orbital type. defined in orbital_properties.txt
133 {
134  return orbital_type_name_;
135 }
136 
138 {
139  return orbital_type_enum_;
140 }
141 
142 
143 
144 ///@brief returns the distance from the atom the orbital comes off. defined in orbital_properties.txt
146 {
147  return distance_;
148 }
149 
150 ///@brief returns the atom_types associated with the orbital type. defined in orbital_properties.txt
152 {
153  return atom_type_name_;
154 }
155 
156 ///@brief returns hybrdiziation of atom the orbital is attached to
158 {
159  return hybridization_;
160 }
161 
162 ///@brief returns the orbital associated with the type
164 {
165  return orbital_name_;
166 }
167 
168 
169 
170 
171 }
172 }
173 }
174