LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
internal-water-filter.hpp
1/*
2 Internal water filter library
3*/
4
5
6/*
7 This file is part of LOOS.
8
9 LOOS (Lightweight Object-Oriented Structure library)
10 Copyright (c) 2008, Tod D. Romo, Alan Grossfield
11 Department of Biochemistry and Biophysics
12 School of Medicine & Dentistry, University of Rochester
13
14 This package (LOOS) is free software: you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation under version 3 of the License.
17
18 This package is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
25*/
26
27
28
29#if !defined(LOOS_INTERNAL_WATER_FILTER_HPP)
30#define LOOS_INTERNAL_WATER_FILTER_HPP
31
32#include <loos.hpp>
33#include <DensityGrid.hpp>
34#include <vector>
35
36
37namespace loos {
38
39 namespace DensityTools {
40
41
44 public:
45 WaterFilterBase() { }
46 virtual ~WaterFilterBase() { }
47
49
52 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&) =0;
53
55 virtual std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&) =0;
56
58 virtual double volume(void) =0;
59
61 virtual std::string name(void) const =0;
62
63 protected:
64 std::vector<loos::GCoord> bdd_;
65 };
66
67
68 // --------------------------------------------------------------------------------
69
71
77 public:
78 WaterFilterBox(const double pad) : pad_(pad) { }
79 virtual ~WaterFilterBox() { }
80
81 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
82 virtual std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
83
84 virtual double volume(void);
85 virtual std::string name(void) const;
86
87 private:
88 double pad_;
89 };
90
91
92
93 // --------------------------------------------------------------------------------
94
96
101 public:
102 WaterFilterRadius(const double radius) : radius_(radius) { }
103 virtual ~WaterFilterRadius() { }
104
105 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
106 virtual std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
107
108 virtual double volume(void);
109 virtual std::string name(void) const;
110
111 private:
112 double radius_;
113 };
114
115 // --------------------------------------------------------------------------------
116
118
123 public:
124 WaterFilterContacts(const double radius, const uint mincontacts) : radius_(radius), threshold_(mincontacts) { }
125 virtual ~WaterFilterContacts() { }
126
127 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
128 virtual std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
129
130 virtual double volume(void);
131 virtual std::string name(void) const;
132
133 private:
134 double radius_;
135 uint threshold_;
136 };
137
138
139 // --------------------------------------------------------------------------------
140
142
151 public:
152 WaterFilterAxis(const double radius) : radius_(radius*radius) { }
153 virtual ~WaterFilterAxis() { }
154
155 virtual std::string name(void) const;
156 virtual double volume(void);
157
158 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
159 std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
160
161 private:
162 loos::GCoord axis_, orig_;
163 double radius_;
164 };
165
166 // --------------------------------------------------------------------------------
167
169
179 public:
180 WaterFilterCore(const double radius) : radius_(radius*radius) { }
181 virtual ~WaterFilterCore() { }
182
183 virtual std::string name(void) const;
184 virtual double volume(void);
185
186 virtual std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
187 std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
188
189 private:
190 loos::GCoord calculateAxis(const loos::AtomicGroup& grp);
191
192
193 loos::GCoord axis_, orig_;
194 double radius_;
195 };
196
197
198
199 // --------------------------------------------------------------------------------
200
202
210 public:
211 WaterFilterBlob(const DensityGrid<int>& blob) : blob_(blob), bdd_set(false), vol(-1.0) { }
212 virtual ~WaterFilterBlob() { }
213
214 virtual std::string name(void) const;
215 virtual double volume(void);
216
217 std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
218 std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
219
220 private:
221 DensityGrid<int> blob_;
222 bool bdd_set;
223 double vol;
224 };
225
226
227 // --------------------------------------------------------------------------------
228
231 public:
232 WaterFilterDecorator(WaterFilterBase* p) : base(p) { }
233 virtual ~WaterFilterDecorator() { }
234
235 virtual std::string name(void) const { return(base->name()); }
236 virtual double volume(void) { return(base->volume()); }
237
238 virtual std::vector<int> filter(const loos::AtomicGroup& solv, const loos::AtomicGroup& prot) {
239 return(base->filter(solv, prot));
240 }
241
242 virtual std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup& prot) {
243 return(base->boundingBox(prot));
244 }
245
246 private:
247 WaterFilterBase *base;
248 };
249
250
253 public:
254 ZClippedWaterFilter(WaterFilterBase* p, const double zmin, const double zmax) : WaterFilterDecorator(p),
255 zmin_(zmin), zmax_(zmax) { }
256 virtual ~ZClippedWaterFilter() { }
257
258 std::string name(void) const;
259 std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
260 std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
261
262 double volume(void) { return(0.0); }
263
264 private:
265 double zmin_, zmax_;
266 };
267
268
269
271
284 public:
285 BulkedWaterFilter(WaterFilterBase* p, const double pad, const double zmin, const double zmax) : WaterFilterDecorator(p),
286 pad_(pad),
287 zmin_(zmin), zmax_(zmax) { }
288 virtual ~BulkedWaterFilter() { }
289
290 std::string name(void) const;
291 std::vector<int> filter(const loos::AtomicGroup&, const loos::AtomicGroup&);
292 std::vector<loos::GCoord> boundingBox(const loos::AtomicGroup&);
293
294 double volume(void) { return(0.0); }
295
296 private:
297 double pad_;
298 double zmin_, zmax_;
299 };
300
301 };
302
303}
304
305
306#endif
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Add bulk water back into the mask/map.
Definition internal-water-filter.hpp:283
double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.hpp:294
std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:448
std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:469
std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:440
Pick waters that are within a radius of the principal axis for a molecule.
Definition internal-water-filter.hpp:150
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:170
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:177
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:207
std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:212
Base interface for water filter/picker.
Definition internal-water-filter.hpp:43
virtual std::string name(void) const =0
Just states the name of the filter/picker.
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)=0
Given a molecule and a set of waters, pick which waters are inside.
virtual std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)=0
Calculate the appropriate bounding box (given the molecule)
virtual double volume(void)=0
Calculate the volume of the region we can pick waters from...
Pick waters based on a grid-mask.
Definition internal-water-filter.hpp:209
std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:357
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:341
std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:375
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:331
Pick waters inside a bounding box.
Definition internal-water-filter.hpp:76
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:37
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:66
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:44
virtual std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:72
Pick waters with a minimum number of contacts to protein atoms.
Definition internal-water-filter.hpp:122
virtual std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:158
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:123
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:130
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:152
Pick waters that are within a radius of the core axis for a molecule.
Definition internal-water-filter.hpp:178
std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:304
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:239
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:299
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:268
Decorator base class for "decorating" the core water filters...
Definition internal-water-filter.hpp:230
virtual std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &prot)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.hpp:242
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.hpp:235
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.hpp:236
virtual std::vector< int > filter(const loos::AtomicGroup &solv, const loos::AtomicGroup &prot)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.hpp:238
Pick waters within a given radius of a group of atoms.
Definition internal-water-filter.hpp:100
virtual double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.cpp:107
virtual std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:89
virtual std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:113
virtual std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:82
Restrict waters to be within a given z-range.
Definition internal-water-filter.hpp:252
std::vector< loos::GCoord > boundingBox(const loos::AtomicGroup &)
Calculate the appropriate bounding box (given the molecule)
Definition internal-water-filter.cpp:430
std::vector< int > filter(const loos::AtomicGroup &, const loos::AtomicGroup &)
Given a molecule and a set of waters, pick which waters are inside.
Definition internal-water-filter.cpp:416
double volume(void)
Calculate the volume of the region we can pick waters from...
Definition internal-water-filter.hpp:262
std::string name(void) const
Just states the name of the filter/picker.
Definition internal-water-filter.cpp:408
Namespace for most things not already encapsulated within a class.
Definition version.cpp:3