Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SingleGrid.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/qsar/scoring_grid/SingleGrid.hh
11 /// @author Sam DeLuca
12 
13 
14 #ifndef INCLUDED_protocols_qsar_scoring_grid_SingleGrid_hh
15 #define INCLUDED_protocols_qsar_scoring_grid_SingleGrid_hh
16 
20 
21 #include <core/grid/CartGrid.hh>
23 #include <core/pose/Pose.fwd.hh>
24 
25 #include <utility/tag/Tag.fwd.hh>
26 #include <utility/vector1.hh>
27 #include <utility/io/ozstream.fwd.hh>
28 
29 #include <numeric/interpolation/spline/SplineGenerator.hh>
30 #include <numeric/xyzVector.hh>
31 
32 #include <list>
33 
34 #ifdef WIN32
35  #include <protocols/qsar/qsarMap.hh>
36 #endif
37 
38 
39 namespace protocols {
40 namespace qsar {
41 namespace scoring_grid {
42 
43 class SingleGrid : public GridBase
44 {
45 public:
46 
47  SingleGrid(std::string type);
48  virtual ~SingleGrid();
49  /// @brief initialize a grid of zeros with a given centerpoint, width and resolution (in angstroms).
50  virtual void initialize(core::Vector const & center, core::Real width, core::Real resolution);
51  /// @brief set the chain around which to calculate the grid
52  virtual void set_chain(char chain);
53  /// @brief get the chain around which the grid is calculated
54  char get_chain();
55  /// @brief populate the grid with values based on a passed pose
56  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center, core::Size const & ligand_chain_id_to_exclude)=0;
57  /// @brief populate the grid with values based on a passed pose
58  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center,utility::vector1<core::Size> ligand_chain_ids_to_exclude)=0;
59  /// @brief populate the grid with values based on a passed pose
60  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center)=0;
61  /// @brief setup a grid based on RosettaScripts input
62  virtual void parse_my_tag(utility::tag::TagPtr const tag)=0;
63  /// @brief serialize the SingleGrid to a json_spirit object
64  virtual utility::json_spirit::Value serialize();
65  /// @brief deserialize a json_spirit object to a SingleGrid
66  virtual void deserialize(utility::json_spirit::mObject data);
67  /// @brief return a constant reference to the grid
69  ///@brief set the grid type
70  void set_type(std::string type);
71  /// @brief return the grids type
72  virtual std::string get_type();
73  /// @brief set the center of the grid
74  void set_center(core::Vector center);
75  /// @brief get the center of the grid
77  /// @brief get the max score value in the grid
78  core::Real get_min_value() const;
79  /// @brief get the minimum score value in the grid
80  core::Real get_max_value() const;
81  /// @brief get the value of a single point in the grid based on pdb coordinates
83  /// @brief get the value of a single point in the grid based on pdb coordinates
85  /// @brief get dimensions of the grid
87  /// @brief get the pdb coordinates based on grid point coordinates
88  core::Vector get_pdb_coords(int x, int y, int z);
89  /// @brief get the pdb coordinates based on grid point coordinates
91  /// @brief return the current score of a residue using the current grid
92  virtual core::Real score(core::conformation::Residue const & residue, core::Real const max_score, qsarMapOP qsar_map);
93  /// @brief return the current score of an atom using the current grid
94  virtual core::Real atom_score(core::conformation::Residue const & residue, core::Size atomno, qsarMapOP qsar_map);
95  void grid_to_kin(utility::io::ozstream & out, core::Real min_val, core::Real max_val, core::Size stride);
96  //void grid_rotamer_trials(core::pose::Pose & pose, core::Size residue_id, int const min_score);
97  /// @brief check to see if residue is in grid
98  virtual bool is_in_grid(core::conformation::Residue const & residue);
99 
100  std::list<std::pair<core::Vector, core::Real> > get_point_value_list_within_range(core::Real lower_bound, core::Real upper_bound,core::Size stride);
101 
102  virtual void dump_BRIX(std::string const & prefix);
103 
104  //Various mathematical functions for assigning values to the grid go here
105  void set_sphere(core::Vector const & coords, core::Real radius, core::Real value);
106  void set_ring(
107  core::Vector const & coords,
108  core::Real inner_radius,
109  core::Real outer_radius,
110  core::Real value
111  );
112  void diffuse_ring(core::Vector const & coords, core::Real radius, core::Real width, core::Real magnitude);
113  void set_distance_sphere( core::Vector const & coords,core::Real cutoff);
114  void set_point(core::Vector const & coords, core::Real value);
115  void set_distance_sphere_for_atom(core::Real const & atom_shell, core::Vector const & coords,core::Real cutoff);
116  void set_score_sphere_for_atom(numeric::interpolation::spline::InterpolatorOP lj_spline,core::Vector const & coords, core::Real cutoff);
117  /// @fill the entire grid with some value
119 private:
123  char chain_;
124 
125 };
126 
127 
128 }
129 }
130 }
131 
132 #endif /* GRIDBASE_HH_ */