Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CoordinateConstraint.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
11 /// @brief
12 
13 #ifndef INCLUDED_core_scoring_constraints_CoordinateConstraint_hh
14 #define INCLUDED_core_scoring_constraints_CoordinateConstraint_hh
15 
21 #include <core/pose/Pose.fwd.hh>
22 #include <core/id/AtomID.hh>
23 
25 
26 
27 // C++ Headers
28 #include <cstdlib>
29 #include <iostream>
30 //#include <map>
31 // AUTO-REMOVED #include <utility>
32 
33 #include <utility/vector1.hh>
34 #include <numeric/xyzVector.hh>
35 
36 
37 namespace core {
38 namespace scoring {
39 namespace constraints {
40 
41 
42 ///@details CoordinateConstraint compares the coordinates of a given atom (AtomID atom_) to a fixed coordinate triplet (Vector xyz_target_). Its other argument, fixed_atom_, is somewhat nonobvious. CoordinateConstraints are meant to be used with a Pose that has a nonmoving virtual root residue. An AtomID in this virtual root residue should be passed as fixed_atom_. CoordinateConstraint does not use fixed_atom_, but the ScoreFunction code detects when fixed_atom_ and atom_ move relative to one another, and trigger re-scoring at that time. In other words, CoordinateConstraints are really context-independent one body energies, but we wish them to be evaluated as context-independent two-body energies. (Ideally, ScoreFunction would detect when atom_ moves relative to xyz_target_, but since ScoreFunction functions on atoms and not floating coordinate triplets, this is a good workaround.) -- SML
44 public:
45 
46 
48 
49  ///c-tor
51  AtomID const & a1,
52  AtomID const & fixed_atom_in,
53  Vector const & xyz_target_in,
54  FuncOP func,
56  );
57 
59 
60 
61  virtual std::string type() const;
62 
63  virtual ConstraintOP clone() const;
64 
65  /// @brief Copies the data from this Constraint into a new object and returns an OP
66  /// atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom )
67  /// if a sequence_mapping is present it is used to map residue numbers .. NULL = identity mapping
68  /// to the new object. Intended to be implemented by derived classes.
69  virtual ConstraintOP remapped_clone( pose::Pose const& src, pose::Pose const& dest, id::SequenceMappingCOP map=NULL ) const;
70 
71 
72  ///
73  void show( std::ostream& out ) const;
74 
75  // @brief Reads the definition of a Constraint from the given std::istream,
76  // using the given Pose, and the given FuncFactory. This method is intended
77  // to be overridden by derived classes if they'd like to use the
78  // ConstraintIO machinery.
79  virtual void read_def( std::istream &, pose::Pose const &, FuncFactory const & );
80 
81  /// @brief possibility to do object comparison instead
82  /// of pointer comparison
83  bool operator == ( Constraint const & other_cst) const;
84 
85  ///
86  void show_def( std::ostream& out, pose::Pose const& pose ) const;
87 
88  // @brief take coordinates, distances, angles, etc from given pose
89  ///
90  virtual void steal_def( pose::Pose const& );
91 
92  ///
93  Real
95  Vector const & xyz
96  ) const;
97 
98  ///
99  virtual
100  void
101  score( XYZ_Func const & xyz, EnergyMap const &, EnergyMap & emap ) const;
102 
103  // atom deriv
104  virtual
105  void
106  fill_f1_f2(
107  AtomID const & atom,
108  XYZ_Func const & xyz,
109  Vector & F1,
110  Vector & F2,
111  EnergyMap const & weights
112  ) const;
113 
114  ///
115  Size
116  natoms() const;
117 
118  virtual
120  remap_resid( core::id::SequenceMapping const &seqmap ) const;
121 
122  ///
123  AtomID const &
124  atom( Size const n ) const;
125 
126  // UNDEFIUNED, commenting out to fix PyRosetta build void set_atom( Size const index, AtomID const atom_id );
127 
128  Real
129  dist( pose::Pose const & pose ) const;
130 
131 
132  virtual Size show_violations(
133  std::ostream& out,
134  pose::Pose const& pose,
135  Size verbose_level,
136  Real threshold = 1
137  ) const;
138 
139 private:
140 
141  // functions
142  Real
143  func( Real const theta ) const;
144 
145  // deriv
146  Real
147  dfunc( Real const theta ) const;
148 
149 private:
150  // data
155 };
156 
157 }
158 }
159 }
160 
161 #endif