Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RelativeSegmentFilter.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 /// @author Sarel Fleishman
13 
14 
15 // Project Headers
16 #include <core/types.hh>
17 #include <core/pose/Pose.hh>
18 #include <basic/Tracer.hh>
19 #include <utility/tag/Tag.hh>
23 
24 namespace protocols {
25 namespace protein_interface_design {
26 namespace filters {
27 
28 static basic::Tracer TR( "protocols.protein_interface_design.filters.RelativeSegmentFilter" );
29 
30 using core::pose::Pose;
31 
34 
36 RelativeSegmentFilterCreator::keyname() const { return "RelativeSegment"; }
37 
38 bool
39 RelativeSegmentFilter::apply( Pose const & pose ) const {
42 
43  core::Size const nearest_to_from( protocols::rosetta_scripts::find_nearest_res( pose, source_pose, start_res() ) );
44  core::Size const nearest_to_to( protocols::rosetta_scripts::find_nearest_res( pose, source_pose, stop_res() ) );
45 
46  if( nearest_to_from == 0 || nearest_to_to == 0 ){
47  TR<<"nearest_to_from: "<<nearest_to_from<<" nearest_to_to: "<<nearest_to_to<<". Failing"<<std::endl;
48  return false;
49  }
50  runtime_assert( nearest_to_to > nearest_to_from );
51  TR<<"Residues on source pose: ";
52  for( core::Size i = nearest_to_from; i <= nearest_to_to; ++i )
53  TR<<i<<",";
54  TR<<std::endl;
55  return true;
56 }
57 
58 void
60 {
61  source_pose( tag->getOption< std::string >( "source_pose" ) );
62  start_res( tag->getOption< core::Size >( "start_res" ) );
63  stop_res( tag->getOption< core::Size >( "stop_res" ));
64  runtime_assert( stop_res() > start_res() );
65  runtime_assert( start_res() > 0 );
66  runtime_assert( stop_res() <= pose.total_residue() );
67  TR<<"source_pose: "<<source_pose()<<" start_res: "<<start_res()<<" stop res: "<<stop_res()<<std::endl;
68 }
69 
70 void
71 RelativeSegmentFilter::report( std::ostream &, core::pose::Pose const & ) const {
72 }
73 
76  return( 0.0 );
77 }
78 
80 
81 }
82 } // protein_interface_design
83 } // devel