Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SingleResidueFragData.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/FragData.hh
12 /// @brief A fragment as list of SingleResidue Data
13 /// @author Oliver Lange (olange@u.washington.edu)
14 /// @date Wed Oct 20 12:08:31 2007
15 ///
16 #ifndef INCLUDED_core_fragment_SingleResidueFragData_HH
17 #define INCLUDED_core_fragment_SingleResidueFragData_HH
18 
19 // Unit Headers
21 
22 // Package Headers
24 
25 // Project Headers
27 #include <core/pose/Pose.fwd.hh>
28 #include <core/types.hh>
29 
30 // AUTO-REMOVED #include <core/kinematics/types.hh>
31 
32 // Utility headers
33 // AUTO-REMOVED #include <utility/vector1.hh>
34 #include <utility/pointer/ReferenceCount.hh>
35 // AUTO-REMOVED #include <utility/fix_boinc_read.hh>
36 
37 // C++ headers
38 // AUTO-REMOVED #include <string>
39 // AUTO-REMOVED #include <ostream>
40 
41 #include <utility/vector1.hh>
42 
43 
44 namespace core {
45 namespace fragment {
46 
47 
49 
50 ///@brief Base class for SRFD classes
51 ///@detail Instances of SRFD classes contain information on specific dofs in
52 /// a single residue or a jump connected to a residue
53 /// The classes' apply method will now how to implement the specified dofs in the give pose
54 /// at the given residue position
55 ///
56 
57 /// TODO: change SRFD interface such that apply is called like this
58 /// apply( pose, inframe_pos (1..length), Frame const& )
59 /// jumpFrags can then ask the Frame for their upstream residue and check that if they
60 /// are at position 1 that they do nothgin...
61 /// can have basic implementation that translates this apply into the old apply
62 // only JumpSRFD needs to overload this function
63 // scrap continuous apply of FragData ?!
64 
65 
67 public:
68  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
69  virtual ~SingleResidueFragData();
71  : sequence_( sequence )
72  {};
73 
75  : sequence_( 'X' )
76  {};
77 
78  virtual
80  clone() const = 0;
81 
82  /// @brief create a new instance of this object
83  virtual
84  SingleResidueFragDataOP create() const = 0;
85 
86  /// @brief insert fragment_data into pose at position seq_pos
87  virtual bool apply( pose::Pose &, Size seq_pos ) const = 0;
88 
89  /// @brief insert fragment_data into pose at position seq_pos for dofs that are
90  /// allowed to move in the movemap
91  /// @return True if operation succeeds, False otherwise.
92  virtual bool apply( kinematics::MoveMap const & movemap, pose::Pose & pose, Size const seqpos ) const = 0;
93 
94  /// @brief insert fragment_data sec-struct into ss-string at position seq_pos
95  virtual bool apply_ss( std::string&, Size seq_pos ) const = 0;
96 
97  /// @brief insert fragment_data into pose at position seq_pos
98  virtual bool steal( pose::Pose const&, Size seq_pos ) = 0;
99 
100  /// @brief insert fragment_data into pose at position given by Frame.seqpos( intra_frame_pos );
101  virtual bool apply(pose::Pose &, Size const intra_frame_pos, Frame const & ) const;
102 
103  /// @brief insert fragment_data into pose at position given by Frame.seqpos( intra_frame_pos )
104  /// for dofs that are allowed to move in the MoveMap
105  virtual bool apply( kinematics::MoveMap const & movemap, pose::Pose & pose, Size const intra_frame_pos, Frame const & frame ) const;
106 
107  /// @brief insert fragment_data sec-struct into ss-string at position seq_pos
108  virtual bool apply_ss( std::string&, Size intra_frame_pos, Frame const& ) const;
109 
110  /// @brief insert fragment_data into pose at position seq_pos
111  virtual bool steal( pose::Pose const&, Size intra_frame_pos, Frame const& );
112 
113  /// @brief check weather SRFD applies to same dofs and is of same type
114  virtual bool
115  is_compatible( SingleResidueFragData const& ) const = 0;
116 
117  /// @brief check weather dofs can be moved
118  virtual bool
119  is_applicable( kinematics::MoveMap const&, Size intra_frame_pos, Frame const& ) const;
120 
121  /// @brief check whether dofs can be moved
122  virtual bool
123  is_applicable( kinematics::MoveMap const&, Size pos ) const = 0;
124 
125 
126  void
127  set_sequence( char const sequence )
128  {
130  }
131  ///
132  char
133  sequence() const
134  {
135  return sequence_;
136  };
137 
138  virtual char secstruct() const {
139  // this shouldn't be called for an SRFD that does not have secstruct
140  assert( 0 );
141  return 'X';
142  }
143 
144  virtual
145  void show( std::ostream &out ) const;
146 
147  /// @brief Default implementation: noop
148  virtual
149  void read_data( std::istream& );
150 
151 
152  virtual
153  std::string type() const;
154 
156 
157 protected:
158  char sequence_;
159 };
160 
161 inline std::ostream& operator<< ( std::ostream& out, SingleResidueFragData const& srfd ) {
162  srfd.show( out );
163  return out;
164 }
165 
166 inline std::istream& operator>> ( std::istream& in, SingleResidueFragData& srfd ) {
167  srfd.read_data( in );
168  return in;
169 }
170 
171 }
172 }
173 
174 #endif