Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ThreadSequenceOperation.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/toolbox/task_operations/ThreadSequenceOperation.cc
11 /// @brief
12 /// @author Sarelf Fleishman sarelf@uw.edu
13 
14 // Unit Headers
17 
18 // Project Headers
19 #include <core/pose/Pose.hh>
20 
21 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
23 
24 // Utility Headers
25 #include <core/types.hh>
26 #include <basic/Tracer.hh>
27 #include <utility/vector1.hh>
28 #include <utility/tag/Tag.hh>
29 // AUTO-REMOVED #include <core/pack/task/operation/ResLvlTaskOperations.hh>
30 
31 #include <utility/vector0.hh>
32 
33 
34 using basic::Error;
35 using basic::Warning;
36 static basic::Tracer TR( "protocols.toolbox.TaskOperations.ThreadSequenceOperation" );
37 
38 namespace protocols {
39 namespace toolbox {
40 namespace task_operations {
41 
42 using namespace core::pack::task::operation;
43 using namespace std;
44 
46 {
47  target_sequence( "" ); start_res( 1 );
48 }
49 
51 {
52  target_sequence( seq );
53 }
54 
56 
59 {
60  return new ThreadSequenceOperation;
61 }
62 
64 {
65  return new ThreadSequenceOperation( *this );
66 }
67 
68 void
70 {
72  using namespace core::chemical;
73 
74  runtime_assert( target_sequence().length() + start_res() -1 <= pose.total_residue() );
76  bool activated_rtr( false );
77  for( core::Size resi( 1 ); resi <= pose.total_residue(); ++resi ){
78  if( resi >= start_res() && resi <= start_res() + target_sequence_.length() - 1 ){
79  if( target_sequence_[ resi - start_res() ] == 'x' ) continue; // allows for 'wildcard' residues that can be allowed to design to anything within the threaded sequence
80  if( target_sequence_[ resi - start_res() ] == ' ' ){/// only repack this residue
81  rtr.include_residue( resi );
82  activated_rtr = true;
83  continue;
84  }
87  keep_aas[ aa_from_oneletter_code( target_sequence_[ resi-start_res() ] ) ] = true;
88  racaas.keep_aas( keep_aas );
89  racaas.include_residue( resi );
90  racaas.apply( pose, task );
91  }
92  else if( !allow_design_around() )
93  rtr.include_residue( resi );
94  }
95  if( !allow_design_around() || activated_rtr )
96  rtr.apply( pose, task );
97 }
98 
99 void
101 {
102  target_sequence_ = seq;
103 }
104 
107 {
108  return( target_sequence_ );
109 }
110 
113  return start_res_;
114 }
115 
116 void
118  start_res_ = s;
119 }
120 
121 void
123 {
124  target_sequence( tag->getOption< std::string >( "target_sequence" ) );
125  start_res( tag->getOption< core::Size >( "start_res", 1 ) );
126  allow_design_around( tag->getOption< bool >( "allow_design_around", true ) );
127  TR<<"Threading with sequence: "<<target_sequence()<<" starting at residue #"<<start_res()<<" allow design around "<<allow_design_around()<<std::endl;
128 }
129 
130 } //namespace protocols
131 } //namespace toolbox
132 } //namespace task_operations