OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
builder.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_CONOP_BUILDER_HH
20 #define OST_CONOP_BUILDER_HH
21 
22 /*
23  Author: Marco Biasini
24  */
25 #include <ost/mol/mol.hh>
26 
28 #include <ost/conop/builder_fw.hh>
29 
30 namespace ost { namespace conop {
31 
32 typedef enum {
35 } Dialect;
55 public:
56 
57  Builder(): dialect_(PDB_DIALECT), strict_(false), bond_feasibility_check_(true) { }
58  virtual ~Builder();
59 
62  virtual void CompleteAtoms(mol::ResidueHandle rh);
63 
64  virtual void SetDialect(Dialect dialect) { dialect_=dialect; }
65 
66  virtual void SetStrictHydrogenMode(bool strict) { strict_=strict; }
67  bool GetStrictHydrogenMode() const { return strict_; }
68 
69  Dialect GetDialect() const { return dialect_; }
72  virtual void CheckResidueCompleteness(const mol::ResidueHandle& rh);
73 
76  virtual bool IsResidueComplete(const mol::ResidueHandle& rh);
77 
80  virtual mol::ResidueKey IdentifyResidue(const mol::ResidueHandle& rh);
81 
85  virtual void FillResidueProps(mol::ResidueHandle residue);
86 
87  virtual void FillAtomProps(mol::AtomHandle atom);
93  virtual void ConnectAtomsOfResidue(mol::ResidueHandle rh);
100  virtual void ConnectResidueToPrev(mol::ResidueHandle rh,
101  mol::ResidueHandle prev);
103  virtual void ConnectResidueToNext(mol::ResidueHandle rh,
104  mol::ResidueHandle next);
105 
107  virtual void AssignTorsions(mol::ChainHandle ch);
108 
110  virtual void AssignTorsionsToResidue(mol::ResidueHandle residue);
111 
113  void AssignBackBoneTorsionsToResidue(mol::ResidueHandle res);
114 
123  virtual bool DoesPeptideBondExist(const mol::AtomHandle& n,
124  const mol::AtomHandle& c);
125 
131  virtual bool IsBondFeasible(const mol::AtomHandle& atom_a,
132  const mol::AtomHandle& atom_b);
133 
135  static String GuessAtomElement(const String& atom_name, bool hetatm);
136 
138  static bool AreResiduesConsecutive(const mol::ResidueHandle& r1,
139  const mol::ResidueHandle& r2);
142  void GuessChemClass(mol::ResidueHandle res);
145  void DistanceBasedConnect(mol::AtomHandle atom);
146 
148  void SetBondFeasibilityCheck(bool b_feas_flag) { bond_feasibility_check_ = b_feas_flag; }
149 
151  bool GetBondFeasibilityCheck() const { return bond_feasibility_check_; }
152 
153 private:
154  Dialect dialect_;
155  bool strict_;
156  bool bond_feasibility_check_;
157 };
158 
159 
160 }} // ns
161 
162 #endif