Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstraintScoreCutoffFilter.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 protocols/filters/ConstraintScoreCutoffFilter.cc
11 /// @brief
12 /// @detailed
13 /// Contains currently:
14 ///
15 ///
16 /// @author Oliver Lange
17 
18 // Unit Headers
21 
22 // Package Headers
24 
25 
26 // Project Headers
28 #include <core/pose/Pose.hh>
29 #include <core/types.hh>
30 // AUTO-REMOVED #include <core/scoring/ScoreFunction.hh>
31 #include <core/scoring/Energies.hh>
36 #include <basic/Tracer.hh>
37 
38 #include <protocols/jd2/util.hh>
39 #include <protocols/jd2/Job.hh>
40 
41 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
42 // ObjexxFCL Headers
43 #include <ObjexxFCL/format.hh>
44 
45 // Utility headers
46 #include <utility/tag/Tag.hh>
47 
48 #include <utility/vector0.hh>
49 #include <utility/vector1.hh>
50 
51 //Auto Headers
53 
54 
55 
56 //// C++ headers
57 static basic::Tracer tr("protocols.filters.ConstraintScoreCutoffFilter");
58 
59 namespace protocols {
60 namespace simple_filters {
61 
62 
64  parent("ConstraintScoreCutoffFilter"),
65  cutoff_( 0.0 )
66 {}
67 
69  parent("ConstraintScoreCutoffFilter"),
70  cutoff_(cutoff_in)
71 {}
72 
73 void
75  score_type_ = setting;
76 }
77 
78 void
80  constraints_ = cst_in;
81 }
82 
83 
84 bool
86  core::Real cur_score = get_score( pose );
88  if ( job ) job->add_string_real_pair( get_user_defined_name(), cur_score );
89  if ( cur_score <= cutoff() ) return true;
90  return false;
91 } // apply_filter
92 
93 
96  using namespace core::scoring;
97  core::pose::Pose pose( pose_in );
98  pose.constraint_set( NULL );
100  ScoreFunction scorefxn;
101  scorefxn.set_weight( score_type_, 1.0 );
102  return scorefxn( pose );
103 }
104 
105 void
107  if (tag->hasOption("cutoff")) {
108  cutoff_ = tag->getOption<core::Real>("cutoff", 10000.0 );
109  }
110  if (tag->hasOption("report_name") ) {
111  set_user_defined_name( tag->getOption<std::string>("report_name") );
112  } else {
113  set_user_defined_name( "cst_cutoff_filter" );
114  }
115 }
116 
117 void
118 ConstraintScoreCutoffFilter::report( std::ostream & /*ostr*/, core::pose::Pose const & /*pose*/ ) const
119 { }
120 
121 
124 
126 ConstraintScoreCutoffFilterCreator::keyname() const { return "ConstraintScoreCutoffFilter"; }
127 
128 
129 
130 } // filters
131 } // protocols