Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DistancePairConstraint.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/DistancePairConstraint.hh
11 /// @brief Restrain a pair of residues to take the same torsion angles
12 /// @author Frank DiMaio, Fabio Parmeggiani
13 
14 #ifndef INCLUDED_core_scoring_constraints_DistancePairConstraint_hh
15 #define INCLUDED_core_scoring_constraints_DistancePairConstraint_hh
16 
21 
23 #include <core/id/AtomID.hh>
24 
25 #include <string>
26 
27 #include <utility/vector1.hh>
28 
29 
30 namespace core {
31 namespace scoring {
32 namespace constraints {
33 
34 
35 /// constraint on CA distance
36 
38 public:
39 
40  virtual std::string type() const {
41  return "DistancePair";
42  }
43 
44  virtual ConstraintOP clone() const {
45  return new DistancePairConstraint(
48  func_, score_type()
49  );
50  }
51 
52  Size show_violations( std::ostream& out, pose::Pose const& pose, Size verbose_level, Real threshold = 1 ) const;
53 
54  void read_def(
55  std::istream & in,
56  pose::Pose const & pose,
57  FuncFactory const & func_factory
58  );
59 
60  /// @brief possibility to compare constraint according to data
61  /// and not just pointers
62  bool operator == ( Constraint const & other ) const;
63 
64  Real
65  score(
66  Vector const & X1, Vector const & X2,
67  Vector const & Y1, Vector const & Y2
68  ) const;
69 
70  void
71  score( XYZ_Func const & xyz, EnergyMap const &, EnergyMap & emap ) const;
72 
73  Real
74  score( conformation::Conformation const & conformation ) const;
75 
76  // atom deriv
77  void
78  fill_f1_f2(
79  AtomID const & atom,
80  XYZ_Func const & xyz,
81  Vector & F1, Vector & F2,
82  EnergyMap const & weights
83  ) const;
84 
85  ///c-tor
87  AtomID const & a1, AtomID const & a2,
88  AtomID const & b1, AtomID const & b2,
89  FuncOP func,
91  ):
92  Constraint( scotype ),
93  atomA1_(a1), atomA2_(a2),
94  atomB1_(b1), atomB2_(b2),
95  func_( func )
96  {}
97 
98  Size
99  natoms() const {
100  return 4;
101  }
102 
103  virtual
105  remap_resid( core::id::SequenceMapping const & seqmap ) const;
106 
107  AtomID const &
108  atom( Size const n ) const;
109 
110  virtual void show( std::ostream & out ) const;
111 
112  // Coppied Remapped_clone from AtomPairConstraint
113  /// @brief Copies the data from this Constraint into a new object and returns an OP
114  /// atoms are mapped to atoms with the same name in dest pose ( e.g. for switch from centroid to fullatom )
115  /// if a sequence_mapping is present it is used to map residue numbers .. NULL = identity mapping
116  /// to the new object. Intended to be implemented by derived classes.
118  pose::Pose const & src,
119  pose::Pose const & dest,
120  id::SequenceMappingCOP map = NULL
121  ) const;
122 
123 private:
124  Real
125  func( Real const theta ) const;
126 
127  Real
128  dfunc( Real const theta ) const;
129 
130 
131 private:
132  // data
136 };
137 
138 } // constraints
139 } // scoring
140 } // core
141 
142 #endif