OpenStructure
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-2020 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:
56 
58 
59 
62 
66  void Apply(EntityVisitor& visitor);
67 
69 
76 
78 
79  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 
128 
135 
137  Real GetMass() const;
138 
141 
147 
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 
167 
168  unsigned long GetHashCode() const;
169 
172  bool InSequence() const;
173  bool operator==(const ChainHandle& ref) const;
174  bool operator!=(const ChainHandle& ref) const;
175 
178  void SetInSequence(const int index);
179 };
180 
181 }} // ns
182 
183 #endif // OST_CHAIN_HANDLE_HH
184 
axis-aligned cuboid
Three dimensional vector class, using Real precision.
Definition: vec3.hh:48
Handle to atom datatype.
Definition: atom_handle.hh:37
base class for ChainHandle and ChainView
Definition: chain_base.hh:40
linear chain of residues
Definition: chain_handle.hh:52
EntityView Select(const Query &q, QueryFlags flags=0) const
return view based on a query object
void SetInSequence(const int index)
checks whether res breaks the in sequence property and updates it accordingly
ResidueHandle GetNext(const ResidueHandle &rh)
AtomHandle FindAtom(const ResNum &num, const String &atom_name) const
bool operator==(const ChainHandle &ref) const
ChainHandle GetHandle() const
get this handle
Real GetMass() const
Get entity's mass.
void Apply(EntityVisitor &visitor)
Apply visitor.
EntityHandle GetEntity() const
Get parent entity.
geom::AlignedCuboid GetBounds() const
ResidueHandle GetPrev(const ResidueHandle &rh)
Get residue before the given residue.
int GetAtomCount() const
Get number of atoms of this chain.
bool InSequence() const
whether the residues form an ordered sequence with respect to their reside numbers.
geom::Vec3 GetCenterOfMass() const
Get entity's center of mass (mass weighted)
void AssignSecondaryStructure(SecStructure ss, const ResNum &start, const ResNum &end)
assign secondary structure to the inclusive residue range start, end
unsigned long GetHashCode() const
ResidueHandle GetResidueByIndex(int index) const
Get residue by index.
ResidueHandleList GetResidueList() const
Get residues of this chain as a list.
int GetBondCount() const
Get number of all inclusive bonds of this chain.
int GetResidueCount() const
Get number of residues of this chain.
AtomHandleList GetAtomList() const
Retrieve atoms of this chain as a list.
geom::Vec3 GetCenterOfAtoms() const
Get entity's center of atoms (not mass weighted)
bool operator!=(const ChainHandle &ref) const
EntityView Select(const String &query_string, QueryFlags flags=0) const
return view based on query String.
ChainHandle(const impl::ChainImplPtr &impl)
Protein or molecule.
definition of EntityView
Definition: entity_view.hh:86
EntityVisitor interface.
Selection Query.
Definition: query.hh:74
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
#define DLLEXPORT_OST_MOL
boost::shared_ptr< ChainImpl > ChainImplPtr
pointer_it< T > end(const std::vector< T > &values)
std::vector< AtomHandle > AtomHandleList
uint QueryFlags
Definition: query.hh:69
std::vector< ResidueHandle > ResidueHandleList
Definition: base.dox:1
Secondary structure types as defined by DSSP. For convenience, the enum values match the characters u...