Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IgnoreSubsetConstraintSet.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 IgnoreSubsetConstraintSet.cc
11 /// @brief
12 /// @detailed
13 /// @author James Thompson
14 ///
15 
16 // Package Headers
17 
18 // Project Headers
20 // AUTO-REMOVED #include <core/pose/Pose.hh>
22 #include <core/types.hh>
24 
25 // ObjexxFCL Headers
26 
27 // Utility headers
28 #include <utility/vector1.fwd.hh>
29 #include <utility/pointer/ReferenceCount.hh>
30 
31 #include <basic/Tracer.hh>
32 
33 //// C++ headers
34 #include <string>
35 #include <set>
36 
37 #include <utility/vector1.hh>
38 
39 
40 static basic::Tracer tr("protocols.comparative_modeling");
41 
44 
45 namespace protocols {
46 namespace comparative_modeling {
47 
48 using namespace core;
49 
51  std::set< int > residues_to_ignore,
52  ConstraintSet const & other
53 ) :
54  ConstraintSet( other ),
55  ignore_list_( residues_to_ignore )
56 {}
57 
58 /// @copy constructor. Does nothing.
60  IgnoreSubsetConstraintSet const & other
61 ) :
62  ConstraintSet( other ),
63  ignore_list_( other.ignore_list() )
64 {}
65 
66 /*void
67 IgnoreSubsetConstraintSet::eval_atom_derivative_for_residue_pairs (
68  id::AtomID const & atom_id,
69  pose::Pose const & pose,
70  scoring::ScoreFunction const &,
71  scoring::EnergyMap const & weights,
72  Vector & F1,
73  Vector & F2
74 ) const
75 {
76  using scoring::constraints::ResidueConstraints;
77 
78  Size const resi( atom_id.rsd() );
79 
80  for ( ResidueConstraints::const_iterator
81  it= residue_pair_constraints_begin( resi ), ite = residue_pair_constraints_end( resi );
82  it != ite; ++it ) {
83  Size const resj( it->first );
84  if ( !ignore(resi) && !ignore(resj) ) {
85  it->second->eval_atom_derivative(
86  atom_id, pose.conformation(), weights, F1, F2
87  );
88  } // if ( !ignore)
89  }
90 
91 } // eval_atom_derivative_for_residue_pairs
92 */
93 
94 ///
95 void
97  Residue const & rsd1,
98  Residue const & rsd2,
99  Pose const & pose,
100  core::scoring::ScoreFunction const & scorefxn,
102 ) const
103 {
104  int const pos1( rsd1.seqpos() ), pos2( rsd2.seqpos() );
105  if ( ignore(pos1) || ignore(pos2) ) {
106  return; //cast avoids warning
107  }
108  ConstraintSet::residue_pair_energy( rsd1, rsd2, pose, scorefxn, emap );
109 }
110 
111 void
113  core::conformation::Residue const & rsd,
114  core::pose::Pose const & pose,
115  core::scoring::ScoreFunction const & sfxn,
116  core::kinematics::MinimizerMapBase const & minmap,
118 ) const
119 {
120  if ( ignore( rsd.seqpos() ) ) return;
121  ConstraintSet::setup_for_minimizing_for_residue( rsd, pose, sfxn, minmap, res_data_cache );
122 }
123 
124 
125 void
127  conformation::Residue const & rsd1,
128  conformation::Residue const & rsd2,
129  pose::Pose const & pose,
130  core::scoring::ScoreFunction const & sfxn,
131  core::kinematics::MinimizerMapBase const & minmap,
132  core::scoring::ResSingleMinimizationData const & res1_data_cache,
133  core::scoring::ResSingleMinimizationData const & res2_data_cache,
134  core::scoring::ResPairMinimizationData & respair_data_cache
135 ) const
136 {
137  if ( ignore( rsd1.seqpos() ) || ignore( rsd2.seqpos() ) ) return;
139  rsd1, rsd2, pose, sfxn, minmap, res1_data_cache, res2_data_cache, respair_data_cache );
140 }
141 
142 bool
143 IgnoreSubsetConstraintSet::ignore( int const pos ) const {
144  if ( ignore_list_.find(pos) == ignore_list_.end() ) {
145  return false;
146  }
147 
148  return true;
149 }
150 
151 void
153  ignore_list_.insert( pos );
154 }
155 
156 std::set< int >
158  return ignore_list_;
159 }
160 
161 } // comparative_modeling
162 } // protocols
163