Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DomainAssembly.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 
11 /// @file protocols/abinitio/DomainAssembly.cc
12 /// @brief
13 /// @author Sarel Fleishman (sarelf@u.washington.edu), Jacob Corn (jecorn@u.washington.edu)
14 
15 // Unit headers
18 
19 // Package headers
20 
21 // Project headers
22 #include <core/fragment/FragSet.hh>
24 #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
26 #include <basic/options/keys/packing.OptionKeys.gen.hh>
35 #include <utility/tag/Tag.hh>
38 #include <core/pose/selection.hh>
39 
40 //Auto Headers
43 #include <utility/vector0.hh>
44 #include <utility/vector1.hh>
45 #include <basic/options/option.hh>
46 
47 
48 namespace protocols {
49 namespace abinitio {
50 
51 using namespace core;
52 using namespace std;
53 using namespace core::scoring;
54 using namespace protocols::moves;
55 
56 static basic::Tracer TR( "protocols.protein_interface_design.movers.DomainAssembly" );
57 
60 {
62 }
63 
66  return new DomainAssembly;
67 }
68 
71 {
72  return "DomainAssembly";
73 }
74 
76  protocols::moves::Mover( DomainAssemblyCreator::mover_name() )
77 {}
78 
80  core::Size const linker_start,
81  core::Size const linker_end,
82  FragSetOP fragset_large,
83  FragSetOP fragset_small
84 ) :
85  protocols::moves::Mover( DomainAssemblyCreator::mover_name() ),
86  linker_start_( linker_start ),
87  linker_end_( linker_end ),
88  fragset_large_( fragset_large ),
89  fragset_small_( fragset_small ),
90  fragments_set_( true )
91 {}
92 
94 
97  return( protocols::moves::MoverOP( new DomainAssembly( *this ) ) );
98 }
99 
102 {
104 }
105 
106 void
108 {
109  protocols::simple_moves::ReturnSidechainMover recover_sidechains( pose );
110 
111  if( !fragments_set_ ) {
112  TR<<"*******WARNING WARNING********: fragments not set, skipping domain assembly"<<std::endl;
113  runtime_assert( fragments_set_ );
114  return;
115  }
116 
118  mm->set_bb( false );
119  for( core::Size i=linker_start_; i<=linker_end_; ++i ) mm->set_bb( i, true );
120 /* //The following code only makes sense if we do 'blind' prediction stuff. In all cases where we have a starting structure,
121 //it's probably a good idea to start near that.
122  for(i = 1; i <= flexible_regions_.size(); i++ ){
123  ir = std::max(0, std::min( (int)pose_full_centroid.total_residue() , (int) flexible_regions_[i] ) );
124 
125  std::cout << "Linker: " << ir << std::endl;
126 
127  Real const init_phi ( -150.0 );
128  Real const init_psi ( 150.0 );
129  Real const init_omega( 180.0 );
130  pose_full_centroid.set_phi( ir , init_phi );
131  pose_full_centroid.set_psi( ir , init_psi );
132  pose_full_centroid.set_omega( ir, init_omega);
133  movemap->set_bb(ir, true);
134  }
135 */
139  to_centroid.apply( pose );
141  do {
143  abinit.init( pose );
144  abinit.apply( pose );
145  } while( !abrelax_app.check_filters( pose ) );
146 
147  //recover sidechains from starting structures
148  to_fullatom.apply( pose );
149  recover_sidechains.apply( pose );
150 // pose.update_residue_neighbors(); // o/w fails assertion `graph_state_ == GOOD`
151 // (*scorefxn)( pose );
152 // scorefxn->accumulate_residue_total_energies( pose );
153 
154 //Repack regions around the linker
155  core::pack::task::PackerTaskOP task( pack::task::TaskFactory::create_packer_task( pose ));
156  task->initialize_from_command_line().or_include_current( true );
157  task->restrict_to_repacking();
158 
159  for ( core::Size i = linker_end_+1; i <= pose.total_residue(); ++i) {
160  if ( !pose.residue(i).is_protein() ) continue;
161  if( pose.residue(i).type().name() == "CYD" ) {
162  task->nonconst_residue_task( i ).prevent_repacking();
163  continue;
164  }
165 
166  core::conformation::Residue const resi( pose.residue( i ) );
167  core::Size j;
168  for( j = 1; j<=linker_end_; ++j ) {
169  core::conformation::Residue const resj( pose.residue( j ) );
170 
171  core::Real const distance( resi.xyz( resi.nbr_atom() ).distance( resj.xyz( resj.nbr_atom() ) ) );
172  if( distance <= 8.0 ) break;
173  }
174  if( j>linker_end_ ) task->nonconst_residue_task( i ).prevent_repacking();
175  }
176  for ( core::Size i = 1; i <= linker_start_ - 1; ++i) {
177  if ( !pose.residue(i).is_protein() ) continue;
178  if( pose.residue(i).type().name() == "CYD" ) {
179  task->nonconst_residue_task( i ).prevent_repacking();
180  continue;
181  }
182 
183  core::conformation::Residue const resi( pose.residue( i ) );
184  core::Size j;
185  for( j = linker_start_; j<=pose.total_residue(); ++j ) {
186  core::conformation::Residue const resj( pose.residue( j ) );
187 
188  core::Real const distance( resi.xyz( resi.nbr_atom() ).distance( resj.xyz( resj.nbr_atom() ) ) );
189  if( distance <= 8.0 ) break;
190  }
191  if( j>pose.total_residue() ) task->nonconst_residue_task( i ).prevent_repacking();
192  }
193  //in case there is a resfile, information in this resfile overrides the computed task
194  if( basic::options::option[basic::options::OptionKeys::packing::resfile].user() )
195  core::pack::task::parse_resfile(pose, *task);
196 
197  pack::pack_rotamers( pose, *scorefxn, task);
198  (*scorefxn)( pose );
199  /// Now handled automatically. scorefxn->accumulate_residue_total_energies( pose );
200 }
201 
205 }
206 
207 void
209 {
210  linker_start_ = core::pose::get_resnum( tag, pose, "linker_start_" );
211  linker_end_ = core::pose::get_resnum( tag, pose, "linker_end_" );
212  runtime_assert( linker_end_ > linker_start_ );
213  runtime_assert( linker_start_ > 0 );
214  runtime_assert( linker_end_ < pose.total_residue() );
215 
216  std::string const frag_large_fname( tag->getOption< std::string >( "frag9", "frag9" ) );
217  std::string const frag_small_fname( tag->getOption< std::string >( "frag3", "frag3" ) );
218 
219  using namespace core::fragment;
220  using namespace basic::options;
221  fragset_large_ = FragmentIO(option[ OptionKeys::abinitio::number_9mer_frags ] ).read_data( frag_large_fname );
222  fragset_small_ = FragmentIO(option[ OptionKeys::abinitio::number_3mer_frags ] ).read_data( frag_small_fname );
223  fragments_set_ = true;
224 }
225 
226 } // abinitio
227 } // protocols