Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FullAtomRNA_Fragments.hh
Go to the documentation of this file.
1 
2 //Auto using namespaces
3 //Auto using namespaces end
4 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
5 // vi: set ts=2 noet:
6 // CVS information:
7 // $Revision: 1.1.2.1 $
8 // $Date: 2005/11/07 21:05:35 $
9 // $Author: rhiju $
10 // (c) Copyright Rosetta Commons Member Institutions.
11 // (c) This file is part of the Rosetta software suite and is made available under license.
12 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
13 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
14 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
15 /// @author Rhiju Das
16 
17 #ifndef INCLUDED_protocols_rna_FullAtomRNA_Fragments_HH
18 #define INCLUDED_protocols_rna_FullAtomRNA_Fragments_HH
19 
21 // AUTO-REMOVED #include <protocols/toolbox/AllowInsert.hh>
23 
24 // ObjexxFCL Headers
25 #include <ObjexxFCL/FArray1D.hh>
26 #include <ObjexxFCL/FArray2D.hh>
27 #include <ObjexxFCL/FArray3D.hh>
28 
29 #include <core/pose/Pose.fwd.hh>
30 #include <core/types.hh>
32 #include <utility/pointer/ReferenceCount.hh>
33 
34 // C++ Headers
35 #include <string>
36 #include <map>
37 #include <vector>
38 
39 #include <utility/vector1.hh>
40 
41 
42 //Auto using namespaces
43 namespace ObjexxFCL { } using namespace ObjexxFCL; // AUTO USING NS
44 
45 
46 /////////////////////////////////////////////////////////////////////////////////////
47 /////////////////////////////////////////////////////////////////////////////////////
48 // Goal: to make a fragment object that can choose fragments
49 // "on the fly" for RNA ab inito folding.
50 //
51 // After reading in a set of torsions from, e.g., the ribosome crystal structure,
52 // should be able to generate fragments of size 1, 2, or 3, with
53 // exact sequence matches, partial Y/R matches, or ignoring sequence.
54 //
55 namespace protocols{
56 namespace rna{
57 
58  /////////////////////////////////////////////////////////////////////////////////////////////////
59  /////////////////////////////////////////////////////////////////////////////////////////////////
60  class TorsionSet {
61  public:
62  TorsionSet & operator =( TorsionSet const & src );
63  TorsionSet( core::Size const size );
64 
65  //make this private?
66  FArray2D <core::Real> torsions; // dimensions: (NUM_RNA_TORSIONS, SRange(0, size) );
67  FArray1D <std::string> torsion_source_name; // dimensions: ( SRange(0, size) );
68  FArray1D <char> secstruct;
69 
70  FArray3D <core::Real> non_main_chain_sugar_coords;
72 
73  inline
74  core::Size get_size() const { return size_; }
75 
76  private:
78 
79  };
80 
81 
82  class FullAtomRNA_Fragments; // defined below.
83 
84  /////////////////////////////////////////////////////////////////////////////////////////////////
85  /////////////////////////////////////////////////////////////////////////////////////////////////
87  public:
88  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
89  virtual ~FragmentLibrary();
90 
91  //constructor!
92  //FragmentLibrary();
93 
94  //destructor -- necessary?
95  //~FragmentLibrary();
96 
97  core::Real get_fragment_torsion(
98  core::Size const num_torsion,
99  Size const which_frag,
100  core::Size const offset );
101 
102  TorsionSet const get_fragment_torsion_set( core::Size const which_frag );
103 
104  void add_torsion( TorsionSet const torsion_set );
105 
106  void add_torsion(
107  FullAtomRNA_Fragments const & vall,
108  core::Size const position,
109  core::Size const size
110  );
111 
112  core::Size get_align_depth();
113 
114  private:
115  std::vector< TorsionSet > align_torsions_;
116 
117  };
118 
119  /////////////////////////////////////////////////////////////////////////////////////////////////
121  typedef std::pair< std::string, std::string > SequenceSecStructPair;
122  typedef std::map< SequenceSecStructPair, FragmentLibraryOP > FragmentLibraryPointerMap;
123 
124  /////////////////////////////////////////////////////////////////////////////////////////////////
126  public:
127  //Constructor -- needs vall_torsions_file to get started.
128  // RNA_Fragments();
130 
132 
133  //Probably the only thing that will actually get called publicly:
134  virtual void
135  apply_random_fragment(
136  core::pose::Pose & pose,
137  core::Size const position,
138  core::Size const size,
139  core::Size const type,
140  toolbox::AllowInsertOP allow_insert );
141 
142  virtual bool
143  is_fullatom();
144 
145  void read_vall_torsions( std::string const filename );
146 
147 
148  core::Real
149  torsions( core::Size const & i, core::Size const & j ) const { return vall_torsions_( i, j ); }
150 
152  name( core::Size const & i ) const { return vall_name_( i ); }
153 
154  char
155  secstruct( core::Size const & i ) const { return vall_secstruct_( i ); }
156 
157  bool
158  non_main_chain_sugar_coords_defined() const { return vall_non_main_chain_sugar_coords_defined_; }
159 
160  core::Real
161  non_main_chain_sugar_coords( core::Size const & i, core::Size const & j, core::Size const & k ) const{ return vall_non_main_chain_sugar_coords_( i, j, k);}
162 
163  private:
164 
165  void
166  pick_random_fragment(
167  TorsionSet & torsion_set,
168  std::string const RNA_string,
169  std::string const RNA_secstruct_string,
170  core::Size const type = MATCH_YR );
171 
172  void
173  pick_random_fragment(
174  TorsionSet & torsion_set,
175  core::pose::Pose & pose,
176  core::Size const position,
177  core::Size const size,
178  core::Size const type = MATCH_YR );
179 
180  void
181  insert_fragment(
182  core::pose::Pose & pose,
183  Size const position,
184  protocols::rna::TorsionSet const & torsion_set,
185  toolbox::AllowInsertOP allow_insert );
186 
187  private:
188 
189  // Probably should make following "vall" stuff a different object
190  // and, come on, these could be a vector to save memory!
191  FArray2D <core::Real> vall_torsions_;
192  FArray3D <core::Real> vall_non_main_chain_sugar_coords_;
193  FArray1D <char> vall_sequence_;
194  FArray1D <bool> vall_is_chainbreak_;
195  FArray2D <bool> vall_edge_is_base_pairing_;
197  FArray1D <char> vall_secstruct_;
198  FArray1D <std::string> vall_name_;
201 
202  // Need to hold on to some fragment libraries. These
203  // will be picked on the fly when the code requires them.
204  // Indexed by sequence, e.g., AAA, AGA, GUA ... or even RYR ... or even NNN (totally generic!)
206 
207  void pick_fragment_library( SequenceSecStructPair const & key );
208 
209  void pick_random_fragment( FArray1D <core::Real> & RNA_torsions, std::string const RNA_string );
210 
211  };
212 
213  /////////////////////////////////////////////////////////////////////////////////////////////////
214  /////////////////////////////////////////////////////////////////////////////////////////////////
215 
216 
217 }
218 }
219 
220 #endif