Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SolvationGrid.cc
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/ligand_docking/scoring_grid/SolvationGrid.cc
11 /// @author Sam DeLuca
12 
15 
16 #include <utility/tag/Tag.hh>
17 
20 
23 
25 
26 #include <core/pose/Pose.hh>
27 
28 #include <list>
29 
30 namespace protocols {
31 namespace qsar {
32 namespace scoring_grid {
33 
35 {
37 }
38 
40 {
41  GridBaseOP solvation_grid= new SolvationGrid();
42 
43  solvation_grid->parse_my_tag(tag);
44 
45  return solvation_grid;
46 }
47 
49 {
50  return new SolvationGrid();
51 }
52 
53 
55 {
56  return "SolvationGrid";
57 }
58 
60 {
61 
62 }
63 
65 {
66 
67 }
68 
69 void SolvationGrid::refresh(core::pose::Pose const & pose, core::Vector const & /*center*/)
70 {
72  core::scoring::ScoringManager::get_instance()->etable("FA_STANDARD_DEFAULT"));
73 
74  core::scoring::etable::TableLookupEvaluator etable_evaluator(*etable);
75 
76  //put all the atoms in a list so we don't have to deal with extracting them all more than once
77 
78  std::list<core::conformation::Atom> atom_list;
79  for(core::Size resnum = 1; resnum <=pose.total_residue();++resnum)
80  {
81  core::conformation::Residue current_residue = pose.residue(resnum);
82 
83  for(core::Size atomnum = 1; atomnum <= current_residue.natoms();++atomnum)
84  {
85  atom_list.push_back(current_residue.atom(atomnum));
86  }
87 
88  }
89 
91  for(core::Size x_index =0; x_index < dimensions.x(); ++x_index)
92  {
93  for(core::Size y_index = 0; y_index < dimensions.y(); ++y_index)
94  {
95  for(core::Size z_index = 0; z_index < dimensions.z(); ++z_index)
96  {
97  core::Vector pdb_coords(get_pdb_coords(x_index,y_index,z_index));
98  core::conformation::Atom probe(pdb_coords,probe_atom_type_,1);
99 
100  core::Real total_solvation = 0.0;
101 
102 
103  for(std::list<core::conformation::Atom>::iterator it = atom_list.begin();it != atom_list.end();++it)
104  {
105  //the interface for the etable evaluator gets atr,rep,distance and solvation at once
106  //atr,rep and d2 are dummy variables
107  core::Real atr = 0.0;
108  core::Real rep = 0.0;
109  core::Real sol = 0.0;
110  core::Real d2 = 0.0;
111 
112  etable_evaluator.atom_pair_energy(probe, *it, 1.0, atr, rep, sol, d2);
113  total_solvation += sol;
114  }
115 
116  set_point(pdb_coords,total_solvation);
117 
118  }
119  }
120  }
121 
122 
123 }
124 
125 void SolvationGrid::refresh(core::pose::Pose const & pose, core::Vector const & center, core::Size const & )
126 {
127  refresh(pose,center);
128 }
129 
130 
131 
133 {
134  refresh(pose,center);
135 }
136 
138 {
139 
140 }
141 
142 
143 utility::json_spirit::Value SolvationGrid::serialize()
144 {
145  using utility::json_spirit::Value;
146  using utility::json_spirit::Pair;
147 
148  Pair probe_type_data("probe_type",probe_atom_type_);
149  Pair base_data("base_data",SingleGrid::serialize());
150 
151  #ifdef PYROSETTA
152  Value _; return _;
153  #endif
154 
155  return Value(utility::tools::make_vector(probe_type_data,base_data));
156 
157 }
158 
159 void SolvationGrid::deserialize(utility::json_spirit::mObject data )
160 {
161  probe_atom_type_ = data["probe_type"].get_int();
162  SingleGrid::deserialize(data["base_data"].get_obj());
163 }
164 
166 {
167  probe_atom_type_ = atom_type;
168 }
169 
170 
171 }
172 }
173 }