Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisulfideMatchingEnergyContainer.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 sw=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 core/scoring/disulfides/DisulfideMatchingEnergyContainer.hh
11 /// @brief Disulfide Energy Container class declaration
12 /// @author rvernon@u.washington.edu
13 /// @todo This file was taken with minimal modifications from FullatomDisulfideEnergyContainer.hh.
14 /// It might be a good idea to move some code into a superclass inheritted by both.
15 
16 #ifndef INCLUDED_core_scoring_disulfides_DisulfideMatchingEnergyContainer_hh
17 #define INCLUDED_core_scoring_disulfides_DisulfideMatchingEnergyContainer_hh
18 
19 // Unit headers
21 
22 #ifdef WIN32
24 #endif
25 
26 // Package headers
28 
29 // Project headers
31 
33 // AUTO-REMOVED #include <core/scoring/ScoreFunction.fwd.hh>
34 
35 // AUTO-REMOVED #include <core/scoring/ScoreType.hh>
36 
37 #include <core/pose/Pose.fwd.hh>
38 
40 #include <utility/vector1.hh>
41 
42 
43 namespace core {
44 namespace scoring {
45 namespace disulfides {
46 
47 /** @brief An iterator over the disulfide bonds a residue forms
48  *
49  * When scoring a pose, a long range energy container must be able to iterate
50  * over all the residues which interact with a particular residue. For
51  * disulfide bonds, this is either zero or one items depending on whether the
52  * residue specified forms a disulfide bond or not.
53  *
54  * @todo Given the proper options, include all residues in the vicinity which
55  * could form a bond, not just the best one. Maybe even include non-cysteines!
56  */
58 public:
59 
62  Size focused_node,
63  Size disulfide_index
64  );
65 
68  );
69 
71 
73  virtual ResidueNeighborIterator const & operator ++ ();
74  virtual bool operator == ( ResidueNeighborIterator const & ) const;
75  virtual bool operator != ( ResidueNeighborIterator const & ) const;
76 
77  virtual Size upper_neighbor_id() const;
78  virtual Size lower_neighbor_id() const;
79 
80  virtual Size residue_iterated_on() const;
81  virtual Size neighbor_id() const;
82 
83  virtual void save_energy( EnergyMap const & );
84  virtual void retrieve_energy( EnergyMap & ) const;
85  virtual void accumulate_energy( EnergyMap & ) const;
86 
87  virtual void mark_energy_computed();
88  virtual void mark_energy_uncomputed();
89 
90  virtual bool energy_computed() const;
91 
92 private:
96 };
97 
98 /// @brief Just a const version of DisulfideMatchingNeighborIterator
100 public:
103  Size focused_node,
104  Size disulfide_index
105  );
106 
108 
110 
112  virtual ResidueNeighborConstIterator const & operator ++ ();
113  virtual bool operator == ( ResidueNeighborConstIterator const & ) const;
114  virtual bool operator != ( ResidueNeighborConstIterator const & ) const;
115 
116  virtual Size upper_neighbor_id() const;
117  virtual Size lower_neighbor_id() const;
118 
119  virtual Size residue_iterated_on() const;
120  virtual Size neighbor_id() const;
121 
122  virtual void retrieve_energy( EnergyMap & ) const;
123  virtual void accumulate_energy( EnergyMap & ) const;
124 
125  virtual bool energy_computed() const;
126 
127 private:
131 
132 };
133 
134 /**
135  * @brief Storage for Disulfide Energy Terms
136  */
138 {
139 public:
141  dslfc_rot_( 0.0 ),
142  dslfc_trans_( 0.0 ),
143  dslfc_RT_( 0.0 )
144  {}
145 
146  Energy dslfc_rot() const { return dslfc_rot_;}
147  Energy dslfc_trans() const { return dslfc_trans_;}
148  Energy dslfc_RT() const { return dslfc_RT_;}
149 
150  Energy & dslfc_rot() { return dslfc_rot_;}
152  Energy & dslfc_RT() { return dslfc_RT_;}
153 
154 private:
158 };
159 
161 public:
162  static Size const NO_DISULFIDE;
163 
164 public:
166 
168 
169  void
170  update( pose::Pose const & );
171 
172  virtual
174 
175  virtual
176  bool empty() const;
177 
178  virtual
179  LREnergyContainerOP clone() const;
180 
181  virtual
183  const_neighbor_iterator_begin( int resid ) const;
184 
185  virtual
187  const_neighbor_iterator_end( int resid ) const;
188 
189  virtual
191  const_upper_neighbor_iterator_begin( int resid ) const;
192 
193  virtual
195  const_upper_neighbor_iterator_end( int resid ) const;
196 
197  virtual
199  neighbor_iterator_begin( int resid );
200 
201  virtual
203  neighbor_iterator_end( int resid );
204 
205  virtual
207  upper_neighbor_iterator_begin( int resid );
208 
209  virtual
211  upper_neighbor_iterator_end( int resid );
212 
213  bool
214  disulfide_bonded( Size res1id, Size res2id ) const;
215 
216  bool residue_forms_disulfide( Size resid ) const;
217 
218  // What residue is resid forming a disulfide with?
219  Size other_neighbor_id( Size resid ) const;
220 
221  DisulfideAtomIndices const &
222  disulfide_atom_indices( Size resid ) const;
223 
224  DisulfideAtomIndices const &
225  other_neighbor_atom_indices( Size resid ) const;
226 
227 // Read and write access granted to Disulf Iterators. Other classes should not use these methods.
228 public:
229 
230  // Mutators
231  void save_energy( Size disulfide_index, EnergyMap const & emap );
232  void mark_energy_computed( Size disulfide_index );
233  void mark_energy_uncomputed( Size disulfide_index );
234 
235  // Accessors
236  Size lower_neighbor_id( Size disulfide_index ) const;
237  Size upper_neighbor_id( Size disulfide_index ) const;
238  Size other_neighbor_id( Size disulfide_index, Size resid ) const;
239 
240  void accumulate_energy( Size disulfide_index, EnergyMap & emap ) const;
241  void retrieve_energy( Size disulfide_index, EnergyMap & emap ) const;
242  bool energy_computed( Size disulfide_index ) const;
243 
244 private:
245  void find_disulfides( pose::Pose const & pose );
246  bool disulfides_changed( pose::Pose const & pose );
247  Size num_disulfides() const;
248 private:
254 };
255 
256 }
257 }
258 }
259 
260 #endif