Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LoopLengthChange.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 protocols/protein_interface_design/movers/LoopLengthChange.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu)
13 
14 // Unit headers
17 
18 // Package headers
19 #include <core/pose/Pose.hh>
21 #include <basic/Tracer.hh>
22 #include <utility/tag/Tag.hh>
25 #include <protocols/moves/Mover.hh>
26 #include <core/pose/selection.hh>
30 #include <utility/vector0.hh>
31 #include <utility/vector1.hh>
32 #include <core/pose/PDBInfo.hh>
33 
34 
35 namespace protocols {
36 namespace protein_interface_design {
37 namespace movers {
38 
39 using namespace std;
40 using namespace core::scoring;
41 
42 static basic::Tracer TR( "protocols.protein_interface_design.movers.LoopLengthChange" );
43 
46 {
48 }
49 
52  return new LoopLengthChange;
53 }
54 
57 {
58  return "LoopLengthChange";
59 }
60 
62  Mover( LoopLengthChangeCreator::mover_name() ),
63  loop_start_( 0 ), loop_end_( 0 ), delta_( 0 )
64 {
65 }
66 
67 
69 
70 void
72 {
73  TR<<"Changing loop "<<loop_start()<<"-"<<loop_end()<<" by "<<delta()<<std::endl;
74  runtime_assert( loop_end() >= loop_start() );
75  runtime_assert( loop_end() + delta() >= loop_start() );
76  if( delta() < 0 ){
77  for( int del(0); del>delta(); --del ){
78  pose.delete_polymer_residue( loop_end() + del );
79 // pose.conformation().insert_ideal_geometry_at_polymer_bond( loop_start() );
80 // pose.conformation().insert_ideal_geometry_at_polymer_bond( loop_start() + 1 );
81  }
82  }
83  else if( delta() > 0 ){
84  using namespace core::chemical;
85  using namespace core::conformation;
86 
87  ResidueTypeSet const & residue_set( pose.residue( 1 ).residue_type_set() ); // residuetypeset is noncopyable
88  ResidueCOP new_res = ResidueFactory::create_residue( residue_set.name_map( name_from_aa( aa_from_oneletter_code( 'A' ) ) ) );
89  for( core::Size leng(1); leng<=(core::Size) delta(); ++leng ){
90  pose.conformation().safely_append_polymer_residue_after_seqpos( *new_res, loop_end() + leng - 1, true/*build_ideal
91 _geometry*/ );
92 // pose.set_omega(loop_end()+leng-1,180.0);
93  }
94  }
96  pose.pdb_info()->obsolete( true );
97 }
98 
102 }
103 
104 void
106 {
107  loop_start( core::pose::parse_resnum( tag->getOption< std::string >( "loop_start" ), pose ) );
108  loop_end( core::pose::parse_resnum( tag->getOption< std::string >( "loop_end" ), pose ) );
109  delta( tag->getOption< int >( "delta" ) );
110 
111  runtime_assert( loop_end() > loop_start() );
112  runtime_assert( loop_end() + delta() >= loop_start() );
113 
114  TR<<"LoopLengthChange with loop "<<loop_start()<<"-"<<loop_end()<<" and delta "<<delta()<<std::endl;
115 }
116 
119  return( protocols::moves::MoverOP( new LoopLengthChange( *this ) ));
120 }
121 
122 void
125 }
126 
129  return( loop_start_ );
130 }
131 
132 void
134  loop_end_ = l;
135 }
136 
139  return( loop_end_ );
140 }
141 
142 void
143 LoopLengthChange::delta( int const d ){
144  delta_ = d;
145 }
146 
147 int
149  return( delta_ );
150 }
151 
152 } //movers
153 } //protein_interface_design
154 } //protocols