Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PocketGrid.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/pockets/PocketGrid.hh
11 /// @brief protocols::pockets::PocketGrid header
12 /// @author David Johnson
13 /// @author Ragul Gowthaman
14 
15 #ifndef INCLUDED_protocols_pockets_PocketGrid_hh
16 #define INCLUDED_protocols_pockets_PocketGrid_hh
17 
18 #include <utility/pointer/ReferenceCount.hh>
20 #include <core/types.hh>
21 // AUTO-REMOVED #include <core/pose/Pose.hh>
24 
25 // Numeric Headers
26 // AUTO-REMOVED #include <numeric/xyz.functions.hh>
27 #include <numeric/xyzMatrix.hh>
28 #include <numeric/xyzVector.hh>
29 // AUTO-REMOVED #include <numeric/conversions.hh>
30 
31 #include <utility/vector1_bool.hh>
32 #include <list>
33 #include <string>
34 
35 #include <core/pose/Pose.fwd.hh>
36 #include <utility/vector1.hh>
37 
38 
39 namespace protocols {
40 namespace pockets {
41 
42 ///@
43 class PCluster
44 {
45 
46  friend class PocketGrid;
47  friend class EggshellGrid;
48 
49 public:
50 
52  PCluster(const PCluster& old);
53  ~PCluster() {};
54  int size() const {return points_.size();};
55  bool testNeighbor(PCluster & c2);
56  bool isClose(PCluster const & c2) const;
57  bool isTarget() const {return target;};
58  void add (core::Size x, core::Size y, core::Size z);
59  typedef struct {
63  } Cxyz;
64  std::list < Cxyz > points_;
65 
66 private:
67  int count_;
68  bool target;
71 
72 }; //PCluster
73 
74 ///@
76 {
77 
78  friend class PocketGrid;
79  friend class EggshellGrid;
80 
81 public:
82  PClusterSet();
83  PClusterSet& operator= (const PClusterSet& old);
84  void clear();
85  std::list<PCluster>::iterator add (core::Size x, core::Size y, core::Size z, core::Real step);
86  void findClusters();
87  void join(std::list<PCluster>::iterator c1, std::list<PCluster>::iterator c2);
88  core::Real getLargestClusterSize( core::Real const & stepSize, core::Real const & minClusterSize );
89  core::Real getNetClusterSize( core::Real const & stepSize, core::Real const & minClusterSize );
90  core::Size size() { return clusters_.size(); }
91 
92 private:
93  std::list <PCluster> clusters_;
94 
95 }; //PClusterSet
96 
97 ///@
99 {
100 
101  friend class EggshellGrid;
102 
103 protected:
105  std::vector < std::vector < std::vector <PtType> > > grid_;
106  std::vector < std::vector < std::vector <core::Size> > > pockets_;
107  //std::vector < conformation::Atom > atoms_;
108  //core::Size numAtoms_;
116  void init();
117  void setup_default_options();
118  void newSearch(core::Size thr1, core::Size thr2, core::Size max1, core::Size max2, bool psp=false, bool sps=false);
119  bool fill(core::Size x, core::Size y,core::Size z);
120  bool touchesSolvent(core::Size x, core::Size y,core::Size z) const;
121  bool touchesSS(core::Size x, core::Size y,core::Size z) const;
122  bool touchesPS(core::Size x, core::Size y,core::Size z) const;
123  bool touchesSurface(core::Size x, core::Size y,core::Size z, bool polar, bool either=false) const;
125 
128 
143  bool markpsp_;
144  bool marksps_;
148 
149 public:
150  PocketGrid();
151  virtual ~PocketGrid();
152  PocketGrid(const PocketGrid& gr);
153  PocketGrid& operator= (const PocketGrid& gr);
154 
155  PocketGrid( core::conformation::Residue const & central_rsd );
156  PocketGrid( std::vector< core::conformation::ResidueOP > const & central_rsd );
157  PocketGrid( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real x, core::Real y, core::Real z, core::Real const & stepSize );
158  PocketGrid( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real x, core::Real y, core::Real z );
159  PocketGrid( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real x, core::Real y, core::Real z, core::Real const & stepSize, bool psp, bool sps);
160 
161  PocketGrid( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real x, core::Real const & stepSize=1, bool psp=false, bool sps=false);
162  PocketGrid( core::Vector const & center, core::Real x, core::Real const & stepSize=1, bool psp=false, bool sps=false);
163  PocketGrid( core::Vector const & center, core::Real const & x, core::Real const & y, core::Real const & z, core::Real const & stepSize=1, bool psp=false, bool sps=false);
164 
165  void initialize( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real const size_x, core::Real const size_y, core::Real const size_z, core::Real const & stepSize=1, bool psp=false, bool sps=false);
166 
167  void initialize( core::Real const & xc, core::Real const & yc, core::Real const & zc, core::Real x, core::Real const & stepSize=1, bool psp=false, bool sps=false);
168  void initialize( core::Vector const & center, core::Real x, core::Real const & stepSize=1, bool psp=false, bool sps=false);
169  void initialize( core::Vector const & center, core::Real const & x, core::Real const & y, core::Real const & z, core::Real const & stepSize=1, bool psp=false, bool sps=false);
170  void initialize( core::conformation::Residue const & central_rsd, core::Real const & x, core::Real const & y, core::Real const & z, core::Real const & stepSize=1, bool psp=false, bool sps=false);
171  void initialize( std::vector< core::conformation::ResidueOP > const & central_rsd, core::Real const & x, core::Real const & y, core::Real const & z, core::Real const & stepSize=1, bool psp=false, bool sps=false);
172  void clear();
173 
174  void recenter(core::Real const & xc, core::Real const & yc, core::Real const & zc);
175  void recenter( core::conformation::Residue const & central_rsd );
176  void recenter( std::vector< core::conformation::ResidueOP > const & central_rsds );
177  void recenter( core::Vector const & center);
178 
179  void findPockets(core::Size thr, core::Real max);
180  void findPSP(core::Size thr, core::Real max);
181  void findSPS(core::Size thr, core::Real max);
182 
183  void mark (core::Real x, core::Real y, core::Real z, core::Real const & vdWd, core::Real const & buffer, bool polar=false, bool targetResi=false);
184  void mark (core::Vector const & center, core::Real const & vdWd, core::Real const & buffer, bool polar=false, bool targetResi=false);
185 
186  void clearSmallPockets(core::Size minsize);
187  void findClusters();
188 
189  void dumpGridToFile();
190  void dumpGridToFile( std::string const & output_filename );
191  void fillTargetPockets();
192  void print();
193  core::Real targetPocketVolume(core::Real const & surf_sc, core::Real const & bur_sc) const ;
195  void markPocketDepth(core::Real const & surf_d, core::Real const & bur_d);
196  void markEdgeDepth(core::Real const & surf_d, core::Real const & bur_d);
198  void markDepth(core::Size x, core::Size y, core::Size z, core::Real const & surf_d, core::Real const & bur_d);
199  bool markOneEdgeDepth(core::Size x, core::Size y, core::Size z, core::Real const & surf_d, core::Real const & bur_d, bool isTarget);
200  void clusterPockets();
206  bool isTooSmall() const;
208 
209  bool autoexpanding_pocket_eval( core::conformation::Residue const & central_rsd, core::scoring::constraints::XYZ_Func const & xyz_func, Size const total_residues );
210  bool autoexpanding_pocket_eval( std::vector< core::conformation::ResidueOP > const & central_rsd, core::scoring::constraints::XYZ_Func const & xyz_func, Size const total_residues );
211  bool autoexpanding_pocket_eval( core::conformation::Residue const & central_rsd, core::pose::Pose const & inPose);
212  bool autoexpanding_pocket_eval( std::vector< core::conformation::ResidueOP > const & central_rsd, core::pose::Pose const & inPose);
214  bool DARC_autoexpanding_pocket_eval( core::conformation::Residue const & central_rsd, core::scoring::constraints::XYZ_Func const & xyz_func, Size const total_residues, numeric::xyzVector<core::Real> grid_center );
215  bool DARC_pocket_eval( core::conformation::Residue const & central_rsd, core::pose::Pose const & inPose, numeric::xyzVector<core::Real> grid_center );
216  bool DARC_pocket_eval( core::conformation::Residue const & central_rsd, core::scoring::constraints::XYZ_Func const & xyz_func, Size const total_residues, numeric::xyzVector<core::Real> grid_center );
217 
218  void move_pose_to_standard_orie( core::Size const & central_seqpos, core::pose::Pose & pose );
219 
220  static std::vector< core::conformation::ResidueOP > getRelaxResidues( core::pose::Pose const & input_pose, std::string const & resids );
221  void randomAngle();
222  void zeroAngle();
223 
224  core::Real get_pocket_distance( PocketGrid const & template_pocket ) const { return get_pocket_distance( template_pocket, ""); };
225  core::Real get_pocket_distance( PocketGrid const & template_pocket, std::string const & comparison_pdbname ) const;
226 
227 }; //class PocketGrid
228 
229 
230 
231 ///@
232 class EggshellGrid : public PocketGrid
233 {
234 
235  friend class NonPlaidFingerprint;
236 
237 private:
238 
239  std::list< numeric::xyzVector<core::Real> > eggshell_coord_list_;
240  std::list< numeric::xyzVector<core::Real> > extra_coord_list_;
242 
243 public:
244 
245  EggshellGrid( const PocketGrid& gr );
246  EggshellGrid( const PocketGrid& ext_grd, std::list< numeric::xyzVector<core::Real> > const & eggshell_coord_list);
247  EggshellGrid( std::string const & fname );
248 
249  std::list< numeric::xyzVector<core::Real> > const & eggshell_coord_list() const { return eggshell_coord_list_; };
250  std::list< numeric::xyzVector<core::Real> > const & extra_coord_list() const { return extra_coord_list_; };
251 
252  void dump_eggshell( std::string const & fname ) const;
253  void write_eggshell_to_pdb( std::string const & output_pdbname ) const;
254  void write_grid_to_pdb( const PocketGrid& gr, std::string const & output_pdbname ) const;
255 
256  numeric::xyzVector<core::Real> calculate_center_xyz (std::list< numeric::xyzVector<core::Real> > const & pocketshell_coord_list );
257 
258  core::Real get_eggshell_distance( EggshellGrid const & template_eggshell ) const { return get_eggshell_distance( template_eggshell, ""); };
259  core::Real get_eggshell_distance( EggshellGrid const & template_eggshell, std::string const & comparison_pdbname ) const;
260 
261 }; //class grid
262 
263 }//pockets
264 }//protocols
265 
266 #endif