Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
symE.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 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/symE/symE.c
11 /// @brief Implementation of symmetric design bonus class
12 /// @author Sam DeLuca (samuel.l.deluca@vanderbilt.edu)
13 
14 // Unit headers
17 
18 // Package headers
19 #include <core/scoring/Energies.hh>
20 // AUTO-REMOVED #include <core/scoring/ScoreFunction.hh>
21 //#include <core/scoring/ScoringManager.hh>
24 
25 // Project headers
26 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
27 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
28 #include <basic/options/option.hh>
29 #include <basic/options/keys/score.OptionKeys.gen.hh>
30 #include <core/pose/Pose.hh>
31 // AUTO-REMOVED #include <basic/database/open.hh>
32 #include <basic/Tracer.hh>
33 
36 #include <core/kinematics/Jump.hh>
37 #include <utility/vector1.hh>
38 
39 
40 static basic::Tracer TR("core.scoring.symE");
41 
42 namespace core {
43 namespace scoring {
44 namespace sym_e {
45 
46 
47 /// @details This must return a fresh instance of the symE class,
48 /// never an instance already in use
52 ) const {
53  return new symEnergy;
54 }
55 
58  ScoreTypes sts;
59  sts.push_back( symE_bonus );
60  return sts;
61 }
62 
63 
64 
66  parent( new symECreator )
67 {}
68 
70 {
71  return new symEnergy(*this);
72 }
73 
75 {
76 
77  using namespace methods;
79  {
81  //LREnergyContainerOP lr_container = new LREnergyContainer(pose);
82  pose.energies().set_long_range_container(sym_bonus_lr, lr_container);
83  } else {
84  DenseEnergyContainerOP lr_container_copied = DenseEnergyContainerOP(static_cast<DenseEnergyContainer*>(pose.energies().nonconst_long_range_container(sym_bonus_lr).get() ));
85  if(lr_container_copied->size() !=pose.total_residue() )
86  {
88  //LREnergyContainerOP lr_container = new LREnergyContainer(pose);
89  pose.energies().set_long_range_container(sym_bonus_lr, lr_container);
90  }
91  //lr_container_copied->update(pose);
92  }
93 
95 }
96 
98 {
100 }
101 
103 {
104  //
105 }
106 
108 {
109  return false;
110 }
111 
113 {
114  //
115 }
116 
118 {
119  return true;
120 }
121 
122 
124 {
125  return methods::sym_bonus_lr;
126 }
127 
128 
130 {
131  Size rsd1Pos = rsd1.seqpos();
132  Size rsd2Pos = rsd2.seqpos();
133  Size totalLength = pose.total_residue();
134 
135  int symUnits = basic::options::option[ basic::options::OptionKeys::score::symE_units ]();
136  core::Real symBonus = basic::options::option[ basic::options::OptionKeys::score::symE_bonus ]();
137 
138  if(symUnits >0)
139  {
140 
141  if(rsd1Pos % (totalLength/symUnits) == rsd2Pos % (totalLength/symUnits) && rsd1Pos != rsd2Pos)
142  {
143 
144  if (rsd1.name() == rsd2.name())
145  {
146  emap[ symE_bonus ] += symBonus;
147  }
148  }
149  }
150 
151 }
154 {
155  return 1; // Initial versioning
156 }
157 } //symE
158 } //scoring
159 } //core