Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CentroidDisulfideEnergy.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/CentroidDisulfideEnergy.cc
11 /// @brief Centroid Disulfide Energy class implementation
12 /// @author Spencer Bliven <blivens@u.washington.edu>
13 /// @date 2/4/09
14 
15 
16 // Unit headers
19 
20 // Package headers
23 
24 // Project headers
28 #include <core/pose/Pose.hh>
30 #include <core/scoring/Energies.hh>
33 #include <basic/Tracer.hh>
34 
36 #include <utility/vector1.hh>
37 
38 
39 namespace core {
40 namespace scoring {
41 namespace disulfides {
42 
43 
44 /// @details This must return a fresh instance of the CentroidDisulfideEnergy class,
45 /// never an instance already in use
49 ) const {
50  return new CentroidDisulfideEnergy( ScoringManager::get_instance()->get_CentroidDisulfidePotential() );
51 }
52 
55  ScoreTypes sts;
56  sts.push_back( dslfc_cen_dst );
57  sts.push_back( dslfc_cb_dst );
58  sts.push_back( dslfc_ang );
59  sts.push_back( dslfc_cb_dih );
60  sts.push_back( dslfc_bb_dih );
61  return sts;
62 }
63 
64 
65 static basic::Tracer TR("core.scoring.disulfides.CentroidDisulfideEnergy");
66 
68  CentroidDisulfidePotential const & potential
69 ) :
71  potential_( potential )
72 {}
73 
75 
76 // EnergyMethod Methods:
77 
79 {
80  return new CentroidDisulfideEnergy( potential_ );
81 }
82 
83 
85  pose::Pose & pose,
86  ScoreFunction const & ) const
87 {
88  using namespace methods;
89 
93  } else {
95  static_cast< CentroidDisulfideEnergyContainer * > (
97  dec->update( pose );
98  }
99 }
100 
102  utility::vector1< bool > & ) const
103 {}
104 
105 
106 // TwoBodyEnergy Methods:
107 
109  conformation::Residue const & rsd1,
110  conformation::Residue const & rsd2,
111  pose::Pose const & pose,
112  ScoreFunction const &,
113  EnergyMap & emap
114  ) const
115 {
116  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
118  return;
119  }
120 
121 
122  Energy cbcb_distance_score;
123  Energy centroid_distance_score;
124  Energy cacbcb_angle_1_score;
125  Energy cacbcb_angle_2_score;
126  Energy cacbcbca_dihedral_score;
127  Energy backbone_dihedral_score;
128 
129  //Require cysteines
130  if ( rsd1.aa() != chemical::aa_cys || rsd2.aa() != chemical::aa_cys ) return;
131  //Require Centroid
132  if (rsd1.residue_type_set().name() != chemical::CENTROID ||
134  return;
135 
137  static_cast< CentroidDisulfideEnergyContainer const * > (
139  //Require they're bonded
140  if ( ! dec->residue_forms_disulfide( rsd1.seqpos() ) ||
141  dec->other_neighbor_id( rsd1.seqpos() ) != (Size) rsd2.seqpos() ){
142  return;
143  }
144 
146  rsd1, rsd2,
147  cbcb_distance_score,
148  centroid_distance_score,
149  cacbcb_angle_1_score,
150  cacbcb_angle_2_score,
151  cacbcbca_dihedral_score,
152  backbone_dihedral_score
153  );
154 
155  emap[ dslfc_cen_dst ] += centroid_distance_score;
156  emap[ dslfc_cb_dst ] += cbcb_distance_score;
157  emap[ dslfc_ang ] += (cacbcb_angle_1_score + cacbcb_angle_2_score)*.5;
158  emap[ dslfc_cb_dih ] += cacbcbca_dihedral_score;
159  emap[ dslfc_bb_dih ] += backbone_dihedral_score;
160 }
161 
162 
164 {
165  return false;
166 }
167 
168 
170  conformation::Residue const &,
171  pose::Pose const &,
172  ScoreFunction const &,
173  EnergyMap &
174  ) const
175 {}
176 
177 // LongRangeTwoBodyEnergy methods
180 {
182 }
183 
184 
186  pose::Pose const & pose,
187  Size res1,
188  Size res2
189  ) const
190 {
191  using namespace methods;
192  if ( ! pose.energies().long_range_container( centroid_disulfide_energy )) return false;
193 
195  static_cast< CentroidDisulfideEnergyContainer const * > (
197  return dec->disulfide_bonded( res1, res2 );
198 }
201 {
202  return 1; // Initial versioning
203 }
204 
205 
206 } // namespace disulfides
207 } // namespace scoring
208 } // namespace core
209