RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
FFTGrid.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Subclass of RealGrid with extra methods for finding peaks
14// The original FFT functionality has long since been abandoned
15
16#ifndef _RBTFFTGRID_H_
17#define _RBTFFTGRID_H_
18
19#include "rxdock/RealGrid.h"
20
21namespace rxdock {
22
23// struct for holding FFT Peak info
24class FFTPeak {
25public:
26 // Constructor
27 FFTPeak() : index(0), coord(0.0, 0.0, 0.0), height(0.0), volume(0) {}
28
29 // Data attributes - public to avoid need for accessor functions
30 unsigned int index; // Location of peak maximum - iXYZ index into grid
31 Coord coord; // Location of peak maximum - real world vector/coord
32 // corresponding to displacement
33 double height; // Maximum value of peak
34 unsigned int volume; // Number of grid points in peak (=points.size())
35 std::set<unsigned int> points; // Set of iXYZ peak indices
36};
37
38typedef SmartPtr<FFTPeak> FFTPeakPtr; // Smart pointer
39// Multi-map of key=peak height,value=FFTPeakPtr
40typedef std::multimap<double, FFTPeakPtr> FFTPeakMap;
41typedef FFTPeakMap::iterator FFTPeakMapIter;
42typedef FFTPeakMap::reverse_iterator FFTPeakMapRIter;
43typedef FFTPeakMap::const_iterator FFTPeakMapConstIter;
44typedef FFTPeakMap::const_reverse_iterator FFTPeakMapConstRIter;
45
46class FFTGrid : public RealGrid {
47public:
48 // Class type string
49 static const std::string _CT;
50
52 // Constructors/destructors
53 // Construct a NXxNYxNZ grid running from gridMin at gridStep resolution
54 FFTGrid(const Coord &gridMin, const Coord &gridStep, unsigned int NX,
55 unsigned int NY, unsigned int NZ, unsigned int NPad = 0);
56
57 // Constructor reading all params from binary stream
58 FFTGrid(json j);
59
60 ~FFTGrid(); // Default destructor
61
62 FFTGrid(const FFTGrid &); // Copy constructor
63 // Copy constructors taking base class arguments
64 FFTGrid(const RealGrid &);
65 FFTGrid(const BaseGrid &);
66
67 FFTGrid &operator=(const FFTGrid &); // Copy assignment
68 // Copy assignment taking base class arguments
69 FFTGrid &operator=(const RealGrid &);
70 FFTGrid &operator=(const BaseGrid &);
71
73 // Public methods
75
77 // Virtual functions for reading/writing grid data to streams in
78 // text and binary format
79 // Subclasses should provide their own private OwnPrint
80 // method to handle subclass data members, and override the public
81 // Print method
82 virtual void Print(std::ostream &ostr) const; // Text output
83
84 // Find the coords of all (separate) peaks above the threshold value
85 // whose volumes are not less than minVol
86 // Returns a map of FFTPeaks
87 FFTPeakMap FindPeaks(double threshold, unsigned int minVol = 1);
88 // Returns the grid point with the maximum value in FFTPeak format
89 // Just a wrapper around FindMaxValue() (see below)
90 FFTPeak FindMaxPeak() const;
91
92protected:
94 // Protected methods
96 // Protected method for writing data members for this class to text stream
97 void OwnPrint(std::ostream &ostr) const;
98
99private:
101 // Private methods
103 FFTGrid(); // Disable default constructor
104
105 // Helper function called by copy constructor and assignment operator
106 void CopyGrid(const FFTGrid &);
107
108protected:
110 // Protected data
112
113private:
115 // Private data
117};
118
119// Useful typedefs
120typedef SmartPtr<FFTGrid> FFTGridPtr; // Smart pointer
121
122} // namespace rxdock
123
124#endif //_RBTFFTGRID_H_
Definition BaseGrid.h:27
Definition Coord.h:45
Definition FFTGrid.h:46
Definition FFTGrid.h:24
Definition RealGrid.h:30
Definition SmartPointer.h:48