Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SlideTogether.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 core/pack/task/ResfileReader.cc
11 /// @brief implementation of resfile reader and its command classes
12 /// @author Gordon Lemmon (glemmon@gmail.com)
13 
14 // Unit Headers
17 
19 
20 // Utility Headers
21 
22 #include <utility/exit.hh>
23 #include <utility/tag/Tag.hh>
24 #include <utility/string_util.hh>
25 #include <basic/Tracer.hh>
26 #include <core/types.hh>
27 
28 #include <core/pose/util.hh>
29 #include <utility/vector0.hh>
30 #include <utility/vector1.hh>
31 
32 #include <utility/excn/Exceptions.hh>
33 #include <boost/foreach.hpp>
34 #define foreach BOOST_FOREACH
35 
36 namespace protocols {
37 namespace ligand_docking {
38 
39 static basic::Tracer slide_together_tracer("protocols.ligand_docking.ligand_options.slide_together");
40 
43 {
45 }
46 
49  return new SlideTogether;
50 }
51 
54 {
55  return "SlideTogether";
56 }
57 
59 
60 SlideTogether::SlideTogether(std::string const & chain): chain_(chain), jumps_(){}
61 
63  //utility::pointer::ReferenceCount(),
64  protocols::moves::Mover( that ),
65  chain_(that.chain_),
66  jumps_(that.jumps_)
67 {}
68 
70 
72  return new SlideTogether( *this );
73 }
74 
76  return new SlideTogether;
77 }
78 
80  return "SlideTogether";
81 }
82 
83 //@brief parse XML (specifically in the context of the parser/scripting scheme)
84 void
86  utility::tag::TagPtr const tag,
87  protocols::moves::DataMap & /*datamap*/,
88  protocols::filters::Filters_map const & /*filters*/,
89  protocols::moves::Movers_map const & /*movers*/,
90  core::pose::Pose const & pose
91 )
92 {
93  if ( tag->getName() != "SlideTogether" ) throw utility::excn::EXCN_RosettaScriptsOption("This should be impossible");
94  if ( ! tag->hasOption("chains") ) throw utility::excn::EXCN_RosettaScriptsOption("'SlideTogether' mover requires chains tag");
95 
96  std::string const chains_str = tag->getOption<std::string>("chains");
97  utility::vector1<std::string> chain_strs= utility::string_split(chains_str, ',');
98  foreach(std::string chain_str, chain_strs){
99  utility::vector1<core::Size> chain_ids= get_chain_ids_from_chain(chain_str, pose);
100  foreach( core::Size chain_id, chain_ids){
101  core::Size jump_id= core::pose::get_jump_id_from_chain_id(chain_id, pose);
102  jumps_.push_back(jump_id);
103  }
104  }
105 }
106 
107 void
109  slide_together_tracer<< "Applying slide_together"<< std::endl;
110 
111  // If we are not using parse_my_tags...
112  if(! chain_.empty()){
113  if(jumps_.size() > 0){
114  utility_exit_with_message("This should be impossible");// jumps are set through parse_my_tags, chain through the 1-arg constructor
115  }
117  foreach( core::Size chain_id, chain_ids){
118  core::Size jump_id= core::pose::get_jump_id_from_chain_id(chain_id, pose);
119  jumps_.push_back(jump_id);
120  }
121  }
122 
124  slideTogether.apply(pose);
125 }
126 
127 } //namespace ligand_docking
128 } //namespace protocols