Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JumpingFrame.hh
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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/fragments/Frame.hh
12 /// @brief set of fragments for a certain alignment frame
13 /// @author Oliver Lange (olange@u.washington.edu)
14 /// @author James Thompson
15 /// @date Wed Oct 20 12:08:31 2007
16 ///
17 #ifndef INCLUDED_core_fragment_JumpingFrame_HH
18 #define INCLUDED_core_fragment_JumpingFrame_HH
19 
20 // Unit Headers
22 
23 // Package Headers
24 #include <core/fragment/Frame.hh>
25 
26 // Project Headers
27 #include <core/pose/Pose.fwd.hh>
29 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
30 
31 // Utility headers
32 #include <utility/vector1.fwd.hh>
33 #include <utility/pointer/ReferenceCount.hh>
34 
35 // C++ STL Headers
36 #include <map>
37 
39 #include <utility/exit.hh>
40 #include <utility/vector1.hh>
41 
42 
43 namespace core {
44 namespace fragment {
45 
46 
47 /// @brief JumpingFrame is a discontinuous frame
48 /// i.e, the SRFDs stored in the FragData objects can be applied to residues anywhere
49 /// a 5 7 9 Frame of a FragData containing three BBTorsionSRFDs would change torsions of 5 7 9
50 /// a 5 32 2 Frame of a FragData containing two BBTorsionSRFD and on JumpSRFD would change torsions of 5 and 32 and the RT of jump_nr 2
51 /// note that in the latter case the 2 is not coding for a residue number!
52 ///
53 /// what is meaning of start() and end() ? If some of the positions are actually jump_nr should we ignore them for the
54 /// start() / end() question ? or should we store which positions are jumps and translate into residue numbers from jump_nr ?
55 /// could a MixedFrame contain Frames MixedFrame -- > non-cont-Frame, JumpFrame
56 class NonContinuousFrame : public Frame {
58  typedef Frame Parent;
59 public:
60 
61  // c'stor
63  : Frame( start, end, length ), pos_( length )
64  {};
65 
66  // copy c'stor, necessary or is pos_ copied automatically ?
67  // i think it will be copied just fine
68  // NonContinuousFrame
69  ///
70  /// @brief clone method, new frame with same alignment position, fragments are not copied!
71  // virtual FrameOP clone() {
72  // return new NonContinuousFrame( *this );
73  // }
74 
75  /// @brief translate intra-frame position into sequence position. (trivial for base-class)
76  virtual core::Size seqpos( core::Size intra_pos ) const { // BaseClass --> continuous frames
77  runtime_assert( intra_pos <= length() );
78  return pos_[ intra_pos ];
79  }
80 
81  virtual bool moves_residue( core::Size pos ) const {
82  PosList::const_iterator it = find( pos_.begin(), pos_.end(), pos );
83  return it != pos_.end();
84  }
85 
86  /// @brief true if frame is continuous
87  virtual bool is_continuous() const
88  { return false; };
89 
90  /// @brief assign sequence position or jump_nr to internal position pos
91  void set_pos( Size intra_pos, Size setting ) {
92  assert( intra_pos <= length() );
93  pos_[ intra_pos ] = setting;
94  }
95 
96  virtual void show( std::ostream& ) const;
97  virtual void read( std::istream& );
98 
99  virtual bool align( core::id::SequenceMapping const& map );
100 
101 protected:
102  void show_pos( std::ostream &out ) const;
103  PosList& pos() { return pos_ ; } ;
104  PosList const& pos() const { return pos_; };
105 private:
106 
107  /// @brief stores the residue number's or jump_nr's associated with the SRFDs in FragData
108  PosList pos_;
109 };
110 
111 
112 /// @brief JumpingFrame, so far there is nothing special about JumpingFrames.
113 /// but I think we might want to have additionally information like the start and end residues that belong to a certain jump_nr.!
114 /// okay: right now I require that the creator of a JumpingFrame sets start to the start-residue of the jump
116 public:
117 
119  : NonContinuousFrame( 0, 0, 0 ) {};
120 
122  : NonContinuousFrame( start, end, length ) {};
123 
124  ///@brief convience --- generate a matching FragData object dofs are unitialized!
125  //FragDataOP generate_fragdata( SingleResidueFragDataOP frag_res_type, SingleResidueFragDataOP jump_frag_type )
126 
127  /// @brief clone method, new frame with same alignment position, fragments are not copied!
128  virtual FrameOP clone() const {
129  JumpingFrameOP newFrame ( new JumpingFrame( start(), end(), length() ) );
130  newFrame->pos() = pos();
131  return newFrame;
132  }
133 
135  return "JUMPFRAME";
136  }
137 
138  virtual std::string type() const {
139  return _static_type_name();
140  }
141  /// fragment_as_pose ????
142 
143 
144 
145 
146 }; //JumpingFrame
147 
148 
149 }
150 }
151 
152 #endif