 |
ProSHADE
0.7.6.6 (JUL 2022)
Protein Shape Detection
|
This class contains all inputed and derived data for a single structure.
More...
#include <ProSHADE_data.hpp>
|
| ProSHADE_data () |
| Constructor for getting empty ProSHADE_data class. More...
|
|
| ProSHADE_data (std::string strName, double *mapVals, int len, proshade_single xDmSz, proshade_single yDmSz, proshade_single zDmSz, proshade_unsign xDmInd, proshade_unsign yDmInd, proshade_unsign zDmInd, proshade_signed xFr, proshade_signed yFr, proshade_signed zFr, proshade_signed xT, proshade_signed yT, proshade_signed zT, proshade_unsign inputO) |
| Constructor for creating ProSHADE_data structure with data. More...
|
|
| ~ProSHADE_data (void) |
| Destructor for the ProSHADE_data class. More...
|
|
void | readInStructure (std::string fName, proshade_unsign inputO, ProSHADE_settings *settings, proshade_double *maskArr=nullptr, proshade_unsign maskXDim=0, proshade_unsign maskYDim=0, proshade_unsign maskZDim=0, proshade_double *weightsArr=nullptr, proshade_unsign weigXDim=0, proshade_unsign weigYDim=0, proshade_unsign weigZDim=0) |
| This function initialises the basic ProSHADE_data variables and reads in a single structure. More...
|
|
void | readInStructure (gemmi::Structure *gemmiStruct, proshade_unsign inputO, ProSHADE_settings *settings) |
| This function initialises the basic ProSHADE_data variables and reads in a single structure from Gemmi co-ordinate object. More...
|
|
void | writeMap (std::string fName, std::string title="Created by ProSHADE and written by GEMMI", int mode=2) |
| Function for writing out the internal structure representation in MRC MAP format. More...
|
|
void | writePdb (std::string fName, proshade_double euA=0.0, proshade_double euB=0.0, proshade_double euG=0.0, proshade_double trsX=0.0, proshade_double trsY=0.0, proshade_double trsZ=0.0, proshade_double rotX=0.0, proshade_double rotY=0.0, proshade_double rotZ=0.0, bool firstModel=true) |
| This function writes out the co-ordinates file with ProSHADE type rotation and translation applied. More...
|
|
void | writeGemmi (std::string fName, gemmi::Structure gemmiStruct, proshade_double euA=0.0, proshade_double euB=0.0, proshade_double euG=0.0, proshade_double trsX=0.0, proshade_double trsY=0.0, proshade_double trsZ=0.0, proshade_double rotX=0.0, proshade_double rotY=0.0, proshade_double rotZ=0.0, bool firstModel=true) |
| This function writes out the gemmi::Structure object with ProSHADE type rotation and translation applied. More...
|
|
void | writeMask (std::string fName, proshade_double *mask) |
| Function for writing out a mask in MRC MAP format. More...
|
|
void | invertMirrorMap (ProSHADE_settings *settings) |
| Function for inverting the map to its mirror image. More...
|
|
void | normaliseMap (ProSHADE_settings *settings) |
| Function for normalising the map values to mean 0 and sd 1.. More...
|
|
void | maskMap (ProSHADE_settings *settings) |
| Function for computing the map mask using blurring and X IQRs from median. More...
|
|
void | getReBoxBoundaries (ProSHADE_settings *settings, proshade_signed *&ret) |
| This function finds the boundaries enclosing positive map values and adds some extra space. More...
|
|
void | createNewMapFromBounds (ProSHADE_settings *settings, ProSHADE_data *&newStr, proshade_signed *newBounds) |
| This function creates a new structure from the calling structure and new bounds values. More...
|
|
void | reSampleMap (ProSHADE_settings *settings) |
| This function changes the internal map sampling to conform to particular resolution value. More...
|
|
void | centreMapOnCOM (ProSHADE_settings *settings) |
| This function shits the map so that its COM is in the centre of the map. More...
|
|
void | addExtraSpace (ProSHADE_settings *settings) |
| This function increases the size of the map so that it can add empty space around it. More...
|
|
void | removePhaseInormation (ProSHADE_settings *settings) |
| This function removes phase from the map, effectively converting it to Patterson map. More...
|
|
void | shiftToBoxCentre (ProSHADE_settings *settings) |
| Function for shifting map so that its centre of box is at required position. More...
|
|
void | shiftToRotationCentre (ProSHADE_settings *settings) |
| Function for shifting map so that its rotation centre is at the centre of the box. More...
|
|
void | processInternalMap (ProSHADE_settings *settings) |
| This function simply clusters several other functions which should be called together. More...
|
|
void | getSpherePositions (ProSHADE_settings *settings) |
| This function determines the sphere positions (radii) for sphere mapping. More...
|
|
void | mapToSpheres (ProSHADE_settings *settings) |
| This function converts the internal map onto a set of concentric spheres. More...
|
|
void | computeSphericalHarmonics (ProSHADE_settings *settings) |
| This function computes the spherical harmonics decomposition for the whole structure. More...
|
|
bool | shellBandExists (proshade_unsign shell, proshade_unsign bandVal) |
| This function checks if particular shell has a particular band. More...
|
|
void | computeRRPMatrices (ProSHADE_settings *settings) |
| This function pre-computes the RRP matrices for a data object. More...
|
|
void | allocateEMatrices (proshade_unsign band, proshade_single oversamplingRatio) |
| This function allocates the required memory for the E matrices. More...
|
|
void | allocateSO3CoeffsSpace (proshade_unsign band) |
| This function allocates the memory for the SO(3) coefficients and the inverse for that calling object. More...
|
|
void | allocateWignerMatricesSpace () |
| This function allocates the memory for the Wigner matrices for the calling object.
|
|
void | computeRotationFunction (ProSHADE_settings *settings) |
| This function computes the self-rotation function for this structure. More...
|
|
void | convertRotationFunction (ProSHADE_settings *settings) |
| This function converts the self-rotation function of this structure to angle-axis representation. More...
|
|
void | getRealEMatrixValuesForLM (proshade_signed band, proshade_signed order1, double *eMatsLMReal, int len) |
| This function fills the input array with the real E matrix values for particular band and order1 (l as opposed to l'). More...
|
|
void | getImagEMatrixValuesForLM (proshade_signed band, proshade_signed order1, double *eMatsLMImag, int len) |
| This function fills the input array with the imaginary E matrix values for particular band and order1 (l as opposed to l'). More...
|
|
void | getRealSO3Coeffs (double *so3CoefsReal, int len) |
| This function fills the input array with the real SO(3) coefficient values. More...
|
|
void | getImagSO3Coeffs (double *so3CoefsImag, int len) |
| This function fills the input array with the imaginary SO(3) coefficient values. More...
|
|
void | getRealRotFunction (double *rotFunReal, int len) |
| This function fills the input array with the real rotation function values. More...
|
|
void | getImagRotFunction (double *rotFunImag, int len) |
| This function fills the input array with the imaginary rotation function values. More...
|
|
void | getRealTranslationFunction (double *trsFunReal, int len) |
| This function fills the input array with the real translation function values. More...
|
|
void | getImagTranslationFunction (double *trsFunImag, int len) |
| This function fills the input array with the imaginary translation function values. More...
|
|
void | getRotMatrixFromRotFunInds (proshade_signed aI, proshade_signed bI, proshade_signed gI, double *rotMat, int len) |
| This function takes rotation function indices, converts them to Euler angles and these to rotation matrix, which it then returns. More...
|
|
int | so3CoeffsArrayIndex (proshade_signed order1, proshade_signed order2, proshade_signed band) |
| This function gets the SO(3) coefficients array index for a particular so(3) band, order1 and order2 position. More...
|
|
void | getDihedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList) |
| This function obtains a list of all D symmetries from already computed C symmetries list. More...
|
|
std::vector< proshade_double * > | decidePolyFromList (ProSHADE_settings *settings, std::vector< std::vector< proshade_double * > > *polyList, size_t fullGroupSize, std::vector< proshade_double * > *CSyms, proshade_double tolerance, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function takes a list of predicted polyheral groups and decides which is most likely using the FSC of the constituent axes. More...
|
|
void | getPredictedIcosahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function predicts a list of all I symmetry axes from the already computed C symmetries list. More...
|
|
void | getPredictedOctahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function predicts a list of all O symmetry axes from the already computed C symmetries list. More...
|
|
void | getPredictedTetrahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function predicts a list of all T symmetry axes from the already computed C symmetries list. More...
|
|
void | detectSymmetryFromAngleAxisSpace (ProSHADE_settings *settings) |
| This function runs the symmetry detection algorithms on this structure using the angle-axis space and saving the results in the settings object. More...
|
|
std::vector< proshade_double * > | getCyclicSymmetriesListFromAngleAxis (ProSHADE_settings *settings) |
| This function obtains a list of all C symmetries from the angle-axis space mapped rotation function values. More...
|
|
std::vector< proshade_double * > | findRequestedCSymmetryFromAngleAxis (ProSHADE_settings *settings, proshade_unsign fold, proshade_double *peakThres) |
| This function searches the angle-axis representation of the rotation function for a cyclic point group with given fold. More...
|
|
std::string | getRecommendedSymmetryType (void) |
| This function simply returns the detected recommended symmetry type.
|
|
proshade_unsign | getRecommendedSymmetryFold (void) |
| This function simply returns the detected recommended symmetry fold.
|
|
std::vector< proshade_double * > | getRecommendedSymmetryValues (void) |
| This function simply returns the detected recommended symmetry axes.
|
|
proshade_unsign | getNoRecommendedSymmetryAxes (ProSHADE_settings *settings) |
|
proshade_unsign | getNoRecommendedSymmetryAxes (void) |
| This function returns the number of detected recommended symmetry axes. More...
|
|
std::vector< std::string > | getSymmetryAxis (ProSHADE_settings *settings, proshade_unsign axisNo) |
| This function returns a single symmetry axis as a vector of strings from the recommended symmetry axes list. More...
|
|
void | prepareFSCFourierMemory (proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed *noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_single resolution, proshade_signed *cutXDim, proshade_signed *cutYDim, proshade_signed *cutZDim) |
| This function allocates the memory and makes all preparations required for FSC computation. More...
|
|
proshade_double | computeFSC (ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, size_t symIndex, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_unsign rotNumber=1) |
| This function computes FSC for any given axis in the supplied CSym symmetry axes vector. More...
|
|
proshade_double | computeFSC (ProSHADE_settings *settings, proshade_double *sym, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_unsign rotNumber=1) |
| This function computes FSC for any given axis in the supplied CSym symmetry axes vector. More...
|
|
void | determineRecommendedSymmetry (ProSHADE_settings *settings, proshade_double threshold, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function takes all the detected symmetry results and decides on which are to be recommended for this structure. More...
|
|
void | saveRequestedSymmetryD (ProSHADE_settings *settings, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed cutXDim, proshade_signed cutYDim, proshade_signed cutZDim) |
| This function takes the D symmetries and searched for the requested symmetry. More...
|
|
std::vector< std::vector< proshade_double > > | getAllGroupElements (std::vector< proshade_unsign > axesList, std::string groupType="", proshade_double matrixTolerance=0.05) |
| This function returns the group elements as rotation matrices of any defined point group. More...
|
|
std::vector< std::vector< proshade_double > > | getAllGroupElements (std::vector< std::vector< proshade_double > > *allCs, std::vector< proshade_unsign > axesList, std::string groupType="", proshade_double matrixTolerance=0.05) |
| This function returns the group elements as rotation matrices of any defined point group. More...
|
|
void | reportSymmetryResults (ProSHADE_settings *settings) |
| This function prints the report for symmetry detection. More...
|
|
void | reportCurrentSymmetryResults (ProSHADE_settings *settings, proshade_double threshold, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed cutXDim, proshade_signed cutYDim, proshade_signed cutZDim) |
| This function prints a single line of the symmetry detection results for a particular threshold. More...
|
|
void | reportSymmetryResultsList (ProSHADE_settings *settings) |
| This function takes prints the report for symmetry detection using multiple thresholds.. More...
|
|
void | getOverlayRotationFunction (ProSHADE_settings *settings, ProSHADE_internal_data::ProSHADE_data *obj2) |
| This function computes the overlay rotation function (i.e. the correlation function in SO(3) space). More...
|
|
std::vector< proshade_double > | getBestRotationMapPeaksEulerAngles (ProSHADE_settings *settings) |
| This function returns a vector of three floats, the three Euler angles of the best peak in the rotation map. More...
|
|
std::vector< proshade_double > | getBestTranslationMapPeaksAngstrom (ProSHADE_internal_data::ProSHADE_data *staticStructure) |
| This function gets the optimal translation vector and returns it as a standard library vector. It also applies the translation to the internal map. More...
|
|
void | zeroPaddToDims (proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim) |
| This function changes the size of a structure to fit the supplied new limits. More...
|
|
void | rotateMapReciprocalSpace (ProSHADE_settings *settings, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma) |
| This function rotates a map based on the given Euler angles. More...
|
|
std::vector< proshade_double > | rotateMapRealSpace (proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, proshade_double *&map) |
| This function rotates a map based on the given angle-axis rotation. More...
|
|
std::vector< proshade_double > | rotateMapRealSpaceInPlace (proshade_double eulA, proshade_double eulB, proshade_double eulG) |
| This function rotates a map based on the given Euler angles in place. More...
|
|
void | rotateFourierCoeffs (proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, fftw_complex *&coeffs, fftw_complex *&rotCoeffs, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim) |
| This function takes the rotation in terms of angle-axis representation and returns the input Fourier coefficients rotated by the rotation. More...
|
|
void | translateMap (proshade_double trsX, proshade_double trsY, proshade_double trsZ) |
| This function simply translates the map by a given number of Angstroms along the three axes. More...
|
|
void | allocateRotatedSHMemory (void) |
| This function allocates the memory required for storing the rotated Spherical Harmonics coefficients.
|
|
void | computeRotatedSH (void) |
| This function multiplies the objects spherical harmonics with the Wigner D matrices, obtaining rotated spherical harmonics coefficients.
|
|
void | invertSHCoefficients (void) |
| This function computes the shell mapped data from inverting the Spherical Harmonics coefficients. More...
|
|
void | interpolateMapFromSpheres (proshade_double *&densityMapRotated) |
| This function interpolates the density map from the sphere mapped data. More...
|
|
void | computeTranslationMap (ProSHADE_internal_data::ProSHADE_data *obj1) |
| This function does the computation of the translation map and saves results internally. More...
|
|
void | findMapCOM (void) |
| This function finds the centre of mass of the internal map representation. More...
|
|
void | writeOutOverlayFiles (ProSHADE_settings *settings, proshade_double eulA, proshade_double eulB, proshade_double eulG, std::vector< proshade_double > *rotCentre, std::vector< proshade_double > *ultimateTranslation) |
| This function writes out the rotated map, co-ordinates and transformation JSON file. More...
|
|
void | reportOverlayResults (ProSHADE_settings *settings, std::vector< proshade_double > *rotationCentre, std::vector< proshade_double > *eulerAngles, std::vector< proshade_double > *finalTranslation) |
| This function reports the results of the overlay mode. More...
|
|
void | deepCopyMap (proshade_double *&saveTo, proshade_signed verbose) |
| This function copies the internal map into the supplied pointer, which it also allocates. More...
|
|
proshade_double | getMapValue (proshade_unsign pos) |
| This function returns the internal map representation value of a particular array position. More...
|
|
proshade_unsign | getMaxSpheres (void) |
| This function returns the number of spheres which contain the whole object. More...
|
|
proshade_unsign | getMaxBand (void) |
| This function returns the maximum band value for the object. More...
|
|
proshade_double * | getRealSphHarmValue (proshade_unsign band, proshade_unsign order, proshade_unsign shell) |
| This function allows access to the private internal real spherical harmonics values. More...
|
|
proshade_double * | getImagSphHarmValue (proshade_unsign band, proshade_unsign order, proshade_unsign shell) |
| This function allows access to the private internal imaginary spherical harmonics values. More...
|
|
proshade_double | getRRPValue (proshade_unsign band, proshade_unsign sh1, proshade_unsign sh2) |
| This function allows access to the priva internal RRP matrices. More...
|
|
proshade_double | getAnySphereRadius (proshade_unsign shell) |
| This function allows access to the radius of any particular sphere. More...
|
|
proshade_double | getIntegrationWeight (void) |
| This function allows access to the integration weight for the object. More...
|
|
proshade_unsign | getShellBandwidth (proshade_unsign shell) |
| This function allows access to the bandwidth of a particular shell. More...
|
|
proshade_single | getSpherePosValue (proshade_unsign shell) |
| This function allows access to sphere positions. More...
|
|
proshade_complex ** | getEMatrixByBand (proshade_unsign band) |
| This function allows access to E matrix for a particular band. More...
|
|
void | getEMatrixValue (proshade_unsign band, proshade_unsign order1, proshade_unsign order2, proshade_double *valueReal, proshade_double *valueImag) |
| This function allows access to E matrix by knowing the band, order1 and order2 indices. More...
|
|
proshade_complex * | getInvSO3Coeffs (void) |
| This function allows access to the inverse SO(3) coefficients array. More...
|
|
proshade_complex * | getSO3Coeffs (void) |
| This function allows access to the SO(3) coefficients array. More...
|
|
proshade_unsign | getEMatDim (void) |
| This function allows access to the maximum band for the E matrix. More...
|
|
void | getWignerMatrixValue (proshade_unsign band, proshade_unsign order1, proshade_unsign order2, proshade_double *valueReal, proshade_double *valueImag) |
| This function allows access to the Wigner D matrix by knowing the band, order1 and order2 indices. More...
|
|
proshade_single | getXDimSize (void) |
| This function allows access to the map size in angstroms along the X axis. More...
|
|
proshade_single | getYDimSize (void) |
| This function allows access to the map size in angstroms along the Y axis. More...
|
|
proshade_single | getZDimSize (void) |
| This function allows access to the map size in angstroms along the Z axis. More...
|
|
proshade_unsign | getXDim (void) |
| This function allows access to the map size in indices along the X axis. More...
|
|
proshade_unsign | getYDim (void) |
| This function allows access to the map size in indices along the Y axis. More...
|
|
proshade_unsign | getZDim (void) |
| This function allows access to the map size in indices along the Z axis. More...
|
|
proshade_signed * | getXFromPtr (void) |
| This function allows access to the map start along the X axis. More...
|
|
proshade_signed * | getYFromPtr (void) |
| This function allows access to the map start along the Y axis. More...
|
|
proshade_signed * | getZFromPtr (void) |
| This function allows access to the map start along the Z axis. More...
|
|
proshade_signed * | getXToPtr (void) |
| This function allows access to the map last position along the X axis. More...
|
|
proshade_signed * | getYToPtr (void) |
| This function allows access to the map last position along the Y axis. More...
|
|
proshade_signed * | getZToPtr (void) |
| This function allows access to the map last position along the Z axis. More...
|
|
proshade_signed * | getXAxisOrigin (void) |
| This function allows access to the map X axis origin value. More...
|
|
proshade_signed * | getYAxisOrigin (void) |
| This function allows access to the map Y axis origin value. More...
|
|
proshade_signed * | getZAxisOrigin (void) |
| This function allows access to the map Z axis origin value. More...
|
|
proshade_double *& | getInternalMap (void) |
| This function allows access to the first map array value address. More...
|
|
proshade_complex * | getTranslationFnPointer (void) |
| This function allows access to the translation function through a pointer. More...
|
|
std::vector< proshade_double > | getMapCOMProcessChange (void) |
| This function allows access to the translation caused by structure processing. More...
|
|
std::vector< proshade_double * > * | getCyclicAxes (void) |
| This function allows access to the list of detected cyclic axes. More...
|
|
std::vector< proshade_double * > | getCyclicAxesCopy (void) |
| This function allows access to the list of detected cyclic axes in non-overwrite fashion. More...
|
|
std::vector< std::vector< proshade_double * > > * | getDihedralAxes (void) |
| This function allows access to the list of detected dihedral axes. More...
|
|
std::vector< std::vector< proshade_double * > > | getDihedralAxesCopy (void) |
| This function allows access to the list of detected dihedral axes in a non-over-write fashion. More...
|
|
void | setIntegrationWeight (proshade_double intW) |
| This function allows setting the integration weight for the object. More...
|
|
void | setIntegrationWeightCumul (proshade_double intW) |
| This function allows setting the cumulative integration weight for the object. More...
|
|
void | setEMatrixValue (int band, int order1, int order2, proshade_complex val) |
| This function allows setting the E matrix value. More...
|
|
void | normaliseEMatrixValue (proshade_unsign band, proshade_unsign order1, proshade_unsign order2, proshade_double normF) |
| This function allows normalising the E matrix value. More...
|
|
void | setSO3CoeffValue (proshade_unsign position, proshade_complex val) |
| This function allows setting the SOFT coefficient values using array position and value. More...
|
|
void | setWignerMatrixValue (proshade_complex val, proshade_unsign band, proshade_unsign order1, proshade_unsign order2) |
| This function allows setting the Wigner D matrix value by its band, order1 and order2 co-ordinate. More...
|
|
|
std::string | fileName |
| This is the original file from which the data were obtained.
|
|
ProSHADE_internal_io::InputType | fileType |
| This is the type of the input file.
|
|
proshade_double * | internalMap |
| The internal map data representation, which may be amended as the run progresses.
|
|
proshade_single | xDimSize |
| This is the size of the map cell x dimension in Angstroms.
|
|
proshade_single | yDimSize |
| This is the size of the map cell y dimension in Angstroms.
|
|
proshade_single | zDimSize |
| This is the size of the map cell z dimension in Angstroms.
|
|
proshade_single | aAngle |
| This is the angle a of the map cell in degrees.
|
|
proshade_single | bAngle |
| This is the angle b of the map cell in degrees.
|
|
proshade_single | cAngle |
| This is the angle c of the map cell in degrees.
|
|
proshade_unsign | xDimIndices |
| This is the size of the map cell x dimension in indices.
|
|
proshade_unsign | yDimIndices |
| This is the size of the map cell y dimension in indices.
|
|
proshade_unsign | zDimIndices |
| This is the size of the map cell z dimension in indices.
|
|
proshade_unsign | xGridIndices |
| As far as I know, this is identical to the xDimIndices.
|
|
proshade_unsign | yGridIndices |
| As far as I know, this is identical to the yDimIndices.
|
|
proshade_unsign | zGridIndices |
| As far as I know, this is identical to the zDimIndices.
|
|
proshade_unsign | xAxisOrder |
| This is the order of the x axis.
|
|
proshade_unsign | yAxisOrder |
| This is the order of the y axis.
|
|
proshade_unsign | zAxisOrder |
| This is the order of the z axis.
|
|
proshade_signed | xAxisOrigin |
| This is the origin position along the x axis.
|
|
proshade_signed | yAxisOrigin |
| This is the origin position along the y axis.
|
|
proshade_signed | zAxisOrigin |
| This is the origin position along the z axis.
|
|
proshade_double | xCom |
| The COM of the map after processing along the X-axis.
|
|
proshade_double | yCom |
| The COM of the map after processing along the Y-axis.
|
|
proshade_double | zCom |
| The COM of the map after processing along the Z-axis.
|
|
proshade_single | xDimSizeOriginal |
| This is the size of the map cell x dimension in Angstroms.
|
|
proshade_single | yDimSizeOriginal |
| This is the size of the map cell y dimension in Angstroms.
|
|
proshade_single | zDimSizeOriginal |
| This is the size of the map cell z dimension in Angstroms.
|
|
proshade_unsign | xDimIndicesOriginal |
| This is the size of the map cell x dimension in indices.
|
|
proshade_unsign | yDimIndicesOriginal |
| This is the size of the map cell y dimension in indices.
|
|
proshade_unsign | zDimIndicesOriginal |
| This is the size of the map cell z dimension in indices.
|
|
proshade_signed | xAxisOriginOriginal |
| This is the origin position along the x axis.
|
|
proshade_signed | yAxisOriginOriginal |
| This is the origin position along the y axis.
|
|
proshade_signed | zAxisOriginOriginal |
| This is the origin position along the z axis.
|
|
proshade_double | originalMapXCom |
| The COM of the first map to be loaded/computed without any furhter changes being reflacted along the X axis.
|
|
proshade_double | originalMapYCom |
| The COM of the first map to be loaded/computed without any furhter changes being reflacted along the Y axis.
|
|
proshade_double | originalMapZCom |
| The COM of the first map to be loaded/computed without any furhter changes being reflacted along the Z axis.
|
|
proshade_double | mapMovFromsChangeX |
| When the map is translated, the xFrom and xTo values are changed. This variable holds how much they have changed.
|
|
proshade_double | mapMovFromsChangeY |
| When the map is translated, the yFrom and yTo values are changed. This variable holds how much they have changed.
|
|
proshade_double | mapMovFromsChangeZ |
| When the map is translated, the zFrom and zTo values are changed. This variable holds how much they have changed.
|
|
proshade_double | mapCOMProcessChangeX |
| The change in X axis between the creation of the structure (originalMapXCom) and just before rotation.
|
|
proshade_double | mapCOMProcessChangeY |
| The change in Y axis between the creation of the structure (originalMapYCom) and just before rotation.
|
|
proshade_double | mapCOMProcessChangeZ |
| The change in Z axis between the creation of the structure (originalMapZCom) and just before rotation.
|
|
proshade_double | originalPdbRotCenX |
| The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map) along the x-axis.
|
|
proshade_double | originalPdbRotCenY |
| The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map) along the y-axis.
|
|
proshade_double | originalPdbRotCenZ |
| The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map) along the z-axis.
|
|
proshade_double | originalPdbTransX |
| The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE internal map) along the x-axis.
|
|
proshade_double | originalPdbTransY |
| The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE internal map) along the y-axis.
|
|
proshade_double | originalPdbTransZ |
| The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE internal map) along the z-axis.
|
|
proshade_signed | xFrom |
| This is the starting index along the x axis.
|
|
proshade_signed | yFrom |
| This is the starting index along the y axis.
|
|
proshade_signed | zFrom |
| This is the starting index along the z axis.
|
|
proshade_signed | xTo |
| This is the final index along the x axis.
|
|
proshade_signed | yTo |
| This is the final index along the y axis.
|
|
proshade_signed | zTo |
| This is the final index along the z axis.
|
|
std::vector< proshade_single > | spherePos |
| Vector of sphere radii from the centre of the map.
|
|
proshade_unsign | noSpheres |
| The number of spheres with map projected onto them.
|
|
ProSHADE_internal_spheres::ProSHADE_sphere ** | spheres |
| The set of concentric spheres to which the intermal density map has been projected.
|
|
proshade_complex ** | sphericalHarmonics |
| A set of spherical harmonics values arrays for each sphere.
|
|
proshade_complex ** | rotSphericalHarmonics |
| A set of rotated spherical harmonics values arrays for each sphere, used only if map rotation is required.
|
|
proshade_unsign | maxShellBand |
| The maximum band for any shell of the object.
|
|
proshade_unsign | maxEMatDim |
| The band (l) value for E matrix (i.e. the smallest of the two bands).
|
|
proshade_double *** | rrpMatrices |
| The energy levels descriptor shell correlation tables.
|
|
proshade_complex *** | eMatrices |
| The trace sigma and full rotation function c*conj(c) integral tables.
|
|
proshade_double | integrationWeight |
| The Pearson's c.c. type weighting for the integration.
|
|
proshade_complex * | so3Coeffs |
| The coefficients obtained by SO(3) Fourier Transform (SOFT), in this case derived from the E matrices.
|
|
proshade_complex * | so3CoeffsInverse |
| The inverse coefficients obtained by inverse SO(3) Fourier Transform (SOFT) - i.e. rotation function.
|
|
proshade_complex *** | wignerMatrices |
| These matrices are computed for a particular rotation to be done in spherical harmonics.
|
|
proshade_complex * | translationMap |
| This is where the translation map will be held, if at all used.
|
|
std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_sphere * > | sphereMappedRotFun |
|
bool | isEmpty |
| This variable stated whether the class contains any information.
|
|
proshade_unsign | inputOrder |
| This value is the input order - it is useful to know for writing out files, so that they would not overwrite the same name multiple times.
|
|
std::vector< proshade_double * > | cyclicSymmetries |
| This is where the detected cyclic ("C") symmetries will be kept.
|
|
std::vector< std::vector< proshade_double * > > | dihedralSymmetries |
| This is where the detected dihedral ("D") symmetries will be kept.
|
|
std::vector< proshade_double * > | tetrahedralSymmetries |
| This is where the detected tetrahedral ("T") symmetries will be kept.
|
|
std::vector< proshade_double * > | octahedralSymmetries |
| This is where the detected octahedral ("O") symmetries will be kept.
|
|
std::vector< proshade_double * > | icosahedralSymmetries |
| This is where the detected icosahedral ("I") symmetries will be kept.
|
|
std::vector< proshade_double * > | recommendedSymmetryValues |
| The axes and other info of the recommended symmetry for the structure.
|
|
std::string | recommendedSymmetryType |
| The symmetry type that ProSHADE finds the best fitting for the structure. Possible values are "" for none, "C" for cyclic, "D" for Dihedral, "T" for Tetrahedral, "O" for Octahedral and "I" for Icosahedral. C and D types also have fold value associated.
|
|
proshade_unsign | recommendedSymmetryFold |
| The fold of the recommended symmetry C or D type, 0 otherwise.
|
|
This class contains all inputed and derived data for a single structure.
This class codes the object that contains all the information about the input data and the derived information as well. It does not, however, provide the computation code as that lives elsewhere, except for the forward declarations.
Definition at line 48 of file ProSHADE_data.hpp.
◆ ProSHADE_data() [1/2]
ProSHADE_internal_data::ProSHADE_data::ProSHADE_data |
( |
| ) |
|
Constructor for getting empty ProSHADE_data class.
This constructor creates an empty data structure which can later be filled with data and used to process these data further.
- Parameters
-
[in] | settings | ProSHADE_settings object specifying what should be done. |
[out] | X | Empty data object with deault values. |
Definition at line 94 of file ProSHADE_data.cpp.
99 this->
fileType = ProSHADE_internal_io::UNKNOWN;
164 this->
spherePos = std::vector<proshade_single> ( );
◆ ProSHADE_data() [2/2]
ProSHADE_internal_data::ProSHADE_data::ProSHADE_data |
( |
std::string |
strName, |
|
|
double * |
mapVals, |
|
|
int |
len, |
|
|
proshade_single |
xDmSz, |
|
|
proshade_single |
yDmSz, |
|
|
proshade_single |
zDmSz, |
|
|
proshade_unsign |
xDmInd, |
|
|
proshade_unsign |
yDmInd, |
|
|
proshade_unsign |
zDmInd, |
|
|
proshade_signed |
xFr, |
|
|
proshade_signed |
yFr, |
|
|
proshade_signed |
zFr, |
|
|
proshade_signed |
xT, |
|
|
proshade_signed |
yT, |
|
|
proshade_signed |
zT, |
|
|
proshade_unsign |
inputO |
|
) |
| |
Constructor for creating ProSHADE_data structure with data.
This constructor creates a data structure with all the map information, so that maps obtained from other software could be loeaded and used. This function makes a lot of assumptions (all angles are 90 degrees, axis grids are equal to indices, axis order is XYZ and axis origin is the first index in all dimensions). If any of these are not true, the user is required to change the appropriate internal values after this function has returned the object.
- Parameters
-
[in] | settings | ProSHADE_settings object specifying what should be done. |
[in] | strName | The name of the structure for reference. |
[in] | mapVals | A pointer to array where all the map data are. |
[in] | len | The length of this map values array. |
[in] | xDmSz | The size of the x-axis dimension in Angstroms. |
[in] | yDmSz | The size of the y-axis dimension in Angstroms. |
[in] | zDmSz | The size of the z-axis dimension in Angstroms. |
[in] | xDmInd | The size of the x-axis dimension in indices. |
[in] | yDmInd | The size of the y-axis dimension in indices. |
[in] | zDmInd | The size of the z-axis dimension in indices. |
[in] | xFr | The first index statting position along the x-axis. |
[in] | yFr | The first index statting position along the y-axis. |
[in] | zFr | The first index statting position along the z-axis. |
[in] | xT | The last index end position along the x-axis. |
[in] | yT | The last index end position along the y-axis. |
[in] | zT | The last index end position along the z-axis. |
[in] | inputO | The input order for this structure. |
[out] | X | Empty data object with filled in values and map. |
Definition at line 218 of file ProSHADE_data.cpp.
223 this->
fileType = ProSHADE_internal_io::MAP;
288 this->
spherePos = std::vector<proshade_single> ( );
310 if (
static_cast<proshade_unsign
> ( len ) != ( xDmInd * yDmInd * zDmInd ) )
312 throw ProSHADE_exception (
"Structure class input map has wrong dimensions.",
"EP00044", __FILE__, __LINE__, __func__,
"The supplied map array size has different dimensions to\n : the required map dimensions." );
315 if ( (
static_cast<proshade_signed
> ( xT - xFr ) !=
static_cast<proshade_signed
> ( xDmInd - 1 ) ) ||
316 (
static_cast<proshade_signed
> ( yT - yFr ) !=
static_cast<proshade_signed
> ( yDmInd - 1 ) ) ||
317 (
static_cast<proshade_signed
> ( zT - zFr ) !=
static_cast<proshade_signed
> ( zDmInd - 1 ) ) )
319 throw ProSHADE_exception (
"Structure class input dimensions not in line with map\n : to/from indices.",
"EP00045", __FILE__, __LINE__, __func__,
"The supplied map information does not add up. The\n : dimensions are not in line with the indexing start/stop\n : position distances and therefore proper map indexing\n : cannot be done. Please check the input values." );
327 proshade_unsign arrPos = 0;
328 for ( proshade_unsign xIt = 0; xIt < this->
xDimIndices; xIt++ )
330 for ( proshade_unsign yIt = 0; yIt < this->
yDimIndices; yIt++ )
332 for ( proshade_unsign zIt = 0; zIt < this->
zDimIndices; zIt++ )
334 arrPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
335 this->
internalMap[arrPos] =
static_cast<proshade_double
> ( mapVals[arrPos] );
◆ ~ProSHADE_data()
ProSHADE_internal_data::ProSHADE_data::~ProSHADE_data |
( |
void |
| ) |
|
Destructor for the ProSHADE_data class.
This destructor is responsible for releasing all memory used by the data storing object
- Parameters
-
Definition at line 354 of file ProSHADE_data.cpp.
364 if ( this->
spheres !=
nullptr )
366 for ( proshade_unsign iter = 0; iter < this->
noSpheres; iter++ )
368 if ( this->
spheres[iter] !=
nullptr )
380 for ( proshade_unsign iter = 0; iter < this->
noSpheres; iter++ )
394 for ( proshade_unsign iter = 0; iter < this->
noSpheres; iter++ )
408 for ( proshade_unsign bwIt = 0; bwIt < this->
maxShellBand; bwIt++ )
412 for ( proshade_unsign shIt = 0; shIt < this->
noSpheres; shIt++ )
431 for ( proshade_unsign bandIter = 0; bandIter < this->
getEMatDim ( ); bandIter++ )
433 if ( this->
eMatrices[bandIter] !=
nullptr )
435 for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
437 if ( this->
eMatrices[bandIter][band2Iter] !=
nullptr )
439 delete[] this->
eMatrices[bandIter][band2Iter];
440 this->
eMatrices[bandIter][band2Iter] =
nullptr;
464 for ( proshade_unsign bandIter = 1; bandIter < this->
maxEMatDim; bandIter++ )
468 for ( proshade_unsign order1Iter = 0; order1Iter < ( (bandIter * 2) + 1 ); order1Iter++ )
488 if ( this->sphereMappedRotFun.size() > 0 )
490 for ( proshade_unsign spIt = 0; spIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); spIt++ )
492 delete this->sphereMappedRotFun.at(spIt);
◆ addExtraSpace()
void ProSHADE_internal_data::ProSHADE_data::addExtraSpace |
( |
ProSHADE_settings * |
settings | ) |
|
This function increases the size of the map so that it can add empty space around it.
This function adds a given number of angstroms (as given in the settings object) to the internal structure map. This requires all the internal variables to be adjusted for the extra space at the begginning and at the end, while also copying the map into a larger one with appropriate extra space.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 1629 of file ProSHADE_data.cpp.
1632 std::stringstream hlpSS;
1633 hlpSS <<
"Adding extra " << settings->
addExtraSpace <<
" angstroms.";
1642 this->
xDimSize += 2 *
static_cast<proshade_single
> ( xAddIndices ) * this->
xDimSize /
static_cast<proshade_single
> ( this->
xDimIndices );
1643 this->
yDimSize += 2 *
static_cast<proshade_single
> ( yAddIndices ) * this->
yDimSize /
static_cast<proshade_single
> ( this->
yDimIndices );
1644 this->
zDimSize += 2 *
static_cast<proshade_single
> ( zAddIndices ) * this->
zDimSize /
static_cast<proshade_single
> ( this->
zDimIndices );
1658 this->
xFrom -= xAddIndices;
1659 this->
yFrom -= yAddIndices;
1660 this->
zFrom -= zAddIndices;
1662 this->
xTo += xAddIndices;
1663 this->
yTo += yAddIndices;
1664 this->
zTo += zAddIndices;
1677 proshade_unsign newMapIndex, oldMapIndex;
1678 for ( proshade_unsign xIt = 0; xIt < (this->
xDimIndices - xAddIndices); xIt++ )
1681 if ( xIt < xAddIndices ) {
continue; }
1683 for ( proshade_unsign yIt = 0; yIt < (this->
yDimIndices - yAddIndices); yIt++ )
1686 if ( yIt < yAddIndices ) {
continue; }
1688 for ( proshade_unsign zIt = 0; zIt < (this->
zDimIndices - zAddIndices); zIt++ )
1691 if ( zIt < zAddIndices ) {
continue; }
1695 oldMapIndex = (zIt - zAddIndices) + (this->
zDimIndices - ( 2 * zAddIndices ) ) * ( (yIt - yAddIndices) + (this->
yDimIndices - ( 2 * yAddIndices ) ) * (xIt - xAddIndices) );
1697 newMap[newMapIndex] = this->
internalMap[oldMapIndex];
◆ allocateEMatrices()
void ProSHADE_internal_data::ProSHADE_data::allocateEMatrices |
( |
proshade_unsign |
band, |
|
|
proshade_single |
oversamplingRatio |
|
) |
| |
This function allocates the required memory for the E matrices.
This function belongs to the ProSHADE_data class and its role is to allocate the require memory for the E matrices required by both, the Trace Sigma and Full Rotational descriptors, as well as symmetry and rotation tasks.
- Parameters
-
[in] | band | The minimal band of the comparison for which E matrices are computed. |
[in] | oversamplingRatio | How much was the resolution oversampled? |
Definition at line 276 of file ProSHADE_distances.cpp.
279 proshade_unsign oversampleEMatricesBy =
static_cast< proshade_unsign
> (
static_cast< proshade_single
> ( band ) * ( 1.0f - oversamplingRatio ) );
282 this->
maxEMatDim = band + oversampleEMatricesBy;
288 for ( proshade_unsign bandIter = 0; bandIter < this->
maxEMatDim; bandIter++ )
291 this->
eMatrices[bandIter] =
new proshade_complex* [
static_cast<proshade_unsign
> ( ( bandIter * 2 ) + 1 )];
294 for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
296 this->
eMatrices[bandIter][band2Iter] =
new proshade_complex [
static_cast<proshade_unsign
> ( ( bandIter * 2 ) + 1 )];
302 for ( proshade_unsign bandIter = 0; bandIter < this->
maxEMatDim; bandIter++ )
304 for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
306 for ( proshade_unsign band3Iter = 0; band3Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band3Iter++ )
308 this->
eMatrices[bandIter][band2Iter][band3Iter][0] = 0.0;
309 this->
eMatrices[bandIter][band2Iter][band3Iter][1] = 0.0;
◆ allocateRRPMemory()
void ProSHADE_internal_data::ProSHADE_data::allocateRRPMemory |
( |
| ) |
|
|
protected |
This function allocates the required memory for the RRP matrices.
This function belongs to the ProSHADE_data class and its role is to allocate the require memory for the RRP matrices, given the already determined bandwidths and shell count.
Definition at line 31 of file ProSHADE_distances.cpp.
37 for ( proshade_unsign bwIt = 0; bwIt < this->
maxShellBand; bwIt++ )
43 for ( proshade_unsign shIt = 0; shIt < this->
noSpheres; shIt++ )
◆ allocateSO3CoeffsSpace()
void ProSHADE_internal_data::ProSHADE_data::allocateSO3CoeffsSpace |
( |
proshade_unsign |
band | ) |
|
This function allocates the memory for the SO(3) coefficients and the inverse for that calling object.
- Parameters
-
[in] | band | The bandwidth to which the computation will be done. |
Definition at line 707 of file ProSHADE_distances.cpp.
710 this->
so3Coeffs =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) *
static_cast<proshade_unsign
>( ( 4 * pow(
static_cast<proshade_double
> ( band ), 3.0 ) -
static_cast<proshade_double
> ( band ) ) / 3.0 ) ) );
711 this->
so3CoeffsInverse =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) *
static_cast<proshade_unsign
>( pow(
static_cast<proshade_double
> ( band ) * 2.0, 3.0 ) ) ) );
◆ centreMapOnCOM()
void ProSHADE_internal_data::ProSHADE_data::centreMapOnCOM |
( |
ProSHADE_settings * |
settings | ) |
|
This function shits the map so that its COM is in the centre of the map.
This function finds the Centre Of Mass (COM) for the internal map and proceeds to use Fourier to shift the COM to the centre of the map. There is an assumption that the COM and centre of map are close, as if they were far apart, the shift could move some part of the map through the boundaries and cause the map to become messy.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 1556 of file ProSHADE_data.cpp.
1570 proshade_double xCOM = 0.0;
1571 proshade_double yCOM = 0.0;
1572 proshade_double zCOM = 0.0;
1580 proshade_single xSampRate =
static_cast< proshade_single
> ( this->
xDimSize ) /
static_cast< proshade_single
> ( this->
xTo - this->
xFrom + 1 );
1581 proshade_single ySampRate =
static_cast< proshade_single
> ( this->
yDimSize ) /
static_cast< proshade_single
> ( this->
yTo - this->
yFrom + 1 );
1582 proshade_single zSampRate =
static_cast< proshade_single
> ( this->
zDimSize ) /
static_cast< proshade_single
> ( this->
zTo - this->
zFrom + 1 );
1585 xCOM /=
static_cast< proshade_double
> ( xSampRate );
1586 yCOM /=
static_cast< proshade_double
> ( ySampRate );
1587 zCOM /=
static_cast< proshade_double
> ( zSampRate );
1589 xCOM -=
static_cast< proshade_double
> ( this->
xFrom );
1590 yCOM -=
static_cast< proshade_double
> ( this->
yFrom );
1591 zCOM -=
static_cast< proshade_double
> ( this->
zFrom );
1594 proshade_double xDist = ( (
static_cast<proshade_double
> ( this->
xDimIndices ) / 2.0 ) - xCOM ) *
static_cast<proshade_double
> ( this->
xDimSize ) /
static_cast<proshade_double
> ( this->
xDimIndices );
1595 proshade_double yDist = ( (
static_cast<proshade_double
> ( this->
yDimIndices ) / 2.0 ) - yCOM ) *
static_cast<proshade_double
> ( this->
yDimSize ) /
static_cast<proshade_double
> ( this->
yDimIndices );
1596 proshade_double zDist = ( (
static_cast<proshade_double
> ( this->
zDimIndices ) / 2.0 ) - zCOM ) *
static_cast<proshade_double
> ( this->
zDimSize ) /
static_cast<proshade_double
> ( this->
zDimIndices );
1600 static_cast< proshade_single
> ( xDist ),
1601 static_cast< proshade_single
> ( yDist ),
1602 static_cast< proshade_single
> ( zDist ),
1604 static_cast< proshade_signed
> ( this->
xDimIndices ),
1605 static_cast< proshade_signed
> ( this->
yDimIndices ),
1606 static_cast< proshade_signed
> ( this->
zDimIndices ) );
◆ computeFSC() [1/2]
proshade_double ProSHADE_internal_data::ProSHADE_data::computeFSC |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double * |
sym, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim, |
|
|
proshade_unsign |
rotNumber = 1 |
|
) |
| |
This function computes FSC for any given axis in the supplied CSym symmetry axes vector.
This function drives the FSC computation for symmetry detection. It iterates over all rotations specified by the symmetry axis (except for the I rotation) and for each of these, computes the rotated map Fourier coefficients (does not rotate the map). Next, it procceds to bin the coefficients according to the supplied key. From these bins, the sums required for finding the FSC between the rotated map and the original map can be obtained. Finally, averaging the FSC'c for all rotations the final FSC for the whole symmetry axis is obtained and returned.
- Warning
- This function does not really work on its own, it makes plethora of assumptions easily summed as: The prepareFSCFourierMemory() function has been run and its results are supplied to this function. If this does not hold, then I would not use this function as it will most likely fail terribly with memory access issues.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | sym | A single double array containing a single Cyclic symmetry entry in the ProSHADE format. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
[in] | rotNumber | Which rotation should be used to compare against the original position? Defaults to first (1). |
[out] | fsc | The FSC value found for the first (smallest) rotated map along the symmetry axis and the original map. |
Definition at line 2408 of file ProSHADE_data.cpp.
2411 if ( sym[6] > -2.0 ) {
return ( sym[6] ); }
2414 std::stringstream ss2;
2415 ss2 <<
"Computing FSC for symmetry C" << sym[0] <<
" ( " << sym[1] <<
" ; " << sym[2] <<
" ; " << sym[3] <<
" ) with peak height " << sym[5];
2419 fftw_complex *rotCoeffs;
2420 proshade_double averageFSC = 0.0;
2423 if ( rotNumber == 0 )
2425 for ( proshade_unsign rotIndex = 1; rotIndex < static_cast< proshade_unsign > ( sym[0] ); rotIndex++ )
2428 this->
rotateFourierCoeffs ( sym[1], sym[2], sym[3], ( ( 2.0 * M_PI ) / sym[0] ) *
static_cast< proshade_double
> ( rotIndex ), fCoeffsCut, rotCoeffs, xDim, yDim, zDim );
2434 fftw_free ( rotCoeffs );
2438 averageFSC /= ( sym[0] - 1.0 );
2443 this->
rotateFourierCoeffs ( sym[1], sym[2], sym[3], ( ( 2.0 * M_PI ) / sym[0] ) *
static_cast< proshade_double
> ( rotNumber ), fCoeffsCut, rotCoeffs, xDim, yDim, zDim );
2449 fftw_free ( rotCoeffs );
2453 sym[6] = averageFSC;
2456 std::stringstream ss3;
2457 if ( rotNumber != 0 )
2459 ss3 <<
"FSC value for structure rotated by " << ( ( 2.0 * M_PI ) / sym[0] ) *
static_cast< proshade_double
> ( rotNumber ) <<
" radians is " << averageFSC <<
" .";
2463 ss3 <<
"FSC value averaged over all " <<
static_cast< proshade_unsign
> ( sym[0] - 1 ) <<
" rotations is " << averageFSC <<
" .";
2468 return ( averageFSC );
◆ computeFSC() [2/2]
proshade_double ProSHADE_internal_data::ProSHADE_data::computeFSC |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double * > * |
CSym, |
|
|
size_t |
symIndex, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim, |
|
|
proshade_unsign |
rotNumber = 1 |
|
) |
| |
This function computes FSC for any given axis in the supplied CSym symmetry axes vector.
This function drives the FSC computation for symmetry detection. It iterates over all rotations specified by the symmetry axis (except for the I rotation) and for each of these, computes the rotated map Fourier coefficients (does not rotate the map). Next, it procceds to bin the coefficients according to the supplied key. From these bins, the sums required for finding the FSC between the rotated map and the original map can be obtained. Finally, averaging the FSC'c for all rotations the final FSC for the whole symmetry axis is obtained and returned.
- Warning
- This function does not really work on its own, it makes plethora of assumptions easily summed as: The prepareFSCFourierMemory() function has been run and its results are supplied to this function. If this does not hold, then I would not use this function as it will most likely fail terribly with memory access issues.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | CSym | A vector of pointers to double arrays, each array being a single Cyclic symmetry entry. |
[in] | symIndex | The index of the symmetry axis in the CSym vector for which FSC should be computed. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
[in] | rotNumber | Which rotation should be used to compare against the original position? Defaults to first (1). |
[out] | fsc | The FSC value found for the first (smallest) rotated map along the symmetry axis and the original map. |
Definition at line 2312 of file ProSHADE_data.cpp.
2315 if ( symIndex >= CSym->size() )
2317 std::cerr <<
"The supplied symmetry axes vector does not contain element number " << symIndex <<
". Returning FSC 0.0." << std::endl;
2322 if ( CSym->at(symIndex)[6] > -2.0 ) {
return ( CSym->at(symIndex)[6] ); }
2325 std::stringstream ss2;
2326 ss2 <<
"Computing FSC for symmetry C" << CSym->at(symIndex)[0] <<
" ( " << CSym->at(symIndex)[1] <<
" ; " << CSym->at(symIndex)[2] <<
" ; " << CSym->at(symIndex)[3] <<
" ) with peak height " << CSym->at(symIndex)[5];
2330 fftw_complex *rotCoeffs;
2331 proshade_double averageFSC = 0.0;
2334 if ( rotNumber == 0 )
2336 for ( proshade_unsign rotIndex = 1; rotIndex < static_cast< proshade_unsign > ( CSym->at(symIndex)[0] ); rotIndex++ )
2339 this->
rotateFourierCoeffs ( CSym->at(symIndex)[1], CSym->at(symIndex)[2], CSym->at(symIndex)[3], ( ( 2.0 * M_PI ) / CSym->at(symIndex)[0] ) *
static_cast< proshade_double
> ( rotIndex ), fCoeffsCut, rotCoeffs, xDim, yDim, zDim );
2345 fftw_free ( rotCoeffs );
2349 averageFSC /= ( CSym->at(symIndex)[0] - 1.0 );
2354 this->
rotateFourierCoeffs ( CSym->at(symIndex)[1], CSym->at(symIndex)[2], CSym->at(symIndex)[3], ( ( 2.0 * M_PI ) / CSym->at(symIndex)[0] ) *
static_cast< proshade_double
> ( rotNumber ), fCoeffsCut, rotCoeffs, xDim, yDim, zDim );
2360 fftw_free ( rotCoeffs );
2364 CSym->at(symIndex)[6] = averageFSC;
2367 std::stringstream ss3;
2368 if ( rotNumber != 0 )
2370 ss3 <<
"FSC value for structure rotated by " << ( ( 2.0 * M_PI ) / CSym->at(symIndex)[0] ) *
static_cast< proshade_double
> ( rotNumber ) <<
" radians is " << averageFSC <<
" .";
2374 ss3 <<
"FSC value averaged over all " <<
static_cast< proshade_unsign
> ( CSym->at(symIndex)[0] - 1 ) <<
" rotations is " << averageFSC <<
" .";
2379 return ( averageFSC );
◆ computeRotationFunction()
void ProSHADE_internal_data::ProSHADE_data::computeRotationFunction |
( |
ProSHADE_settings * |
settings | ) |
|
This function computes the self-rotation function for this structure.
This function assumes that the spherical harmonics have been computed for a data object. It can be then called on this object and it will proceed to compute the E matrices for this object against itself. From these "self E matrices", the function will generate the SO(3) transform coefficients and finally it will invert transform these coefficients back, thus getting the self-rotation function.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map self-rotation function computation. |
Definition at line 41 of file ProSHADE_symmetry.cpp.
◆ computeRRPMatrices()
void ProSHADE_internal_data::ProSHADE_data::computeRRPMatrices |
( |
ProSHADE_settings * |
settings | ) |
|
This function pre-computes the RRP matrices for a data object.
This function belongs to the ProSHADE_data class and its role is to set the objects internal variables properly and provide all the required calculations, so that the object will in the end have all the RRP matrices computed and be ready for the energy levels calculation.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for the task. |
Definition at line 59 of file ProSHADE_distances.cpp.
68 proshade_double descValR = 0.0;
69 proshade_unsign arrPos1, arrPos2;
70 for ( proshade_unsign band = 0; band < this->
maxShellBand; band++ )
73 for ( proshade_unsign shell1 = 0; shell1 < this->
noSpheres; shell1++ )
78 for ( proshade_unsign shell2 = 0; shell2 < this->
noSpheres; shell2++ )
86 for ( proshade_unsign shell2 = 0; shell2 < this->
noSpheres; shell2++ )
89 if ( shell1 > shell2 ) {
continue; }
103 for ( proshade_unsign order = 0; order < static_cast< proshade_unsign > ( ( 2 * band ) + 1 ); order++ )
105 arrPos1 =
static_cast< proshade_unsign
> ( seanindex (
static_cast< int > ( order ) -
static_cast<int > ( band ),
106 static_cast< int > ( band ),
static_cast< int > ( this->
spheres[shell1]->getLocalBandwidth() ) ) );
107 arrPos2 =
static_cast< proshade_unsign
> ( seanindex (
static_cast< int > ( order ) -
static_cast< int > ( band ),
108 static_cast< int > ( band ),
static_cast< int > ( this->
spheres[shell2]->getLocalBandwidth() ) ) );
116 this->
rrpMatrices[band][shell1][shell2] = descValR;
117 this->
rrpMatrices[band][shell2][shell1] = descValR;
◆ computeSphericalHarmonics()
void ProSHADE_internal_data::ProSHADE_data::computeSphericalHarmonics |
( |
ProSHADE_settings * |
settings | ) |
|
This function computes the spherical harmonics decomposition for the whole structure.
This function is called to compute the spherical harmonics decomposition of the mapped data on every available sphere. This is done sphere-wise and there is some sub-optimal memory management stemming from different shells having different resolutions.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 1895 of file ProSHADE_data.cpp.
1903 for ( proshade_unsign iter = 0; iter < this->
noSpheres; iter++ )
1911 for ( proshade_unsign iter = 0; iter < this->
noSpheres; iter++ )
1914 std::stringstream ss;
1915 ss <<
"Now decomposing sphere " << iter <<
". " <<
"( Band is: " << this->
spheres[iter]->
getLocalBandwidth() <<
").";
◆ computeTranslationMap()
This function does the computation of the translation map and saves results internally.
This function takes the static structure, the optimal translation to which should be found and then it proceeds to compute the Fourier transform of both this and the static structures. It then combines the coefficients for translation function and computes the inverse Fourier transform, thus obtaining the translation function. This function is then saved, while all other internal data are deleted.
- Parameters
-
[in] | staticStructure | A pointer to the data class object of the other ( static ) structure. |
Definition at line 324 of file ProSHADE_overlay.cpp.
327 fftw_complex *tmpIn1 =
nullptr, *tmpOut1 =
nullptr, *tmpIn2 =
nullptr, *tmpOut2 =
nullptr, *resOut =
nullptr;
328 fftw_plan forwardFourierObj1, forwardFourierObj2, inverseFourierCombo;
329 proshade_unsign dimMult = staticStructure->
getXDim() * staticStructure->
getYDim() * staticStructure->
getZDim();
330 ProSHADE_internal_overlay::allocateTranslationFunctionMemory ( tmpIn1, tmpOut1, tmpIn2, tmpOut2, this->
translationMap, resOut, forwardFourierObj1, forwardFourierObj2, inverseFourierCombo, staticStructure->
getXDim(), staticStructure->
getYDim(), staticStructure->
getZDim() );
333 for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn1[iter][0] = staticStructure->
getMapValue ( iter ); tmpIn1[iter][1] = 0.0; }
334 for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn2[iter][0] = this->
getMapValue ( iter ); tmpIn2[iter][1] = 0.0; }
337 fftw_execute ( forwardFourierObj1 );
338 fftw_execute ( forwardFourierObj2 );
342 fftw_execute ( inverseFourierCombo );
◆ convertRotationFunction()
void ProSHADE_internal_data::ProSHADE_data::convertRotationFunction |
( |
ProSHADE_settings * |
settings | ) |
|
This function converts the self-rotation function of this structure to angle-axis representation.
This function creates a set of concentric spheres in a spherical co-ordinates space, where the radius is the angle-axis representation angle and the lattitude and longitude angles are the angle-axis representation axis vector. I.e. each of the spheres contains all angle-axis representation axes for a single given angle.
Then, it proceeds to interpolate the rotation function for each point in this space, thus effectivelly re-sampling the rotation function onto the required space.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map self-rotation function computation. |
Definition at line 135 of file ProSHADE_symmetry.cpp.
141 proshade_double shellSpacing = ( 2.0 * M_PI ) /
static_cast<proshade_double
> ( this->
getMaxBand ( ) ) * 2.0;
142 std::vector< proshade_double > allPeakHeights;
145 for ( proshade_unsign spIt = 1; spIt < ( this->
getMaxBand ( ) * 2 ); spIt++ )
151 static_cast<proshade_double
> ( spIt ) * shellSpacing,
156 for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( sphereMappedRotFun.size() ); shIt++ )
159 std::stringstream hlpSS;
160 hlpSS <<
"Interpolating sphere " << shIt <<
" ( radius: " << this->sphereMappedRotFun.at(shIt)->getRadius() <<
" ).";
164 this->sphereMappedRotFun.at(shIt)->interpolateSphereValues ( this->
getInvSO3Coeffs ( ) );
172 for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
174 this->sphereMappedRotFun.at(shIt)->findAllPeaks (
static_cast< proshade_signed
> ( settings->
peakNeighbours ), &allPeakHeights );
178 std::stringstream hlpSS;
179 hlpSS <<
"Detected " << allPeakHeights.size() <<
" peaks with any height.";
186 std::stringstream hlpSS2;
187 hlpSS2 <<
"From these peaks, decided the threshold will be " << peakThres <<
" peak height.";
191 for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
193 this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( peakThres );
◆ createNewMapFromBounds()
void ProSHADE_internal_data::ProSHADE_data::createNewMapFromBounds |
( |
ProSHADE_settings * |
settings, |
|
|
ProSHADE_data *& |
newStr, |
|
|
proshade_signed * |
newBounds |
|
) |
| |
This function creates a new structure from the calling structure and new bounds values.
This function takes a pointer to uninitialised structure and fills it with the calling structure values adjusted for the new bounds. If the bounds are the same, the two structures should be identical except the file (the new structure does not have an input file associated) and the type (no type for the new structure). It can deal with both larger and smaller bounds than the original values.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
[in] | newStr | A pointer reference to a new structure class which has all the same values except for the new bounds and adequately changed map. |
[in] | newBounds | A pointer to proshade_signed array of 6 storing the results - (0 = minX; 1 = maxX; 2 = minY; 3 = maxY; 4 - minZ; 5 = maxZ). |
Definition at line 1410 of file ProSHADE_data.cpp.
1416 newStr->fileName =
"N/A";
1417 newStr->fileType = ProSHADE_internal_io::MAP;
1420 newStr->xDimIndices =
static_cast< proshade_unsign
> ( newBounds[1] ) -
static_cast< proshade_unsign
> ( newBounds[0] ) + 1;
1421 newStr->yDimIndices =
static_cast< proshade_unsign
> ( newBounds[3] ) -
static_cast< proshade_unsign
> ( newBounds[2] ) + 1;
1422 newStr->zDimIndices =
static_cast< proshade_unsign
> ( newBounds[5] ) -
static_cast< proshade_unsign
> ( newBounds[4] ) + 1;
1424 newStr->aAngle = this->
aAngle;
1425 newStr->bAngle = this->
aAngle;
1426 newStr->cAngle = this->
aAngle;
1428 newStr->xDimSize =
static_cast<proshade_single
> ( newStr->xDimIndices ) * ( this->
xDimSize /
static_cast<proshade_single
> ( this->
xDimIndices ) );
1429 newStr->yDimSize =
static_cast<proshade_single
> ( newStr->yDimIndices ) * ( this->
yDimSize /
static_cast<proshade_single
> ( this->
yDimIndices ) );
1430 newStr->zDimSize =
static_cast<proshade_single
> ( newStr->zDimIndices ) * ( this->
zDimSize /
static_cast<proshade_single
> ( this->
zDimIndices ) );
1432 newStr->xGridIndices = newStr->xDimIndices;
1433 newStr->yGridIndices = newStr->yDimIndices;
1434 newStr->zGridIndices = newStr->zDimIndices;
1440 newStr->xAxisOrigin = this->
xAxisOrigin + newBounds[0];
1441 newStr->yAxisOrigin = this->
yAxisOrigin + newBounds[2];
1442 newStr->zAxisOrigin = this->
zAxisOrigin + newBounds[4];
1444 newStr->xFrom = this->
xFrom + newBounds[0];
1445 newStr->yFrom = this->
yFrom + newBounds[2];
1446 newStr->zFrom = this->
zFrom + newBounds[4];
1448 newStr->xTo = this->
xTo - (
static_cast< proshade_signed
> ( this->
xDimIndices - 1 ) - newBounds[1] );
1449 newStr->yTo = this->
yTo - (
static_cast< proshade_signed
> ( this->
yDimIndices - 1 ) - newBounds[3] );
1450 newStr->zTo = this->
zTo - (
static_cast< proshade_signed
> ( this->
zDimIndices - 1 ) - newBounds[5] );
1453 newStr->internalMap =
new proshade_double[newStr->xDimIndices * newStr->yDimIndices * newStr->zDimIndices];
1458 this->xFrom, this->yFrom, this->zFrom, newStr->yDimIndices, newStr->zDimIndices,
1459 this->xDimIndices, this->yDimIndices, this->zDimIndices, newStr->internalMap, this->internalMap );
◆ decidePolyFromList()
std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::decidePolyFromList |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< std::vector< proshade_double * > > * |
polyList, |
|
|
size_t |
fullGroupSize, |
|
|
std::vector< proshade_double * > * |
CSyms, |
|
|
proshade_double |
tolerance, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function takes a list of predicted polyheral groups and decides which is most likely using the FSC of the constituent axes.
...
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[in] | CSymList | A vector containing the already detected Cyclic symmetries. |
Definition at line 1659 of file ProSHADE_symmetry.cpp.
1662 std::vector< proshade_double* > ret;
1663 proshade_double fscVal = 0.0;
1664 proshade_double fscValAvg = 0.0;
1665 proshade_double fscMax = 0.0;
1666 size_t fscMaxInd = 0;
1667 proshade_signed matchedPos = -1;
1670 for (
size_t gIt = 0; gIt < polyList->size(); gIt++ )
1673 if ( polyList->at(gIt).size() != fullGroupSize ) {
continue; }
1680 for (
size_t aIt = 0; aIt < polyList->at(gIt).size(); aIt++ )
1683 matchedPos =
ProSHADE_internal_symmetry::addAxisUnlessSame (
static_cast< proshade_unsign
> ( polyList->at(gIt).at(aIt)[0] ), polyList->at(gIt).at(aIt)[1], polyList->at(gIt).at(aIt)[2], polyList->at(gIt).at(aIt)[3], polyList->at(gIt).at(aIt)[5], polyList->at(gIt).at(aIt)[6], CSyms, tolerance );
1686 fscVal = this->
computeFSC ( settings, CSyms,
static_cast< size_t > ( matchedPos ), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
1687 polyList->at(gIt).at(aIt)[6] = fscVal;
1688 fscValAvg += fscVal;
1698 fscValAvg /=
static_cast< proshade_double
> ( fullGroupSize );
1701 if ( fscValAvg > fscMax )
1712 for (
size_t retIt = 0; retIt < polyList->at(fscMaxInd).size(); retIt++ )
1715 matchedPos =
ProSHADE_internal_symmetry::addAxisUnlessSame (
static_cast< proshade_unsign
> ( polyList->at(fscMaxInd).at(retIt)[0] ), polyList->at(fscMaxInd).at(retIt)[1], polyList->at(fscMaxInd).at(retIt)[2], polyList->at(fscMaxInd).at(retIt)[3], polyList->at(fscMaxInd).at(retIt)[5], polyList->at(fscMaxInd).at(retIt)[6], CSyms, tolerance );
◆ deepCopyMap()
void ProSHADE_internal_data::ProSHADE_data::deepCopyMap |
( |
proshade_double *& |
saveTo, |
|
|
proshade_signed |
verbose |
|
) |
| |
This function copies the internal map into the supplied pointer, which it also allocates.
This function is provided so that the user can provide a pointer and have it allocated and filled with the map values.
- Parameters
-
[in] | saveTo | A pointer where the internal map should be deep copied into. |
[in] | verbose | How loud the run should be? |
Definition at line 3431 of file ProSHADE_data.cpp.
3434 if ( saveTo !=
nullptr )
◆ detectSymmetryFromAngleAxisSpace()
void ProSHADE_internal_data::ProSHADE_data::detectSymmetryFromAngleAxisSpace |
( |
ProSHADE_settings * |
settings | ) |
|
This function runs the symmetry detection algorithms on this structure using the angle-axis space and saving the results in the settings object.
This function firstly decides whether specific C symmetry was requested or not. This decision is important as knowing the required fold allows for a rather simplified algorithm to be applied. Thus, if specific fold is known, simplified algorithm will be used. Otherwise, this function will do a general search by firstly finding all cyclic point groups and then applying the dihedral, tetrahedral, octahedral and icosahedral searches.
Once complete, the function will save both, the vector of ProSHADE formatted array pointers as well as vector of vectors of doubles with the same information containing all detected cyclic point groups into the supplied vector pointers.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
Definition at line 1954 of file ProSHADE_data.cpp.
1957 if ( settings->axisErrToleranceDefault )
1959 settings->
axisErrTolerance = std::min ( std::max ( 0.01, ( ( 2.0 * M_PI ) /
static_cast< proshade_double
> ( this->
maxShellBand ) ) / 2.0 ), 0.05 );
1963 fftw_complex* fCoeffsCut;
1964 proshade_double **bindata, *fscByBin;
1965 proshade_signed *cutIndices, *binCounts, noBins, cutXDim, cutYDim, cutZDim;
1972 std::stringstream hlpSS;
1977 proshade_double symThres = 0.0;
1983 const FloatingPoint< proshade_double > lhs ( this->
cyclicSymmetries.at(cIt)[5] ), rhs ( -999.9 );
1986 this->
computeFSC ( settings, &this->
cyclicSymmetries, cIt, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
1996 bool passedTests =
false;
2004 proshade_double* hlpSym =
new proshade_double[7];
2006 for (
size_t iter = 0; iter < 7; iter++ ) { hlpSym[iter] = this->
cyclicSymmetries.at(cIt)[iter]; }
2027 for (
size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) {
delete[] bindata[binIt]; }
2031 delete[] cutIndices;
2032 fftw_free ( fCoeffsCut );
2045 std::stringstream ss;
2050 if ( this->sphereMappedRotFun.size() < 1 )
2052 throw ProSHADE_exception (
"Rotation function was not converted into angle-axis space.",
"ES00062", __FILE__, __LINE__, __func__,
"It seems that the convertRotationFunction() function was\n : not yet called. Therefore, there are no data to detect the\n : symmetry from; please call the convertRotationFunction()\n : function before the detectSymmetryFromAngleAxisSpace()\n : function." );
2063 for (
size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) {
delete[] bindata[binIt]; }
2067 delete[] cutIndices;
2068 fftw_free ( fCoeffsCut );
2077 throw ProSHADE_exception (
"Requested symmetry supplied, but not recognised.",
"ES00032", __FILE__, __LINE__, __func__,
"There are only the following value allowed for the\n : symmetry type request: \"C\", \"D\", \"T\", \"O\" and \"I\". Any\n : other value will result in this error." );
2084 this->
determineRecommendedSymmetry ( settings, -2.0, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2091 this->
saveRequestedSymmetryD ( settings, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2097 this->
getPredictedTetrahedralSymmetriesList ( settings, &this->
cyclicSymmetries, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2102 proshade_double fscVal = 0.0;
2103 proshade_double fscValAvg = 0.0;
2106 for (
size_t tIt = 0; tIt < this->
tetrahedralSymmetries.size(); tIt++ ) {
if ( this->
tetrahedralSymmetries.at(tIt)[5] > settings->
peakThresholdMin ) { fscVal = this->
computeFSC ( settings, &this->
tetrahedralSymmetries.at(tIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); fscValAvg += fscVal; } }
2123 this->
getPredictedOctahedralSymmetriesList ( settings, &this->
cyclicSymmetries, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2128 proshade_double fscVal = 0.0;
2129 proshade_double fscValAvg = 0.0;
2132 for (
size_t oIt = 0; oIt < this->
octahedralSymmetries.size(); oIt++ ) {
if ( this->
octahedralSymmetries.at(oIt)[5] > settings->
peakThresholdMin ) { fscVal = this->
computeFSC ( settings, &this->
octahedralSymmetries.at(oIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); fscValAvg += fscVal; } }
2149 this->
getPredictedIcosahedralSymmetriesList ( settings, &this->
cyclicSymmetries, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2154 proshade_double fscVal = 0.0;
2155 proshade_double fscValAvg = 0.0;
2158 for (
size_t iIt = 0; iIt < this->
icosahedralSymmetries.size(); iIt++ ) {
if ( this->
icosahedralSymmetries.at(iIt)[5] > settings->
peakThresholdMin ) { fscVal = this->
computeFSC ( settings, &this->
icosahedralSymmetries.at(iIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); fscValAvg += fscVal; } }
2173 for (
size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) {
delete[] bindata[binIt]; }
2176 delete[] cutIndices;
2177 fftw_free ( fCoeffsCut );
◆ determineRecommendedSymmetry()
void ProSHADE_internal_data::ProSHADE_data::determineRecommendedSymmetry |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double |
threshold, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
cutXDim, |
|
|
proshade_signed |
cutYDim, |
|
|
proshade_signed |
cutZDim |
|
) |
| |
This function takes all the detected symmetry results and decides on which are to be recommended for this structure.
This function is the brains of symmetry detection in the sense that it decides which symmetry group ProSHADE recommends as being detected. It starts by taking all C symmetries and building a histogram of their peak heights. From this histogram, it determines a threshold which contains only the most reliable axes.
Next, the function tests for all axes being over this threshold for the polyhedral symmetries - I, O and T in this order. If all such axes (with appropriate folds) are found, their FSCs will be checked against the supplied (settings object) threshold (default: 0.80). If all axes pass the FSC test, then the corresponding polyhedral symmetry is determined as recommended.
Should no polyhedral symmetries be found, the list of detected D symmetries will be tested next with very similar approach - both axes are required to pass the peak height threshold as well as the FSC threshold. Should multiple axes pairs pass, the one with the highest fold will be decided as the recommended one.
Finally, if no dihedral symmetry is found, the C symmetries list will be searched, again with the peak height and FSC criteria. If multiple symmetry axes are found, the one with the highest fold will be determined as the recommended one, while if no symmetries axis passes both tests, then no symmetry will be returned as detected.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | threshold | The FSC threshold to which all axes need to be in order to be included in cosideration for the recommended symmetry. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 2502 of file ProSHADE_data.cpp.
2516 if ( threshold < -1.0 ) { threshold = settings->
fscThreshold; }
2525 std::vector< proshade_double* > thresholdedCs;
2530 this->
getPredictedTetrahedralSymmetriesList ( settings, &thresholdedCs, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2531 this->
getPredictedOctahedralSymmetriesList ( settings, &thresholdedCs, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2532 this->
getPredictedIcosahedralSymmetriesList ( settings, &thresholdedCs, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
2535 proshade_double step = 0.01;
2536 proshade_double sigma = 0.3;
2537 proshade_signed windowSize = 9;
2538 proshade_double IFSCAverage = 0.0, OFSCAverage = 0.0, TFSCAverage = 0.0;
2539 bool IIsBest =
false, OIsBest =
false, TIsBest =
false;
2546 proshade_unsign noPassed = 0;
for (
size_t cIt = 0; cIt < thresholdedCs.size(); cIt++ ) {
if ( thresholdedCs.at(cIt)[5] > bestHistPeakStart ) { noPassed += 1; } }
2547 std::stringstream ss;
2548 ss <<
"Smoothening has resolved in " << noPassed <<
" C symmetries.";
2553 bool alreadyDecided =
false;
2557 proshade_double fscVal = 0.0;
2558 proshade_double fscValAvg = 0.0;
2559 proshade_unsign lowFSC = 0;
2562 for (
size_t iIt = 0; iIt < this->
icosahedralSymmetries.size(); iIt++ ) {
if ( !std::isinf ( this->
icosahedralSymmetries.at(iIt)[6] ) ) { fscVal = this->
icosahedralSymmetries.at(iIt)[6]; }
else { fscVal = this->
computeFSC ( settings, &this->
icosahedralSymmetries.at(iIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); } fscValAvg += fscVal;
if ( fscVal < threshold ) { lowFSC++; } }
2564 IFSCAverage = fscValAvg;
2565 if ( ( IFSCAverage < threshold ) || ( lowFSC > 10 ) ) { IFSCAverage = 0.0; }
2572 proshade_double fscVal = 0.0;
2573 proshade_double fscValAvg = 0.0;
2574 proshade_unsign lowFSC = 0;
2577 for (
size_t oIt = 0; oIt < this->
octahedralSymmetries.size(); oIt++ ) {
if ( !std::isinf ( this->
octahedralSymmetries.at(oIt)[6] ) ) { fscVal = this->
octahedralSymmetries.at(oIt)[6]; }
else { fscVal = this->
computeFSC ( settings, &this->
octahedralSymmetries.at(oIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); } fscValAvg += fscVal;
if ( fscVal < threshold ) { lowFSC++; } }
2579 OFSCAverage = fscValAvg;
2580 if ( ( OFSCAverage < threshold ) || ( lowFSC > 5 ) ) { OFSCAverage = 0.0; }
2587 proshade_double fscVal = 0.0;
2588 proshade_double fscValAvg = 0.0;
2589 proshade_unsign lowFSC = 0;
2592 for (
size_t tIt = 0; tIt < this->
tetrahedralSymmetries.size(); tIt++ ) {
if ( !std::isinf ( this->
tetrahedralSymmetries.at(tIt)[6] ) ) { fscVal = this->
tetrahedralSymmetries.at(tIt)[6]; }
else { fscVal = this->
computeFSC ( settings, &this->
tetrahedralSymmetries.at(tIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); } fscValAvg += fscVal;
if ( fscVal < threshold ) { lowFSC++; } }
2594 TFSCAverage = fscValAvg;
2595 if ( ( TFSCAverage < threshold ) || ( lowFSC > 2 ) ) { TFSCAverage = 0.0; }
2599 proshade_double newThres = threshold;
2602 proshade_double phaselessStep = 0.01;
2603 proshade_double phaselessSigma = 0.005;
2604 proshade_signed phaselessWSize = 5;
2609 if ( ( IFSCAverage > std::max( OFSCAverage * 0.9, TFSCAverage * 0.7 ) ) && ( IFSCAverage > newThres ) ) { IIsBest =
true; }
2610 if ( ( OFSCAverage > std::max( IFSCAverage * 1.2, TFSCAverage * 0.7 ) ) && ( OFSCAverage > newThres ) ) { OIsBest =
true; }
2611 if ( ( TFSCAverage > std::max( IFSCAverage * 1.2, OFSCAverage * 1.1 ) ) && ( TFSCAverage > newThres ) ) { TIsBest =
true; }
2612 if ( !IIsBest && !OIsBest && !TIsBest && ( std::max( IFSCAverage, std::max( OFSCAverage, TFSCAverage ) ) > newThres ) )
2614 const FloatingPoint< proshade_double > lhsPolyI ( IFSCAverage ), lhsPolyO ( OFSCAverage ), lhsPolyT ( TFSCAverage ), rhsPolyMax ( std::max( IFSCAverage, std::max( OFSCAverage, TFSCAverage ) ) );
2615 if ( lhsPolyI.AlmostEquals( rhsPolyMax ) ) { IIsBest =
true; }
2616 if ( lhsPolyO.AlmostEquals( rhsPolyMax ) ) { OIsBest =
true; }
2617 if ( lhsPolyT.AlmostEquals( rhsPolyMax ) ) { TIsBest =
true; }
2629 alreadyDecided =
true;
2633 if ( OIsBest && !alreadyDecided )
2641 alreadyDecided =
true;
2645 if ( TIsBest && !alreadyDecided )
2653 alreadyDecided =
true;
2657 proshade_signed bestD = -1;
2661 proshade_unsign bestFold = 0;
2662 proshade_double bestValFSC = -std::numeric_limits < proshade_double >::infinity();
2663 proshade_double bestValPeak = -std::numeric_limits < proshade_double >::infinity();
2669 const FloatingPoint< proshade_double > lhs999a ( this->
dihedralSymmetries.at(dIt).at(0)[5] ), lhs999b ( this->
dihedralSymmetries.at(dIt).at(1)[5] ), rhs999 (
static_cast< proshade_double
> ( -999.9 ) );
2670 if ( ( this->
dihedralSymmetries.at(dIt).at(0)[5] < bestHistPeakStart ) && !( lhs999a.AlmostEquals( rhs999 ) ) ) {
continue; }
2671 if ( ( this->
dihedralSymmetries.at(dIt).at(1)[5] < bestHistPeakStart ) && !( lhs999b.AlmostEquals( rhs999 ) ) ) {
continue; }
2674 if ( std::isinf ( this->
dihedralSymmetries.at(dIt).at(0)[6] ) ) { this->
computeFSC ( settings, &this->
dihedralSymmetries.at(dIt).at(0)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); }
2675 if ( std::isinf ( this->
dihedralSymmetries.at(dIt).at(1)[6] ) ) { this->
computeFSC ( settings, &this->
dihedralSymmetries.at(dIt).at(1)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); }
2679 std::vector< proshade_double* > smootheningHlp;
2687 proshade_double* sym =
new proshade_double[7];
2690 sym[0] = 0.0; sym[1] = 0.0; sym[2] = 0.0; sym[3] = 0.0; sym[4] = 0.0;
2706 for (
size_t axIt = 0; axIt < smootheningHlp.size(); axIt++ ) {
if ( smootheningHlp.at(axIt) !=
nullptr ) {
delete[] smootheningHlp.at(axIt); } }
2716 const FloatingPoint< proshade_double > lhs999a2 ( this->
dihedralSymmetries.at(dIt).at(0)[5] ), lhs999b2 ( this->
dihedralSymmetries.at(dIt).at(1)[5] ), rhs999 (
static_cast< proshade_double
> ( -999.9 ) );
2717 if ( ( this->
dihedralSymmetries.at(dIt).at(0)[5] < bestHistPeakStart ) && !( lhs999a2.AlmostEquals( rhs999 ) ) ) {
continue; }
2718 if ( ( this->
dihedralSymmetries.at(dIt).at(1)[5] < bestHistPeakStart ) && !( lhs999b2.AlmostEquals( rhs999 ) ) ) {
continue; }
2719 if ( std::min ( this->
dihedralSymmetries.at(dIt).at(0)[5], this->dihedralSymmetries.at(dIt).at(1)[5] ) < ( std::max ( settings->
peakThresholdMin, onlyDPeakThreshold ) * 0.90 ) ) {
continue; }
2722 if ( ( this->
dihedralSymmetries.at(dIt).at(0)[0] >
static_cast< proshade_double
> ( bestFold ) ) ||
2723 ( this->dihedralSymmetries.at(dIt).at(1)[0] >
static_cast< proshade_double
> ( bestFold ) ) )
2726 if ( ( this->
dihedralSymmetries.at(dIt).at(0)[6] < std::max ( threshold, onlyDFSCThreshold ) ) &&
2727 ( this->dihedralSymmetries.at(dIt).at(1)[6] < std::max ( threshold, onlyDFSCThreshold ) ) ) {
continue; }
2728 if ( std::min ( this->
dihedralSymmetries.at(dIt).at(0)[6], this->dihedralSymmetries.at(dIt).at(1)[6] ) < ( std::max ( threshold, onlyDFSCThreshold ) * 0.70 ) ) {
continue; }
2733 bestFold =
static_cast< proshade_unsign
> ( std::max ( this->
dihedralSymmetries.at(dIt).at(0)[0], this->dihedralSymmetries.at(dIt).at(1)[0] ) );
2734 bestD =
static_cast< proshade_signed
> ( dIt );
2739 const FloatingPoint< proshade_double > lhs1 ( this->
dihedralSymmetries.at(dIt).at(0)[0] ), lhs2 ( this->
dihedralSymmetries.at(dIt).at(1)[0] ), rhs (
static_cast< proshade_double
> ( bestFold ) );
2740 if ( ( ( ( this->
dihedralSymmetries.at(dIt).at(0)[6] + this->dihedralSymmetries.at(dIt).at(1)[6] ) / 2.0 ) > ( bestValFSC * 1.00 ) ) &&
2741 ( ( ( this->dihedralSymmetries.at(dIt).at(0)[5] + this->dihedralSymmetries.at(dIt).at(1)[5] ) / 2.0 ) > ( bestValPeak * 0.95 ) ) &&
2742 ( ( lhs1.AlmostEquals ( rhs ) ) || ( lhs2.AlmostEquals ( rhs ) ) ) )
2746 bestFold =
static_cast< proshade_unsign
> ( std::max ( this->
dihedralSymmetries.at(dIt).at(0)[0], this->dihedralSymmetries.at(dIt).at(1)[0] ) );
2747 bestD =
static_cast< proshade_signed
> ( dIt );
2757 this->
recommendedSymmetryFold =
static_cast< proshade_unsign
> ( std::max ( this->
dihedralSymmetries.at(
static_cast< size_t> ( bestD ) ).at(0)[0], this->dihedralSymmetries.at(
static_cast< size_t> ( bestD ) ).at(0)[1] ) );
2767 proshade_signed bestC = -1;
2768 proshade_unsign bestFold = 0;
2774 if ( ( cIt > 20 ) && ( this->
cyclicSymmetries.at(cIt)[5] < 0.95 ) ) {
break; }
2780 if ( std::isinf ( this->
cyclicSymmetries.at(cIt)[6] ) ) { this->
computeFSC ( settings, &this->
cyclicSymmetries.at(cIt)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim ); }
2785 if (
static_cast< proshade_signed
> ( threshold * 100.0 ) >
static_cast< proshade_signed
> ( settings->
fscThreshold * 100.0 ) ) { bestHistFSCStart = threshold; }
2791 if ( this->
cyclicSymmetries.at(cIt)[0] >
static_cast< proshade_double
> ( bestFold ) )
2794 if ( this->
cyclicSymmetries.at(cIt)[6] > std::max ( bestHistFSCStart, threshold ) )
2796 bestFold =
static_cast< proshade_unsign
> ( this->
cyclicSymmetries.at(cIt)[0] );
2797 bestC =
static_cast< proshade_signed
> ( cIt );
2807 ( ( this->
cyclicSymmetries.at(
static_cast< size_t > ( bestC ) )[5] * 0.95 ) > std::min ( this->
dihedralSymmetries.at(
static_cast< size_t > ( bestD ) ).at(0)[5], this->dihedralSymmetries.at(
static_cast< size_t > ( bestD ) ).at(1)[5] ) ) )
2823 alreadyDecided =
true;
2828 for (
size_t iter = 0; iter < thresholdedCs.size(); iter++ ) {
if ( thresholdedCs.at(iter) !=
nullptr ) {
delete[] thresholdedCs.at(iter); } }
◆ figureIndexStartStop()
void ProSHADE_internal_data::ProSHADE_data::figureIndexStartStop |
( |
void |
| ) |
|
|
protected |
Function for determining iterator start and stop positions.
This function is called to set the xFrom, yFrom, ..., yTo and zTo iterator values for easier further calculations. It assumes that gemmi has read in the xFrom, yFrom and zFrom values already.
Definition at line 894 of file ProSHADE_data.cpp.
◆ findMapCOM()
void ProSHADE_internal_data::ProSHADE_data::findMapCOM |
( |
void |
| ) |
|
This function finds the centre of mass of the internal map representation.
This function simply computes the centre of mass for the given ProSHADE_data object map in the "real space" (i.e. the space that counts Angstroms from the bottom left further corner). These are then saved into the ProSHADE_data object.
Definition at line 3672 of file ProSHADE_data.cpp.
3678 proshade_double totNonZeroPoints = 0.0;
3679 proshade_signed mapIt = 0;
3682 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->
xDimIndices ); xIt++ )
3684 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->
yDimIndices ); yIt++ )
3686 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->
zDimIndices ); zIt++ )
3689 mapIt = zIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( yIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * xIt );
3692 if ( this->
internalMap[mapIt] <= 0.0 ) {
continue; }
3703 this->
xCom /= totNonZeroPoints;
3704 this->
yCom /= totNonZeroPoints;
3705 this->
zCom /= totNonZeroPoints;
3709 ( (
static_cast< proshade_single
> ( this->
xCom ) -
static_cast< proshade_single
> ( this->
xFrom ) ) *
3712 ( (
static_cast< proshade_single
> ( this->
yCom ) -
static_cast< proshade_single
> ( this->
yFrom ) ) *
3715 ( (
static_cast< proshade_single
> ( this->
zCom ) -
static_cast< proshade_single
> ( this->
zFrom ) ) *
◆ findRequestedCSymmetryFromAngleAxis()
std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::findRequestedCSymmetryFromAngleAxis |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_unsign |
fold, |
|
|
proshade_double * |
peakThres |
|
) |
| |
This function searches the angle-axis representation of the rotation function for a cyclic point group with given fold.
This function is a simplification of the getCyclicSymmetriesListFromAngleAxis() function, where this function does not map the whole rotation function, but rothar only to the spheres it knows it will required. Moreover, it does not search for all cyclic point groups, but only those which span all the spheres (angles) and therefore have the required fold.
In terms of operations, this function interpolates the rotation function values onto the spheres it requires, then it finds peaks and removes the small peaks, so that these can then be grouped. For each group which spans all the angles it then finds the index with highest sum of peak height over all spheres. It can then do the bi-cubic interpolation if requested. Finally, all the detected peaks are sorted by the peak height and returned.
- Parameters
-
[in] | settings | ProSHADE_settings object containing all the settings for this run. |
[in] | fold | The fold which should be sought for by the function. |
[in] | peakThres | The threshold used to cut peaks. |
[out] | ret | Vector of double pointers to arrays having the standard ProSHADE symmetry group structure. |
Definition at line 2939 of file ProSHADE_symmetry.cpp.
2942 proshade_double soughtAngle;
2943 std::vector< proshade_double > allPeakHeights;
2944 std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup* > peakGroups;
2945 std::vector< proshade_double* > ret;
2949 if ( ( M_PI /
static_cast < proshade_double
> ( this->
maxShellBand ) ) >= ( M_PI /
static_cast< proshade_double
> ( fold ) ) )
2952 std::stringstream hlpSS;
2953 hlpSS <<
"!!! ProSHADE WARNING !!! Will not search for fold " << fold <<
" as the map sampling does not support its reliable detection. Increase resolution/bandwidth if you suspect this fold could be present in the structure.";
2959 this->sphereMappedRotFun.clear();
2962 for ( proshade_double angIt = 1.0; angIt < static_cast < proshade_double > ( fold ); angIt += 1.0 )
2965 soughtAngle = angIt * ( 2.0 * M_PI /
static_cast<proshade_double
> ( fold ) );
2969 M_PI /
static_cast < proshade_double
> ( this->
maxShellBand ),
2973 static_cast < proshade_unsign
> ( angIt - 1.0 ) ) );
2976 this->sphereMappedRotFun.at(
static_cast < size_t > ( angIt - 1.0 ))->interpolateSphereValues ( this->
getInvSO3Coeffs ( ) );
2979 this->sphereMappedRotFun.at(
static_cast < size_t > ( angIt - 1.0 ))->findAllPeaks (
static_cast< proshade_signed
> ( settings->
peakNeighbours ), &allPeakHeights );
2983 std::stringstream hlpSS;
2984 hlpSS <<
"Found a total of " << std::pow (
static_cast< proshade_double
> ( this->
maxShellBand ) * 2.0 * (
static_cast< proshade_double
> ( fold ) - 1.0 ), 2.0 ) -
static_cast< proshade_double
> ( allPeakHeights.size() ) <<
" non-peaks for thresholding.";
2991 std::stringstream hlpSS2;
2992 hlpSS2 <<
"Determined peak threshold " << *peakThres <<
".";
2996 for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
2998 this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( *peakThres );
3002 for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); sphIt++ )
3005 for ( proshade_unsign pkIt = 0; pkIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().size() ); pkIt++ )
3009 for ( proshade_unsign pkGrpIt = 0; pkGrpIt < static_cast<proshade_unsign> ( peakGroups.size() ); pkGrpIt++ )
3011 if ( peakGroups.at(pkGrpIt)->checkIfPeakBelongs (
static_cast< proshade_double
> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first ),
3012 static_cast< proshade_double
> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second ),
3017 if ( !newPeak ) {
continue; }
3021 static_cast< proshade_double
> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second ),
3023 this->sphereMappedRotFun.at(sphIt)->getAngularDim() ) );
3028 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( peakGroups.size() ); grIt++ )
3031 std::stringstream hlpSS3;
3032 hlpSS3 <<
"Now considering group with LAT " << peakGroups.at(grIt)->getLatFromIndices() <<
" - " << peakGroups.at(grIt)->getLatToIndices() <<
" and LON " << peakGroups.at(grIt)->getLonFromIndices() <<
" - " << peakGroups.at(grIt)->getLonToIndices() <<
" spanning spheres ";
3033 for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( peakGroups.at(grIt)->getSpherePositions().size() ); sphIt++ ) { hlpSS3 << peakGroups.at(grIt)->getSpherePositions().at(sphIt) <<
" ; "; }
3040 delete peakGroups.at(grIt);
◆ getAllGroupElements() [1/2]
std::vector< std::vector< proshade_double > > ProSHADE_internal_data::ProSHADE_data::getAllGroupElements |
( |
std::vector< proshade_unsign > |
axesList, |
|
|
std::string |
groupType = "" , |
|
|
proshade_double |
matrixTolerance = 0.05 |
|
) |
| |
This function returns the group elements as rotation matrices of any defined point group.
This function is essentially a wrapper for the overloaded version of this function. The purpose of this function is allow getting point group elements for axes detected in a particular structure.
- Parameters
-
[in] | axesList | A vector of ints specifying which C axes from the full list are members of the group. |
[in] | groupType | An optional string specifying for which symmetry type the group elements are to be computed. Leave empty if you want to use the supplied axes without any questions being asked. |
[in] | matrixTolerance | The maximum allowed trace difference for two matrices to still be considered the same. |
[out] | val | A vector containing a vector of 9 doubles (rotation matrix) for each group element for the requested group. |
Definition at line 3122 of file ProSHADE_data.cpp.
3125 std::vector< std::vector< proshade_double > > hlpVec;
3126 std::vector< proshade_double > hlpVec2;
3130 for (
size_t it2 = 0; it2 < 7; it2++ )
3138 std::vector< std::vector< proshade_double > > ret = this->
getAllGroupElements ( &hlpVec, axesList, groupType, matrixTolerance );
◆ getAllGroupElements() [2/2]
std::vector< std::vector< proshade_double > > ProSHADE_internal_data::ProSHADE_data::getAllGroupElements |
( |
std::vector< std::vector< proshade_double > > * |
allCs, |
|
|
std::vector< proshade_unsign > |
axesList, |
|
|
std::string |
groupType = "" , |
|
|
proshade_double |
matrixTolerance = 0.05 |
|
) |
| |
This function returns the group elements as rotation matrices of any defined point group.
This function generates a list of all point group elements for any group defined by a set of cyclic point groups. The set is supplied using the first parameter for a larger set and the second parameter for specifying a subset of the first parameter set.
This function can generate appropriate elementes for all ProSHADE supported point group types (i.e. C, D, T, O and I) as well as for any supplied set of cyclic point groups (use the groupType value of "X").
Please note that the final set of point group elements will be checked for being a point group, i.e. for the fact that a product of any two members will be another already present member. If this condition is not met, error will be thrown. This poses some issues when the point group axes are slightly off, as this can lead to the point group check failing...
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | axesList | A vector of ints specifying which C axes from the full list are members of the group. |
[in] | groupType | An optional string specifying for which symmetry type the group elements are to be computed. Leave empty if you want to use the supplied axes without any questions being asked. |
[in] | matrixTolerance | The maximum allowed trace difference for two matrices to still be considered the same. |
[out] | val | A vector containing a vector of 9 doubles (rotation matrix) for each group element for the requested group. |
Definition at line 3163 of file ProSHADE_data.cpp.
3166 std::vector<std::vector< proshade_double > > ret;
3169 if ( groupType ==
"C" )
3176 allCs->at(axesList.at(0)).at(2),
3177 allCs->at(axesList.at(0)).at(3),
3178 static_cast< proshade_signed
> ( allCs->at(axesList.at(0)).at(0) ) );
3184 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3187 else if ( groupType ==
"D" )
3194 allCs->at(axesList.at(0)).at(2),
3195 allCs->at(axesList.at(0)).at(3),
3196 static_cast< proshade_signed
> ( allCs->at(axesList.at(0)).at(0) ) );
3199 allCs->at(axesList.at(1)).at(2),
3200 allCs->at(axesList.at(1)).at(3),
3201 static_cast< proshade_signed
> ( allCs->at(axesList.at(1)).at(0) ) );
3210 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3213 else if ( groupType ==
"T" )
3219 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3222 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3223 if ( lhs1.AlmostEquals ( rhs1 ) )
3227 allCs->at(axesList.at(grIt)).at(2),
3228 allCs->at(axesList.at(grIt)).at(3),
3229 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3237 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3240 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3241 if ( lhs1.AlmostEquals ( rhs1 ) )
3245 allCs->at(axesList.at(grIt)).at(2),
3246 allCs->at(axesList.at(grIt)).at(3),
3247 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3258 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3261 else if ( groupType ==
"O" )
3267 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3270 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 4.0 );
3271 if ( lhs1.AlmostEquals ( rhs1 ) )
3275 allCs->at(axesList.at(grIt)).at(2),
3276 allCs->at(axesList.at(grIt)).at(3),
3277 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3285 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3288 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3289 if ( lhs1.AlmostEquals ( rhs1 ) )
3293 allCs->at(axesList.at(grIt)).at(2),
3294 allCs->at(axesList.at(grIt)).at(3),
3295 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3303 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3306 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3307 if ( lhs1.AlmostEquals ( rhs1 ) )
3311 allCs->at(axesList.at(grIt)).at(2),
3312 allCs->at(axesList.at(grIt)).at(3),
3313 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3324 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3327 else if ( groupType ==
"I" )
3333 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3336 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 5.0 );
3337 if ( lhs1.AlmostEquals ( rhs1 ) )
3341 allCs->at(axesList.at(grIt)).at(2),
3342 allCs->at(axesList.at(grIt)).at(3),
3343 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3351 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3354 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3355 if ( lhs1.AlmostEquals ( rhs1 ) )
3359 allCs->at(axesList.at(grIt)).at(2),
3360 allCs->at(axesList.at(grIt)).at(3),
3361 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3369 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3372 const FloatingPoint< proshade_double > lhs1 ( allCs->at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3373 if ( lhs1.AlmostEquals ( rhs1 ) )
3377 allCs->at(axesList.at(grIt)).at(2),
3378 allCs->at(axesList.at(grIt)).at(3),
3379 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3390 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3393 else if ( groupType ==
"X" )
3396 for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3400 allCs->at(axesList.at(grIt)).at(2),
3401 allCs->at(axesList.at(grIt)).at(3),
3402 static_cast< proshade_signed
> ( allCs->at(axesList.at(grIt)).at(0) ) );
3412 throw ProSHADE_exception (
"Computed point group elements do not form a group.",
"ES00060", __FILE__, __LINE__, __func__,
"The supplied cyclic groups list does not form a group and\n : therefore such group's elements cannot be obtained. Please\n : check the cyclic groups list supplied to the\n : getAllGroupElements() function." );
3417 std::stringstream hlpSS;
3418 hlpSS <<
"Unknown symmetry type: >" << groupType <<
"<";
3419 throw ProSHADE_exception ( hlpSS.str().c_str(),
"ES00058", __FILE__, __LINE__, __func__,
"Function getAllGroupElements was called with symmetry type\n : value outside of the allowed values C, D, T, O, I\n : or empty for using all supplied axes." );
◆ getAnySphereRadius()
proshade_double ProSHADE_internal_data::ProSHADE_data::getAnySphereRadius |
( |
proshade_unsign |
shell | ) |
|
This function allows access to the radius of any particular sphere.
- Parameters
-
[out] | X | The distance of the requested sphere to the centre of the coordinates. |
Definition at line 3915 of file ProSHADE_data.cpp.
3918 return ( this->
spheres[shell]->getShellRadius() );
◆ getBestRotationMapPeaksEulerAngles()
std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::getBestRotationMapPeaksEulerAngles |
( |
ProSHADE_settings * |
settings | ) |
|
This function returns a vector of three floats, the three Euler angles of the best peak in the rotation map.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map overlay. |
[out] | val | A vector of the Euler angles of the best peak in the rotation function map. |
Definition at line 1496 of file ProSHADE_overlay.cpp.
1499 std::vector < proshade_double > ret;
1500 proshade_double eulA, eulB, eulG;
1505 &eulA, &eulB, &eulG, settings );
◆ getBestTranslationMapPeaksAngstrom()
This function gets the optimal translation vector and returns it as a standard library vector. It also applies the translation to the internal map.
- Parameters
-
[in] | staticStructure | A pointer to the data class object of the other ( static ) structure. |
[out] | X | A vector of doubles with the optimal translation vector in Angstroms. |
Definition at line 250 of file ProSHADE_overlay.cpp.
253 std::vector< proshade_double > ret;
254 proshade_double mapPeak = 0.0;
255 proshade_unsign xDimS = staticStructure->
getXDim();
256 proshade_unsign yDimS = staticStructure->
getYDim();
257 proshade_unsign zDimS = staticStructure->
getZDim();
258 proshade_double trsX = 0.0, trsY = 0.0, trsZ = 0.0;
269 if ( trsX > (
static_cast< proshade_double
> ( xDimS ) / 2.0 ) ) { trsX = trsX -
static_cast< proshade_double
> ( xDimS ); }
270 if ( trsY > (
static_cast< proshade_double
> ( yDimS ) / 2.0 ) ) { trsY = trsY -
static_cast< proshade_double
> ( yDimS ); }
271 if ( trsZ > (
static_cast< proshade_double
> ( zDimS ) / 2.0 ) ) { trsZ = trsZ -
static_cast< proshade_double
> ( zDimS ); }
280 proshade_single xMov =
static_cast< proshade_single
> ( -trsX );
281 proshade_single yMov =
static_cast< proshade_single
> ( -trsY );
282 proshade_single zMov =
static_cast< proshade_single
> ( -trsZ );
303 static_cast< proshade_signed
> ( this->
getXDim() ),
static_cast< proshade_signed
> ( this->
getYDim() ),
static_cast< proshade_signed
> ( this->
getZDim() ) );
◆ getCyclicAxes()
std::vector< proshade_double * > * ProSHADE_internal_data::ProSHADE_data::getCyclicAxes |
( |
void |
| ) |
|
This function allows access to the list of detected cyclic axes.
- Parameters
-
[out] | cyclicSymmetries | Vector of the cyclic axes detected in the structure. |
Definition at line 4239 of file ProSHADE_data.cpp.
◆ getCyclicAxesCopy()
std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getCyclicAxesCopy |
( |
void |
| ) |
|
This function allows access to the list of detected cyclic axes in non-overwrite fashion.
- Parameters
-
[out] | cyclicSymmetries | Vector of the cyclic axes detected in the structure. |
Definition at line 4251 of file ProSHADE_data.cpp.
4254 std::vector< proshade_double* > ret;
◆ getCyclicSymmetriesListFromAngleAxis()
std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getCyclicSymmetriesListFromAngleAxis |
( |
ProSHADE_settings * |
settings | ) |
|
This function obtains a list of all C symmetries from the angle-axis space mapped rotation function values.
This function oversees the full search for cyclic point groups in the self-rotation function. It starts with finding all prime numbers up to the user specified limit. It then checks for each of the prime numbers whether there is a cyclic point group with fold equal to the prime number.
If any such point groups are found, the function searches for nultiples of these folds, making use of the fact that any structure with cyclic point group of fold n must also contain a point group of fold n/2 if n/2 is an integer. In this manner, cyclic point group with any fold can be found using a small number of specific fold searches, thus eliminating the need to determine which folds should be considered.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[out] | ret | A vector of arrays containing all detected cyclic point groups in the standard ProSHADE format, i.e. [0] = fold, [1] = x-axis, [2] = y-axis, [3] = z-axis, [4] = angle, [5] = average peak height. |
Definition at line 2656 of file ProSHADE_symmetry.cpp.
2660 std::vector< proshade_double* > ret, tmpHolder;
2661 std::vector< proshade_unsign > testedFolds;
2662 proshade_double symThres;
2663 proshade_unsign foldToTest, rotationNumber;
2664 bool foldDone, anyNewSyms =
true;
2667 fftw_complex* fCoeffsCut;
2668 proshade_double **bindata, *fscByBin;
2669 proshade_signed *cutIndices, *binCounts, noBins, cutXDim, cutYDim, cutZDim;
2673 for ( proshade_unsign prIt = 0; prIt < static_cast< proshade_unsign > ( primes.size() ); prIt++ )
2676 std::stringstream hlpSS;
2677 hlpSS <<
"Searching for prime fold symmetry C" << primes.at(prIt) <<
".";
2685 std::vector< proshade_signed > divisAll;
2687 for ( proshade_unsign pfIt = primes.at(prIt) + 4; pfIt >= ( std::max ( primes.at(prIt) - 4, settings->
supportedSymmetryFold ) ); pfIt-- )
2689 if ( pfIt == primes.at(prIt) ) {
continue; }
2690 if ( pfIt < 2 ) {
continue; }
2696 std::vector< proshade_double > prevRots;
2697 for (
size_t fIt = 0; fIt < divisAll.size(); fIt++ ) {
for (
size_t rIt = 1; rIt < static_cast< size_t > ( divisAll.at(fIt) - 1 ); rIt++ ) {
ProSHADE_internal_misc::addToDoubleVector ( &prevRots, ( ( 2.0 * M_PI ) /
static_cast< proshade_double
> ( divisAll.at(fIt) ) ) *
static_cast< proshade_double
> ( rIt ) ); } }
2700 proshade_unsign bestPos = 1;
2701 proshade_double bestDist = 0.0;
2702 proshade_double curPos = 0.0;
2703 proshade_double bestDistHlp;
2706 for ( proshade_unsign fIt = 2; fIt <= static_cast< proshade_unsign >( ( primes.at(prIt) + 1 ) / 2 ); fIt++ )
2709 curPos = ( ( 2.0 * M_PI ) /
static_cast< proshade_double
> ( primes.at(prIt) ) ) *
static_cast< proshade_double
> ( fIt );
2710 bestDistHlp = std::numeric_limits < proshade_double >::infinity();
2713 for ( proshade_unsign dIt = 0; dIt < static_cast< proshade_unsign > ( prevRots.size() ); dIt++ ) {
if ( std::abs ( prevRots.at(dIt) - curPos ) < bestDistHlp ) { bestDistHlp = std::abs ( prevRots.at(dIt) - curPos ); } }
2716 if ( bestDistHlp > bestDist ) { bestDist = bestDistHlp; bestPos = fIt; }
2719 rotationNumber = bestPos;
2720 if ( rotationNumber >= ( primes.at(prIt) - 1 ) ) { rotationNumber = 1; }
2727 for (
size_t axIt = 0; axIt < prSyms.size(); axIt++ )
2730 if ( prSyms.at(axIt)[5] >= std::max ( symThres, settings->
minSymPeak ) )
2736 this->
computeFSC ( settings, prSyms.at(axIt), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim, rotationNumber );
2741 prSyms.at(axIt)[6] = -std::numeric_limits < proshade_double >::infinity();
2742 this->
computeFSC ( settings, prSyms.at(axIt), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim, 0 );
2751 delete[] prSyms.at(axIt);
2756 if ( ret.size() < 1 ) {
return ( ret ); }
2760 proshade_double dotProduct = 0.0;
2763 while ( anyNewSyms )
2769 for ( proshade_unsign axIt1 = 0; axIt1 < static_cast< proshade_unsign > ( ret.size() ); axIt1++ )
2772 if ( bestFSCPeakStart > ret.at(axIt1)[6] ) {
continue; }
2774 for ( proshade_unsign axIt2 = 0; axIt2 < static_cast< proshade_unsign > ( ret.size() ); axIt2++ )
2777 if ( bestFSCPeakStart > ret.at(axIt2)[6] ) {
continue; }
2789 &ret.at(axIt2)[3] );
2790 if ( std::abs ( dotProduct ) < ( 1.0 - settings->
axisErrTolerance ) ) {
continue; }
2793 foldToTest =
static_cast< proshade_unsign
> ( ret.at(axIt1)[0] * ret.at(axIt2)[0] );
2800 std::vector< proshade_signed > divisAll;
2803 for (
size_t iter = 0; iter < ret.size(); iter++ ) {
if ( ret.at(iter)[6] > ( bestFSCPeakStart * 0.9 ) ) {
ProSHADE_internal_misc::addToSignedVector ( &divisAll,
static_cast< proshade_signed
> ( ret.at(iter)[0] ) ); } }
2806 std::vector< proshade_double > prevRots;
2807 for (
size_t fIt = 0; fIt < divisAll.size(); fIt++ ) {
for (
size_t rIt = 1; rIt < static_cast< size_t > ( divisAll.at(fIt) - 1 ); rIt++ ) {
ProSHADE_internal_misc::addToDoubleVector ( &prevRots, ( ( 2.0 * M_PI ) /
static_cast< proshade_double
> ( divisAll.at(fIt) ) ) *
static_cast< proshade_double
> ( rIt ) ); } }
2810 proshade_unsign bestPos = 1;
2811 proshade_double bestDist = 0.0;
2812 proshade_double curPos = 0.0;
2813 proshade_double bestDistHlp;
2816 for ( proshade_unsign fIt = 2; fIt <= static_cast< proshade_unsign >( foldToTest / 2 ); fIt++ )
2819 curPos = ( ( 2.0 * M_PI ) /
static_cast< proshade_double
> ( foldToTest ) ) *
static_cast< proshade_double
> ( fIt );
2820 bestDistHlp = std::numeric_limits < proshade_double >::infinity();
2823 for ( proshade_unsign dIt = 0; dIt < static_cast< proshade_unsign > ( prevRots.size() ); dIt++ ) {
if ( std::abs ( prevRots.at(dIt) - curPos ) < bestDistHlp ) { bestDistHlp = std::abs ( prevRots.at(dIt) - curPos ); } }
2826 if ( bestDistHlp > bestDist ) { bestDist = bestDistHlp; bestPos = fIt; }
2829 rotationNumber = bestPos;
2830 if ( rotationNumber >= ( foldToTest - 1 ) ) { rotationNumber = 1; }
2835 for ( proshade_unsign fIt = 0; fIt < static_cast< proshade_unsign > ( testedFolds.size() ); fIt++ ) {
if ( testedFolds.at(fIt) == foldToTest ) { foldDone =
true;
break; } }
2836 if ( foldDone ) {
continue; }
2840 std::stringstream hlpSS2;
2841 hlpSS2 <<
"Searching for fold combination of detected folds " << ret.at(axIt1)[0] <<
" and " << ret.at(axIt2)[0] <<
", i.e. C" << foldToTest <<
".";
2848 for (
size_t newAxIt = 0; newAxIt < prSyms.size(); newAxIt++ )
2851 if ( prSyms.at(newAxIt)[5] >= symThres )
2858 this->
computeFSC ( settings, prSyms.at(newAxIt), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim, rotationNumber );
2861 if ( ( foldToTest >= settings->
supportedSymmetryFold ) || ( prSyms.at(newAxIt)[6] >= bestFSCPeakStart ) )
2863 prSyms.at(newAxIt)[6] = -std::numeric_limits < proshade_double >::infinity();
2864 this->
computeFSC ( settings, prSyms.at(newAxIt), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim, 0 );
2873 delete[] prSyms.at(newAxIt);
2877 if ( tmpHolder.size() != 0 )
2880 for ( proshade_unsign tmpIt = 0; tmpIt < static_cast< proshade_unsign > ( tmpHolder.size() ); tmpIt++ )
2883 delete[] tmpHolder.at(tmpIt);
2890 tmpHolder.clear ( );
2896 for (
size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) {
delete[] bindata[binIt]; }
2900 delete[] cutIndices;
2901 fftw_free ( fCoeffsCut );
◆ getDihedralAxes()
std::vector< std::vector< proshade_double * > > * ProSHADE_internal_data::ProSHADE_data::getDihedralAxes |
( |
void |
| ) |
|
This function allows access to the list of detected dihedral axes.
- Parameters
-
[out] | dihedralSymmetries | Vector of vectors containing the list of detected dihedral symmetries. |
Definition at line 4271 of file ProSHADE_data.cpp.
◆ getDihedralAxesCopy()
std::vector< std::vector< proshade_double * > > ProSHADE_internal_data::ProSHADE_data::getDihedralAxesCopy |
( |
void |
| ) |
|
This function allows access to the list of detected dihedral axes in a non-over-write fashion.
- Parameters
-
[out] | dihedralSymmetries | Vector of vectors containing the list of detected dihedral symmetries. |
Definition at line 4282 of file ProSHADE_data.cpp.
4285 std::vector< std::vector< proshade_double* > > ret;
4290 std::vector< proshade_double* > hlpVec;
◆ getDihedralSymmetriesList()
void ProSHADE_internal_data::ProSHADE_data::getDihedralSymmetriesList |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double * > * |
CSymList |
|
) |
| |
This function obtains a list of all D symmetries from already computed C symmetries list.
This function simply returns a vector of C symmetry pairs which are perpendicular to each other (and therefore form dihedral symmetry). The vector contains arrays of 12 double numbers with the following format: [0] = Fold of axis 1; [1] = X-axis of axis 1; [2] Y-axis of axis 1; [3] = Z-axis of axis 1; [4] = angle of axis 1; [5] = average peak height of axis 1; [6] = Fold of axis 2; [7] = X-axis of axis 2; [8] Y-axis of axis 2; [9] = Z-axis of axis 2; [10] = angle of axis 2; [11] = average peak height of axis 2. Note that the larger fold axis is listed first in this format.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[in] | CSymList | Vector of double pointers to the list of axes in which the detection of dihedral symmetries is to be done. |
Definition at line 317 of file ProSHADE_symmetry.cpp.
320 proshade_double dotProduct;
326 if ( CSymList->size() < 2 ) { return ; }
329 for ( proshade_unsign ax1 = 0; ax1 < static_cast<proshade_unsign> ( CSymList->size() ); ax1++ )
332 const FloatingPoint< proshade_double > lhs1 ( CSymList->at(ax1)[5] ), rhs1 ( -999.9 );
333 if ( ( CSymList->at(ax1)[5] < settings->
minSymPeak ) && !( lhs1.AlmostEquals ( rhs1 ) ) ) {
continue; }
335 for ( proshade_unsign ax2 = 1; ax2 < static_cast<proshade_unsign> ( CSymList->size() ); ax2++ )
338 if ( ax1 >= ax2 ) {
continue; }
341 const FloatingPoint< proshade_double > lhs2 ( CSymList->at(ax2)[5] ), rhs2 ( -999.9 );
342 if ( ( CSymList->at(ax2)[5] < settings->
minSymPeak ) && !( lhs2.AlmostEquals ( rhs2 ) ) ) {
continue; }
346 &CSymList->at(ax1)[3], &CSymList->at(ax2)[1],
347 &CSymList->at(ax2)[2], &CSymList->at(ax2)[3] );
353 if ( CSymList->at(ax1)[0] >= CSymList->at(ax2)[0] )
355 std::vector< proshade_double* > hlpVec;
357 proshade_double* hlpSym =
new proshade_double[7];
359 for (
size_t iter = 0; iter < 7; iter++ ) { hlpSym[iter] = CSymList->at(ax1)[iter]; }
362 proshade_double* hlpSym2 =
new proshade_double[7];
364 for (
size_t iter = 0; iter < 7; iter++ ) { hlpSym2[iter] = CSymList->at(ax2)[iter]; }
371 std::vector< proshade_double* > hlpVec;
373 proshade_double* hlpSym =
new proshade_double[7];
375 for (
size_t iter = 0; iter < 7; iter++ ) { hlpSym[iter] = CSymList->at(ax2)[iter]; }
378 proshade_double* hlpSym2 =
new proshade_double[7];
380 for (
size_t iter = 0; iter < 7; iter++ ) { hlpSym2[iter] = CSymList->at(ax1)[iter]; }
390 std::stringstream hlpSS;
◆ getEMatDim()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getEMatDim |
( |
void |
| ) |
|
This function allows access to the maximum band for the E matrix.
- Parameters
-
[out] | X | The bandwidth used for the E matrix size (smaller of the two bands). |
Definition at line 4014 of file ProSHADE_data.cpp.
◆ getEMatrixByBand()
proshade_complex ** ProSHADE_internal_data::ProSHADE_data::getEMatrixByBand |
( |
proshade_unsign |
band | ) |
|
This function allows access to E matrix for a particular band.
- Parameters
-
[in] | band | The band for which the E matrix subset order * order should be returned. |
[out] | X | Pointer to pointer of complex matrix with dimensions order * order of the E matrices. |
Definition at line 3962 of file ProSHADE_data.cpp.
◆ getEMatrixValue()
void ProSHADE_internal_data::ProSHADE_data::getEMatrixValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
order1, |
|
|
proshade_unsign |
order2, |
|
|
proshade_double * |
valueReal, |
|
|
proshade_double * |
valueImag |
|
) |
| |
This function allows access to E matrix by knowing the band, order1 and order2 indices.
- Parameters
-
[in] | band | The band for which the E matrix value should be returned. |
[in] | order1 | The first order for which the E matrix value should be returned. |
[in] | order2 | The second order for which the E matrix value should be returned. |
[in] | valueReal | The proshade_double number pointer to where the real part of the value will be saved. |
[in] | valueImag | The proshade_double number pointer to where the imaginary part of the value will be saved. |
Definition at line 3977 of file ProSHADE_data.cpp.
3980 *valueReal = this->
eMatrices[band][order1][order2][0];
3981 *valueImag = this->
eMatrices[band][order1][order2][1];
◆ getImagEMatrixValuesForLM()
void ProSHADE_internal_data::ProSHADE_data::getImagEMatrixValuesForLM |
( |
proshade_signed |
band, |
|
|
proshade_signed |
order1, |
|
|
double * |
eMatsLMImag, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the imaginary E matrix values for particular band and order1 (l as opposed to l').
- Parameters
-
[in] | band | The band for which the imaginary E matrix values are requested. |
[in] | order | The order for which the imaginary E matrix values are requested. |
[in] | eMatsLMImag | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4426 of file ProSHADE_data.cpp.
4429 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4431 eMatsLMImag[iter] =
static_cast<double> ( this->
eMatrices[band][order1][iter][1] );
◆ getImagRotFunction()
void ProSHADE_internal_data::ProSHADE_data::getImagRotFunction |
( |
double * |
rotFunImag, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the imaginary rotation function values.
- Parameters
-
[in] | rotFunImag | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4513 of file ProSHADE_data.cpp.
4516 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4518 rotFunImag[iter] =
static_cast<double> ( this->
so3CoeffsInverse[iter][1] );
◆ getImagSO3Coeffs()
void ProSHADE_internal_data::ProSHADE_data::getImagSO3Coeffs |
( |
double * |
so3CoefsImag, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the imaginary SO(3) coefficient values.
- Parameters
-
[in] | so3CoefsImag | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4462 of file ProSHADE_data.cpp.
4465 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4467 so3CoefsImag[iter] =
static_cast<double> ( this->
so3Coeffs[iter][1] );
◆ getImagSphHarmValue()
proshade_double * ProSHADE_internal_data::ProSHADE_data::getImagSphHarmValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
order, |
|
|
proshade_unsign |
shell |
|
) |
| |
This function allows access to the private internal imaginary spherical harmonics values.
- Parameters
-
[in] | band | The l for which the spherical harmonics value is to be retrieved. |
[in] | order | The m for which the spherical harmonics value is to be retrieved. |
[in] | shell | The shell for which the spherical harmonics value is to be retrieved. |
[in] | locBand | The bandwidth to which this shell was computed to. |
[out] | X | Pointer to the value of the internal private spherical harmonics imaginary value of the given index. |
Definition at line 3902 of file ProSHADE_data.cpp.
3905 return ( &this->
sphericalHarmonics[shell][seanindex (
static_cast< int > ( order ) -
static_cast< int > ( band ),
3906 static_cast< int > ( band ),
3907 static_cast< int > ( this->
spheres[shell]->getLocalBandwidth() ) )][1] );
◆ getImagTranslationFunction()
void ProSHADE_internal_data::ProSHADE_data::getImagTranslationFunction |
( |
double * |
trsFunImag, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the imaginary translation function values.
- Parameters
-
[in] | trsFunImag | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4549 of file ProSHADE_data.cpp.
4552 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4554 trsFunImag[iter] =
static_cast<double> ( this->
translationMap[iter][1] );
◆ getIntegrationWeight()
proshade_double ProSHADE_internal_data::ProSHADE_data::getIntegrationWeight |
( |
void |
| ) |
|
This function allows access to the integration weight for the object.
- Parameters
-
[out] | X | The integration weight for the object or 0.0 if not yet computed. |
Definition at line 3926 of file ProSHADE_data.cpp.
◆ getInternalMap()
proshade_double *& ProSHADE_internal_data::ProSHADE_data::getInternalMap |
( |
void |
| ) |
|
This function allows access to the first map array value address.
- Parameters
-
[out] | internalMap | Pointer to the first position in the internal map array. |
Definition at line 4198 of file ProSHADE_data.cpp.
◆ getInvSO3Coeffs()
proshade_complex * ProSHADE_internal_data::ProSHADE_data::getInvSO3Coeffs |
( |
void |
| ) |
|
This function allows access to the inverse SO(3) coefficients array.
- Parameters
-
[out] | X | The internal inverse SO(3) coefficients array variable. |
Definition at line 3992 of file ProSHADE_data.cpp.
◆ getMapCOMProcessChange()
std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::getMapCOMProcessChange |
( |
void |
| ) |
|
This function allows access to the translation caused by structure processing.
- Parameters
-
[out] | mapCOMProcessChange | Vector of the distances in Angstroms that the structure has been moved internally. |
Definition at line 4220 of file ProSHADE_data.cpp.
4223 std::vector< proshade_double > ret;
◆ getMapValue()
proshade_double ProSHADE_internal_data::ProSHADE_data::getMapValue |
( |
proshade_unsign |
pos | ) |
|
This function returns the internal map representation value of a particular array position.
- Parameters
-
[in] | pos | The position in the map array, of which the value should be returned. |
[out] | X | The internal map representation value at position pos. |
Definition at line 3738 of file ProSHADE_data.cpp.
◆ getMaxBand()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxBand |
( |
void |
| ) |
|
This function returns the maximum band value for the object.
- Parameters
-
[out] | X | The largest number of bands used in any shell of the object. |
Definition at line 3748 of file ProSHADE_data.cpp.
◆ getMaxSpheres()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxSpheres |
( |
void |
| ) |
|
This function returns the number of spheres which contain the whole object.
- Parameters
-
[out] | X | The total number of spheres to which the structure is mapped. |
Definition at line 3727 of file ProSHADE_data.cpp.
◆ getNoRecommendedSymmetryAxes()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getNoRecommendedSymmetryAxes |
( |
void |
| ) |
|
This function returns the number of detected recommended symmetry axes.
- Parameters
-
[out] | val | The length of the recommended symmetry axes vector. |
Definition at line 4638 of file ProSHADE_data.cpp.
◆ getOverlayRotationFunction()
This function computes the overlay rotation function (i.e. the correlation function in SO(3) space).
This function assumes it is called from the object to which the rotation function is to be assigned to (presumably the moving rather than static structure). It starts by computing the E matrices, normalising these using the Patterson-like normalisation, generating SO(3) coefficients from the E matrices and finally computing their inverse SOFT transform to get the rotation function.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | obj2 | A pointer to the data class object of the other ( static ) structure. |
Definition at line 35 of file ProSHADE_overlay.cpp.
◆ getPredictedIcosahedralSymmetriesList()
void ProSHADE_internal_data::ProSHADE_data::getPredictedIcosahedralSymmetriesList |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double * > * |
CSymList, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function predicts a list of all I symmetry axes from the already computed C symmetries list.
This function starts by checking if there is a pair of C3 and C5 symmetries with the icosahedron dihedral angle ( acos( std::sqrt ( ( 1.0 + 2.0 / std::sqrt ( 5.0 ) ) / 3.0 ) ) ). If found, it calls the predictIcosAxes() function, which uses the knowledge of the two axes (C5 and C3) which are closest to the dihedral angle to find the best rotation matrix matching a pre-computed icosahedron model to the detected axes. After rotating the model, the model axes become the predicted axes for the structure and their peak heights are then computed. Once complete, all the predicted axes are in the ret variable.
- Warning
- This function does not check if the correct number of C axes was found, it is assumed this will be checked when the determination of which symmetry was found.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[in] | CSymList | A vector of double pointers containing the list of axes on which the icosahedral symmetry detection is to be attempted. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 1749 of file ProSHADE_symmetry.cpp.
1752 std::vector< std::vector< proshade_double* > > hlpVec;
1764 for (
size_t pIt = 0; pIt < hlpVec.size(); pIt++ )
1772 this->
icosahedralSymmetries =
ProSHADE_data::decidePolyFromList ( settings, &hlpVec, 31, CSymList, settings->
axisErrTolerance, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
1775 for (
size_t gIt = 0; gIt < hlpVec.size(); gIt++ ) {
for (
size_t aIt = 0; aIt < hlpVec.at(gIt).size(); aIt++ ) {
if ( hlpVec.at(gIt).at(aIt) !=
nullptr ) {
delete[] hlpVec.at(gIt).at(aIt); } } }
◆ getPredictedOctahedralSymmetriesList()
void ProSHADE_internal_data::ProSHADE_data::getPredictedOctahedralSymmetriesList |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double * > * |
CSymList, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function predicts a list of all O symmetry axes from the already computed C symmetries list.
This function starts by checking if there is a pair of C3 and C4 symmetries with the octahedron dihedral angle ( acos( ( 1.0 / sqrt ( 3.0 ) ) ) ). If found, it calls the predictOctaAxes() function, which uses the knowledge of the two axes (C4 and C3) which are closest to the dihedral angle to find the best rotation matrix matching a pre-computed octahedron model to the detected axes. After rotating the model, the model axes become the predicted axes for the structure and their peak heights are then computed. Once complete, all the predicted axes are in the ret variable.
- Warning
- This function does not check if the correct number of C axes was found, it is assumed this will be checked when the determination of which symmetry was found.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[in] | CSymList | A vector of double pointers containing the list of axes on which the octahedral symmetry detection is to be attempted. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 1807 of file ProSHADE_symmetry.cpp.
1810 std::vector< std::vector< proshade_double* > > hlpVec;
1822 for (
size_t pIt = 0; pIt < hlpVec.size(); pIt++ )
1830 this->
octahedralSymmetries =
ProSHADE_data::decidePolyFromList ( settings, &hlpVec, 13, CSymList, settings->
axisErrTolerance, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
1833 for (
size_t gIt = 0; gIt < hlpVec.size(); gIt++ ) {
for (
size_t aIt = 0; aIt < hlpVec.at(gIt).size(); aIt++ ) {
if ( hlpVec.at(gIt).at(aIt) !=
nullptr ) {
delete[] hlpVec.at(gIt).at(aIt); } } }
◆ getPredictedTetrahedralSymmetriesList()
void ProSHADE_internal_data::ProSHADE_data::getPredictedTetrahedralSymmetriesList |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double * > * |
CSymList, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function predicts a list of all T symmetry axes from the already computed C symmetries list.
This function starts by checking if there is a pair of C3 and C2 symmetries with the tetrahedron dihedral angle ( acos( ( 1.0 / sqrt ( 3.0 ) ) ). If found, it calls the predictTetraAxes() function, which uses the knowledge of the two axes (C3 and C2) which are closest to the dihedral angle to find the best rotation matrix matching a pre-computed tetrhedron model to the detected axes. After rotating the model, the model axes become the predicted axes for the structure and their peak heights are then computed. Once complete, all the predicted axes are in the ret variable.
- Warning
- This function does not check if the correct number of C axes was found, it is assumed this will be checked when the determination of which symmetry was found.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for symmetry detection. |
[in] | CSymList | Vector of double pointers containing the list of axes on which the tetrahedral symmetry detection is to be attempted. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 3553 of file ProSHADE_symmetry.cpp.
3556 std::vector< std::vector< proshade_double* > > hlpVec;
3568 for (
size_t pIt = 0; pIt < hlpVec.size(); pIt++ )
3576 this->
tetrahedralSymmetries =
ProSHADE_data::decidePolyFromList ( settings, &hlpVec, 7, CSymList, settings->
axisErrTolerance, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
3579 for (
size_t gIt = 0; gIt < hlpVec.size(); gIt++ ) {
for (
size_t aIt = 0; aIt < hlpVec.at(gIt).size(); aIt++ ) {
if ( hlpVec.at(gIt).at(aIt) !=
nullptr ) {
delete[] hlpVec.at(gIt).at(aIt); } } }
◆ getRealEMatrixValuesForLM()
void ProSHADE_internal_data::ProSHADE_data::getRealEMatrixValuesForLM |
( |
proshade_signed |
band, |
|
|
proshade_signed |
order1, |
|
|
double * |
eMatsLMReal, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the real E matrix values for particular band and order1 (l as opposed to l').
- Parameters
-
[in] | band | The band for which the real E matrix values are requested. |
[in] | order | The order for which the real E matrix values are requested. |
[in] | eMatsLMReal | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4406 of file ProSHADE_data.cpp.
4409 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4411 eMatsLMReal[iter] =
static_cast<double> ( this->
eMatrices[band][order1][iter][0] );
◆ getRealRotFunction()
void ProSHADE_internal_data::ProSHADE_data::getRealRotFunction |
( |
double * |
rotFunReal, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the real rotation function values.
- Parameters
-
[in] | rotFunReal | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4495 of file ProSHADE_data.cpp.
4498 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4500 rotFunReal[iter] =
static_cast<double> ( this->
so3CoeffsInverse[iter][0] );
◆ getRealSO3Coeffs()
void ProSHADE_internal_data::ProSHADE_data::getRealSO3Coeffs |
( |
double * |
so3CoefsReal, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the real SO(3) coefficient values.
- Parameters
-
[in] | so3CoefsReal | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4444 of file ProSHADE_data.cpp.
4447 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4449 so3CoefsReal[iter] =
static_cast<double> ( this->
so3Coeffs[iter][0] );
◆ getRealSphHarmValue()
proshade_double * ProSHADE_internal_data::ProSHADE_data::getRealSphHarmValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
order, |
|
|
proshade_unsign |
shell |
|
) |
| |
This function allows access to the private internal real spherical harmonics values.
- Parameters
-
[in] | band | The l for which the spherical harmonics value is to be retrieved. |
[in] | order | The m for which the spherical harmonics value is to be retrieved. |
[in] | shell | The shell for which the spherical harmonics value is to be retrieved. |
[in] | locBand | The bandwidth to which this shell was computed to. |
[out] | X | Pointer to the value of the internal private spherical harmonics real value of the given index. |
Definition at line 3885 of file ProSHADE_data.cpp.
3888 return ( &this->
sphericalHarmonics[shell][seanindex (
static_cast< int > ( order ) -
static_cast< int > ( band ),
3889 static_cast< int > ( band ),
3890 static_cast< int > ( this->
spheres[shell]->getLocalBandwidth() ) )][0] );
◆ getRealTranslationFunction()
void ProSHADE_internal_data::ProSHADE_data::getRealTranslationFunction |
( |
double * |
trsFunReal, |
|
|
int |
len |
|
) |
| |
This function fills the input array with the real translation function values.
- Parameters
-
[in] | trsFunReal | The array to which the values will be written into. |
[in] | len | The lenght of the array. |
Definition at line 4531 of file ProSHADE_data.cpp.
4534 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4536 trsFunReal[iter] =
static_cast<double> ( this->
translationMap[iter][0] );
◆ getReBoxBoundaries()
void ProSHADE_internal_data::ProSHADE_data::getReBoxBoundaries |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_signed *& |
ret |
|
) |
| |
This function finds the boundaries enclosing positive map values and adds some extra space.
This function firstly finds the boundaries which enclose the positive map values and then it proceeds to add a given amount of space to all dimensions (positive and negative) to make sure the map does not end exactly at the bounds. It returns the new boundaries in the ret variable if they are smaller than the original bounds, or just the original bounds in case decrease was not achieved.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
[in] | ret | A pointer to proshade_signed array of 6 storing the results - (0 = minX; 1 = maxX; 2 = minY; 3 = maxY; 4 - minZ; 5 = maxZ). |
Definition at line 1352 of file ProSHADE_data.cpp.
1360 for ( proshade_unsign iter = 0; iter < 6; iter++ ) { ret[iter] = settings->
forceBounds[iter]; }
1367 static_cast< proshade_signed
> ( this->
xDimIndices ),
1368 static_cast< proshade_signed
> ( this->
yDimIndices ),
1369 static_cast< proshade_signed
> ( this->
zDimIndices ),
1380 std::stringstream ssHlp;
1381 ssHlp <<
"New boundaries are: " << ret[1] - ret[0] + 1 <<
" x " << ret[3] - ret[2] + 1 <<
" x " << ret[5] - ret[4] + 1;
1387 for ( proshade_unsign iter = 0; iter < 6; iter++ ) { settings->
forceBounds[iter] = ret[iter]; }
◆ getRotMatrixFromRotFunInds()
void ProSHADE_internal_data::ProSHADE_data::getRotMatrixFromRotFunInds |
( |
proshade_signed |
aI, |
|
|
proshade_signed |
bI, |
|
|
proshade_signed |
gI, |
|
|
double * |
rotMat, |
|
|
int |
len |
|
) |
| |
This function takes rotation function indices, converts them to Euler angles and these to rotation matrix, which it then returns.
- Parameters
-
[in] | aI | The index along the Euler alpha dimension. |
[in] | bI | The index along the Euler beta dimension. |
[in] | gI | The index along the Euler gamma dimension. |
[in] | rotMat | The array to which the rotation matrix will be written into. |
[in] | len | The lenght of the array (must be 9). |
Definition at line 4570 of file ProSHADE_data.cpp.
4573 proshade_double eA, eB, eG;
4577 proshade_double* rMat =
nullptr;
4578 rMat =
new proshade_double[9];
4585 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4587 rotMat[iter] =
static_cast<double> ( rMat[iter] );
◆ getRRPValue()
proshade_double ProSHADE_internal_data::ProSHADE_data::getRRPValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
sh1, |
|
|
proshade_unsign |
sh2 |
|
) |
| |
This function allows access to the priva internal RRP matrices.
- Parameters
-
[out] | X | The value of the internal private RRP matrix for the given indices. |
Definition at line 3758 of file ProSHADE_data.cpp.
◆ getShellBandwidth()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getShellBandwidth |
( |
proshade_unsign |
shell | ) |
|
This function allows access to the bandwidth of a particular shell.
- Parameters
-
[in] | shell | The index of the shell for which the bandwidth is required. |
[out] | X | The bandwidth of the requested shell. |
Definition at line 3938 of file ProSHADE_data.cpp.
3941 return ( this->
spheres[shell]->getLocalBandwidth ( ) );
◆ getSO3Coeffs()
proshade_complex * ProSHADE_internal_data::ProSHADE_data::getSO3Coeffs |
( |
void |
| ) |
|
This function allows access to the SO(3) coefficients array.
- Parameters
-
[out] | X | The internal SO(3) coefficients array variable. |
Definition at line 4003 of file ProSHADE_data.cpp.
◆ getSpherePositions()
void ProSHADE_internal_data::ProSHADE_data::getSpherePositions |
( |
ProSHADE_settings * |
settings | ) |
|
This function determines the sphere positions (radii) for sphere mapping.
This function determines the radii of the concentric spheres (as measured from the centre of the map). This is done by checking if these values have already been as and if not, then the radii are placed between points of the map starting between the centre point and its neighbours and then adding spheres until the most outlying diagonal point is covered.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 1790 of file ProSHADE_data.cpp.
1795 std::stringstream hlpSS;
1796 hlpSS <<
"The sphere distances were determined as " << this->
spherePos.at(0);
1797 for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->
spherePos.size() ); iter++ ) { hlpSS <<
"; " << this->
spherePos.at(iter); }
1798 hlpSS <<
" Angstroms.";
1804 proshade_unsign maxDim =
static_cast< proshade_unsign
> ( std::max ( this->
xDimSize, std::max ( this->
yDimSize, this->
zDimSize ) ) );
1805 proshade_unsign minDim =
static_cast< proshade_unsign
> ( std::min ( this->
xDimSize, std::min ( this->
yDimSize, this->
zDimSize ) ) );
1806 proshade_unsign midDim =
static_cast< proshade_unsign
> ( 0 );
1807 if ( ( this->
xDimSize <
static_cast< proshade_single
> ( maxDim ) ) && ( this->
xDimSize >
static_cast< proshade_single
> ( minDim ) ) ) { midDim =
static_cast< proshade_unsign
> ( this->
xDimSize ); }
1808 else if ( ( this->
yDimSize <
static_cast< proshade_single
> ( maxDim ) ) && ( this->
yDimSize >
static_cast< proshade_single
> ( minDim ) ) ) { midDim =
static_cast< proshade_unsign
> ( this->
yDimSize ); }
1809 else { midDim =
static_cast< proshade_unsign
> ( this->
zDimSize ); }
1811 proshade_single maxDiag =
static_cast< proshade_single
> ( std::sqrt ( std::pow (
static_cast<proshade_single
> ( maxDim ), 2.0 ) +
1812 std::pow (
static_cast<proshade_single
> ( midDim ), 2.0 ) ) );
1815 for ( proshade_single iter = 0.5f; ( iter * settings->
maxSphereDists ) < ( maxDiag / 2.0f ); iter += 1.0f )
1818 if ( ( settings->
maxRadius > 0.0 ) && ( settings->
maxRadius <
static_cast< proshade_double
> ( maxDiag ) ) && (
static_cast< proshade_double
> ( iter * settings->
maxSphereDists ) > settings->
maxRadius ) ) {
break; }
1828 std::stringstream hlpSS;
1829 hlpSS <<
"The sphere distances were determined as " << this->
spherePos.at(0);
1830 for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->
spherePos.size() ); iter++ ) { hlpSS <<
"; " << this->
spherePos.at(iter); }
1831 hlpSS <<
" Angstroms.";
◆ getSpherePosValue()
proshade_single ProSHADE_internal_data::ProSHADE_data::getSpherePosValue |
( |
proshade_unsign |
shell | ) |
|
This function allows access to sphere positions.
- Parameters
-
[in] | shell | The index of the sphere for which the position (radius) is to be obtained. |
[out] | X | The radius of the sphere with index shell. |
Definition at line 3950 of file ProSHADE_data.cpp.
◆ getSymmetryAxis()
std::vector< std::string > ProSHADE_internal_data::ProSHADE_data::getSymmetryAxis |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_unsign |
axisNo |
|
) |
| |
This function returns a single symmetry axis as a vector of strings from the recommended symmetry axes list.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | axisNo | The index of the axis to be returned. |
[out] | val | A vector of strings containing the symmetry axis fold, x, y, z axis element, angle, peak height and averaged FSC in this order. |
Definition at line 4650 of file ProSHADE_data.cpp.
4656 return ( std::vector< std::string > ( ) );
4660 std::vector< std::string > ret;
4663 std::stringstream ssHlp;
◆ getTranslationFnPointer()
proshade_complex * ProSHADE_internal_data::ProSHADE_data::getTranslationFnPointer |
( |
void |
| ) |
|
This function allows access to the translation function through a pointer.
- Parameters
-
[out] | translationMap | Pointer to the first position in the translation function map array. |
Definition at line 4209 of file ProSHADE_data.cpp.
◆ getWignerMatrixValue()
void ProSHADE_internal_data::ProSHADE_data::getWignerMatrixValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
order1, |
|
|
proshade_unsign |
order2, |
|
|
proshade_double * |
valueReal, |
|
|
proshade_double * |
valueImag |
|
) |
| |
This function allows access to the Wigner D matrix by knowing the band, order1 and order2 indices.
- Parameters
-
[in] | band | The band for which the Wigner D matrix value should be returned. |
[in] | order1 | The first order for which the Wigner D matrix value should be returned. |
[in] | order2 | The second order for which the Wigner D matrix value should be returned. |
[in] | valueReal | The proshade_double number pointer to where the real part of the value will be saved. |
[in] | valueImag | The proshade_double number pointer to where the imaginary part of the value will be saved. |
Definition at line 4029 of file ProSHADE_data.cpp.
◆ getXAxisOrigin()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXAxisOrigin |
( |
void |
| ) |
|
This function allows access to the map X axis origin value.
- Parameters
-
[out] | xAxisOrigin | The value of X axis origin for the map. |
Definition at line 4165 of file ProSHADE_data.cpp.
◆ getXDim()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getXDim |
( |
void |
| ) |
|
This function allows access to the map size in indices along the X axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in indices along the X axis. |
Definition at line 4074 of file ProSHADE_data.cpp.
◆ getXDimSize()
proshade_single ProSHADE_internal_data::ProSHADE_data::getXDimSize |
( |
void |
| ) |
|
This function allows access to the map size in angstroms along the X axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in angstroms along the X axis. |
Definition at line 4044 of file ProSHADE_data.cpp.
◆ getXFromPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXFromPtr |
( |
void |
| ) |
|
This function allows access to the map start along the X axis.
- Parameters
-
[out] | xFrom | Pointer to the starting index along the X axis. |
Definition at line 4104 of file ProSHADE_data.cpp.
4107 return ( &this->
xFrom );
◆ getXToPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXToPtr |
( |
void |
| ) |
|
This function allows access to the map last position along the X axis.
- Parameters
-
[out] | xFrom | Pointer to the final index along the X axis. |
Definition at line 4134 of file ProSHADE_data.cpp.
4137 return ( &this->
xTo );
◆ getYAxisOrigin()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYAxisOrigin |
( |
void |
| ) |
|
This function allows access to the map Y axis origin value.
- Parameters
-
[out] | yAxisOrigin | The value of Y axis origin for the map. |
Definition at line 4176 of file ProSHADE_data.cpp.
◆ getYDim()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getYDim |
( |
void |
| ) |
|
This function allows access to the map size in indices along the Y axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in indices along the Y axis. |
Definition at line 4084 of file ProSHADE_data.cpp.
◆ getYDimSize()
proshade_single ProSHADE_internal_data::ProSHADE_data::getYDimSize |
( |
void |
| ) |
|
This function allows access to the map size in angstroms along the Y axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in angstroms along the Y axis. |
Definition at line 4054 of file ProSHADE_data.cpp.
◆ getYFromPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYFromPtr |
( |
void |
| ) |
|
This function allows access to the map start along the Y axis.
- Parameters
-
[out] | yFrom | Pointer to the starting index along the Y axis. |
Definition at line 4114 of file ProSHADE_data.cpp.
4117 return ( &this->
yFrom );
◆ getYToPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYToPtr |
( |
void |
| ) |
|
This function allows access to the map last position along the Y axis.
- Parameters
-
[out] | yFrom | Pointer to the final index along the Y axis. |
Definition at line 4144 of file ProSHADE_data.cpp.
4147 return ( &this->
yTo );
◆ getZAxisOrigin()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZAxisOrigin |
( |
void |
| ) |
|
This function allows access to the map Z axis origin value.
- Parameters
-
[out] | zAxisOrigin | The value of Z axis origin for the map. |
Definition at line 4187 of file ProSHADE_data.cpp.
◆ getZDim()
proshade_unsign ProSHADE_internal_data::ProSHADE_data::getZDim |
( |
void |
| ) |
|
This function allows access to the map size in indices along the Z axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in indices along the Z axis. |
Definition at line 4094 of file ProSHADE_data.cpp.
◆ getZDimSize()
proshade_single ProSHADE_internal_data::ProSHADE_data::getZDimSize |
( |
void |
| ) |
|
This function allows access to the map size in angstroms along the Z axis.
- Parameters
-
[out] | xDimSize | The size of the internal map in angstroms along the Z axis. |
Definition at line 4064 of file ProSHADE_data.cpp.
◆ getZFromPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZFromPtr |
( |
void |
| ) |
|
This function allows access to the map start along the Z axis.
- Parameters
-
[out] | zFrom | Pointer to the starting index along the Z axis. |
Definition at line 4124 of file ProSHADE_data.cpp.
4127 return ( &this->
zFrom );
◆ getZToPtr()
proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZToPtr |
( |
void |
| ) |
|
This function allows access to the map last position along the Z axis.
- Parameters
-
[out] | zFrom | Pointer to the final index along the Z axis. |
Definition at line 4154 of file ProSHADE_data.cpp.
4157 return ( &this->
zTo );
◆ interpolateMapFromSpheres()
void ProSHADE_internal_data::ProSHADE_data::interpolateMapFromSpheres |
( |
proshade_double *& |
densityMapRotated | ) |
|
This function interpolates the density map from the sphere mapped data.
- Parameters
-
[in] | densityMapRotated | The pointer to allocated memory where the new map values will be held. |
Definition at line 1310 of file ProSHADE_overlay.cpp.
1313 proshade_double rad = 0.0, lon = 0.0, lat = 0.0, newU = 0.0, newV = 0.0, newW = 0.0;
1314 proshade_unsign lowerLonL = 0, upperLonL = 0, lowerLonU = 0, upperLonU = 0, lowerLatL = 0, upperLatL = 0, lowerLatU = 0, upperLatU = 0, lowerShell = 0, upperShell = 0;
1315 proshade_double x00 = 0.0, x01 = 0.0, x10 = 0.0, x11 = 0.0, distLLon = 0.0, distLLat = 0.0, distLRad = 0.0, valLLon = 0.0, valULon = 0.0;
1316 proshade_double lowerShellValue = 0.0, upperShellValue = 0.0;
1317 proshade_double xSamplingRate =
static_cast<proshade_double
> ( this->
xDimSize ) /
static_cast<proshade_double
> ( this->
xDimIndices );
1318 proshade_double ySamplingRate =
static_cast<proshade_double
> ( this->
yDimSize ) /
static_cast<proshade_double
> ( this->
yDimIndices );
1319 proshade_double zSamplingRate =
static_cast<proshade_double
> ( this->
zDimSize ) /
static_cast<proshade_double
> ( this->
zDimIndices );
1320 proshade_signed arrPos;
1321 std::vector<proshade_double> lonCOU, latCOU, lonCOL, latCOL;
1323 for ( proshade_signed uIt = 0; uIt < static_cast<proshade_signed> (this->
xDimIndices); uIt++ )
1325 for ( proshade_signed vIt = 0; vIt < static_cast<proshade_signed> (this->
yDimIndices); vIt++ )
1327 for ( proshade_signed wIt = 0; wIt < static_cast<proshade_signed> (this->
zDimIndices); wIt++ )
1330 newU =
static_cast<proshade_double
> ( uIt - (
static_cast<proshade_signed
> (this->
xDimIndices) / 2 ) );
1331 newV =
static_cast<proshade_double
> ( vIt - (
static_cast<proshade_signed
> (this->
yDimIndices) / 2 ) );
1332 newW =
static_cast<proshade_double
> ( wIt - (
static_cast<proshade_signed
> (this->
zDimIndices) / 2 ) );
1335 if ( ( newU == 0.0 ) && ( newV == 0.0 ) && ( newW == 0.0 ) )
1337 arrPos = wIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * uIt );
1338 densityMapRotated[arrPos] = this->
internalMap[arrPos];
1343 rad = sqrt ( pow( ( newU * xSamplingRate ), 2.0 ) +
1344 pow( ( newV * ySamplingRate ), 2.0 ) +
1345 pow( ( newW * zSamplingRate ), 2.0 ) );
1346 lon = atan2 ( ( newV * ySamplingRate ), ( newU * xSamplingRate ) );
1347 lat = asin ( ( newW * zSamplingRate ) / rad );
1350 if ( rad != rad ) { rad = 0.0; }
1351 if ( lon != lon ) { lon = 0.0; }
1352 if ( lat != lat ) { lat = 0.0; }
1357 for ( proshade_unsign iter = 0; iter < (this->
noSpheres-1); iter++ )
1359 if ( (
static_cast< proshade_double
> ( this->
spherePos.at(iter) ) <= rad ) && (
static_cast< proshade_double
> ( this->
spherePos.at(iter+1) ) > rad ) )
1362 upperShell = iter+1;
1367 if ( upperShell == 0 )
1369 arrPos = wIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * uIt );
1370 densityMapRotated[arrPos] = 0.0;
1375 lonCOL.clear(); latCOL.clear(); lonCOU.clear(); latCOU.clear();
1380 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOL.size() ); iter++ )
1382 if ( iter == (
static_cast<proshade_unsign
> ( lonCOL.size() ) - 1 ) )
1388 if ( ( std::floor(10000. * lonCOL.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOL.at(iter+1)) > std::floor(10000. * lon) ) )
1395 if ( upperLonL == this->
spheres[lowerShell]->getLocalAngRes() ) { upperLonL = 0; }
1397 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOU.size() ); iter++ )
1399 if ( iter == (
static_cast<proshade_unsign
> ( lonCOU.size() ) - 1 ) )
1405 if ( ( std::floor(10000. * lonCOU.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOU.at(iter+1)) > std::floor(10000. * lon) ) )
1412 if ( upperLonU == this->
spheres[upperShell]->getLocalAngRes() ) { upperLonU = 0; }
1414 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOL.size() ); iter++ )
1416 if ( iter == (
static_cast<proshade_unsign
> ( latCOL.size() ) - 1 ) )
1422 if ( ( std::floor(10000. * latCOL.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOL.at(iter+1)) > std::floor(10000. * lat) ) )
1429 if ( upperLatL == this->
spheres[lowerShell]->getLocalAngRes() ) { upperLatL = 0; }
1431 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOU.size() ); iter++ )
1433 if ( iter == (
static_cast<proshade_unsign
> ( latCOU.size() ) - 1 ) )
1439 if ( ( std::floor(10000. * latCOU.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOU.at(iter+1)) > std::floor(10000. * lat) ) )
1446 if ( upperLatU == this->
spheres[upperShell]->getLocalAngRes() ) { upperLatU = 0; }
1454 distLLon = std::abs ( lon - lonCOL.at(lowerLonL) ) / ( std::abs( lon - lonCOL.at(lowerLonL) ) + std::abs( lon - lonCOL.at(upperLonL) ) );
1455 valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1456 valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1458 distLLat = std::abs ( lat - latCOL.at(lowerLatL) ) / ( std::abs( lat - latCOL.at(lowerLatL) ) + std::abs( lat - latCOL.at(upperLatL) ) );
1459 lowerShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1467 distLLon = std::abs ( lon - lonCOU.at(lowerLonU) ) / ( std::abs( lon - lonCOU.at(lowerLonU) ) + std::abs( lon - lonCOU.at(upperLonU) ) );
1468 valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1469 valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1471 distLLat = std::abs ( lat - latCOU.at(lowerLatU) ) / ( std::abs( lat - latCOU.at(lowerLatU) ) + std::abs( lat - latCOU.at(upperLatU) ) );
1472 upperShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1475 distLRad = std::abs ( rad -
static_cast< proshade_double
> ( this->
spherePos.at(lowerShell) ) ) / ( std::abs( rad -
static_cast< proshade_double
> ( this->
spherePos.at(lowerShell) ) ) +
1476 std::abs( rad -
static_cast< proshade_double
> ( this->
spherePos.at(upperShell) ) ) );
1478 arrPos = wIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( vIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * uIt );
1479 densityMapRotated[arrPos] = ( ( 1.0 - distLRad ) * lowerShellValue ) + ( distLRad * upperShellValue );
◆ invertMirrorMap()
void ProSHADE_internal_data::ProSHADE_data::invertMirrorMap |
( |
ProSHADE_settings * |
settings | ) |
|
Function for inverting the map to its mirror image.
This function switches all index values along the three axes from 0 ... max to max ... 0. This should not normally be done, but in the case where the wrong hand has been used in the map re-construction process, this may be helpful.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
Definition at line 1211 of file ProSHADE_data.cpp.
1217 proshade_signed arrayPos, invPos;
1230 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->
xDimIndices ); xIt++ )
1232 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->
yDimIndices ); yIt++ )
1234 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->
zDimIndices ); zIt++ )
1237 arrayPos = zIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( yIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * xIt );
1238 invPos = (
static_cast< proshade_signed
> ( this->
zDimIndices - 1 ) - zIt ) +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( (
static_cast< proshade_signed
> ( this->
yDimIndices - 1 ) - yIt ) +
static_cast< proshade_signed
> ( this->
yDimIndices ) * (
static_cast< proshade_signed
> ( this->
xDimIndices - 1 ) - xIt ) );
◆ invertSHCoefficients()
void ProSHADE_internal_data::ProSHADE_data::invertSHCoefficients |
( |
void |
| ) |
|
This function computes the shell mapped data from inverting the Spherical Harmonics coefficients.
Definition at line 1217 of file ProSHADE_overlay.cpp.
1220 double *sigR =
nullptr, *sigI =
nullptr, *rcoeffs =
nullptr, *icoeffs =
nullptr, *weights =
nullptr, *workspace =
nullptr;
1221 fftw_plan idctPlan, ifftPlan;
1224 for (
int shell = 0; shell < static_cast<int> ( this->
noSpheres ); shell++ )
1233 makeweights (
static_cast< int > ( this->
spheres[shell]->getLocalBandwidth() ), weights );
1239 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1248 InvFST_semi_fly ( rcoeffs,
1252 static_cast< int > ( this->
spheres[shell]->getLocalBandwidth() ),
1255 static_cast< int > ( this->
spheres[shell]->getLocalBandwidth() ),
1260 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1266 fftw_destroy_plan ( idctPlan );
1267 fftw_destroy_plan ( ifftPlan );
◆ mapToSpheres()
void ProSHADE_internal_data::ProSHADE_data::mapToSpheres |
( |
ProSHADE_settings * |
settings | ) |
|
This function converts the internal map onto a set of concentric spheres.
This function starts by determining the spherical harmonics values which were not supplied by the user, these may be bandwidth, Legendre approximation steps, integration order, etc. It then proceeds to determine the optimal sphere distances, unless these were determined by the user.
Finally, the function creates a new instance of the ProSHADE_sphere class for each of the already determined sphere positions. Note: The constructor of ProSHADE_sphere is where the mapping then happens.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 1851 of file ProSHADE_data.cpp.
1867 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->
spherePos.size() ); iter++ )
1869 std::stringstream ss;
1870 ss <<
"Now mapping sphere " << iter <<
" .";
1876 this->internalMap, &this->maxShellBand, &this->maxEMatDim );
◆ maskMap()
Function for computing the map mask using blurring and X IQRs from median.
This function takes all the internal map representation information from the calling object and the internal map itself and proceeds to write all this information in MRC MAP format for visualisation and further processing by other software. It is dependent on the internal information being correct.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
Definition at line 1312 of file ProSHADE_data.cpp.
1332 delete[] blurredMap;
◆ normaliseEMatrixValue()
void ProSHADE_internal_data::ProSHADE_data::normaliseEMatrixValue |
( |
proshade_unsign |
band, |
|
|
proshade_unsign |
order1, |
|
|
proshade_unsign |
order2, |
|
|
proshade_double |
normF |
|
) |
| |
This function allows normalising the E matrix value.
- Parameters
-
[in] | band | The band indice of the E matrix to which the value should be assigned. |
[in] | order1 | The first order indice of the E matrix to which the value should be assigned. |
[in] | order2 | The second order indice of the E matrix to which the value should be assigned. |
[in] | normF | The value by which the original E matrix value will be divided to normalise it. |
Definition at line 4354 of file ProSHADE_data.cpp.
4357 this->
eMatrices[band][order1][order2][0] /= normF;
4358 this->
eMatrices[band][order1][order2][1] /= normF;
◆ normaliseMap()
void ProSHADE_internal_data::ProSHADE_data::normaliseMap |
( |
ProSHADE_settings * |
settings | ) |
|
Function for normalising the map values to mean 0 and sd 1..
This function takes the map and changes its value to have mean 0 and standard deviation of 1. This should make wo maps with very different density levels more comparable, but it remains to be seen if this causes any trouble. Can be turned off using the settings options.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
Definition at line 1265 of file ProSHADE_data.cpp.
1280 proshade_double* meanSD =
new proshade_double[2];
◆ prepareFSCFourierMemory()
void ProSHADE_internal_data::ProSHADE_data::prepareFSCFourierMemory |
( |
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed * |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_single |
resolution, |
|
|
proshade_signed * |
cutXDim, |
|
|
proshade_signed * |
cutYDim, |
|
|
proshade_signed * |
cutZDim |
|
) |
| |
This function allocates the memory and makes all preparations required for FSC computation.
This function does all the heavy lifting of the FSC computation that can be done with only the knowledge of the array dimensions. It starts by assigning each array index into a bin and then it proceeds to cut the array of bins to contain all reflections up to the resolution, but not more. Next, it computes the Fourier transform of the static map and cuts it to the same dimensions as the bin array to save space and computation time.
- Parameters
-
[in] | cutIndices | This is where the bin indexing array 'cut to the resolution' will be saved into. |
[in] | fCoeffsCut | This is where the Fourier coefficients array cut to the resolution will be saved into. |
[in] | noBins | The number of bins will be stored in this variable. |
[in] | bindata | An array to store the bin sums and other FSC computation temporary results. |
[in] | binCounts | An array that will be used to store the number of reflactions in each bin. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | resolution | Resolution to which the FSC will be calculated (so that the maps could be cut appropriately). |
[in] | cutXDim | The x-axis dimension of the cut coefficients (and bin indices) will be saved here. |
[in] | cutYDim | The x-axis dimension of the cut coefficients (and bin indices) will be saved here. |
[in] | cutZDim | The x-axis dimension of the cut coefficients (and bin indices) will be saved here. |
Definition at line 2202 of file ProSHADE_data.cpp.
2205 std::vector< proshade_single > *resArray;
2206 proshade_signed* binIndexing =
nullptr;
2214 cutXDim, cutYDim, cutZDim,
2219 delete[] binIndexing;
2222 bindata =
new proshade_double*[*noBins];
2223 binCounts =
new proshade_signed [*noBins];
2224 fscByBin =
new proshade_double [*noBins];
2225 fftw_complex* mapData =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ) );
2226 fftw_complex* fCoeffs =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ) );
2227 fCoeffsCut =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) *
static_cast< proshade_unsign
> ( (*cutXDim) * (*cutYDim) * (*cutZDim) ) ) );
2238 for (
size_t binIt = 0; binIt < static_cast< size_t > ( *noBins ); binIt++ )
2240 bindata[binIt] =
new proshade_double[12];
2245 for (
size_t binIt = 0; binIt < static_cast< size_t > ( *noBins ); binIt++ ) {
for (
size_t it = 0; it < 12; it++ ) { bindata[binIt][it] = 0.0; } }
2246 for (
size_t binIt = 0; binIt < static_cast< size_t > ( *noBins ); binIt++ ) { binCounts[binIt] = 0; fscByBin[binIt] = 0.0; }
2247 for (
size_t mapIt = 0; mapIt < static_cast< size_t > ( this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ); mapIt++ ) { mapData[mapIt][0] = 0.0; mapData[mapIt][1] = 0.0; fCoeffs[mapIt][0] = 0.0; fCoeffs[mapIt][1] = 0.0; }
2248 for (
size_t mapIt = 0; mapIt < static_cast< size_t > ( (*cutXDim) * (*cutYDim) * (*cutZDim) ); mapIt++ ) { fCoeffsCut[mapIt][0] = 0.0; fCoeffsCut[mapIt][1] = 0.0; }
2251 fftw_plan planForwardFourier = fftw_plan_dft_3d (
static_cast< int > ( this->
xDimIndices ),
static_cast< int > ( this->
yDimIndices ),
static_cast< int > ( this->
zDimIndices ), mapData, fCoeffs, FFTW_FORWARD, FFTW_ESTIMATE );
2256 fftw_execute ( planForwardFourier );
2263 proshade_unsign arrPos = 0;
2264 for ( proshade_unsign xIt = 0; xIt < static_cast< proshade_unsign > ( *cutXDim ); xIt++ )
2266 for ( proshade_unsign yIt = 0; yIt < static_cast< proshade_unsign > ( *cutYDim ); yIt++ )
2268 for ( proshade_unsign zIt = 0; zIt < static_cast< proshade_unsign > ( *cutZDim ); zIt++ )
2270 arrPos = zIt +
static_cast< proshade_unsign
> ( *cutZDim ) * ( yIt +
static_cast< proshade_unsign
> ( *cutYDim ) * xIt );
2271 if ( ( cutIndices[arrPos] < 0 ) || ( cutIndices[arrPos] > (*noBins) ) ) { fCoeffsCut[arrPos][0] = 0.0; fCoeffsCut[arrPos][1] = 0.0; }
2277 fftw_destroy_plan ( planForwardFourier );
2278 fftw_free ( mapData );
2279 fftw_free ( fCoeffs );
◆ processInternalMap()
void ProSHADE_internal_data::ProSHADE_data::processInternalMap |
( |
ProSHADE_settings * |
settings | ) |
|
This function simply clusters several other functions which should be called together.
This function serves to cluster the map normalisation, map masking, map centering and map extra space addition into a single function. This allows for simpler code and does not take any control away, as all the decisions are ultimately driven by the settings. This function also shifts the map so that its centre of box is at the desired position.
This function also does some internal value saving and auto-determination of any parameters that the user did not supply. This, however, means, that this function MUST be called for every structure that is to be processed by ProSHADE. This is of importance to people whe want to use only a perticular functions.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
- Warning
- This function MUST be called on any structure that is to be processed by ProSHADE.
Definition at line 1739 of file ProSHADE_data.cpp.
◆ readInGemmi()
void ProSHADE_internal_data::ProSHADE_data::readInGemmi |
( |
gemmi::Structure * |
gemmiStruct, |
|
|
ProSHADE_settings * |
settings |
|
) |
| |
|
protected |
Function for reading co-ordinate data from Gemmi object.
This function processes the input Gemmi structure into ProSHADE internal map. It starts with ProSHADE optional modifications of the co-ordinates (i.e. setting all B-factors to given value and removing waters). It then proceeds to move the co-ordinates so that their minimal point is at position [20, 20, 20] (this is to make sure map density will be at the centre of the box) and computes the theoretical density map using Gemmi's Cromer & Libermann method. It then moves the map box to the original co-ordinates position.
If map re-sampling is required, then this is done here as well.
Finally, this function sets all the ProSHADE internal values to what other functions expect and terminates.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
- Warning
- For multiple models, this function works, but the map is not perfectly fitted to the PDB file.
Definition at line 759 of file ProSHADE_data.cpp.
780 proshade_double xCOMPdb, yCOMPdb, zCOMPdb;
784 proshade_single xF = 0.0f, xT = 0.0f, yF = 0.0f, yT = 0.0f, zF = 0.0f, zT = 0.0f;
788 proshade_single xMov =
static_cast< proshade_single
> ( settings->
coOrdsExtraSpace - xF );
789 proshade_single yMov =
static_cast< proshade_single
> ( settings->
coOrdsExtraSpace - yF );
790 proshade_single zMov =
static_cast< proshade_single
> ( settings->
coOrdsExtraSpace - zF );
799 ProSHADE_internal_mapManip::generateMapFromPDB ( *gemmiStruct, this->
internalMap, settings->
requestedResolution, this->xDimSize, this->yDimSize, this->zDimSize, &this->xTo, &this->yTo, &this->zTo, settings->
forceP1, settings->
firstModelOnly );
812 static_cast< proshade_signed
> ( this->
xDimIndices ),
static_cast< proshade_signed
> ( this->
yDimIndices ),
813 static_cast< proshade_signed
> ( this->
zDimIndices ) );
◆ readInMAP()
void ProSHADE_internal_data::ProSHADE_data::readInMAP |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double * |
maskArr = nullptr , |
|
|
proshade_unsign |
maskXDim = 0 , |
|
|
proshade_unsign |
maskYDim = 0 , |
|
|
proshade_unsign |
maskZDim = 0 , |
|
|
proshade_double * |
weightsArr = nullptr , |
|
|
proshade_unsign |
weigXDim = 0 , |
|
|
proshade_unsign |
weigYDim = 0 , |
|
|
proshade_unsign |
weigZDim = 0 |
|
) |
| |
|
protected |
Function for reading map data using gemmi library.
This function reads in the map data using the information from the settings object and saves all the results into the structure calling it. More specifically, the data are parsed from the input file, mask (if any is supplied) is applied here, the Fourier weights are applied, map re-sampling is done and then the final map details are saved for further processing.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
[in] | maskArr | An array of mask values (default nullptr) to be used instead of an input mask file. |
[in] | maskXDim | The size of maskArray x dimension in indices (defaults to 0). |
[in] | maskYDim | The size of maskArray y dimension in indices (defaults to 0). |
[in] | maskZDim | The size of maskArray z dimension in indices (defaults to 0). |
[in] | weightsArr | An array of weights (default nullptr) to be used instead of input file. |
[in] | weigXDim | The size of weightsArray x dimension in indices (defaults to 0). |
[in] | weigYDim | The size of weightsArray y dimension in indices (defaults to 0). |
[in] | weigZDim | The size of weightsArray z dimension in indices (defaults to 0). |
Definition at line 635 of file ProSHADE_data.cpp.
638 gemmi::Ccp4<float> map;
639 map.read_ccp4 ( gemmi::MaybeGzipped ( this->
fileName.c_str() ) );
642 map.setup ( 0.0f, gemmi::MapSetup::ReorderOnly );
659 maskArr, maskXDim, maskYDim, maskZDim );
671 weightsArr, weigXDim, weigYDim, weigZDim );
680 std::min (
static_cast<proshade_single
> ( this->
yDimSize ) /
static_cast<proshade_single
> ( this->
yDimIndices ),
681 static_cast<proshade_single
> ( this->
zDimSize ) /
static_cast<proshade_single
> ( this->
zDimIndices ) ) ) * 2.0f );
◆ readInPDB()
void ProSHADE_internal_data::ProSHADE_data::readInPDB |
( |
ProSHADE_settings * |
settings | ) |
|
|
protected |
Function for reading pdb data.
This function reads in the pdb data using the information from the settings object, converts the co-ordinates onto a theoretical map and and saves all the results into the structure calling it.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
- Warning
- For multiple models, this function works, but the map is not perfectly fitted to the PDB file.
Definition at line 724 of file ProSHADE_data.cpp.
733 gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->
fileName ) );
◆ readInStructure() [1/2]
void ProSHADE_internal_data::ProSHADE_data::readInStructure |
( |
gemmi::Structure * |
gemmiStruct, |
|
|
proshade_unsign |
inputO, |
|
|
ProSHADE_settings * |
settings |
|
) |
| |
This function initialises the basic ProSHADE_data variables and reads in a single structure from Gemmi co-ordinate object.
This function is basically the constructor for the ProSHADE_data class. It reads in a structure from the supplied gemmi::Structure object in the same way a co-ordinate structure would be read from file.
- Parameters
-
[in] | gemmiStruct | The Gemmi Structure object that should be read in. |
[in] | inputO | The order of this structure in this run's input. |
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
Definition at line 583 of file ProSHADE_data.cpp.
586 std::stringstream ss;
587 ss <<
"Starting to load the structure from Gemmi object " << inputO;
593 throw ProSHADE_exception (
"Structure data class not empty.",
"E000005", __FILE__, __LINE__, __func__,
"Attempted to read in structure into a ProSHADE_data\n : object which already does have structure read in\n : i.e. " + this->
fileName );
600 this->
fileType = ProSHADE_internal_io::GEMMI;
◆ readInStructure() [2/2]
void ProSHADE_internal_data::ProSHADE_data::readInStructure |
( |
std::string |
fName, |
|
|
proshade_unsign |
inputO, |
|
|
ProSHADE_settings * |
settings, |
|
|
proshade_double * |
maskArr = nullptr , |
|
|
proshade_unsign |
maskXDim = 0 , |
|
|
proshade_unsign |
maskYDim = 0 , |
|
|
proshade_unsign |
maskZDim = 0 , |
|
|
proshade_double * |
weightsArr = nullptr , |
|
|
proshade_unsign |
weigXDim = 0 , |
|
|
proshade_unsign |
weigYDim = 0 , |
|
|
proshade_unsign |
weigZDim = 0 |
|
) |
| |
This function initialises the basic ProSHADE_data variables and reads in a single structure.
This function is basically the constructor for the ProSHADE_data class. It reads in a structure (independent of the structure type) and fills in all the appropriate variables of the class.
- Parameters
-
[in] | fName | The file name of the file which should be loaded. |
[in] | inputO | The order of this structure in this run's input. |
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
[in] | maskArr | An array of mask values (default nullptr) to be used instead of an input mask file. |
[in] | maskXDim | The size of maskArray x dimension in indices (defaults to 0). |
[in] | maskYDim | The size of maskArray y dimension in indices (defaults to 0). |
[in] | maskZDim | The size of maskArray z dimension in indices (defaults to 0). |
[in] | weightsArr | An array of weights (default nullptr) to be used instead of input file. |
[in] | weigXDim | The size of weightsArray x dimension in indices (defaults to 0). |
[in] | weigYDim | The size of weightsArray y dimension in indices (defaults to 0). |
[in] | weigZDim | The size of weightsArray z dimension in indices (defaults to 0). |
Definition at line 525 of file ProSHADE_data.cpp.
533 throw ProSHADE_exception (
"Structure data class not empty.",
"E000005", __FILE__, __LINE__, __func__,
"Attempted to read in structure into a ProSHADE_data\n : object which already does have structure read in\n : i.e. " + this->
fileName );
548 case ProSHADE_internal_io::UNKNOWN:
549 throw ProSHADE_exception (
"Unknown file type.",
"E000006", __FILE__, __LINE__, __func__,
"When attempting to read the file\n : " + this->
fileName +
"\n : the file extension was determined as unknown. This could\n : mean either that the file does not exist, or that it is\n : not one of the supported extensions." );
551 case ProSHADE_internal_io::GEMMI:
552 throw ProSHADE_exception (
"Unknown file type.",
"E000006", __FILE__, __LINE__, __func__,
"When attempting to read the file\n : " + this->
fileName +
"\n : the file extension was determined as unknown. This could\n : mean either that the file does not exist, or that it is\n : not one of the supported extensions." );
554 case ProSHADE_internal_io::PDB:
558 case ProSHADE_internal_io::MAP:
559 this->
readInMAP ( settings, maskArr, maskXDim, maskYDim, maskZDim, weightsArr, weigXDim, weigYDim, weigZDim );
◆ removePhaseInormation()
void ProSHADE_internal_data::ProSHADE_data::removePhaseInormation |
( |
ProSHADE_settings * |
settings | ) |
|
This function removes phase from the map, effectively converting it to Patterson map.
This function is called when the phase information needs to be removed from the internal map representation. It does the forward Fourier transform, removes the phase from the Fourier coefficients and then the inverse Fourier transform, thus resulting with the Patterson map. It does write over the original map.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
Definition at line 3794 of file ProSHADE_data.cpp.
3800 fftw_complex* mapCoeffs =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ) );
3801 fftw_complex* pattersonMap =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ) );
3811 pattersonMap[iter][1] = 0.0;
3815 fftw_plan forward = fftw_plan_dft_3d (
static_cast< int > ( this->
xDimIndices ),
static_cast< int > ( this->
yDimIndices ),
static_cast< int > ( this->
zDimIndices ),
3816 pattersonMap, mapCoeffs, FFTW_FORWARD, FFTW_ESTIMATE );
3817 fftw_plan inverse = fftw_plan_dft_3d (
static_cast< int > ( this->
xDimIndices ),
static_cast< int > ( this->
yDimIndices ),
static_cast< int > ( this->
zDimIndices ),
3818 mapCoeffs, pattersonMap, FFTW_BACKWARD, FFTW_ESTIMATE );
3821 fftw_execute ( forward );
3827 fftw_execute ( inverse );
3830 proshade_signed mapIt, patIt, patX, patY, patZ;
3831 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->
xDimIndices ); xIt++ )
3833 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->
yDimIndices ); yIt++ )
3835 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->
zDimIndices ); zIt++ )
3838 patX = xIt - (
static_cast<proshade_signed
> ( this->
xDimIndices ) / 2 );
if ( patX < 0 ) { patX += this->
xDimIndices; }
3839 patY = yIt - (
static_cast<proshade_signed
> ( this->
yDimIndices ) / 2 );
if ( patY < 0 ) { patY += this->
yDimIndices; }
3840 patZ = zIt - (
static_cast<proshade_signed
> ( this->
zDimIndices ) / 2 );
if ( patZ < 0 ) { patZ += this->
zDimIndices; }
3843 mapIt = zIt +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( yIt +
static_cast< proshade_signed
> ( this->
yDimIndices ) * xIt );
3844 patIt = patZ +
static_cast< proshade_signed
> ( this->
zDimIndices ) * ( patY +
static_cast< proshade_signed
> ( this->
yDimIndices ) * patX );
3847 this->
internalMap[mapIt] = pattersonMap[patIt][0];
3853 fftw_free ( mapCoeffs );
3854 fftw_free ( pattersonMap );
3857 fftw_destroy_plan ( forward );
3858 fftw_destroy_plan ( inverse );
◆ reportCurrentSymmetryResults()
void ProSHADE_internal_data::ProSHADE_data::reportCurrentSymmetryResults |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double |
threshold, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
cutXDim, |
|
|
proshade_signed |
cutYDim, |
|
|
proshade_signed |
cutZDim |
|
) |
| |
This function prints a single line of the symmetry detection results for a particular threshold.
This is a very simple function which provides the advanced textual output for the symmetry detection task.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection reporting. |
[in] | threshold | The threshold to which the results are to be determined. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 3531 of file ProSHADE_data.cpp.
3534 proshade_signed origVerbose = settings->
verbose;
3536 this->
determineRecommendedSymmetry ( settings, threshold, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
3537 settings->
verbose = origVerbose;
3542 std::stringstream ssHlp;
3543 ssHlp << std::showpos << std::fixed << std::setprecision(2) <<
" " << threshold <<
" C +1 +0.00000 +0.00000 +0.00000 +0.00000 +1.00000 +1.00000" << std::endl <<
"===========================================================================================================";
3550 std::stringstream ssHlp;
3554 std::stringstream ssHlp;
3555 ssHlp <<
"===========================================================================================================";
◆ reportOverlayResults()
void ProSHADE_internal_data::ProSHADE_data::reportOverlayResults |
( |
ProSHADE_settings * |
settings, |
|
|
std::vector< proshade_double > * |
rotationCentre, |
|
|
std::vector< proshade_double > * |
eulerAngles, |
|
|
std::vector< proshade_double > * |
finalTranslation |
|
) |
| |
This function reports the results of the overlay mode.
- Parameters
-
[in] | settings | ProSHADE_settings object specifying the details of how the computations should be done. |
[in] | rotationCentre | Pointer to vector for saving the position of the centre of rotation about which the rotation is to be done. |
[in] | mapBoxMovement | Pointer to vector for saving the sum of all translations done internally by ProSHADE to this input map. |
[in] | eulerAngles | Pointer to vector where the three Euler angles will be saved into. |
[in] | finalTranslation | Pointer to a vector where the translation required to move structure from origin to optimal overlay with static structure will be saved into. |
Definition at line 4743 of file ProSHADE_data.cpp.
4749 std::stringstream rotCen; rotCen << std::setprecision (3) << std::showpos <<
"The rotation centre to origin translation vector is: " << -rotationCentre->at(0) <<
" " << -rotationCentre->at(1) <<
" " << -rotationCentre->at(2);
4753 proshade_double* rotMat =
new proshade_double[9];
4757 std::stringstream rotMatSS;
4758 rotMatSS << std::setprecision (3) << std::showpos <<
"The rotation matrix about origin is : " << rotMat[0] <<
" " << rotMat[1] <<
" " << rotMat[2] << std::endl;
4759 rotMatSS << std::setprecision (3) << std::showpos <<
" : " << rotMat[3] <<
" " << rotMat[4] <<
" " << rotMat[5] << std::endl;
4760 rotMatSS << std::setprecision (3) << std::showpos <<
" : " << rotMat[6] <<
" " << rotMat[7] <<
" " << rotMat[8];
4766 std::stringstream finTrs; finTrs << std::setprecision (3) << std::showpos <<
"The rotation centre to overlay translation vector is: " << finalTranslation->at(0) <<
" " << finalTranslation->at(1) <<
" " << finalTranslation->at(2);
◆ reportSymmetryResults()
void ProSHADE_internal_data::ProSHADE_data::reportSymmetryResults |
( |
ProSHADE_settings * |
settings | ) |
|
This function prints the report for symmetry detection.
This is a very simple function which provides the basic textual output for the symmetry detection task.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection reporting. |
Definition at line 3463 of file ProSHADE_data.cpp.
3473 std::stringstream ssHlp;
3475 ssHlp << std::endl <<
"Detected " << this->
recommendedSymmetryType <<
" symmetry with fold " << this->
recommendedSymmetryFold <<
" about point [" << comMove.at(0) <<
" , " << comMove.at(1) <<
" , " << comMove.at(2) <<
"] away from centre of mass .";
3480 ssHlp.clear(); ssHlp.str (
"" );
3481 ssHlp <<
" Fold X Y Z Angle Height Average FSC";
3486 ssHlp.clear(); ssHlp.str (
"" );
3492 std::stringstream ssHlp, hlpSS3;
3493 ssHlp.clear(); ssHlp.str (
"" );
3494 hlpSS3 << std::endl <<
"To facilitate manual checking for symmetries, the following is a list of all detected C symmetries:";
3499 ssHlp.clear(); ssHlp.str (
"" );
3500 ssHlp <<
" Fold X Y Z Angle Height Average FSC";
3505 ssHlp.clear(); ssHlp.str (
"" );
◆ reportSymmetryResultsList()
void ProSHADE_internal_data::ProSHADE_data::reportSymmetryResultsList |
( |
ProSHADE_settings * |
settings | ) |
|
This function takes prints the report for symmetry detection using multiple thresholds..
This is a very simple function which provides the advanced textual output for the symmetry detection task.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection reporting. |
Definition at line 3569 of file ProSHADE_data.cpp.
3572 std::stringstream ssHlp;
3573 std::vector< proshade_double > thrLevels;
3583 fftw_complex* fCoeffsCut;
3584 proshade_double **bindata, *fscByBin;
3585 proshade_signed *cutIndices, *binCounts, noBins, cutXDim, cutYDim, cutZDim;
3589 ssHlp.clear(); ssHlp.str (
"" );
3591 ssHlp << std::endl <<
"Detecting symmetries about point [" << comMove.at(0) <<
" , " << comMove.at(1) <<
" , " << comMove.at(2) <<
"] away from centre of mass .";
3595 proshade_signed origVerbose = settings->
verbose;
3597 this->
determineRecommendedSymmetry ( settings, settings->
fscThreshold, cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
3598 settings->
verbose = origVerbose;
3601 ssHlp.clear(); ssHlp.str (
"" );
3602 ssHlp << std::endl <<
"ProSHADE default symmetry detection algorithm claims the symmetry to be " << this->
recommendedSymmetryType <<
"-" << this->
recommendedSymmetryFold <<
" with axes:" << std::endl <<
"======================================================================================";
3607 ssHlp.clear(); ssHlp.str (
"" );
3608 ssHlp <<
" Type Fold X Y Z Angle Height Average FSC";
3613 ssHlp.clear(); ssHlp.str (
"" );
3614 ssHlp <<
" Type Fold X Y Z Angle Height Average FSC" << std::endl <<
" C +1 +0.00000 +0.00000 +0.00000 +0.00000 +1.00000 +1.00000";
3619 ssHlp.clear(); ssHlp.str (
"" );
3625 ssHlp.clear(); ssHlp.str (
"" );
3626 ssHlp << std::endl << std::endl <<
"Symmetry detection results per FSC threshold levels:" << std::endl <<
"====================================================";;
3629 ssHlp.clear(); ssHlp.str (
"" );
3630 ssHlp << std::endl <<
" Threshold Type Fold X Y Z Angle Height Average FSC" << std::endl <<
"===========================================================================================================";
3634 for (
size_t lIt = 0; lIt < thrLevels.size(); lIt++ )
3636 this->
reportCurrentSymmetryResults ( settings, thrLevels.at(lIt), cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, cutXDim, cutYDim, cutZDim );
3640 for (
size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) {
delete[] bindata[binIt]; }
3643 delete[] cutIndices;
3644 fftw_free ( fCoeffsCut );
3647 ssHlp.clear(); ssHlp.str (
"" );
3648 ssHlp << std::endl << std::endl <<
"To facilitate manual checking for symmetries, the following is a list of all detected C symmetries:";
3653 ssHlp.clear(); ssHlp.str (
"" );
3654 ssHlp <<
" Type Fold X Y Z Angle Height Average FSC";
3659 ssHlp.clear(); ssHlp.str (
"" );
◆ reSampleMap()
void ProSHADE_internal_data::ProSHADE_data::reSampleMap |
( |
ProSHADE_settings * |
settings | ) |
|
This function changes the internal map sampling to conform to particular resolution value.
This function will take the requested resolution value from the settings object and will proceed to change the internal map sampling to conform to requested resolution / 2 and therefore to the requested resolution map.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for reading in the map. |
Definition at line 1476 of file ProSHADE_data.cpp.
1482 proshade_single* changeVals =
new proshade_single[6];
1485 proshade_double xMapCOMPreReSampl = 0.0, yMapCOMPreReSampl = 0.0, zMapCOMPreReSampl = 0.0;
1486 ProSHADE_internal_mapManip::findMAPCOMValues ( this->
internalMap, &xMapCOMPreReSampl, &yMapCOMPreReSampl, &zMapCOMPreReSampl, this->
xDimSize, this->
yDimSize, this->
zDimSize, this->
xFrom, this->
xTo, this->
yFrom, this->
yTo, this->
zFrom, this->
zTo, settings->
removeNegativeDensity );
1492 this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1502 this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1507 this->
xDimIndices +=
static_cast<proshade_unsign
> ( changeVals[0] );
1508 this->
yDimIndices +=
static_cast<proshade_unsign
> ( changeVals[1] );
1509 this->
zDimIndices +=
static_cast<proshade_unsign
> ( changeVals[2] );
1515 this->
xTo +=
static_cast<proshade_unsign
> ( changeVals[0] );
1516 this->
yTo +=
static_cast<proshade_unsign
> ( changeVals[1] );
1517 this->
zTo +=
static_cast<proshade_unsign
> ( changeVals[2] );
1524 proshade_double xMapCOMPostReSampl = 0.0, yMapCOMPostReSampl = 0.0, zMapCOMPostReSampl = 0.0;
1525 ProSHADE_internal_mapManip::findMAPCOMValues ( this->
internalMap, &xMapCOMPostReSampl, &yMapCOMPostReSampl, &zMapCOMPostReSampl, this->
xDimSize, this->
yDimSize, this->
zDimSize, this->
xFrom, this->
xTo, this->
yFrom, this->
yTo, this->
zFrom, this->
zTo, settings->
removeNegativeDensity );
1528 proshade_single xMov =
static_cast< proshade_single
> ( xMapCOMPostReSampl - xMapCOMPreReSampl );
1529 proshade_single yMov =
static_cast< proshade_single
> ( yMapCOMPostReSampl - yMapCOMPreReSampl );
1530 proshade_single zMov =
static_cast< proshade_single
> ( zMapCOMPostReSampl - zMapCOMPreReSampl );
1537 static_cast< proshade_signed
> ( this->
xDimIndices ),
static_cast< proshade_signed
> ( this->
yDimIndices ),
static_cast< proshade_signed
> ( this->
zDimIndices ) );
1540 delete[] changeVals;
◆ rotateFourierCoeffs()
void ProSHADE_internal_data::ProSHADE_data::rotateFourierCoeffs |
( |
proshade_double |
axX, |
|
|
proshade_double |
axY, |
|
|
proshade_double |
axZ, |
|
|
proshade_double |
axAng, |
|
|
fftw_complex *& |
coeffs, |
|
|
fftw_complex *& |
rotCoeffs, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function takes the rotation in terms of angle-axis representation and returns the input Fourier coefficients rotated by the rotation.
This function converts a set of Fourier coefficients of a structure onto a set of Fourier coefficients corresponding to a structure rotated by the given rotation. It deals with the boundaries as well as the axis order.
- Parameters
-
[in] | axX | The x-axis element of the angle-axis rotation representation. |
[in] | axY | The y-axis element of the angle-axis rotation representation. |
[in] | axZ | The z-axis element of the angle-axis rotation representation. |
[in] | axAng | The angle about the axis by which the rotation is to be done. |
[in] | coeffs | The coefficients to be rotated. |
[in] | rotCoeffs | An array to be allocated and filled with the rotated Fourier coefficients. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 873 of file ProSHADE_overlay.cpp.
876 size_t dimMax =
static_cast< size_t > ( xDim * yDim * zDim );
877 proshade_double *rotMat =
new proshade_double[9];
878 proshade_signed *mins =
new proshade_signed[3];
879 proshade_signed *maxs =
new proshade_signed[3];
880 proshade_signed *interpMins =
new proshade_signed[3];
881 proshade_signed *interpMaxs =
new proshade_signed[3];
882 proshade_double *interpDiff =
new proshade_double[3];
883 rotCoeffs =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * dimMax ) );
884 fftw_complex *rotCoeffsHlp =
reinterpret_cast< fftw_complex*
> ( fftw_malloc (
sizeof ( fftw_complex ) * dimMax ) );
885 proshade_double *rotVec;
886 std::complex< proshade_double > c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1;
889 bool withinBounds =
false;
902 for (
size_t iter = 0; iter < static_cast< size_t > ( dimMax ); iter++ ) { rotCoeffs[iter][0] = 0.0; rotCoeffs[iter][1] = 0.0; rotCoeffsHlp[iter][0] = 0.0; rotCoeffsHlp[iter][1] = 0.0; }
909 mins[0] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( xDim ) / -2.0f ) );
910 mins[1] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( yDim ) / -2.0f ) );
911 mins[2] =
static_cast< proshade_signed
> ( std::floor (
static_cast< proshade_single
> ( zDim ) / -2.0f ) );
913 maxs[0] = -( mins[0] + 1 );
914 maxs[1] = -( mins[1] + 1 );
915 maxs[2] = -( mins[2] + 1 );
918 for ( proshade_signed xIt = mins[0]; xIt <= maxs[0]; xIt++ )
920 for ( proshade_signed yIt = mins[1]; yIt <= maxs[1]; yIt++ )
922 for ( proshade_signed zIt = mins[2]; zIt <= 0; zIt++ )
926 static_cast< proshade_double
> ( xIt ),
927 static_cast< proshade_double
> ( yIt ),
928 static_cast< proshade_double
> ( zIt ) );
932 for (
size_t posIt = 0; posIt < 3; posIt++ )
935 interpMins[posIt] =
static_cast< proshade_signed
> ( std::round ( rotVec[posIt] ) );
936 if ( interpMins[posIt] > rotVec[posIt] ) { interpMaxs[posIt] = interpMins[posIt]; interpMins[posIt]--; }
937 else { interpMaxs[posIt] = interpMins[posIt] + 1; }
940 if ( ( maxs[posIt] < interpMins[posIt] ) || ( interpMins[posIt] < mins[posIt] ) || ( maxs[posIt] < interpMaxs[posIt] ) || ( interpMaxs[posIt] < mins[posIt] ) )
942 withinBounds =
false;
947 interpDiff[posIt] = rotVec[posIt] -
static_cast< proshade_double
> ( interpMins[posIt] );
949 if ( !withinBounds ) {
continue; }
952 for (
size_t posIt = 0; posIt < 3; posIt++ )
954 interpMaxs[posIt] = std::min ( maxs[posIt], std::max ( mins[posIt], interpMaxs[posIt] ) );
961 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
962 if ( arrPos >= dimMax ) {
continue; }
963 c000 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
965 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
966 if ( arrPos >= dimMax ) {
continue; }
967 c001 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
969 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
970 if ( arrPos >= dimMax ) {
continue; }
971 c010 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
973 arrPos =
static_cast< size_t > ( ( interpMins[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
974 if ( arrPos >= dimMax ) {
continue; }
975 c011 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
977 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
978 if ( arrPos >= dimMax ) {
continue; }
979 c100 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
981 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMins[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
982 if ( arrPos >= dimMax ) {
continue; }
983 c101 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
985 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMins[2] - mins[2] ) ) );
986 if ( arrPos >= dimMax ) {
continue; }
987 c110 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
989 arrPos =
static_cast< size_t > ( ( interpMaxs[0] - mins[0] ) + zDim * ( ( interpMaxs[1] - mins[1] ) + yDim * ( interpMaxs[2] - mins[2] ) ) );
990 if ( arrPos >= dimMax ) {
continue; }
991 c111 = std::complex< proshade_double > ( coeffs[arrPos][0], coeffs[arrPos][1] );
994 c00 = ( c000 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c100 *
static_cast< proshade_double
> ( interpDiff[0] ) );
995 c01 = ( c001 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c101 *
static_cast< proshade_double
> ( interpDiff[0] ) );
996 c10 = ( c010 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c110 *
static_cast< proshade_double
> ( interpDiff[0] ) );
997 c11 = ( c011 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c111 *
static_cast< proshade_double
> ( interpDiff[0] ) );
1000 c0 = ( c00 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c10 *
static_cast< proshade_double
> ( interpDiff[1] ) );
1001 c1 = ( c01 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c11 *
static_cast< proshade_double
> ( interpDiff[1] ) );
1004 arrPos =
static_cast< size_t > ( ( zIt - mins[2] ) + zDim * ( ( yIt - mins[1] ) + yDim * ( xIt - mins[0] ) ) );
1005 if ( arrPos >= dimMax ) {
continue; }
1006 rotCoeffs[arrPos][0] = ( ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) ) ).real();
1007 rotCoeffs[arrPos][1] = ( ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) ) ).imag();
1010 if ( ( mins[0] == xIt ) || ( mins[1] == yIt ) || ( mins[2] == zIt ) ) {
continue; }
1012 arrPos2 =
static_cast< size_t > ( ( -zIt - mins[2] ) + zDim * ( ( -yIt - mins[1] ) + yDim * ( -xIt - mins[0] ) ) );
1013 if ( arrPos2 >= dimMax ) {
continue; }
1014 rotCoeffs[arrPos2][0] = rotCoeffs[arrPos][0];
1015 rotCoeffs[arrPos2][1] = rotCoeffs[arrPos][1] * -1.0;
1021 for ( proshade_signed xIt = 0; xIt < xDim; xIt++ )
1023 for ( proshade_signed yIt = 0; yIt < yDim; yIt++ )
1025 for ( proshade_signed zIt = 0; zIt < zDim; zIt++ )
1027 arrPos =
static_cast< size_t > ( zIt + zDim * ( yIt + yDim * xIt ) );
1028 arrPos2 =
static_cast< size_t > ( xIt + xDim * ( yIt + yDim * zIt ) );
1030 if ( std::isnan ( rotCoeffs[arrPos][0] ) ) { rotCoeffsHlp[arrPos2][0] = 0.0;
continue; }
1031 if ( std::isnan ( rotCoeffs[arrPos][1] ) ) { rotCoeffsHlp[arrPos2][1] = 0.0;
continue; }
1033 rotCoeffsHlp[arrPos2][0] = rotCoeffs[arrPos][0];
1034 rotCoeffsHlp[arrPos2][1] = rotCoeffs[arrPos][1];
1038 for (
size_t iter = 0; iter < static_cast< size_t > ( xDim * yDim * zDim ); iter++ ) { rotCoeffs[iter][0] = rotCoeffsHlp[iter][0]; rotCoeffs[iter][1] = rotCoeffsHlp[iter][1]; }
1044 delete[] interpMaxs;
1045 delete[] interpMins;
1046 delete[] interpDiff;
1047 fftw_free ( rotCoeffsHlp );
◆ rotateMapRealSpace()
std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::rotateMapRealSpace |
( |
proshade_double |
axX, |
|
|
proshade_double |
axY, |
|
|
proshade_double |
axZ, |
|
|
proshade_double |
axAng, |
|
|
proshade_double *& |
map |
|
) |
| |
This function rotates a map based on the given angle-axis rotation.
This function takes the axis and angle of the required rotation as well as a pointer to which the rotated map should be saved into and proceeds to rotate the map in real space using tri-linear interpolation.
- Parameters
-
[in] | axX | The x-axis element of the angle-axis rotation representation. |
[in] | axY | The y-axis element of the angle-axis rotation representation. |
[in] | axZ | The z-axis element of the angle-axis rotation representation. |
[in] | axAng | The angle about the axis by which the rotation is to be done. |
[in] | map | A pointer which will be set to point to the rotated map. |
[out] | ret | The rotation centre about which the rotation was done in Angstroms. |
Definition at line 632 of file ProSHADE_overlay.cpp.
635 bool withinBounds =
true;
636 proshade_double c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1;
638 proshade_double xCOM, yCOM, zCOM;
639 std::vector< proshade_double > ret;
642 proshade_single xSampRate = this->
xDimSize /
static_cast< proshade_single
> ( this->
xTo - this->
xFrom );
643 proshade_single ySampRate = this->
yDimSize /
static_cast< proshade_single
> ( this->
yTo - this->
yFrom );
644 proshade_single zSampRate = this->
zDimSize /
static_cast< proshade_single
> ( this->
zTo - this->
zFrom );
647 ProSHADE_internal_mapManip::findMAPCOMValues ( this->
internalMap, &xCOM, &yCOM, &zCOM, this->
xDimSize, this->
yDimSize, this->
zDimSize, this->
xFrom, this->
xTo, this->
yFrom, this->
yTo, this->
zFrom, this->
zTo,
false );
650 proshade_single *mins =
new proshade_single[3];
651 proshade_single *maxs =
new proshade_single[3];
652 proshade_single *rotMat =
new proshade_single[9];
653 proshade_single *rotVec;
654 proshade_single *interpMins =
new proshade_single[3];
655 proshade_single *interpMaxs =
new proshade_single[3];
656 proshade_single *interpDiff =
new proshade_single[3];
657 proshade_single *movs =
new proshade_single[3];
674 mins[0] = std::floor (
static_cast< proshade_single
> ( this->
xDimIndices ) / -2.0f );
675 mins[1] = std::floor (
static_cast< proshade_single
> ( this->
yDimIndices ) / -2.0f );
676 mins[2] = std::floor (
static_cast< proshade_single
> ( this->
zDimIndices ) / -2.0f );
682 if ( this->
xDimIndices % 2 == 0 ) { maxs[0] -= 1.0f; }
683 if ( this->
yDimIndices % 2 == 0 ) { maxs[1] -= 1.0f; }
684 if ( this->
zDimIndices % 2 == 0 ) { maxs[2] -= 1.0f; }
700 for ( proshade_single xIt = mins[0]; xIt <= maxs[0]; xIt += 1.0f )
702 for ( proshade_single yIt = mins[1]; yIt <= maxs[1]; yIt += 1.0f )
704 for ( proshade_single zIt = mins[2]; zIt <= maxs[2]; zIt += 1.0f )
711 for (
size_t posIt = 0; posIt < 3; posIt++ )
714 interpMins[posIt] = std::floor ( rotVec[posIt] );
715 interpMaxs[posIt] = interpMins[posIt] + 1.0f;
718 if ( ( maxs[posIt] < interpMins[posIt] ) || ( interpMins[posIt] < mins[posIt] ) || ( maxs[posIt] < interpMaxs[posIt] ) || ( interpMaxs[posIt] < mins[posIt] ) )
720 withinBounds =
false;
725 interpDiff[posIt] = rotVec[posIt] - interpMins[posIt];
727 if ( !withinBounds ) {
continue; }
730 for (
size_t posIt = 0; posIt < 3; posIt++ )
732 interpMaxs[posIt] = std::min ( maxs[posIt], std::max ( mins[posIt], interpMaxs[posIt] ) );
739 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
742 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
745 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
748 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMins[0] - mins[0] ) ) );
751 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
754 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMins[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
757 arrPos =
static_cast< size_t > ( ( interpMins[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
760 arrPos =
static_cast< size_t > ( ( interpMaxs[2] - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( interpMaxs[1] - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( interpMaxs[0] - mins[0] ) ) );
764 c00 = ( c000 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c100 *
static_cast< proshade_double
> ( interpDiff[0] ) );
765 c01 = ( c001 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c101 *
static_cast< proshade_double
> ( interpDiff[0] ) );
766 c10 = ( c010 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c110 *
static_cast< proshade_double
> ( interpDiff[0] ) );
767 c11 = ( c011 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[0] ) ) ) + ( c111 *
static_cast< proshade_double
> ( interpDiff[0] ) );
770 c0 = ( c00 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c10 *
static_cast< proshade_double
> ( interpDiff[1] ) );
771 c1 = ( c01 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[1] ) ) ) + ( c11 *
static_cast< proshade_double
> ( interpDiff[1] ) );
774 arrPos =
static_cast< size_t > ( ( zIt - mins[2] ) +
static_cast< proshade_single
> ( this->
zDimIndices ) * ( ( yIt - mins[1] ) +
static_cast< proshade_single
> ( this->
yDimIndices ) * ( xIt - mins[0] ) ) );
775 map[arrPos] = ( c0 * ( 1.0 -
static_cast< proshade_double
> ( interpDiff[2] ) ) ) + ( c1 *
static_cast< proshade_double
> ( interpDiff[2] ) );
◆ rotateMapRealSpaceInPlace()
std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::rotateMapRealSpaceInPlace |
( |
proshade_double |
eulA, |
|
|
proshade_double |
eulB, |
|
|
proshade_double |
eulG |
|
) |
| |
This function rotates a map based on the given Euler angles in place.
This function takes the Euler angles of the required rotation and proceeds to make use of the rotateMapRealSpace () function to rotate the map in real space using trilinear interpolation, replacing the original map with the rotated one.
- Parameters
-
[in] | eulerAlpha | The rotation expressed as a pointer to Euler alpha angle. |
[in] | eulerBeta | The rotation expressed as a pointer to Euler beta angle. |
[in] | eulerGamma | The rotation expressed as a pointer to Euler gamma angle. |
[out] | ret | The rotation centre about which the rotation was done in Angstroms. |
Definition at line 805 of file ProSHADE_overlay.cpp.
808 proshade_double axX, axY, axZ, axAng, tmp, *rMat, *map;
811 rMat =
new proshade_double[9];
836 std::vector< proshade_double > ret = this->
rotateMapRealSpace ( axX, axY, axZ, axAng, map );
◆ rotateMapReciprocalSpace()
void ProSHADE_internal_data::ProSHADE_data::rotateMapReciprocalSpace |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double |
eulerAlpha, |
|
|
proshade_double |
eulerBeta, |
|
|
proshade_double |
eulerGamma |
|
) |
| |
This function rotates a map based on the given Euler angles.
This function starts by computing the Wigner D matrices for the given Euler angles and then it proceeds to multiply the spherical harmonics coefficients with these, thus producing spherical harmonics coefficients of a rotated structure. Then, it computes the inverse spherical harmonics decomposition, thus obtaining the sphere mapped values for the rotated structure. Finally, it interpolates these sphere mapped values back to Cartesian grid, thus obtaining a map rotated by the given Euler angles.
- Parameters
-
[in] | settings | The settings object specifying how exactly the rotation is to be done. |
[in] | eulerAlpha | The rotation expressed as a pointer to Euler alpha angle. |
[in] | eulerBeta | The rotation expressed as a pointer to Euler beta angle. |
[in] | eulerGamma | The rotation expressed as a pointer to Euler gamma angle. |
Definition at line 571 of file ProSHADE_overlay.cpp.
595 std::vector<proshade_double> lonCO, latCO;
601 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->
xDimIndices * this->
yDimIndices * this->
zDimIndices ); iter++ ) { densityMapRotated[iter] = 0.0; }
613 delete[] densityMapRotated;
◆ saveRequestedSymmetryD()
void ProSHADE_internal_data::ProSHADE_data::saveRequestedSymmetryD |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_signed *& |
cutIndices, |
|
|
fftw_complex *& |
fCoeffsCut, |
|
|
proshade_signed |
noBins, |
|
|
proshade_double **& |
bindata, |
|
|
proshade_signed *& |
binCounts, |
|
|
proshade_double *& |
fscByBin, |
|
|
proshade_signed |
xDim, |
|
|
proshade_signed |
yDim, |
|
|
proshade_signed |
zDim |
|
) |
| |
This function takes the D symmetries and searched for the requested symmetry.
This is a simple search function, which searches the symmetry results for the requested symmetry fold, and if more such symmetries are found, takes the one with the highest average peak height sum. If the requested fold was found, it will save it to the settings object, while it will set the object to fold 0 if the requested symmetry was not found (albeit there may be other symmetries present).
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map symmetry detection. |
[in] | cutIndices | Map of each coefficient index to its correct bin cut to resolution. |
[in] | fCoeffsCut | The original map Fourier coefficients cut to resolution. |
[in] | noBins | Number of bins to be used (only up to the cut-off resolution). |
[in] | bindata | Pre-allocated array of dimensions noBins x 12 serving as workspace for the bin summation and FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | binCounts | Pre-allocated array of dimension noBins serving to store the bin sizes for FSC computation. This array is modified by the function in case the caller would be interested in these results. |
[in] | fscByBin | This array will hold FSC values for each bin. This is useful in further computations, but could be internal for FSC only computation. |
[in] | xDim | The number of indices along the x-axis of the of the array to be rotated. |
[in] | yDim | The number of indices along the y-axis of the of the array to be rotated. |
[in] | zDim | The number of indices along the z-axis of the of the array to be rotated. |
Definition at line 2853 of file ProSHADE_data.cpp.
2856 proshade_unsign bestIndex = 0;
2857 proshade_double highestSym = 0.0;
2860 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->
dihedralSymmetries.size() ); iter++ )
2863 const FloatingPoint< proshade_double > lhs1 ( std::max ( this->
dihedralSymmetries.at(iter).at(0)[0], this->dihedralSymmetries.at(iter).at(1)[0] ) ), rhs1 (
static_cast< proshade_double
> ( settings->
requestedSymmetryFold ) );
2864 if ( !lhs1.AlmostEquals ( rhs1 ) ) {
continue; }
2867 const FloatingPoint< proshade_double > lhs999a ( this->
dihedralSymmetries.at(iter).at(0)[5] ), lhs999b ( this->
dihedralSymmetries.at(iter).at(1)[5] ), rhs999 (
static_cast< proshade_double
> ( -999.9 ) );
2872 this->
computeFSC ( settings, &this->
dihedralSymmetries.at(iter).at(0)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
2873 this->
computeFSC ( settings, &this->
dihedralSymmetries.at(iter).at(1)[0], cutIndices, fCoeffsCut, noBins, bindata, binCounts, fscByBin, xDim, yDim, zDim );
2876 if ( ( this->
dihedralSymmetries.at(iter).at(0)[6] + this->dihedralSymmetries.at(iter).at(1)[6] ) > highestSym )
2884 if ( highestSym > 0.0 )
◆ setEMatrixValue()
void ProSHADE_internal_data::ProSHADE_data::setEMatrixValue |
( |
int |
band, |
|
|
int |
order1, |
|
|
int |
order2, |
|
|
proshade_complex |
val |
|
) |
| |
This function allows setting the E matrix value.
- Parameters
-
[in] | band | The band indice of the E matrix to which the value should be assigned. |
[in] | order1 | The first order indice of the E matrix to which the value should be assigned. |
[in] | order2 | The second order indice of the E matrix to which the value should be assigned. |
[in] | val | The value which should be saved. |
Definition at line 4336 of file ProSHADE_data.cpp.
4339 this->
eMatrices[band][order1][order2][0] = val[0];
4340 this->
eMatrices[band][order1][order2][1] = val[1];
◆ setIntegrationWeight()
void ProSHADE_internal_data::ProSHADE_data::setIntegrationWeight |
( |
proshade_double |
intW | ) |
|
This function allows setting the integration weight for the object.
- Parameters
-
[in] | intW | The integration weight to be set for this object. |
Definition at line 4305 of file ProSHADE_data.cpp.
◆ setIntegrationWeightCumul()
void ProSHADE_internal_data::ProSHADE_data::setIntegrationWeightCumul |
( |
proshade_double |
intW | ) |
|
This function allows setting the cumulative integration weight for the object.
- Parameters
-
[in] | intW | The integration weight to be added to the current value for this object. |
Definition at line 4319 of file ProSHADE_data.cpp.
◆ setPDBMapValues()
void ProSHADE_internal_data::ProSHADE_data::setPDBMapValues |
( |
void |
| ) |
|
|
protected |
Function for determining iterator start and stop positions.
This function is called to set the xFrom, yFrom, ..., yTo and zTo iterator values for easier further calculations.
Definition at line 848 of file ProSHADE_data.cpp.
◆ setSO3CoeffValue()
void ProSHADE_internal_data::ProSHADE_data::setSO3CoeffValue |
( |
proshade_unsign |
position, |
|
|
proshade_complex |
val |
|
) |
| |
This function allows setting the SOFT coefficient values using array position and value.
- Parameters
-
[in] | position | The 1D array position at which the new value should be saved. |
[in] | val | Complex value to be saved into the array. |
Definition at line 4370 of file ProSHADE_data.cpp.
◆ setWignerMatrixValue()
void ProSHADE_internal_data::ProSHADE_data::setWignerMatrixValue |
( |
proshade_complex |
val, |
|
|
proshade_unsign |
band, |
|
|
proshade_unsign |
order1, |
|
|
proshade_unsign |
order2 |
|
) |
| |
This function allows setting the Wigner D matrix value by its band, order1 and order2 co-ordinate.
- Parameters
-
[in] | val | proshade_complex value of the Wigner D matrix at position band, order1, order2. |
[in] | band | The band of the Wigner D matrix value. |
[in] | order1 | The first order of the Wigner D matrix value. |
[in] | order2 | The second order of the Wigner D matrix value. |
Definition at line 4388 of file ProSHADE_data.cpp.
◆ shellBandExists()
bool ProSHADE_internal_data::ProSHADE_data::shellBandExists |
( |
proshade_unsign |
shell, |
|
|
proshade_unsign |
bandVal |
|
) |
| |
This function checks if particular shell has a particular band.
This function is useful for the progressive shell mapping, where it may not be clear in one part of the code whether a particular shell does or does not have a particular band value. Therefore, this function allows simple check.
- Parameters
-
[in] | shell | The index (number) of the shell for which the check should be done. |
[in] | bandVal | The band value which should be sought for the shell. |
[out] | X | True if the shell has the band, false otherwise. |
Definition at line 3774 of file ProSHADE_data.cpp.
3776 if ( this->
spheres[shell]->getLocalBandwidth( ) >= bandVal )
◆ shiftToBoxCentre()
void ProSHADE_internal_data::ProSHADE_data::shiftToBoxCentre |
( |
ProSHADE_settings * |
settings | ) |
|
Function for shifting map so that its centre of box is at required position.
This function takes a real world position and shifts the map so that this position is at the centre of the box. This is very useful if you know which position you want, for example, symmetry to be computed over.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for processing of the map. |
Definition at line 1099 of file ProSHADE_data.cpp.
1102 std::stringstream ss;
1103 ss <<
"Moving map box centre to " << settings->
boxCentre.at(0) <<
"; " << settings->
boxCentre.at(1) <<
"; " << settings->
boxCentre.at(2) <<
" .";
1107 proshade_double xSamplingRate =
static_cast<proshade_double
> ( this->
xDimSize ) /
static_cast<proshade_double
> ( this->
xDimIndices );
1108 proshade_double ySamplingRate =
static_cast<proshade_double
> ( this->
yDimSize ) /
static_cast<proshade_double
> ( this->
yDimIndices );
1109 proshade_double zSamplingRate =
static_cast<proshade_double
> ( this->
zDimSize ) /
static_cast<proshade_double
> ( this->
zDimIndices );
1112 proshade_double startCentreX = ( ( (
static_cast<proshade_double
> ( this->
xTo ) -
static_cast<proshade_double
> ( this->
xFrom ) ) / 2.0 ) * xSamplingRate );
1113 proshade_double startCentreY = ( ( (
static_cast<proshade_double
> ( this->
yTo ) -
static_cast<proshade_double
> ( this->
yFrom ) ) / 2.0 ) * ySamplingRate );
1114 proshade_double startCentreZ = ( ( (
static_cast<proshade_double
> ( this->
zTo ) -
static_cast<proshade_double
> ( this->
zFrom ) ) / 2.0 ) * zSamplingRate );
1117 proshade_double boxStartX = settings->
boxCentre.at(0) - (
static_cast<proshade_double
> ( this->
xFrom ) * xSamplingRate );
1118 proshade_double boxStartY = settings->
boxCentre.at(1) - (
static_cast<proshade_double
> ( this->
yFrom ) * ySamplingRate );
1119 proshade_double boxStartZ = settings->
boxCentre.at(2) - (
static_cast<proshade_double
> ( this->
zFrom ) * zSamplingRate );
1122 proshade_double xShift = startCentreX - boxStartX;
1123 proshade_double yShift = startCentreY - boxStartY;
1124 proshade_double zShift = startCentreZ - boxStartZ;
1127 if ( ( ( settings->
boxCentre.at(0) < (
static_cast<proshade_double
> ( this->
xFrom ) * xSamplingRate ) ) ||
1128 ( settings->
boxCentre.at(0) > (
static_cast<proshade_double
> ( this->
xFrom ) * xSamplingRate +
static_cast<proshade_double
> ( this->
xDimSize ) ) ) ) ||
1129 ( ( settings->
boxCentre.at(1) < (
static_cast<proshade_double
> ( this->
yFrom ) * ySamplingRate ) ) ||
1130 ( settings->
boxCentre.at(1) > (
static_cast<proshade_double
> ( this->
yFrom ) * ySamplingRate +
static_cast<proshade_double
> ( this->
yDimSize ) ) ) ) ||
1131 ( ( settings->
boxCentre.at(2) < (
static_cast<proshade_double
> ( this->
zFrom ) * zSamplingRate ) ) ||
1132 ( settings->
boxCentre.at(2) > (
static_cast<proshade_double
> ( this->
zFrom ) * zSamplingRate +
static_cast<proshade_double
> ( this->
zDimSize ) ) ) ) )
1139 static_cast< proshade_single
> ( xShift ),
1140 static_cast< proshade_single
> ( yShift ),
1141 static_cast< proshade_single
> ( zShift ),
1143 static_cast< proshade_signed
> ( this->
xDimIndices ),
1144 static_cast< proshade_signed
> ( this->
yDimIndices ),
1145 static_cast< proshade_signed
> ( this->
zDimIndices ) );
1148 std::stringstream ss2;
1149 ss2 <<
"Position " << settings->
boxCentre.at(0) <<
"; " << settings->
boxCentre.at(1) <<
"; " << settings->
boxCentre.at(2) <<
" set at the centre of the map box.";
◆ shiftToRotationCentre()
void ProSHADE_internal_data::ProSHADE_data::shiftToRotationCentre |
( |
ProSHADE_settings * |
settings | ) |
|
Function for shifting map so that its rotation centre is at the centre of the box.
This function takes the distance between the detected optimal centre of rotation (as detected by the specialised task) and the centre of the map and proceeds to shift the map so that these two positions would be the same.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for processing of the map. |
Definition at line 1164 of file ProSHADE_data.cpp.
1167 std::stringstream ss;
1173 static_cast< proshade_single
> ( -settings->
centrePosition.at(0) ),
1174 static_cast< proshade_single
> ( -settings->
centrePosition.at(1) ),
1175 static_cast< proshade_single
> ( -settings->
centrePosition.at(2) ),
1176 this->xDimSize, this->yDimSize, this->zDimSize,
1177 static_cast< proshade_signed
> ( this->xDimIndices ),
1178 static_cast< proshade_signed
> ( this->yDimIndices ),
1179 static_cast< proshade_signed
> ( this->zDimIndices ) );
1187 std::stringstream ss2;
1188 ss2 <<
"Map rotation centre shifted.";
◆ so3CoeffsArrayIndex()
int ProSHADE_internal_data::ProSHADE_data::so3CoeffsArrayIndex |
( |
proshade_signed |
order1, |
|
|
proshade_signed |
order2, |
|
|
proshade_signed |
band |
|
) |
| |
This function gets the SO(3) coefficients array index for a particular so(3) band, order1 and order2 position.
It should be noted that this function assumes that the orders are in the format -l < 0 < l and NOT 0 < 2l + 1.
- Parameters
-
[in] | order1 | The first order for which the SO(3) value index is requested. |
[in] | order2 | The second order for which the SO(3) value index is requested. |
[in] | band | The band for which the SO(3) value index is requested. |
[out] | val | Index position of the SO(3) value. |
Definition at line 4484 of file ProSHADE_data.cpp.
4487 return (
static_cast<int> ( so3CoefLoc (
static_cast< int > ( order1 ),
static_cast< int > ( order2 ),
static_cast< int > ( band ),
static_cast< int > ( this->
getEMatDim() ) ) ) );
◆ translateMap()
void ProSHADE_internal_data::ProSHADE_data::translateMap |
( |
proshade_double |
trsX, |
|
|
proshade_double |
trsY, |
|
|
proshade_double |
trsZ |
|
) |
| |
This function simply translates the map by a given number of Angstroms along the three axes.
This function calls the internal functions to first provide the maximum possible movement by changing the frame of the map and secondly, it make the precise movement within this new frame using the Fourier translation approach.
- Parameters
-
[in] | settings | The settings object specifying how exactly the rotation is to be done. |
[in] | trsX | The translation expressed as a number of angstroms to move by along the x-axis. |
[in] | trsY | The translation expressed as a number of angstroms to move by along the y-axis. |
[in] | trsZ | The translation expressed as a number of angstroms to move by along the z-axis. |
Definition at line 1064 of file ProSHADE_overlay.cpp.
1067 proshade_single xMov =
static_cast< proshade_single
> ( -trsX );
1068 proshade_single yMov =
static_cast< proshade_single
> ( -trsY );
1069 proshade_single zMov =
static_cast< proshade_single
> ( -trsZ );
1078 static_cast< proshade_signed
> ( this->
getXDim() ),
static_cast< proshade_signed
> ( this->
getYDim() ),
1079 static_cast< proshade_signed
> ( this->
getZDim() ) );
◆ writeGemmi()
void ProSHADE_internal_data::ProSHADE_data::writeGemmi |
( |
std::string |
fName, |
|
|
gemmi::Structure |
gemmiStruct, |
|
|
proshade_double |
euA = 0.0 , |
|
|
proshade_double |
euB = 0.0 , |
|
|
proshade_double |
euG = 0.0 , |
|
|
proshade_double |
trsX = 0.0 , |
|
|
proshade_double |
trsY = 0.0 , |
|
|
proshade_double |
trsZ = 0.0 , |
|
|
proshade_double |
rotX = 0.0 , |
|
|
proshade_double |
rotY = 0.0 , |
|
|
proshade_double |
rotZ = 0.0 , |
|
|
bool |
firstModel = true |
|
) |
| |
This function writes out the gemmi::Structure object with ProSHADE type rotation and translation applied.
This function takes loaded gemmi::Structure object and applies specific rotation and translations to it. These are intended to be the results of ProSHADE Overlay mode compuations, but could be anything else, as long as the usage is correct. Finally, it writes out a PDB formatted file with the now positions.
- Parameters
-
[in] | fName | The filename (including path) to where the output PDB file should be saved. |
[in] | gemmiStruct | gemmi::Structure object which should be modified and written out. |
[in] | euA | The Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | euB | The Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | euG | The Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | trsX | The translation to be done along X-axis in Angstroms. |
[in] | trsY | The translation to be done along Y-axis in Angstroms. |
[in] | trsZ | The translation to be done along Z-axis in Angstroms. |
[in] | rotX | The translation to be done along X-axis in Angstroms. |
[in] | rotY | The translation to be done along Y-axis in Angstroms. |
[in] | rotZ | The translation to be done along Z-axis in Angstroms. |
[in] | firstModel | Should only the first model, or rather all of them be used? |
Definition at line 1020 of file ProSHADE_data.cpp.
1023 if ( ( euA != 0.0 ) || ( euB != 0.0 ) || ( euG != 0.0 ) )
1033 std::ofstream outCoOrdFile;
1034 outCoOrdFile.open ( fName.c_str() );
1036 if ( outCoOrdFile.is_open() )
1038 gemmi::PdbWriteOptions opt;
1039 write_pdb ( gemmiStruct, outCoOrdFile, opt );
1043 std::stringstream hlpMessage;
1044 hlpMessage <<
"Failed to open the PDB file " << fName <<
" for output.";
1045 throw ProSHADE_exception ( hlpMessage.str().c_str(),
"EP00048", __FILE__, __LINE__, __func__,
"ProSHADE has failed to open the PDB output file. This is\n : likely caused by either not having the write privileges\n : to the required output path, or by making a mistake in\n : the path." );
1048 outCoOrdFile.close ( );
◆ writeMap()
void ProSHADE_internal_data::ProSHADE_data::writeMap |
( |
std::string |
fName, |
|
|
std::string |
title = "Created by ProSHADE and written by GEMMI" , |
|
|
int |
mode = 2 |
|
) |
| |
Function for writing out the internal structure representation in MRC MAP format.
This function takes all the internal map representation information from the calling object and proceeds to write all this information in MRC MAP format for visualisation and possibly further processing by other software. This function will write out axis order XYZ and spacegroup P1 irrespective of the input axis order and spacegroup.
- Parameters
-
[in] | fName | The filename (including path) to where the output MAP file should be saved. |
[in] | title | String with the map title to be written into the header - default value is "Created by ProSHADE and written by GEMMI" |
[in] | mode | The type of the data, leave at default 2 (mean float type) unless you specifically required other types. |
Definition at line 916 of file ProSHADE_data.cpp.
919 gemmi::Grid<float> mapData;
920 mapData.set_unit_cell (
static_cast< double > ( this->
xDimSize ),
static_cast< double > ( this->
yDimSize ),
static_cast< double > ( this->
zDimSize ),
static_cast< double > ( this->
aAngle ),
static_cast< double > ( this->
bAngle ),
static_cast< double > ( this->
cAngle ) );
921 mapData.set_size_without_checking (
static_cast< int > ( this->
xDimIndices ),
static_cast< int > ( this->
yDimIndices ),
static_cast< int > ( this->
zDimIndices ) );
922 mapData.axis_order = gemmi::AxisOrder::XYZ;
923 mapData.spacegroup = &gemmi::get_spacegroup_p1();
926 gemmi::Ccp4<float> map;
928 map.update_ccp4_header ( mode );
942 proshade_unsign arrPos = 0;
943 for ( proshade_unsign uIt = 0; uIt < this->
xDimIndices; uIt++ )
945 for ( proshade_unsign vIt = 0; vIt < this->
yDimIndices; vIt++ )
947 for ( proshade_unsign wIt = 0; wIt < this->
zDimIndices; wIt++ )
949 arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
950 map.grid.set_value (
static_cast< int > ( uIt ),
static_cast< int > ( vIt ),
static_cast< int > ( wIt ),
static_cast<float> ( this->
internalMap[arrPos] ) );
956 map.update_ccp4_header ( mode,
true );
959 map.write_ccp4_map ( fName );
◆ writeMask()
void ProSHADE_internal_data::ProSHADE_data::writeMask |
( |
std::string |
fName, |
|
|
proshade_double * |
mask |
|
) |
| |
Function for writing out a mask in MRC MAP format.
This function takes a mask map and the filename and proceeds to write out the mask into the requested file name in th MRC MAP format. It assumes that the mask has the same dimmensions as the map.
- Parameters
-
[in] | fileName | The filename (including path) to where the output should be saved. |
[in] | mask | Pointer to the mask map array. |
Definition at line 1062 of file ProSHADE_data.cpp.
◆ writeOutOverlayFiles()
void ProSHADE_internal_data::ProSHADE_data::writeOutOverlayFiles |
( |
ProSHADE_settings * |
settings, |
|
|
proshade_double |
eulA, |
|
|
proshade_double |
eulB, |
|
|
proshade_double |
eulG, |
|
|
std::vector< proshade_double > * |
rotCentre, |
|
|
std::vector< proshade_double > * |
ultimateTranslation |
|
) |
| |
This function writes out the rotated map, co-ordinates and transformation JSON file.
This function takes basically all the results of the overlay mode and appropriately applies them to write out the moved density map, if possible the moved co-ordinates and also the overlay operations listing JSON file.
- Parameters
-
[in] | settings | A pointer to settings class containing all the information required for map manipulation. |
[in] | eulA | The Euler alpha angle value, by which the moving structure is to be rotated by. |
[in] | eulB | The Euler beta angle value, by which the moving structure is to be rotated by. |
[in] | eulG | The Euler gamma angle value, by which the moving structure is to be rotated by. |
[in] | rotCentre | The rotation centre position. |
[in] | ultimateTranslation | The final translation as determined by the translation function. |
Definition at line 4709 of file ProSHADE_data.cpp.
4712 std::stringstream fNameHlp;
4721 this->
writePdb ( fNameHlp.str(), eulA, eulB, eulG, ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2), rotCentre->at(0), rotCentre->at(1), rotCentre->at(2), settings->
firstModelOnly );
4727 ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2),
◆ writePdb()
void ProSHADE_internal_data::ProSHADE_data::writePdb |
( |
std::string |
fName, |
|
|
proshade_double |
euA = 0.0 , |
|
|
proshade_double |
euB = 0.0 , |
|
|
proshade_double |
euG = 0.0 , |
|
|
proshade_double |
trsX = 0.0 , |
|
|
proshade_double |
trsY = 0.0 , |
|
|
proshade_double |
trsZ = 0.0 , |
|
|
proshade_double |
rotX = 0.0 , |
|
|
proshade_double |
rotY = 0.0 , |
|
|
proshade_double |
rotZ = 0.0 , |
|
|
bool |
firstModel = true |
|
) |
| |
This function writes out the co-ordinates file with ProSHADE type rotation and translation applied.
This function first checks if this internal structure originated from co-ordinate file (only if co-ordinates are provided can they be written out). If so, it will proceed to read in the original co-ordinates into gemmi::Structure object and call the gemmi writing out function.
- Parameters
-
[in] | fName | The filename (including path) to where the output PDB file should be saved. |
[in] | euA | The Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | euB | The Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | euG | The Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required). |
[in] | trsX | The translation to be done along X-axis in Angstroms. |
[in] | trsY | The translation to be done along Y-axis in Angstroms. |
[in] | trsZ | The translation to be done along Z-axis in Angstroms. |
[in] | rotX | The translation to be done along X-axis in Angstroms. |
[in] | rotY | The translation to be done along Y-axis in Angstroms. |
[in] | rotZ | The translation to be done along Z-axis in Angstroms. |
[in] | firstModel | Should only the first model, or rather all of them be used? |
Definition at line 983 of file ProSHADE_data.cpp.
988 throw ProSHADE_exception (
"Cannot write co-ordinate file if the input file did not contain co-ordinates.",
"EP00047", __FILE__, __LINE__, __func__,
"You have called the WritePDB function on structure which\n : was created by reading in a map. This is not allowed as\n : ProSHADE cannot create co-ordinates from map file." );
992 gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->
fileName ) );
995 this->
writeGemmi ( fName, pdbFile, euA, euB, euG, trsX, trsY, trsZ, rotX, rotY, rotZ, firstModel );
◆ zeroPaddToDims()
void ProSHADE_internal_data::ProSHADE_data::zeroPaddToDims |
( |
proshade_unsign |
xDim, |
|
|
proshade_unsign |
yDim, |
|
|
proshade_unsign |
zDim |
|
) |
| |
This function changes the size of a structure to fit the supplied new limits.
This function increases the map size by symetrically adding zeroes in each required dimension. The first zero is always added AFTER the structure, so for even size increases, there will be misplacement of centre of mass. The map position in the "real" world should not change.
- Parameters
-
[in] | xDim | The X dimension size to which this structure should be padded into. |
[in] | yDim | The Y dimension size to which this structure should be padded into. |
[in] | zDim | The Z dimension size to which this structure should be padded into. |
Definition at line 433 of file ProSHADE_overlay.cpp.
438 throw ProSHADE_exception (
"Cannot zero-pad in negative direction.",
"EO00034", __FILE__, __LINE__, __func__,
"The requested padded size of a structure is smaller than\n : the current size. If the user sees this error, there is\n : likely a considerable bug. Please report this error." );
445 proshade_unsign addXPre, addYPre, addZPre, addXPost, addYPost, addZPost;
446 ProSHADE_internal_overlay::computeBeforeAfterZeroCounts ( &addXPre, &addYPre, &addZPre, &addXPost, &addYPost, &addZPost, xDim, yDim, zDim, this->
xDimIndices, this->
yDimIndices, this->
zDimIndices );
449 proshade_double* newMap =
new proshade_double [xDim * yDim * zDim];
452 ProSHADE_internal_overlay::paddMapWithZeroes ( this->
internalMap, newMap, xDim, yDim, zDim, this->
xDimIndices, this->
yDimIndices, this->
zDimIndices, addXPre, addYPre, addZPre );
456 this->
internalMap =
new proshade_double [xDim * yDim * zDim];
457 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( xDim * yDim * zDim ); iter++ ) { this->
internalMap[iter] = newMap[iter]; }
463 this->
xDimSize =
static_cast< proshade_single
> ( xDim ) * ( this->
xDimSize /
static_cast< proshade_single
> ( this->
xDimIndices ) );
464 this->
yDimSize =
static_cast< proshade_single
> ( yDim ) * ( this->
yDimSize /
static_cast< proshade_single
> ( this->
yDimIndices ) );
465 this->
zDimSize =
static_cast< proshade_single
> ( zDim ) * ( this->
zDimSize /
static_cast< proshade_single
> ( this->
zDimIndices ) );
468 this->
xFrom -= addXPre ; this->
yFrom -= addYPre ; this->
zFrom -= addZPre;
469 this->
xTo += addXPost; this->
yTo += addYPost; this->
zTo += addZPost;
The documentation for this class was generated from the following files:
void addToDblPtrVectorVector(std::vector< std::vector< proshade_double * > > *vecToAddTo, std::vector< proshade_double * > elementToAdd)
Adds the element to the vector of vectors of double pointers.
proshade_double noIQRsFromMedianNaivePeak
When doing peak searching, how many IQRs from the median the threshold for peak height should be (in ...
void normaliseEMatrices(ProSHADE_internal_data::ProSHADE_data *obj1, ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function normalises the E matrices.
bool sortProSHADESymmetryByPeak(proshade_double *a, proshade_double *b)
This function allows using std::sort to sort vectors of ProSHADE symmetry format..
proshade_double originalMapYCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
proshade_unsign maxBandwidth
The bandwidth of spherical harmonics decomposition for the largest sphere.
void addExtraBoundSpace(proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_signed *&bounds, proshade_single extraSpace)
This function takes a set of bounds and adds a given number of Angstroms to them.
proshade_double mapMovFromsChangeX
When the map is translated, the xFrom and xTo values are changed. This variable holds how much they h...
void allocateRotatedSHMemory(void)
This function allocates the memory required for storing the rotated Spherical Harmonics coefficients.
std::vector< proshade_double * > cyclicSymmetries
This is where the detected cyclic ("C") symmetries will be kept.
void determinePDBRanges(gemmi::Structure pdbFile, proshade_single *xFrom, proshade_single *xTo, proshade_single *yFrom, proshade_single *yTo, proshade_single *zFrom, proshade_single *zTo, bool firstModel)
Function for finding the PDB file ranges.
std::string fileName
This is the original file from which the data were obtained.
proshade_signed zFrom
This is the starting index along the z axis.
bool detectOctahedralSymmetry(std::vector< proshade_double * > *CSymList, proshade_double axErr, proshade_double minPeakHeight)
This function takes the list of C symmetries and decides whether basic requirements for octahhedral s...
std::string rotTrsJSONFile
The filename to which the rotation and translation operations are to be saved into.
proshade_unsign xDimIndices
This is the size of the map cell x dimension in indices.
proshade_single getZDimSize(void)
This function allows access to the map size in angstroms along the Z axis.
void getEulerZYZFromSOFTPosition(proshade_signed band, proshade_signed x, proshade_signed y, proshade_signed z, proshade_double *eulerAlpha, proshade_double *eulerBeta, proshade_double *eulerGamma)
Function to find Euler angles (ZYZ convention) from index position in the inverse SOFT map.
void changePDBBFactors(gemmi::Structure *pdbFile, proshade_double newBFactorValue, bool firstModel)
Function for changing the PDB B-factor values to a specific single value.
void readInMAP(ProSHADE_settings *settings, proshade_double *maskArr=nullptr, proshade_unsign maskXDim=0, proshade_unsign maskYDim=0, proshade_unsign maskZDim=0, proshade_double *weightsArr=nullptr, proshade_unsign weigXDim=0, proshade_unsign weigYDim=0, proshade_unsign weigZDim=0)
Function for reading map data using gemmi library.
proshade_single zDimSizeOriginal
This is the size of the map cell z dimension in Angstroms.
void vectorMeanAndSD(std::vector< proshade_double > *vec, proshade_double *&ret)
Function to get vector mean and standard deviation.
proshade_double determinePeakThreshold(std::vector< proshade_double > inArr, proshade_double noIQRsFromMedian, proshade_double startMinVal)
This function takes a vector of values and determines the threshold for removing noise from it.
void addToDblPtrVector(std::vector< proshade_double * > *vecToAddTo, proshade_double *elementToAdd)
Adds the element to the vector.
void determineRecommendedSymmetry(ProSHADE_settings *settings, proshade_double threshold, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function takes all the detected symmetry results and decides on which are to be recommended for ...
bool isPrime(proshade_unsign toCheck)
This function check is the supplied number is prime or not.
bool isFilePDB(std::string fName)
Function determining if the input data type is PDB.
proshade_unsign getLocalBandwidth(void)
This function returns the local bandwidth.
proshade_unsign maxSymmetryFold
The highest symmetry fold to search for.
proshade_unsign xGridIndices
As far as I know, this is identical to the xDimIndices.
proshade_complex * translationMap
This is where the translation map will be held, if at all used.
std::vector< std::vector< proshade_double > > joinElementsFromDifferentGroups(std::vector< std::vector< proshade_double > > *first, std::vector< std::vector< proshade_double > > *second, proshade_double matrixTolerance, bool combine)
This function joins two group element lists using only unique elements.
proshade_unsign xAxisOrder
This is the order of the x axis.
void getPredictedIcosahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function predicts a list of all I symmetry axes from the already computed C symmetries list.
proshade_complex ** rotSphericalHarmonics
A set of rotated spherical harmonics values arrays for each sphere, used only if map rotation is requ...
void determineAllSHValues(proshade_unsign xDim, proshade_unsign yDim, proshade_single xDimAngs, proshade_single yDimAngs, proshade_single zDimAngs)
This function determines all the required values for spherical harmonics computation.
std::vector< proshade_double * > decidePolyFromList(ProSHADE_settings *settings, std::vector< std::vector< proshade_double * > > *polyList, size_t fullGroupSize, std::vector< proshade_double * > *CSyms, proshade_double tolerance, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function takes a list of predicted polyheral groups and decides which is most likely using the F...
proshade_complex ** sphericalHarmonics
A set of spherical harmonics values arrays for each sphere.
void interpolateMapFromSpheres(proshade_double *&densityMapRotated)
This function interpolates the density map from the sphere mapped data.
proshade_single cAngle
This is the angle c of the map cell in degrees.
proshade_double computeFSC(fftw_complex *fCoeffs1, fftw_complex *fCoeffs2, proshade_signed xInds, proshade_signed yInds, proshade_signed zInds, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&binData, proshade_signed *&binCounts, proshade_double *&fscByBin, bool averageByBinSize=false)
This function computes the FSC.
proshade_complex * so3CoeffsInverse
The inverse coefficients obtained by inverse SO(3) Fourier Transform (SOFT) - i.e....
proshade_signed * getXAxisOrigin(void)
This function allows access to the map X axis origin value.
proshade_signed addAxisUnlessSame(proshade_unsign fold, proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axHeight, proshade_double averageFSC, std::vector< proshade_double * > *prosp, proshade_double axErr)
This function simply creates a new axis from information in aruments and tests if no such axis alread...
proshade_double yCom
The COM of the map after processing along the Y-axis.
proshade_single boundsExtraSpace
The number of extra angstroms to be added to all re-boxing bounds just for safety.
This class contains all inputed data for the rotation function angle-axis converted spheres.
This class is the representation of ProSHADE exception.
void findPredictedAxesHeights(std::vector< proshade_double * > *ret, ProSHADE_internal_data::ProSHADE_data *dataObj, ProSHADE_settings *settings)
This function finds the rotation function value for all axes supplied in the ret parameter.
proshade_single blurFactor
This is the amount by which B-factors should be increased to create the blurred map for masking.
bool maskMap
Should the map be masked from noise?
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
std::string requestedSymmetryType
The symmetry type requested by the user. Allowed values are C, D, T, O and I.
void allocateRRPMemory()
This function allocates the required memory for the RRP matrices.
void getRotationMatrixFromEulerZYZAngles(proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *matrix)
Function to find the rotation matrix from Euler angles (ZYZ convention).
proshade_single getXDimSize(void)
This function allows access to the map size in angstroms along the X axis.
proshade_double *& getInternalMap(void)
This function allows access to the first map array value address.
proshade_unsign noSpheres
The number of spheres with map projected onto them.
bool removeNegativeDensity
Should the negative density be removed from input files?
proshade_single getYDimSize(void)
This function allows access to the map size in angstroms along the Y axis.
proshade_unsign inputOrder
This value is the input order - it is useful to know for writing out files, so that they would not ov...
void getMaskFromBlurr(proshade_double *&blurMap, proshade_double *&outMap, proshade_unsign xDimS, proshade_unsign yDimS, proshade_unsign zDimS, proshade_single noIQRs)
Function for computing mask from blurred map.
proshade_single zDimSize
This is the size of the map cell z dimension in Angstroms.
proshade_complex * so3Coeffs
The coefficients obtained by SO(3) Fourier Transform (SOFT), in this case derived from the E matrices...
bool saveMask
Should the mask be saved?
proshade_single requestedResolution
The resolution to which the calculations are to be done.
bool isBandWithinShell(proshade_unsign bandInQuestion, proshade_unsign shellInQuestion, ProSHADE_internal_spheres::ProSHADE_sphere **spheres)
This function checks if a band is available for a given shell.
proshade_double mapCOMProcessChangeX
The change in X axis between the creation of the structure (originalMapXCom) and just before rotation...
proshade_double minSymPeak
Minimum average peak for symmetry axis to be considered as "real".
void blurSharpenMap(proshade_double *&map, proshade_double *&maskedMap, proshade_unsign xDimS, proshade_unsign yDimS, proshade_unsign zDimS, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_single blurringFactor)
Function for blurring/sharpening maps.
proshade_double originalMapXCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
proshade_unsign xDimIndicesOriginal
This is the size of the map cell x dimension in indices.
void moveMapByFourier(proshade_double *&map, proshade_single xMov, proshade_single yMov, proshade_single zMov, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
Function for moving map back to original PDB location by using Fourier transformation.
bool progressiveSphereMapping
If true, each shell will have its own angular resolution dependent on the actual number of map points...
void movePDBForMapCalc(gemmi::Structure *pdbFile, proshade_single xMov, proshade_single yMov, proshade_single zMov, bool firstModel)
Function for moving co-ordinate atoms to better suit theoretical map computation.
void saveRequestedSymmetryD(ProSHADE_settings *settings, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed cutXDim, proshade_signed cutYDim, proshade_signed cutZDim)
This function takes the D symmetries and searched for the requested symmetry.
proshade_single maxSphereDists
The distance between spheres in spherical mapping for the largest sphere.
proshade_unsign maxShellBand
The maximum band for any shell of the object.
proshade_double originalPdbRotCenY
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
void getSpherePositions(ProSHADE_settings *settings)
This function determines the sphere positions (radii) for sphere mapping.
void invertMirrorMap(ProSHADE_settings *settings)
Function for inverting the map to its mirror image.
bool checkElementsFormGroup(std::vector< std::vector< proshade_double > > *elements, proshade_double matrixTolerance)
This function checks if all group element products produce another group element.
std::vector< proshade_double > getMapCOMProcessChange(void)
This function allows access to the translation caused by structure processing.
void computeBeforeAfterZeroCounts(proshade_unsign *addXPre, proshade_unsign *addYPre, proshade_unsign *addZPre, proshade_unsign *addXPost, proshade_unsign *addYPost, proshade_unsign *addZPost, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_unsign xDimIndices, proshade_unsign yDimIndices, proshade_unsign zDimIndices)
This function finds the number of zeroes to be added after and before the structure along each dimens...
proshade_double mapCOMProcessChangeZ
The change in Z axis between the creation of the structure (originalMapZCom) and just before rotation...
proshade_single maskingThresholdIQRs
Number of inter-quartile ranges from the median to be used for thresholding the blurred map for maski...
bool usePhase
If true, the full data will be used, if false, Patterson maps will be used instead and phased data wi...
proshade_single xDimSizeOriginal
This is the size of the map cell x dimension in Angstroms.
void printWarningMessage(proshade_signed verbose, std::string message, std::string warnCode)
General stderr message printing (used for warnings).
InputType figureDataType(std::string fName)
Function determining input data type.
void reSampleMapToResolutionTrilinear(proshade_double *&map, proshade_single resolution, proshade_unsign xDimS, proshade_unsign yDimS, proshade_unsign zDimS, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_single *&corrs)
This function re-samples a map to conform to given resolution using tri-linear interpolation.
proshade_signed zAxisOriginOriginal
This is the origin position along the z axis.
std::vector< proshade_double * > icosahedralSymmetries
This is where the detected icosahedral ("I") symmetries will be kept.
This class contains all inputed and derived data for a single sphere.
proshade_double getRotatedMappedData(proshade_unsign pos)
This function gets the rotated mapped data value for a particular position.
std::string maskFileName
The filename to which mask should be saved.
void freeTranslationFunctionMemory(fftw_complex *&tmpIn1, fftw_complex *&tmpOut1, fftw_complex *&tmpIn2, fftw_complex *&tmpOut2, fftw_complex *&resOut, fftw_plan &forwardFourierObj1, fftw_plan &forwardFourierObj2, fftw_plan &inverseFourierCombo)
This function releases the memory for the Fourier transforms required for translation function comput...
proshade_complex *** eMatrices
The trace sigma and full rotation function c*conj(c) integral tables.
void centreMapOnCOM(ProSHADE_settings *settings)
This function shits the map so that its COM is in the centre of the map.
proshade_signed * getXFromPtr(void)
This function allows access to the map start along the X axis.
proshade_signed verbose
Should the software report on the progress, or just be quiet? Value between -1 (nothing) and 4 (loud)
std::vector< std::vector< proshade_double > > getAllGroupElements(std::vector< proshade_unsign > axesList, std::string groupType="", proshade_double matrixTolerance=0.05)
This function returns the group elements as rotation matrices of any defined point group.
proshade_unsign yDimIndices
This is the size of the map cell y dimension in indices.
proshade_signed xAxisOriginOriginal
This is the origin position along the x axis.
proshade_signed messageShift
This value allows shifting the messages to create more readable log for sub-processes.
void changeFourierOrder(fftw_complex *&fCoeffs, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, bool negativeFirst)
This function changes the order of Fourier coefficients in a 3D array between positive first (default...
void readInGemmi(gemmi::Structure *gemmiStruct, ProSHADE_settings *settings)
Function for reading co-ordinate data from Gemmi object.
proshade_unsign yGridIndices
As far as I know, this is identical to the yDimIndices.
bool changeMapResolutionTriLinear
Should maps be re-sampled to obtain the required resolution?
proshade_signed zAxisOrigin
This is the origin position along the z axis.
void addToDoubleVector(std::vector< proshade_double > *vecToAddTo, proshade_double elementToAdd)
Adds the element to the vector.
void shiftToRotationCentre(ProSHADE_settings *settings)
Function for shifting map so that its rotation centre is at the centre of the box.
void setPDBMapValues(void)
Function for determining iterator start and stop positions.
void findMapCOM(void)
This function finds the centre of mass of the internal map representation.
proshade_unsign yDimIndicesOriginal
This is the size of the map cell y dimension in indices.
proshade_unsign getXDim(void)
This function allows access to the map size in indices along the X axis.
void removeWaters(gemmi::Structure *pdbFile, bool firstModel)
This function removed all waters from PDB input file.
bool useBiCubicInterpolationOnPeaks
This variable switch decides whether best symmetry is detected from peak indices, or whether bicubic ...
proshade_double originalPdbTransX
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
void cutIndicesToResolution(proshade_signed xInds, proshade_signed yInds, proshade_signed zInds, proshade_single resolution, proshade_signed *binIndexing, std::vector< proshade_single > *resArray, proshade_signed *cutXDim, proshade_signed *cutYDim, proshade_signed *cutZDim, proshade_signed *&cutBinIndices, proshade_signed *&noBins)
This function cuts the bin assignment array into a smaller array containing all bins up to a given re...
proshade_signed zTo
This is the final index along the z axis.
proshade_signed xTo
This is the final index along the x axis.
void writeMask(std::string fName, proshade_double *mask)
Function for writing out a mask in MRC MAP format.
proshade_double integrationWeight
The Pearson's c.c. type weighting for the integration.
proshade_double peakThresholdMin
The threshold for peak height above which axes are considered possible.
proshade_signed xAxisOrigin
This is the origin position along the x axis.
proshade_double originalPdbTransY
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
void generateSO3CoeffsFromEMatrices(ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function converts the E matrices to SO(3) coefficients.
void computeWignerMatricesForRotation(ProSHADE_settings *settings, ProSHADE_internal_data::ProSHADE_data *obj, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma)
This function computes the Wigner D matrices for a particular set of Euler angles.
proshade_double *** rrpMatrices
The energy levels descriptor shell correlation tables.
proshade_signed yTo
This is the final index along the y axis.
bool forceP1
Should the P1 spacegroup be forced on the input PDB files?
proshade_single xDimSize
This is the size of the map cell x dimension in Angstroms.
proshade_double computeDotProduct(proshade_double *x1, proshade_double *y1, proshade_double *z1, proshade_double *x2, proshade_double *y2, proshade_double *z2)
Simple 3D vector dot product computation.
void computeRotatedSH(void)
This function multiplies the objects spherical harmonics with the Wigner D matrices,...
std::vector< proshade_double > calcBounds
The boundaries to be used for deciding the calculation thresholds (band, integration order,...
void addToSignedVector(std::vector< proshade_signed > *vecToAddTo, proshade_signed elementToAdd)
Adds the element to the vector.
void prepareFSCFourierMemory(proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed *noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_single resolution, proshade_signed *cutXDim, proshade_signed *cutYDim, proshade_signed *cutZDim)
This function allocates the memory and makes all preparations required for FSC computation.
void getPredictedTetrahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function predicts a list of all T symmetry axes from the already computed C symmetries list.
proshade_double mapMovFromsChangeY
When the map is translated, the yFrom and yTo values are changed. This variable holds how much they h...
proshade_signed yAxisOrigin
This is the origin position along the y axis.
void getBestPeakEulerAngsNaive(proshade_complex *map, proshade_unsign dim, proshade_double *eulA, proshade_double *eulB, proshade_double *eulG, ProSHADE_settings *settings)
This function finds the highest peaks optimised Euler angles using the "naive" approach.
void deepCopyAxisToDblPtrVector(std::vector< proshade_double * > *dblPtrVec, proshade_double *axis)
Does a deep copy of a double array to a vector of double arrays.
proshade_unsign yAxisOrder
This is the order of the y axis.
proshade_double * internalMap
The internal map data representation, which may be amended as the run progresses.
void writePdb(std::string fName, proshade_double euA=0.0, proshade_double euB=0.0, proshade_double euG=0.0, proshade_double trsX=0.0, proshade_double trsY=0.0, proshade_double trsZ=0.0, proshade_double rotX=0.0, proshade_double rotY=0.0, proshade_double rotZ=0.0, bool firstModel=true)
This function writes out the co-ordinates file with ProSHADE type rotation and translation applied.
proshade_unsign zDimIndicesOriginal
This is the size of the map cell z dimension in indices.
proshade_double complexMultiplicationConjugRealOnly(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2)
Function to conjuggate multiply two complex numbers and return the real part only.
proshade_signed xFrom
This is the starting index along the x axis.
proshade_double computeFSC(ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, size_t symIndex, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_unsign rotNumber=1)
This function computes FSC for any given axis in the supplied CSym symmetry axes vector.
void getRotationMatrixFromAngleAxis(proshade_double *rotMat, proshade_double x, proshade_double y, proshade_double z, proshade_double ang)
This function converts the axis-angle representation to the rotation matrix representation.
void writeMap(std::string fName, std::string title="Created by ProSHADE and written by GEMMI", int mode=2)
Function for writing out the internal structure representation in MRC MAP format.
proshade_unsign getMaxBand(void)
This function returns the maximum band value for the object.
void shiftToBoxCentre(ProSHADE_settings *settings)
Function for shifting map so that its centre of box is at required position.
std::string appliedMaskFileName
The filename from which mask data will be read from.
void invertSHCoefficients(void)
This function computes the shell mapped data from inverting the Spherical Harmonics coefficients.
bool detectIcosahedralSymmetry(std::vector< proshade_double * > *CSymList, proshade_double axErr, proshade_double minPeakHeight)
This function takes the list of C symmetries and decides whether basic requirements for isosahedral s...
proshade_single resolutionOversampling
How much (%) should the requested resolution be over-sampled by map re-sampling?
proshade_single coOrdsExtraSpace
This number of Angstroms will be added before and any co-ordinates to make sure there is no atom dire...
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
void writeGemmi(std::string fName, gemmi::Structure gemmiStruct, proshade_double euA=0.0, proshade_double euB=0.0, proshade_double euG=0.0, proshade_double trsX=0.0, proshade_double trsY=0.0, proshade_double trsZ=0.0, proshade_double rotX=0.0, proshade_double rotY=0.0, proshade_double rotZ=0.0, bool firstModel=true)
This function writes out the gemmi::Structure object with ProSHADE type rotation and translation appl...
proshade_single addExtraSpace
If this value is non-zero, this many angstroms of empty space will be added to the internal map.
proshade_unsign getYDim(void)
This function allows access to the map size in indices along the Y axis.
void findHighestValueInMap(fftw_complex *resIn, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD, proshade_double *trsX, proshade_double *trsY, proshade_double *trsZ, proshade_double *mapPeak)
This function simply finds the highest value in fftw_complex map and returns its position and value.
void maskMap(ProSHADE_settings *settings)
Function for computing the map mask using blurring and X IQRs from median.
void getNonZeroBounds(proshade_double *map, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_signed *&ret)
Function for finding the map boundaries enclosing positive only values.
proshade_double xCom
The COM of the map after processing along the X-axis.
void getAxisAngleFromRotationMatrix(proshade_double *rotMat, proshade_double *x, proshade_double *y, proshade_double *z, proshade_double *ang, proshade_signed verbose=1)
This function converts rotation matrix to the axis-angle representation.
proshade_double fscThreshold
The threshold for FSC value under which the axis is considered to be likely noise.
proshade_double originalPdbTransZ
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
proshade_unsign supportedSymmetryFold
Maximum supported fold by the map.
void readInMapData(gemmi::Ccp4< float > *gemmiMap, proshade_double *&map, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_unsign xAxOrder, proshade_unsign yAxOrder, proshade_unsign zAxOrder)
This function converts the gemmi Ccp4 object data to ProSHADE internal map representation.
void computeEMatrices(ProSHADE_internal_data::ProSHADE_data *obj1, ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function computes the complete E matrices and their weights between any two objects.
proshade_complex * getTranslationFnPointer(void)
This function allows access to the translation function through a pointer.
void findMAPCOMValues(proshade_double *map, proshade_double *xCom, proshade_double *yCom, proshade_double *zCom, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_signed xFrom, proshade_signed xTo, proshade_signed yFrom, proshade_signed yTo, proshade_signed zFrom, proshade_signed zTo, bool removeNegDens)
This function finds the Centre of Mass for a map.
void combineFourierForTranslation(fftw_complex *tmpOut1, fftw_complex *tmpOut2, fftw_complex *&resOut, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD)
This function combines Fourier coefficients of two structures in a way, so that inverse Fourier of th...
proshade_double zCom
The COM of the map after processing along the Z-axis.
std::vector< std::vector< proshade_double * > > dihedralSymmetries
This is where the detected dihedral ("D") symmetries will be kept.
std::vector< proshade_single > spherePos
Vector of sphere radii from the centre of the map.
bool invertMap
Should the map be inverted? Only use this if you think you have the wrong hand in your map.
proshade_unsign getZDim(void)
This function allows access to the map size in indices along the Z axis.
std::vector< proshade_double > centrePosition
The position of the centre of the map in "real space" co-ordinates.
void removeMapPhase(fftw_complex *&mapCoeffs, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim)
This function removes the phase from reciprocal (frequency) map.
proshade_signed boundsSimilarityThreshold
Number of indices which can be added just to make sure same size in indices is achieved.
void computeAngularThreshold(std::vector< proshade_double > *lonCO, std::vector< proshade_double > *latCO, proshade_unsign angRes)
This function computes the angular thresholds for longitude and lattitude angles.
void initialiseInverseSHComputation(proshade_unsign shBand, double *&sigR, double *&sigI, double *&rcoeffs, double *&icoeffs, double *&weights, double *&workspace, fftw_plan &idctPlan, fftw_plan &ifftPlan)
This function initialises internal variables for inverse Spherical Harmonics computation.
bool changeMapResolution
Should maps be re-sampled to obtain the required resolution?
void writeRotationTranslationJSON(proshade_double trsX1, proshade_double trsY1, proshade_double trsZ1, proshade_double eulA, proshade_double eulB, proshade_double eulG, proshade_double trsX2, proshade_double trsY2, proshade_double trsZ2, std::string fileName)
Function for writing out the optimal rotation and translation into a JSON file.
std::vector< proshade_signed > primeFactorsDecomp(proshade_signed number)
Function to find prime factors of an integer.
proshade_double mapMovFromsChangeZ
When the map is translated, the zFrom and zTo values are changed. This variable holds how much they h...
void axesToGroupTypeSanityCheck(proshade_unsign requiredAxes, proshade_unsign obtainedAxes, std::string groupType)
This function checks that the required and obtained numbers of axes are correct, printing error if th...
proshade_unsign recommendedSymmetryFold
The fold of the recommended symmetry C or D type, 0 otherwise.
This class contains peak groups detected in the rotation function mapped spheres.
std::vector< proshade_double * > recommendedSymmetryValues
The axes and other info of the recommended symmetry for the structure.
std::string overlayStructureName
The filename to which the rotated and translated moving structure is to be saved.
bool isAxisUnique(std::vector< proshade_double * > *CSymList, proshade_double *axis, proshade_double tolerance=0.1, bool improve=false)
This function checks if new axis is unique, or already detected.
proshade_double getMapValue(proshade_unsign pos)
This function returns the internal map representation value of a particular array position.
proshade_signed * getYToPtr(void)
This function allows access to the map last position along the Y axis.
void computeInverseSOFTTransform(ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function computes the inverse SO(3) transform.
bool moveToCOM
Logical value stating whether the structure should be moved to have its Centre Of Mass (COM) in the m...
proshade_unsign peakNeighbours
Number of points in any direction that have to be lower than the considered index in order to conside...
proshade_double maxRadius
The maximum distance from centre in Angstroms for a map value to still be used.
proshade_complex *** wignerMatrices
These matrices are computed for a particular rotation to be done in spherical harmonics.
ProSHADE_internal_io::InputType fileType
This is the type of the input file.
std::vector< proshade_double > rotateMapRealSpace(proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, proshade_double *&map)
This function rotates a map based on the given angle-axis rotation.
proshade_signed * getZAxisOrigin(void)
This function allows access to the map Z axis origin value.
void writeOutMapHeader(gemmi::Ccp4< float > *map, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_single xDim, proshade_single yDim, proshade_single zDim, proshade_single aAng, proshade_single bAng, proshade_single cAng, proshade_signed xFrom, proshade_signed yFrom, proshade_signed zFrom, proshade_signed xAxOrigin, proshade_signed yAxOrigin, proshade_signed zAxOrigin, proshade_unsign xAxOrder, proshade_unsign yAxOrder, proshade_unsign zAxOrder, proshade_unsign xGridInds, proshade_unsign yGridInds, proshade_unsign zGridInds, std::string title, int mode)
This function parses the CCP4 MAP file header as read in by gemmi.
proshade_signed myRound(proshade_double x)
Calls the appropriate version of round function depending on compiler version.
proshade_single yDimSizeOriginal
This is the size of the map cell y dimension in Angstroms.
proshade_double * compute3x3MatrixVectorMultiplication(proshade_double *mat, proshade_double x, proshade_double y, proshade_double z)
Function for computing a 3x3 matrix to 3x1 vector multiplication.
void findPDBCOMValues(gemmi::Structure *pdbFile, proshade_double *xCom, proshade_double *yCom, proshade_double *zCom, bool firstModel)
This function finds the Centre of Mass for the co-ordinate file.
proshade_unsign zAxisOrder
This is the order of the z axis.
void beautifyBoundaries(proshade_signed *&bounds, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_signed boundsDiffThres)
Function for modifying boundaries to a mathematically more pleasant values.
void predictOctaAxes(std::vector< proshade_double * > *CSymList, std::vector< std::vector< proshade_double * > > *ret, proshade_double axErr, proshade_double minPeakHeight)
This function predicts all octahedral point group symmetry axes from the cyclic point groups list.
void reSampleMap(ProSHADE_settings *settings)
This function changes the internal map sampling to conform to particular resolution value.
std::vector< proshade_double > boxCentre
If box centre is to be in any other location, this variable will hold the real space location that sh...
void rotateFourierCoeffs(proshade_double axX, proshade_double axY, proshade_double axZ, proshade_double axAng, fftw_complex *&coeffs, fftw_complex *&rotCoeffs, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function takes the rotation in terms of angle-axis representation and returns the input Fourier ...
void rotatePDBCoordinates(gemmi::Structure *pdbFile, proshade_double euA, proshade_double euB, proshade_double euG, proshade_double xCom, proshade_double yCom, proshade_double zCom, bool firstModel)
Function for rotating the PDB file co-ordinates by Euler angles.
void generateMapFromPDB(gemmi::Structure pdbFile, proshade_double *&map, proshade_single requestedResolution, proshade_single xCell, proshade_single yCell, proshade_single zCell, proshade_signed *xTo, proshade_signed *yTo, proshade_signed *zTo, bool forceP1, bool firstModel)
This function generates a theoretical map from co-ordinate input files.
void checkMemoryAllocation(chVar checkVar, std::string fileP, unsigned int lineP, std::string funcP, std::string infoP="This error may occurs when ProSHADE requests memory to be\n : allocated to it and this operation fails. This could\n : happen when not enough memory is available, either due to\n : other processes using a lot of memory, or when the machine\n : does not have sufficient memory available. Re-run to see\n : if this problem persists.")
Checks if memory was allocated properly.
proshade_unsign maxEMatDim
The band (l) value for E matrix (i.e. the smallest of the two bands).
proshade_signed * getXToPtr(void)
This function allows access to the map last position along the X axis.
proshade_signed * getYFromPtr(void)
This function allows access to the map start along the Y axis.
void translatePDBCoordinates(gemmi::Structure *pdbFile, proshade_double transX, proshade_double transY, proshade_double transZ, bool firstModel)
Function for translating the PDB file co-ordinates by given distances in Angstroms.
proshade_double mapCOMProcessChangeY
The change in Y axis between the creation of the structure (originalMapYCom) and just before rotation...
proshade_single bAngle
This is the angle b of the map cell in degrees.
proshade_signed yAxisOriginOriginal
This is the origin position along the y axis.
proshade_single aAngle
This is the angle a of the map cell in degrees.
void predictTetraAxes(std::vector< proshade_double * > *CSymList, std::vector< std::vector< proshade_double * > > *ret, proshade_double axErr, proshade_double minPeakHeight)
This function predicts all tetrahedral point group symmetry axes from the cyclic point groups list.
void addToDoubleVectorVector(std::vector< std::vector< proshade_double > > *vecToAddTo, std::vector< proshade_double > elementToAdd)
Adds the element to the vector of vectors.
void figureIndexStartStop(void)
Function for determining iterator start and stop positions.
bool isEmpty
This variable stated whether the class contains any information.
void reportCurrentSymmetryResults(ProSHADE_settings *settings, proshade_double threshold, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed cutXDim, proshade_signed cutYDim, proshade_signed cutZDim)
This function prints a single line of the symmetry detection results for a particular threshold.
void allocateTranslationFunctionMemory(fftw_complex *&tmpIn1, fftw_complex *&tmpOut1, fftw_complex *&tmpIn2, fftw_complex *&tmpOut2, fftw_complex *&resIn, fftw_complex *&resOut, fftw_plan &forwardFourierObj1, fftw_plan &forwardFourierObj2, fftw_plan &inverseFourierCombo, proshade_unsign xD, proshade_unsign yD, proshade_unsign zD)
This function allocates the memory for the Fourier transforms required for translation function compu...
proshade_complex * getInvSO3Coeffs(void)
This function allows access to the inverse SO(3) coefficients array.
proshade_unsign getEMatDim(void)
This function allows access to the maximum band for the E matrix.
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
std::string fourierWeightsFileName
The filename from which Fourier weights data will be read from.
std::string recommendedSymmetryType
The symmetry type that ProSHADE finds the best fitting for the structure. Possible values are "" for ...
proshade_signed yFrom
This is the starting index along the y axis.
void addToUnsignVector(std::vector< proshade_unsign > *vecToAddTo, proshade_unsign elementToAdd)
Adds the element to the vector.
void cutArrayToResolution(proshade_signed xInds, proshade_signed yInds, proshade_signed zInds, proshade_signed noBins, fftw_complex *inputMap, fftw_complex *&cutMap)
This function re-sizes data array to contain only values up to a particular resolution bin.
proshade_unsign getLocalAngRes(void)
This function returns the local angular resolution.
void reSampleMapToResolutionFourier(proshade_double *&map, proshade_single resolution, proshade_unsign xDimS, proshade_unsign yDimS, proshade_unsign zDimS, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_single *&corrs)
This function re-samples a map to conform to given resolution using Fourier.
void copyMapByBounds(proshade_signed xFrom, proshade_signed xTo, proshade_signed yFrom, proshade_signed yTo, proshade_signed zFrom, proshade_signed zTo, proshade_signed origXFrom, proshade_signed origYFrom, proshade_signed origZFrom, proshade_unsign yDimIndices, proshade_unsign zDimIndices, proshade_unsign origXDimIndices, proshade_unsign origYDimIndices, proshade_unsign origZDimIndices, proshade_double *&newMap, proshade_double *origMap)
This function copies an old map to a new map with different boundaries.
proshade_signed * getYAxisOrigin(void)
This function allows access to the map Y axis origin value.
std::vector< proshade_double * > getCyclicSymmetriesListFromAngleAxis(ProSHADE_settings *settings)
This function obtains a list of all C symmetries from the angle-axis space mapped rotation function v...
proshade_double originalPdbRotCenZ
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
void computeTranslationsFromPeak(ProSHADE_internal_data::ProSHADE_data *staticStructure, ProSHADE_internal_data::ProSHADE_data *movingStructure, proshade_double *trsX, proshade_double *trsY, proshade_double *trsZ)
This function computes the translation in Angstroms that corresponds to the translation function peak...
void paddMapWithZeroes(proshade_double *oldMap, proshade_double *&newMap, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_unsign xDimIndices, proshade_unsign yDimIndices, proshade_unsign zDimIndices, proshade_unsign addXPre, proshade_unsign addYPre, proshade_unsign addZPre)
This function adds zeroes before and after the central map and copies the central map values into a n...
void addToSingleVector(std::vector< proshade_single > *vecToAddTo, proshade_single elementToAdd)
Adds the element to the vector.
bool sortSymFSCHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the sixth number, sorting highest first.
bool firstModelOnly
Shoud only the first PDB model be used, or should all models be used?
bool sortProSHADESymmetryByFSC(proshade_double *a, proshade_double *b)
This function allows using std::sort to sort vectors of ProSHADE symmetry format.
void applyMask(proshade_double *&map, std::string maskFile, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_signed verbose, proshade_signed messageShift, std::vector< proshade_double > *calcBounds, proshade_double *maskArray=nullptr, proshade_unsign maXInds=0, proshade_unsign maYInds=0, proshade_unsign maZInds=0)
This function reads and applies the mask to the map.
proshade_double axisErrTolerance
Allowed error on vector axis in in dot product ( acos ( 1 - axErr ) is the allowed difference in radi...
bool useSameBounds
Switch to say that the same boundaries as used for the first should be used for all input maps.
proshade_unsign zDimIndices
This is the size of the map cell z dimension in indices.
std::vector< std::vector< proshade_double > > computeGroupElementsForGroup(proshade_double xAx, proshade_double yAx, proshade_double zAx, proshade_signed fold)
This function computes the group elements as rotation matrices (except for the identity element) for ...
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
void allocateRotatedMap(void)
This function allocates the rotated map memory.
proshade_unsign zGridIndices
As far as I know, this is identical to the zDimIndices.
void applyWeights(proshade_double *&map, std::string weightsFile, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_signed verbose, proshade_signed messageShift, proshade_double *weightsArray=nullptr, proshade_unsign waXInds=0, proshade_unsign waYInds=0, proshade_unsign waZInds=0)
This function reads and applies the Fourier weights to the map.
std::vector< proshade_double * > tetrahedralSymmetries
This is where the detected tetrahedral ("T") symmetries will be kept.
void getDihedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
This function obtains a list of all D symmetries from already computed C symmetries list.
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
proshade_double findTopGroupSmooth(std::vector< proshade_double * > *CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize, proshade_double maxLim=1.0)
This function finds a subgroup of axes with distinctly higher correlation value.
bool removeWaters
Should all waters be removed from input PDB files?
ProSHADE_internal_spheres::ProSHADE_sphere ** spheres
The set of concentric spheres to which the intermal density map has been projected.
void normaliseMap(ProSHADE_settings *settings)
Function for normalising the map values to mean 0 and sd 1..
std::vector< proshade_double * > findRequestedCSymmetryFromAngleAxis(ProSHADE_settings *settings, proshade_unsign fold, proshade_double *peakThres)
This function searches the angle-axis representation of the rotation function for a cyclic point grou...
std::vector< proshade_unsign > findAllPrimes(proshade_unsign upTo)
This function finds all prime numbers up to the supplied limit.
proshade_double originalPdbRotCenX
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
proshade_double originalMapZCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
void printProgressMessage(proshade_signed verbose, proshade_signed messageLevel, std::string message, proshade_signed messageShift=0)
General stdout message printing.
proshade_single yDimSize
This is the size of the map cell y dimension in Angstroms.
void setResolution(proshade_single resolution)
Sets the requested resolution in the appropriate variable.
void removePhaseInormation(ProSHADE_settings *settings)
This function removes phase from the map, effectively converting it to Patterson map.
void binReciprocalSpaceReflections(proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_single xSize, proshade_single ySize, proshade_single zSize, proshade_signed *noBin, proshade_signed *&binIndexing, std::vector< proshade_single > *&resArray)
This function does binning of the reciprocal space reflections.
void getPredictedOctahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList, proshade_signed *&cutIndices, fftw_complex *&fCoeffsCut, proshade_signed noBins, proshade_double **&bindata, proshade_signed *&binCounts, proshade_double *&fscByBin, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim)
This function predicts a list of all O symmetry axes from the already computed C symmetries list.
void moveMapByIndices(proshade_single *xMov, proshade_single *yMov, proshade_single *zMov, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_signed *xFrom, proshade_signed *xTo, proshade_signed *yFrom, proshade_signed *yTo, proshade_signed *zFrom, proshade_signed *zTo, proshade_signed *xOrigin, proshade_signed *yOrigin, proshade_signed *zOrigin)
Function for moving map back to original PDB location by changing the indices.
void readInMapHeader(gemmi::Ccp4< float > *map, proshade_unsign *xDimInds, proshade_unsign *yDimInds, proshade_unsign *zDimInds, proshade_single *xDim, proshade_single *yDim, proshade_single *zDim, proshade_single *aAng, proshade_single *bAng, proshade_single *cAng, proshade_signed *xFrom, proshade_signed *yFrom, proshade_signed *zFrom, proshade_signed *xAxOrigin, proshade_signed *yAxOrigin, proshade_signed *zAxOrigin, proshade_unsign *xAxOrder, proshade_unsign *yAxOrder, proshade_unsign *zAxOrder, proshade_unsign *xGridInds, proshade_unsign *yGridInds, proshade_unsign *zGridInds)
This function parses the CCP4 MAP file header as read in by gemmi.
bool fastISearch
Should FSC be computed for all possible I matches, or just for the best one according to FR?
void predictIcosAxes(std::vector< proshade_double * > *CSymList, std::vector< std::vector< proshade_double * > > *ret, proshade_double axErr, proshade_double minPeakHeight)
This function predicts all possible icosahedral point groups symmetry axes from the cyclic point grou...
void addExtraSpace(ProSHADE_settings *settings)
This function increases the size of the map so that it can add empty space around it.
bool detectTetrahedralSymmetry(std::vector< proshade_double * > *CSymList, proshade_double axErr, proshade_double minPeakHeight)
This function takes the list of C symmetries and decides whether basic requirements for tetrahedral s...
std::vector< proshade_double * > octahedralSymmetries
This is where the detected octahedral ("O") symmetries will be kept.
void addToStringVector(std::vector< std::string > *vecToAddTo, std::string elementToAdd)
Adds the element to the vector.
void computeSphericalHarmonics(proshade_unsign band, proshade_double *sphereMappedData, proshade_complex *&shArray)
This function computes the spherical harmonics of a aingle shell, saving them in supplied pointer.
void readInPDB(ProSHADE_settings *settings)
Function for reading pdb data.
void setRotatedMappedData(proshade_unsign pos, proshade_double value)
This function sets the rotated mapped data value to the given position.
void transpose3x3MatrixInPlace(proshade_single *mat)
Transposes 3x3 matrix in place.
proshade_signed * getZFromPtr(void)
This function allows access to the map start along the Z axis.
proshade_signed * getZToPtr(void)
This function allows access to the map last position along the Z axis.