Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChargeGrid.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 src/protocols/qsar/scoring_grid/ChargeGrid.hh
11 /// @author Sam DeLuca
12 /// @brief This is an implementation of equation 3 in Goodford, J. Med. Chem. 1985,28,849-857. doi:10.1021/jm00145a002
13 
14 #ifndef INCLUDED_protocols_qsar_scoring_grid_ChargeGrid_HH
15 #define INCLUDED_protocols_qsar_scoring_grid_ChargeGrid_HH
16 
19 
20 namespace protocols {
21 namespace qsar {
22 namespace scoring_grid {
23 
24 /// @brief a very light representation of an atom that is just a charge and a cartesian space position
25 struct ChargeAtom
26 {
27  ChargeAtom(core::Vector const & in_xyz, core::Real const & in_charge, core::Size const & nc)
28  {
29  xyz = in_xyz;
30  charge = in_charge;
31  neighbor_count = nc;
32 
33  }
34 
36  {
37  charge = 0.0;
38  neighbor_count = 0;
39  }
40 
41  utility::json_spirit::Value serialize();
42 
43  void deserialize(utility::json_spirit::mObject data);
44 
48 };
49 
50 
51 class ChargeGrid : public SingleGrid
52 {
53 public:
54  ChargeGrid();
55  ChargeGrid(core::Real charge);
56  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center, core::Size const & ligand_chain_id_to_exclude);
57  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center);
58  virtual void refresh(core::pose::Pose const & pose, core::Vector const & center, utility::vector1<core::Size> ligand_chain_ids_to_exclude);
59  /// @brief serialize the SingleGrid to a json_spirit object
60  virtual utility::json_spirit::Value serialize();
61  /// @brief deserialize a json_spirit object to a SingleGrid
62  virtual void deserialize(utility::json_spirit::mObject data);
63  void parse_my_tag(utility::tag::TagPtr const tag);
64  virtual core::Real score(core::conformation::Residue const & residue, core::Real const max_score, qsarMapOP qsar_map);
65  /// @brief return the current score of an atom using the current grid
66  virtual core::Real atom_score(core::conformation::Residue const & residue, core::Size atomno, qsarMapOP qsar_map);
67 
68 private:
69 
70  /// @brief calculate nominal depth based on atom count within 4 Angstroms. See
71  /// Table 2 of the 1985 Goodford Paper
72  core::Real nominal_depth(core::Size const & n_atoms) const;
73 
74  core::Real charge_charge_electrostatic(core::pose::Pose const & pose, ChargeAtom const & atom_q, ChargeAtom const & atom_p) const;
75 
76  void setup_charge_atoms(core::pose::Pose const & pose);
77 
78 private:
79 
82  core::Real indirect_numerator_; // (zeta - epsilon) / (zeta + epsilon)
84  std::list<ChargeAtom> charge_atom_list_;
85 
86 };
87 
88 
89 }
90 }
91 }
92 
93 
94 
95 #endif /* CHARGEGRID_HH_ */