Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ReplicateTask.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 src/core/pack/task/operation/ReplicateTask.cc
11 /// @details Replicates logic from one pose onto another. Poses must be the same size!
12 /// Only copies logic for being_packed and being_designed.
13 /// Use this to retain task information from round to round and keep
14 /// sequence information from being corrupted in the task.
15 /// @author stranges
16 
19 
22 #include <core/pose/Pose.hh>
23 
24 #include <utility/exit.hh>
25 
26 #include <utility/tag/Tag.hh>
27 
28 #include <utility/vector0.hh>
29 #include <utility/vector1.hh>
30 
31 
32 namespace core {
33 namespace pack {
34 namespace task {
35 namespace operation {
36 
37  ///@details empty constructor need to call set_native_task to make it work
39 
40  ///@details constructor using an established PackerTask
42  parent(), native_task_( native_task->clone() ){}
43 
44  ///@details contstructor that uses an TaskFactory and applies it to the native to get the task
46  parent(){
47  //convert task factory into task for general use
48  native_task_ = task_factory->create_task_and_apply_taskoperations( native_pose ) ;
49  }
50 
52 
54  {
55  return new ReplicateTask( *this );
56  }
57 
59  {
60  return new ReplicateTask;
61  }
62 
63  void
65  pose::Pose const & pose,
66  task::PackerTask & task) const
67  {
68  // note: poses must be the same size as this copies the task logic
69  // on a per residue basis
70  runtime_assert( pose.total_residue() == native_task_->total_residue() );
71  //for all the residues in the pose copy the basic task logic
72  for( Size ii = 1; ii <= pose.total_residue(); ii++){
73  //if not being designed then restrict to repacking
74  if(!native_task_->nonconst_residue_task( ii ).being_designed())
76  //task.nonconst_residue_task( ii ).add_behavior( "NATAA" );
77 
78  //if not being packed at all then prevent from repacking
79  if(!native_task_->nonconst_residue_task( ii ).being_packed())
81  //task.nonconst_residue_task( ii ).add_behavior( "NATRO" );
82 
83  } //end loop over all residues
84  } //end apply
85 
86  void
88  native_task_ = native_task;
89  }
90 
91  ///@brief does not work within parser framework so exit if try to use.
92  void
94  {
95  utility_exit_with_message_status( "No parse_tag for ReplicateTask. Exiting...\n", 1 );
96  }
97 
98 //private:
99 
100 } //operation
101 } //pack
102 } //task
103 } //core