OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
residue_base.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_RESIDUE_BASE_HH
20 #define OST_RESIDUE_BASE_HH
21 
22 #include <ost/geom/geom.hh>
23 
24 #include <ost/mol/module_config.hh>
25 #include <ost/mol/residue_prop.hh>
27 #include <ost/mol/sec_structure.hh>
29 #include <ost/mol/chem_class.hh>
30 #include <ost/mol/chem_type.hh>
31 
32 #include <ost/generic_property.hh>
33 #include "property_id.hh"
34 
35 namespace ost { namespace mol {
36 
68  public GenericPropContainer<ResidueBase> {
69 public:
70  ResidueBase();
71  ResidueBase(const impl::ResidueImplPtr& impl);
72  ResidueBase(const ResidueBase& rhs);
73 public:
74 
76 
77 
78 
79 
80 
81 
82 
83  operator bool() const { return this->IsValid(); }
86  bool IsValid() const { return Impl().get()!=0; }
89  const ResNum& GetNumber() const;
90 
92  const ResidueKey& GetKey() const;
93 
95  const String& GetName() const;
96 
99  String GetQualifiedName() const;
100 
102  AtomHandle GetCentralAtom() const;
103 
111  void SetCentralAtom(const AtomHandle& a);
112 
114  geom::Vec3 GetCentralNormal() const;
115 
117  bool IsPeptideLinking() const;
118 
120  bool IsNucleotideLinking() const;
121 
122  ChemClass GetChemClass() const;
123 
124  void SetChemClass(ChemClass cc);
125 
127  ChemType GetChemType() const;
128 
129  void SetChemType(ChemType ct);
130 
133  SecStructure GetSecStructure() const;
134 
138  void SetSecStructure(SecStructure ss);
139 
144  TorsionHandle GetPhiTorsion() const;
145 
150  TorsionHandle GetPsiTorsion() const;
151 
156  TorsionHandle GetOmegaTorsion() const;
157  char GetOneLetterCode() const;
158 
159  void SetOneLetterCode(char olc);
160 
162  String GetStringProperty(Prop::ID prop_id) const;
163 
165  Real GetFloatProperty(Prop::ID prop_id) const;
166 
168  int GetIntProperty(Prop::ID prop_id) const;
169 
171  bool IsProtein() const;
172 
173  void SetIsProtein(bool protein);
174 
175  void SetIsLigand(bool ligand);
176 
177  bool IsLigand() const;
178 public:
179  impl::ResidueImplPtr& Impl();
180 
181  const impl::ResidueImplPtr& Impl() const;
182 protected:
183  GenericPropContainerImpl* GpImpl();
184 
185  const GenericPropContainerImpl* GpImpl() const;
186  void CheckValidity() const;
187 private:
188  impl::ResidueImplPtr impl_;
189 
190 };
191 
192 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
193  const ResidueBase& residue);
194 }} // ns
195 
196 #endif // OST_RESIDUE_BASE_HH
197