OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
chain_handle.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_CHAIN_HANDLE_HS
20 #define OST_CHAIN_HANDLE_HS
21 
22 #include <vector>
23 
24 #include <ost/mol/module_config.hh>
25 
26 #include <ost/geom/geom.hh>
27 
28 #include "chain_base.hh"
29 
30 #include "query.hh"
31 #include "view_type_fw.hh"
32 #include "handle_type_fw.hh"
33 #include "residue_prop.hh"
34 #include "entity_visitor_fw.hh"
35 #include "sec_structure.hh"
36 
37 namespace ost { namespace mol {
38 
53 
54 public:
55  ChainHandle();
56 
57  ChainHandle(const impl::ChainImplPtr& impl);
58 
59 
61  EntityHandle GetEntity() const;
62 
66  void Apply(EntityVisitor& visitor);
67 
69 
74  ResidueHandle GetPrev(const ResidueHandle& rh);
75  ResidueHandle GetNext(const ResidueHandle& rh);
76 
78 
79 
80 
81 
82 
83  ResidueHandle FindResidue(const ResNum& num) const;
84 
92  AtomHandle FindAtom(const ResNum& num,
93  const String& atom_name) const;
97  ResidueHandle GetResidueByIndex(int index) const;
99 
101  //
102  // To count all atoms of the entity the chain belongs to, use
103  // \c EntityHandle::GetAtomCount(). For count of specific residues, use
104  // \c ResidueHandle::GetResidueCount().
105  int GetAtomCount() const;
106 
113  int GetBondCount() const;
114 
118  int GetResidueCount() const;
119 
125 
126 
127  AtomHandleList GetAtomList() const;
128 
134  ResidueHandleList GetResidueList() const;
135 
137  Real GetMass() const;
138 
140  geom::Vec3 GetCenterOfMass() const;
141 
146  geom::Vec3 GetCenterOfAtoms() const;
147 
148  geom::AlignedCuboid GetBounds() const;
151  void AssignSecondaryStructure(SecStructure ss,
152  const ResNum& start,
153  const ResNum& end);
154 
157  EntityView Select(const Query& q, QueryFlags flags=0) const;
158 
161  EntityView Select(const String& query_string, QueryFlags flags=0) const;
162 
166  ChainHandle GetHandle() const;
169  bool InSequence() const;
170  bool operator==(const ChainHandle& ref) const;
171  bool operator!=(const ChainHandle& ref) const;
172 
175  void SetInSequence(const int index);
176 };
177 
178 }} // ns
179 
180 #endif // OST_CHAIN_HANDLE_HH
181