Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LayerDesignOperation.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 protocols/flxbb/LayerDesignOperation.hh
11 /// @brief Design residues with selected amino acids depending on the enviroment: layer.
12 /// The layer of each residue is assigned as core, boundary, or surface, which are defined by
13 /// accessible surface of mainchain + CB. If resfile is read before calling this operation,
14 /// this operation is not applied for the residues defined by PIKAA.
15 /// @author Nobuyasu Koga ( nobuyasu@uw.edu )
16 /// @modified Javier Castellanos (javiercv@uw.edu )
17 
18 // The following are using amino acids for each layer
19 /// @CORE
20 // Loop: AFILPVWY
21 // Strand: FIL VWY
22 // Helix: AFIL VWY ( P only at the beginning of helix )
23 // HelixCapping: DNST
24 //
25 /// @BOUDNARY
26 // Loop: ADEFGIKLNPQRSTVWY
27 // Strand: DEF IKLN QRSTVWY
28 // Helix: ADE IKLN QRSTV Y ( P only at the beginning of helix )
29 // HelixCapping: DNST
30 //
31 /// @SURFACE
32 // Loop: DEGHKNPQRST
33 // Strand: DE HKN QRST
34 // Helix: DE HKN QRST ( P only at the beginning of helix )
35 // HelixCapping: DNST
36 
37 
38 
39 #ifndef INCLUDED_protocols_flxbb_LayerDesignOperation_hh
40 #define INCLUDED_protocols_flxbb_LayerDesignOperation_hh
41 
42 #include <core/types.hh>
43 // AUTO-REMOVED #include <core/chemical/AA.hh>
48 #include <utility/tag/Tag.fwd.hh>
49 
50 // AUTO-REMOVED #include <iostream>
51 #include <utility/vector1.hh>
52 
53 #include <string>
54 #include <map>
55 
56 
57 // Utility Headers
58 
59 using namespace core::pack::task;
60 
61 namespace protocols {
62 namespace flxbb {
63 
65 public:
66 
67 
69  typedef core::Real Real;
76  typedef std::map< std::string, TaskOperationOP > TaskLayers;
77  typedef std::pair< std::string, TaskOperationOP > TaskLayer;
78 
79  // Layer Residues is a map of maps, the first key is the layer(core, boundary, intermediate)
80  // and the second key is the secondary structure (L,E,H). The values are string of one letter
81  // code aminoacids to be used in each layer.
82  typedef std::map< std::string, std::string > LayerDefinitions;
83  typedef std::pair< std::string, std::string > LayerDefinition;
84  typedef std::map< std::string, LayerDefinitions > LayerResidues;
85  typedef std::pair< std::string, LayerDefinitions > Layer;
86 
87 public:
88 
89 
90  /// @brief default constructor
92 
93  /// @brief value constructor
94  LayerDesignOperation( bool dsgn_core, bool dsgn_boundary, bool dsgn_surface );
95 
96  /// @brief destructor
97  virtual ~LayerDesignOperation();
98 
99  /// @brief make clone
100  virtual TaskOperationOP clone() const;
101 
102 
103 public:
104 
105 
106  /// @brief layer to be designed
107  void design_layer( bool const dsgn_core, bool const dsgn_boundary, bool const dsgn_surface );
108 
109  /// @brief accessible surface for evaluating residues are in surface or not
110  void sasa_surface( Real const r, String const ss="" );
111 
112  /// @brief accessible surface for evaluating residues are in core or not
113  void sasa_core( Real const r, String const ss="" );
114 
115  /// @brief set pore radius for colculating asa
116  void pore_radius( Real ps );
117 
118  /// @brief set verbose
119  void set_verbose( bool const b ) { verbose_ = b; }
120 
121  /// @brief set restrict_restypes
122  void set_restrict_restypes( bool const b ) { restrict_restypes_ = b; }
123 
124  /// @brief use original sequence for not designed layer
126  {
127  use_original_ = true;
128  }
129 
130  ///@brief make pymol scripts showing the different layers
131  void make_pymol_script(bool value) { make_pymol_script_ = value; }
132 
133 public:
134 
135 
136  void parse_tag( TagPtr tag );
137 
138 
139 public:
140 
141 
142  /// @brief apply
143  virtual void apply( Pose const & pose, PackerTask & task ) const;
144 
145 private:
146  utility::vector1<bool> get_restrictions(std::string const & layer, std::string const & default_layer, std::string const & ss_type) const;
147  void set_default_layer_residues();
148 
149 
150 private:
151 
152  ///@brief utility function to transform a vector of position into a pymol selection command
153  std::string pos2select( utility::vector1< Size > const & pos) const;
154  ///@brief write a pymol command with the different layers as selections
155  void write_pymol_script( Pose const & pos, toolbox::SelectResiduesByLayerOP srbl, std::map< std::string, utility::vector1<bool> > const & layer_specification,bool las_ligand, std::string const & filename ) const;
156 
157  /// @brief add helix capping ?
159 
160  /// @brief use original sequence for not designed layer ?
162 
163  ///@brief
165 
166  bool verbose_;
167 
169 
171 
173  std::map< std::string, bool > design_layer_;
174 
176 
177  // define the layer each residue belong to
179 
180 
181 };
182 
183 // utility class for chaining together task operations
187 public:
189  /// @brief apply
190  virtual void apply( Pose const & pose, PackerTask & task ) const;
191  /// @brief make clone
192  virtual TaskOperationOP clone() const { return new CombinedTaskOperation( *this ); }
193 
194 private:
196 };
197 
199 
200 } // flxbb
201 } // protocols
202 
203 #endif