Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
make_symmetric_task.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file core/pose/symmetry/util.hh
10 /// @brief utility functions for handling of symmetric conformations
11 /// @author Ingemar Andre
12 
13 // Unit headers
16 #include <core/pose/Pose.hh>
17 #include <core/chemical/AA.hh>
21 
23 
24 #include <core/id/AtomID.hh>
25 
26 // Package Headers
28 
29 #include <numeric/xyzMatrix.hh>
30 #include <numeric/xyzVector.hh>
31 #include <numeric/xyz.functions.hh>
32 
33 #include <utility/vector1.hh>
34 
35 #include <basic/Tracer.hh>
36 
37 
38 static basic::Tracer TR("core.pack.make_symmetric_task");
39 
40 namespace core {
41 namespace pack {
42 
43 void
45  pose::Pose const & pose,
47 )
48 {
49  using namespace conformation::symmetry;
50  using namespace pose::symmetry;
51 
52  assert( core::pose::symmetry::is_symmetric( pose ) );
53 
54  SymmetricConformation const & SymmConf (
55  dynamic_cast<SymmetricConformation const &> ( pose.conformation()) );
56  SymmetryInfoCOP symm_info( SymmConf.Symmetry_Info() );
57 
58  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
59  if ( !symm_info->chi_is_independent(i) ) {
60  task->nonconst_residue_task( i ).prevent_repacking();
61  }
62  }
63 }
64 
67  pose::Pose const & pose,
68  task::PackerTaskCOP non_symmetric_task
69 ){
70  using namespace core::pack::task;
71  assert( core::pose::symmetry::is_symmetric( pose ) );
72  PackerTaskOP new_task = non_symmetric_task->clone();
74  return new_task;
75 }
76 
79  pose::Pose const & pose,
80  task::PackerTaskCOP non_symmetric_task
81 ){
82  using namespace core::pack::task;
83  assert( core::pose::symmetry::is_symmetric( pose ) );
84 
85  PackerTaskOP new_task = TaskFactory::create_packer_task(pose);
86  PackerTask_ const & o(dynamic_cast<PackerTask_ const &>(*non_symmetric_task));
87  PackerTask_ & n(dynamic_cast<PackerTask_ &>(*new_task));
88 
89  if( !o.symmetrize_by_union() ) utility_exit_with_message("incorrect PackerTask symmetrization request");
90 
91  n.update_commutative(o);
92 
93  conformation::symmetry::SymmetricConformation const & SymmConf( dynamic_cast<conformation::symmetry::SymmetricConformation const &> ( pose.conformation()) );
95 
96  for( Size i = 1; i <= symm_info->num_total_residues_without_pseudo(); ++i ) {
97  Size const ifollow = symm_info->chi_follows(i);
98  if( ifollow != 0 && ifollow != i ) {
99  n.update_residue_union(ifollow,o.residue_task(i));
100  }
101  }
102 
103  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
104  if ( !symm_info->chi_is_independent(i) ) {
106  }
107  }
108 
109  return new_task;
110 }
111 
114  pose::Pose const & pose,
115  task::PackerTaskCOP non_symmetric_task
116 ){
117  using namespace core::pack::task;
118  assert( core::pose::symmetry::is_symmetric( pose ) );
119 
120  PackerTaskOP new_task = TaskFactory::create_packer_task(pose);
121  PackerTask_ const & o(dynamic_cast<PackerTask_ const &>(*non_symmetric_task));
122  PackerTask_ & n(dynamic_cast<PackerTask_ &>(*new_task));
123 
124  if( !o.symmetrize_by_intersection() ) utility_exit_with_message("incorrect PackerTask symmetrization request");
125 
126  n.update_commutative(o);
127 
128  conformation::symmetry::SymmetricConformation const & SymmConf( dynamic_cast<conformation::symmetry::SymmetricConformation const &> ( pose.conformation()) );
130 
131  for( Size i = 1; i <= symm_info->num_total_residues_without_pseudo(); ++i ) {
132  Size const ifollow = symm_info->chi_follows(i);
133  if( ifollow != 0 && ifollow != i ) {
135  }
136  }
137 
138  for ( Size i = 1; i <= pose.total_residue(); ++i ) {
139  if ( !symm_info->chi_is_independent(i) ) {
141  }
142  }
143 
144  return new_task;
145 }
146 
149  pose::Pose const & pose,
150  task::PackerTaskCOP non_symmetric_task
151 ){
152  using namespace core::pack::task;
153  assert( core::pose::symmetry::is_symmetric( pose ) );
154  PackerTask_ const & o(dynamic_cast<PackerTask_ const &>(*non_symmetric_task));
155 
156  if( o.symmetrize_by_union() ){
157  return make_new_symmetric_PackerTask_by_union(pose,non_symmetric_task);
158  }
159  if( o.symmetrize_by_intersection() ){
160  return make_new_symmetric_PackerTask_by_intersection(pose,non_symmetric_task);
161  }
162  // TR << "YOU HAVE NOT SPECIFIED HOW YOUR PACKERTASK SHOULD BE SYMMETRIZED, TRUNCATING IT!" << std::endl;
163  // return make_new_symmetric_PackerTask_by_truncation(pose,non_symmetric_task);
164  return non_symmetric_task->clone();
165 }
166 
167 } // pack
168 } // core