Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SAXSScoreFilter.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 SAXSScoreFilter.cc
11 /// @brief runs reject or accept filters on pose
12 /// @detailed
13 /// Contains currently: SAXSScoreFilter
14 ///
15 ///
16 /// @author Dominik Gront
17 
18 // Unit Headers
20 
21 // Project Headers
22 #include <core/pose/Pose.hh>
23 #include <core/types.hh>
24 // AUTO-REMOVED #include <core/pose/util.hh>
27 
31 #include <basic/options/keys/casp.OptionKeys.gen.hh>
32 
36 
39 
40 
41 #include <basic/options/option.hh>
42 #include <basic/options/keys/filters.OptionKeys.gen.hh>
43 
45 
46 // Utility headers
47 #include <basic/Tracer.hh>
48 
50 #include <core/kinematics/Jump.hh>
51 #include <utility/vector0.hh>
52 #include <utility/vector1.hh>
53 
54 //Auto Headers
56 
57 
58 
59 //// C++ headers
60 static basic::Tracer tr("protocols.simple_filters.SAXSScoreFilter");
61 
62 namespace protocols {
63 namespace simple_filters {
64 
66  using namespace basic::options;
67  using namespace basic::options::OptionKeys;
68 
69 // score_ = new protocols::scoring::methods::saxs::SAXSEnergyFA();
70  cutoff_ = basic::options::option[ basic::options::OptionKeys::filters::set_saxs_filter ]();
71  score_value_ = cutoff_ + 1;
72 }
73 
74 
75 bool SAXSScoreFilter::apply( core::pose::Pose const & pose ) const {
76 
77  using namespace basic::options;
78  using namespace basic::options::OptionKeys;
79 
80  core::pose::Pose fa_pose ( pose );
82  if ( !pose.is_fullatom() )
84  if ( option[ casp::repack ].user() ) {
87  task->initialize_from_command_line();
88  task->restrict_to_repacking();
89  core::pack::pack_rotamers(fa_pose, (*scorefxn), task);
90  }
91  if ( option[ casp::sc_min ] ) {
92 // std::string const min_type( option[ run::min_type ]() );
93  std::string min_type("dfpmin");
95  final_mm.set_chi( true );
96  final_mm.set_bb( false );
97  core::optimization::AtomTreeMinimizer().run( fa_pose, final_mm, *scorefxn,
98  core::optimization::MinimizerOptions( min_type, 0.001, true ) );
99  }
100  score_value_ = score.total_energy( fa_pose );
101 
102  if ( score_value_ < cutoff_ ) {
103  tr.Info << " Passed with score " << score_value_ << std::endl;
104  return true;
105  }
106 
107  tr.Info << " Failed with score " << score_value_ << std::endl;
108  return false;
109 }
110 
111 } // filters
112 } // protocols