Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Motif.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 //
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 Motif.hh
11 /// @brief Header for interaction motif between residues
12 /// @author havranek, sthyme (sthyme@gmail.com)
13 
14 #ifndef INCLUDED_protocols_motifs_Motif_hh
15 #define INCLUDED_protocols_motifs_Motif_hh
16 
17 // Unit Headers
19 
20 // Package Headers
21 
22 // Project Headers
25 #include <core/kinematics/Jump.hh>
27 #include <core/pose/Pose.fwd.hh>
28 #include <core/types.hh>
29 
30 // Utility Headers
31 #include <utility/pointer/ReferenceCount.hh>
32 
33 // C++ Headers
34 #include <iosfwd>
35 #include <map>
36 #include <string>
37 
38 #include <utility/vector1.hh>
39 
40 
41 namespace protocols {
42 namespace motifs {
43 
45 {
46 
47 static std::map < std::string, utility::vector1 < std::string > > motifAtomIDs;
48 static std::map < std::string, utility::vector1 < std::string > > basebaseAtomIDs;
49 
50 public:
51  // This is a 'by hand' way to associate a jump with the coordinate system-forming
52  // atoms.
53  Motif(
54  std::string const resname1,
55  std::string const res1_atom1,
56  std::string const res1_atom2,
57  std::string const res1_atom3,
58  std::string const resname2,
59  std::string const res2_atom1,
60  std::string const res2_atom2,
61  std::string const res2_atom3,
62  core::kinematics::Jump const & orientation
63  );
64 
65  // This constructor gets the jump for you - PDB numbering + chain id
66  Motif(
67  core::pose::Pose const & pose,
68  Size const pdb_residue_position_1,
69  char const pdb_chain_id1,
70  std::string const res1_atom1,
71  std::string const res1_atom2,
72  std::string const res1_atom3,
73  Size const pdb_residue_position_2,
74  char const pdb_chain_id2,
75  std::string const res2_atom1,
76  std::string const res2_atom2,
77  std::string const res2_atom3
78  );
79 
80  // This constructor gets the jump for you - Rosetta numbering
81  Motif(
82  core::pose::Pose const & pose,
83  Size const pdb_residue_position_1,
84  std::string const res1_atom1,
85  std::string const res1_atom2,
86  std::string const res1_atom3,
87  Size const pdb_residue_position_2,
88  std::string const res2_atom1,
89  std::string const res2_atom2,
90  std::string const res2_atom3
91  );
92 
93  // This constructor forms a motif using preset atom types from a static map
94  Motif(
95  core::conformation::Residue const & res1,
96  core::conformation::Residue const & res2
97  );
98 
99  // Ligand motif constructor: This constructor gets the jump for you - Rosetta numbering
100  Motif(
101  core::conformation::Residue const & res1,
102  core::conformation::Residue const & res2,
103  utility::vector1< Size > const res2_atoms
104  );
105 
106 // Ligand motif search constructor: No residues, just atom names and a jump
107  Motif(
108  std::string const resname1,
109  std::string const res1_atom1,
110  std::string const res1_atom2,
111  std::string const res1_atom3,
112  std::string const res2_atom1,
113  std::string const res2_atom2,
114  std::string const res2_atom3,
115  core::kinematics::Jump const & orientation
116  );
117 
118  // Copy constructor
119  Motif(
120  Motif const & src
121  );
122 
123  // Clone method
124  MotifOP
125  clone() const;
126 
127  // Destructor
128  virtual ~Motif();
129 
130  // Residue check_res is res1 of motif
131  virtual bool
133  core::conformation::Residue const & check_res
134  ) const;
135 
136  // Residue check_res is res2 of motif
137  virtual bool
139  core::conformation::Residue const & check_res
140  ) const;
141 
142  // Position in pose is same type as motif
143  virtual bool
144  apply_check(
145  core::pose::Pose const & pose,
146  Size const pos
147  ) const;
148 
149  // Make atom integers for this motif, unused as of now, may want in future
150  //virtual void
151  //generate_atom_ints();
152 
155  core::pose::Pose & pose,
156  Size const rotamer_build_position,
157  bool use_forward,
158  Size const ex_,
159  bool res2 = false
160  ) const;
161 
162  // Build a rotamer library using this motif and one given position to serve as the start
163  // point for the motif. The third, optional argument is the position at which to build
164  // the rotamers. If neglected, finds the closest position in the pose and uses that.
167  core::pose::Pose & pose,
168  Size const motif_anchor_position,
169  bool use_forward,
170  Size rotamer_build_position = 0
171  ) const;
172 
173  // The place_residue function moves the mobile residue based on motif geometry
174  virtual void
176  core::conformation::Residue const & fixed,
178  bool one_three = true
179  ) const;
180 
181  virtual void
182  place_atoms(
183  core::conformation::Residue const & fixed,
185  utility::vector1< std::string > const & atoms,
186  bool one_three = true
187  ) const;
188 
189  virtual void
190  place_atom(
191  core::conformation::Residue const & fixed,
194  bool one_three = true,
195  std::string const atomtype = "C1*"
196  ) const;
197 
198  virtual void
200  core::conformation::Residue const & fixed,
202  bool forward,
203  bool one_three = true
204  ) const;
205 
206  virtual void
207  place_atom_(
208  core::conformation::Residue const & fixed,
210  bool forward,
212  bool one_three = true,
213  std::string const atomtype = "C1*"
214  ) const;
215 
216  virtual void
217  place_atoms_(
218  core::conformation::Residue const & fixed,
220  bool forward,
221  utility::vector1< std::string > const & atoms,
222  bool one_three = true
223  ) const;
224 
225  // Ligand motifs place_residue
226  virtual void
228  core::conformation::Residue const & fixed,
230  Size const & res2_atom1_index_in,
231  Size const & res2_atom2_index_in,
232  Size const & res2_atom3_index_in,
233  bool one_three = true
234  ) const;
235 
236  // Ligand motifs place_atoms
237  virtual void
238  place_atoms(
239  core::conformation::Residue const & fixed,
241  utility::vector1< Size > const & atoms,
242  Size const & res2_atom1_index_in,
243  Size const & res2_atom2_index_in,
244  Size const & res2_atom3_index_in,
245  bool one_three = true
246  ) const;
247 
248  // Ligand motifs place_atom
249  virtual void
250  place_atom(
251  core::conformation::Residue const & fixed,
254  Size const & res2_atom1_index_in,
255  Size const & res2_atom2_index_in,
256  Size const & res2_atom3_index_in,
257  Size const & atomtype,
258  bool one_three = true
259  ) const;
260 
261  // Ligand motifs place_residue_
262  virtual void
264  core::conformation::Residue const & fixed,
266  bool forward,
267  Size const & res2_atom1_index_in,
268  Size const & res2_atom2_index_in,
269  Size const & res2_atom3_index_in,
270  bool one_three = true
271  ) const;
272 
273  // Ligand motifs place_atom_
274  virtual void
275  place_atom_(
276  core::conformation::Residue const & fixed,
278  bool forward,
280  Size const & res2_atom1_index_in,
281  Size const & res2_atom2_index_in,
282  Size const & res2_atom3_index_in,
283  Size const & atomtype,
284  bool one_three = true
285  ) const;
286 
287  // Ligand motifs place_atoms_
288  virtual void
289  place_atoms_(
290  core::conformation::Residue const & fixed,
292  bool forward,
293  utility::vector1< Size > const & atoms,
294  Size const & res2_atom1_index_in,
295  Size const & res2_atom2_index_in,
296  Size const & res2_atom3_index_in,
297  bool one_three = true
298  ) const;
299 
300  // For output
301  virtual void
302  print(
303  std::ostream & os
304  ) const;
305 
306  // For output
307  virtual
308  std::string print() const;
309 
310  // Overloaded operator for output
311  friend std::ostream & operator <<(
312  std::ostream & os,
313  Motif const & mot
314  );
315 
316  // Stores remark, havranek uses
317  void
318  store_remark(
319  std::string const & remark_in
320  );
321 
322  // Stores path of motif for future output if motif was read from pdb
323  void
324  store_path(
325  std::string const & path_in
326  );
327 
328  // Accessors
329  std::string const & restype_name1() const { return restype_name1_; }
330  std::string const & res1_atom1_name() const { return res1_atom1_name_; }
331  std::string const & res1_atom2_name() const { return res1_atom2_name_; }
332  std::string const & res1_atom3_name() const { return res1_atom3_name_; }
333  int const & res1_atom1_int() const { return res1_atom1_int_; }
334  int const & res1_atom2_int() const { return res1_atom2_int_; }
335  int const & res1_atom3_int() const { return res1_atom3_int_; }
336  Size const & res1_atom1_index() const { return res1_atom1_index_; }
337  Size const & res1_atom2_index() const { return res1_atom2_index_; }
338  Size const & res1_atom3_index() const { return res1_atom3_index_; }
339  std::string const & restype_name2() const { return restype_name2_; }
340  std::string const & res2_atom1_name() const { return res2_atom1_name_; }
341  std::string const & res2_atom2_name() const { return res2_atom2_name_; }
342  std::string const & res2_atom3_name() const { return res2_atom3_name_; }
343  int const & res2_atom1_int() const { return res2_atom1_int_; }
344  int const & res2_atom2_int() const { return res2_atom2_int_; }
345  int const & res2_atom3_int() const { return res2_atom3_int_; }
346  Size const & res2_atom1_index() const { return res2_atom1_index_; }
347  Size const & res2_atom2_index() const { return res2_atom2_index_; }
348  Size const & res2_atom3_index() const { return res2_atom3_index_; }
351  bool has_remark() const { return has_remark_;}
352  bool has_path() const { return has_path_;}
353  std::string const & remark() const { return remark_;}
354  std::string const & path() const { return path_;}
355 
356 private:
357  // names (name3) of the residues in motif and each of the 6 motif atoms
378  // Jumps associated with the motif
381  // Associated information for future output
385  bool has_path_;
386 
387 };
388 
389 } // namespace motifs
390 } // namespace protocols
391 
392 #endif // INCLUDED_protocols_motifs_Motif