Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CentroidDisulfideEnergyContainer.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/CentroidDisulfideEnergyContainer.hh
11 /// @brief Disulfide Energy Container class declaration
12 /// @author Spencer Bliven <blivens@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_CentroidDisulfideEnergyContainer_hh
17 #define INCLUDED_core_scoring_disulfides_CentroidDisulfideEnergyContainer_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 CentroidDisulfideNeighborIterator
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  * @note Although the full atom and centroid terms will not be defined
137  * at the same time for a particular disulfide bond, it is convienient
138  * to be able to store either in the same object.
139  */
141 {
142 public:
144  dslfc_cen_dst_( 0.0 ),
145  dslfc_cb_dst_( 0.0 ),
146  dslfc_ang_( 0.0 ),
147  dslfc_cb_dih_( 0.0 ),
148  dslfc_bb_dih_( 0.0 )
149  {}
150 
152  Energy dslfc_cb_dst() const { return dslfc_cb_dst_;}
153  Energy dslfc_ang() const { return dslfc_ang_;}
154  Energy dslfc_cb_dih() const { return dslfc_cb_dih_;}
155  Energy dslfc_bb_dih() const { return dslfc_bb_dih_;}
156 
159  Energy & dslfc_ang() { return dslfc_ang_;}
162 
163 private:
169 };
170 
172 public:
173  static Size const NO_DISULFIDE;
174 
175 public:
177 
179 
180  void
181  update( pose::Pose const & );
182 
183  virtual
185 
186  virtual
187  bool empty() const;
188 
189  virtual
190  LREnergyContainerOP clone() const;
191 
192  virtual
194  const_neighbor_iterator_begin( int resid ) const;
195 
196  virtual
198  const_neighbor_iterator_end( int resid ) const;
199 
200  virtual
202  const_upper_neighbor_iterator_begin( int resid ) const;
203 
204  virtual
206  const_upper_neighbor_iterator_end( int resid ) const;
207 
208  virtual
210  neighbor_iterator_begin( int resid );
211 
212  virtual
214  neighbor_iterator_end( int resid );
215 
216  virtual
218  upper_neighbor_iterator_begin( int resid );
219 
220  virtual
222  upper_neighbor_iterator_end( int resid );
223 
224  bool
225  disulfide_bonded( Size res1id, Size res2id ) const;
226 
227  bool residue_forms_disulfide( Size resid ) const;
228 
229  // What residue is resid forming a disulfide with?
230  Size other_neighbor_id( Size resid ) const;
231 
232  DisulfideAtomIndices const &
233  disulfide_atom_indices( Size resid ) const;
234 
235  DisulfideAtomIndices const &
236  other_neighbor_atom_indices( Size resid ) const;
237 
238 // Read and write access granted to Disulf Iterators. Other classes should not use these methods.
239 public:
240 
241  // Mutators
242  void save_energy( Size disulfide_index, EnergyMap const & emap );
243  void mark_energy_computed( Size disulfide_index );
244  void mark_energy_uncomputed( Size disulfide_index );
245 
246  // Accessors
247  Size lower_neighbor_id( Size disulfide_index ) const;
248  Size upper_neighbor_id( Size disulfide_index ) const;
249  Size other_neighbor_id( Size disulfide_index, Size resid ) const;
250 
251  void accumulate_energy( Size disulfide_index, EnergyMap & emap ) const;
252  void retrieve_energy( Size disulfide_index, EnergyMap & emap ) const;
253  bool energy_computed( Size disulfide_index ) const;
254 
255 private:
256  void find_disulfides( pose::Pose const & pose );
257  bool disulfides_changed( pose::Pose const & pose );
258  Size num_disulfides() const;
259 private:
265 };
266 
267 }
268 }
269 }
270 
271 #endif