OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
sec_struct.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_SEC_STRUCT_HH
20 #define OST_SEC_STRUCT_HH
21 
22 #include <vector>
23 
24 #include <ost/base.hh>
25 #include <ost/geom/geom.hh>
26 #include <ost/message.hh>
27 #include <ost/mol/mol.hh>
28 
29 namespace ost { namespace mol{ namespace alg{
30 
31 inline Real DSSPHBondEnergy(const geom::Vec3& h_pos, const geom::Vec3& n_pos,
32  const geom::Vec3& c_pos, const geom::Vec3& o_pos) {
33  Real on = 1.0/geom::Distance(o_pos,n_pos);
34  Real ch = 1.0/geom::Distance(c_pos,h_pos);
35  Real oh = 1.0/geom::Distance(o_pos,h_pos);
36  Real cn = 1.0/geom::Distance(c_pos,n_pos);
37  return 27.888 * (on+ch-oh-cn);
38 }
39 
40 // Raw estimation of secondary structure
41 //
42 // This function is not intended for Python export, since the input has to be
43 // prepared carefully. It basically estimates the secondary structure of a
44 // stretch of amino acids based on the hydrogen bond pattern as described for
45 // the dssp tool.
46 //
47 // To define the hydrogen bonds you need to provide the vectors donor_for_one
48 // and donor_for two. The index of an acceptor residue appears in one of the
49 // two vectors if the corresponding hbond energy is < -0.5
50 // (be aware of prolines that can't be donors!).
51 // There are two of those vectors, because for every residue we store the two
52 // lowest energy acceptors. If there is no acceptor available, the value
53 // at this position must be -1.
54 // The connected_to_next contains zeros and ones that defines, whether there
55 // is a peptide bond towards the next residue and the ca_positions vector
56 // is self explaining.
57 // As an additional feature you can also provide the according data for the
58 // full structure but only estimate the secondary structure for a small
59 // stretch, that gets defined by start_idx and size.
60 // For an example usage have a look at the AssignSecStruct functions.
61 
62 String RawEstimateSS(const std::vector<geom::Vec3>& ca_positions,
63  int start_idx, int size,
64  const std::vector<int>& donor_for_one,
65  const std::vector<int>& donor_for_two,
66  const std::vector<int>& connected_to_next);
67 
68 void PrepareSSData(const ost::mol::ResidueViewList& res_list,
69  std::vector<int>& res_indices,
70  std::vector<geom::Vec3>& ca_positions,
71  std::vector<int>& donor_for_one,
72  std::vector<int>& donor_for_two,
73  std::vector<int>& connected_to_next);
74 
76 
78 
79 }}} //ns
80 
81 #endif
std::string String
Definition: base.hh:54
float Real
Definition: base.hh:44
Real DSSPHBondEnergy(const geom::Vec3 &h_pos, const geom::Vec3 &n_pos, const geom::Vec3 &c_pos, const geom::Vec3 &o_pos)
Definition: sec_struct.hh:31
Protein or molecule.
String RawEstimateSS(const std::vector< geom::Vec3 > &ca_positions, int start_idx, int size, const std::vector< int > &donor_for_one, const std::vector< int > &donor_for_two, const std::vector< int > &connected_to_next)
std::vector< ResidueView > ResidueViewList
Definition: view_type_fw.hh:37
Real DLLEXPORT_OST_GEOM Distance(const Line2 &l, const Vec2 &v)
Three dimensional vector class, using Real precision.
Definition: vec3.hh:43
void AssignSecStruct(ost::mol::EntityView &ent)
definition of EntityView
Definition: entity_view.hh:86
void PrepareSSData(const ost::mol::ResidueViewList &res_list, std::vector< int > &res_indices, std::vector< geom::Vec3 > &ca_positions, std::vector< int > &donor_for_one, std::vector< int > &donor_for_two, std::vector< int > &connected_to_next)