Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DihedralConstraint.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file src/core/scoring/DihedralConstraint.hh
11 /// @brief
12 
13 #ifndef INCLUDED_core_scoring_constraints_DihedralConstraint_hh
14 #define INCLUDED_core_scoring_constraints_DihedralConstraint_hh
15 
17 
22 
24 #include <core/id/AtomID.hh>
25 
26 #include <string>
27 
28 #include <utility/vector1.hh>
29 
30 
31 namespace core {
32 namespace scoring {
33 namespace constraints {
34 
35 
36 /// constraint on dihedral angle formed by 4 points
37 
39 public:
40 
41  Real
42  score(
43  Vector const & xyz1,
44  Vector const & xyz2,
45  Vector const & xyz3,
46  Vector const & xyz4
47  ) const;
48 
49  virtual std::string type() const {
50  return "Dihedral";
51  }
52 
53  virtual ConstraintOP clone() const {
54  return new DihedralConstraint(
56  );
57  }
58 
59  Size show_violations( std::ostream& out, pose::Pose const& pose, Size verbose_level, Real threshold = 1 ) const;
60 
61  void read_def(
62  std::istream & in,
63  pose::Pose const & pose,
64  FuncFactory const & func_factory
65  );
66 
67  /// @brief possibility to compare constraint according to data
68  /// and not just pointers
69  bool operator == ( Constraint const & other ) const;
70 
71  void
72  score( XYZ_Func const & xyz, EnergyMap const &, EnergyMap & emap ) const;
73 
74  Real
75  score( conformation::Conformation const & conformation ) const;
76 
77  // atom deriv
78  void
79  fill_f1_f2(
80  AtomID const & atom,
81  XYZ_Func const & xyz,
82  Vector & F1,
83  Vector & F2,
84  EnergyMap const & weights
85  ) const;
86 
87  ///c-tor
89  AtomID const & a1,
90  AtomID const & a2,
91  AtomID const & a3,
92  AtomID const & a4,
93  FuncOP func,
95  ):
96  Constraint( scotype ),
97  atom1_(a1),
98  atom2_(a2),
99  atom3_(a3),
100  atom4_(a4),
101  func_( func )
102  {}
103 
104  Size
105  natoms() const
106  {
107  return 4;
108  }
109 
110  virtual
112  remap_resid( core::id::SequenceMapping const & seqmap ) const;
113 
114  AtomID const &
115  atom( Size const n ) const;
116 
117  virtual void show( std::ostream & out ) const;
118 
119  void show_def( std::ostream& out, pose::Pose const& pose ) const;
120 
121  virtual Func const& get_func() const {
122  return *func_;
123  }
124 
125  // Coppied Remapped_clone from AtomPairConstraint
126  /// @brief Copies the data from this Constraint into a new object and returns an OP
127  /// atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom )
128  /// if a sequence_mapping is present it is used to map residue numbers .. NULL = identity mapping
129  /// to the new object. Intended to be implemented by derived classes.
131  pose::Pose const & src,
132  pose::Pose const & dest,
133  id::SequenceMappingCOP map = NULL
134  ) const;
135 
136 private:
137  Real
138  func( Real const theta ) const;
139 
140  Real
141  dfunc( Real const theta ) const;
142 
143  // this guy doesn't need member data --> static
144  static
145  void
146  helper(
147  Vector const & M,
148  Vector const & v,
149  Vector const & w,
150  Vector & F1,
151  Vector & F2
152  );
153 
154  static
155  void
157  Vector const & p1,
158  Vector const & p2,
159  Vector const & p3,
160  Vector const & p4,
161  Real & x,
162  Vector & F1,
163  Vector & F2
164  );
165 
166  static
167  void
169  Vector const & p1,
170  Vector const & p2,
171  Vector const & p3,
172  Vector const & p4,
173  Real & x,
174  Vector & F1,
175  Vector & F2
176  );
177 
178 private:
179  // data
182 };
183 
184 } // constraints
185 } // scoring
186 } // core
187 
188 #endif