Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MetalloClaimer.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 TopologyBroker
11 /// @brief top-class (Organizer) of the TopologyBroker mechanism
12 /// @detailed responsibilities:
13 /// @author Oliver Lange
14 
15 // Unit Headers
17 
18 // Package Headers
22 
23 // Project Headers
26 // AUTO-REMOVED
27 #include <core/pose/Pose.hh>
28 // AUTO-REMOVED #include <core/pose/util.hh>
29 
33 
34 // ObjexxFCL Headers
35 
36 // Utility headers
37 // AUTO-REMOVED #include <core/sequence/util.hh>
38 
39 
40 //#include <utility/io/izstream.hh>
41 //#include <utility/io/ozstream.hh>
42 //#include <utility/io/util.hh>
43 #include <basic/Tracer.hh>
44 #include <utility/excn/Exceptions.hh>
45 //#include <basic/options/option.hh>
46 
47 //// C++ headers
48 // AUTO-REMOVED #include <fstream>
49 
50 // ObjexxFCL Headers
51 #include <ObjexxFCL/string.functions.hh>
52 
54 #include <utility/vector1.hh>
55 
56 
57 static basic::Tracer tr("protocols.topo_broker",basic::t_info);
58 
59 namespace protocols {
60 namespace topology_broker {
61 
62 using namespace core;
63 MetalloClaimer::MetalloClaimer() : residue_pair_jump_( NULL )
64 {}
65 
66 //bool MetalloClaimer::allow_claim( DofClaim const& foreign_claim ) {
67 // if ( foreign_claim.owner() == this ) return true; // always allow your own claims!
68 // if ( foreign_claim.type() == DofClaim::SEQUENCE ) {
69 // if ( foreign_claim.pos( 1 ) == 1 && foreing_claim.right() == DofClaim::EXCLUSIVE ) {
70 // return false; // don't accept any other fixed positions right now --- maybe never ?!
71 // }
72 // }
73 // return true;
74 //} // MetalloClaimer::allow_claim()
76  SequenceClaimer::initialize_residues( pose, my_claim, failed_to_init );
77  // I know this guy isn't doing anything JumpClaimer::initialize_residues( pose, my_claim, failed_to_init );
78  jump_setup_->clear();
80  tr.Trace << "MetalloClaimer: setup jump between " << anchor_residue_ << " " << my_claim->offset() << std::endl;
81  jump_setup_->add_jump(
82  jumping::Interval( anchor_residue_, my_claim->offset()), //jump
83  jumping::Interval( my_claim->offset() - 1, my_claim->offset() - 1 ) //cutpoint interval
84  );
85  new_decoy();
86 }
87 
89 }
90 
94  anchor_chain_ = ""; //usually anchored to DEFAULT chain
95  anchor_residue_ = 0;
97 }
98 
99 bool MetalloClaimer::read_tag( std::string tag, std::istream& is ) {
100  using namespace jumping;
101  if ( tag == "ligand" ) {
102  is >> ligand_;
103  } else if ( tag == "anchor" ) {
104  is >> anchor_residue_;
105  } else if ( tag == "aa" ) {
106  for ( int i = 1; i <= 2; ++i ) {
107  std::string name;
108  core::chemical::ResidueTypeSetCAP residue_type_set(
110  is >> name;
111  if ( residue_type_set->name_map(name).is_protein() )
112  name = name + "_p:CtermProteinFull_p:NtermProteinFull";
113  core::chemical::ResidueType const & res_type( residue_type_set->name_map(name) );
114  residue_pair_jump_->add_residue_single( res_type );
115  }
116  } else if ( tag == "cst_atoms" ) {
117  for ( int i = 1; i <= 2; ++i ) {
118  std::string name;
119  for ( int j = 1; j <= 3; ++j ) {
120  is >> name;
121  residue_pair_jump_->set_cstAtoms(i,j,name);
122  }
123  }
124  } else if ( tag == "jump_atoms" ) {
125  for ( int i = 1; i <= 2; ++i ) {
126  std::string name;
127  for ( int j = 1; j <= 3; ++j ) {
128  is >> name;
129  residue_pair_jump_->set_jumpAtoms(i,j,name);
130  }
131  }
132  } else if ( tag == "disAB"
133  || tag == "angleA" || tag == "angleB"
134  || tag == "dihedralA" || tag == "dihedralB" || tag == "dihedralAB" ) {
135  //these are all multi valued read until line ends
136  std::string line;
137  getline( is, line );
138  std::istringstream in( line );
139  Real value;
140  if ( tag == "disAB" ) {
141  while (in >> value) {
142  residue_pair_jump_->set_cstInfo( disAB, value );
143  }
144  } else if ( tag == "angleA" ) {
145  while (in >> value) {
146  residue_pair_jump_->set_cstInfo( angleA, value );
147  }
148  } else if ( tag == "angleB" ) {
149  while (in >> value) {
150  residue_pair_jump_->set_cstInfo( angleB, value );
151  }
152  } else if ( tag == "dihedralA" ) {
153  while (in >> value) {
154  residue_pair_jump_->set_cstInfo( dihedralA, value );
155  }
156  } else if ( tag == "dihedralB" ) {
157  while (in >> value) {
158  residue_pair_jump_->set_cstInfo( dihedralB, value );
159  }
160  } else if ( tag == "dihedralAB" ) {
161  while (in >> value) {
162  residue_pair_jump_->set_cstInfo( dihedralAB, value );
163  }
164  } else runtime_assert( 0 ); //if you are here you missed a tag in the statement above.
165  } else if ( SequenceClaimer::read_tag( tag, is ) ) {
166  //noop
167  } else if ( JumpClaimer::read_tag( tag, is ) ) {
168  //noop
169  } else return false;
170  return true;
171 }
172 
174  if ( !anchor_residue_ ) {
175  throw EXCN_Input( "need to specify anchor residue for MetalloLigand "+ligand_ );
176  }
177 
178  set_label( ligand_ + ObjexxFCL::string_of( anchor_residue_ ) + anchor_chain_ );
179  if ( !anchor_chain_.size() ) anchor_chain_ = "DEFAULT"; //do this after labelling so we don't have "DEFAULT" appearing in the label
180 
181  set_sequence( "Z["+ligand_+"]" );
182 
183  residue_pair_jump_->init_mini_pose();
185  jump_setup_->add_residue_pair_jump( residue_pair_jump_ );
186  set_jump_def( jump_setup_ ); //tell the underlying JumpClaimer
187 }
188 
189 
190 
191 } //topology_broker
192 } //protocols