Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisulfideMatchingEnergy.cc
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/DisulfideMatchingEnergy.cc
11 /// @brief Centroid Disulfide Energy class implementation
12 /// @author rvernon@u.washington.edu
13 /// @date 02/09/10
14 
15 
16 // Unit headers
19 
20 // Package headers
23 
24 // Project headers
27 #include <core/pose/Pose.hh>
29 #include <core/scoring/Energies.hh>
32 #include <basic/Tracer.hh>
33 
34 #include <utility/vector1.hh>
35 
36 
37 namespace core {
38 namespace scoring {
39 namespace disulfides {
40 
41 
42 /// @details This must return a fresh instance of the DisulfideMatchingEnergy class,
43 /// never an instance already in use
47 ) const {
48  return new DisulfideMatchingEnergy( ScoringManager::get_instance()->get_DisulfideMatchingPotential() );
49 }
50 
53  ScoreTypes sts;
54  sts.push_back( dslfc_rot );
55  sts.push_back( dslfc_trans );
56  sts.push_back( dslfc_RT );
57  return sts;
58 }
59 
60 
61 static basic::Tracer TR("core.scoring.disulfides.DisulfideMatchingEnergy");
62 
63 
64 
66  DisulfideMatchingPotential const & potential
67 ) :
69  potential_( potential )
70 {}
71 
73 
74 // EnergyMethod Methods:
75 
77 {
78  return new DisulfideMatchingEnergy( potential_ );
79 }
80 
81 
83  pose::Pose & pose,
84  ScoreFunction const & ) const
85 {
86  using namespace methods;
87 
91  } else {
93  static_cast< DisulfideMatchingEnergyContainer * > (
95  dec->update( pose );
96  }
97 }
98 
100  utility::vector1< bool > & ) const
101 {}
102 
103 
104 // TwoBodyEnergy Methods:
105 
107  conformation::Residue const & rsd1,
108  conformation::Residue const & rsd2,
109  pose::Pose const & pose,
110  ScoreFunction const &,
111  EnergyMap & emap
112  ) const
113 {
114  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
116  return;
117  }
118 
119  Energy match_rot;
120  Energy match_trans;
121  Energy match_RT;
122 
123  //Require cysteines
124  if ( rsd1.aa() != chemical::aa_cys || rsd2.aa() != chemical::aa_cys ) return;
125  //Require Centroid (NOT NO MORE!)
126  //if (rsd1.residue_type_set().name() != chemical::CENTROID ||
127  // rsd2.residue_type_set().name() != chemical::CENTROID )
128  // return;
129 
131  static_cast< DisulfideMatchingEnergyContainer const * > (
133  //Require they're bonded
134  if ( ! dec->residue_forms_disulfide( rsd1.seqpos() ) ||
135  dec->other_neighbor_id( rsd1.seqpos() ) != (Size) rsd2.seqpos() ){
136  return;
137  }
138 
140  rsd1, rsd2,
141  match_rot,
142  match_trans,
143  match_RT
144  );
145 
146  emap[ dslfc_rot ] += match_rot;
147  emap[ dslfc_trans ] += match_trans;
148  emap[ dslfc_RT ] += match_RT;
149 }
150 
151 
152 
154 {
155  return false;
156 }
157 
158 
160  conformation::Residue const &,
161  pose::Pose const &,
162  ScoreFunction const &,
163  EnergyMap &
164  ) const
165 {}
166 
167 // LongRangeTwoBodyEnergy methods
170 {
172 }
173 
174 
176  pose::Pose const & pose,
177  Size res1,
178  Size res2
179  ) const
180 {
181  using namespace methods;
182  if ( ! pose.energies().long_range_container( disulfide_matching_energy )) return false;
183 
185  static_cast< DisulfideMatchingEnergyContainer const * > (
187  return dec->disulfide_bonded( res1, res2 );
188 }
191 {
192  return 1; // Initial versioning
193 }
194 
195 
196 } // namespace disulfides
197 } // namespace scoring
198 } // namespace core
199