Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RemodelRotamerLinks.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 
13 
15 #include <basic/options/option.hh>
17 #include <core/pose/Pose.hh>
18 #include <core/pose/PDBInfo.hh>
19 
20 #include <basic/Tracer.hh>
21 #include <utility/tag/Tag.hh>
22 
23 // option key includes
24 #include <basic/options/keys/remodel.OptionKeys.gen.hh>
25 
26 namespace protocols {
27 namespace forge {
28 namespace remodel {
29 
30 using namespace core;
31 using namespace chemical;
32 using namespace conformation;
33 using namespace basic::options;
34 using namespace pack;
35 using namespace rotamer_set;
36 using namespace task;
37 using namespace operation;
38 
39 using basic::t_info;
40 using basic::t_debug;
41 using basic::t_trace;
42 static basic::Tracer TR("protocols.forge.remodel.RemodelRotamerLinks",t_info);
43 
45 {
46  return new RemodelRotamerLinks;
47 }
48 
50 
52 {
53  return new RemodelRotamerLinks( *this );
54 }
55 
56 void
58 {}
59 
60 void
62  Pose const & pose,
63  PackerTask & ptask
64 ) const
65 {
66  Size const nres( pose.total_residue() );
67  // setup residue couplings
68  RotamerLinksOP links( new RotamerLinks );
69  links->resize( nres );
70 
71  Size repeat_number = basic::options::option[ OptionKeys::remodel::repeat_structure];
72  Size segment_length = nres / repeat_number;
73 
75 
76 //find all the equivalent positions, first pass iterate over the base
77  for (Size res = 1; res<= segment_length ; res++){
79 
80  for (Size rep = 0; rep < repeat_number; rep++){
81  list.push_back(res+(segment_length*rep));
82  }
83  equiv_pos.push_back(list);
84  }
85 
86 
87  //second pass, iterate over to populate the entire chain
88 
89  for (Size i = 1; i <= nres ; i++){
90  Size subcounter = (i%segment_length);
91  if (subcounter == 0){
92  subcounter = segment_length;
93  }
94 
95  links->set_equiv(i, equiv_pos[subcounter]);
96 
97  //std::cout << "linking " << i << " with " << subcounter << "array with ";
98  for (Size k=1; k<= equiv_pos[subcounter].size(); k++){
99  //std::cout << " " << equiv_pos[subcounter][k];
100  }
101  //std::cout << std::endl;
102  // check for similarities
103  //std::cout << ptask.task_string(pose);
104 
105  }
106 
107  //std::cout << ptask << std::endl;
108 
109 
110  ptask.rotamer_links( links );
111 }
112 
113 } // namespace remodel
114 } // namespace forge
115 } // namespace protocols
116