OpenStructure
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/mol/module_config.hh>
23 #include <ost/mol/residue_prop.hh>
25 #include <ost/mol/sec_structure.hh>
27 #include <ost/mol/chem_class.hh>
28 
29 #include <ost/generic_property.hh>
30 #include "property_id.hh"
31 
32 namespace ost { namespace mol {
33 
60  public GenericPropContainer<ResidueBase> {
61 public:
62  ResidueBase();
63  ResidueBase(const impl::ResidueImplPtr& impl);
64  ResidueBase(const ResidueBase& rhs);
65 public:
66 
68 
69 
70 
71 
72 
73 
74 
75  operator bool() const { return this->IsValid(); }
78  bool IsValid() const { return Impl().get()!=0; }
81  const ResNum& GetNumber() const;
82 
84  const ResidueKey& GetKey() const;
85 
87  const String& GetName() const;
88 
91  String GetQualifiedName() const;
92 
93 
95  bool IsPeptideLinking() const;
96 
98  bool IsNucleotideLinking() const;
99 
100  ChemClass GetChemClass() const;
101 
102  void SetChemClass(ChemClass cc);
103 
106  SecStructure GetSecStructure() const;
107 
111  void SetSecStructure(SecStructure ss);
112 
117  TorsionHandle GetPhiTorsion() const;
118 
123  TorsionHandle GetPsiTorsion() const;
124 
129  TorsionHandle GetOmegaTorsion() const;
130  char GetOneLetterCode() const;
131 
132  void SetOneLetterCode(char olc);
133 
135  String GetStringProperty(Prop::ID prop_id) const;
136 
138  Real GetFloatProperty(Prop::ID prop_id) const;
139 
141  int GetIntProperty(Prop::ID prop_id) const;
142 
144  bool IsProtein() const;
145 
146  void SetIsProtein(bool protein);
147 
148  void SetIsLigand(bool ligand);
149 
150  bool IsLigand() const;
151 public:
152  impl::ResidueImplPtr& Impl();
153 
154  const impl::ResidueImplPtr& Impl() const;
155 protected:
156  GenericPropContainerImpl* GpImpl();
157 
158  const GenericPropContainerImpl* GpImpl() const;
159  void CheckValidity() const;
160 private:
161  impl::ResidueImplPtr impl_;
162 
163 };
164 
165 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os,
166  const ResidueBase& residue);
167 }} // ns
168 
169 #endif // OST_RESIDUE_BASE_HH
170