ProSHADE: src/proshade/ProSHADE_spheres.hpp Source File

| ProSHADE 0.7.5.1 (JAN 2021) Protein Shape Detection

ProSHADE_spheres.hpp
Go to the documentation of this file.
1
23 //==================================================== ProSHADE
24 #include "ProSHADE_sphericalHarmonics.hpp"
25
26 //==================================================== Overinclusion protection
27 #ifndef __PROSHADE_SPHERES__
28 #define __PROSHADE_SPHERES__
29
30 //==================================================== ProSHADE_internal_spheres Namespace
40 namespace ProSHADE_internal_spheres
41 {
48 class ProSHADE_sphere
49 {
50 private:
51 //============================================ General sphere spherical harmonics computation variables
52 proshade_unsign localBandwidth;
53 proshade_unsign localAngRes;
54 proshade_single sphereWidth;
55 proshade_double sphereRadius;
56
57 //============================================ General map fraction values
58 proshade_single maxSphereRange;
59 proshade_unsign shellOrder;
60
61 //============================================ General map dealing values
62 proshade_single xDimSampling;
63 proshade_single yDimSampling;
64 proshade_single zDimSampling;
65
66 //============================================ Mapped data
67 proshade_double* mappedData;
68 proshade_double* mappedDataRot;
69
70 protected:
71 proshade_unsign getMaxCircumference ( proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_double maxRange,
72 proshade_single xSize, proshade_single ySize, proshade_single zSize );
73 bool getMapPoint ( proshade_double* map, proshade_unsign xDimMax, proshade_unsign yDimMax,
74 proshade_unsign zDimMax, proshade_signed xPos,
75 proshade_signed yPos, proshade_signed zPos, std::vector<proshade_double>* interpVec );
76 void getLongitudeCutoffs ( std::vector<proshade_double>* lonCO );
77 void getLattitudeCutoffs ( std::vector<proshade_double>* latCO );
78 void getInterpolationXYZ ( proshade_double* x, proshade_double* y, proshade_double* z,
79 proshade_double thetaIt, std::vector<proshade_double>* lonCO,
80 proshade_unsign phiIt, std::vector<proshade_double>* latCO );
81 void getXYZTopBottoms ( proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax,
82 proshade_double x, proshade_double y, proshade_double z,
83 proshade_signed* xBottom, proshade_signed* yBottom, proshade_signed* zBottom,
84 proshade_signed* xTop,
85 proshade_signed* yTop, proshade_signed* zTop );
86 void interpolateAlongFirst ( std::vector<proshade_double> c000, std::vector<proshade_double> c001, std::vector<proshade_double> c010,
87 std::vector<proshade_double> c011, std::vector<proshade_double> c100, std::vector<proshade_double> c101,
88 std::vector<proshade_double> c110, std::vector<proshade_double> c111,
89 std::vector<proshade_double>* c00, std::vector<proshade_double>* c01,
90 std::vector<proshade_double>* c10, std::vector<proshade_double>* c11,
91 proshade_double xd );
92 void interpolateAlongSecond ( std::vector<proshade_double> c00, std::vector<proshade_double> c01,
93 std::vector<proshade_double> c10, std::vector<proshade_double> c11,
94 std::vector<proshade_double>* c0, std::vector<proshade_double>* c1, proshade_double yd );
95 void mapData ( proshade_double* map, proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax );
96
97 public:
98 //============================================ Constructors / Destructors
99 ProSHADE_sphere ( proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_single xSize,
100 proshade_single ySize, proshade_single zSize, proshade_unsign shOrder,
101 std::vector<proshade_single>* spherePos,
102 bool progressiveMapping, proshade_unsign band, proshade_double* map,
103 proshade_unsign* maxShellBand );
104 ~ProSHADE_sphere ( void );
105
106 //============================================ Rotated map data related functions
107 void allocateRotatedMap ( void );
108
109 //============================================ Accessor/Mutator functions
110 proshade_unsign getLocalBandwidth ( void );
111 proshade_unsign getLocalAngRes ( void );
112 proshade_double* getMappedData ( void );
113 proshade_double getShellRadius ( void );
114 void setRotatedMappedData ( proshade_unsign pos, proshade_double value );
115 proshade_double getRotatedMappedData ( proshade_unsign pos );
116 };
117
118 //================================================ Sphere resolution and computation decisions
119 proshade_unsign autoDetermineBandwidth ( proshade_unsign circumference );
120 proshade_single autoDetermineSphereDistances ( proshade_single maxMapRange, proshade_single resolution );
121 proshade_unsign autoDetermineIntegrationOrder ( proshade_single maxMapRange, proshade_single sphereDist );
122
129 class ProSHADE_rotFun_spherePeakGroup
130 {
131 public:
132 proshade_double latSampling;
133 proshade_double lonSampling;
134 proshade_unsign dimension;
135 proshade_double latFrom;
136 proshade_double latTo;
137 proshade_double lonFrom;
138 proshade_double lonTo;
139 proshade_double latFromInds;
140 proshade_double latToInds;
141 proshade_double lonFromInds;
142 proshade_double lonToInds;
143
144 std::vector<proshade_unsign> spherePositions;
145
146 proshade_double* latMinLonMinXYZ;
147 proshade_double* latMaxLonMinXYZ;
148 proshade_double* latMinLonMaxXYZ;
149 proshade_double* latMaxLonMaxXYZ;
150
151 protected:
152 void computeCornerPositions ( void );
153 proshade_signed angularDistanceWithBorders ( proshade_signed origLat, proshade_signed testedLat );
154 void getAllAngleDifferences ( std::vector< proshade_double >* angDiffs, std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> sphereVals );
155 void getAllPossibleFolds ( std::vector< proshade_double >* angDiffs, std::vector< proshade_unsign >* foldsToTry,
156 std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> sphereVals );
157 void getSpheresFormingFold ( proshade_unsign foldToTry, std::vector< proshade_unsign >* spheresFormingFold,
158 std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> sphereVals, proshade_double sphereAngleTolerance );
159 void getBestIndexForFold ( proshade_double* bestPosVal, proshade_double* bestLatInd, proshade_double* bestLonInd, std::vector< proshade_unsign >* spheresFormingFold,
160 std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> sphereVals );
161
162 public:
163 ProSHADE_rotFun_spherePeakGroup ( proshade_double lat, proshade_double lon, proshade_unsign sphPos, proshade_unsign angDim );
164 ~ProSHADE_rotFun_spherePeakGroup ( void );
165
166 public:
167 bool checkIfPeakBelongs ( proshade_double lat, proshade_double lon, proshade_unsign sphPos, proshade_double cosTol, proshade_signed verbose );
168 void findCyclicPointGroupsGivenFold ( std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> sphereVals, proshade_double axisTolerance,
169 std::vector < proshade_double* >* detectedCs, bool bicubicInterp, proshade_unsign fold, proshade_unsign verbose );
170
171 public:
172 proshade_double getLatFromIndices ( void );
173 proshade_double getLatToIndices ( void );
174 proshade_double getLonFromIndices ( void );
175 proshade_double getLonToIndices ( void );
176 std::vector<proshade_unsign> getSpherePositions ( void );
177 };
178 }
179
180
181 #endif
ProSHADE_internal_spheres::ProSHADE_sphere::getInterpolationXYZ
void getInterpolationXYZ(proshade_double *x, proshade_double *y, proshade_double *z, proshade_double thetaIt, std::vector< proshade_double > *lonCO, proshade_unsign phiIt, std::vector< proshade_double > *latCO)
This function finds the x, y and z positions of supplied shell point.
Definition: ProSHADE_spheres.cpp:339
ProSHADE_internal_spheres::ProSHADE_sphere::getLocalBandwidth
proshade_unsign getLocalBandwidth(void)
This function returns the local bandwidth.
Definition: ProSHADE_spheres.cpp:393
ProSHADE_internal_spheres::ProSHADE_sphere::interpolateAlongFirst
void interpolateAlongFirst(std::vector< proshade_double > c000, std::vector< proshade_double > c001, std::vector< proshade_double > c010, std::vector< proshade_double > c011, std::vector< proshade_double > c100, std::vector< proshade_double > c101, std::vector< proshade_double > c110, std::vector< proshade_double > c111, std::vector< proshade_double > *c00, std::vector< proshade_double > *c01, std::vector< proshade_double > *c10, std::vector< proshade_double > *c11, proshade_double xd)
This function interpolates along the first (X) dimension.
Definition: ProSHADE_spheres.cpp:445
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getLatToIndices
proshade_double getLatToIndices(void)
Accessor function for the private variable latToInds.
Definition: ProSHADE_spheres.cpp:1306
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::angularDistanceWithBorders
proshade_signed angularDistanceWithBorders(proshade_signed origLat, proshade_signed testedLat)
This function takes two lattitude or longitude positions and finds the smallest distance between them...
Definition: ProSHADE_spheres.cpp:1109
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::computeCornerPositions
void computeCornerPositions(void)
This function computes the group corner vectors, saving results into internal variables.
Definition: ProSHADE_spheres.cpp:1079
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getLatFromIndices
proshade_double getLatFromIndices(void)
Accessor function for the private variable latFromInds.
Definition: ProSHADE_spheres.cpp:1295
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getSpheresFormingFold
void getSpheresFormingFold(proshade_unsign foldToTry, std::vector< proshade_unsign > *spheresFormingFold, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > sphereVals, proshade_double sphereAngleTolerance)
This function simply finds the indices of the spheres which form the requested form.
Definition: ProSHADE_spheres.cpp:1535
ProSHADE_internal_spheres::ProSHADE_sphere::getMapPoint
bool getMapPoint(proshade_double *map, proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_signed xPos, proshade_signed yPos, proshade_signed zPos, std::vector< proshade_double > *interpVec)
This function fills in the interpolation vector for a single map point.
Definition: ProSHADE_spheres.cpp:263
ProSHADE_internal_spheres::ProSHADE_sphere
This class contains all inputed and derived data for a single sphere.
Definition: ProSHADE_spheres.hpp:49
ProSHADE_internal_spheres::ProSHADE_sphere::getRotatedMappedData
proshade_double getRotatedMappedData(proshade_unsign pos)
This function gets the rotated mapped data value for a particular position.
Definition: ProSHADE_spheres.cpp:630
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getAllPossibleFolds
void getAllPossibleFolds(std::vector< proshade_double > *angDiffs, std::vector< proshade_unsign > *foldsToTry, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > sphereVals)
This function angle differences and creates a list of folds that may be present in the group.
Definition: ProSHADE_spheres.cpp:1473
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getSpherePositions
std::vector< proshade_unsign > getSpherePositions(void)
Accessor function for the private variable spherePositions.
Definition: ProSHADE_spheres.cpp:1339
ProSHADE_internal_spheres::autoDetermineSphereDistances
proshade_single autoDetermineSphereDistances(proshade_single maxMapRange, proshade_single resolution)
This function determines the sphere distances for sphere mapping.
Definition: ProSHADE_spheres.cpp:540
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getAllAngleDifferences
void getAllAngleDifferences(std::vector< proshade_double > *angDiffs, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > sphereVals)
This function takes all angles present in this peak group and finds the set of unique angle differece...
Definition: ProSHADE_spheres.cpp:1430
ProSHADE_internal_spheres::ProSHADE_sphere::getXYZTopBottoms
void getXYZTopBottoms(proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_double x, proshade_double y, proshade_double z, proshade_signed *xBottom, proshade_signed *yBottom, proshade_signed *zBottom, proshade_signed *xTop, proshade_signed *yTop, proshade_signed *zTop)
This function fills in the interpolation vector for a single map point.
Definition: ProSHADE_spheres.cpp:370
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::findCyclicPointGroupsGivenFold
void findCyclicPointGroupsGivenFold(std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > sphereVals, proshade_double axisTolerance, std::vector< proshade_double * > *detectedCs, bool bicubicInterp, proshade_unsign fold, proshade_unsign verbose)
Function detecting cyclic point groups with a particular fold in a peak group.
Definition: ProSHADE_spheres.cpp:1366
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::ProSHADE_rotFun_spherePeakGroup
ProSHADE_rotFun_spherePeakGroup(proshade_double lat, proshade_double lon, proshade_unsign sphPos, proshade_unsign angDim)
Constructor for getting empty ProSHADE_rotFun_spherePeakGroup class.
Definition: ProSHADE_spheres.cpp:1029
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::checkIfPeakBelongs
bool checkIfPeakBelongs(proshade_double lat, proshade_double lon, proshade_unsign sphPos, proshade_double cosTol, proshade_signed verbose)
This function takes a new prospective peak and tests if it belongs to this peak group or not.
Definition: ProSHADE_spheres.cpp:1137
ProSHADE_internal_spheres::ProSHADE_sphere::getMaxCircumference
proshade_unsign getMaxCircumference(proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_double maxRange, proshade_single xSize, proshade_single ySize, proshade_single zSize)
This function determines the maximum circumference of a shell.
Definition: ProSHADE_spheres.cpp:124
ProSHADE_internal_spheres::ProSHADE_sphere::ProSHADE_sphere
ProSHADE_sphere(proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax, proshade_single xSize, proshade_single ySize, proshade_single zSize, proshade_unsign shOrder, std::vector< proshade_single > *spherePos, bool progressiveMapping, proshade_unsign band, proshade_double *map, proshade_unsign *maxShellBand)
Constructor for getting empty ProSHADE_sphere class.
Definition: ProSHADE_spheres.cpp:46
ProSHADE_internal_spheres::ProSHADE_sphere::getMappedData
proshade_double * getMappedData(void)
This function returns the mapped data array.
Definition: ProSHADE_spheres.cpp:419
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup
This class contains peak groups detected in the rotation function mapped spheres.
Definition: ProSHADE_spheres.hpp:130
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getLonToIndices
proshade_double getLonToIndices(void)
Accessor function for the private variable lonToInds.
Definition: ProSHADE_spheres.cpp:1328
ProSHADE_internal_spheres::ProSHADE_sphere::~ProSHADE_sphere
~ProSHADE_sphere(void)
Destructor for the ProSHADE_sphere class.
Definition: ProSHADE_spheres.cpp:102
ProSHADE_internal_spheres::autoDetermineIntegrationOrder
proshade_unsign autoDetermineIntegrationOrder(proshade_single maxMapRange, proshade_single sphereDist)
This function determines the integration order for the between spheres integration.
Definition: ProSHADE_spheres.cpp:564
ProSHADE_internal_spheres
This namespace contains the structure and functions required for storing internal map projections ont...
Definition: ProSHADE_maths.hpp:42
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getLonFromIndices
proshade_double getLonFromIndices(void)
Accessor function for the private variable lonFromInds.
Definition: ProSHADE_spheres.cpp:1317
ProSHADE_internal_spheres::autoDetermineBandwidth
proshade_unsign autoDetermineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE_spheres.cpp:518
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::getBestIndexForFold
void getBestIndexForFold(proshade_double *bestPosVal, proshade_double *bestLatInd, proshade_double *bestLonInd, std::vector< proshade_unsign > *spheresFormingFold, std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > sphereVals)
Function which does simple search through all peak groups indices and saves the index with the highes...
Definition: ProSHADE_spheres.cpp:1582
ProSHADE_internal_spheres::ProSHADE_sphere::getLocalAngRes
proshade_unsign getLocalAngRes(void)
This function returns the local angular resolution.
Definition: ProSHADE_spheres.cpp:406
ProSHADE_internal_spheres::ProSHADE_sphere::getLongitudeCutoffs
void getLongitudeCutoffs(std::vector< proshade_double > *lonCO)
This function fills in the vector of longitudal bin boarder values.
Definition: ProSHADE_spheres.cpp:290
ProSHADE_internal_spheres::ProSHADE_sphere::allocateRotatedMap
void allocateRotatedMap(void)
This function allocates the rotated map memory.
Definition: ProSHADE_spheres.cpp:599
ProSHADE_internal_spheres::ProSHADE_sphere::mapData
void mapData(proshade_double *map, proshade_unsign xDimMax, proshade_unsign yDimMax, proshade_unsign zDimMax)
This function maps the internal map to the specific sphere.
Definition: ProSHADE_spheres.cpp:181
ProSHADE_internal_spheres::ProSHADE_sphere::interpolateAlongSecond
void interpolateAlongSecond(std::vector< proshade_double > c00, std::vector< proshade_double > c01, std::vector< proshade_double > c10, std::vector< proshade_double > c11, std::vector< proshade_double > *c0, std::vector< proshade_double > *c1, proshade_double yd)
This function interpolates along the second (Y) dimension.
Definition: ProSHADE_spheres.cpp:491
ProSHADE_internal_spheres::ProSHADE_sphere::getShellRadius
proshade_double getShellRadius(void)
This function returns the radius of the shell in question.
Definition: ProSHADE_spheres.cpp:590
ProSHADE_sphericalHarmonics.hpp
This header file declares the functions required to compute the spherical harmonics decomposition for...
ProSHADE_internal_spheres::ProSHADE_sphere::setRotatedMappedData
void setRotatedMappedData(proshade_unsign pos, proshade_double value)
This function sets the rotated mapped data value to the given position.
Definition: ProSHADE_spheres.cpp:616
ProSHADE_internal_spheres::ProSHADE_sphere::getLattitudeCutoffs
void getLattitudeCutoffs(std::vector< proshade_double > *latCO)
This function fills in the vector of lattitudal bin boarder values.
Definition: ProSHADE_spheres.cpp:311
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup::~ProSHADE_rotFun_spherePeakGroup
~ProSHADE_rotFun_spherePeakGroup(void)
Destructor for the ProSHADE_rotFun_spherePeakGroup class.
Definition: ProSHADE_spheres.cpp:1068