ProSHADE  0.7.6.1 (AUG 2021)
Protein Shape Detection
ProSHADE_internal_data::ProSHADE_data Class Reference

This class contains all inputed and derived data for a single structure. More...

#include <ProSHADE_data.hpp>

Public Member Functions

 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 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)
 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...
 
std::vector< proshade_double * > getCyclicSymmetriesList (ProSHADE_settings *settings)
 This function obtains a list of all C symmetries from already computed self-rotation map. More...
 
std::vector< proshade_double * > 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 * > getTetrahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function obtains a list of all T symmetry axes from the already computed C symmetries list. More...
 
std::vector< proshade_double * > getOctahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function obtains a list of all O symmetry axes from the already computed C symmetries list. More...
 
std::vector< proshade_double * > getIcosahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function obtains a list of all I symmetry axes from the already computed C symmetries list. More...
 
std::vector< std::vector< proshade_double * > > getPredictedIcosahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function predicts a list of all I symmetry axes from the already computed C symmetries list. More...
 
std::vector< proshade_double * > getPredictedOctahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function predicts a list of all O symmetry axes from the already computed C symmetries list. More...
 
std::vector< proshade_double * > getPredictedTetrahedralSymmetriesList (ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
 This function predicts a list of all T symmetry axes from the already computed C symmetries list. More...
 
void detectSymmetryFromAngleAxisSpace (ProSHADE_settings *settings, std::vector< proshade_double * > *axes, std::vector< std::vector< proshade_double > > *allCs)
 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...
 
void saveDetectedSymmetries (ProSHADE_settings *settings, std::vector< proshade_double * > *CSyms, std::vector< std::vector< proshade_double > > *allCs)
 This function takes the results of point group searches and saves then into the output variables. More...
 
std::string getRecommendedSymmetryType (ProSHADE_settings *settings)
 This function simply returns the detected recommended symmetry type. More...
 
proshade_unsign getRecommendedSymmetryFold (ProSHADE_settings *settings)
 This function simply returns the detected recommended symmetry fold. More...
 
proshade_unsign getNoRecommendedSymmetryAxes (ProSHADE_settings *settings)
 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...
 
proshade_double findTopGroupSmooth (std::vector< proshade_double * > *CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize)
 This function finds the distinct group of axes with highest peak heights. More...
 
void prepareFSCFourierMemory (fftw_complex *&mapData, fftw_complex *&origCoeffs, fftw_complex *&fCoeffs, proshade_signed *&binIndexing, proshade_signed *noBins, proshade_double **&bindata, proshade_signed *&binCounts, fftw_plan *planForwardFourier)
 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, fftw_complex *mapData, fftw_complex *fCoeffs, fftw_complex *origCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&bindata, proshade_signed *&binCounts)
 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, fftw_complex *mapData, fftw_complex *fCoeffs, fftw_complex *origCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&bindata, proshade_signed *&binCounts)
 This function computes FSC for any given axis in the supplied CSym symmetry axes vector. More...
 
void saveRecommendedSymmetry (ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, std::vector< proshade_double * > *DSym, std::vector< proshade_double * > *TSym, std::vector< proshade_double * > *OSym, std::vector< proshade_double * > *ISym, std::vector< proshade_double * > *axes, fftw_complex *mapData, fftw_complex *origCoeffs, fftw_complex *fCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **bindata, proshade_signed *binCounts)
 This function takes all the detected symmetry results and decides on which are to be recommended for this structure. More...
 
void saveRequestedSymmetryC (ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, std::vector< proshade_double * > *axes)
 This function takes the C symmetries and searched for the requested symmetry. More...
 
void saveRequestedSymmetryD (ProSHADE_settings *settings, std::vector< proshade_double * > *DSym, std::vector< proshade_double * > *axes, fftw_complex *mapData, fftw_complex *origCoeffs, fftw_complex *fCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **bindata, proshade_signed *binCounts)
 This function takes the D symmetries and searched for the requested symmetry. More...
 
std::vector< std::vector< proshade_double > > getAllGroupElements (ProSHADE_settings *settings, 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 takes prints the report for symmetry detection. 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 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 getComparisonBand (void)
 This function allows access to the maximum band for the comparison. 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...
 
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 (proshade_unsign band, proshade_unsign order1, proshade_unsign 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...
 

Public Attributes

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_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_unsign maxCompBand
 The largest comparison band - this variable tells how large arrays will be allocated for the comparison.
 
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.
 

Protected Member Functions

void figureIndexStartStop (void)
 Function for determining iterator start and stop positions. More...
 
void setPDBMapValues (void)
 Function for determining iterator start and stop positions. More...
 
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. More...
 
void readInPDB (ProSHADE_settings *settings)
 Function for reading pdb data. More...
 
void readInGemmi (gemmi::Structure gemmiStruct, ProSHADE_settings *settings)
 Function for reading co-ordinate data from Gemmi object. More...
 
void allocateRRPMemory ()
 This function allocates the required memory for the RRP matrices. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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]settingsProSHADE_settings object specifying what should be done.
[out]XEmpty data object with deault values.

Definition at line 93 of file ProSHADE_data.cpp.

94 {
95  //================================================ Initialise variables
96  // ... Variables regarding input file
97  this->fileName = "";
98  this->fileType = ProSHADE_internal_io::UNKNOWN;
99 
100  // ... Variables regarding map
101  this->internalMap = nullptr;
102 
103  // ... Variables regarding map information
104  this->xDimSize = 0.0;
105  this->yDimSize = 0.0;
106  this->zDimSize = 0.0;
107  this->aAngle = 0.0;
108  this->bAngle = 0.0;
109  this->cAngle = 0.0;
110  this->xDimIndices = 0;
111  this->yDimIndices = 0;
112  this->zDimIndices = 0;
113  this->xGridIndices = 0;
114  this->yGridIndices = 0;
115  this->zGridIndices = 0;
116  this->xAxisOrder = 1;
117  this->yAxisOrder = 2;
118  this->zAxisOrder = 3;
119  this->xAxisOrigin = 0;
120  this->yAxisOrigin = 0;
121  this->zAxisOrigin = 0;
122  this->xCom = 0.0;
123  this->yCom = 0.0;
124  this->zCom = 0.0;
125 
126  // ... Variables regarding original input values (i.e. these do not change with ProSHADE manipulations)
127  this->xDimSizeOriginal = 0.0;
128  this->yDimSizeOriginal = 0.0;
129  this->zDimSizeOriginal = 0.0;
130  this->xDimIndicesOriginal = 0;
131  this->yDimIndicesOriginal = 0;
132  this->zDimIndicesOriginal = 0;
133  this->xAxisOriginOriginal = 0;
134  this->yAxisOriginOriginal = 0;
135  this->zAxisOriginOriginal = 0;
136  this->originalMapXCom = 0.0;
137  this->originalMapYCom = 0.0;
138  this->originalMapZCom = 0.0;
139  this->mapMovFromsChangeX = 0.0;
140  this->mapMovFromsChangeY = 0.0;
141  this->mapMovFromsChangeZ = 0.0;
142  this->mapCOMProcessChangeX = 0.0;
143  this->mapCOMProcessChangeY = 0.0;
144  this->mapCOMProcessChangeZ = 0.0;
145 
146  // ... Variables regarding rotation and translation of original input files
147  this->originalPdbRotCenX = 0.0;
148  this->originalPdbRotCenY = 0.0;
149  this->originalPdbRotCenZ = 0.0;
150  this->originalPdbTransX = 0.0;
151  this->originalPdbTransY = 0.0;
152  this->originalPdbTransZ = 0.0;
153 
154  // ... Variables regarding iterator positions
155  this->xFrom = 0;
156  this->yFrom = 0;
157  this->zFrom = 0;
158  this->xTo = 0;
159  this->yTo = 0;
160  this->zTo = 0;
161 
162  // ... Variables regarding SH mapping spheres
163  this->spherePos = std::vector<proshade_single> ( );
164  this->noSpheres = 0;
165  this->spheres = nullptr;
166  this->sphericalHarmonics = nullptr;
167  this->rotSphericalHarmonics = nullptr;
168  this->maxShellBand = 0;
169 
170  // ... Variables regarding shape distance computations
171  this->rrpMatrices = nullptr;
172  this->eMatrices = nullptr;
173  this->so3Coeffs = nullptr;
174  this->so3CoeffsInverse = nullptr;
175  this->wignerMatrices = nullptr;
176  this->integrationWeight = 0.0;
177  this->maxCompBand = 0;
178  this->translationMap = nullptr;
179 
180 
181  // ... Control variables
182  this->isEmpty = true;
183 
184  //================================================ Done
185 
186 }

◆ 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]settingsProSHADE_settings object specifying what should be done.
[in]strNameThe name of the structure for reference.
[in]mapValsA pointer to array where all the map data are.
[in]lenThe length of this map values array.
[in]xDmSzThe size of the x-axis dimension in Angstroms.
[in]yDmSzThe size of the y-axis dimension in Angstroms.
[in]zDmSzThe size of the z-axis dimension in Angstroms.
[in]xDmIndThe size of the x-axis dimension in indices.
[in]yDmIndThe size of the y-axis dimension in indices.
[in]zDmIndThe size of the z-axis dimension in indices.
[in]xFrThe first index statting position along the x-axis.
[in]yFrThe first index statting position along the y-axis.
[in]zFrThe first index statting position along the z-axis.
[in]xTThe last index end position along the x-axis.
[in]yTThe last index end position along the y-axis.
[in]zTThe last index end position along the z-axis.
[in]inputOThe input order for this structure.
[out]XEmpty data object with filled in values and map.

Definition at line 214 of file ProSHADE_data.cpp.

215 {
216  //================================================ Initialise variables
217  // ... Variables regarding input file
218  this->fileName = strName;
219  this->fileType = ProSHADE_internal_io::MAP;
220 
221  // ... Variables regarding map
222  this->internalMap = nullptr;
223 
224  // ... Variables regarding map information
225  this->xDimSize = xDmSz;
226  this->yDimSize = yDmSz;
227  this->zDimSize = zDmSz;
228  this->aAngle = 90.0;
229  this->bAngle = 90.0;
230  this->cAngle = 90.0;
231  this->xDimIndices = xDmInd;
232  this->yDimIndices = yDmInd;
233  this->zDimIndices = zDmInd;
234  this->xGridIndices = xDmInd;
235  this->yGridIndices = yDmInd;
236  this->zGridIndices = zDmInd;
237  this->xAxisOrder = 1;
238  this->yAxisOrder = 2;
239  this->zAxisOrder = 3;
240  this->xAxisOrigin = xFr;
241  this->yAxisOrigin = yFr;
242  this->zAxisOrigin = zFr;
243  this->xCom = 0.0;
244  this->yCom = 0.0;
245  this->zCom = 0.0;
246 
247  // ... Variables regarding original input values (i.e. these do not change with ProSHADE manipulations)
248  this->xDimSizeOriginal = 0.0;
249  this->yDimSizeOriginal = 0.0;
250  this->zDimSizeOriginal = 0.0;
251  this->xDimIndicesOriginal = 0;
252  this->yDimIndicesOriginal = 0;
253  this->zDimIndicesOriginal = 0;
254  this->xAxisOriginOriginal = 0;
255  this->yAxisOriginOriginal = 0;
256  this->zAxisOriginOriginal = 0;
257  this->originalMapXCom = 0.0;
258  this->originalMapYCom = 0.0;
259  this->originalMapZCom = 0.0;
260  this->mapMovFromsChangeX = 0.0;
261  this->mapMovFromsChangeY = 0.0;
262  this->mapMovFromsChangeZ = 0.0;
263  this->mapCOMProcessChangeX = 0.0;
264  this->mapCOMProcessChangeY = 0.0;
265  this->mapCOMProcessChangeZ = 0.0;
266 
267  // ... Variables regarding rotation and translation of original input files
268  this->originalPdbRotCenX = 0.0;
269  this->originalPdbRotCenY = 0.0;
270  this->originalPdbRotCenZ = 0.0;
271  this->originalPdbTransX = 0.0;
272  this->originalPdbTransY = 0.0;
273  this->originalPdbTransZ = 0.0;
274 
275  // ... Variables regarding iterator positions
276  this->xFrom = xFr;
277  this->yFrom = yFr;
278  this->zFrom = zFr;
279  this->xTo = xT;
280  this->yTo = yT;
281  this->zTo = zT;
282 
283  // ... Variables regarding SH mapping spheres
284  this->spherePos = std::vector<proshade_single> ( );
285  this->noSpheres = 0;
286  this->spheres = nullptr;
287  this->sphericalHarmonics = nullptr;
288  this->rotSphericalHarmonics = nullptr;
289  this->maxShellBand = 0;
290 
291  // ... Variables regarding shape distance computations
292  this->rrpMatrices = nullptr;
293  this->eMatrices = nullptr;
294  this->so3Coeffs = nullptr;
295  this->so3CoeffsInverse = nullptr;
296  this->wignerMatrices = nullptr;
297  this->integrationWeight = 0.0;
298  this->maxCompBand = 0;
299  this->translationMap = nullptr;
300 
301  // ... Control variables
302  this->isEmpty = false;
303  this->inputOrder = inputO;
304 
305  //================================================ Sanity checks
306  if ( static_cast<proshade_unsign> ( len ) != ( xDmInd * yDmInd * zDmInd ) )
307  {
308  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." );
309  }
310 
311  if ( ( static_cast<proshade_signed> ( xT - xFr ) != static_cast<proshade_signed> ( xDmInd - 1 ) ) ||
312  ( static_cast<proshade_signed> ( yT - yFr ) != static_cast<proshade_signed> ( yDmInd - 1 ) ) ||
313  ( static_cast<proshade_signed> ( zT - zFr ) != static_cast<proshade_signed> ( zDmInd - 1 ) ) )
314  {
315  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." );
316  }
317 
318  //================================================ Allocate the map memory
319  this->internalMap = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
320  ProSHADE_internal_misc::checkMemoryAllocation ( this->internalMap, __FILE__, __LINE__, __func__ );
321 
322  //================================================ Copy the values into the map
323  proshade_unsign arrPos = 0;
324  for ( proshade_unsign xIt = 0; xIt < this->xDimIndices; xIt++ )
325  {
326  for ( proshade_unsign yIt = 0; yIt < this->yDimIndices; yIt++ )
327  {
328  for ( proshade_unsign zIt = 0; zIt < this->zDimIndices; zIt++ )
329  {
330  arrPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
331  this->internalMap[arrPos] = static_cast<proshade_double> ( mapVals[arrPos] );
332  }
333  }
334  }
335 
336  //================================================ Release memory (it was allocated by the PyBind11 lambda function and needs to be released)
337  delete[] mapVals;
338 
339  //================================================ Done
340 
341 }

◆ ~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
[out]XN/A.

Definition at line 349 of file ProSHADE_data.cpp.

350 {
351  //================================================ Release the internal map
352  if ( this->internalMap != nullptr )
353  {
354  delete[] this->internalMap;
355  }
356 
357  //================================================ Release the sphere mapping
358  if ( this->spheres != nullptr )
359  {
360  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
361  {
362  if ( this->spheres[iter] != nullptr )
363  {
364  delete this->spheres[iter];
365  this->spheres[iter] = nullptr;
366  }
367  }
368  delete[] this->spheres;
369  }
370 
371  //================================================ Release the spherical harmonics
372  if ( this->sphericalHarmonics != nullptr )
373  {
374  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
375  {
376  if ( this->sphericalHarmonics[iter] != nullptr )
377  {
378  delete[] this->sphericalHarmonics[iter];
379  this->sphericalHarmonics[iter] = nullptr;
380  }
381  }
382  delete[] this->sphericalHarmonics;
383  }
384 
385  //================================================ Release the rotated spherical harmonics
386  if ( this->rotSphericalHarmonics != nullptr )
387  {
388  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
389  {
390  if ( this->rotSphericalHarmonics[iter] != nullptr )
391  {
392  delete[] this->rotSphericalHarmonics[iter];
393  this->rotSphericalHarmonics[iter] = nullptr;
394  }
395  }
396  delete[] this->rotSphericalHarmonics;
397  }
398 
399  //================================================ Release the RRP matrices (pre-computation for the energy levels descriptor)
400  if ( this->rrpMatrices != nullptr )
401  {
402  for ( proshade_unsign bwIt = 0; bwIt < this->maxShellBand; bwIt++ )
403  {
404  if ( this->rrpMatrices[bwIt] != nullptr )
405  {
406  for ( proshade_unsign shIt = 0; shIt < this->noSpheres; shIt++ )
407  {
408  if ( this->rrpMatrices[bwIt][shIt] != nullptr )
409  {
410  delete[] this->rrpMatrices[bwIt][shIt];
411  }
412  }
413 
414  delete[] this->rrpMatrices[bwIt];
415  }
416  }
417 
418  delete[] this->rrpMatrices;
419  }
420 
421  //================================================ Release the E matrices
422  if ( this->eMatrices != nullptr )
423  {
424  for ( proshade_unsign bandIter = 0; bandIter < this->maxCompBand; bandIter++ )
425  {
426  if ( this->eMatrices[bandIter] != nullptr )
427  {
428  for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
429  {
430  if ( this->eMatrices[bandIter][band2Iter] != nullptr )
431  {
432  delete[] this->eMatrices[bandIter][band2Iter];
433  }
434  }
435 
436  delete[] this->eMatrices[bandIter];
437  }
438  }
439 
440  delete[] this->eMatrices;
441  }
442 
443  //================================================ Release SOFT and inverse SOFT coefficients
444  if ( this->so3Coeffs != nullptr )
445  {
446  delete[] this->so3Coeffs;
447  }
448  if ( this->so3CoeffsInverse != nullptr )
449  {
450  delete[] this->so3CoeffsInverse;
451  }
452 
453  //================================================ Release Wigner matrices
454  if ( this->wignerMatrices != nullptr )
455  {
456  for ( proshade_unsign bandIter = 1; bandIter < this->maxCompBand; bandIter++ )
457  {
458  if ( this->wignerMatrices[bandIter] != nullptr )
459  {
460  for ( proshade_unsign order1Iter = 0; order1Iter < ( (bandIter * 2) + 1 ); order1Iter++ )
461  {
462  if ( this->wignerMatrices[bandIter][order1Iter] != nullptr )
463  {
464  delete[] this->wignerMatrices[bandIter][order1Iter];
465  }
466  }
467  delete[] this->wignerMatrices[bandIter];
468  }
469  }
470  delete[] wignerMatrices;
471  }
472 
473  //================================================ Release translation map
474  if ( this->translationMap != nullptr )
475  {
476  delete[] this->translationMap;
477  }
478 
479  //================================================ Release the angle-axis space rotation function
480  if ( this->sphereMappedRotFun.size() > 0 )
481  {
482  for ( proshade_unsign spIt = 0; spIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); spIt++ )
483  {
484  delete this->sphereMappedRotFun.at(spIt);
485  }
486  }
487 
488  //================================================ Done
489 
490 }

Member Function Documentation

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 1590 of file ProSHADE_data.cpp.

1591 {
1592  //================================================ Report function start
1593  std::stringstream hlpSS;
1594  hlpSS << "Adding extra " << settings->addExtraSpace << " angstroms.";
1595  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1596 
1597  //================================================ Figure how much indices need to change
1598  proshade_unsign xAddIndices = static_cast< proshade_unsign > ( ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) ) );
1599  proshade_unsign yAddIndices = static_cast< proshade_unsign > ( ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) ) );
1600  proshade_unsign zAddIndices = static_cast< proshade_unsign > ( ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) ) );
1601 
1602  //================================================ Update internal data variables
1603  this->xDimSize += 2 * static_cast<proshade_single> ( xAddIndices ) * this->xDimSize / static_cast<proshade_single> ( this->xDimIndices );
1604  this->yDimSize += 2 * static_cast<proshade_single> ( yAddIndices ) * this->yDimSize / static_cast<proshade_single> ( this->yDimIndices );
1605  this->zDimSize += 2 * static_cast<proshade_single> ( zAddIndices ) * this->zDimSize / static_cast<proshade_single> ( this->zDimIndices );
1606 
1607  this->xDimIndices += 2 * xAddIndices;
1608  this->yDimIndices += 2 * yAddIndices;
1609  this->zDimIndices += 2 * zAddIndices;
1610 
1611  this->xGridIndices = this->xDimIndices;
1612  this->yGridIndices = this->yDimIndices;
1613  this->zGridIndices = this->zDimIndices;
1614 
1615  this->xAxisOrigin -= xAddIndices;
1616  this->yAxisOrigin -= yAddIndices;
1617  this->zAxisOrigin -= zAddIndices;
1618 
1619  this->xFrom -= xAddIndices;
1620  this->yFrom -= yAddIndices;
1621  this->zFrom -= zAddIndices;
1622 
1623  this->xTo += xAddIndices;
1624  this->yTo += yAddIndices;
1625  this->zTo += zAddIndices;
1626 
1627  //================================================ Allocate new map
1628  proshade_double* newMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1629  ProSHADE_internal_misc::checkMemoryAllocation ( newMap, __FILE__, __LINE__, __func__ );
1630 
1631  //================================================ Set new map to zeroes
1632  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1633  {
1634  newMap[iter] = 0.0;
1635  }
1636 
1637  //================================================ Update the map
1638  proshade_unsign newMapIndex, oldMapIndex;
1639  for ( proshade_unsign xIt = 0; xIt < (this->xDimIndices - xAddIndices); xIt++ )
1640  {
1641  //============================================ Check if point is applicable
1642  if ( xIt < xAddIndices ) { continue; }
1643 
1644  for ( proshade_unsign yIt = 0; yIt < (this->yDimIndices - yAddIndices); yIt++ )
1645  {
1646  //======================================== Check if point is applicable
1647  if ( yIt < yAddIndices ) { continue; }
1648 
1649  for ( proshade_unsign zIt = 0; zIt < (this->zDimIndices - zAddIndices); zIt++ )
1650  {
1651  //==================================== Check if point is applicable
1652  if ( zIt < zAddIndices ) { continue; }
1653 
1654  //==================================== Var init
1655  newMapIndex = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
1656  oldMapIndex = (zIt - zAddIndices) + (this->zDimIndices - ( 2 * zAddIndices ) ) * ( (yIt - yAddIndices) + (this->yDimIndices - ( 2 * yAddIndices ) ) * (xIt - xAddIndices) );
1657 
1658  newMap[newMapIndex] = this->internalMap[oldMapIndex];
1659  }
1660  }
1661  }
1662 
1663  //================================================ Copy new to old
1664  delete[] this->internalMap;
1665 
1666  this->internalMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1667  ProSHADE_internal_misc::checkMemoryAllocation ( this->internalMap, __FILE__, __LINE__, __func__ );
1668 
1669  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1670  {
1671  this->internalMap[iter] = newMap[iter];
1672  }
1673 
1674  //================================================ Release memory
1675  delete[] newMap;
1676 
1677  //================================================ Report function completion
1678  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Extra space added." );
1679 
1680  //================================================ Done
1681  return ;
1682 
1683 }

◆ allocateEMatrices()

void ProSHADE_internal_data::ProSHADE_data::allocateEMatrices ( proshade_unsign  band)

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]bandThe minimal band of the comparison for which E matrices are computed.

Definition at line 275 of file ProSHADE_distances.cpp.

276 {
277  //================================================ Save the maximum band to the object
278  this->maxCompBand = band;
279 
280  //================================================ Allocate the required memory
281  this->eMatrices = new proshade_complex** [this->maxCompBand];
282  ProSHADE_internal_misc::checkMemoryAllocation ( this->eMatrices, __FILE__, __LINE__, __func__ );
283 
284  for ( proshade_unsign bandIter = 0; bandIter < this->maxCompBand; bandIter++ )
285  {
286  //============================================ Allocate the data structure
287  this->eMatrices[bandIter] = new proshade_complex* [static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 )];
288  ProSHADE_internal_misc::checkMemoryAllocation ( this->eMatrices[bandIter], __FILE__, __LINE__, __func__ );
289 
290  for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
291  {
292  this->eMatrices[bandIter][band2Iter] = new proshade_complex [static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 )];
293  ProSHADE_internal_misc::checkMemoryAllocation ( this->eMatrices[bandIter][band2Iter], __FILE__, __LINE__, __func__ );
294  }
295  }
296 
297  //================================================ Done
298  return ;
299 
300 }

◆ 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.

32 {
33  //================================================ Allocate the required memory
34  this->rrpMatrices = new proshade_double** [this->maxShellBand];
35  ProSHADE_internal_misc::checkMemoryAllocation ( this->rrpMatrices, __FILE__, __LINE__, __func__ );
36 
37  for ( proshade_unsign bwIt = 0; bwIt < this->maxShellBand; bwIt++ )
38  {
39  //============================================ For rach sphere
40  this->rrpMatrices[bwIt] = new proshade_double* [this->noSpheres];
41  ProSHADE_internal_misc::checkMemoryAllocation ( this->rrpMatrices[bwIt], __FILE__, __LINE__, __func__ );
42 
43  for ( proshade_unsign shIt = 0; shIt < this->noSpheres; shIt++ )
44  {
45  this->rrpMatrices[bwIt][shIt] = new double [this->noSpheres];
46  ProSHADE_internal_misc::checkMemoryAllocation ( this->rrpMatrices[bwIt][shIt], __FILE__, __LINE__, __func__ );
47  }
48  }
49 }

◆ 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]bandThe bandwidth to which the computation will be done.

Definition at line 675 of file ProSHADE_distances.cpp.

676 {
677  //================================================ Allocate the memory
678  this->so3Coeffs = new fftw_complex [static_cast<proshade_unsign>( ( 4 * pow( static_cast<proshade_double> ( band ), 3.0 ) - static_cast<proshade_double> ( band ) ) / 3.0 )];
679  this->so3CoeffsInverse = new fftw_complex [static_cast<proshade_unsign>( pow( static_cast<proshade_double> ( band ) * 2.0, 3.0 ) )];
680 
681  //================================================ Check memory allocation
682  ProSHADE_internal_misc::checkMemoryAllocation ( this->so3Coeffs, __FILE__, __LINE__, __func__ );
683  ProSHADE_internal_misc::checkMemoryAllocation ( this->so3CoeffsInverse, __FILE__, __LINE__, __func__ );
684 
685  //================================================ Done
686  return ;
687 
688 }

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 1525 of file ProSHADE_data.cpp.

1526 {
1527  //================================================ Report function start
1528  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
1529 
1530  //================================================ Initialise local variables
1531  proshade_double xCOM = 0.0;
1532  proshade_double yCOM = 0.0;
1533  proshade_double zCOM = 0.0;
1534 
1535  //================================================ Find the COM location
1536  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xCOM, &yCOM, &zCOM,
1537  this->xDimSize, this->yDimSize, this->xDimSize, this->xFrom,
1538  this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
1539 
1540  //================================================ Find the sampling rates
1541  proshade_single xSampRate = static_cast< proshade_single > ( this->xDimSize ) / static_cast< proshade_single > ( this->xTo - this->xFrom );
1542  proshade_single ySampRate = static_cast< proshade_single > ( this->yDimSize ) / static_cast< proshade_single > ( this->yTo - this->yFrom );
1543  proshade_single zSampRate = static_cast< proshade_single > ( this->zDimSize ) / static_cast< proshade_single > ( this->zTo - this->zFrom );
1544 
1545  //================================================ Convert to position in indices starting from 0
1546  xCOM /= static_cast< proshade_double > ( xSampRate );
1547  yCOM /= static_cast< proshade_double > ( ySampRate );
1548  zCOM /= static_cast< proshade_double > ( zSampRate );
1549 
1550  xCOM -= static_cast< proshade_double > ( this->xFrom );
1551  yCOM -= static_cast< proshade_double > ( this->yFrom );
1552  zCOM -= static_cast< proshade_double > ( this->zFrom );
1553 
1554  //================================================ Find distance from COM to map centre in Angstroms
1555  proshade_double xDist = ( ( static_cast<proshade_double> ( this->xDimIndices ) / 2.0 ) - xCOM ) * static_cast<proshade_double> ( this->xDimSize ) / static_cast<proshade_double> ( this->xDimIndices );
1556  proshade_double yDist = ( ( static_cast<proshade_double> ( this->yDimIndices ) / 2.0 ) - yCOM ) * static_cast<proshade_double> ( this->yDimSize ) / static_cast<proshade_double> ( this->yDimIndices );
1557  proshade_double zDist = ( ( static_cast<proshade_double> ( this->zDimIndices ) / 2.0 ) - zCOM ) * static_cast<proshade_double> ( this->zDimSize ) / static_cast<proshade_double> ( this->zDimIndices );
1558 
1559  //================================================ Move the map within the box
1561  static_cast< proshade_single > ( xDist ),
1562  static_cast< proshade_single > ( yDist ),
1563  static_cast< proshade_single > ( zDist ),
1564  this->xDimSize, this->yDimSize, this->zDimSize,
1565  static_cast< proshade_signed > ( this->xDimIndices ),
1566  static_cast< proshade_signed > ( this->yDimIndices ),
1567  static_cast< proshade_signed > ( this->zDimIndices ) );
1568 
1569  //================================================ Note the change due to centering
1570  this->mapCOMProcessChangeX -= xDist;
1571  this->mapCOMProcessChangeY -= yDist;
1572  this->mapCOMProcessChangeZ -= zDist;
1573 
1574  //================================================ Report function completion
1575  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map centered." );
1576 
1577  //================================================ Done
1578  return ;
1579 
1580 }

◆ computeFSC() [1/2]

proshade_double ProSHADE_internal_data::ProSHADE_data::computeFSC ( ProSHADE_settings settings,
proshade_double *  sym,
fftw_complex *  mapData,
fftw_complex *  fCoeffs,
fftw_complex *  origCoeffs,
fftw_plan *  planForwardFourier,
proshade_signed  noBins,
proshade_signed *  binIndexing,
proshade_double **&  bindata,
proshade_signed *&  binCounts 
)

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 map rotation accordingly. Next, it computes the Fourier transform of such rotated map and 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, the main ones being: Fourier transform of original (non-rotated) map is already computed and supplied, the FFTW plan for the Fourier transform of the rotated map is prepared and supplied, the workspace is allocated and supplied, the binning mask and number of bins is already determined ans supplied and so on. It would not be hard to remove these, but then repeated calls of this function would become much slower as all of these steps would have to be done for each call separately.
Parameters
[in]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]symA single double array containing a single Cyclic symmetry entry in the ProSHADE format.
[in]mapDataFFTW complex array which will be the input for the Fourier transform done by the planForwardFourier plan.
[in]fCoeffsFFTW complex array where the Fourier transform coefficients will be saved into by the planForwardFourier plan.
[in]origCoeffsFFTW complex array holding already compute Fourier transform of the non-rotated map.
[in]planForwardFourierA prepared FFTW3 plan for transforming the mapData onto fCoeffs.
[in]noBinsThe number of bins as already pre-computed.
[in]binIndexingA map of pre-computed bin assignments for each reflection in the format as outputted by FFTW.
[in]bindataPre-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]binCountsPre-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.
[out]fscThe FSC value found for the first (smallest) rotated map along the symmetry axis and the original map.

Definition at line 2510 of file ProSHADE_data.cpp.

2511 {
2512  //================================================ Ignore if already computed
2513  const FloatingPoint< proshade_double > lhs1 ( sym[6] ), rhs1 ( -1.0 );
2514  if ( !lhs1.AlmostEquals ( rhs1 ) ) { return ( sym[6] ); }
2515 
2516  //================================================ Report progress
2517  std::stringstream ss2;
2518  ss2 << "Computing FSC for symmetry C" << sym[0] << " ( " << sym[1] << " ; " << sym[2] << " ; " << sym[3] << " ) with peak height " << sym[5];
2519  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss2.str() );
2520 
2521  //================================================ Initialise local variables
2522  proshade_double *rotMap;
2523 
2524  //================================================ For each rotation along the axis
2525  proshade_double averageFSC = 0.0;
2526  for ( proshade_double rotIter = 1.0; rotIter < sym[0]; rotIter += 1.0 )
2527  {
2528  //============================================ Get rotated map by the smallest fold angle along the symmetry axis
2529  this->rotateMapRealSpace ( sym[1], sym[2], sym[3], ( ( 2.0 * M_PI ) / sym[0] ) * rotIter, rotMap );
2530 
2531  //============================================ Get Fourier for the rotated map
2532  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { mapData[iter][0] = rotMap[iter]; mapData[iter][1] = 0.0; }
2533  fftw_execute ( *planForwardFourier );
2534 
2535  //============================================ Clean FSC computation memory
2536  for ( size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { for ( size_t valIt = 0; valIt < 12; valIt++ ) { bindata[binIt][valIt] = 0.0; } }
2537  for ( size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { binCounts[binIt] = 0; }
2538 
2539  //============================================ Compute FSC
2540  averageFSC += ProSHADE_internal_maths::computeFSC ( origCoeffs, fCoeffs, this->xDimIndices, this->yDimIndices, this->zDimIndices, noBins, binIndexing, bindata, binCounts );
2541 
2542  //============================================ Release memory
2543  delete[] rotMap;
2544  }
2545 
2546  //================================================ Convert sum to average
2547  averageFSC /= ( sym[0] - 1.0 );
2548 
2549  //================================================ Save result to the axis
2550  sym[6] = averageFSC;
2551 
2552  //================================================ Report progress
2553  std::stringstream ss3;
2554  ss3 << "FSC value is " << averageFSC << " .";
2555  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 5, ss3.str() );
2556 
2557  //================================================ Done
2558  return ( averageFSC );
2559 
2560 }

◆ computeFSC() [2/2]

proshade_double ProSHADE_internal_data::ProSHADE_data::computeFSC ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSym,
size_t  symIndex,
fftw_complex *  mapData,
fftw_complex *  fCoeffs,
fftw_complex *  origCoeffs,
fftw_plan *  planForwardFourier,
proshade_signed  noBins,
proshade_signed *  binIndexing,
proshade_double **&  bindata,
proshade_signed *&  binCounts 
)

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 map rotation accordingly. Next, it computes the Fourier transform of such rotated map and 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, the main ones being: Fourier transform of original (non-rotated) map is already computed and supplied, the FFTW plan for the Fourier transform of the rotated map is prepared and supplied, the workspace is allocated and supplied, the binning mask and number of bins is already determined ans supplied and so on. It would not be hard to remove these, but then repeated calls of this function would become much slower as all of these steps would have to be done for each call separately.
Parameters
[in]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]CSymA vector of pointers to double arrays, each array being a single Cyclic symmetry entry.
[in]symIndexThe index of the symmetry axis in the CSym vector for which FSC should be computed.
[in]mapDataFFTW complex array which will be the input for the Fourier transform done by the planForwardFourier plan.
[in]fCoeffsFFTW complex array where the Fourier transform coefficients will be saved into by the planForwardFourier plan.
[in]origCoeffsFFTW complex array holding already compute Fourier transform of the non-rotated map.
[in]planForwardFourierA prepared FFTW3 plan for transforming the mapData onto fCoeffs.
[in]noBinsThe number of bins as already pre-computed.
[in]binIndexingA map of pre-computed bin assignments for each reflection in the format as outputted by FFTW.
[in]bindataPre-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]binCountsPre-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.
[out]fscThe FSC value found for the first (smallest) rotated map along the symmetry axis and the original map.

Definition at line 2425 of file ProSHADE_data.cpp.

2426 {
2427  //================================================ Sanity check
2428  if ( symIndex >= CSym->size() )
2429  {
2430  std::cerr << "The supplied symmetry axes vector does not contain element number " << symIndex << ". Returning FSC 0.0." << std::endl;
2431  return ( -2.0 );
2432  }
2433 
2434  //================================================ Ignore if already computed
2435  const FloatingPoint< proshade_double > lhs1 ( CSym->at(symIndex)[6] ), rhs1 ( -1.0 );
2436  if ( !lhs1.AlmostEquals ( rhs1 ) ) { return ( CSym->at(symIndex)[6] ); }
2437 
2438  //================================================ Report progress
2439  std::stringstream ss2;
2440  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];
2441  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss2.str() );
2442 
2443  //================================================ Initialise local variables
2444  proshade_double *rotMap;
2445 
2446  //================================================ For each rotation along the axis
2447  proshade_double averageFSC = 0.0;
2448  for ( proshade_double rotIter = 1.0; rotIter < CSym->at(symIndex)[0]; rotIter += 1.0 )
2449  {
2450  //============================================ Get rotated map by the smallest fold angle along the symmetry axis
2451  this->rotateMapRealSpace ( CSym->at(symIndex)[1], CSym->at(symIndex)[2], CSym->at(symIndex)[3], ( ( 2.0 * M_PI ) / CSym->at(symIndex)[0] ) * rotIter, rotMap );
2452 
2453  //============================================ Get Fourier for the rotated map
2454  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { mapData[iter][0] = rotMap[iter]; mapData[iter][1] = 0.0; }
2455  fftw_execute ( *planForwardFourier );
2456 
2457  //============================================ Clean FSC computation memory
2458  for ( size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { for ( size_t valIt = 0; valIt < 12; valIt++ ) { bindata[binIt][valIt] = 0.0; } }
2459  for ( size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { binCounts[binIt] = 0; }
2460 
2461  //============================================ Compute FSC
2462  averageFSC += ProSHADE_internal_maths::computeFSC ( origCoeffs, fCoeffs, this->xDimIndices, this->yDimIndices, this->zDimIndices, noBins, binIndexing, bindata, binCounts );
2463 
2464  //============================================ Release memory
2465  delete[] rotMap;
2466  }
2467 
2468  //================================================ Convert sum to average
2469  averageFSC /= ( CSym->at(symIndex)[0] - 1.0 );
2470 
2471  //================================================ Save result to the axis
2472  CSym->at(symIndex)[6] = averageFSC;
2473 
2474  //================================================ Report progress
2475  std::stringstream ss3;
2476  ss3 << "FSC value is " << averageFSC << " .";
2477  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 5, ss3.str() );
2478 
2479  //================================================ Done
2480  return ( averageFSC );
2481 
2482 }

◆ 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]settingsA pointer to settings class containing all the information required for map self-rotation function computation.

Definition at line 41 of file ProSHADE_symmetry.cpp.

42 {
43  //================================================ Report progress
44  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting self-rotation function computation." );
45 
46  //================================================ Compute un-weighted E matrices and their weights
47  ProSHADE_internal_distances::computeEMatrices ( this, this, settings );
48 
49  //================================================ Normalise E matrices by the magnitudes
50  ProSHADE_internal_distances::normaliseEMatrices ( this, this, settings );
51 
52  //================================================ Generate SO(3) coefficients
54 
55  //================================================ Compute the inverse SO(3) Fourier Transform (SOFT) on the newly computed coefficients
57 
58  //================================================ Report completion
59  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Self-rotation function obtained." );
60 
61  //================================================ Done
62  return ;
63 
64 }

◆ 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]settingsA pointer to settings class containing all the information required for the task.

Definition at line 59 of file ProSHADE_distances.cpp.

60 {
61  //================================================ Report progress
62  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Computing RRP matrices for structure " + this->fileName );
63 
64  //================================================ Allocate the memory
65  this->allocateRRPMemory ( );
66 
67  //================================================ Start computation: For each band (l)
68  proshade_double descValR = 0.0;
69  proshade_unsign arrPos1, arrPos2;
70  for ( proshade_unsign band = 0; band < this->maxShellBand; band++ )
71  {
72  //============================================ For each unique shell couple
73  for ( proshade_unsign shell1 = 0; shell1 < this->noSpheres; shell1++ )
74  {
75  //======================================== Does the band exist for this shell1?
76  if ( !ProSHADE_internal_distances::isBandWithinShell ( band, shell1, this->spheres ) )
77  {
78  for ( proshade_unsign shell2 = 0; shell2 < this->noSpheres; shell2++ )
79  {
80  this->rrpMatrices[band][shell1][shell2] = 0.0;
81  this->rrpMatrices[band][shell2][shell1] = 0.0;
82  }
83  continue;
84  }
85 
86  for ( proshade_unsign shell2 = 0; shell2 < this->noSpheres; shell2++ )
87  {
88  //==================================== Compute each values only once
89  if ( shell1 > shell2 ) { continue; }
90 
91  //==================================== Check if band exists for this shell2?
92  if ( !ProSHADE_internal_distances::isBandWithinShell ( band, shell2, this->spheres ) )
93  {
94  this->rrpMatrices[band][shell1][shell2] = 0.0;
95  this->rrpMatrices[band][shell2][shell1] = 0.0;
96  continue;
97  }
98 
99  //==================================== Initialise
100  descValR = 0.0;
101 
102  //==================================== Sum over order (m)
103  for ( proshade_unsign order = 0; order < static_cast< proshade_unsign > ( ( 2 * band ) + 1 ); order++ )
104  {
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() ) ) );
110  &this->sphericalHarmonics[shell1][arrPos1][1],
111  &this->sphericalHarmonics[shell2][arrPos2][0],
112  &this->sphericalHarmonics[shell2][arrPos2][1] );
113  }
114 
115  //==================================== Save the matrices
116  this->rrpMatrices[band][shell1][shell2] = descValR;
117  this->rrpMatrices[band][shell2][shell1] = descValR;
118  }
119  }
120  }
121 
122  //================================================ Report progress
123  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, "RRP matrices successfully computed." );
124 
125  //================================================ Done
126  return ;
127 
128 }

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 1843 of file ProSHADE_data.cpp.

1844 {
1845  //================================================ Report progress
1846  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting spherical harmonics decomposition." );
1847 
1848  //================================================ Initialise memory
1849  this->sphericalHarmonics = new proshade_complex* [this->noSpheres];
1850  ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics, __FILE__, __LINE__, __func__ );
1851  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1852  {
1853  this->sphericalHarmonics[iter] = new proshade_complex [(this->spheres[iter]->getLocalBandwidth() * 2) * (this->spheres[iter]->getLocalBandwidth() * 2)];
1854  ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics[iter], __FILE__, __LINE__, __func__ );
1855  }
1856 
1857  //================================================ Compute the spherical harmonics
1858  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1859  {
1860  //============================================ Report progress
1861  std::stringstream ss;
1862  ss << "Now decomposing sphere " << iter << ". " << "( Band is: " << this->spheres[iter]->getLocalBandwidth() << ").";
1863  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1864 
1865  //============================================ Compute
1866  ProSHADE_internal_sphericalHarmonics::computeSphericalHarmonics ( this->spheres[iter]->getLocalBandwidth(), this->spheres[iter]->getMappedData(), this->sphericalHarmonics[iter] );
1867  }
1868 
1869  //================================================ Report completion
1870  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Spherical harmonics decomposition complete." );
1871 
1872  //======================================== Done
1873  return ;
1874 
1875 }

◆ computeTranslationMap()

void ProSHADE_internal_data::ProSHADE_data::computeTranslationMap ( ProSHADE_internal_data::ProSHADE_data staticStructure)

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]staticStructureA pointer to the data class object of the other ( static ) structure.

Definition at line 324 of file ProSHADE_overlay.cpp.

325 {
326  //================================================ Do this using Fourier!
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() );
331 
332  //================================================ Fill in input data
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; }
335 
336  //================================================ Calculate Fourier
337  fftw_execute ( forwardFourierObj1 );
338  fftw_execute ( forwardFourierObj2 );
339 
340  //================================================ Combine Fourier coeffs and invert
341  ProSHADE_internal_overlay::combineFourierForTranslation ( tmpOut1, tmpOut2, resOut, staticStructure->getXDim(), staticStructure->getYDim(), staticStructure->getZDim() );
342  fftw_execute ( inverseFourierCombo );
343 
344  //================================================ Free memory
345  ProSHADE_internal_overlay::freeTranslationFunctionMemory ( tmpIn1, tmpOut1, tmpIn2, tmpOut2, resOut, forwardFourierObj1, forwardFourierObj2, inverseFourierCombo );
346 
347  //================================================ Done
348  return ;
349 
350 }

◆ 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]settingsA pointer to settings class containing all the information required for map self-rotation function computation.

Definition at line 120 of file ProSHADE_symmetry.cpp.

121 {
122  //================================================ Report progress
123  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting self-rotation function conversion to angle-axis representation." );
124 
125  //================================================ Initialise variables
126  proshade_double shellSpacing = ( 2.0 * M_PI ) / static_cast<proshade_double> ( this->maxShellBand ) * 2.0;
127  std::vector< proshade_double > allPeakHeights;
128 
129  //================================================ Initialise the spheres
130  for ( proshade_unsign spIt = 1; spIt < ( this->maxShellBand * 2 ); spIt++ )
131  {
132  this->sphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere( static_cast<proshade_double> ( spIt ) * shellSpacing,
133  shellSpacing,
134  this->maxShellBand * 2,
135  static_cast<proshade_double> ( spIt ) * shellSpacing,
136  spIt - 1 ) );
137  }
138 
139  //================================================ Interpolate the rotation function onto the spheres
140  for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( sphereMappedRotFun.size() ); shIt++ )
141  {
142  //============================================ Report progress
143  std::stringstream hlpSS;
144  hlpSS << "Interpolating sphere " << shIt << " ( radius: " << this->sphereMappedRotFun.at(shIt)->getRadius() << " ).";
145  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
146 
147  //============================================ Interpolate onto spheres
148  this->sphereMappedRotFun.at(shIt)->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
149  }
150 
151  //================================================ Report completion
152  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Self-rotation function converted to spherical angle-axis space." );
153  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Started peak detection on the angle-axis spheres." );
154 
155  //================================================ Find all peaks in the sphere grids
156  for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
157  {
158  this->sphereMappedRotFun.at(shIt)->findAllPeaks ( static_cast< proshade_signed > ( settings->peakNeighbours ), &allPeakHeights );
159  }
160 
161  //================================================ Report progress
162  std::stringstream hlpSS;
163  hlpSS << "Detected " << allPeakHeights.size() << " peaks with any height.";
164  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
165 
166  //================================================ Compute threshold for small peaks
167  proshade_double peakThres = std::max ( settings->minSymPeak, determinePeakThreshold ( allPeakHeights, settings->noIQRsFromMedianNaivePeak ) );
168 
169  //================================================ Report progress
170  std::stringstream hlpSS2;
171  hlpSS2 << "From these peaks, decided the threshold will be " << peakThres << " peak height.";
172  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS2.str() );
173 
174  //================================================ Remove too small peaks
175  for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
176  {
177  this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( peakThres );
178  }
179 
180  //================================================ Report progress
181  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, "Peaks detected for all spheres." );
182 
183  //================================================ Done
184  return ;
185 
186 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.
[in]newStrA pointer reference to a new structure class which has all the same values except for the new bounds and adequately changed map.
[in]newBoundsA 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 1387 of file ProSHADE_data.cpp.

1388 {
1389  //================================================ Report function start
1390  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Creating new structure according to the new bounds." );
1391 
1392  //================================================ Fill in basic info
1393  newStr->fileName = "N/A";
1394  newStr->fileType = ProSHADE_internal_io::MAP;
1395 
1396  //================================================ Fill in new structure values
1397  newStr->xDimIndices = static_cast< proshade_unsign > ( newBounds[1] ) - static_cast< proshade_unsign > ( newBounds[0] ) + 1;
1398  newStr->yDimIndices = static_cast< proshade_unsign > ( newBounds[3] ) - static_cast< proshade_unsign > ( newBounds[2] ) + 1;
1399  newStr->zDimIndices = static_cast< proshade_unsign > ( newBounds[5] ) - static_cast< proshade_unsign > ( newBounds[4] ) + 1;
1400 
1401  newStr->aAngle = this->aAngle;
1402  newStr->bAngle = this->aAngle;
1403  newStr->cAngle = this->aAngle;
1404 
1405  newStr->xDimSize = static_cast<proshade_single> ( newStr->xDimIndices ) * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) );
1406  newStr->yDimSize = static_cast<proshade_single> ( newStr->yDimIndices ) * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) );
1407  newStr->zDimSize = static_cast<proshade_single> ( newStr->zDimIndices ) * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) );
1408 
1409  newStr->xGridIndices = newStr->xDimIndices;
1410  newStr->yGridIndices = newStr->yDimIndices;
1411  newStr->zGridIndices = newStr->zDimIndices;
1412 
1413  newStr->xAxisOrder = this->xAxisOrder;
1414  newStr->yAxisOrder = this->yAxisOrder;
1415  newStr->zAxisOrder = this->zAxisOrder;
1416 
1417  newStr->xAxisOrigin = this->xAxisOrigin + newBounds[0];
1418  newStr->yAxisOrigin = this->yAxisOrigin + newBounds[2];
1419  newStr->zAxisOrigin = this->zAxisOrigin + newBounds[4];
1420 
1421  newStr->xFrom = this->xFrom + newBounds[0];
1422  newStr->yFrom = this->yFrom + newBounds[2];
1423  newStr->zFrom = this->zFrom + newBounds[4];
1424 
1425  newStr->xTo = this->xTo - ( static_cast< proshade_signed > ( this->xDimIndices - 1 ) - newBounds[1] );
1426  newStr->yTo = this->yTo - ( static_cast< proshade_signed > ( this->yDimIndices - 1 ) - newBounds[3] );
1427  newStr->zTo = this->zTo - ( static_cast< proshade_signed > ( this->zDimIndices - 1 ) - newBounds[5] );
1428 
1429  //================================================ Allocate new structure map
1430  newStr->internalMap = new proshade_double[newStr->xDimIndices * newStr->yDimIndices * newStr->zDimIndices];
1431  ProSHADE_internal_misc::checkMemoryAllocation ( newStr->internalMap, __FILE__, __LINE__, __func__ );
1432 
1433  //================================================ Copy the map
1434  ProSHADE_internal_mapManip::copyMapByBounds ( newStr->xFrom, newStr->xTo, newStr->yFrom, newStr->yTo, newStr->zFrom, newStr->zTo,
1435  this->xFrom, this->yFrom, this->zFrom, newStr->yDimIndices, newStr->zDimIndices,
1436  this->xDimIndices, this->yDimIndices, this->zDimIndices, newStr->internalMap, this->internalMap );
1437 
1438  //================================================ Report function completion
1439  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New structure created." );
1440 
1441  //================================================ Done
1442  return ;
1443 
1444 }

◆ 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]saveToA pointer where the internal map should be deep copied into.
[in]verboseHow loud the run should be?

Definition at line 3435 of file ProSHADE_data.cpp.

3436 {
3437  //================================================ Sanity check
3438  if ( saveTo != nullptr )
3439  {
3440  ProSHADE_internal_messages::printWarningMessage ( verbose, "!!! ProSHADE WARNING !!! The deep copy pointer is not set to NULL. Cannot proceed and returning unmodified pointer.", "WB00040" );
3441  return ;
3442  }
3443 
3444  //================================================ Allocate the memory
3445  saveTo = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3446 
3447  //================================================ Check memory allocation
3448  ProSHADE_internal_misc::checkMemoryAllocation ( saveTo, __FILE__, __LINE__, __func__ );
3449 
3450  //================================================ Copy internal map to the new pointer
3451  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
3452  {
3453  saveTo[iter] = this->internalMap[iter];
3454  }
3455 
3456  //================================================ Done
3457  return ;
3458 
3459 }

◆ detectSymmetryFromAngleAxisSpace()

void ProSHADE_internal_data::ProSHADE_data::detectSymmetryFromAngleAxisSpace ( ProSHADE_settings settings,
std::vector< proshade_double * > *  axes,
std::vector< std::vector< proshade_double > > *  allCs 
)

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]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]axesA vector to which all the axes of the recommended symmetry (if any) will be saved.
[in]allCsA vector to which all the detected cyclic symmetries will be saved into.

Definition at line 1903 of file ProSHADE_data.cpp.

1904 {
1905  //================================================ Modify axis tolerance and matrix tolerance by sampling, if required by user
1906  if ( settings->axisErrToleranceDefault )
1907  {
1908  settings->axisErrTolerance = std::min ( std::max ( 0.01, ( 2.0 * M_PI ) / static_cast< proshade_double > ( this->maxShellBand ) ), 0.05 );
1909  }
1910 
1911  //================================================ Prepare FSC computation memory and variables
1912  fftw_complex *mapData, *origCoeffs, *fCoeffs;
1913  fftw_plan planForwardFourier;
1914  proshade_double **bindata;
1915  proshade_signed *binIndexing, *binCounts, noBins;
1916  this->prepareFSCFourierMemory ( mapData, origCoeffs, fCoeffs, binIndexing, &noBins, bindata, binCounts, &planForwardFourier );
1917 
1918  //================================================ If C was requested, we will do it immediately - this allows for a significant speed-up.
1919  if ( settings->requestedSymmetryType == "C" )
1920  {
1921  //============================================ Report progress
1922  std::stringstream hlpSS;
1923  hlpSS << "Starting detection of cyclic point group C" << settings->requestedSymmetryFold;
1924  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1925 
1926  //============================================ Do simplified search only in the applicable data
1927  proshade_double symThres = 0.0;
1928  std::vector< proshade_double* > CSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, settings->requestedSymmetryFold, &symThres );
1929 
1930  //============================================ Deal with the rotation function 0 1 0 PI issue
1931  bool possible010PIIssue = false;
1932  for ( size_t iter = 0; iter < CSyms.size(); iter++ ) { if ( ProSHADE_internal_maths::isAxisUnique ( &CSyms, 0.0, 1.0, 0.0, 2.0, 0.1 ) ) { possible010PIIssue = true; } }
1933  if ( possible010PIIssue )
1934  {
1935  proshade_double* addAxis = new proshade_double[7];
1936  addAxis[0] = 2.0; addAxis[1] = 0.0; addAxis[2] = 1.0; addAxis[3] = 0.0; addAxis[4] = M_PI; addAxis[5] = -999.9; addAxis[6] = -1.0;
1938  delete[] addAxis;
1939  }
1940 
1941  //============================================ Compute FSC for all possible axes
1942  for ( size_t cIt = 0; cIt < CSyms.size(); cIt++ ) { const FloatingPoint< proshade_double > lhs ( CSyms.at(cIt)[5] ), rhs ( -999.9 ); if ( ( CSyms.at(cIt)[5] > settings->peakThresholdMin ) || ( lhs.AlmostEquals ( rhs ) ) ) { this->computeFSC ( settings, &CSyms, cIt, mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts ); } }
1943 
1944  //============================================ Sort by FSC
1945  std::sort ( CSyms.begin(), CSyms.end(), sortProSHADESymmetryByFSC );
1946 
1947  //============================================ Save the best axis as the recommended one
1948  if ( settings->detectedSymmetry.size() == 0 ) { if ( CSyms.size() > 0 ) { settings->setDetectedSymmetry ( CSyms.at(0) ); } }
1949  if ( CSyms.size() > 0 )
1950  {
1951  bool passedTests = false;
1952  for ( size_t cIt = 0; cIt < CSyms.size(); cIt++ )
1953  {
1954  if ( CSyms.at(0)[6] > settings->fscThreshold )
1955  {
1956  settings->setRecommendedSymmetry ( "C" );
1957  settings->setRecommendedFold ( settings->requestedSymmetryFold );
1958 
1960  this->saveDetectedSymmetries ( settings, &CSyms, allCs );
1961 
1962  passedTests = true;
1963  break;
1964  }
1965  }
1966 
1967  if ( !passedTests )
1968  {
1969  settings->setRecommendedSymmetry ( "" );
1970  settings->setRecommendedFold ( 0 );
1971  }
1972  }
1973  else
1974  {
1975  settings->setRecommendedSymmetry ( "" );
1976  settings->setRecommendedFold ( 0 );
1977  }
1978 
1979  //============================================ Release memory after FSC computation
1980  delete[] mapData;
1981  delete[] origCoeffs;
1982  delete[] fCoeffs;
1983  fftw_destroy_plan ( planForwardFourier );
1984  delete[] binIndexing;
1985  for (size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { delete[] bindata[binIt]; }
1986  delete[] bindata;
1987  delete[] binCounts;
1988 
1989  //============================================ Done
1990  return ;
1991  }
1992 
1993  //================================================ Report progress
1994  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting C symmetry detection." );
1995 
1996  //================================================ Initialise variables
1997  std::vector< proshade_double* > CSyms = getCyclicSymmetriesListFromAngleAxis ( settings );
1998 
1999  //============================================ Deal with the rotation function 0 1 0 PI issue
2000  bool possible010PIIssue = false;
2001  for ( size_t iter = 0; iter < CSyms.size(); iter++ ) { if ( ProSHADE_internal_maths::isAxisUnique ( &CSyms, 0.0, 1.0, 0.0, 2.0, 0.1 ) ) { possible010PIIssue = true; } }
2002  if ( possible010PIIssue )
2003  {
2004  proshade_double* addAxis = new proshade_double[7];
2005  addAxis[0] = 2.0; addAxis[1] = 0.0; addAxis[2] = 1.0; addAxis[3] = 0.0; addAxis[4] = M_PI; addAxis[5] = -999.9; addAxis[6] = -1.0;
2007  delete[] addAxis;
2008  }
2009 
2010  for ( size_t cIt = 0; cIt < CSyms.size(); cIt++ ) { const FloatingPoint< proshade_double > lhs ( CSyms.at(cIt)[5] ), rhs ( -999.9 ); if ( lhs.AlmostEquals ( rhs ) ) { this->computeFSC ( settings, &CSyms, cIt, mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts ); } }
2011 
2012  //================================================ Report progress
2013  std::stringstream ss;
2014  ss << "Detected " << CSyms.size() << " C symmetries.";
2015  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, ss.str() );
2016 
2017  //================================================ Sanity check - was the rotation function mapped properly?
2018  if ( this->sphereMappedRotFun.size() < 1 )
2019  {
2020  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." );
2021  }
2022 
2023  //================================================ Sanity check - was any symmetry requested?
2024  if ( ( settings->requestedSymmetryType != "" ) && ( settings->requestedSymmetryType != "C" ) && ( settings->requestedSymmetryType != "D" ) && ( settings->requestedSymmetryType != "T" ) && ( settings->requestedSymmetryType != "O" ) && ( settings->requestedSymmetryType != "I" ) )
2025  {
2026  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." );
2027  }
2028 
2029  //================================================ Are we doing general search?
2030  if ( settings->requestedSymmetryType == "" )
2031  {
2032  //============================================ Run the symmetry detection functions for C, D, T, O and I symmetries
2033  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
2034  std::vector< proshade_double* > ISyms;
2035  std::vector< proshade_double* > OSyms = this->getPredictedOctahedralSymmetriesList ( settings, &CSyms );
2036  std::vector< proshade_double* > TSyms = this->getPredictedTetrahedralSymmetriesList ( settings, &CSyms );
2037 
2038  //============================================ Find which of the I groups is the correct one
2039  proshade_double fscMax = 0.0;
2040  size_t fscMaxInd = 0;
2041  std::vector < std::vector< proshade_double* > > ISymsHlp = this->getPredictedIcosahedralSymmetriesList ( settings, &CSyms );
2042 
2043  for ( size_t icoIt = 0; icoIt < ISymsHlp.size(); icoIt++ )
2044  {
2045  //======================================== Is this a complete icosahedron?
2046  if ( ISymsHlp.at(icoIt).size() != 31 ) { continue; }
2047 
2048  //======================================== Initialise decision vars
2049  proshade_double fscVal = 0.0;
2050  proshade_double fscValAvg = 0.0;
2051 
2052  //======================================== For each axis
2053  for ( size_t aIt = 0; aIt < ISymsHlp.at(icoIt).size(); aIt++ )
2054  {
2055  //==================================== Match to CSyms
2056  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ISymsHlp.at(icoIt).at(aIt)[0] ), ISymsHlp.at(icoIt).at(aIt)[1], ISymsHlp.at(icoIt).at(aIt)[2], ISymsHlp.at(icoIt).at(aIt)[3], ISymsHlp.at(icoIt).at(aIt)[5], ISymsHlp.at(icoIt).at(aIt)[6], &CSyms, settings->axisErrTolerance );
2057 
2058  //==================================== Compute FSC
2059  fscVal = this->computeFSC ( settings, &CSyms, static_cast< size_t > ( matchedPos ), mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts );
2060  ISymsHlp.at(fscMaxInd).at(aIt)[6] = fscVal;
2061  fscValAvg += fscVal;
2062  }
2063 
2064  //==================================== Get FSC average over all axes
2065  fscValAvg /= 31.0;
2066 
2067  //======================================== Is this the best
2068  if ( fscValAvg > fscMax )
2069  {
2070  fscMax = fscValAvg;
2071  fscMaxInd = icoIt;
2072  }
2073  }
2074 
2075  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2076  if ( fscMax >= ( settings->fscThreshold * 0.7 ) )
2077  {
2078  //======================================== Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
2079  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ISymsHlp.at(fscMaxInd).size() ); retIt++ )
2080  {
2081  //==================================== Add the correct index to the settings object
2082  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ISymsHlp.at(fscMaxInd).at(retIt)[0] ), ISymsHlp.at(fscMaxInd).at(retIt)[1], ISymsHlp.at(fscMaxInd).at(retIt)[2], ISymsHlp.at(fscMaxInd).at(retIt)[3], ISymsHlp.at(fscMaxInd).at(retIt)[5], ISymsHlp.at(fscMaxInd).at(retIt)[6], &CSyms, settings->axisErrTolerance );
2083  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, static_cast < proshade_unsign > ( matchedPos ) );
2084 
2085  //==================================== Set ISyms for saving
2086  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ISyms, ISymsHlp.at(fscMaxInd).at(retIt) );
2087  }
2088  }
2089 
2090  //============================================ Decide on recommended symmetry
2091  this->saveRecommendedSymmetry ( settings, &CSyms, &DSyms, &TSyms, &OSyms, &ISyms, axes, mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts );
2092  }
2093 
2094  if ( settings->requestedSymmetryType == "D" )
2095  {
2096  //============================================ Run only the D symmetry detection and search for requested fold
2097  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
2098  this->saveRequestedSymmetryD ( settings, &DSyms, axes, mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts );
2099  }
2100 
2101  if ( settings->requestedSymmetryType == "T" )
2102  {
2103  //============================================ Run only the T symmetry detection
2104  std::vector< proshade_double* > TSyms = this->getPredictedTetrahedralSymmetriesList ( settings, &CSyms );
2105 
2106  if ( TSyms.size() == 7 )
2107  {
2108  //======================================== Initialise decision vars
2109  proshade_double fscVal = 0.0;
2110  proshade_double fscValAvg = 0.0;
2111 
2112  //======================================== Check if axes have high enough FSC and peak height
2113  for ( size_t tIt = 0; tIt < 7; tIt++ ) { if ( CSyms.at(settings->allDetectedTAxes.at(tIt))[5] > settings->peakThresholdMin ) { fscVal = this->computeFSC ( settings, &CSyms, settings->allDetectedTAxes.at(tIt), mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts ); fscValAvg += fscVal; } }
2114  fscValAvg /= 7.0;
2115 
2116  //======================================== If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2117  if ( fscValAvg >= ( settings->fscThreshold * 0.8 ) )
2118  {
2119  //==================================== The decision is T
2120  settings->setRecommendedSymmetry ( "T" );
2121  settings->setRecommendedFold ( 0 );
2122  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedTAxes.size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSyms.at(settings->allDetectedTAxes.at(it)) ); }
2123  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedTAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSyms.at(settings->allDetectedTAxes.at(it)) ); } }
2124  }
2125  }
2126  }
2127 
2128  if ( settings->requestedSymmetryType == "O" )
2129  {
2130  //============================================ Run only the O symmetry detection
2131  std::vector< proshade_double* > OSyms = this->getPredictedOctahedralSymmetriesList ( settings, &CSyms );
2132 
2133  if ( OSyms.size() == 13 )
2134  {
2135  //======================================== Initialise decision vars
2136  proshade_double fscVal = 0.0;
2137  proshade_double fscValAvg = 0.0;
2138 
2139  //======================================== Check if at least one C5 and one C3 with the correct angle have high FSC and peak height
2140  for ( size_t oIt = 0; oIt < 13; oIt++ ) { if ( CSyms.at(settings->allDetectedOAxes.at(oIt))[5] > settings->peakThresholdMin ) { fscVal = this->computeFSC ( settings, &CSyms, settings->allDetectedOAxes.at(oIt), mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts ); fscValAvg += fscVal; } }
2141  fscValAvg /= 13.0;
2142 
2143  //======================================== If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2144  if ( fscValAvg >= ( settings->fscThreshold * 0.8 ) )
2145  {
2146  //==================================== The decision is O
2147  settings->setRecommendedSymmetry ( "O" );
2148  settings->setRecommendedFold ( 0 );
2149  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedOAxes.size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSyms.at(settings->allDetectedOAxes.at(it)) ); }
2150  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedOAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSyms.at(settings->allDetectedOAxes.at(it)) ); } }
2151  }
2152  }
2153  }
2154 
2155  if ( settings->requestedSymmetryType == "I" )
2156  {
2157  //============================================ Find which of the I groups is the correct one
2158  proshade_double fscMax = 0.0;
2159  size_t fscMaxInd = 0;
2160  std::vector < std::vector< proshade_double* > > ISymsHlp = this->getPredictedIcosahedralSymmetriesList ( settings, &CSyms );
2161  std::vector< proshade_double* > ISyms;
2162 
2163  for ( size_t icoIt = 0; icoIt < ISymsHlp.size(); icoIt++ )
2164  {
2165  //======================================== Is this a complete icosahedron?
2166  if ( ISymsHlp.at(icoIt).size() != 31 ) { continue; }
2167 
2168  //======================================== Initialise decision vars
2169  proshade_double fscVal = 0.0;
2170  proshade_double fscValAvg = 0.0;
2171 
2172  //======================================== For each axis
2173  for ( size_t aIt = 0; aIt < ISymsHlp.at(icoIt).size(); aIt++ )
2174  {
2175  //==================================== Match to CSyms
2176  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ISymsHlp.at(icoIt).at(aIt)[0] ), ISymsHlp.at(icoIt).at(aIt)[1], ISymsHlp.at(icoIt).at(aIt)[2], ISymsHlp.at(icoIt).at(aIt)[3], ISymsHlp.at(icoIt).at(aIt)[5], ISymsHlp.at(icoIt).at(aIt)[6], &CSyms, settings->axisErrTolerance );
2177 
2178  //==================================== Compute FSC
2179  fscVal = this->computeFSC ( settings, &CSyms, static_cast< size_t > ( matchedPos ), mapData, fCoeffs, origCoeffs, &planForwardFourier, noBins, binIndexing, bindata, binCounts );
2180  ISymsHlp.at(fscMaxInd).at(aIt)[6] = fscVal;
2181  fscValAvg += fscVal;
2182  }
2183 
2184  //==================================== Get FSC average over all axes
2185  fscValAvg /= 31.0;
2186 
2187  //======================================== Is this the best
2188  if ( fscValAvg > fscMax )
2189  {
2190  fscMax = fscValAvg;
2191  fscMaxInd = icoIt;
2192  }
2193  }
2194 
2195  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2196  if ( fscMax >= ( settings->fscThreshold * 0.7 ) )
2197  {
2198  //======================================== Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
2199  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ISymsHlp.at(fscMaxInd).size() ); retIt++ )
2200  {
2201  //==================================== Add the correct index to the settings object
2202  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ISymsHlp.at(fscMaxInd).at(retIt)[0] ), ISymsHlp.at(fscMaxInd).at(retIt)[1], ISymsHlp.at(fscMaxInd).at(retIt)[2], ISymsHlp.at(fscMaxInd).at(retIt)[3], ISymsHlp.at(fscMaxInd).at(retIt)[5], ISymsHlp.at(fscMaxInd).at(retIt)[6], &CSyms, settings->axisErrTolerance );
2203  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, static_cast < proshade_unsign > ( matchedPos ) );
2204 
2205  //==================================== Set ISyms for saving
2206  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ISyms, ISymsHlp.at(fscMaxInd).at(retIt) );
2207  }
2208  }
2209 
2210  //============================================ Delete all memory from ISymsHlp
2211  for ( size_t gIt = 0; gIt < ISymsHlp.size(); gIt++ ) { for ( size_t aIt = 0; aIt < ISymsHlp.at(gIt).size(); aIt++ ) { delete[] ISymsHlp.at(gIt).at(aIt); } }
2212 
2213  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2214  if ( fscMax >= ( settings->fscThreshold * 0.7 ) )
2215  {
2216  //======================================== The decision is I
2217  settings->setRecommendedSymmetry ( "I" );
2218  settings->setRecommendedFold ( 0 );
2219  for ( size_t it = 0; it < ISyms.size(); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, ISyms.at(it) ); }
2220  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedIAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSyms.at(settings->allDetectedIAxes.at(it)) ); } }
2221  }
2222  }
2223 
2224  //================================================ Save C symmetries to argument and if different from settings, to the settings as well
2225  this->saveDetectedSymmetries ( settings, &CSyms, allCs );
2226 
2227  //================================================ Release memory after FSC computation
2228  delete[] mapData;
2229  delete[] origCoeffs;
2230  delete[] fCoeffs;
2231  fftw_destroy_plan ( planForwardFourier );
2232  delete[] binIndexing;
2233  for (size_t binIt = 0; binIt < static_cast< size_t > ( noBins ); binIt++ ) { delete[] bindata[binIt]; }
2234  delete[] bindata;
2235  delete[] binCounts;
2236 
2237  //================================================ Done
2238  return ;
2239 
2240 }

◆ 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 983 of file ProSHADE_data.cpp.

984 {
985  //================================================ Set ends to origin + size - 1
986  this->xTo = this->xFrom + static_cast< proshade_signed > ( this->xDimIndices ) - 1;
987  this->yTo = this->yFrom + static_cast< proshade_signed > ( this->yDimIndices ) - 1;
988  this->zTo = this->zFrom + static_cast< proshade_signed > ( this->zDimIndices ) - 1;
989 
990  //================================================ Done
991  return ;
992 
993 }

◆ 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 3523 of file ProSHADE_data.cpp.

3524 {
3525  //================================================ Initialise variables
3526  this->xCom = 0.0;
3527  this->yCom = 0.0;
3528  this->zCom = 0.0;
3529  proshade_double totNonZeroPoints = 0.0;
3530  proshade_signed mapIt = 0;
3531 
3532  //================================================ Compute COM from 0 ; 0 ; 0
3533  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
3534  {
3535  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
3536  {
3537  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
3538  {
3539  //==================================== Find map index
3540  mapIt = zIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( yIt + static_cast< proshade_signed > ( this->yDimIndices ) * xIt );
3541 
3542  //==================================== Use only positive density
3543  if ( this->internalMap[mapIt] <= 0.0 ) { continue; }
3544 
3545  //==================================== Compute Index COM
3546  this->xCom += this->internalMap[mapIt] * static_cast<proshade_double> ( xIt + this->xFrom );
3547  this->yCom += this->internalMap[mapIt] * static_cast<proshade_double> ( yIt + this->yFrom );
3548  this->zCom += this->internalMap[mapIt] * static_cast<proshade_double> ( zIt + this->zFrom );
3549  totNonZeroPoints += this->internalMap[mapIt];
3550  }
3551  }
3552  }
3553 
3554  this->xCom /= totNonZeroPoints;
3555  this->yCom /= totNonZeroPoints;
3556  this->zCom /= totNonZeroPoints;
3557 
3558  //================================================ Convert to real world
3559  this->xCom = static_cast< proshade_double > ( ( static_cast< proshade_single > ( this->xFrom ) * ( this->xDimSizeOriginal / static_cast< proshade_single > ( this->xDimIndicesOriginal ) ) ) +
3560  ( ( static_cast< proshade_single > ( this->xCom ) - static_cast< proshade_single > ( this->xFrom ) ) *
3561  ( static_cast< proshade_single > ( this->xDimSizeOriginal ) / static_cast< proshade_single > ( this->xDimIndicesOriginal ) ) ) );
3562  this->yCom = static_cast< proshade_double > ( ( static_cast< proshade_single > ( this->yFrom ) * ( this->yDimSizeOriginal / static_cast< proshade_single > ( this->yDimIndicesOriginal ) ) ) +
3563  ( ( static_cast< proshade_single > ( this->yCom ) - static_cast< proshade_single > ( this->yFrom ) ) *
3564  ( static_cast< proshade_single > ( this->yDimSizeOriginal ) / static_cast< proshade_single > ( this->yDimIndicesOriginal ) ) ) );
3565  this->zCom = static_cast< proshade_double > ( ( static_cast< proshade_single > ( this->zFrom ) * ( this->zDimSizeOriginal / static_cast< proshade_single > ( this->zDimIndicesOriginal ) ) ) +
3566  ( ( static_cast< proshade_single > ( this->zCom ) - static_cast< proshade_single > ( this->zFrom ) ) *
3567  ( static_cast< proshade_single > ( this->zDimSizeOriginal ) / static_cast< proshade_single > ( this->zDimIndicesOriginal ) ) ) );
3568 
3569  //================================================ Done
3570  return ;
3571 
3572 }

◆ 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]settingsProSHADE_settings object containing all the settings for this run.
[in]foldThe fold which should be sought for by the function.
[in]peakThresThe threshold used to cut peaks.
[out]retVector of double pointers to arrays having the standard ProSHADE symmetry group structure.

Definition at line 3895 of file ProSHADE_symmetry.cpp.

3896 {
3897  //================================================ Initialise variables
3898  proshade_double soughtAngle;
3899  std::vector< proshade_double > allPeakHeights;
3900  std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup* > peakGroups;
3901  std::vector< proshade_double* > ret;
3902  bool newPeak;
3903 
3904  //================================================ Make sure we have a clean start
3905  this->sphereMappedRotFun.clear();
3906 
3907  //================================================ Convert rotation function to only the required angle-axis space spheres and find all peaks
3908  for ( proshade_double angIt = 1.0; angIt < static_cast<proshade_double> ( fold ); angIt += 1.0 )
3909  {
3910  //============================================ Figure the angles to form the symmetry
3911  soughtAngle = angIt * ( 2.0 * M_PI / static_cast<proshade_double> ( fold ) );
3912 
3913  //============================================ Create the angle-axis sphere with correct radius (angle)
3914  this->sphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere ( soughtAngle,
3915  M_PI / static_cast< proshade_double > ( this->maxShellBand ),
3916  this->maxShellBand * 2,
3917  soughtAngle,
3918  static_cast<proshade_unsign> ( angIt - 1.0 ) ) );
3919 
3920  //=========================================== Interpolate rotation function onto the sphere
3921  this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
3922 
3923  //============================================ Find all peaks for this sphere
3924  this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->findAllPeaks ( static_cast< proshade_signed > ( settings->peakNeighbours ), &allPeakHeights );
3925  }
3926 
3927  //============================================ Report progress
3928  std::stringstream hlpSS;
3929  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.";
3930  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS.str() );
3931 
3932  //================================================ Determine the threshold for significant peaks
3933  *peakThres = std::max ( settings->minSymPeak, determinePeakThreshold ( allPeakHeights, settings->noIQRsFromMedianNaivePeak ) );
3934 
3935  //============================================ Report progress
3936  std::stringstream hlpSS2;
3937  hlpSS2 << "Determined peak threshold " << *peakThres << ".";
3938  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS2.str() );
3939 
3940  //================================================ Remove small peaks
3941  for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
3942  {
3943  this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( *peakThres );
3944  }
3945 
3946  //================================================ Group peaks
3947  for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); sphIt++ )
3948  {
3949  //============================================ For each peak
3950  for ( proshade_unsign pkIt = 0; pkIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().size() ); pkIt++ )
3951  {
3952  //======================================== Check if peak belongs to an already detected peak group
3953  newPeak = true;
3954  for ( proshade_unsign pkGrpIt = 0; pkGrpIt < static_cast<proshade_unsign> ( peakGroups.size() ); pkGrpIt++ )
3955  {
3956  if ( peakGroups.at(pkGrpIt)->checkIfPeakBelongs ( static_cast< proshade_double > ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first ),
3957  static_cast< proshade_double > ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second ),
3958  sphIt, settings->axisErrTolerance, settings->verbose ) ) { newPeak = false; break; }
3959  }
3960 
3961  //======================================== If already added, go to next one
3962  if ( !newPeak ) { continue; }
3963 
3964  //======================================== If not, create a new group with this peak
3965  peakGroups.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup ( static_cast< proshade_double > ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first ),
3966  static_cast< proshade_double > ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second ),
3967  sphIt,
3968  this->sphereMappedRotFun.at(sphIt)->getAngularDim() ) );
3969  }
3970  }
3971 
3972  //================================================ For each peak group, look for the requested fold
3973  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( peakGroups.size() ); grIt++ )
3974  {
3975  //============================================ Report progress
3976  std::stringstream hlpSS3;
3977  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 ";
3978  for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( peakGroups.at(grIt)->getSpherePositions().size() ); sphIt++ ) { hlpSS3 << peakGroups.at(grIt)->getSpherePositions().at(sphIt) << " ; "; }
3979  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 5, hlpSS3.str() );
3980 
3981  //============================================ Find point groups in the peak group
3982  peakGroups.at(grIt)->findCyclicPointGroupsGivenFold ( this->sphereMappedRotFun, &ret, settings->useBiCubicInterpolationOnPeaks, fold, settings->verbose );
3983 
3984  //============================================ Release the memory
3985  delete peakGroups.at(grIt);
3986  }
3987 
3988  //================================================ Sort ret by peak height
3989  std::sort ( ret.begin(), ret.end(), sortProSHADESymmetryByPeak );
3990 
3991  //================================================ Done
3992  return ( ret );
3993 
3994 }

◆ findTopGroupSmooth()

proshade_double ProSHADE_internal_data::ProSHADE_data::findTopGroupSmooth ( std::vector< proshade_double * > *  CSym,
size_t  peakPos,
proshade_double  step,
proshade_double  sigma,
proshade_signed  windowSize 
)

This function finds the distinct group of axes with highest peak heights.

This function starts by getting a vector of all peak heights detected in all C symmetries detected in the structure. It then proceeds to convert this vector into a histogram, which it then smoothens using Gaussian convolution according to the input parameters. Finally, it searches for peaks in the smoothened histogram function and reports the minimal value that average peak height must be in order for the axis to be considered part of this top group.

Parameters
[in]CSymA vector of pointers to double arrays, each array being a single Cyclic symmetry entry.
[in]stepThe granulosity of the interval <0,1> using which the search should be done.
[in]sigmaThe variance of the Gaussian used to smoothen the peak height histogram.
[in]windowSizeThe width of the window over which smoothening is done.
[out]thresholdThe minimum peak height that an axis needs to have to be considered a member of the distinct top group.

Definition at line 2301 of file ProSHADE_data.cpp.

2302 {
2303  //================================================ Initialise local variables
2304  proshade_double threshold = 0.0;
2305  proshade_signed totSize = static_cast< proshade_signed > ( ( 1.0 / step ) + 1 );
2306  std::vector< std::pair < proshade_double, proshade_unsign > > vals;
2307  std::vector< proshade_double > hist ( static_cast< unsigned long int > ( totSize ), 0.0 );
2308  proshade_unsign histPos = 0;
2309 
2310  //================================================ Make sure window size is odd
2311  if ( windowSize % 2 == 0 ) { windowSize += 1; }
2312 
2313  //================================================ Get vector of pairs of peak heights and indices in CSym array
2314  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( CSym->size() ); symIt++ ) { vals.emplace_back ( std::pair < proshade_double, proshade_unsign > ( CSym->at(symIt)[peakPos], symIt ) ); }
2315 
2316  //================================================ Convert all found heights to histogram from 0.0 to 1.0 by step
2317  for ( proshade_double it = 0.0; it <= 1.0; it = it + step )
2318  {
2319  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( vals.size() ); symIt++ )
2320  {
2321  //======================================== Is this height in the range?
2322  if ( ( vals.at(symIt).first > it ) && ( vals.at(symIt).first <= ( it + step ) ) ) { hist.at(histPos) += 1.0; }
2323  }
2324 
2325  //============================================ Update counter and continue
2326  histPos += 1;
2327  }
2328 
2329  //================================================ Smoothen the distribution
2330  std::vector< proshade_double > smoothened = ProSHADE_internal_maths::smoothen1D ( step, windowSize, sigma, hist );
2331 
2332  //================================================ Find peaks in smoothened data
2333  std::vector< proshade_signed > peaks = ProSHADE_internal_peakSearch::findPeaks1D ( smoothened );
2334 
2335  //================================================ Take best peaks surroundings and produce a new set of "high" axes
2336  proshade_signed bestHistPos;
2337  if ( peaks.size() > 0 ) { bestHistPos = peaks.at(peaks.size()-1) + ( ( windowSize - 1 ) / 2 ); }
2338  else { bestHistPos = 0.0; }
2339 
2340  threshold = ( static_cast< proshade_double > ( bestHistPos ) * step ) - ( static_cast< proshade_double > ( windowSize ) * step );
2341 
2342  //================================================ Done
2343  return ( threshold );
2344 
2345 }

◆ getAllGroupElements()

std::vector< std::vector< proshade_double > > ProSHADE_internal_data::ProSHADE_data::getAllGroupElements ( ProSHADE_settings settings,
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 second parameter, where these need to be detected by ProSHADE first and then their index in the ProSHADE cyclic group detected list can be given here.

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 isses when the point group axes are slightly off, as this can lead to the point group check failing...

Parameters
[in]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]axesListA vector of ints specifying which C axes from the full list are members of the group.
[in]groupTypeAn 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]matrixToleranceThe maximum allowed trace difference for two matrices to still be considered the same.
[out]valA vector containing a vector of 9 doubles (rotation matrix) for each group element for the requested group.

Definition at line 3168 of file ProSHADE_data.cpp.

3169 {
3170  //================================================ Initialise variables
3171  std::vector<std::vector< proshade_double > > ret;
3172 
3173  //================================================ Select which symmetry type are we computing for
3174  if ( groupType == "C" )
3175  {
3176  //============================================ Sanity check
3177  axesToGroupTypeSanityCheck ( 1, static_cast< proshade_unsign > ( axesList.size() ), groupType );
3178 
3179  //============================================ Generate elements
3180  ret = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(0)).at(1),
3181  settings->allDetectedCAxes.at(axesList.at(0)).at(2),
3182  settings->allDetectedCAxes.at(axesList.at(0)).at(3),
3183  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(0)).at(0) ) );
3184 
3185  //============================================ Check the element to form a group
3186  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3187  else
3188  {
3189  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." );
3190  }
3191  }
3192  else if ( groupType == "D" )
3193  {
3194  //============================================ Sanity check
3195  axesToGroupTypeSanityCheck ( 2, static_cast<proshade_unsign> ( axesList.size() ), groupType );
3196 
3197  //============================================ Generate elements for both axes
3198  std::vector<std::vector< proshade_double > > first = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(0)).at(1),
3199  settings->allDetectedCAxes.at(axesList.at(0)).at(2),
3200  settings->allDetectedCAxes.at(axesList.at(0)).at(3),
3201  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(0)).at(0) ) );
3202  std::vector<std::vector< proshade_double > > second = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(1)).at(1),
3203  settings->allDetectedCAxes.at(axesList.at(1)).at(2),
3204  settings->allDetectedCAxes.at(axesList.at(1)).at(3),
3205  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(1)).at(0) ) );
3206 
3207  //============================================ Join the element lists
3208  ret = joinElementsFromDifferentGroups ( &first, &second, matrixTolerance, true );
3209 
3210  //============================================ Check the element to form a group
3211  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3212  else
3213  {
3214  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." );
3215  }
3216  }
3217  else if ( groupType == "T" )
3218  {
3219  //============================================ Sanity check
3220  axesToGroupTypeSanityCheck ( 7, static_cast<proshade_unsign> ( axesList.size() ), groupType );
3221 
3222  //============================================ Generate elements for all four C3 axes first
3223  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3224  {
3225  //======================================== If this is a C3 axis
3226  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3227  if ( lhs1.AlmostEquals ( rhs1 ) )
3228  {
3229  //==================================== Generate the elements
3230  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3231  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3232  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3233  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3234 
3235  //==================================== Join the elements to any already found
3236  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3237  }
3238  }
3239 
3240  //============================================ Generate elements for all three C2 axes second
3241  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3242  {
3243  //======================================== If this is a C3 axis
3244  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3245  if ( lhs1.AlmostEquals ( rhs1 ) )
3246  {
3247  //==================================== Generate the elements
3248  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3249  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3250  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3251  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3252 
3253  //==================================== Join the elements to any already found
3254  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3255  }
3256  }
3257 
3258  //============================================ Check the element to form a group
3259  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3260  else
3261  {
3262  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." );
3263  }
3264  }
3265  else if ( groupType == "O" )
3266  {
3267  //============================================ Sanity check
3268  axesToGroupTypeSanityCheck ( 13, static_cast<proshade_unsign> ( axesList.size() ), groupType );
3269 
3270  //============================================ Generate elements for all three C4 axes first
3271  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3272  {
3273  //======================================== If this is a C3 axis
3274  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 4.0 );
3275  if ( lhs1.AlmostEquals ( rhs1 ) )
3276  {
3277  //==================================== Generate the elements
3278  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3279  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3280  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3281  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3282 
3283  //==================================== Join the elements to any already found
3284  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3285  }
3286  }
3287 
3288  //============================================ Generate elements for all four C3 axes first
3289  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3290  {
3291  //======================================== If this is a C3 axis
3292  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3293  if ( lhs1.AlmostEquals ( rhs1 ) )
3294  {
3295  //==================================== Generate the elements
3296  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3297  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3298  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3299  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3300 
3301  //==================================== Join the elements to any already found
3302  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3303  }
3304  }
3305 
3306  //============================================ Generate elements for all six C2 axes next
3307  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3308  {
3309  //======================================== If this is a C3 axis
3310  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3311  if ( lhs1.AlmostEquals ( rhs1 ) )
3312  {
3313  //==================================== Generate the elements
3314  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3315  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3316  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3317  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3318 
3319  //==================================== Join the elements to any already found
3320  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3321  }
3322  }
3323 
3324  //============================================ Check the element to form a group
3325  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3326  else
3327  {
3328  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." );
3329  }
3330  }
3331  else if ( groupType == "I" )
3332  {
3333  //============================================ Sanity check
3334  axesToGroupTypeSanityCheck ( 31, static_cast<proshade_unsign> ( axesList.size() ), groupType );
3335 
3336  //============================================ Generate elements for all six C5 axes first
3337  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3338  {
3339  //======================================== If this is a C5 axis
3340  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 5.0 );
3341  if ( lhs1.AlmostEquals ( rhs1 ) )
3342  {
3343  //==================================== Generate the elements
3344  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3345  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3346  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3347  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3348 
3349  //==================================== Join the elements to any already found
3350  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3351  }
3352  }
3353 
3354  //============================================ Generate elements for all ten C3 axes next
3355  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3356  {
3357  //======================================== If this is a C3 axis
3358  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 3.0 );
3359  if ( lhs1.AlmostEquals ( rhs1 ) )
3360  {
3361  //==================================== Generate the elements
3362  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3363  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3364  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3365  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3366 
3367  //==================================== Join the elements to any already found
3368  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3369  }
3370  }
3371 
3372  //============================================ Generate elements for all fifteen C2 axes lastly
3373  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3374  {
3375  //======================================== If this is a C3 axis
3376  const FloatingPoint< proshade_double > lhs1 ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ), rhs1 ( 2.0 );
3377  if ( lhs1.AlmostEquals ( rhs1 ) )
3378  {
3379  //==================================== Generate the elements
3380  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3381  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3382  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3383  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3384 
3385  //==================================== Join the elements to any already found
3386  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
3387  }
3388  }
3389 
3390  //============================================ Check the element to form a group
3391  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3392  else
3393  {
3394  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." );
3395  }
3396  }
3397  else if ( groupType == "X" )
3398  {
3399  //============================================ User forced no checking for unspecified symmetry
3400  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
3401  {
3402  //======================================== Compute group elements
3403  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
3404  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
3405  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
3406  static_cast< proshade_signed > ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) ) );
3407 
3408  //======================================== Join the elements to any already found
3409  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, true );
3410  }
3411 
3412  //============================================ Check the element to form a group
3413  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
3414  else
3415  {
3416  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  }
3418  }
3419  else
3420  {
3421  std::stringstream hlpSS;
3422  hlpSS << "Unknown symmetry type: >" << groupType << "<";
3423  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." );
3424  }
3425 
3426 }

◆ 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]XThe distance of the requested sphere to the centre of the coordinates.

Definition at line 3749 of file ProSHADE_data.cpp.

3750 {
3751  //================================================ Done
3752  return ( this->spheres[shell]->getShellRadius() );
3753 
3754 }

◆ 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]settingsA pointer to settings class containing all the information required for map overlay.
[out]valA vector of the Euler angles of the best peak in the rotation function map.

Definition at line 1386 of file ProSHADE_overlay.cpp.

1387 {
1388  //================================================ Initialise local variables
1389  std::vector < proshade_double > ret;
1390  proshade_double eulA, eulB, eulG;
1391 
1392  //================================================ Get inverse SO(3) map top peak Euler angle values
1394  this->getMaxBand() * 2,
1395  &eulA, &eulB, &eulG, settings );
1396 
1397  //================================================ Re-format to vector
1401 
1402  //================================================ Done
1403  return ( ret );
1404 
1405 }

◆ getBestTranslationMapPeaksAngstrom()

std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::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.

Parameters
[in]staticStructureA pointer to the data class object of the other ( static ) structure.
[out]XA vector of doubles with the optimal translation vector in Angstroms.

Definition at line 250 of file ProSHADE_overlay.cpp.

251 {
252  //================================================ Initialise local variables
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;
260  xDimS,
261  yDimS,
262  zDimS,
263  &trsX,
264  &trsY,
265  &trsZ,
266  &mapPeak );
267 
268  //================================================ Dont translate over half
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 ); }
272 
273  //================================================ Convert the map positions onto translation in Angstroms and save the results
274  ProSHADE_internal_overlay::computeTranslationsFromPeak ( staticStructure, this, &trsX, &trsY, &trsZ );
275 
276  this->originalPdbTransX = trsX;
277  this->originalPdbTransY = trsY;
278  this->originalPdbTransZ = trsZ;
279 
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 );
283 
284  //================================================ Save results as vector
285  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -xMov ) );
286  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -yMov ) );
287  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -zMov ) );
288 
289  //================================================ Save original from variables for PDB output
290  this->mapMovFromsChangeX = static_cast<proshade_double> ( this->xFrom );
291  this->mapMovFromsChangeY = static_cast<proshade_double> ( this->yFrom );
292  this->mapMovFromsChangeZ = static_cast<proshade_double> ( this->zFrom );
293 
294  //================================================ Move the map
295  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
296  this->getXFromPtr(), this->getXToPtr(),
297  this->getYFromPtr(), this->getYToPtr(),
298  this->getZFromPtr(), this->getZToPtr(),
299  this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
300 
302  this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
303  static_cast< proshade_signed > ( this->getXDim() ), static_cast< proshade_signed > ( this->getYDim() ), static_cast< proshade_signed > ( this->getZDim() ) );
304 
305  //================================================ Keep only the change in from and to variables
306  this->mapMovFromsChangeX = static_cast<proshade_double> ( this->xFrom ) - this->mapMovFromsChangeX;
307  this->mapMovFromsChangeY = static_cast<proshade_double> ( this->yFrom ) - this->mapMovFromsChangeY;
308  this->mapMovFromsChangeZ = static_cast<proshade_double> ( this->zFrom ) - this->mapMovFromsChangeZ;
309 
310  //================================================ Done
311  return ( ret );
312 
313 }

◆ getComparisonBand()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getComparisonBand ( void  )

This function allows access to the maximum band for the comparison.

Parameters
[out]XThe bandwidth used for this comparison.

Definition at line 3848 of file ProSHADE_data.cpp.

3849 {
3850  //================================================ Done
3851  return ( this->maxCompBand );
3852 
3853 }

◆ getCyclicSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getCyclicSymmetriesList ( ProSHADE_settings settings)

This function obtains a list of all C symmetries from already computed self-rotation map.

This function starts by finding all peaks in the self-rotation map, which are outliers in terms of height. It then proceeds to group these by the height, searching for C symmetries in each peak height group (thus making sure symmetries with higher peak heights are found first). The symmetry detection proceeds by detecting possible C symmetry folds and searching whether the all peaks are present to support the prospective C symmetry. If only few are missing, it will even search for the missing peaks. Finally, the function returns all detected symmetries in the order of decreasing average peak height.

Parameters
[in]settingsA pointer to settings class containing all the information required for symmetry detection.

Definition at line 198 of file ProSHADE_symmetry.cpp.

199 {
200  //================================================ Initialise variables
201  std::vector< proshade_double* > ret;
202 
203  //================================================ Report progress
204  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting C symmetry detection." );
205 
206  //================================================ Get list of peaks in the self-rotation map
207  std::vector< proshade_double* > allPeaks = ProSHADE_internal_peakSearch::getAllPeaksNaive ( this->getInvSO3Coeffs (), this->getMaxBand() * 2,
208  static_cast< proshade_signed > ( settings->peakNeighbours ),
209  settings->noIQRsFromMedianNaivePeak );
210 
211  //================================================ Convert peaks to angle-axis
212  std::vector< proshade_double* > peaksAA = ProSHADE_internal_symmetry::getPeaksAngleAxisPositions ( allPeaks, settings->verbose );
213 
214  //================================================ Sort peaks by height groups
215  std::vector< proshade_double > peakGroupsBoundaries = ProSHADE_internal_symmetry::findPeaksByHeightBoundaries ( peaksAA, settings->smoothingFactor );
216 
217  //================================================ Get symmetry per group
218  std::vector< std::vector< proshade_unsign > > detectedCSymmetries;
219  for ( proshade_signed iter = static_cast< proshade_signed > ( peakGroupsBoundaries.size() - 1 ); iter >= 0; iter-- )
220  {
221  //============================================ Get peaks group peaks only
222  std::vector< proshade_double* > symPeaks;
223  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( peaksAA.size() ); it++ )
224  {
225  if ( peaksAA.at(it)[4] > peakGroupsBoundaries.at( static_cast< size_t > ( iter ) ) ) { ProSHADE_internal_misc::addToDblPtrVector ( &symPeaks, peaksAA.at(it) ); }
226  }
227 
228  //============================================ Search for symmetry in these peaks
229  detectedCSymmetries = ProSHADE_internal_symmetry::findPeaksCSymmetry ( &symPeaks, settings->verbose,
230  this->getMaxBand(),
231  settings->symMissPeakThres,
232  settings->axisErrTolerance,
233  settings->axisErrToleranceDefault,
234  this );
235 
236  //============================================ Print detected symmetries
237  for ( proshade_unsign detIt = 0; detIt < static_cast<proshade_unsign> ( detectedCSymmetries.size() ); detIt++ ) { ProSHADE_internal_symmetry::printSymmetryGroup ( detectedCSymmetries.at(detIt), symPeaks, settings->verbose ); }
238 
239  //============================================ Save detected
240  ProSHADE_internal_symmetry::saveAllCSymmetries ( detectedCSymmetries, symPeaks, &ret, settings->axisErrTolerance );
241  }
242 
243  //================================================ Release memory
244  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( peaksAA.size() ); iter++ ) { delete[] allPeaks.at(iter); delete[] peaksAA.at(iter); }
245 
246  //================================================ Report completion
247  ProSHADE_internal_symmetry::printSymmetryCompletion ( static_cast<proshade_unsign>( ret.size() ), settings->verbose );
248 
249  //================================================ Done
250  return ( ret );
251 
252 }

◆ 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]settingsA pointer to settings class containing all the information required for symmetry detection.
[out]retA 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 3756 of file ProSHADE_symmetry.cpp.

3757 {
3758  //================================================ Initialise variables
3759  std::vector< proshade_unsign > primes = ProSHADE_internal_maths::findAllPrimes ( settings->maxSymmetryFold );
3760  std::vector< proshade_double* > ret, tmpHolder;
3761  std::vector< proshade_unsign > testedFolds;
3762  proshade_double symThres;
3763  proshade_unsign foldToTest;
3764  bool foldDone, anyNewSyms = true;
3765 
3766  //================================================ For each found prime number in the limit
3767  for ( proshade_unsign prIt = 0; prIt < static_cast< proshade_unsign > ( primes.size() ); prIt++ )
3768  {
3769  //============================================ Report progress
3770  std::stringstream hlpSS;
3771  hlpSS << "Searching for prime fold symmetry C" << primes.at(prIt) << ".";
3772  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
3773 
3774  //============================================ Get all symmetries for this prime fold
3775  std::vector< proshade_double* > prSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, primes.at(prIt), &symThres );
3776 
3777  //============================================ Save the detected C symmetries
3778  for ( size_t axIt = 0; axIt < prSyms.size(); axIt++ )
3779  {
3780  //======================================== Is this symmetry passing the threshold?
3781  if ( prSyms.at(axIt)[5] >= symThres )
3782  {
3783  //==================================== Add this symmetry to final list
3784  if ( ProSHADE_internal_maths::isAxisUnique ( &ret, prSyms.at(axIt), settings->axisErrTolerance, true ) )
3785  {
3786  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ret, prSyms.at(axIt) );
3787  }
3788  }
3789 
3790  //======================================== Release memory
3791  delete[] prSyms.at(axIt);
3792  }
3793  }
3794 
3795  //================================================ Was anything found?
3796  if ( ret.size() < 1 ) { return ( ret ); }
3797 
3798  //================================================ Check for prime symmetry fold multiples
3799  while ( anyNewSyms )
3800  {
3801  //============================================ Initialise new iteration
3802  anyNewSyms = false;
3803 
3804  //============================================ For each passing symmetry, look if there are any combinations of symmetries that would contain it
3805  for ( proshade_unsign axIt1 = 0; axIt1 < static_cast< proshade_unsign > ( ret.size() ); axIt1++ )
3806  {
3807  for ( proshade_unsign axIt2 = 0; axIt2 < static_cast< proshade_unsign > ( ret.size() ); axIt2++ )
3808  {
3809  //==================================== Initialise iteration
3810  foldToTest = static_cast< proshade_unsign > ( ret.at(axIt1)[0] * ret.at(axIt2)[0] );
3811  if ( foldToTest > settings->maxSymmetryFold ) { continue; }
3812 
3813  //==================================== Was this fold tested already?
3814  foldDone = false;
3815  for ( proshade_unsign fIt = 0; fIt < static_cast< proshade_unsign > ( testedFolds.size() ); fIt++ ) { if ( testedFolds.at(fIt) == foldToTest ) { foldDone = true; break; } }
3816  if ( foldDone ) { continue; }
3817  else { ProSHADE_internal_misc::addToUnsignVector ( &testedFolds, foldToTest ); }
3818 
3819  //==================================== Report progress
3820  std::stringstream hlpSS2;
3821  hlpSS2 << "Searching for fold combination of detected folds " << ret.at(axIt1)[0] << " and " << ret.at(axIt2)[0] << ", i.e. C" << foldToTest << ".";
3822  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS2.str() );
3823 
3824  //==================================== Get all symmetries for this fold
3825  std::vector< proshade_double* > prSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, foldToTest, &symThres );
3826 
3827  //==================================== For each detected group with the required fold
3828  for ( size_t newAxIt = 0; newAxIt < prSyms.size(); newAxIt++ )
3829  {
3830  if ( prSyms.at(newAxIt)[5] >= symThres )
3831  {
3832  //================================ Add to detected axes
3833  if ( ProSHADE_internal_maths::isAxisUnique ( &ret, prSyms.at(newAxIt), settings->axisErrTolerance, true ) )
3834  {
3835  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &tmpHolder, prSyms.at(newAxIt) );
3836  }
3837  }
3838 
3839  //==================================== Release memory
3840  delete[] prSyms.at(newAxIt);
3841  }
3842  }
3843  }
3844 
3845  //============================================ Add newly found groups and repeat if need be
3846  if ( tmpHolder.size() > 0 )
3847  {
3848  for ( proshade_unsign tmpIt = 0; tmpIt < static_cast< proshade_unsign > ( tmpHolder.size() ); tmpIt++ )
3849  {
3850  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ret, tmpHolder.at(tmpIt) );
3851  delete[] tmpHolder.at(tmpIt);
3852  }
3853 
3854  anyNewSyms = true;
3855  tmpHolder.clear ( );
3856  }
3857  }
3858 
3859  //================================================ Sort the vector
3860  std::sort ( ret.begin(), ret.end(), ProSHADE_internal_misc::sortSymHlpInv );
3861 
3862  //================================================ Done
3863  return ( ret );
3864 }

◆ getDihedralSymmetriesList()

std::vector< proshade_double * > 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]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.

Definition at line 1299 of file ProSHADE_symmetry.cpp.

1300 {
1301  //================================================ Initialise variables
1302  std::vector< proshade_double* > ret;
1303  proshade_double dotProduct;
1304 
1305  //================================================ Report progress
1306  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting D symmetry detection." );
1307 
1308  //================================================If not enough axes, just end here
1309  if ( CSymList->size() < 2 ) { return ( ret ); }
1310 
1311  //================================================ For each unique pair of axes
1312  for ( proshade_unsign ax1 = 0; ax1 < static_cast<proshade_unsign> ( CSymList->size() ); ax1++ )
1313  {
1314  //============================================ Ignore small axes
1315  const FloatingPoint< proshade_double > lhs1 ( CSymList->at(ax1)[5] ), rhs1 ( -999.9 );
1316  if ( ( CSymList->at(ax1)[5] < settings->minSymPeak ) && !( lhs1.AlmostEquals ( rhs1 ) ) ) { continue; }
1317 
1318  for ( proshade_unsign ax2 = 1; ax2 < static_cast<proshade_unsign> ( CSymList->size() ); ax2++ )
1319  {
1320  //======================================= Use unique pairs only
1321  if ( ax1 >= ax2 ) { continue; }
1322 
1323  //======================================== Ignore small axes
1324  const FloatingPoint< proshade_double > lhs2 ( CSymList->at(ax2)[5] ), rhs2 ( -999.9 );
1325  if ( ( CSymList->at(ax2)[5] < settings->minSymPeak ) && !( lhs2.AlmostEquals ( rhs2 ) ) ) { continue; }
1326 
1327  //======================================= Compute the dot product
1328  dotProduct = ProSHADE_internal_maths::computeDotProduct ( &CSymList->at(ax1)[1], &CSymList->at(ax1)[2],
1329  &CSymList->at(ax1)[3], &CSymList->at(ax2)[1],
1330  &CSymList->at(ax2)[2], &CSymList->at(ax2)[3] );
1331 
1332  //======================================== If close to zero, these two axes are perpendicular
1333  if ( std::abs( dotProduct ) < settings->axisErrTolerance )
1334  {
1335  //==================================== Save
1336  if ( CSymList->at(ax1)[0] >= CSymList->at(ax2)[0] )
1337  {
1338  ProSHADE_internal_symmetry::saveDSymmetry ( &ret, CSymList, ax1, ax2 );
1339 
1340  std::vector< proshade_unsign > DSymInd;
1344 
1345  }
1346  else
1347  {
1348  ProSHADE_internal_symmetry::saveDSymmetry ( &ret, CSymList, ax2, ax1 );
1349 
1350  std::vector< proshade_unsign > DSymInd;
1354  }
1355  }
1356  }
1357  }
1358 
1359  //================================================ Report progress
1360  std::stringstream hlpSS;
1361  hlpSS << "Detected " << ret.size() << " D symmetries.";
1362  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, hlpSS.str() );
1363 
1364  //================================================ Done
1365  return ( ret );
1366 
1367 }

◆ 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]bandThe band for which the E matrix subset order * order should be returned.
[out]XPointer to pointer of complex matrix with dimensions order * order of the E matrices.

Definition at line 3796 of file ProSHADE_data.cpp.

3797 {
3798  //================================================ Done
3799  return ( this->eMatrices[band] );
3800 
3801 }

◆ 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]bandThe band for which the E matrix value should be returned.
[in]order1The first order for which the E matrix value should be returned.
[in]order2The second order for which the E matrix value should be returned.
[in]valueRealThe proshade_double number pointer to where the real part of the value will be saved.
[in]valueImagThe proshade_double number pointer to where the imaginary part of the value will be saved.

Definition at line 3811 of file ProSHADE_data.cpp.

3812 {
3813  //================================================ Set pointer
3814  *valueReal = this->eMatrices[band][order1][order2][0];
3815  *valueImag = this->eMatrices[band][order1][order2][1];
3816 
3817  //================================================ Done
3818  return ;
3819 
3820 }

◆ getIcosahedralSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getIcosahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

This function obtains 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 C4 symmetries with the octahedron dihedral angle ( acos ( 1/sqrt(3) ) ). If so, it will then assume existence of octahedral symmetry and it will search for three C4 axes, four C3 axes and six C2 axes with the correct angle to each other and within the group. If all required axes are detected, it will return a list of 13 axes, otherwise it will return empty or shorter list. Automated missing symmetry axis detection is also included.

Parameters
[in]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.

Definition at line 2799 of file ProSHADE_symmetry.cpp.

2800 {
2801  //================================================ Initialise variables
2802  std::vector< proshade_double* > ret;
2803 
2804  //================================================ Report progress
2805  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting I symmetry detection." );
2806 
2807  //================================================ Are the basic requirements for icosahedral symmetry met?
2809  {
2810  //============================================ Search for all the symmetry axes
2811  ProSHADE_internal_symmetry::findIcos6C5s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2812  if ( ret.size() != 6 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2813 
2814  ProSHADE_internal_symmetry::findIcos10C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2815  if ( ret.size() != 16 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2816 
2817  ProSHADE_internal_symmetry::findIcos15C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2818  if ( ret.size() != 31 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2819  else
2820  {
2821  //======================================== Sort ret by fold
2822  std::sort ( ret.begin(), ret.end(), ProSHADE_internal_misc::sortSymInvFoldHlp );
2823 
2824  //======================================== Save indices
2825  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
2826  {
2827  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
2828  {
2829  const FloatingPoint< proshade_double > lhs1 ( CSymList->at(csIt)[0] ), rhs1 ( ret.at(retIt)[0] );
2830  const FloatingPoint< proshade_double > lhs2 ( CSymList->at(csIt)[1] ), rhs2 ( ret.at(retIt)[1] );
2831  const FloatingPoint< proshade_double > lhs3 ( CSymList->at(csIt)[2] ), rhs3 ( ret.at(retIt)[2] );
2832  const FloatingPoint< proshade_double > lhs4 ( CSymList->at(csIt)[3] ), rhs4 ( ret.at(retIt)[3] );
2833  const FloatingPoint< proshade_double > lhs5 ( CSymList->at(csIt)[4] ), rhs5 ( ret.at(retIt)[4] );
2834  const FloatingPoint< proshade_double > lhs6 ( CSymList->at(csIt)[5] ), rhs6 ( ret.at(retIt)[5] );
2835  if ( lhs1.AlmostEquals ( rhs1 ) &&
2836  lhs2.AlmostEquals ( rhs2 ) &&
2837  lhs3.AlmostEquals ( rhs3 ) &&
2838  lhs4.AlmostEquals ( rhs4 ) &&
2839  lhs5.AlmostEquals ( rhs5 ) &&
2840  lhs6.AlmostEquals ( rhs6 ) )
2841  {
2843  }
2844  }
2845  }
2846  }
2847  }
2848 
2849  //================================================ Report progress
2850  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "I symmetry detection complete." );
2851 
2852  //================================================ Done
2853  return ( ret );
2854 
2855 }

◆ 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]bandThe band for which the imaginary E matrix values are requested.
[in]orderThe order for which the imaginary E matrix values are requested.
[in]eMatsLMImagThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4187 of file ProSHADE_data.cpp.

4188 {
4189  //================================================ Save the data into the output array
4190  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4191  {
4192  eMatsLMImag[iter] = static_cast<double> ( this->eMatrices[band][order1][iter][1] );
4193  }
4194 
4195  //================================================ Done
4196  return ;
4197 
4198 }

◆ 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]rotFunImagThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4274 of file ProSHADE_data.cpp.

4275 {
4276  //================================================ Save the data into the output array
4277  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4278  {
4279  rotFunImag[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][1] );
4280  }
4281 
4282  //================================================ Done
4283  return ;
4284 
4285 }

◆ 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]so3CoefsImagThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4223 of file ProSHADE_data.cpp.

4224 {
4225  //================================================ Save the data into the output array
4226  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4227  {
4228  so3CoefsImag[iter] = static_cast<double> ( this->so3Coeffs[iter][1] );
4229  }
4230 
4231  //================================================ Done
4232  return ;
4233 
4234 }

◆ 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
[out]XPointer to the value of the internal private spherical harmonics imaginary value of the given index.

Definition at line 3736 of file ProSHADE_data.cpp.

3737 {
3738  //================================================ Done
3739  return ( &this->sphericalHarmonics[shell][seanindex ( static_cast< int > ( order ) - static_cast< int > ( band ),
3740  static_cast< int > ( band ),
3741  static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ) )][1] );
3742 
3743 }

◆ 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]trsFunImagThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4310 of file ProSHADE_data.cpp.

4311 {
4312  //================================================ Save the data into the output array
4313  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4314  {
4315  trsFunImag[iter] = static_cast<double> ( this->translationMap[iter][1] );
4316  }
4317 
4318  //================================================ Done
4319  return ;
4320 
4321 }

◆ getIntegrationWeight()

proshade_double ProSHADE_internal_data::ProSHADE_data::getIntegrationWeight ( void  )

This function allows access to the integration weight for the object.

Parameters
[out]XThe integration weight for the object or 0.0 if not yet computed.

Definition at line 3760 of file ProSHADE_data.cpp.

3761 {
3762  //================================================ Done
3763  return ( this->integrationWeight );
3764 
3765 }

◆ getInternalMap()

proshade_double *& ProSHADE_internal_data::ProSHADE_data::getInternalMap ( void  )

This function allows access to the first map array value address.

Parameters
[out]internalMapPointer to the first position in the internal map array.

Definition at line 4028 of file ProSHADE_data.cpp.

4029 {
4030  //================================================ Return the requested value
4031  return ( this->internalMap );
4032 }

◆ getInvSO3Coeffs()

proshade_complex * ProSHADE_internal_data::ProSHADE_data::getInvSO3Coeffs ( void  )

This function allows access to the inverse SO(3) coefficients array.

Parameters
[out]XThe internal inverse SO(3) coefficients array variable.

Definition at line 3826 of file ProSHADE_data.cpp.

3827 {
3828  //================================================ Done
3829  return ( this->so3CoeffsInverse );
3830 
3831 }

◆ 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]mapCOMProcessChangeVector of the distances in Angstroms that the structure has been moved internally.

Definition at line 4048 of file ProSHADE_data.cpp.

4049 {
4050  //================================================ Initialise local variables
4051  std::vector< proshade_double > ret;
4052 
4053  //================================================ Save the values
4057 
4058  //================================================ Return the requested value
4059  return ( ret );
4060 }

◆ 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]posThe position in the map array, of which the value should be returned.
[out]XThe internal map representation value at position pos.

Definition at line 3589 of file ProSHADE_data.cpp.

3590 {
3591  //================================================ Return the value
3592  return ( this->internalMap[pos] );
3593 }

◆ getMaxBand()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxBand ( void  )

This function returns the maximum band value for the object.

Parameters
[out]XThe largest number of bands used in any shell of the object.

Definition at line 3599 of file ProSHADE_data.cpp.

3600 {
3601  //================================================ Return the value
3602  return ( this->maxShellBand );
3603 }

◆ getMaxSpheres()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxSpheres ( void  )

This function returns the number of spheres which contain the whole object.

Parameters
[out]XThe total number of spheres to which the structure is mapped.

Definition at line 3578 of file ProSHADE_data.cpp.

3579 {
3580  //================================================ Return the value
3581  return ( this->noSpheres );
3582 }

◆ getNoRecommendedSymmetryAxes()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getNoRecommendedSymmetryAxes ( ProSHADE_settings settings)

This function returns the number of detected recommended symmetry axes.

Parameters
[in]settingsA pointer to settings class containing all the information required for map manipulation.
[out]valThe length of the recommended symmetry axes vector.

Definition at line 4386 of file ProSHADE_data.cpp.

4387 {
4388  //================================================ Return the value
4389  return ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) );
4390 }

◆ getOctahedralSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getOctahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

This function obtains 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/sqrt(3) ) ). If so, it will then assume existence of octahedral symmetry and it will search for three C4 axes, four C3 axes and six C2 axes with the correct angle to each other and within the group. If all required axes are detected, it will return a list of 13 axes, otherwise it will return empty or shorter list. Automated missing symmetry axis detection is also included.

Parameters
[in]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.

Definition at line 2199 of file ProSHADE_symmetry.cpp.

2200 {
2201  //================================================ Initialise variables
2202  std::vector< proshade_double* > ret;
2203 
2204  //================================================ Report progress
2205  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting O symmetry detection." );
2206 
2207  //================================================ Are the basic requirements for tetrahedral symmetry met?
2208  if ( ProSHADE_internal_symmetry::detectOctahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2209  {
2210  //============================================ Search for all the symmetry axes
2211  ProSHADE_internal_symmetry::findOcta3C4s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2212  if ( ret.size() != 3 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2213 
2214  ProSHADE_internal_symmetry::findOcta4C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2215  if ( ret.size() != 7 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2216 
2217  ProSHADE_internal_symmetry::findOcta6C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2218  if ( ret.size() != 13 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
2219  else
2220  {
2221  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
2222  {
2223  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
2224  {
2225  //======================================== Sort ret by fold
2226  std::sort ( ret.begin(), ret.end(), ProSHADE_internal_misc::sortSymInvFoldHlp );
2227 
2228  //======================================== Save indices
2229  const FloatingPoint< proshade_double > lhs1 ( CSymList->at(csIt)[0] ), rhs1 ( ret.at(retIt)[0] );
2230  const FloatingPoint< proshade_double > lhs2 ( CSymList->at(csIt)[1] ), rhs2 ( ret.at(retIt)[1] );
2231  const FloatingPoint< proshade_double > lhs3 ( CSymList->at(csIt)[2] ), rhs3 ( ret.at(retIt)[2] );
2232  const FloatingPoint< proshade_double > lhs4 ( CSymList->at(csIt)[3] ), rhs4 ( ret.at(retIt)[3] );
2233  const FloatingPoint< proshade_double > lhs5 ( CSymList->at(csIt)[4] ), rhs5 ( ret.at(retIt)[4] );
2234  const FloatingPoint< proshade_double > lhs6 ( CSymList->at(csIt)[5] ), rhs6 ( ret.at(retIt)[5] );
2235  if ( lhs1.AlmostEquals ( rhs1 ) &&
2236  lhs2.AlmostEquals ( rhs2 ) &&
2237  lhs3.AlmostEquals ( rhs3 ) &&
2238  lhs4.AlmostEquals ( rhs4 ) &&
2239  lhs5.AlmostEquals ( rhs5 ) &&
2240  lhs6.AlmostEquals ( rhs6 ) )
2241  {
2243  }
2244  }
2245  }
2246  }
2247  }
2248 
2249  //================================================ Report progress
2250  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "O symmetry detection complete." );
2251 
2252  //================================================ Done
2253  return ( ret );
2254 
2255 }

◆ getOverlayRotationFunction()

void ProSHADE_internal_data::ProSHADE_data::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).

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]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]obj2A pointer to the data class object of the other ( static ) structure.

Definition at line 35 of file ProSHADE_overlay.cpp.

36 {
37  //================================================ Report progress
38  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting rotation function computation." );
39 
40  //================================================ Compute un-weighted E matrices and their weights
41  ProSHADE_internal_distances::computeEMatrices ( obj2, this, settings );
42 
43  //================================================ Normalise E matrices by the magnitudes
44  ProSHADE_internal_distances::normaliseEMatrices ( obj2, this, settings );
45 
46  //================================================ Generate SO(3) coefficients
48 
49  //================================================ Compute the inverse SO(3) Fourier Transform (SOFT) on the newly computed coefficients
51 
52  //================================================ Report completion
53  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Rotation function obtained." );
54 
55  //================================================ Done
56  return ;
57 
58 }

◆ getPredictedIcosahedralSymmetriesList()

std::vector< std::vector< proshade_double * > > ProSHADE_internal_data::ProSHADE_data::getPredictedIcosahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

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]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.
[out]retA vector of all the detected axes in the standard ProSHADE format with height either the detected value (for the detected ones) or 0 for the predicted ones.

Definition at line 2871 of file ProSHADE_symmetry.cpp.

2872 {
2873  //================================================ Initialise variables
2874  std::vector< std::vector< proshade_double* > > ret;
2875 
2876  //================================================ Report progress
2877  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting I symmetry prediction." );
2878 
2879  //================================================ Are the basic requirements for icosahedral symmetry met?
2881  {
2882  //============================================ Generate the rest of the axes
2883  ProSHADE_internal_symmetry::predictIcosAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
2884 
2885  //============================================ For each possible axes pair
2886  for ( size_t pIt = 0; pIt < ret.size(); pIt++ )
2887  {
2888  //======================================== Get heights for the predicted axes
2889  ProSHADE_internal_symmetry::findPredictedAxesHeights ( &(ret.at(pIt)), this, settings );
2890  }
2891  }
2892 
2893 
2894  //================================================ Report progress
2895  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "I symmetry prediction complete." );
2896 
2897  //================================================ Done
2898  return ( ret );
2899 
2900 }

◆ getPredictedOctahedralSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getPredictedOctahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

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]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.
[out]retA vector of all the detected axes in the standard ProSHADE format with height either the detected value (for the detected ones) or 0 for the predicted ones.

Definition at line 2916 of file ProSHADE_symmetry.cpp.

2917 {
2918  //================================================ Initialise variables
2919  std::vector< proshade_double* > ret;
2920 
2921  //================================================ Report progress
2922  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting O symmetry prediction." );
2923 
2924  //================================================ Are the basic requirements for icosahedral symmetry met?
2925  if ( ProSHADE_internal_symmetry::detectOctahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2926  {
2927  //============================================ Generate the rest of the axes
2928  ProSHADE_internal_symmetry::predictOctaAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
2929 
2930  //============================================ Get heights for the predicted axes
2932 
2933  //============================================ Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
2934  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ret.size() ); retIt++ )
2935  {
2936  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ret.at(retIt)[0] ), ret.at(retIt)[1], ret.at(retIt)[2], ret.at(retIt)[3], ret.at(retIt)[5], CSymList, settings->axisErrTolerance );
2937  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedOAxes, static_cast < proshade_unsign > ( matchedPos ) );
2938  }
2939  }
2940 
2941  //================================================ Report progress
2942  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "O symmetry prediction complete." );
2943 
2944  //================================================ Done
2945  return ( ret );
2946 
2947 }

◆ getPredictedTetrahedralSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getPredictedTetrahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

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]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.
[out]retA vector of all the detected axes in the standard ProSHADE format with height either the detected value (for the detected ones) or 0 for the predicted ones.

Definition at line 4253 of file ProSHADE_symmetry.cpp.

4254 {
4255  //================================================ Initialise variables
4256  std::vector< proshade_double* > ret;
4257 
4258  //================================================ Report progress
4259  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting T symmetry prediction." );
4260 
4261  //================================================ Are the basic requirements for icosahedral symmetry met?
4263  {
4264  //============================================ Generate the rest of the axes
4265  ProSHADE_internal_symmetry::predictTetraAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
4266 
4267  //============================================ Get heights for the predicted axes
4269 
4270  //============================================ Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
4271  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ret.size() ); retIt++ )
4272  {
4273  proshade_signed matchedPos = ProSHADE_internal_symmetry::addAxisUnlessSame ( static_cast< proshade_unsign > ( ret.at(retIt)[0] ), ret.at(retIt)[1], ret.at(retIt)[2], ret.at(retIt)[3], ret.at(retIt)[5], CSymList, settings->axisErrTolerance );
4274  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedTAxes, static_cast < proshade_unsign > ( matchedPos ) );
4275  }
4276  }
4277 
4278  //================================================ Report progress
4279  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "T symmetry prediction complete." );
4280 
4281  //================================================ Done
4282  return ( ret );
4283 
4284 }

◆ 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]bandThe band for which the real E matrix values are requested.
[in]orderThe order for which the real E matrix values are requested.
[in]eMatsLMRealThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4167 of file ProSHADE_data.cpp.

4168 {
4169  //================================================ Save the data into the output array
4170  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4171  {
4172  eMatsLMReal[iter] = static_cast<double> ( this->eMatrices[band][order1][iter][0] );
4173  }
4174 
4175  //================================================ Done
4176  return ;
4177 
4178 }

◆ 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]rotFunRealThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4256 of file ProSHADE_data.cpp.

4257 {
4258  //================================================ Save the data into the output array
4259  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4260  {
4261  rotFunReal[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][0] );
4262  }
4263 
4264  //================================================ Done
4265  return ;
4266 
4267 }

◆ 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]so3CoefsRealThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4205 of file ProSHADE_data.cpp.

4206 {
4207  //================================================ Save the data into the output array
4208  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4209  {
4210  so3CoefsReal[iter] = static_cast<double> ( this->so3Coeffs[iter][0] );
4211  }
4212 
4213  //================================================ Done
4214  return ;
4215 
4216 }

◆ 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
[out]XPointer to the value of the internal private spherical harmonics real value of the given index.

Definition at line 3723 of file ProSHADE_data.cpp.

3724 {
3725  //================================================ Done
3726  return ( &this->sphericalHarmonics[shell][seanindex ( static_cast< int > ( order ) - static_cast< int > ( band ),
3727  static_cast< int > ( band ),
3728  static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ) )][0] );
3729 
3730 }

◆ 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]trsFunRealThe array to which the values will be written into.
[in]lenThe lenght of the array.

Definition at line 4292 of file ProSHADE_data.cpp.

4293 {
4294  //================================================ Save the data into the output array
4295  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4296  {
4297  trsFunReal[iter] = static_cast<double> ( this->translationMap[iter][0] );
4298  }
4299 
4300  //================================================ Done
4301  return ;
4302 
4303 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.
[in]retA 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 1329 of file ProSHADE_data.cpp.

1330 {
1331  //================================================ Report function start
1332  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Finding new boundaries." );
1333 
1334  //================================================ If same bounds as first one are required, test if possible and return these instead
1335  if ( settings->useSameBounds && ( this->inputOrder != 0 ) )
1336  {
1337  for ( proshade_unsign iter = 0; iter < 6; iter++ ) { ret[iter] = settings->forceBounds[iter]; }
1338  }
1339  //================================================ In this case, bounds need to be found de novo
1340  else
1341  {
1342  //============================================ Find the non-zero bounds
1344  static_cast< proshade_signed > ( this->xDimIndices ),
1345  static_cast< proshade_signed > ( this->yDimIndices ),
1346  static_cast< proshade_signed > ( this->zDimIndices ),
1347  ret );
1348 
1349  //============================================ Add the extra space
1351  this->xDimSize, this->yDimSize, this->zDimSize, ret, settings->boundsExtraSpace );
1352 
1353  //============================================ Beautify boundaries
1355 
1356  //============================================ Report function results
1357  std::stringstream ssHlp;
1358  ssHlp << "New boundaries are: " << ret[1] - ret[0] + 1 << " x " << ret[3] - ret[2] + 1 << " x " << ret[5] - ret[4] + 1;
1359  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, ssHlp.str() );
1360 
1361  //============================================ If need be, save boundaries to be used for all other structure
1362  if ( settings->useSameBounds && ( this->inputOrder == 0 ) )
1363  {
1364  for ( proshade_unsign iter = 0; iter < 6; iter++ ) { settings->forceBounds[iter] = ret[iter]; }
1365  }
1366  }
1367 
1368  //================================================ Report function completion
1369  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New boundaries determined." );
1370 
1371  //================================================ Done
1372  return ;
1373 
1374 }

◆ getRecommendedSymmetryFold()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getRecommendedSymmetryFold ( ProSHADE_settings settings)

This function simply returns the detected recommended symmetry fold.

Parameters
[in]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 4374 of file ProSHADE_data.cpp.

4375 {
4376  //================================================ Return the value
4377  return ( settings->recommendedSymmetryFold );
4378 
4379 }

◆ getRecommendedSymmetryType()

std::string ProSHADE_internal_data::ProSHADE_data::getRecommendedSymmetryType ( ProSHADE_settings settings)

This function simply returns the detected recommended symmetry type.

Parameters
[in]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 4363 of file ProSHADE_data.cpp.

4364 {
4365  //================================================ Return the value
4366  return ( settings->recommendedSymmetryType );
4367 
4368 }

◆ 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]aIThe index along the Euler alpha dimension.
[in]bIThe index along the Euler beta dimension.
[in]gIThe index along the Euler gamma dimension.
[in]rotMatThe array to which the rotation matrix will be written into.
[in]lenThe lenght of the array (must be 9).

Definition at line 4331 of file ProSHADE_data.cpp.

4332 {
4333  //================================================ Get Euler angles
4334  proshade_double eA, eB, eG;
4335  ProSHADE_internal_maths::getEulerZXZFromSOFTPosition ( static_cast< int > ( this->getMaxBand() ), aI, bI, gI, &eA, &eB, &eG );
4336 
4337  //================================================ Prepare internal rotation matrix memory
4338  proshade_double* rMat = nullptr;
4339  rMat = new proshade_double[9];
4340  ProSHADE_internal_misc::checkMemoryAllocation ( rMat, __FILE__, __LINE__, __func__ );
4341 
4342  //================================================ Convert to rotation matrix
4344 
4345  //================================================ Copy to output
4346  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
4347  {
4348  rotMat[iter] = static_cast<double> ( rMat[iter] );
4349  }
4350 
4351  //================================================ Release internal memory
4352  delete[] rMat;
4353 
4354  //================================================ Done
4355  return ;
4356 
4357 }

◆ 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]XThe value of the internal private RRP matrix for the given indices.

Definition at line 3609 of file ProSHADE_data.cpp.

3610 {
3611  //================================================ Return the value
3612  return ( this->rrpMatrices[band][sh1][sh2] );
3613 }

◆ 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]shellThe index of the shell for which the bandwidth is required.
[out]XThe bandwidth of the requested shell.

Definition at line 3772 of file ProSHADE_data.cpp.

3773 {
3774  //================================================ Done
3775  return ( this->spheres[shell]->getLocalBandwidth ( ) );
3776 
3777 }

◆ getSO3Coeffs()

proshade_complex * ProSHADE_internal_data::ProSHADE_data::getSO3Coeffs ( void  )

This function allows access to the SO(3) coefficients array.

Parameters
[out]XThe internal SO(3) coefficients array variable.

Definition at line 3837 of file ProSHADE_data.cpp.

3838 {
3839  //================================================ Done
3840  return ( this->so3Coeffs );
3841 
3842 }

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 1742 of file ProSHADE_data.cpp.

1743 {
1744  //================================================ Check the current settings value is set to auto
1745  if ( this->spherePos.size() != 0 )
1746  {
1747  std::stringstream hlpSS;
1748  hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1749  for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1750  hlpSS << " Angstroms.";
1751  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1752  return ;
1753  }
1754 
1755  //================================================ Find maximum diagonal
1756  proshade_unsign maxDim = static_cast< proshade_unsign > ( std::max ( this->xDimSize, std::max ( this->yDimSize, this->zDimSize ) ) );
1757  proshade_unsign minDim = static_cast< proshade_unsign > ( std::min ( this->xDimSize, std::min ( this->yDimSize, this->zDimSize ) ) );
1758  proshade_unsign midDim = static_cast< proshade_unsign > ( 0 );
1759  if ( ( this->xDimSize < static_cast< proshade_single > ( maxDim ) ) && ( this->xDimSize > static_cast< proshade_single > ( minDim ) ) ) { midDim = static_cast< proshade_unsign > ( this->xDimSize ); }
1760  else if ( ( this->yDimSize < static_cast< proshade_single > ( maxDim ) ) && ( this->yDimSize > static_cast< proshade_single > ( minDim ) ) ) { midDim = static_cast< proshade_unsign > ( this->yDimSize ); }
1761  else { midDim = static_cast< proshade_unsign > ( this->zDimSize ); }
1762 
1763  proshade_single maxDiag = static_cast< proshade_single > ( std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ), 2.0 ) +
1764  std::pow ( static_cast<proshade_single> ( midDim ), 2.0 ) ) );
1765 
1766  //================================================ Set between the points
1767  for ( proshade_single iter = 0.5f; ( iter * settings->maxSphereDists ) < ( maxDiag / 2.0f ); iter += 1.0f )
1768  {
1769  ProSHADE_internal_misc::addToSingleVector ( &this->spherePos, ( iter * settings->maxSphereDists ) );
1770  }
1771 
1772  //================================================ Save the number of spheres
1773  this->noSpheres = static_cast<proshade_unsign> ( this->spherePos.size() );
1774 
1775  //================================================ Report progress
1776  std::stringstream hlpSS;
1777  hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1778  for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1779  hlpSS << " Angstroms.";
1780  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1781 
1782  //================================================ Done
1783  return ;
1784 
1785 }

◆ getSpherePosValue()

proshade_single ProSHADE_internal_data::ProSHADE_data::getSpherePosValue ( proshade_unsign  shell)

This function allows access to sphere positions.

Parameters
[in]shellThe index of the sphere for which the position (radius) is to be obtained.
[out]XThe radius of the sphere with index shell.

Definition at line 3784 of file ProSHADE_data.cpp.

3785 {
3786  //================================================ Done
3787  return ( this->spherePos.at(shell) );
3788 
3789 }

◆ 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]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]axisNoThe index of the axis to be returned.
[out]valA 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 4398 of file ProSHADE_data.cpp.

4399 {
4400  //================================================ Sanity checks
4401  if ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) <= axisNo )
4402  {
4403  ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
4404  return ( std::vector< std::string > ( ) );
4405  }
4406 
4407  //================================================ Initialise local variables
4408  std::vector< std::string > ret;
4409 
4410  //================================================ Input the axis data as strings
4411  std::stringstream ssHlp;
4412  ssHlp << settings->detectedSymmetry.at(axisNo)[0];
4413  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4414  ssHlp.str ( "" );
4415 
4416  ssHlp << settings->detectedSymmetry.at(axisNo)[1];
4417  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4418  ssHlp.str ( "" );
4419 
4420  ssHlp << settings->detectedSymmetry.at(axisNo)[2];
4421  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4422  ssHlp.str ( "" );
4423 
4424  ssHlp << settings->detectedSymmetry.at(axisNo)[3];
4425  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4426  ssHlp.str ( "" );
4427 
4428  ssHlp << settings->detectedSymmetry.at(axisNo)[4];
4429  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4430  ssHlp.str ( "" );
4431 
4432  ssHlp << settings->detectedSymmetry.at(axisNo)[5];
4433  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4434  ssHlp.str ( "" );
4435 
4436  ssHlp << settings->detectedSymmetry.at(axisNo)[6];
4437  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
4438  ssHlp.str ( "" );
4439 
4440  //================================================ Done
4441  return ( ret );
4442 
4443 }

◆ getTetrahedralSymmetriesList()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::getTetrahedralSymmetriesList ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSymList 
)

This function obtains a list of all T symmetry axes from the already computed C symmetries list.

This function starts by checking if there are two C3 symmetries with the tetrahedral dihedral angle. If so, it proceeds to search for all seven symmetry axes expected to form a full tetrahedral symmetry. It then returns the list of found symmetries; if full tetrahedral symmetry was found, seven axes (four C3s and three C2s) are returned. If less than seven symmetries are returned, the procedure has failed and no tetrahedral symmetry was found.

Parameters
[in]settingsA pointer to settings class containing all the information required for symmetry detection.
[in]CSymListA vector containing the already detected Cyclic symmetries.

Definition at line 1419 of file ProSHADE_symmetry.cpp.

1420 {
1421  //================================================ Initialise variables
1422  std::vector< proshade_double* > ret;
1423 
1424  //================================================ Report progress
1425  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting T symmetry detection." );
1426 
1427  //================================================ Are the basic requirements for tetrahedral symmetry met?
1429  {
1430  //============================================ Search for all the symmetry axes
1431  ProSHADE_internal_symmetry::findTetra4C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
1432  if ( ret.size() != 4 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
1433 
1434  ProSHADE_internal_symmetry::findTetra3C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
1435  if ( ret.size() != 7 ) { ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Failed to detect some of the polyhedral symmetries, while detecting the correct dihedral angles.", "WS00031" ); return ( ret ); }
1436  else
1437  {
1438  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
1439  {
1440  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
1441  {
1442  //======================================== Sort ret by fold
1443  std::sort ( ret.begin(), ret.end(), ProSHADE_internal_misc::sortSymInvFoldHlp );
1444 
1445  //======================================== Save indices
1446  const FloatingPoint< proshade_double > lhs1 ( CSymList->at(csIt)[0] ), rhs1 ( ret.at(retIt)[0] );
1447  const FloatingPoint< proshade_double > lhs2 ( CSymList->at(csIt)[1] ), rhs2 ( ret.at(retIt)[1] );
1448  const FloatingPoint< proshade_double > lhs3 ( CSymList->at(csIt)[2] ), rhs3 ( ret.at(retIt)[2] );
1449  const FloatingPoint< proshade_double > lhs4 ( CSymList->at(csIt)[3] ), rhs4 ( ret.at(retIt)[3] );
1450  const FloatingPoint< proshade_double > lhs5 ( CSymList->at(csIt)[4] ), rhs5 ( ret.at(retIt)[4] );
1451  const FloatingPoint< proshade_double > lhs6 ( CSymList->at(csIt)[5] ), rhs6 ( ret.at(retIt)[5] );
1452  if ( ( lhs1.AlmostEquals ( rhs1 ) ) &&
1453  ( lhs2.AlmostEquals ( rhs2 ) ) &&
1454  ( lhs3.AlmostEquals ( rhs3 ) ) &&
1455  ( lhs4.AlmostEquals ( rhs4 ) ) &&
1456  ( lhs5.AlmostEquals ( rhs5 ) ) &&
1457  ( lhs6.AlmostEquals ( rhs6 ) ) )
1458  {
1460  }
1461  }
1462  }
1463  }
1464  }
1465 
1466  //================================================ Report progress
1467  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "T symmetry detection complete." );
1468 
1469  //================================================ Done
1470  return ( ret );
1471 
1472 }

◆ getTranslationFnPointer()

proshade_complex * ProSHADE_internal_data::ProSHADE_data::getTranslationFnPointer ( void  )

This function allows access to the translation function through a pointer.

Parameters
[out]translationMapPointer to the first position in the translation function map array.

Definition at line 4038 of file ProSHADE_data.cpp.

4039 {
4040  //================================================ Return the requested value
4041  return ( this->translationMap );
4042 }

◆ 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]bandThe band for which the Wigner D matrix value should be returned.
[in]order1The first order for which the Wigner D matrix value should be returned.
[in]order2The second order for which the Wigner D matrix value should be returned.
[in]valueRealThe proshade_double number pointer to where the real part of the value will be saved.
[in]valueImagThe proshade_double number pointer to where the imaginary part of the value will be saved.

Definition at line 3863 of file ProSHADE_data.cpp.

3864 {
3865  //================================================ Set pointer
3866  *valueReal = this->wignerMatrices[band][order1][order2][0];
3867  *valueImag = this->wignerMatrices[band][order1][order2][1];
3868 
3869  //================================================ Done
3870  return ;
3871 
3872 }

◆ getXAxisOrigin()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXAxisOrigin ( void  )

This function allows access to the map X axis origin value.

Parameters
[out]xAxisOriginThe value of X axis origin for the map.

Definition at line 3998 of file ProSHADE_data.cpp.

3999 {
4000  //================================================ Return the requested value
4001  return ( &this->xAxisOrigin );
4002 }

◆ 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]xDimSizeThe size of the internal map in indices along the X axis.

Definition at line 3908 of file ProSHADE_data.cpp.

3909 {
3910  //================================================ Return the requested value
3911  return ( this->xDimIndices );
3912 }

◆ 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]xDimSizeThe size of the internal map in angstroms along the X axis.

Definition at line 3878 of file ProSHADE_data.cpp.

3879 {
3880  //================================================ Return the requested value
3881  return ( this->xDimSize );
3882 }

◆ getXFromPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXFromPtr ( void  )

This function allows access to the map start along the X axis.

Parameters
[out]xFromPointer to the starting index along the X axis.

Definition at line 3938 of file ProSHADE_data.cpp.

3939 {
3940  //================================================ Return the requested value
3941  return ( &this->xFrom );
3942 }

◆ 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]xFromPointer to the final index along the X axis.

Definition at line 3968 of file ProSHADE_data.cpp.

3969 {
3970  //================================================ Return the requested value
3971  return ( &this->xTo );
3972 }

◆ getYAxisOrigin()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYAxisOrigin ( void  )

This function allows access to the map Y axis origin value.

Parameters
[out]yAxisOriginThe value of Y axis origin for the map.

Definition at line 4008 of file ProSHADE_data.cpp.

4009 {
4010  //================================================ Return the requested value
4011  return ( &this->yAxisOrigin );
4012 }

◆ 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]xDimSizeThe size of the internal map in indices along the Y axis.

Definition at line 3918 of file ProSHADE_data.cpp.

3919 {
3920  //================================================ Return the requested value
3921  return ( this->yDimIndices );
3922 }

◆ 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]xDimSizeThe size of the internal map in angstroms along the Y axis.

Definition at line 3888 of file ProSHADE_data.cpp.

3889 {
3890  //================================================ Return the requested value
3891  return ( this->yDimSize );
3892 }

◆ getYFromPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYFromPtr ( void  )

This function allows access to the map start along the Y axis.

Parameters
[out]yFromPointer to the starting index along the Y axis.

Definition at line 3948 of file ProSHADE_data.cpp.

3949 {
3950  //================================================ Return the requested value
3951  return ( &this->yFrom );
3952 }

◆ 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]yFromPointer to the final index along the Y axis.

Definition at line 3978 of file ProSHADE_data.cpp.

3979 {
3980  //================================================ Return the requested value
3981  return ( &this->yTo );
3982 }

◆ getZAxisOrigin()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZAxisOrigin ( void  )

This function allows access to the map Z axis origin value.

Parameters
[out]zAxisOriginThe value of Z axis origin for the map.

Definition at line 4018 of file ProSHADE_data.cpp.

4019 {
4020  //================================================ Return the requested value
4021  return ( &this->zAxisOrigin );
4022 }

◆ 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]xDimSizeThe size of the internal map in indices along the Z axis.

Definition at line 3928 of file ProSHADE_data.cpp.

3929 {
3930  //================================================ Return the requested value
3931  return ( this->zDimIndices );
3932 }

◆ 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]xDimSizeThe size of the internal map in angstroms along the Z axis.

Definition at line 3898 of file ProSHADE_data.cpp.

3899 {
3900  //================================================ Return the requested value
3901  return ( this->zDimSize );
3902 }

◆ getZFromPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZFromPtr ( void  )

This function allows access to the map start along the Z axis.

Parameters
[out]zFromPointer to the starting index along the Z axis.

Definition at line 3958 of file ProSHADE_data.cpp.

3959 {
3960  //================================================ Return the requested value
3961  return ( &this->zFrom );
3962 }

◆ 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]zFromPointer to the final index along the Z axis.

Definition at line 3988 of file ProSHADE_data.cpp.

3989 {
3990  //================================================ Return the requested value
3991  return ( &this->zTo );
3992 }

◆ interpolateMapFromSpheres()

void ProSHADE_internal_data::ProSHADE_data::interpolateMapFromSpheres ( proshade_double *&  densityMapRotated)

This function interpolates the density map from the sphere mapped data.

Parameters
[in]densityMapRotatedThe pointer to allocated memory where the new map values will be held.

Definition at line 1200 of file ProSHADE_overlay.cpp.

1201 {
1202  //================================================ Initialise variables
1203  proshade_double rad = 0.0, lon = 0.0, lat = 0.0, newU = 0.0, newV = 0.0, newW = 0.0;
1204  proshade_unsign lowerLonL = 0, upperLonL = 0, lowerLonU = 0, upperLonU = 0, lowerLatL = 0, upperLatL = 0, lowerLatU = 0, upperLatU = 0, lowerShell = 0, upperShell = 0;
1205  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;
1206  proshade_double lowerShellValue = 0.0, upperShellValue = 0.0;
1207  proshade_double xSamplingRate = static_cast<proshade_double> ( this->xDimSize ) / static_cast<proshade_double> ( this->xDimIndices );
1208  proshade_double ySamplingRate = static_cast<proshade_double> ( this->yDimSize ) / static_cast<proshade_double> ( this->yDimIndices );
1209  proshade_double zSamplingRate = static_cast<proshade_double> ( this->zDimSize ) / static_cast<proshade_double> ( this->zDimIndices );
1210  proshade_signed arrPos;
1211  std::vector<proshade_double> lonCOU, latCOU, lonCOL, latCOL;
1212 
1213  for ( proshade_signed uIt = 0; uIt < static_cast<proshade_signed> (this->xDimIndices); uIt++ )
1214  {
1215  for ( proshade_signed vIt = 0; vIt < static_cast<proshade_signed> (this->yDimIndices); vIt++ )
1216  {
1217  for ( proshade_signed wIt = 0; wIt < static_cast<proshade_signed> (this->zDimIndices); wIt++ )
1218  {
1219  //==================================== Convert to centered coords
1220  newU = static_cast<proshade_double> ( uIt - ( static_cast<proshade_signed> (this->xDimIndices) / 2 ) );
1221  newV = static_cast<proshade_double> ( vIt - ( static_cast<proshade_signed> (this->yDimIndices) / 2 ) );
1222  newW = static_cast<proshade_double> ( wIt - ( static_cast<proshade_signed> (this->zDimIndices) / 2 ) );
1223 
1224  //==================================== Deal with 0 ; 0 ; 0
1225  if ( ( newU == 0.0 ) && ( newV == 0.0 ) && ( newW == 0.0 ) )
1226  {
1227  arrPos = wIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( vIt + static_cast< proshade_signed > ( this->yDimIndices ) * uIt );
1228  densityMapRotated[arrPos] = this->internalMap[arrPos];
1229  continue;
1230  }
1231 
1232  //==================================== Convert to spherical coords
1233  rad = sqrt ( pow( ( newU * xSamplingRate ), 2.0 ) +
1234  pow( ( newV * ySamplingRate ), 2.0 ) +
1235  pow( ( newW * zSamplingRate ), 2.0 ) );
1236  lon = atan2 ( ( newV * ySamplingRate ), ( newU * xSamplingRate ) );
1237  lat = asin ( ( newW * zSamplingRate ) / rad );
1238 
1239  //==================================== Deal with nan's
1240  if ( rad != rad ) { rad = 0.0; }
1241  if ( lon != lon ) { lon = 0.0; }
1242  if ( lat != lat ) { lat = 0.0; }
1243 
1244  //==================================== Find shells above and below
1245  lowerShell = 0;
1246  upperShell = 0;
1247  for ( proshade_unsign iter = 0; iter < (this->noSpheres-1); iter++ )
1248  {
1249  if ( ( static_cast< proshade_double > ( this->spherePos.at(iter) ) <= rad ) && ( static_cast< proshade_double > ( this->spherePos.at(iter+1) ) > rad ) )
1250  {
1251  lowerShell = iter;
1252  upperShell = iter+1;
1253  break;
1254  }
1255  }
1256 
1257  if ( upperShell == 0 )
1258  {
1259  arrPos = wIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( vIt + static_cast< proshade_signed > ( this->yDimIndices ) * uIt );
1260  densityMapRotated[arrPos] = 0.0;
1261  continue;
1262  }
1263 
1264  //==================================== Get the longitude and lattitude cut-offs for this shell resolution
1265  lonCOL.clear(); latCOL.clear(); lonCOU.clear(); latCOU.clear();
1266  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCOL, &latCOL, this->spheres[lowerShell]->getLocalAngRes() );
1267  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCOU, &latCOU, this->spheres[upperShell]->getLocalAngRes() );
1268 
1269  //==================================== Find the angle cutoffs around the point
1270  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOL.size() ); iter++ )
1271  {
1272  if ( iter == ( static_cast<proshade_unsign> ( lonCOL.size() ) - 1 ) )
1273  {
1274  lowerLonL = 0;
1275  upperLonL = 1;
1276  break;
1277  }
1278  if ( ( std::floor(10000. * lonCOL.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOL.at(iter+1)) > std::floor(10000. * lon) ) )
1279  {
1280  lowerLonL = iter;
1281  upperLonL = iter+1;
1282  break;
1283  }
1284  }
1285  if ( upperLonL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLonL = 0; }
1286 
1287  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOU.size() ); iter++ )
1288  {
1289  if ( iter == ( static_cast<proshade_unsign> ( lonCOU.size() ) - 1 ) )
1290  {
1291  lowerLonU = 0;
1292  upperLonU = 1;
1293  break;
1294  }
1295  if ( ( std::floor(10000. * lonCOU.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOU.at(iter+1)) > std::floor(10000. * lon) ) )
1296  {
1297  lowerLonU = iter;
1298  upperLonU = iter+1;
1299  break;
1300  }
1301  }
1302  if ( upperLonU == this->spheres[upperShell]->getLocalAngRes() ) { upperLonU = 0; }
1303 
1304  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOL.size() ); iter++ )
1305  {
1306  if ( iter == ( static_cast<proshade_unsign> ( latCOL.size() ) - 1 ) )
1307  {
1308  lowerLatL = 0;
1309  upperLatL = 1;
1310  break;
1311  }
1312  if ( ( std::floor(10000. * latCOL.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOL.at(iter+1)) > std::floor(10000. * lat) ) )
1313  {
1314  lowerLatL = iter;
1315  upperLatL = iter+1;
1316  break;
1317  }
1318  }
1319  if ( upperLatL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLatL = 0; }
1320 
1321  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOU.size() ); iter++ )
1322  {
1323  if ( iter == ( static_cast<proshade_unsign> ( latCOU.size() ) - 1 ) )
1324  {
1325  lowerLatU = 0;
1326  upperLatU = 1;
1327  break;
1328  }
1329  if ( ( std::floor(10000. * latCOU.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOU.at(iter+1)) > std::floor(10000. * lat) ) )
1330  {
1331  lowerLatU = iter;
1332  upperLatU = iter+1;
1333  break;
1334  }
1335  }
1336  if ( upperLatU == this->spheres[upperShell]->getLocalAngRes() ) { upperLatU = 0; }
1337 
1338  //==================================== Interpolate lower shell
1339  x00 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1340  x01 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1341  x10 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1342  x11 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1343 
1344  distLLon = std::abs ( lon - lonCOL.at(lowerLonL) ) / ( std::abs( lon - lonCOL.at(lowerLonL) ) + std::abs( lon - lonCOL.at(upperLonL) ) );
1345  valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1346  valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1347 
1348  distLLat = std::abs ( lat - latCOL.at(lowerLatL) ) / ( std::abs( lat - latCOL.at(lowerLatL) ) + std::abs( lat - latCOL.at(upperLatL) ) );
1349  lowerShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1350 
1351  //==================================== Interpolate upper shell
1352  x00 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1353  x01 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1354  x10 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1355  x11 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1356 
1357  distLLon = std::abs ( lon - lonCOU.at(lowerLonU) ) / ( std::abs( lon - lonCOU.at(lowerLonU) ) + std::abs( lon - lonCOU.at(upperLonU) ) );
1358  valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1359  valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1360 
1361  distLLat = std::abs ( lat - latCOU.at(lowerLatU) ) / ( std::abs( lat - latCOU.at(lowerLatU) ) + std::abs( lat - latCOU.at(upperLatU) ) );
1362  upperShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1363 
1364  //==================================== Interpolate between shells
1365  distLRad = std::abs ( rad - static_cast< proshade_double > ( this->spherePos.at(lowerShell) ) ) / ( std::abs( rad - static_cast< proshade_double > ( this->spherePos.at(lowerShell) ) ) +
1366  std::abs( rad - static_cast< proshade_double > ( this->spherePos.at(upperShell) ) ) );
1367 
1368  arrPos = wIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( vIt + static_cast< proshade_signed > ( this->yDimIndices ) * uIt );
1369  densityMapRotated[arrPos] = ( ( 1.0 - distLRad ) * lowerShellValue ) + ( distLRad * upperShellValue );
1370  }
1371 
1372  }
1373 
1374  }
1375 
1376  //================================================ Done
1377  return ;
1378 
1379 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.

Definition at line 1188 of file ProSHADE_data.cpp.

1189 {
1190  //================================================ Report function start
1191  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion." );
1192 
1193  //================================================ Initialise variables
1194  proshade_signed arrayPos, invPos;
1195 
1196  //================================================ Create helper map
1197  proshade_double* hlpMap = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
1198  ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
1199 
1200  //================================================ Save map values to the helper map
1201  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1202  {
1203  hlpMap[iter] = this->internalMap[iter];
1204  }
1205 
1206  //================================================ Invert the values
1207  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
1208  {
1209  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
1210  {
1211  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
1212  {
1213  //==================================== Var init
1214  arrayPos = zIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( yIt + static_cast< proshade_signed > ( this->yDimIndices ) * xIt );
1215  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 ) );
1216 
1217  //==================================== And save
1218  this->internalMap[invPos] = hlpMap[arrayPos];
1219  }
1220  }
1221  }
1222 
1223  //================================================ Release memory
1224  delete[] hlpMap;
1225 
1226  //================================================ Report function completion
1227  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map inversion completed." );
1228 
1229  //================================================ Done
1230  return ;
1231 
1232 }

◆ 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 1107 of file ProSHADE_overlay.cpp.

1108 {
1109  //================================================ Initialise local variables
1110  double *sigR = nullptr, *sigI = nullptr, *rcoeffs = nullptr, *icoeffs = nullptr, *weights = nullptr, *workspace = nullptr;
1111  fftw_plan idctPlan, ifftPlan;
1112 
1113  //================================================ For each shell
1114  for ( int shell = 0; shell < static_cast<int> ( this->noSpheres ); shell++ )
1115  {
1116  //=========================================== Initialise internal variables
1117  proshade_unsign oneDim = this->spheres[shell]->getLocalBandwidth() * 2;
1118 
1119  //=========================================== Allocate memory
1120  ProSHADE_internal_overlay::initialiseInverseSHComputation ( this->spheres[shell]->getLocalBandwidth(), sigR, sigI, rcoeffs, icoeffs, weights, workspace, idctPlan, ifftPlan );
1121 
1122  //=========================================== Compute weights for the transform using the appropriate shell related band
1123  makeweights ( static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ), weights );
1124 
1125  //============================================ Allocate rotated shell mapped data memory
1126  this->spheres[shell]->allocateRotatedMap ( );
1127 
1128  //============================================ Load SH coeffs to arrays
1129  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1130  {
1131  rcoeffs[iter] = this->rotSphericalHarmonics[shell][iter][0];
1132  icoeffs[iter] = this->rotSphericalHarmonics[shell][iter][1];
1133  sigR[iter] = 0.0;
1134  sigI[iter] = 0.0;
1135  }
1136 
1137  //============================================ Get inverse spherical harmonics transform for the shell
1138  InvFST_semi_fly ( rcoeffs,
1139  icoeffs,
1140  sigR,
1141  sigI,
1142  static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ),
1143  workspace,
1144  0,
1145  static_cast< int > ( this->spheres[shell]->getLocalBandwidth() ),
1146  &idctPlan,
1147  &ifftPlan );
1148 
1149  //=========================================== Copy the results to the rotated shells array
1150  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
1151  {
1152  this->spheres[shell]->setRotatedMappedData ( iter, sigR[iter] );
1153  }
1154 
1155  //=========================================== Release the plans
1156  fftw_destroy_plan ( idctPlan );
1157  fftw_destroy_plan ( ifftPlan );
1158 
1159  //=========================================== Release the memory
1160  delete[] sigR;
1161  delete[] rcoeffs;
1162  delete[] weights;
1163  delete[] workspace;
1164  }
1165 
1166  //================================================ Done
1167  return ;
1168 
1169 }

◆ 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, taylor series cap, 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 1799 of file ProSHADE_data.cpp.

1800 {
1801  //================================================ Report progress
1802  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting sphere mapping procedure." );
1803 
1804  //================================================ Determine spherical harmonics variables
1805  settings->determineAllSHValues ( this->xDimIndices, this->yDimIndices,
1806  this->xDimSize, this->yDimSize, this->zDimSize );
1807  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere settings determined." );
1808 
1809  //================================================ Find number of spheres supported
1810  this->getSpherePositions ( settings );
1811  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere positions obtained." );
1812 
1813  //================================================ Create sphere objects and map the density
1815  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ )
1816  {
1817  std::stringstream ss;
1818  ss << "Now mapping sphere " << iter << " .";
1819  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1820 
1822  this->xDimSize, this->yDimSize, this->zDimSize, iter,
1823  &this->spherePos, settings->progressiveSphereMapping, settings->maxBandwidth,
1824  this->internalMap, &this->maxShellBand );
1825  }
1826 
1827  //================================================ Report completion
1828  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere mapping procedure completed." );
1829 
1830  //================================================ Done
1831  return ;
1832 
1833 }

◆ maskMap()

void ProSHADE_internal_data::ProSHADE_data::maskMap ( ProSHADE_settings settings)

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]settingsA pointer to settings class containing all the information required for reading in the map.

Definition at line 1289 of file ProSHADE_data.cpp.

1290 {
1291  //================================================ Report function start
1292  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Computing mask." );
1293 
1294  //================================================ Initialise the blurred map
1295  proshade_double* blurredMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1296  ProSHADE_internal_misc::checkMemoryAllocation ( blurredMap, __FILE__, __LINE__, __func__ );
1297 
1298  //================================================ Compute blurred map
1300  this->xDimSize, this->yDimSize, this->zDimSize, settings->blurFactor );
1301 
1302  //================================================ Compute mask from blurred map and save it into the original map
1304 
1305  //================================================ Print the mask if need be
1306  if ( settings->saveMask ) { if ( settings->maskFileName == "" ) { this->writeMask ( "proshade_mask.map", blurredMap ); } else { std::stringstream ss; ss << settings->maskFileName << "_" << this->inputOrder << ".map"; this->writeMask ( ss.str(), blurredMap ); } }
1307 
1308  //================================================ Release memory
1309  delete[] blurredMap;
1310 
1311  //================================================ Report function completion
1312  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Mask computed." );
1313 
1314  //================================================ Done
1315  return ;
1316 
1317 }

◆ 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]bandThe band indice of the E matrix to which the value should be assigned.
[in]order1The first order indice of the E matrix to which the value should be assigned.
[in]order2The second order indice of the E matrix to which the value should be assigned.
[in]normFThe value by which the original E matrix value will be divided to normalise it.

Definition at line 4115 of file ProSHADE_data.cpp.

4116 {
4117  //================================================ Mutate
4118  this->eMatrices[band][order1][order2][0] /= normF;
4119  this->eMatrices[band][order1][order2][1] /= normF;
4120 
4121  //================================================ Done
4122  return ;
4123 
4124 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.

Definition at line 1242 of file ProSHADE_data.cpp.

1243 {
1244  //================================================ Report function start
1245  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation." );
1246 
1247  //================================================ Initialise vector of map values
1248  std::vector<proshade_double> mapVals ( this->xDimIndices * this->yDimIndices * this->zDimIndices, 0.0 );
1249 
1250  //================================================ Get all map values
1251  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1252  {
1253  mapVals.at(iter) = this->internalMap[iter];
1254  }
1255 
1256  //================================================ Get mean and sd
1257  proshade_double* meanSD = new proshade_double[2];
1258  ProSHADE_internal_maths::vectorMeanAndSD ( &mapVals, meanSD );
1259 
1260  //================================================ Normalise the values
1261  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1262  {
1263  this->internalMap[iter] = ( this->internalMap[iter] - meanSD[0] ) / meanSD[1];
1264  }
1265 
1266  //================================================ Clear the vector
1267  mapVals.clear ( );
1268 
1269  //================================================ Release memory
1270  delete[] meanSD;
1271 
1272  //================================================ Report function completion
1273  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map normalisation completed." );
1274 
1275  //================================================ Done
1276  return ;
1277 
1278 }

◆ prepareFSCFourierMemory()

void ProSHADE_internal_data::ProSHADE_data::prepareFSCFourierMemory ( fftw_complex *&  mapData,
fftw_complex *&  origCoeffs,
fftw_complex *&  fCoeffs,
proshade_signed *&  binIndexing,
proshade_signed *  noBins,
proshade_double **&  bindata,
proshade_signed *&  binCounts,
fftw_plan *  planForwardFourier 
)

This function allocates the memory and makes all preparations required for FSC computation.

Parameters
[in]mapDataThe input array for Fourier transform.
[in]origCoeffsThe array for holding the Fourier coefficients of the original (non-rotated) density.
[in]fCoeffsThe array for holding the results of Fourier transform.
[in]binIndexingA map that will be filled with binning indices for fast binning.
[in]noBinsThe number of bins will be stored in this variable.
[in]bindataAn array to store the bin sums and other FSC computation temporary results.
[in]binCountsAn array that will be used to store the number of reflactions in each bin.

Definition at line 2357 of file ProSHADE_data.cpp.

2358 {
2359  //================================================ Decide number of bins and allocate which reflection belongs to which bin
2361 
2362  //================================================ Allocate memory for FSC sums
2363  bindata = new proshade_double*[*noBins];
2364  binCounts = new proshade_signed [*noBins];
2365 
2366  //================================================ Allcate memory for bin sumation
2367  for ( size_t binIt = 0; binIt < static_cast< size_t > ( *noBins ); binIt++ )
2368  {
2369  bindata[binIt] = new proshade_double[12];
2370  ProSHADE_internal_misc::checkMemoryAllocation ( bindata[binIt], __FILE__, __LINE__, __func__ );
2371  }
2372 
2373  //================================================ Allocate memory for Fourier transform imputs and outputs
2374  mapData = new fftw_complex [this->xDimIndices * this->yDimIndices * this->zDimIndices];
2375  origCoeffs = new fftw_complex [this->xDimIndices * this->yDimIndices * this->zDimIndices];
2376  fCoeffs = new fftw_complex [this->xDimIndices * this->yDimIndices * this->zDimIndices];
2377 
2378  //================================================ Check memory allocation
2379  ProSHADE_internal_misc::checkMemoryAllocation ( mapData, __FILE__, __LINE__, __func__ );
2380  ProSHADE_internal_misc::checkMemoryAllocation ( origCoeffs, __FILE__, __LINE__, __func__ );
2381  ProSHADE_internal_misc::checkMemoryAllocation ( fCoeffs, __FILE__, __LINE__, __func__ );
2382  ProSHADE_internal_misc::checkMemoryAllocation ( bindata, __FILE__, __LINE__, __func__ );
2383  ProSHADE_internal_misc::checkMemoryAllocation ( binCounts, __FILE__, __LINE__, __func__ );
2384 
2385  //================================================ Prepare memory for Fourier transform
2386  *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 );
2387 
2388  //================================================ Compute Fourier transform of the original map
2389  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { mapData[iter][0] = this->internalMap[iter]; mapData[iter][1] = 0.0; }
2390  fftw_execute ( *planForwardFourier );
2391  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { origCoeffs[iter][0] = fCoeffs[iter][0]; origCoeffs[iter][1] = fCoeffs[iter][1]; }
2392 
2393  //================================================ Done
2394  return ;
2395 
2396 }

◆ 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 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]settingsA 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 1699 of file ProSHADE_data.cpp.

1700 {
1701  //================================================ Invert map
1702  if ( settings->invertMap ) { this->invertMirrorMap ( settings ); }
1703  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion (mirror image) not requested." ); }
1704 
1705  //================================================ Normalise map
1706  if ( settings->normaliseMap ) { this->normaliseMap ( settings ); }
1707  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation not requested." ); }
1708 
1709  //================================================ Compute mask
1710  if ( settings->maskMap ) { this->maskMap ( settings ); }
1711  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Masking not requested." ); }
1712 
1713  //================================================ Centre map
1714  if ( settings->moveToCOM ) { this->centreMapOnCOM ( settings ); }
1715  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map centering not requested." ); }
1716 
1717  //================================================ Add extra space
1718  if ( settings->addExtraSpace != 0.0f ) { this->addExtraSpace ( settings ); }
1719  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Extra space not requested." ); }
1720 
1721  //================================================ Remove phase, if required
1722  if ( !settings->usePhase ) { this->removePhaseInormation ( settings ); ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information removed from the data." ); }
1723  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information retained in the data." ); }
1724 
1725  //================================================ Set settings values which were left on AUTO by user and will not be set later
1726  settings->setVariablesLeftOnAuto ( );
1727 
1728  //================================================ Done
1729  return ;
1730 
1731 }

◆ 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]settingsA 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 785 of file ProSHADE_data.cpp.

786 {
787  //================================================ Set resolution if need be
788  if ( settings->requestedResolution < 0.0f )
789  {
790  settings->setResolution ( 8.0 );
791  }
792 
793  //================================================ Change B-factors if need be
794  if ( settings->pdbBFactorNewVal >= 0.0 )
795  {
797  }
798 
799  //================================================ Remove waters if required
800  if ( settings->removeWaters )
801  {
802  ProSHADE_internal_mapManip::removeWaters ( &gemmiStruct, settings->firstModelOnly );
803  }
804 
805  //================================================ Get PDB COM values
806  proshade_double xCOMPdb, yCOMPdb, zCOMPdb;
807  ProSHADE_internal_mapManip::findPDBCOMValues ( gemmiStruct, &xCOMPdb, &yCOMPdb, &zCOMPdb, settings->firstModelOnly );
808 
809  //================================================ Find the ranges
810  proshade_single xF, xT, yF, yT, zF, zT;
811  ProSHADE_internal_mapManip::determinePDBRanges ( gemmiStruct, &xF, &xT, &yF, &yT, &zF, &zT, settings->firstModelOnly );
812 
813  //================================================ Move ranges to have all FROM values 20
814  proshade_single xMov = static_cast< proshade_single > ( 20.0f - xF );
815  proshade_single yMov = static_cast< proshade_single > ( 20.0f - yF );
816  proshade_single zMov = static_cast< proshade_single > ( 20.0f - zF );
817  ProSHADE_internal_mapManip::movePDBForMapCalc ( &gemmiStruct, xMov, yMov, zMov, settings->firstModelOnly );
818 
819  //================================================ Set the angstrom sizes
820  this->xDimSize = static_cast< proshade_single > ( xT - xF + 40.0f );
821  this->yDimSize = static_cast< proshade_single > ( yT - yF + 40.0f );
822  this->zDimSize = static_cast< proshade_single > ( zT - zF + 40.0f );
823 
824  //================================================ Generate map from nicely placed atoms (cell size will be range + 40)
825  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 );
826 
827  //================================================ Remove negative values if so required
828  if ( settings->removeNegativeDensity ) { for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { if ( this->internalMap[iter] < 0.0 ) { this->internalMap[iter] = 0.0; } } }
829 
830  //================================================ Set the internal variables to correct values
831  this->setPDBMapValues ( );
832 
833  //================================================ Compute reverse movement based on COMs. If there is more than 1 models, simply moving back the xyzMov is not enough.
834  proshade_double xCOMMap, yCOMMap, zCOMMap;
835  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xCOMMap, &yCOMMap, &zCOMMap,
836  this->xDimSize, this->yDimSize, this->zDimSize,
837  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
838 
839  if ( gemmiStruct.models.size() > 1 )
840  {
841  xMov = static_cast< proshade_single > ( xCOMMap - xCOMPdb );
842  yMov = static_cast< proshade_single > ( yCOMMap - yCOMPdb );
843  zMov = static_cast< proshade_single > ( zCOMMap - zCOMPdb );
844  }
845 
846  //================================================ Move map back to the original PDB location
847  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize,
848  &this->xFrom, &this->xTo, &this->yFrom, &this->yTo, &this->zFrom, &this->zTo,
849  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
850  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
851  static_cast< proshade_signed > ( this->xDimIndices ), static_cast< proshade_signed > ( this->yDimIndices ),
852  static_cast< proshade_signed > ( this->zDimIndices ) );
853 
854  //================================================ If specific resolution is requested, make sure the map has it
855  if ( settings->changeMapResolution || settings->changeMapResolutionTriLinear )
856  {
857  //============================================ Before re-sampling sampling rate
858  proshade_single xSampRate = this->xDimSize / static_cast< proshade_single > ( this->xTo - this->xFrom );
859  proshade_single ySampRate = this->yDimSize / static_cast< proshade_single > ( this->yTo - this->yFrom );
860  proshade_single zSampRate = this->zDimSize / static_cast< proshade_single > ( this->zTo - this->zFrom );
861 
862  //============================================ Bofore re-sampling first index position
863  proshade_single xStartPosBefore = static_cast< proshade_single > ( this->xFrom ) * xSampRate;
864  proshade_single yStartPosBefore = static_cast< proshade_single > ( this->yFrom ) * ySampRate;
865  proshade_single zStartPosBefore = static_cast< proshade_single > ( this->zFrom ) * zSampRate;
866 
867  //============================================ Find COM before map re-sampling
868  proshade_double xMapCOMPreReSampl = 0.0, yMapCOMPreReSampl = 0.0, zMapCOMPreReSampl = 0.0;
869  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 );
870 
871  //============================================ Re-sample map
872  this->reSampleMap ( settings );
873 
874  //============================================ After re-sampling sampling rate
875  xSampRate = this->xDimSize / static_cast< proshade_single > ( this->xTo - this->xFrom );
876  ySampRate = this->yDimSize / static_cast< proshade_single > ( this->yTo - this->yFrom );
877  zSampRate = this->zDimSize / static_cast< proshade_single > ( this->zTo - this->zFrom );
878 
879  //============================================ After re-sampling first index position
880  proshade_single xStartPosAfter = static_cast< proshade_single > ( this->xFrom ) * xSampRate;
881  proshade_single yStartPosAfter = static_cast< proshade_single > ( this->yFrom ) * ySampRate;
882  proshade_single zStartPosAfter = static_cast< proshade_single > ( this->zFrom ) * zSampRate;
883 
884  //============================================ Translate by change in corners to make the boxes as similarly placed as possible
885  proshade_single xMovHlp = static_cast< proshade_single > ( xStartPosAfter - xStartPosBefore );
886  proshade_single yMovHlp = static_cast< proshade_single > ( yStartPosAfter - yStartPosBefore );
887  proshade_single zMovHlp = static_cast< proshade_single > ( zStartPosAfter - zStartPosBefore );
888  ProSHADE_internal_mapManip::moveMapByIndices ( &xMovHlp, &yMovHlp, &zMovHlp, this->xDimSize, this->yDimSize, this->zDimSize,
889  &this->xFrom, &this->xTo, &this->yFrom, &this->yTo, &this->zFrom, &this->zTo,
890  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
891 
892  //============================================ Find COM after map re-sampling and corner move
893  proshade_double xMapCOMPostReSampl = 0.0, yMapCOMPostReSampl = 0.0, zMapCOMPostReSampl = 0.0;
894  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 );
895 
896  //============================================ Match the COMs to get as close position of the re-sampled structure to the original as possible
898  static_cast< proshade_single > ( xMapCOMPreReSampl - xMapCOMPostReSampl ),
899  static_cast< proshade_single > ( yMapCOMPreReSampl - yMapCOMPostReSampl ),
900  static_cast< proshade_single > ( zMapCOMPreReSampl - zMapCOMPostReSampl ),
901  this->xDimSize, this->yDimSize, this->zDimSize,
902  static_cast< proshade_signed > ( this->xDimIndices ),
903  static_cast< proshade_signed > ( this->yDimIndices ),
904  static_cast< proshade_signed > ( this->zDimIndices ) );
905  }
906 
907  //================================================ Save the original sizes
908  this->xDimSizeOriginal = this->xDimSize;
909  this->yDimSizeOriginal = this->yDimSize;
910  this->zDimSizeOriginal = this->zDimSize;
911 
912  //================================================ Save the original index counts
913  this->xDimIndicesOriginal = this->xDimIndices;
914  this->yDimIndicesOriginal = this->yDimIndices;
915  this->zDimIndicesOriginal = this->zDimIndices;
916 
917  //================================================ Save the original axis origins
918  this->xAxisOriginOriginal = this->xAxisOrigin;
919  this->yAxisOriginOriginal = this->yAxisOrigin;
920  this->zAxisOriginOriginal = this->zAxisOrigin;
921 
922  //================================================ Compute and save the COM
923  this->findMapCOM ( );
924  this->originalMapXCom = this->xCom;
925  this->originalMapYCom = this->yCom;
926  this->originalMapZCom = this->zCom;
927 
928  //================================================ Done
929  return;
930 
931 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.
[in]maskArrAn array of mask values (default nullptr) to be used instead of an input mask file.
[in]maskXDimThe size of maskArray x dimension in indices (defaults to 0).
[in]maskYDimThe size of maskArray y dimension in indices (defaults to 0).
[in]maskZDimThe size of maskArray z dimension in indices (defaults to 0).
[in]weightsArrAn array of weights (default nullptr) to be used instead of input file.
[in]weigXDimThe size of weightsArray x dimension in indices (defaults to 0).
[in]weigYDimThe size of weightsArray y dimension in indices (defaults to 0).
[in]weigZDimThe size of weightsArray z dimension in indices (defaults to 0).

Definition at line 619 of file ProSHADE_data.cpp.

620 {
621  //================================================ Open the file
622  gemmi::Ccp4<float> map;
623  map.read_ccp4 ( gemmi::MaybeGzipped ( this->fileName.c_str() ) );
624 
625  //================================================ Convert to XYZ and create complete map, if need be
626  map.setup ( gemmi::GridSetup::ReorderOnly, NAN );
627 
628  //================================================ Read in the rest of the map file header
630  &this->xDimIndices, &this->yDimIndices, &this->zDimIndices,
631  &this->xDimSize, &this->yDimSize, &this->zDimSize,
632  &this->aAngle, &this->bAngle, &this->cAngle,
633  &this->xFrom, &this->yFrom, &this->zFrom,
634  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin,
635  &this->xAxisOrder, &this->yAxisOrder, &this->zAxisOrder,
636  &this->xGridIndices, &this->yGridIndices, &this->zGridIndices );
637 
638  //================================================ Save the map density to ProSHADE variable
639  ProSHADE_internal_io::readInMapData ( &map, this->internalMap, this->xDimIndices, this->yDimIndices, this->zDimIndices, this->xAxisOrder, this->yAxisOrder, this->zAxisOrder );
640 
641  //================================================ If mask is supplied and the correct task is used
642  ProSHADE_internal_io::applyMask ( this->internalMap, settings->appliedMaskFileName, this->xDimIndices, this->yDimIndices, this->zDimIndices, settings->verbose,
643  maskArr, maskXDim, maskYDim, maskZDim );
644 
645  //================================================ Apply Fourier weights
646  ProSHADE_internal_io::applyWeights ( this->internalMap, settings->fourierWeightsFileName, this->xDimIndices, this->yDimIndices, this->zDimIndices, settings->verbose,
647  weightsArr, weigXDim, weigYDim, weigZDim );
648 
649  //================================================ Remove negative values if so required
650  if ( settings->removeNegativeDensity ) { for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { if ( this->internalMap[iter] < 0.0 ) { this->internalMap[iter] = 0.0; } } }
651 
652  //================================================ Set resolution if need be
653  if ( settings->requestedResolution < 0.0f )
654  {
655  settings->setResolution ( std::min ( static_cast<proshade_single> ( this->xDimSize ) / static_cast<proshade_single> ( this->xDimIndices ),
656  std::min ( static_cast<proshade_single> ( this->yDimSize ) / static_cast<proshade_single> ( this->yDimIndices ),
657  static_cast<proshade_single> ( this->zDimSize ) / static_cast<proshade_single> ( this->zDimIndices ) ) ) * 2.0f );
658  }
659 
660  //================================================ Set iterators from and to
661  this->figureIndexStartStop ( );
662 
663  //================================================ If specific resolution is requested, make sure the map has it
664  if ( settings->changeMapResolution || settings->changeMapResolutionTriLinear )
665  {
666  //============================================ Before re-sampling sampling rate
667  proshade_single xSampRate = this->xDimSize / static_cast< proshade_single > ( this->xTo - this->xFrom );
668  proshade_single ySampRate = this->yDimSize / static_cast< proshade_single > ( this->yTo - this->yFrom );
669  proshade_single zSampRate = this->zDimSize / static_cast< proshade_single > ( this->zTo - this->zFrom );
670 
671  //============================================ Bofore re-sampling first index position
672  proshade_single xStartPosBefore = static_cast< proshade_single > ( this->xFrom ) * xSampRate;
673  proshade_single yStartPosBefore = static_cast< proshade_single > ( this->yFrom ) * ySampRate;
674  proshade_single zStartPosBefore = static_cast< proshade_single > ( this->zFrom ) * zSampRate;
675 
676  //============================================ Find COM before map re-sampling
677  proshade_double xMapCOMPreReSampl = 0.0, yMapCOMPreReSampl = 0.0, zMapCOMPreReSampl = 0.0;
678  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 );
679 
680  //============================================ Re-sample map
681  this->reSampleMap ( settings );
682 
683  //============================================ After re-sampling sampling rate
684  xSampRate = this->xDimSize / static_cast< proshade_single > ( this->xTo - this->xFrom );
685  ySampRate = this->yDimSize / static_cast< proshade_single > ( this->yTo - this->yFrom );
686  zSampRate = this->zDimSize / static_cast< proshade_single > ( this->zTo - this->zFrom );
687 
688  //============================================ After re-sampling first index position
689  proshade_single xStartPosAfter = static_cast< proshade_single > ( this->xFrom ) * xSampRate;
690  proshade_single yStartPosAfter = static_cast< proshade_single > ( this->yFrom ) * ySampRate;
691  proshade_single zStartPosAfter = static_cast< proshade_single > ( this->zFrom ) * zSampRate;
692 
693  //============================================ Translate by change in corners to make the boxes as similarly placed as possible
694  proshade_single xMov = static_cast< proshade_single > ( xStartPosAfter - xStartPosBefore );
695  proshade_single yMov = static_cast< proshade_single > ( yStartPosAfter - yStartPosBefore );
696  proshade_single zMov = static_cast< proshade_single > ( zStartPosAfter - zStartPosBefore );
697  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize,
698  &this->xFrom, &this->xTo, &this->yFrom, &this->yTo, &this->zFrom, &this->zTo,
699  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
700 
701  //============================================ Find COM after map re-sampling and corner move
702  proshade_double xMapCOMPostReSampl = 0.0, yMapCOMPostReSampl = 0.0, zMapCOMPostReSampl = 0.0;
703  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 );
704 
705  //============================================ Match the COMs to get as close position of the re-sampled structure to the original as possible
707  static_cast< proshade_single > ( xMapCOMPreReSampl - xMapCOMPostReSampl ),
708  static_cast< proshade_single > ( yMapCOMPreReSampl - yMapCOMPostReSampl ),
709  static_cast< proshade_single > ( zMapCOMPreReSampl - zMapCOMPostReSampl ),
710  this->xDimSize, this->yDimSize, this->zDimSize,
711  static_cast< proshade_signed > ( this->xDimIndices ),
712  static_cast< proshade_signed > ( this->yDimIndices ),
713  static_cast< proshade_signed > ( this->zDimIndices ) );
714  }
715 
716  //================================================ Save the original sizes
717  this->xDimSizeOriginal = this->xDimSize;
718  this->yDimSizeOriginal = this->yDimSize;
719  this->zDimSizeOriginal = this->zDimSize;
720 
721  //================================================ Save the original index counts
722  this->xDimIndicesOriginal = this->xDimIndices;
723  this->yDimIndicesOriginal = this->yDimIndices;
724  this->zDimIndicesOriginal = this->zDimIndices;
725 
726  //================================================ Save the original axis origins
727  this->xAxisOriginOriginal = this->xAxisOrigin;
728  this->yAxisOriginOriginal = this->yAxisOrigin;
729  this->zAxisOriginOriginal = this->zAxisOrigin;
730 
731  //================================================ Compute and save the COM
732  this->findMapCOM ( );
733  this->originalMapXCom = this->xCom;
734  this->originalMapYCom = this->yCom;
735  this->originalMapZCom = this->zCom;
736 
737  //================================================ Done
738 
739 }

◆ 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]settingsA 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 750 of file ProSHADE_data.cpp.

751 {
752  //================================================ Set resolution if need be
753  if ( settings->requestedResolution < 0.0f )
754  {
755  settings->setResolution ( 8.0 );
756  }
757 
758  //================================================ Open PDB file for reading
759  gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
760 
761  //================================================ Once we have Gemmi object, run the Gemmi function
762  this->readInGemmi ( pdbFile, settings );
763 
764  //================================================ Done
765  return;
766 
767 }

◆ 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]gemmiStructThe Gemmi Structure object that should be read in.
[in]inputOThe order of this structure in this run's input.
[in]settingsA pointer to settings class containing all the information required for reading in the map.

Definition at line 567 of file ProSHADE_data.cpp.

568 {
569  //================================================ Report function start
570  std::stringstream ss;
571  ss << "Starting to load the structure from Gemmi object " << inputO;
573 
574  //================================================ Check if instance is empty
575  if ( !this->isEmpty )
576  {
577  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 );
578  }
579 
580  //================================================ Save the filename
581  this->fileName = gemmiStruct.name;
582 
583  //================================================ Check what is the input format
584  this->fileType = ProSHADE_internal_io::GEMMI;
585 
586  //================================================ Save input order
587  this->inputOrder = inputO;
588 
589  //================================================ Decide how to proceed
590  this->readInGemmi ( gemmiStruct, settings );
591 
592  //================================================ This structure is now full
593  this->isEmpty = false;
594 
595  //================================================ Report function completion
596  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Structure read in successfully." );
597 
598  //================================================ Done
599  return ;
600 
601 }

◆ 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]fNameThe file name of the file which should be loaded.
[in]inputOThe order of this structure in this run's input.
[in]settingsA pointer to settings class containing all the information required for reading in the map.
[in]maskArrAn array of mask values (default nullptr) to be used instead of an input mask file.
[in]maskXDimThe size of maskArray x dimension in indices (defaults to 0).
[in]maskYDimThe size of maskArray y dimension in indices (defaults to 0).
[in]maskZDimThe size of maskArray z dimension in indices (defaults to 0).
[in]weightsArrAn array of weights (default nullptr) to be used instead of input file.
[in]weigXDimThe size of weightsArray x dimension in indices (defaults to 0).
[in]weigYDimThe size of weightsArray y dimension in indices (defaults to 0).
[in]weigZDimThe size of weightsArray z dimension in indices (defaults to 0).

Definition at line 509 of file ProSHADE_data.cpp.

510 {
511  //================================================ Report function start
512  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting to read the structure: " + fName );
513 
514  //================================================ Check if instance is empty
515  if ( !this->isEmpty )
516  {
517  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 );
518  }
519 
520  //================================================ Save the filename
521  this->fileName = fName;
522 
523  //================================================ Check what is the input format
525 
526  //================================================ Save input order
527  this->inputOrder = inputO;
528 
529  //================================================ Decide how to proceed
530  switch ( this->fileType )
531  {
532  case ProSHADE_internal_io::UNKNOWN:
533  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." );
534 
535  case ProSHADE_internal_io::GEMMI:
536  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." );
537 
538  case ProSHADE_internal_io::PDB:
539  this->readInPDB ( settings );
540  break;
541 
542  case ProSHADE_internal_io::MAP:
543  this->readInMAP ( settings, maskArr, maskXDim, maskYDim, maskZDim, weightsArr, weigXDim, weigYDim, weigZDim );
544  break;
545  }
546 
547  //================================================ This structure is now full
548  this->isEmpty = false;
549 
550  //================================================ Report function completion
551  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Structure read in successfully." );
552 
553  //================================================ Done
554  return ;
555 
556 }

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.

Definition at line 3645 of file ProSHADE_data.cpp.

3646 {
3647  //================================================ Report function start
3648  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
3649 
3650  //================================================ Copy map for processing
3651  fftw_complex* mapCoeffs = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3652  fftw_complex* pattersonMap = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3653 
3654  //================================================ Check memory allocation
3655  ProSHADE_internal_misc::checkMemoryAllocation ( mapCoeffs, __FILE__, __LINE__, __func__ );
3656  ProSHADE_internal_misc::checkMemoryAllocation ( pattersonMap, __FILE__, __LINE__, __func__ );
3657 
3658  //================================================ Copy data to mask
3659  for ( proshade_unsign iter = 0; iter < (this->xDimIndices * this->yDimIndices * this->zDimIndices); iter++ )
3660  {
3661  pattersonMap[iter][0] = this->internalMap[iter];
3662  pattersonMap[iter][1] = 0.0;
3663  }
3664 
3665  //================================================ Prepare FFTW plans
3666  fftw_plan forward = fftw_plan_dft_3d ( static_cast< int > ( this->xDimIndices ), static_cast< int > ( this->yDimIndices ), static_cast< int > ( this->zDimIndices ),
3667  pattersonMap, mapCoeffs, FFTW_FORWARD, FFTW_ESTIMATE );
3668  fftw_plan inverse = fftw_plan_dft_3d ( static_cast< int > ( this->xDimIndices ), static_cast< int > ( this->yDimIndices ), static_cast< int > ( this->zDimIndices ),
3669  mapCoeffs, pattersonMap, FFTW_BACKWARD, FFTW_ESTIMATE );
3670 
3671  //================================================ Run forward Fourier
3672  fftw_execute ( forward );
3673 
3674  //================================================ Remove the phase
3676 
3677  //================================================ Run inverse Fourier
3678  fftw_execute ( inverse );
3679 
3680  //================================================ Save the results
3681  proshade_signed mapIt, patIt, patX, patY, patZ;
3682  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
3683  {
3684  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
3685  {
3686  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
3687  {
3688  //==================================== Centre patterson map
3689  patX = xIt - ( static_cast<proshade_signed> ( this->xDimIndices ) / 2 ); if ( patX < 0 ) { patX += this->xDimIndices; }
3690  patY = yIt - ( static_cast<proshade_signed> ( this->yDimIndices ) / 2 ); if ( patY < 0 ) { patY += this->yDimIndices; }
3691  patZ = zIt - ( static_cast<proshade_signed> ( this->zDimIndices ) / 2 ); if ( patZ < 0 ) { patZ += this->zDimIndices; }
3692 
3693  //==================================== Find indices
3694  mapIt = zIt + static_cast< proshade_signed > ( this->zDimIndices ) * ( yIt + static_cast< proshade_signed > ( this->yDimIndices ) * xIt );
3695  patIt = patZ + static_cast< proshade_signed > ( this->zDimIndices ) * ( patY + static_cast< proshade_signed > ( this->yDimIndices ) * patX );
3696 
3697  //==================================== Copy
3698  this->internalMap[mapIt] = pattersonMap[patIt][0];
3699  }
3700  }
3701  }
3702 
3703  //================================================ Release memory
3704  delete[] pattersonMap;
3705  delete[] mapCoeffs;
3706 
3707  //================================================ Delete FFTW plans
3708  fftw_destroy_plan ( forward );
3709  fftw_destroy_plan ( inverse );
3710 
3711  //================================================ Report function completion
3712  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Phase information removed." );
3713 
3714  //================================================ Done
3715  return ;
3716 
3717 }

◆ 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]settingsProSHADE_settings object specifying the details of how the computations should be done.
[in]rotationCentrePointer to vector for saving the position of the centre of rotation about which the rotation is to be done.
[in]mapBoxMovementPointer to vector for saving the sum of all translations done internally by ProSHADE to this input map.
[in]eulerAnglesPointer to vector where the three Euler angles will be saved into.
[in]finalTranslationPointer 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 4491 of file ProSHADE_data.cpp.

4492 {
4493  //================================================ Empty line
4495 
4496  //================================================ Write out rotation centre translation results
4497  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);
4498  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotCen.str() );
4499 
4500  //================================================ Write out rotation matrix about origin
4501  proshade_double* rotMat = new proshade_double[9];
4502  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
4503  ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( eulerAngles->at(0), eulerAngles->at(1), eulerAngles->at(2), rotMat );
4504 
4505  std::stringstream rotMatSS;
4506  rotMatSS << std::setprecision (3) << std::showpos << "The rotation matrix about origin is : " << rotMat[0] << " " << rotMat[1] << " " << rotMat[2] << std::endl;
4507  rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[3] << " " << rotMat[4] << " " << rotMat[5] << std::endl;
4508  rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[6] << " " << rotMat[7] << " " << rotMat[8];
4509  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotMatSS.str() );
4510 
4511  delete[] rotMat;
4512 
4513  //================================================ Write out origin to overlay translation results
4514  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);
4515  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, finTrs.str() );
4516 
4517  //================================================ Done
4518  return ;
4519 
4520 }

◆ reportSymmetryResults()

void ProSHADE_internal_data::ProSHADE_data::reportSymmetryResults ( ProSHADE_settings settings)

This function takes 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]settingsA pointer to settings class containing all the information required for map symmetry detection reporting.

Definition at line 3467 of file ProSHADE_data.cpp.

3468 {
3469  //================================================ Improve this!
3470  if ( settings->recommendedSymmetryType == "" )
3471  {
3472  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, "Did not detect any symmetry!" );
3473  }
3474  else
3475  {
3476  std::stringstream ssHlp;
3477  std::vector< proshade_double > comMove = this->getMapCOMProcessChange ( );
3478  ssHlp << std::endl << "Detected " << settings->recommendedSymmetryType << " symmetry with fold " << settings->recommendedSymmetryFold << " about point [" << comMove.at(0) << " , " << comMove.at(1) << " , " << comMove.at(2) << "] away from centre of mass .";
3479  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
3480 
3481  if ( settings->detectedSymmetry.size() > 0 )
3482  {
3483  ssHlp.clear(); ssHlp.str ( "" );
3484  ssHlp << " Fold X Y Z Angle Height Average FSC";
3485  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
3486  }
3487  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ); symIt++ )
3488  {
3489  ssHlp.clear(); ssHlp.str ( "" );
3490  ssHlp << std::showpos << std::fixed << std::setprecision(0) << " " << settings->detectedSymmetry.at(symIt)[0] << std::setprecision(5) << " " << settings->detectedSymmetry.at(symIt)[1] << " " << settings->detectedSymmetry.at(symIt)[2] << " " << settings->detectedSymmetry.at(symIt)[3] << " " << settings->detectedSymmetry.at(symIt)[4] << " " << settings->detectedSymmetry.at(symIt)[5] << " " << settings->detectedSymmetry.at(symIt)[6];
3491  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
3492  }
3493 
3494  std::stringstream hlpSS3;
3495  ssHlp.clear(); ssHlp.str ( "" );
3496  hlpSS3 << std::endl << "To facilitate manual checking for symmetries, the following is a list of all detected C symmetries:";
3497  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, hlpSS3.str() );
3498 
3499  if ( settings->allDetectedCAxes.size() > 0 )
3500  {
3501  ssHlp.clear(); ssHlp.str ( "" );
3502  ssHlp << " Fold X Y Z Angle Height Average FSC";
3503  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
3504  }
3505  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->allDetectedCAxes.size() ); symIt++ )
3506  {
3507  ssHlp.clear(); ssHlp.str ( "" );
3508  ssHlp << std::showpos << std::fixed << std::setprecision(0) << " " << settings->allDetectedCAxes.at(symIt)[0] << std::setprecision(5) << " " << settings->allDetectedCAxes.at(symIt)[1] << " " << settings->allDetectedCAxes.at(symIt)[2] << " " << settings->allDetectedCAxes.at(symIt)[3] << " " << settings->allDetectedCAxes.at(symIt)[4] << " " << settings->allDetectedCAxes.at(symIt)[5] << " " << settings->allDetectedCAxes.at(symIt)[6];
3509  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
3510  }
3511 
3512  }
3513 
3514  //================================================ Done
3515  return ;
3516 
3517 }

◆ 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]settingsA pointer to settings class containing all the information required for reading in the map.

Definition at line 1453 of file ProSHADE_data.cpp.

1454 {
1455  //================================================ Initialise the return variable
1456  proshade_single* changeVals = new proshade_single[6];
1457 
1458  //================================================ Now re-sample the map
1459  if ( settings->changeMapResolution )
1460  {
1461  ProSHADE_internal_mapManip::reSampleMapToResolutionFourier ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1462  this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1463 
1464  if ( settings->changeMapResolutionTriLinear )
1465  {
1466  ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Requested both Fourier-space and real-space map re-sampling. Defaulting to only Fourier space re-samplling.", "WM00049" );
1467  }
1468  }
1469  if ( settings->changeMapResolutionTriLinear && !settings->changeMapResolution )
1470  {
1471  ProSHADE_internal_mapManip::reSampleMapToResolutionTrilinear ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1472  this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1473 
1474  }
1475 
1476  //================================================ Set the internal values to reflect the new map size
1477  this->xDimIndices += static_cast<proshade_unsign> ( changeVals[0] );
1478  this->yDimIndices += static_cast<proshade_unsign> ( changeVals[1] );
1479  this->zDimIndices += static_cast<proshade_unsign> ( changeVals[2] );
1480 
1481  this->xGridIndices = this->xDimIndices;
1482  this->yGridIndices = this->yDimIndices;
1483  this->zGridIndices = this->zDimIndices;
1484 
1485  this->xTo += static_cast<proshade_unsign> ( changeVals[0] );
1486  this->yTo += static_cast<proshade_unsign> ( changeVals[1] );
1487  this->zTo += static_cast<proshade_unsign> ( changeVals[2] );
1488 
1489  this->xDimSize = changeVals[3];
1490  this->yDimSize = changeVals[4];
1491  this->zDimSize = changeVals[5];
1492 
1493  //================================================ Figure how much the new map moved
1494  proshade_single xMov = -( ( static_cast<proshade_single> ( this->xFrom ) * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) - changeVals[0] ) ) -
1495  ( static_cast<proshade_single> ( this->xFrom ) * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) ) ) );
1496  proshade_single yMov = -( ( static_cast<proshade_single> ( this->yFrom ) * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) - changeVals[1] ) ) -
1497  ( static_cast<proshade_single> ( this->yFrom ) * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) ) ) );
1498  proshade_single zMov = -( ( static_cast<proshade_single> ( this->zFrom ) * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) - changeVals[2] ) ) -
1499  ( static_cast<proshade_single> ( this->zFrom ) * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) ) ) );
1500 
1501  //================================================ Move by indices (this should be sufficient)
1502  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize, &this->xFrom, &this->xTo,
1503  &this->yFrom, &this->yTo, &this->zFrom, &this->zTo, &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
1504 
1505  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
1506  static_cast< proshade_signed > ( this->xDimIndices ), static_cast< proshade_signed > ( this->yDimIndices ), static_cast< proshade_signed > ( this->zDimIndices ) );
1507 
1508  //================================================ Release memory
1509  delete[] changeVals;
1510 
1511  //================================================ Done
1512  return ;
1513 
1514 }

◆ 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]axXThe x-axis element of the angle-axis rotation representation.
[in]axYThe y-axis element of the angle-axis rotation representation.
[in]axZThe z-axis element of the angle-axis rotation representation.
[in]axAngThe angle about the axis by which the rotation is to be done.
[in]mapA pointer which will be set to point to the rotated map.
[out]retThe rotation centre about which the rotation was done in Angstroms.

Definition at line 718 of file ProSHADE_overlay.cpp.

719 {
720  //================================================ Initialise local variables
721  bool withinBounds = true;
722  proshade_double c000, c001, c010, c011, c100, c101, c110, c111, c00, c01, c10, c11, c0, c1;
723  size_t arrPos = 0;
724  proshade_double xCOM, yCOM, zCOM;
725  std::vector< proshade_double > ret;
726 
727  //================================================ Store sampling rates
728  proshade_single xSampRate = this->xDimSize / static_cast< proshade_single > ( this->xTo - this->xFrom );
729  proshade_single ySampRate = this->yDimSize / static_cast< proshade_single > ( this->yTo - this->yFrom );
730  proshade_single zSampRate = this->zDimSize / static_cast< proshade_single > ( this->zTo - this->zFrom );
731 
732  //================================================ Compute map COM
733  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 );
734 
735  //================================================ Allocate local variables
736  proshade_single *mins = new proshade_single[3];
737  proshade_single *maxs = new proshade_single[3];
738  proshade_single *rotMat = new proshade_single[9];
739  proshade_single *rotVec;
740  proshade_single *interpMins = new proshade_single[3];
741  proshade_single *interpMaxs = new proshade_single[3];
742  proshade_single *interpDiff = new proshade_single[3];
743  proshade_single *movs = new proshade_single[3];
744  map = new proshade_double[ this->xDimIndices * this->yDimIndices * this->zDimIndices ];
745 
746  //================================================ Check memory allocation
747  ProSHADE_internal_misc::checkMemoryAllocation ( mins, __FILE__, __LINE__, __func__ );
748  ProSHADE_internal_misc::checkMemoryAllocation ( maxs, __FILE__, __LINE__, __func__ );
749  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
750  ProSHADE_internal_misc::checkMemoryAllocation ( interpMins, __FILE__, __LINE__, __func__ );
751  ProSHADE_internal_misc::checkMemoryAllocation ( interpMaxs, __FILE__, __LINE__, __func__ );
752  ProSHADE_internal_misc::checkMemoryAllocation ( interpDiff, __FILE__, __LINE__, __func__ );
753  ProSHADE_internal_misc::checkMemoryAllocation ( movs, __FILE__, __LINE__, __func__ );
754  ProSHADE_internal_misc::checkMemoryAllocation ( map, __FILE__, __LINE__, __func__ );
755 
756  //================================================ Fill map with zeroes
757  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { map[iter] = 0.0; }
758 
759  //================================================ Determine map max's and min's in terms of the hkl system
760  mins[0] = std::floor ( static_cast< proshade_single > ( this->xDimIndices ) / -2.0f );
761  mins[1] = std::floor ( static_cast< proshade_single > ( this->yDimIndices ) / -2.0f );
762  mins[2] = std::floor ( static_cast< proshade_single > ( this->zDimIndices ) / -2.0f );
763 
764  maxs[0] = -mins[0];
765  maxs[1] = -mins[1];
766  maxs[2] = -mins[2];
767 
768  if ( this->xDimIndices % 2 == 0 ) { maxs[0] -= 1.0f; }
769  if ( this->yDimIndices % 2 == 0 ) { maxs[1] -= 1.0f; }
770  if ( this->zDimIndices % 2 == 0 ) { maxs[2] -= 1.0f; }
771 
772  //================================================ Rotate about COM instead of map midpoint
773  movs[0] = 0.0; //( mins[0] - static_cast< proshade_single > ( this->xFrom ) );
774  movs[1] = 0.0; //( mins[1] - static_cast< proshade_single > ( this->yFrom ) );
775  movs[2] = 0.0; //( mins[2] - static_cast< proshade_single > ( this->zFrom ) );
776 
777  //================================================ Save rotation centre
778  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast< proshade_double > ( ( -mins[0] * xSampRate ) + ( static_cast< proshade_single > ( this->xFrom ) * xSampRate ) ) );
779  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast< proshade_double > ( ( -mins[1] * ySampRate ) + ( static_cast< proshade_single > ( this->yFrom ) * ySampRate ) ) );
780  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast< proshade_double > ( ( -mins[2] * zSampRate ) + ( static_cast< proshade_single > ( this->zFrom ) * zSampRate ) ) );
781 
782  //================================================ Get rotation matrix from Euler angles
783  ProSHADE_internal_maths::getRotationMatrixFromAngleAxis ( rotMat, axX, axY, axZ, axAng );
784 
785  //================================================ For each point
786  for ( proshade_single xIt = mins[0]; xIt <= maxs[0]; xIt += 1.0f )
787  {
788  for ( proshade_single yIt = mins[1]; yIt <= maxs[1]; yIt += 1.0f )
789  {
790  for ( proshade_single zIt = mins[2]; zIt <= maxs[2]; zIt += 1.0f )
791  {
792  //==================================== Compute new point position
793  rotVec = ProSHADE_internal_maths::compute3x3MatrixVectorMultiplication ( rotMat, xIt - movs[0], yIt - movs[1], zIt - movs[2] );
794 
795  //==================================== Find surrounding grid points indices and check for boundaries
796  withinBounds = true;
797  for ( size_t posIt = 0; posIt < 3; posIt++ )
798  {
799  //================================ Determine surrounding points indices in this dimension
800  interpMins[posIt] = std::floor ( rotVec[posIt] );
801  interpMaxs[posIt] = interpMins[posIt] + 1.0f;
802 
803  //================================ Check for boundaries
804  if ( ( maxs[posIt] < interpMins[posIt] ) || ( interpMins[posIt] < mins[posIt] ) || ( maxs[posIt] < interpMaxs[posIt] ) || ( interpMaxs[posIt] < mins[posIt] ) )
805  {
806  withinBounds = false;
807  break;
808  }
809 
810  //================================ Compute the difference from position to min index along this axis
811  interpDiff[posIt] = rotVec[posIt] - interpMins[posIt];
812  }
813  if ( !withinBounds ) { continue; }
814 
815  //==================================== Make sure interpolation max's are within bounds
816  for ( size_t posIt = 0; posIt < 3; posIt++ )
817  {
818  interpMaxs[posIt] = std::min ( maxs[posIt], std::max ( mins[posIt], interpMaxs[posIt] ) );
819  }
820 
821  //==================================== Release memory
822  delete[] rotVec;
823 
824  //==================================== Find the surrounding points values from their indices
825  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] ) ) );
826  c000 = this->internalMap[arrPos];
827 
828  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] ) ) );
829  c001 = this->internalMap[arrPos];
830 
831  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] ) ) );
832  c010 = this->internalMap[arrPos];
833 
834  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] ) ) );
835  c011 = this->internalMap[arrPos];
836 
837  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] ) ) );
838  c100 = this->internalMap[arrPos];
839 
840  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] ) ) );
841  c101 = this->internalMap[arrPos];
842 
843  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] ) ) );
844  c110 = this->internalMap[arrPos];
845 
846  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] ) ) );
847  c111 = this->internalMap[arrPos];
848 
849  //==================================== Interpolate along x-axis
850  c00 = ( c000 * ( 1.0 - static_cast< proshade_double > ( interpDiff[0] ) ) ) + ( c100 * static_cast< proshade_double > ( interpDiff[0] ) );
851  c01 = ( c001 * ( 1.0 - static_cast< proshade_double > ( interpDiff[0] ) ) ) + ( c101 * static_cast< proshade_double > ( interpDiff[0] ) );
852  c10 = ( c010 * ( 1.0 - static_cast< proshade_double > ( interpDiff[0] ) ) ) + ( c110 * static_cast< proshade_double > ( interpDiff[0] ) );
853  c11 = ( c011 * ( 1.0 - static_cast< proshade_double > ( interpDiff[0] ) ) ) + ( c111 * static_cast< proshade_double > ( interpDiff[0] ) );
854 
855  //==================================== Interpolate along y-axis
856  c0 = ( c00 * ( 1.0 - static_cast< proshade_double > ( interpDiff[1] ) ) ) + ( c10 * static_cast< proshade_double > ( interpDiff[1] ) );
857  c1 = ( c01 * ( 1.0 - static_cast< proshade_double > ( interpDiff[1] ) ) ) + ( c11 * static_cast< proshade_double > ( interpDiff[1] ) );
858 
859  //==================================== Interpolate along z-axis
860  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] ) ) );
861  map[arrPos] = ( c0 * ( 1.0 - static_cast< proshade_double > ( interpDiff[2] ) ) ) + ( c1 * static_cast< proshade_double > ( interpDiff[2] ) );
862  }
863  }
864  }
865 
866  //================================================ Release memory
867  delete[] mins;
868  delete[] maxs;
869  delete[] rotMat;
870  delete[] interpMins;
871  delete[] interpMaxs;
872  delete[] interpDiff;
873  delete[] movs;
874 
875  //================================================ Done
876  return ( ret );
877 
878 }

◆ 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]eulerAlphaThe rotation expressed as a pointer to Euler alpha angle.
[in]eulerBetaThe rotation expressed as a pointer to Euler beta angle.
[in]eulerGammaThe rotation expressed as a pointer to Euler gamma angle.
[out]retThe rotation centre about which the rotation was done in Angstroms.

Definition at line 891 of file ProSHADE_overlay.cpp.

892 {
893  //================================================ Initialise local variables
894  proshade_double axX, axY, axZ, axAng, tmp, *rMat, *map;
895 
896  //================================================ Allocate local memory
897  rMat = new proshade_double[9];
898 
899  //================================================ Check local memory allocation
900  ProSHADE_internal_misc::checkMemoryAllocation ( rMat, __FILE__, __LINE__, __func__ );
901 
902  //================================================ Convert Euler angles to rotation matrix
904 
905  //================================================ Transpose the rotation matrix
906  tmp = rMat[1];
907  rMat[1] = rMat[3];
908  rMat[3] = tmp;
909 
910  tmp = rMat[2];
911  rMat[2] = rMat[6];
912  rMat[6] = tmp;
913 
914  tmp = rMat[5];
915  rMat[5] = rMat[7];
916  rMat[7] = tmp;
917 
918  //================================================ Convert rotation matrix to angle-axis
919  ProSHADE_internal_maths::getAxisAngleFromRotationMatrix ( rMat, &axX, &axY, &axZ, &axAng );
920 
921  //================================================ Rotate the internal map
922  std::vector< proshade_double > ret = this->rotateMapRealSpace ( axX, axY, axZ, axAng, map );
923 
924  //================================================ Copy the rotated map in place of the internal map
925  for ( size_t iter = 0; iter < static_cast< size_t > ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
926  {
927  this->internalMap[iter] = map[iter];
928  }
929 
930  //================================================ Release local memory
931  delete[] rMat;
932  delete[] map;
933 
934  //================================================ Save rotation centre for co-ordinates
935  this->originalPdbRotCenX = ret.at(0);
936  this->originalPdbRotCenY = ret.at(1);
937  this->originalPdbRotCenZ = ret.at(2);
938 
939  //================================================ Done
940  return ( ret );
941 
942 }

◆ 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]settingsThe settings object specifying how exactly the rotation is to be done.
[in]eulerAlphaThe rotation expressed as a pointer to Euler alpha angle.
[in]eulerBetaThe rotation expressed as a pointer to Euler beta angle.
[in]eulerGammaThe rotation expressed as a pointer to Euler gamma angle.

Definition at line 657 of file ProSHADE_overlay.cpp.

658 {
659  //================================================ Set maximum comparison bandwidth to maximum object bandwidth
660  this->maxCompBand = this->spheres[this->noSpheres-1]->getLocalBandwidth();
661 
662  //================================================ Save map COM after processing but before rotation
663  this->findMapCOM ( );
664  this->mapCOMProcessChangeX += ( this->xCom - this->originalMapXCom );
665  this->mapCOMProcessChangeY += ( this->yCom - this->originalMapYCom );
666  this->mapCOMProcessChangeZ += ( this->zCom - this->originalMapZCom );
667 
668  //================================================ Compute the Wigner D matrices for the Euler angles
669  ProSHADE_internal_wigner::computeWignerMatricesForRotation ( settings, this, -eulerAlpha, eulerBeta, -eulerGamma );
670 
671  //================================================ Initialise rotated Spherical Harmonics memory
672  this->allocateRotatedSHMemory ( );
673 
674  //================================================ Multiply SH coeffs by Wigner
675  this->computeRotatedSH ( );
676 
677  //================================================ Inverse the SH coeffs to shells
678  this->invertSHCoefficients ( );
679 
680  //================================================ Find spherical cut-offs
681  std::vector<proshade_double> lonCO, latCO;
682  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCO, &latCO, settings->maxBandwidth * 2 );
683 
684  //================================================ Allocate memory for the rotated map
685  proshade_double *densityMapRotated = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
686  ProSHADE_internal_misc::checkMemoryAllocation ( densityMapRotated, __FILE__, __LINE__, __func__ );
687  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { densityMapRotated[iter] = 0.0; }
688 
689  //================================================ Interpolate onto cartesian grid
690  this->interpolateMapFromSpheres ( densityMapRotated );
691 
692  //================================================ Copy map
693  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
694  {
695  this->internalMap[iter] = densityMapRotated[iter];
696  }
697 
698  //================================================ Release rotated map (original is now rotated)
699  delete[] densityMapRotated;
700 
701  //================================================ Done
702  return ;
703 
704 }

◆ saveDetectedSymmetries()

void ProSHADE_internal_data::ProSHADE_data::saveDetectedSymmetries ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSyms,
std::vector< std::vector< proshade_double > > *  allCs 
)

This function takes the results of point group searches and saves then into the output variables.

This function takes the CSyms as they are returned by the findRequestedCSymmetryFromAngleAxis() or the getCyclicSymmetriesListFromAngleAxis() functions and re-saves then to the output variables of the detectSymmetryFromAngleAxisSpace() function. It also releases the memory of the CSyms argument.

Warning
This function releases the memory of the CSyms argument.
Parameters
[in]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]CSymsA pointer to vector
[in]axesA pointer to a vector to which all the axes of the recommended symmetry (if any) will be saved.
[in]allCsA pointer to a vector to which all the detected cyclic symmetries will be saved into.

Definition at line 2255 of file ProSHADE_data.cpp.

2256 {
2257  //================================================ Initialise variables
2258  bool isArgSameAsSettings = true;
2259 
2260  //================================================ For each detected point group
2261  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( CSyms->size() ); cIt++ )
2262  {
2263  //============================================ Create vector to replace the pointer
2264  std::vector< proshade_double > nextSym;
2265  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[0] );
2266  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[1] );
2267  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[2] );
2268  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[3] );
2269  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[4] );
2270  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[5] );
2271  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[6] );
2273 
2274  //============================================ Copy the vector to output variable and if different, then also to settings object
2275  if ( ( cIt == 0 ) && ( settings->allDetectedCAxes.size() == 0 ) ) { isArgSameAsSettings = false; }
2276  if ( !isArgSameAsSettings ) { ProSHADE_internal_misc::addToDoubleVectorVector ( &settings->allDetectedCAxes, nextSym ); }
2277 
2278  //============================================ Release memory
2279  nextSym.clear ( );
2280  delete[] CSyms->at(cIt);
2281  }
2282 
2283  //================================================ Done
2284  return ;
2285 
2286 }

◆ saveRecommendedSymmetry()

void ProSHADE_internal_data::ProSHADE_data::saveRecommendedSymmetry ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSym,
std::vector< proshade_double * > *  DSym,
std::vector< proshade_double * > *  TSym,
std::vector< proshade_double * > *  OSym,
std::vector< proshade_double * > *  ISym,
std::vector< proshade_double * > *  axes,
fftw_complex *  mapData,
fftw_complex *  origCoeffs,
fftw_complex *  fCoeffs,
fftw_plan *  planForwardFourier,
proshade_signed  noBins,
proshade_signed *  binIndexing,
proshade_double **  bindata,
proshade_signed *  binCounts 
)

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]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]CSymA vector of pointers to double arrays, each array being a single Cyclic symmetry entry.
[in]DSymA vector of pointers to double arrays, each array being a single Dihedral symmetry entry.
[in]TSymA vector of pointers to double arrays, all of which together form the axes of tetrahedral symmetry.
[in]OSymA vector of pointers to double arrays, all of which together form the axes of octahedral symmetry.
[in]ISymA vector of pointers to double arrays, all of which together form the axes of icosahedral symmetry.
[in]axesA vector to which all the axes of the recommended symmetry (if any) will be saved.
[in]mapDataFFTW complex array which will be the input for the Fourier transform done by the planForwardFourier plan.
[in]fCoeffsFFTW complex array where the Fourier transform coefficients will be saved into by the planForwardFourier plan.
[in]origCoeffsFFTW complex array holding already compute Fourier transform of the non-rotated map.
[in]planForwardFourierA prepared FFTW3 plan for transforming the mapData onto fCoeffs.
[in]noBinsThe number of bins as already pre-computed.
[in]binIndexingA map of pre-computed bin assignments for each reflection in the format as outputted by FFTW.
[in]bindataPre-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]binCountsPre-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.

Definition at line 2596 of file ProSHADE_data.cpp.

2597 {
2598  //================================================ Report progress
2599  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting recommended symmetry decision procedure." );
2600 
2601  //================================================ If no C symmetries, nothing to save...
2602  if ( CSym->size() == 0 )
2603  {
2604  settings->setRecommendedSymmetry ( "" );
2605  settings->setRecommendedFold ( 0 );
2606  return;
2607  }
2608 
2609  //================================================ Find the top group minimum threshold using smoothened histogram
2610  proshade_double step = 0.01;
2611  proshade_double sigma = 0.03;
2612  proshade_signed windowSize = 9;
2613  proshade_double bestHistPeakStart = this->findTopGroupSmooth ( CSym, 5, step, sigma, windowSize );
2614  if ( bestHistPeakStart > settings->peakThresholdMin ) { bestHistPeakStart = settings->peakThresholdMin; }
2615 
2616  //================================================ Report progress
2617  proshade_unsign noPassed = 0; for ( size_t cIt = 0; cIt < CSym->size(); cIt++ ) { if ( CSym->at(cIt)[5] > bestHistPeakStart ) { noPassed += 1; } }
2618  std::stringstream ss;
2619  ss << "Smoothening has resolved in " << noPassed << " C symmetries.";
2620  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, ss.str() );
2621  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Starting FSC computation to confirm the C symmetries existence." );
2622 
2623  //================================================ Decide if I is the answer
2624  bool alreadyDecided = false;
2625  if ( ISym->size() == 31 )
2626  {
2627  //============================================ Initialise decision vars
2628  proshade_double fscVal = 0.0;
2629  proshade_double fscValAvg = 0.0;
2630 
2631  //============================================ Check if at least one C5 and one C3 with the correct angle have high FSC and peak height
2632  for ( size_t iIt = 0; iIt < 31; iIt++ ) { if ( CSym->at(settings->allDetectedIAxes.at(iIt))[5] > bestHistPeakStart ) { fscVal = this->computeFSC ( settings, CSym, settings->allDetectedIAxes.at(iIt), mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts ); fscValAvg += fscVal; } }
2633  fscValAvg /= 31.0;
2634 
2635  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2636  if ( fscValAvg >= ( settings->fscThreshold * 0.60 ) )
2637  {
2638  //======================================== The decision is I
2639  settings->setRecommendedSymmetry ( "I" );
2640  settings->setRecommendedFold ( 0 );
2641  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedIAxes.size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(settings->allDetectedIAxes.at(it)) ); }
2642  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedIAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSym->at(settings->allDetectedIAxes.at(it)) ); } }
2643 
2644  //======================================== Done
2645  alreadyDecided = true;
2646  }
2647  }
2648 
2649  //================================================ Decide if O is the answer
2650  if ( ( OSym->size() == 13 ) && !alreadyDecided )
2651  {
2652  //============================================ Initialise decision vars
2653  proshade_double fscVal = 0.0;
2654  proshade_double fscValAvg = 0.0;
2655 
2656  //============================================ Check if at least one C5 and one C3 with the correct angle have high FSC and peak height
2657  for ( size_t oIt = 0; oIt < 13; oIt++ ) { if ( CSym->at(settings->allDetectedOAxes.at(oIt))[5] > bestHistPeakStart ) { fscVal = this->computeFSC ( settings, CSym, settings->allDetectedOAxes.at(oIt), mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts ); fscValAvg += fscVal; } }
2658  fscValAvg /= 13.0;
2659 
2660  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2661  if ( fscValAvg >= ( settings->fscThreshold * 0.70 ) )
2662  {
2663  //======================================== The decision is O
2664  settings->setRecommendedSymmetry ( "O" );
2665  settings->setRecommendedFold ( 0 );
2666  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedOAxes.size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(settings->allDetectedOAxes.at(it)) ); }
2667  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedOAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSym->at(settings->allDetectedOAxes.at(it)) ); } }
2668 
2669  //======================================== Done
2670  alreadyDecided = true;
2671  }
2672  }
2673 
2674  //================================================ Decide if T is the answer
2675  if ( ( TSym->size() == 7 ) && !alreadyDecided )
2676  {
2677  //============================================ Initialise decision vars
2678  proshade_double fscVal = 0.0;
2679  proshade_double fscValAvg = 0.0;
2680 
2681  //============================================ Check if at least one C5 and one C3 with the correct angle have high FSC and peak height
2682  for ( size_t tIt = 0; tIt < 7; tIt++ ) { if ( CSym->at(settings->allDetectedTAxes.at(tIt))[5] > bestHistPeakStart ) { fscVal = this->computeFSC ( settings, CSym, settings->allDetectedTAxes.at(tIt), mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts ); fscValAvg += fscVal; } }
2683  fscValAvg /= 7.0;
2684 
2685  //============================================ If C3 and C5 are found and have correct angle (must have if they are both in ISym)
2686  if ( fscValAvg >= ( settings->fscThreshold * 0.80 ) )
2687  {
2688  //======================================== The decision is T
2689  settings->setRecommendedSymmetry ( "T" );
2690  settings->setRecommendedFold ( 0 );
2691  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedTAxes.size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(settings->allDetectedTAxes.at(it)) ); }
2692  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( settings->allDetectedTAxes.size() ); it++ ) { settings->setDetectedSymmetry ( CSym->at(settings->allDetectedTAxes.at(it)) ); } }
2693 
2694  //======================================== Done
2695  alreadyDecided = true;
2696  }
2697  }
2698 
2699  //================================================ Decide if D is the answer
2700  if ( ( settings->allDetectedDAxes.size() > 0 ) && ( DSym->size() > 0 ) && !alreadyDecided )
2701  {
2702  //============================================ Initialise decision vars
2703  proshade_signed bestD = -1;
2704  proshade_unsign bestFold = 0;
2705 
2706  //============================================ Find FSCs
2707  for ( size_t dIt = 0; dIt < settings->allDetectedDAxes.size(); dIt++ )
2708  {
2709  //======================================== Do not consider more than top 20, takes time and is unlikely to produce anything...
2710  if ( dIt > 20 ) { continue; }
2711 
2712  //======================================== Check the peak heights
2713  const FloatingPoint< proshade_double > lhs999a ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[5] ), lhs999b ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[5] ), rhs999 ( static_cast< proshade_double > ( -999.9 ) );
2714  if ( ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[5] < bestHistPeakStart ) && !( lhs999a.AlmostEquals( rhs999 ) ) ) { continue; }
2715  if ( ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[5] < bestHistPeakStart ) && !( lhs999b.AlmostEquals( rhs999 ) ) ) { continue; }
2716 
2717  //======================================== Find FSCs
2718  this->computeFSC ( settings, CSym, settings->allDetectedDAxes.at(dIt).at(0), mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts );
2719  this->computeFSC ( settings, CSym, settings->allDetectedDAxes.at(dIt).at(1), mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts );
2720  }
2721 
2722  //============================================ Find FSC top group threshold
2723  proshade_double bestHistFSCStart = this->findTopGroupSmooth ( CSym, 5, step, sigma, windowSize );
2724 
2725  //============================================ Check if both C symmetries are reliable
2726  for ( size_t dIt = 0; dIt < settings->allDetectedDAxes.size(); dIt++ )
2727  {
2728  //======================================== Check the peak heights
2729  const FloatingPoint< proshade_double > lhs999a2 ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[5] ), lhs999b2 ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[5] ), rhs999 ( static_cast< proshade_double > ( -999.9 ) );
2730  if ( ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[5] < bestHistPeakStart ) && !( lhs999a2.AlmostEquals( rhs999 ) ) ) { continue; }
2731  if ( ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[5] < bestHistPeakStart ) && !( lhs999b2.AlmostEquals( rhs999 ) ) ) { continue; }
2732 
2733  //======================================== Does this improve the best fold?
2734  if ( ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[0] > static_cast< proshade_double > ( bestFold ) ) || ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[0] > static_cast< proshade_double > ( bestFold ) ) )
2735  {
2736  //==================================== Check the FSC vals
2737  if ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[6] < settings->fscThreshold ) { continue; }
2738  if ( CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[6] < settings->fscThreshold ) { continue; }
2739  if ( std::max ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[6], CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[6] ) < bestHistFSCStart ) { continue; }
2740 
2741  //==================================== All good!
2742  bestFold = static_cast< proshade_unsign > ( std::max ( CSym->at(settings->allDetectedDAxes.at(dIt).at(0))[0], CSym->at(settings->allDetectedDAxes.at(dIt).at(1))[0] ) );
2743  bestD = static_cast< proshade_signed > ( dIt );
2744  }
2745  }
2746 
2747  //============================================ Anything?
2748  if ( bestD != -1 )
2749  {
2750  //======================================== The decision is D
2751  settings->setRecommendedSymmetry ( "D" );
2752  settings->setRecommendedFold ( static_cast< proshade_unsign > ( std::max ( CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(0))[0], CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(1))[0] ) ) );
2753  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(0)) );
2754  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(1)) );
2755  if ( settings->detectedSymmetry.size() == 0 )
2756  {
2757  settings->setDetectedSymmetry ( CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(0)) );
2758  settings->setDetectedSymmetry ( CSym->at(settings->allDetectedDAxes.at( static_cast< size_t > ( bestD ) ).at(1)) );
2759  }
2760 
2761  //======================================== Done
2762  alreadyDecided = true;
2763  }
2764  }
2765 
2766  //================================================ Decide if C is the answer
2767  if ( ( CSym->size() > 0 ) && !alreadyDecided )
2768  {
2769  //============================================ Initialise decision vars
2770  proshade_signed bestC = -1;
2771  proshade_unsign bestFold = 0;
2772 
2773  //============================================ Find FSCs for C syms
2774  for ( size_t cIt = 0; cIt < CSym->size(); cIt++ )
2775  {
2776  //======================================== Do not consider more than top 20, takes time and is unlikely to produce anything...
2777  if ( cIt > 20 ) { continue; }
2778 
2779  //======================================== Check the peak height
2780  if ( CSym->at(cIt)[5] < bestHistPeakStart ) { continue; }
2781 
2782  //======================================== Compute FSC
2783  this->computeFSC ( settings, CSym, cIt, mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts );
2784  }
2785 
2786  //============================================ Find FSC top group threshold
2787  proshade_double bestHistFSCStart = this->findTopGroupSmooth ( CSym, 6, step, sigma, windowSize );
2788 
2789  //============================================ Find reliable C syms
2790  for ( size_t cIt = 0; cIt < CSym->size(); cIt++ )
2791  {
2792  //======================================== Check if this improves the best already found fold
2793  if ( CSym->at(cIt)[0] > static_cast< proshade_double > ( bestFold ) )
2794  {
2795  //==================================== If FSC passes
2796  if ( ( CSym->at(cIt)[6] > settings->fscThreshold ) && ( CSym->at(cIt)[6] >= bestHistFSCStart ) )
2797  {
2798  bestFold = static_cast< proshade_unsign > ( CSym->at(cIt)[0] );
2799  bestC = static_cast< proshade_signed > ( cIt );
2800  }
2801  }
2802  }
2803 
2804  //============================================ Anything?
2805  if ( bestC != -1 )
2806  {
2807  //======================================== The decision is C
2808  settings->setRecommendedSymmetry ( "C" );
2809  settings->setRecommendedFold ( static_cast< proshade_unsign > ( CSym->at( static_cast< size_t > ( bestC ) )[0] ) );
2810  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at( static_cast< size_t > ( bestC ) ) );
2811  if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at( static_cast< size_t > ( bestC ) ) ); }
2812 
2813  //======================================== Done
2814  alreadyDecided = true;
2815  }
2816  }
2817 
2818  //================================================ Done
2819  return ;
2820 
2821 }

◆ saveRequestedSymmetryC()

void ProSHADE_internal_data::ProSHADE_data::saveRequestedSymmetryC ( ProSHADE_settings settings,
std::vector< proshade_double * > *  CSym,
std::vector< proshade_double * > *  axes 
)

This function takes the C 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. 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 (although there may be other symmetries present).

Parameters
[in]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]CSymA vector of pointers to double arrays, each array being a single Cyclic symmetry entry.
[in]axesA vector to which all the axes of the requested symmetry (if any) will be saved.

Definition at line 2834 of file ProSHADE_data.cpp.

2835 {
2836  //================================================ Initialise variables
2837  proshade_unsign bestIndex = 0;
2838  proshade_double highestSym = 0.0;
2839 
2840  //================================================ Search for best fold
2841  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( CSym->size() ); iter++ )
2842  {
2843  //============================================ Check if it is tbe correct fold
2844  const FloatingPoint< proshade_double > lhs1 ( CSym->at(iter)[0] ), rhs1 ( static_cast< proshade_double > ( settings->requestedSymmetryFold ) );
2845  if ( !lhs1.AlmostEquals ( rhs1 ) ) { continue; }
2846 
2847  //============================================ If correct, is it the highest found?
2848  if ( CSym->at(iter)[5] > highestSym )
2849  {
2850  highestSym = CSym->at(iter)[5];
2851  bestIndex = iter;
2852  }
2853  }
2854 
2855  //================================================ Found?
2856  if ( highestSym > 0.0 )
2857  {
2858  settings->setRecommendedSymmetry ( "C" );
2859  settings->setRecommendedFold ( static_cast< proshade_unsign > ( CSym->at(bestIndex)[0] ) );
2860  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(bestIndex) );
2861 
2862  if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at(bestIndex) ); }
2863  }
2864  else
2865  {
2866  settings->setRecommendedSymmetry ( "" );
2867  settings->setRecommendedFold ( 0 );
2868  }
2869 
2870  //================================================ Done
2871  return ;
2872 
2873 }

◆ saveRequestedSymmetryD()

void ProSHADE_internal_data::ProSHADE_data::saveRequestedSymmetryD ( ProSHADE_settings settings,
std::vector< proshade_double * > *  DSym,
std::vector< proshade_double * > *  axes,
fftw_complex *  mapData,
fftw_complex *  origCoeffs,
fftw_complex *  fCoeffs,
fftw_plan *  planForwardFourier,
proshade_signed  noBins,
proshade_signed *  binIndexing,
proshade_double **  bindata,
proshade_signed *  binCounts 
)

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]settingsA pointer to settings class containing all the information required for map symmetry detection.
[in]DSymA vector of pointers to double arrays, each array being a single Dihedral symmetry entry.
[in]axesA vector to which all the axes of the requested symmetry (if any) will be saved.

Definition at line 2886 of file ProSHADE_data.cpp.

2887 {
2888  //================================================ Initialise variables
2889  proshade_unsign bestIndex = 0;
2890  proshade_double highestSym = 0.0;
2891 
2892  //================================================ Search for best fold
2893  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( DSym->size() ); iter++ )
2894  {
2895  //============================================ Check if it is tbe correct fold
2896  const FloatingPoint< proshade_double > lhs1 ( std::max ( DSym->at(iter)[0], DSym->at(iter)[7] ) ), rhs1 ( static_cast< proshade_double > ( settings->requestedSymmetryFold ) );
2897  if ( !lhs1.AlmostEquals ( rhs1 ) ) { continue; }
2898 
2899  //============================================ Check if peak height is decent
2900  const FloatingPoint< proshade_double > lhs999a ( DSym->at(iter)[5] ), lhs999b ( DSym->at(iter)[12] ), rhs999 ( static_cast< proshade_double > ( -999.9 ) );
2901  if ( ( DSym->at(iter)[5] < settings->peakThresholdMin ) && !( lhs999a.AlmostEquals( rhs999 ) ) ) { continue; }
2902  if ( ( DSym->at(iter)[12] < settings->peakThresholdMin ) && !( lhs999b.AlmostEquals( rhs999 ) ) ) { continue; }
2903 
2904  //============================================ If correct, compute FSC
2905  this->computeFSC ( settings, &DSym->at(iter)[0], mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts );
2906  this->computeFSC ( settings, &DSym->at(iter)[7], mapData, fCoeffs, origCoeffs, planForwardFourier, noBins, binIndexing, bindata, binCounts );
2907 
2908  //============================================ If best, store it
2909  if ( ( DSym->at(iter)[6] + DSym->at(iter)[13] ) > highestSym )
2910  {
2911  highestSym = ( DSym->at(iter)[6] + DSym->at(iter)[13] );
2912  bestIndex = iter;
2913  }
2914  }
2915 
2916  //================================================ Found?
2917  if ( highestSym > 0.0 )
2918  {
2919  settings->setRecommendedSymmetry ( "D" );
2920  settings->setRecommendedFold ( static_cast< proshade_unsign > ( std::max ( DSym->at(bestIndex)[0], DSym->at(bestIndex)[7] ) ) );
2921  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestIndex)[0] );
2922  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestIndex)[7] );
2923 
2924  if ( settings->detectedSymmetry.size() == 0 )
2925  {
2926  settings->setDetectedSymmetry ( &DSym->at(bestIndex)[0] );
2927  settings->setDetectedSymmetry ( &DSym->at(bestIndex)[7] );
2928  }
2929  }
2930  else
2931  {
2932  settings->setRecommendedSymmetry ( "" );
2933  settings->setRecommendedFold ( 0 );
2934  }
2935 
2936  //================================================ Done
2937  return ;
2938 
2939 }

◆ setEMatrixValue()

void ProSHADE_internal_data::ProSHADE_data::setEMatrixValue ( proshade_unsign  band,
proshade_unsign  order1,
proshade_unsign  order2,
proshade_complex  val 
)

This function allows setting the E matrix value.

Parameters
[in]bandThe band indice of the E matrix to which the value should be assigned.
[in]order1The first order indice of the E matrix to which the value should be assigned.
[in]order2The second order indice of the E matrix to which the value should be assigned.
[in]valThe value which should be saved.

Definition at line 4097 of file ProSHADE_data.cpp.

4098 {
4099  //================================================ Mutate
4100  this->eMatrices[band][order1][order2][0] = val[0];
4101  this->eMatrices[band][order1][order2][1] = val[1];
4102 
4103  //================================================ Done
4104  return ;
4105 
4106 }

◆ setIntegrationWeight()

void ProSHADE_internal_data::ProSHADE_data::setIntegrationWeight ( proshade_double  intW)

This function allows setting the integration weight for the object.

Parameters
[in]intWThe integration weight to be set for this object.

Definition at line 4066 of file ProSHADE_data.cpp.

4067 {
4068  //================================================ Mutate
4069  this->integrationWeight = intW;
4070 
4071  //================================================ Done
4072  return ;
4073 
4074 }

◆ setIntegrationWeightCumul()

void ProSHADE_internal_data::ProSHADE_data::setIntegrationWeightCumul ( proshade_double  intW)

This function allows setting the cumulative integration weight for the object.

Parameters
[in]intWThe integration weight to be added to the current value for this object.

Definition at line 4080 of file ProSHADE_data.cpp.

4081 {
4082  //================================================ Mutate
4083  this->integrationWeight += intW;
4084 
4085  //================================================ Done
4086  return ;
4087 
4088 }

◆ 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 937 of file ProSHADE_data.cpp.

938 {
939  //================================================ Set starts to 0
940  this->xFrom = 0;
941  this->yFrom = 0;
942  this->zFrom = 0;
943 
944  //================================================ Set angles to 90 degrees
945  this->aAngle = 90.0;
946  this->bAngle = 90.0;
947  this->cAngle = 90.0;
948 
949  //================================================ Set dimension sizes in indices
950  this->xDimIndices = static_cast< proshade_unsign > ( this->xTo );
951  this->yDimIndices = static_cast< proshade_unsign > ( this->yTo );
952  this->zDimIndices = static_cast< proshade_unsign > ( this->zTo );
953 
954  //================================================ Set the to indices properly
955  this->xTo -= 1;
956  this->yTo -= 1;
957  this->zTo -= 1;
958 
959  //================================================ Set grid indexing to cell indexing
960  this->xGridIndices = this->xDimIndices;
961  this->yGridIndices = this->yDimIndices;
962  this->zGridIndices = this->zDimIndices;
963 
964  //================================================ Set axis order
965  this->xAxisOrder = 1;
966  this->yAxisOrder = 2;
967  this->zAxisOrder = 3;
968 
969  //================================================ Set origin to the first index
970  this->xAxisOrigin = this->xFrom;
971  this->yAxisOrigin = this->yFrom;
972  this->zAxisOrigin = this->zFrom;
973 
974  //================================================ Done
975  return ;
976 
977 }

◆ 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]positionThe 1D array position at which the new value should be saved.
[in]valComplex value to be saved into the array.

Definition at line 4131 of file ProSHADE_data.cpp.

4132 {
4133  //================================================ Mutate
4134  this->so3Coeffs[position][0] = val[0];
4135  this->so3Coeffs[position][1] = val[1];
4136 
4137  //================================================ Done
4138  return ;
4139 
4140 }

◆ 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]valproshade_complex value of the Wigner D matrix at position band, order1, order2.
[in]bandThe band of the Wigner D matrix value.
[in]order1The first order of the Wigner D matrix value.
[in]order2The second order of the Wigner D matrix value.

Definition at line 4149 of file ProSHADE_data.cpp.

4150 {
4151  //================================================ Mutate
4152  this->wignerMatrices[band][order1][order2][0] = val[0];
4153  this->wignerMatrices[band][order1][order2][1] = val[1];
4154 
4155  //================================================ Done
4156  return ;
4157 
4158 }

◆ 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]shellThe index (number) of the shell for which the check should be done.
[in]bandValThe band value which should be sought for the shell.
[out]XTrue if the shell has the band, false otherwise.

Definition at line 3625 of file ProSHADE_data.cpp.

3626 {
3627  if ( this->spheres[shell]->getLocalBandwidth( ) >= bandVal )
3628  {
3629  return ( true );
3630  }
3631  else
3632  {
3633  return ( false );
3634  }
3635 }

◆ 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]order1The first order for which the SO(3) value index is requested.
[in]order2The second order for which the SO(3) value index is requested.
[in]bandThe band for which the SO(3) value index is requested.
[out]valIndex position of the SO(3) value.

Definition at line 4245 of file ProSHADE_data.cpp.

4246 {
4247  //================================================ Return the value
4248  return ( static_cast<int> ( so3CoefLoc ( static_cast< int > ( order1 ), static_cast< int > ( order2 ), static_cast< int > ( band ), static_cast< int > ( this->getMaxBand() ) ) ) );
4249 }

◆ 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]settingsThe settings object specifying how exactly the rotation is to be done.
[in]trsXThe translation expressed as a number of angstroms to move by along the x-axis.
[in]trsYThe translation expressed as a number of angstroms to move by along the y-axis.
[in]trsZThe translation expressed as a number of angstroms to move by along the z-axis.

Definition at line 954 of file ProSHADE_overlay.cpp.

955 {
956  //================================================ Initialise local variables
957  proshade_single xMov = static_cast< proshade_single > ( -trsX );
958  proshade_single yMov = static_cast< proshade_single > ( -trsY );
959  proshade_single zMov = static_cast< proshade_single > ( -trsZ );
960 
961  //================================================ Move the whole map frame to minimise the Fourier movement
962  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
963  this->getXFromPtr(), this->getXToPtr(), this->getYFromPtr(), this->getYToPtr(),
964  this->getZFromPtr(), this->getZToPtr(), this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
965 
966  //================================================ Finalise the movement by in-frame Fourier movement
967  ProSHADE_internal_mapManip::moveMapByFourier ( this->getInternalMap(), xMov, yMov, zMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
968  static_cast< proshade_signed > ( this->getXDim() ), static_cast< proshade_signed > ( this->getYDim() ),
969  static_cast< proshade_signed > ( this->getZDim() ) );
970 
971  //================================================ Done
972  return ;
973 
974 }

◆ 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]fNameThe filename (including path) to where the output PDB file should be saved.
[in]gemmiStructgemmi::Structure object which should be modified and written out.
[in]euAThe Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]euBThe Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]euGThe Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]trsXThe translation to be done along X-axis in Angstroms.
[in]trsYThe translation to be done along Y-axis in Angstroms.
[in]trsZThe translation to be done along Z-axis in Angstroms.
[in]rotXThe translation to be done along X-axis in Angstroms.
[in]rotYThe translation to be done along Y-axis in Angstroms.
[in]rotZThe translation to be done along Z-axis in Angstroms.
[in]firstModelShould only the first model, or rather all of them be used?

Definition at line 1109 of file ProSHADE_data.cpp.

1110 {
1111  //================================================ If the map was rotated, do the same for the co-ordinates, making sure we take into account the rotation centre of the map
1112  if ( ( euA != 0.0 ) || ( euB != 0.0 ) || ( euG != 0.0 ) )
1113  {
1114  //============================================ Rotate the co-ordinates
1115  ProSHADE_internal_mapManip::rotatePDBCoordinates ( &gemmiStruct, euA, euB, euG, rotX, rotY, rotZ, firstModel );
1116  }
1117 
1118  //================================================ Translate by required translation and the map centering (if applied)
1119  ProSHADE_internal_mapManip::translatePDBCoordinates ( &gemmiStruct, trsX, trsY, trsZ, firstModel );
1120 
1121  //================================================ Write the PDB file
1122  std::ofstream outCoOrdFile;
1123  outCoOrdFile.open ( fName.c_str() );
1124 
1125  if ( outCoOrdFile.is_open() )
1126  {
1127  gemmi::PdbWriteOptions opt;
1128  write_pdb ( gemmiStruct, outCoOrdFile, opt );
1129  }
1130  else
1131  {
1132  std::stringstream hlpMessage;
1133  hlpMessage << "Failed to open the PDB file " << fName << " for output.";
1134  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." );
1135  }
1136 
1137  outCoOrdFile.close ( );
1138 
1139  //================================================ Done
1140  return ;
1141 }

◆ 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]fNameThe filename (including path) to where the output MAP file should be saved.
[in]titleString with the map title to be written into the header - default value is "Created by ProSHADE and written by GEMMI"
[in]modeThe type of the data, leave at default 2 (mean float type) unless you specifically required other types.

Definition at line 1005 of file ProSHADE_data.cpp.

1006 {
1007  //================================================ Create and prepare new Grid gemmi object
1008  gemmi::Grid<float> mapData;
1009  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 ) );
1010  mapData.set_size_without_checking ( static_cast< int > ( this->xDimIndices ), static_cast< int > ( this->yDimIndices ), static_cast< int > ( this->zDimIndices ) );
1011  mapData.axis_order = gemmi::AxisOrder::XYZ;
1012  mapData.spacegroup = &gemmi::get_spacegroup_p1();
1013 
1014  //================================================ Create and prepare new Ccp4 gemmi object
1015  gemmi::Ccp4<float> map;
1016  map.grid = mapData;
1017  map.update_ccp4_header ( mode );
1018 
1019  //================================================ Fill in the header
1021  this->xDimIndices, this->yDimIndices, this->zDimIndices,
1022  this->xDimSize, this->yDimSize, this->zDimSize,
1023  this->aAngle, this->bAngle, this->cAngle,
1024  this->xFrom, this->yFrom, this->zFrom,
1025  this->xAxisOrigin, this->yAxisOrigin, this->zAxisOrigin,
1026  this->xAxisOrder, this->yAxisOrder, this->zAxisOrder,
1027  this->xGridIndices, this->yGridIndices, this->zGridIndices,
1028  title, mode );
1029 
1030  //================================================ Copy internal map to grid
1031  proshade_unsign arrPos = 0;
1032  for ( proshade_unsign uIt = 0; uIt < this->xDimIndices; uIt++ )
1033  {
1034  for ( proshade_unsign vIt = 0; vIt < this->yDimIndices; vIt++ )
1035  {
1036  for ( proshade_unsign wIt = 0; wIt < this->zDimIndices; wIt++ )
1037  {
1038  arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
1039  map.grid.set_value ( static_cast< int > ( uIt ), static_cast< int > ( vIt ), static_cast< int > ( wIt ), static_cast<float> ( this->internalMap[arrPos] ) );
1040  }
1041  }
1042  }
1043 
1044  //================================================ Update the statistics in the header
1045  map.update_ccp4_header ( mode, true );
1046 
1047  //================================================ Write out the map
1048  map.write_ccp4_map ( fName );
1049 
1050  //================================================ Done
1051  return ;
1052 
1053 }

◆ 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]fileNameThe filename (including path) to where the output should be saved.
[in]maskPointer to the mask map array.

Definition at line 1151 of file ProSHADE_data.cpp.

1152 {
1153  //================================================ Allocate the memory
1154  proshade_double* hlpMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1155  ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
1156 
1157  //================================================ Copy original map and over-write with the mask
1158  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1159  {
1160  hlpMap[iter] = this->internalMap[iter];
1161  this->internalMap[iter] = mask[iter];
1162  }
1163 
1164  //================================================ Write out the mask
1165  this->writeMap ( fName );
1166 
1167  //================================================ Copy the original map values back
1168  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1169  {
1170  this->internalMap[iter] = hlpMap[iter];
1171  }
1172 
1173  //================================================ Release memory
1174  delete[] hlpMap;
1175 
1176  //================================================ Done
1177  return ;
1178 }

◆ 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]settingsA pointer to settings class containing all the information required for map manipulation.
[in]eulAThe Euler alpha angle value, by which the moving structure is to be rotated by.
[in]eulBThe Euler beta angle value, by which the moving structure is to be rotated by.
[in]eulGThe Euler gamma angle value, by which the moving structure is to be rotated by.
[in]rotCentreThe rotation centre position.
[in]ultimateTranslationThe final translation as determined by the translation function.

Definition at line 4457 of file ProSHADE_data.cpp.

4458 {
4459  //================================================ Write out rotated map
4460  std::stringstream fNameHlp;
4461  fNameHlp << settings->overlayStructureName << ".map";
4462  this->writeMap ( fNameHlp.str() );
4463 
4464  //================================================ Write out rotated co-ordinates if possible
4465  if ( ProSHADE_internal_io::isFilePDB ( this->fileName ) )
4466  {
4467  fNameHlp.str("");
4468  fNameHlp << settings->overlayStructureName << ".pdb";
4469  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 );
4470  }
4471 
4472  //================================================ Write out the json file with the results
4473  ProSHADE_internal_io::writeRotationTranslationJSON ( rotCentre->at(0), rotCentre->at(1), rotCentre->at(2),
4474  eulA, eulB, eulG,
4475  ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2),
4476  settings->rotTrsJSONFile );
4477 
4478  //================================================ Done
4479  return ;
4480 
4481 }

◆ 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]fNameThe filename (including path) to where the output PDB file should be saved.
[in]euAThe Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]euBThe Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]euGThe Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required).
[in]trsXThe translation to be done along X-axis in Angstroms.
[in]trsYThe translation to be done along Y-axis in Angstroms.
[in]trsZThe translation to be done along Z-axis in Angstroms.
[in]rotXThe translation to be done along X-axis in Angstroms.
[in]rotYThe translation to be done along Y-axis in Angstroms.
[in]rotZThe translation to be done along Z-axis in Angstroms.
[in]firstModelShould only the first model, or rather all of them be used?

Definition at line 1072 of file ProSHADE_data.cpp.

1073 {
1074  //================================================ Check for co-ordinate origin
1075  if ( !ProSHADE_internal_io::isFilePDB ( this->fileName ) )
1076  {
1077  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." );
1078  }
1079 
1080  //================================================ Open PDB file for reading
1081  gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
1082 
1083  //================================================ Write out using the gemmi::Structure object
1084  this->writeGemmi ( fName, pdbFile, euA, euB, euG, trsX, trsY, trsZ, rotX, rotY, rotZ, firstModel );
1085 
1086  //================================================ Done
1087  return ;
1088 }

◆ 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]xDimThe X dimension size to which this structure should be padded into.
[in]yDimThe Y dimension size to which this structure should be padded into.
[in]zDimThe Z dimension size to which this structure should be padded into.

Definition at line 519 of file ProSHADE_overlay.cpp.

520 {
521  //================================================ Sanity check
522  if ( ( this->xDimIndices > xDim ) || ( this->yDimIndices > yDim ) || ( this->zDimIndices > zDim ) )
523  {
524  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." );
525  }
526 
527  //================================================ If done, do nothing
528  if ( ( this->xDimIndices == xDim ) && ( this->yDimIndices == yDim ) && ( this->zDimIndices == zDim ) ) { return ; }
529 
530  //================================================ Find out how many zeroes need to be added before and after
531  proshade_unsign addXPre, addYPre, addZPre, addXPost, addYPost, addZPost;
532  ProSHADE_internal_overlay::computeBeforeAfterZeroCounts ( &addXPre, &addYPre, &addZPre, &addXPost, &addYPost, &addZPost, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices );
533 
534  //================================================ Create a new map
535  proshade_double* newMap = new proshade_double [xDim * yDim * zDim];
536 
537  //================================================ Do the hard work
538  ProSHADE_internal_overlay::paddMapWithZeroes ( this->internalMap, newMap, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices, addXPre, addYPre, addZPre );
539 
540  //================================================ Create a new internal map and copy
541  delete[] this->internalMap;
542  this->internalMap = new proshade_double [xDim * yDim * zDim];
543  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( xDim * yDim * zDim ); iter++ ) { this->internalMap[iter] = newMap[iter]; }
544 
545  //================================================ Release memory
546  delete[] newMap;
547 
548  //================================================ Update map related variables
549  this->xDimSize = static_cast< proshade_single > ( xDim ) * ( this->xDimSize / static_cast< proshade_single > ( this->xDimIndices ) );
550  this->yDimSize = static_cast< proshade_single > ( yDim ) * ( this->yDimSize / static_cast< proshade_single > ( this->yDimIndices ) );
551  this->zDimSize = static_cast< proshade_single > ( zDim ) * ( this->zDimSize / static_cast< proshade_single > ( this->zDimIndices ) );
552  this->xDimIndices = xDim ; this->yDimIndices = yDim ; this->zDimIndices = zDim;
553  this->xGridIndices = xDim ; this->yGridIndices = yDim ; this->zGridIndices = zDim;
554  this->xFrom -= addXPre ; this->yFrom -= addYPre ; this->zFrom -= addZPre;
555  this->xTo += addXPost; this->yTo += addYPost; this->zTo += addZPost;
556  this->xAxisOrigin -= addXPre ; this->yAxisOrigin -= addYPre ; this->zAxisOrigin -= addZPre ;
557 
558  //================================================ Done
559  return ;
560 
561 }

The documentation for this class was generated from the following files:
ProSHADE_internal_data::ProSHADE_data::findTopGroupSmooth
proshade_double findTopGroupSmooth(std::vector< proshade_double * > *CSym, size_t peakPos, proshade_double step, proshade_double sigma, proshade_signed windowSize)
This function finds the distinct group of axes with highest peak heights.
Definition: ProSHADE_data.cpp:2301
ProSHADE_settings::noIQRsFromMedianNaivePeak
proshade_double noIQRsFromMedianNaivePeak
When doing peak searching, how many IQRs from the median the threshold for peak height should be (in ...
Definition: ProSHADE_settings.hpp:118
ProSHADE_internal_distances::normaliseEMatrices
void normaliseEMatrices(ProSHADE_internal_data::ProSHADE_data *obj1, ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function normalises the E matrices.
Definition: ProSHADE_distances.cpp:572
sortProSHADESymmetryByPeak
bool sortProSHADESymmetryByPeak(proshade_double *a, proshade_double *b)
This function allows using std::sort to sort vectors of ProSHADE symmetry format..
Definition: ProSHADE_symmetry.cpp:3872
ProSHADE_internal_data::ProSHADE_data::originalMapYCom
proshade_double originalMapYCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
Definition: ProSHADE_data.hpp:92
ProSHADE_settings::maxBandwidth
proshade_unsign maxBandwidth
The bandwidth of spherical harmonics decomposition for the largest sphere.
Definition: ProSHADE_settings.hpp:58
ProSHADE_internal_mapManip::addExtraBoundSpace
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.
Definition: ProSHADE_mapManip.cpp:1139
ProSHADE_internal_data::ProSHADE_data::mapMovFromsChangeX
proshade_double mapMovFromsChangeX
When the map is translated, the xFrom and xTo values are changed. This variable holds how much they h...
Definition: ProSHADE_data.hpp:94
ProSHADE_settings::recommendedSymmetryType
std::string recommendedSymmetryType
The symmetry type that ProSHADE finds the best fitting for the structure. Possible values are "" for ...
Definition: ProSHADE_settings.hpp:128
ProSHADE_internal_data::ProSHADE_data::allocateRotatedSHMemory
void allocateRotatedSHMemory(void)
This function allocates the memory required for storing the rotated Spherical Harmonics coefficients.
Definition: ProSHADE_overlay.cpp:978
ProSHADE_internal_mapManip::determinePDBRanges
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.
Definition: ProSHADE_mapManip.cpp:72
ProSHADE_internal_data::ProSHADE_data::fileName
std::string fileName
This is the original file from which the data were obtained.
Definition: ProSHADE_data.hpp:52
ProSHADE_internal_data::ProSHADE_data::zFrom
proshade_signed zFrom
This is the starting index along the z axis.
Definition: ProSHADE_data.hpp:112
ProSHADE_internal_symmetry::detectOctahedralSymmetry
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...
Definition: ProSHADE_symmetry.cpp:2268
ProSHADE_settings::rotTrsJSONFile
std::string rotTrsJSONFile
The filename to which the rotation and translation operations are to be saved into.
Definition: ProSHADE_settings.hpp:139
ProSHADE_internal_data::ProSHADE_data::xDimIndices
proshade_unsign xDimIndices
This is the size of the map cell x dimension in indices.
Definition: ProSHADE_data.hpp:65
ProSHADE_internal_data::ProSHADE_data::getZDimSize
proshade_single getZDimSize(void)
This function allows access to the map size in angstroms along the Z axis.
Definition: ProSHADE_data.cpp:3898
ProSHADE_internal_mapManip::changePDBBFactors
void changePDBBFactors(gemmi::Structure *pdbFile, proshade_double newBFactorValue, bool firstModel)
Function for changing the PDB B-factor values to a specific single value.
Definition: ProSHADE_mapManip.cpp:444
ProSHADE_internal_data::ProSHADE_data::readInMAP
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.
Definition: ProSHADE_data.cpp:619
ProSHADE_internal_misc::sortSymInvFoldHlp
bool sortSymInvFoldHlp(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the first number, sorting highest first.
Definition: ProSHADE_misc.cpp:296
ProSHADE_internal_data::ProSHADE_data::zDimSizeOriginal
proshade_single zDimSizeOriginal
This is the size of the map cell z dimension in Angstroms.
Definition: ProSHADE_data.hpp:84
ProSHADE_internal_symmetry::findIcos15C2s
void findIcos15C2s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the fifteen C3 symmetries with correct angles ...
Definition: ProSHADE_symmetry.cpp:3510
ProSHADE_internal_maths::vectorMeanAndSD
void vectorMeanAndSD(std::vector< proshade_double > *vec, proshade_double *&ret)
Function to get vector mean and standard deviation.
Definition: ProSHADE_maths.cpp:121
ProSHADE_internal_misc::addToDblPtrVector
void addToDblPtrVector(std::vector< proshade_double * > *vecToAddTo, proshade_double *elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:143
ProSHADE_internal_io::isFilePDB
bool isFilePDB(std::string fName)
Function determining if the input data type is PDB.
Definition: ProSHADE_io.cpp:32
ProSHADE_internal_spheres::ProSHADE_sphere::getLocalBandwidth
proshade_unsign getLocalBandwidth(void)
This function returns the local bandwidth.
Definition: ProSHADE_spheres.cpp:390
ProSHADE_settings::maxSymmetryFold
proshade_unsign maxSymmetryFold
The highest symmetry fold to search for.
Definition: ProSHADE_settings.hpp:133
ProSHADE_internal_data::ProSHADE_data::xGridIndices
proshade_unsign xGridIndices
As far as I know, this is identical to the xDimIndices.
Definition: ProSHADE_data.hpp:68
ProSHADE_internal_data::ProSHADE_data::translationMap
proshade_complex * translationMap
This is where the translation map will be held, if at all used.
Definition: ProSHADE_data.hpp:133
ProSHADE_internal_data::joinElementsFromDifferentGroups
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.
Definition: ProSHADE_data.cpp:3102
ProSHADE_internal_data::ProSHADE_data::xAxisOrder
proshade_unsign xAxisOrder
This is the order of the x axis.
Definition: ProSHADE_data.hpp:71
ProSHADE_internal_data::ProSHADE_data::rotSphericalHarmonics
proshade_complex ** rotSphericalHarmonics
A set of rotated spherical harmonics values arrays for each sphere, used only if map rotation is requ...
Definition: ProSHADE_data.hpp:122
ProSHADE_settings::determineAllSHValues
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.
Definition: ProSHADE.cpp:1615
ProSHADE_internal_data::ProSHADE_data::sphericalHarmonics
proshade_complex ** sphericalHarmonics
A set of spherical harmonics values arrays for each sphere.
Definition: ProSHADE_data.hpp:121
ProSHADE_internal_symmetry::predictOctaAxes
void predictOctaAxes(std::vector< proshade_double * > *CSymList, 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.
Definition: ProSHADE_symmetry.cpp:3325
ProSHADE_internal_data::ProSHADE_data::interpolateMapFromSpheres
void interpolateMapFromSpheres(proshade_double *&densityMapRotated)
This function interpolates the density map from the sphere mapped data.
Definition: ProSHADE_overlay.cpp:1200
ProSHADE_internal_data::ProSHADE_data::saveRecommendedSymmetry
void saveRecommendedSymmetry(ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, std::vector< proshade_double * > *DSym, std::vector< proshade_double * > *TSym, std::vector< proshade_double * > *OSym, std::vector< proshade_double * > *ISym, std::vector< proshade_double * > *axes, fftw_complex *mapData, fftw_complex *origCoeffs, fftw_complex *fCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **bindata, proshade_signed *binCounts)
This function takes all the detected symmetry results and decides on which are to be recommended for ...
Definition: ProSHADE_data.cpp:2596
ProSHADE_internal_data::ProSHADE_data::cAngle
proshade_single cAngle
This is the angle c of the map cell in degrees.
Definition: ProSHADE_data.hpp:64
ProSHADE_internal_symmetry::predictTetraAxes
void predictTetraAxes(std::vector< proshade_double * > *CSymList, 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.
Definition: ProSHADE_symmetry.cpp:4306
ProSHADE_internal_data::ProSHADE_data::so3CoeffsInverse
proshade_complex * so3CoeffsInverse
The inverse coefficients obtained by inverse SO(3) Fourier Transform (SOFT) - i.e....
Definition: ProSHADE_data.hpp:130
ProSHADE_internal_data::ProSHADE_data::prepareFSCFourierMemory
void prepareFSCFourierMemory(fftw_complex *&mapData, fftw_complex *&origCoeffs, fftw_complex *&fCoeffs, proshade_signed *&binIndexing, proshade_signed *noBins, proshade_double **&bindata, proshade_signed *&binCounts, fftw_plan *planForwardFourier)
This function allocates the memory and makes all preparations required for FSC computation.
Definition: ProSHADE_data.cpp:2357
ProSHADE_internal_data::ProSHADE_data::getXAxisOrigin
proshade_signed * getXAxisOrigin(void)
This function allows access to the map X axis origin value.
Definition: ProSHADE_data.cpp:3998
ProSHADE_internal_symmetry::addAxisUnlessSame
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...
Definition: ProSHADE_symmetry.cpp:2648
ProSHADE_internal_data::ProSHADE_data::yCom
proshade_double yCom
The COM of the map after processing along the Y-axis.
Definition: ProSHADE_data.hpp:78
ProSHADE_settings::boundsExtraSpace
proshade_single boundsExtraSpace
The number of extra angstroms to be added to all re-boxing bounds just for safety.
Definition: ProSHADE_settings.hpp:93
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere
This class contains all inputed data for the rotation function angle-axis converted spheres.
Definition: ProSHADE_maths.hpp:54
ProSHADE_exception
This class is the representation of ProSHADE exception.
Definition: ProSHADE_exceptions.hpp:37
ProSHADE_internal_symmetry::saveAllCSymmetries
void saveAllCSymmetries(std::vector< std::vector< proshade_unsign > > detected, std::vector< proshade_double * > peaks, std::vector< proshade_double * > *ret, proshade_double axErr)
This function takes the detected symmetries indices and peaks and saves these in the main cyclic symm...
Definition: ProSHADE_symmetry.cpp:1133
ProSHADE_internal_symmetry::findPredictedAxesHeights
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.
Definition: ProSHADE_symmetry.cpp:4008
ProSHADE_settings::allDetectedDAxes
std::vector< std::vector< proshade_unsign > > allDetectedDAxes
The vector of all detected dihedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:148
ProSHADE_settings::blurFactor
proshade_single blurFactor
This is the amount by which B-factors should be increased to create the blurred map for masking.
Definition: ProSHADE_settings.hpp:78
ProSHADE_internal_data::ProSHADE_data::saveDetectedSymmetries
void saveDetectedSymmetries(ProSHADE_settings *settings, std::vector< proshade_double * > *CSyms, std::vector< std::vector< proshade_double > > *allCs)
This function takes the results of point group searches and saves then into the output variables.
Definition: ProSHADE_data.cpp:2255
ProSHADE_settings::maskMap
bool maskMap
Should the map be masked from noise?
Definition: ProSHADE_settings.hpp:80
ProSHADE_settings::requestedSymmetryFold
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
Definition: ProSHADE_settings.hpp:131
ProSHADE_settings::requestedSymmetryType
std::string requestedSymmetryType
The symmetry type requested by the user. Allowed values are C, D, T, O and I.
Definition: ProSHADE_settings.hpp:130
ProSHADE_internal_data::ProSHADE_data::allocateRRPMemory
void allocateRRPMemory()
This function allocates the required memory for the RRP matrices.
Definition: ProSHADE_distances.cpp:31
ProSHADE_internal_data::ProSHADE_data::getXDimSize
proshade_single getXDimSize(void)
This function allows access to the map size in angstroms along the X axis.
Definition: ProSHADE_data.cpp:3878
ProSHADE_internal_misc::addToUnsignVectorVector
void addToUnsignVectorVector(std::vector< std::vector< proshade_unsign > > *vecToAddTo, std::vector< proshade_unsign > elementToAdd)
Adds the element to the vector of vectors.
Definition: ProSHADE_misc.cpp:211
ProSHADE_internal_data::ProSHADE_data::getInternalMap
proshade_double *& getInternalMap(void)
This function allows access to the first map array value address.
Definition: ProSHADE_data.cpp:4028
ProSHADE_internal_peakSearch::getAllPeaksNaive
std::vector< proshade_double * > getAllPeaksNaive(proshade_complex *map, proshade_unsign dim, proshade_signed peakSize, proshade_double noIQRs)
This function finds peaks in the 3D map using the "naive" approach.
Definition: ProSHADE_peakSearch.cpp:316
ProSHADE_internal_data::ProSHADE_data::noSpheres
proshade_unsign noSpheres
The number of spheres with map projected onto them.
Definition: ProSHADE_data.hpp:119
ProSHADE_settings::removeNegativeDensity
bool removeNegativeDensity
Should the negative density be removed from input files?
Definition: ProSHADE_settings.hpp:47
ProSHADE_internal_symmetry::findOcta4C3s
void findOcta4C3s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the four C3 symmetries with correct angles req...
Definition: ProSHADE_symmetry.cpp:2390
ProSHADE_internal_symmetry::printSymmetryCompletion
void printSymmetryCompletion(proshade_unsign noSyms, proshade_signed verbose)
This function simply prints the summary and warnings for cyclic symmetries detection completion.
Definition: ProSHADE_symmetry.cpp:1103
ProSHADE_internal_data::ProSHADE_data::getYDimSize
proshade_single getYDimSize(void)
This function allows access to the map size in angstroms along the Y axis.
Definition: ProSHADE_data.cpp:3888
ProSHADE_internal_symmetry::findPeaksByHeightBoundaries
std::vector< proshade_double > findPeaksByHeightBoundaries(std::vector< proshade_double * > allPeaks, proshade_double smoothing)
This function groups the peaks by height and returns the boundaries between such groups.
Definition: ProSHADE_symmetry.cpp:317
ProSHADE_internal_data::ProSHADE_data::inputOrder
proshade_unsign inputOrder
This value is the input order - it is useful to know for writing out files, so that they would not ov...
Definition: ProSHADE_data.hpp:140
ProSHADE_internal_mapManip::getMaskFromBlurr
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.
Definition: ProSHADE_mapManip.cpp:1032
ProSHADE_internal_data::ProSHADE_data::computeFSC
proshade_double computeFSC(ProSHADE_settings *settings, std::vector< proshade_double * > *CSym, size_t symIndex, fftw_complex *mapData, fftw_complex *fCoeffs, fftw_complex *origCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&bindata, proshade_signed *&binCounts)
This function computes FSC for any given axis in the supplied CSym symmetry axes vector.
Definition: ProSHADE_data.cpp:2425
ProSHADE_internal_data::ProSHADE_data::zDimSize
proshade_single zDimSize
This is the size of the map cell z dimension in Angstroms.
Definition: ProSHADE_data.hpp:61
ProSHADE_internal_data::ProSHADE_data::so3Coeffs
proshade_complex * so3Coeffs
The coefficients obtained by SO(3) Fourier Transform (SOFT), in this case derived from the E matrices...
Definition: ProSHADE_data.hpp:129
ProSHADE_settings::saveMask
bool saveMask
Should the mask be saved?
Definition: ProSHADE_settings.hpp:84
ProSHADE_settings::requestedResolution
proshade_single requestedResolution
The resolution to which the calculations are to be done.
Definition: ProSHADE_settings.hpp:50
ProSHADE_internal_distances::isBandWithinShell
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.
Definition: ProSHADE_distances.cpp:139
ProSHADE_internal_data::ProSHADE_data::mapCOMProcessChangeX
proshade_double mapCOMProcessChangeX
The change in X axis between the creation of the structure (originalMapXCom) and just before rotation...
Definition: ProSHADE_data.hpp:97
ProSHADE_settings::minSymPeak
proshade_double minSymPeak
Minimum average peak for symmetry axis to be considered as "real".
Definition: ProSHADE_settings.hpp:127
ProSHADE_internal_mapManip::findMAPCOMValues
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)
This function finds the Centre of Mass for a map.
Definition: ProSHADE_mapManip.cpp:240
ProSHADE_internal_mapManip::blurSharpenMap
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.
Definition: ProSHADE_mapManip.cpp:932
ProSHADE_internal_data::ProSHADE_data::originalMapXCom
proshade_double originalMapXCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
Definition: ProSHADE_data.hpp:91
ProSHADE_settings::setDetectedSymmetry
void setDetectedSymmetry(proshade_double *sym)
Sets the final detected symmetry axes information.
Definition: ProSHADE.cpp:1315
ProSHADE_internal_data::ProSHADE_data::xDimIndicesOriginal
proshade_unsign xDimIndicesOriginal
This is the size of the map cell x dimension in indices.
Definition: ProSHADE_data.hpp:85
ProSHADE_internal_mapManip::moveMapByFourier
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.
Definition: ProSHADE_mapManip.cpp:811
ProSHADE_settings::progressiveSphereMapping
bool progressiveSphereMapping
If true, each shell will have its own angular resolution dependent on the actual number of map points...
Definition: ProSHADE_settings.hpp:105
ProSHADE_internal_mapManip::movePDBForMapCalc
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.
Definition: ProSHADE_mapManip.cpp:573
ProSHADE_settings::maxSphereDists
proshade_single maxSphereDists
The distance between spheres in spherical mapping for the largest sphere.
Definition: ProSHADE_settings.hpp:65
ProSHADE_internal_data::ProSHADE_data::maxShellBand
proshade_unsign maxShellBand
The maximum band for any shell of the object.
Definition: ProSHADE_data.hpp:123
ProSHADE_settings::symMissPeakThres
proshade_double symMissPeakThres
Percentage of peaks that could be missing that would warrant starting the missing peaks search proced...
Definition: ProSHADE_settings.hpp:124
ProSHADE_internal_data::ProSHADE_data::originalPdbRotCenY
proshade_double originalPdbRotCenY
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
Definition: ProSHADE_data.hpp:103
ProSHADE_internal_data::ProSHADE_data::getSpherePositions
void getSpherePositions(ProSHADE_settings *settings)
This function determines the sphere positions (radii) for sphere mapping.
Definition: ProSHADE_data.cpp:1742
ProSHADE_internal_data::ProSHADE_data::invertMirrorMap
void invertMirrorMap(ProSHADE_settings *settings)
Function for inverting the map to its mirror image.
Definition: ProSHADE_data.cpp:1188
ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles
void getRotationMatrixFromEulerZXZAngles(proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *matrix)
Function to find the rotation matrix from Euler angles (ZXZ convention).
Definition: ProSHADE_maths.cpp:1007
ProSHADE_internal_data::ProSHADE_data::getDihedralSymmetriesList
std::vector< proshade_double * > getDihedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
This function obtains a list of all D symmetries from already computed C symmetries list.
Definition: ProSHADE_symmetry.cpp:1299
checkElementsFormGroup
bool checkElementsFormGroup(std::vector< std::vector< proshade_double > > *elements, proshade_double matrixTolerance)
This function checks if all group element products produce another group element.
Definition: ProSHADE_data.cpp:3061
ProSHADE_internal_data::ProSHADE_data::getMapCOMProcessChange
std::vector< proshade_double > getMapCOMProcessChange(void)
This function allows access to the translation caused by structure processing.
Definition: ProSHADE_data.cpp:4048
ProSHADE_internal_overlay::computeBeforeAfterZeroCounts
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...
Definition: ProSHADE_overlay.cpp:578
ProSHADE_internal_data::ProSHADE_data::saveRequestedSymmetryD
void saveRequestedSymmetryD(ProSHADE_settings *settings, std::vector< proshade_double * > *DSym, std::vector< proshade_double * > *axes, fftw_complex *mapData, fftw_complex *origCoeffs, fftw_complex *fCoeffs, fftw_plan *planForwardFourier, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **bindata, proshade_signed *binCounts)
This function takes the D symmetries and searched for the requested symmetry.
Definition: ProSHADE_data.cpp:2886
ProSHADE_internal_data::ProSHADE_data::mapCOMProcessChangeZ
proshade_double mapCOMProcessChangeZ
The change in Z axis between the creation of the structure (originalMapZCom) and just before rotation...
Definition: ProSHADE_data.hpp:99
ProSHADE_settings::maskingThresholdIQRs
proshade_single maskingThresholdIQRs
Number of inter-quartile ranges from the median to be used for thresholding the blurred map for maski...
Definition: ProSHADE_settings.hpp:79
ProSHADE_settings::usePhase
bool usePhase
If true, the full data will be used, if false, Patterson maps will be used instead and phased data wi...
Definition: ProSHADE_settings.hpp:62
ProSHADE_internal_data::ProSHADE_data::xDimSizeOriginal
proshade_single xDimSizeOriginal
This is the size of the map cell x dimension in Angstroms.
Definition: ProSHADE_data.hpp:82
ProSHADE_settings::allDetectedTAxes
std::vector< proshade_unsign > allDetectedTAxes
The vector of all detected tetrahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:149
ProSHADE_internal_messages::printWarningMessage
void printWarningMessage(proshade_signed verbose, std::string message, std::string warnCode)
General stderr message printing (used for warnings).
Definition: ProSHADE_messages.cpp:101
ProSHADE_internal_io::figureDataType
InputType figureDataType(std::string fName)
Function determining input data type.
Definition: ProSHADE_io.cpp:918
ProSHADE_internal_mapManip::reSampleMapToResolutionTrilinear
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.
Definition: ProSHADE_mapManip.cpp:1175
ProSHADE_internal_data::ProSHADE_data::zAxisOriginOriginal
proshade_signed zAxisOriginOriginal
This is the origin position along the z axis.
Definition: ProSHADE_data.hpp:90
ProSHADE_internal_spheres::ProSHADE_sphere
This class contains all inputed and derived data for a single sphere.
Definition: ProSHADE_spheres.hpp:49
ProSHADE_internal_spheres::ProSHADE_sphere::getRotatedMappedData
proshade_double getRotatedMappedData(proshade_unsign pos)
This function gets the rotated mapped data value for a particular position.
Definition: ProSHADE_spheres.cpp:627
ProSHADE_internal_symmetry::findPeaksCSymmetry
std::vector< std::vector< proshade_unsign > > findPeaksCSymmetry(std::vector< proshade_double * > *peaks, proshade_signed verbose, proshade_unsign band, proshade_double missPeakThres, proshade_double axisErrTolerance, bool axisErrToleranceDef, ProSHADE_internal_data::ProSHADE_data *dataObj)
This function searches the list of peaks for presence of cyclic symmetry.
Definition: ProSHADE_symmetry.cpp:375
ProSHADE_settings::maskFileName
std::string maskFileName
The filename to which mask should be saved.
Definition: ProSHADE_settings.hpp:85
ProSHADE_settings::allDetectedOAxes
std::vector< proshade_unsign > allDetectedOAxes
The vector of all detected octahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:150
ProSHADE_internal_overlay::freeTranslationFunctionMemory
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...
Definition: ProSHADE_overlay.cpp:406
ProSHADE_internal_data::ProSHADE_data::eMatrices
proshade_complex *** eMatrices
The trace sigma and full rotation function c*conj(c) integral tables.
Definition: ProSHADE_data.hpp:127
ProSHADE_internal_data::ProSHADE_data::centreMapOnCOM
void centreMapOnCOM(ProSHADE_settings *settings)
This function shits the map so that its COM is in the centre of the map.
Definition: ProSHADE_data.cpp:1525
ProSHADE_internal_data::ProSHADE_data::getXFromPtr
proshade_signed * getXFromPtr(void)
This function allows access to the map start along the X axis.
Definition: ProSHADE_data.cpp:3938
ProSHADE_settings::verbose
proshade_signed verbose
Should the software report on the progress, or just be quiet? Value between -1 (nothing) and 4 (loud)
Definition: ProSHADE_settings.hpp:142
ProSHADE_internal_symmetry::printSymmetryGroup
void printSymmetryGroup(std::vector< proshade_unsign > grp, std::vector< proshade_double * > peaks, proshade_signed verbose)
This function simply prints the detected symmetry and all its supporting peaks.
Definition: ProSHADE_symmetry.cpp:1077
ProSHADE_internal_data::ProSHADE_data::yDimIndices
proshade_unsign yDimIndices
This is the size of the map cell y dimension in indices.
Definition: ProSHADE_data.hpp:66
ProSHADE_internal_data::ProSHADE_data::xAxisOriginOriginal
proshade_signed xAxisOriginOriginal
This is the origin position along the x axis.
Definition: ProSHADE_data.hpp:88
ProSHADE_internal_data::ProSHADE_data::yGridIndices
proshade_unsign yGridIndices
As far as I know, this is identical to the yDimIndices.
Definition: ProSHADE_data.hpp:69
ProSHADE_settings::changeMapResolutionTriLinear
bool changeMapResolutionTriLinear
Should maps be re-sampled to obtain the required resolution?
Definition: ProSHADE_settings.hpp:52
ProSHADE_internal_data::ProSHADE_data::zAxisOrigin
proshade_signed zAxisOrigin
This is the origin position along the z axis.
Definition: ProSHADE_data.hpp:76
ProSHADE_internal_misc::addToDoubleVector
void addToDoubleVector(std::vector< proshade_double > *vecToAddTo, proshade_double elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:77
ProSHADE_internal_data::ProSHADE_data::setPDBMapValues
void setPDBMapValues(void)
Function for determining iterator start and stop positions.
Definition: ProSHADE_data.cpp:937
ProSHADE_internal_data::ProSHADE_data::findMapCOM
void findMapCOM(void)
This function finds the centre of mass of the internal map representation.
Definition: ProSHADE_data.cpp:3523
ProSHADE_internal_data::ProSHADE_data::yDimIndicesOriginal
proshade_unsign yDimIndicesOriginal
This is the size of the map cell y dimension in indices.
Definition: ProSHADE_data.hpp:86
ProSHADE_internal_data::ProSHADE_data::getXDim
proshade_unsign getXDim(void)
This function allows access to the map size in indices along the X axis.
Definition: ProSHADE_data.cpp:3908
ProSHADE_internal_mapManip::removeWaters
void removeWaters(gemmi::Structure *pdbFile, bool firstModel)
This function removed all waters from PDB input file.
Definition: ProSHADE_mapManip.cpp:504
ProSHADE_settings::useBiCubicInterpolationOnPeaks
bool useBiCubicInterpolationOnPeaks
This variable switch decides whether best symmetry is detected from peak indices, or whether bicubic ...
Definition: ProSHADE_settings.hpp:132
ProSHADE_internal_data::ProSHADE_data::originalPdbTransX
proshade_double originalPdbTransX
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
Definition: ProSHADE_data.hpp:105
determinePeakThreshold
proshade_double determinePeakThreshold(std::vector< proshade_double > inArr, proshade_double noIQRsFromMedian)
This function takes a vector of values and determines the threshold for removing noise from it.
Definition: ProSHADE_symmetry.cpp:71
ProSHADE_internal_data::ProSHADE_data::zTo
proshade_signed zTo
This is the final index along the z axis.
Definition: ProSHADE_data.hpp:115
ProSHADE_internal_data::ProSHADE_data::xTo
proshade_signed xTo
This is the final index along the x axis.
Definition: ProSHADE_data.hpp:113
ProSHADE_internal_data::ProSHADE_data::writeMask
void writeMask(std::string fName, proshade_double *mask)
Function for writing out a mask in MRC MAP format.
Definition: ProSHADE_data.cpp:1151
ProSHADE_internal_data::ProSHADE_data::integrationWeight
proshade_double integrationWeight
The Pearson's c.c. type weighting for the integration.
Definition: ProSHADE_data.hpp:128
ProSHADE_settings::peakThresholdMin
proshade_double peakThresholdMin
The threshold for peak height above which axes are considered possible.
Definition: ProSHADE_settings.hpp:135
ProSHADE_internal_peakSearch::findPeaks1D
std::vector< proshade_signed > findPeaks1D(std::vector< proshade_double > data)
This function simply finds all the peaks in a 1D data array.
Definition: ProSHADE_peakSearch.cpp:1014
ProSHADE_internal_data::ProSHADE_data::xAxisOrigin
proshade_signed xAxisOrigin
This is the origin position along the x axis.
Definition: ProSHADE_data.hpp:74
ProSHADE_internal_data::ProSHADE_data::originalPdbTransY
proshade_double originalPdbTransY
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
Definition: ProSHADE_data.hpp:106
ProSHADE_internal_wigner::computeWignerMatricesForRotation
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.
Definition: ProSHADE_wignerMatrices.cpp:258
ProSHADE_internal_maths::computeFSC
proshade_double computeFSC(fftw_complex *fCoeffs1, fftw_complex *fCoeffs2, proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_signed noBins, proshade_signed *binIndexing, proshade_double **&binData, proshade_signed *&binCounts)
This function computes the FSC.
Definition: ProSHADE_maths.cpp:3086
ProSHADE_internal_data::ProSHADE_data::rrpMatrices
proshade_double *** rrpMatrices
The energy levels descriptor shell correlation tables.
Definition: ProSHADE_data.hpp:126
ProSHADE_internal_data::ProSHADE_data::yTo
proshade_signed yTo
This is the final index along the y axis.
Definition: ProSHADE_data.hpp:114
ProSHADE_settings::forceP1
bool forceP1
Should the P1 spacegroup be forced on the input PDB files?
Definition: ProSHADE_settings.hpp:44
ProSHADE_internal_data::ProSHADE_data::xDimSize
proshade_single xDimSize
This is the size of the map cell x dimension in Angstroms.
Definition: ProSHADE_data.hpp:59
ProSHADE_internal_maths::computeDotProduct
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.
Definition: ProSHADE_maths.cpp:1773
ProSHADE_internal_data::ProSHADE_data::computeRotatedSH
void computeRotatedSH(void)
This function multiplies the objects spherical harmonics with the Wigner D matrices,...
Definition: ProSHADE_overlay.cpp:1006
ProSHADE_internal_mapManip::findPDBCOMValues
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.
Definition: ProSHADE_mapManip.cpp:157
ProSHADE_internal_symmetry::findTetra3C2s
void findTetra3C2s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the 3 C2 symmetries with correct angles requir...
Definition: ProSHADE_symmetry.cpp:2071
ProSHADE_internal_data::ProSHADE_data::mapMovFromsChangeY
proshade_double mapMovFromsChangeY
When the map is translated, the yFrom and yTo values are changed. This variable holds how much they h...
Definition: ProSHADE_data.hpp:95
ProSHADE_internal_data::ProSHADE_data::yAxisOrigin
proshade_signed yAxisOrigin
This is the origin position along the y axis.
Definition: ProSHADE_data.hpp:75
ProSHADE_internal_peakSearch::getBestPeakEulerAngsNaive
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.
Definition: ProSHADE_peakSearch.cpp:352
ProSHADE_internal_misc::deepCopyAxisToDblPtrVector
void deepCopyAxisToDblPtrVector(std::vector< proshade_double * > *dblPtrVec, proshade_double *axis)
Does a deep copy of a double array to a vector of double arrays.
Definition: ProSHADE_misc.cpp:310
ProSHADE_internal_data::ProSHADE_data::yAxisOrder
proshade_unsign yAxisOrder
This is the order of the y axis.
Definition: ProSHADE_data.hpp:72
ProSHADE_internal_data::ProSHADE_data::internalMap
proshade_double * internalMap
The internal map data representation, which may be amended as the run progresses.
Definition: ProSHADE_data.hpp:56
ProSHADE_internal_data::ProSHADE_data::writePdb
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.
Definition: ProSHADE_data.cpp:1072
ProSHADE_internal_data::ProSHADE_data::zDimIndicesOriginal
proshade_unsign zDimIndicesOriginal
This is the size of the map cell z dimension in indices.
Definition: ProSHADE_data.hpp:87
ProSHADE_internal_symmetry::findOcta6C2s
void findOcta6C2s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the six C2 symmetries with correct angles requ...
Definition: ProSHADE_symmetry.cpp:2472
ProSHADE_internal_maths::complexMultiplicationConjugRealOnly
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.
Definition: ProSHADE_maths.cpp:103
ProSHADE_internal_data::ProSHADE_data::xFrom
proshade_signed xFrom
This is the starting index along the x axis.
Definition: ProSHADE_data.hpp:110
ProSHADE_internal_maths::getRotationMatrixFromAngleAxis
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.
Definition: ProSHADE_maths.cpp:1444
ProSHADE_internal_data::ProSHADE_data::writeMap
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.
Definition: ProSHADE_data.cpp:1005
ProSHADE_internal_data::ProSHADE_data::getMaxBand
proshade_unsign getMaxBand(void)
This function returns the maximum band value for the object.
Definition: ProSHADE_data.cpp:3599
ProSHADE_settings::appliedMaskFileName
std::string appliedMaskFileName
The filename from which mask data will be read from.
Definition: ProSHADE_settings.hpp:86
ProSHADE_internal_data::ProSHADE_data::invertSHCoefficients
void invertSHCoefficients(void)
This function computes the shell mapped data from inverting the Spherical Harmonics coefficients.
Definition: ProSHADE_overlay.cpp:1107
ProSHADE_internal_symmetry::detectIcosahedralSymmetry
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...
Definition: ProSHADE_symmetry.cpp:2960
ProSHADE_settings::normaliseMap
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
Definition: ProSHADE_settings.hpp:72
ProSHADE_internal_data::ProSHADE_data::writeGemmi
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...
Definition: ProSHADE_data.cpp:1109
ProSHADE_settings::addExtraSpace
proshade_single addExtraSpace
If this value is non-zero, this many angstroms of empty space will be added to the internal map.
Definition: ProSHADE_settings.hpp:102
ProSHADE_internal_data::ProSHADE_data::getYDim
proshade_unsign getYDim(void)
This function allows access to the map size in indices along the Y axis.
Definition: ProSHADE_data.cpp:3918
ProSHADE_internal_data::ProSHADE_data::maxCompBand
proshade_unsign maxCompBand
The largest comparison band - this variable tells how large arrays will be allocated for the comparis...
Definition: ProSHADE_data.hpp:132
ProSHADE_internal_data::ProSHADE_data::maskMap
void maskMap(ProSHADE_settings *settings)
Function for computing the map mask using blurring and X IQRs from median.
Definition: ProSHADE_data.cpp:1289
ProSHADE_internal_mapManip::getNonZeroBounds
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.
Definition: ProSHADE_mapManip.cpp:1082
ProSHADE_internal_data::ProSHADE_data::xCom
proshade_double xCom
The COM of the map after processing along the X-axis.
Definition: ProSHADE_data.hpp:77
ProSHADE_settings::fscThreshold
proshade_double fscThreshold
The threshold for FSC value under which the axis is considered to be likely noise.
Definition: ProSHADE_settings.hpp:134
ProSHADE_internal_data::ProSHADE_data::readInGemmi
void readInGemmi(gemmi::Structure gemmiStruct, ProSHADE_settings *settings)
Function for reading co-ordinate data from Gemmi object.
Definition: ProSHADE_data.cpp:785
ProSHADE_internal_maths::binReciprocalSpaceReflections
void binReciprocalSpaceReflections(proshade_unsign xInds, proshade_unsign yInds, proshade_unsign zInds, proshade_signed *noBin, proshade_signed *&binIndexing)
This function does binning of the reciprocal space reflections.
Definition: ProSHADE_maths.cpp:2939
ProSHADE_internal_data::ProSHADE_data::originalPdbTransZ
proshade_double originalPdbTransZ
The optimal translation vector as it relates to the original PDB positions (and not the ProSHADE inte...
Definition: ProSHADE_data.hpp:107
ProSHADE_internal_data::ProSHADE_data::getPredictedTetrahedralSymmetriesList
std::vector< proshade_double * > getPredictedTetrahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
This function predicts a list of all T symmetry axes from the already computed C symmetries list.
Definition: ProSHADE_symmetry.cpp:4253
ProSHADE_internal_io::applyMask
void applyMask(proshade_double *&map, std::string maskFile, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_signed verbose, 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.
Definition: ProSHADE_io.cpp:294
ProSHADE_internal_io::readInMapData
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.
Definition: ProSHADE_io.cpp:178
ProSHADE_internal_distances::computeEMatrices
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.
Definition: ProSHADE_distances.cpp:510
ProSHADE_internal_data::ProSHADE_data::getTranslationFnPointer
proshade_complex * getTranslationFnPointer(void)
This function allows access to the translation function through a pointer.
Definition: ProSHADE_data.cpp:4038
ProSHADE_settings::setRecommendedSymmetry
void setRecommendedSymmetry(std::string val)
Sets the ProSHADE detected symmetry type.
Definition: ProSHADE.cpp:1231
ProSHADE_internal_data::ProSHADE_data::zCom
proshade_double zCom
The COM of the map after processing along the Z-axis.
Definition: ProSHADE_data.hpp:79
ProSHADE_internal_data::ProSHADE_data::spherePos
std::vector< proshade_single > spherePos
Vector of sphere radii from the centre of the map.
Definition: ProSHADE_data.hpp:118
ProSHADE_settings::invertMap
bool invertMap
Should the map be inverted? Only use this if you think you have the wrong hand in your map.
Definition: ProSHADE_settings.hpp:75
ProSHADE_internal_maths::smoothen1D
std::vector< proshade_double > smoothen1D(proshade_double step, proshade_signed windowSize, proshade_double sigma, std::vector< proshade_double > data)
This function takes a 1D vector and computes smoothened version based on the parameters.
Definition: ProSHADE_maths.cpp:2869
ProSHADE_internal_data::ProSHADE_data::getZDim
proshade_unsign getZDim(void)
This function allows access to the map size in indices along the Z axis.
Definition: ProSHADE_data.cpp:3928
ProSHADE_internal_mapManip::removeMapPhase
void removeMapPhase(fftw_complex *&mapCoeffs, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim)
This function removes the phase from reciprocal (frequency) map.
Definition: ProSHADE_mapManip.cpp:1631
ProSHADE_settings::boundsSimilarityThreshold
proshade_signed boundsSimilarityThreshold
Number of indices which can be added just to make sure same size in indices is achieved.
Definition: ProSHADE_settings.hpp:94
ProSHADE_internal_overlay::computeAngularThreshold
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.
Definition: ProSHADE_overlay.cpp:1177
ProSHADE_internal_overlay::initialiseInverseSHComputation
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.
Definition: ProSHADE_overlay.cpp:1061
ProSHADE_internal_overlay::findHighestValueInMap
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.
Definition: ProSHADE_overlay.cpp:479
ProSHADE_settings::changeMapResolution
bool changeMapResolution
Should maps be re-sampled to obtain the required resolution?
Definition: ProSHADE_settings.hpp:51
ProSHADE_internal_io::writeRotationTranslationJSON
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.
Definition: ProSHADE_io.cpp:960
ProSHADE_internal_data::ProSHADE_data::mapMovFromsChangeZ
proshade_double mapMovFromsChangeZ
When the map is translated, the zFrom and zTo values are changed. This variable holds how much they h...
Definition: ProSHADE_data.hpp:96
axesToGroupTypeSanityCheck
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...
Definition: ProSHADE_data.cpp:3013
ProSHADE_internal_distances::computeInverseSOFTTransform
void computeInverseSOFTTransform(ProSHADE_internal_data::ProSHADE_data *obj1, ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function computes the inverse SO(3) transform.
Definition: ProSHADE_distances.cpp:854
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup
This class contains peak groups detected in the rotation function mapped spheres.
Definition: ProSHADE_spheres.hpp:129
ProSHADE_internal_symmetry::findIcos10C3s
void findIcos10C3s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the ten C3 symmetries with correct angles requ...
Definition: ProSHADE_symmetry.cpp:3438
ProSHADE_settings::overlayStructureName
std::string overlayStructureName
The filename to which the rotated and translated moving structure is to be saved.
Definition: ProSHADE_settings.hpp:138
ProSHADE_internal_maths::isAxisUnique
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.
Definition: ProSHADE_maths.cpp:2717
ProSHADE_internal_data::ProSHADE_data::getMapValue
proshade_double getMapValue(proshade_unsign pos)
This function returns the internal map representation value of a particular array position.
Definition: ProSHADE_data.cpp:3589
ProSHADE_internal_maths::getAxisAngleFromRotationMatrix
void getAxisAngleFromRotationMatrix(proshade_double *rotMat, proshade_double *x, proshade_double *y, proshade_double *z, proshade_double *ang)
This function converts rotation matrix to the axis-angle representation.
Definition: ProSHADE_maths.cpp:1124
ProSHADE_internal_data::ProSHADE_data::getYToPtr
proshade_signed * getYToPtr(void)
This function allows access to the map last position along the Y axis.
Definition: ProSHADE_data.cpp:3978
ProSHADE_settings::moveToCOM
bool moveToCOM
Logical value stating whether the structure should be moved to have its Centre Of Mass (COM) in the m...
Definition: ProSHADE_settings.hpp:99
ProSHADE_settings::peakNeighbours
proshade_unsign peakNeighbours
Number of points in any direction that have to be lower than the considered index in order to conside...
Definition: ProSHADE_settings.hpp:117
ProSHADE_internal_data::ProSHADE_data::wignerMatrices
proshade_complex *** wignerMatrices
These matrices are computed for a particular rotation to be done in spherical harmonics.
Definition: ProSHADE_data.hpp:131
ProSHADE_internal_data::ProSHADE_data::fileType
ProSHADE_internal_io::InputType fileType
This is the type of the input file.
Definition: ProSHADE_data.hpp:53
ProSHADE_internal_data::ProSHADE_data::rotateMapRealSpace
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.
Definition: ProSHADE_overlay.cpp:718
ProSHADE_internal_data::ProSHADE_data::getZAxisOrigin
proshade_signed * getZAxisOrigin(void)
This function allows access to the map Z axis origin value.
Definition: ProSHADE_data.cpp:4018
ProSHADE_internal_io::writeOutMapHeader
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.
Definition: ProSHADE_io.cpp:868
ProSHADE_settings::smoothingFactor
proshade_double smoothingFactor
This factor decides how small the group sizes should be - larger factor means more smaller groups.
Definition: ProSHADE_settings.hpp:121
ProSHADE_internal_mapManip::myRound
proshade_signed myRound(proshade_double x)
Calls the appropriate version of round function depending on compiler version.
Definition: ProSHADE_mapManip.cpp:31
ProSHADE_internal_data::ProSHADE_data::yDimSizeOriginal
proshade_single yDimSizeOriginal
This is the size of the map cell y dimension in Angstroms.
Definition: ProSHADE_data.hpp:83
ProSHADE_internal_maths::compute3x3MatrixVectorMultiplication
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.
Definition: ProSHADE_maths.cpp:1857
ProSHADE_internal_data::ProSHADE_data::zAxisOrder
proshade_unsign zAxisOrder
This is the order of the z axis.
Definition: ProSHADE_data.hpp:73
ProSHADE_internal_mapManip::beautifyBoundaries
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.
Definition: ProSHADE_mapManip.cpp:1916
ProSHADE_internal_data::ProSHADE_data::reSampleMap
void reSampleMap(ProSHADE_settings *settings)
This function changes the internal map sampling to conform to particular resolution value.
Definition: ProSHADE_data.cpp:1453
ProSHADE_internal_mapManip::rotatePDBCoordinates
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.
Definition: ProSHADE_mapManip.cpp:296
ProSHADE_internal_mapManip::generateMapFromPDB
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.
Definition: ProSHADE_mapManip.cpp:644
ProSHADE_internal_misc::checkMemoryAllocation
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.
Definition: ProSHADE_misc.hpp:67
ProSHADE_internal_data::ProSHADE_data::getXToPtr
proshade_signed * getXToPtr(void)
This function allows access to the map last position along the X axis.
Definition: ProSHADE_data.cpp:3968
ProSHADE_internal_data::ProSHADE_data::getYFromPtr
proshade_signed * getYFromPtr(void)
This function allows access to the map start along the Y axis.
Definition: ProSHADE_data.cpp:3948
ProSHADE_internal_mapManip::translatePDBCoordinates
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.
Definition: ProSHADE_mapManip.cpp:381
ProSHADE_internal_data::ProSHADE_data::mapCOMProcessChangeY
proshade_double mapCOMProcessChangeY
The change in Y axis between the creation of the structure (originalMapYCom) and just before rotation...
Definition: ProSHADE_data.hpp:98
ProSHADE_internal_data::ProSHADE_data::bAngle
proshade_single bAngle
This is the angle b of the map cell in degrees.
Definition: ProSHADE_data.hpp:63
ProSHADE_internal_maths::getEulerZXZFromSOFTPosition
void getEulerZXZFromSOFTPosition(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 (ZXZ convention) from index position in the inverse SOFT map.
Definition: ProSHADE_maths.cpp:963
ProSHADE_internal_data::ProSHADE_data::yAxisOriginOriginal
proshade_signed yAxisOriginOriginal
This is the origin position along the y axis.
Definition: ProSHADE_data.hpp:89
ProSHADE_internal_symmetry::saveDSymmetry
void saveDSymmetry(std::vector< proshade_double * > *ret, std::vector< proshade_double * > *CSymList, proshade_unsign axisOne, proshade_unsign axisTwo)
This function saves a detected dihedral symmetry to the dihedral symmetries list.
Definition: ProSHADE_symmetry.cpp:1380
ProSHADE_internal_data::ProSHADE_data::aAngle
proshade_single aAngle
This is the angle a of the map cell in degrees.
Definition: ProSHADE_data.hpp:62
ProSHADE_internal_misc::addToDoubleVectorVector
void addToDoubleVectorVector(std::vector< std::vector< proshade_double > > *vecToAddTo, std::vector< proshade_double > elementToAdd)
Adds the element to the vector of vectors.
Definition: ProSHADE_misc.cpp:233
ProSHADE_internal_data::ProSHADE_data::figureIndexStartStop
void figureIndexStartStop(void)
Function for determining iterator start and stop positions.
Definition: ProSHADE_data.cpp:983
ProSHADE_internal_data::ProSHADE_data::isEmpty
bool isEmpty
This variable stated whether the class contains any information.
Definition: ProSHADE_data.hpp:139
ProSHADE_internal_overlay::allocateTranslationFunctionMemory
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...
Definition: ProSHADE_overlay.cpp:367
ProSHADE_internal_data::ProSHADE_data::getPredictedOctahedralSymmetriesList
std::vector< proshade_double * > getPredictedOctahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
This function predicts a list of all O symmetry axes from the already computed C symmetries list.
Definition: ProSHADE_symmetry.cpp:2916
ProSHADE_internal_data::ProSHADE_data::getInvSO3Coeffs
proshade_complex * getInvSO3Coeffs(void)
This function allows access to the inverse SO(3) coefficients array.
Definition: ProSHADE_data.cpp:3826
ProSHADE_settings::allDetectedIAxes
std::vector< proshade_unsign > allDetectedIAxes
The vector of all detected icosahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:151
ProSHADE_settings::forceBounds
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
Definition: ProSHADE_settings.hpp:96
ProSHADE_settings::fourierWeightsFileName
std::string fourierWeightsFileName
The filename from which Fourier weights data will be read from.
Definition: ProSHADE_settings.hpp:89
ProSHADE_settings::detectedSymmetry
std::vector< proshade_double * > detectedSymmetry
The vector of detected symmetry axes.
Definition: ProSHADE_settings.hpp:146
ProSHADE_internal_data::ProSHADE_data::yFrom
proshade_signed yFrom
This is the starting index along the y axis.
Definition: ProSHADE_data.hpp:111
ProSHADE_settings::recommendedSymmetryFold
proshade_unsign recommendedSymmetryFold
The fold of the recommended symmetry C or D type, 0 otherwise.
Definition: ProSHADE_settings.hpp:129
ProSHADE_internal_misc::addToUnsignVector
void addToUnsignVector(std::vector< proshade_unsign > *vecToAddTo, proshade_unsign elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:99
ProSHADE_internal_symmetry::findOcta3C4s
void findOcta3C4s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the 3 C4 symmetries with perpendicular angles ...
Definition: ProSHADE_symmetry.cpp:2324
ProSHADE_internal_mapManip::reSampleMapToResolutionFourier
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.
Definition: ProSHADE_mapManip.cpp:1376
ProSHADE_internal_mapManip::copyMapByBounds
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.
Definition: ProSHADE_mapManip.cpp:2082
ProSHADE_internal_symmetry::findTetra4C3s
void findTetra4C3s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the 4 C3 symmetries with correct angles requir...
Definition: ProSHADE_symmetry.cpp:1535
ProSHADE_internal_data::ProSHADE_data::getPredictedIcosahedralSymmetriesList
std::vector< std::vector< proshade_double * > > getPredictedIcosahedralSymmetriesList(ProSHADE_settings *settings, std::vector< proshade_double * > *CSymList)
This function predicts a list of all I symmetry axes from the already computed C symmetries list.
Definition: ProSHADE_symmetry.cpp:2871
ProSHADE_internal_data::ProSHADE_data::getYAxisOrigin
proshade_signed * getYAxisOrigin(void)
This function allows access to the map Y axis origin value.
Definition: ProSHADE_data.cpp:4008
ProSHADE_internal_data::ProSHADE_data::getCyclicSymmetriesListFromAngleAxis
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...
Definition: ProSHADE_symmetry.cpp:3756
ProSHADE_internal_data::ProSHADE_data::originalPdbRotCenZ
proshade_double originalPdbRotCenZ
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
Definition: ProSHADE_data.hpp:104
ProSHADE_internal_overlay::computeTranslationsFromPeak
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...
Definition: ProSHADE_overlay.cpp:220
ProSHADE_internal_overlay::paddMapWithZeroes
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...
Definition: ProSHADE_overlay.cpp:607
ProSHADE_internal_misc::addToSingleVector
void addToSingleVector(std::vector< proshade_single > *vecToAddTo, proshade_single elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:55
ProSHADE_settings::firstModelOnly
bool firstModelOnly
Shoud only the first PDB model be used, or should all models be used?
Definition: ProSHADE_settings.hpp:46
ProSHADE_internal_overlay::combineFourierForTranslation
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...
Definition: ProSHADE_overlay.cpp:432
sortProSHADESymmetryByFSC
bool sortProSHADESymmetryByFSC(proshade_double *a, proshade_double *b)
This function allows using std::sort to sort vectors of ProSHADE symmetry format.
Definition: ProSHADE_data.cpp:1883
ProSHADE_internal_symmetry::getPeaksAngleAxisPositions
std::vector< proshade_double * > getPeaksAngleAxisPositions(std::vector< proshade_double * > allPeaks, proshade_signed verbose)
This function converts peaks ZXZ Euler anles to angle-axis representation for further processing.
Definition: ProSHADE_symmetry.cpp:263
ProSHADE_settings::axisErrTolerance
proshade_double axisErrTolerance
Allowed error on vector axis in in dot product ( acos ( 1 - axErr ) is the allowed difference in radi...
Definition: ProSHADE_settings.hpp:125
ProSHADE_settings::useSameBounds
bool useSameBounds
Switch to say that the same boundaries as used for the first should be used for all input maps.
Definition: ProSHADE_settings.hpp:95
ProSHADE_internal_data::ProSHADE_data::zDimIndices
proshade_unsign zDimIndices
This is the size of the map cell z dimension in indices.
Definition: ProSHADE_data.hpp:67
ProSHADE_internal_data::computeGroupElementsForGroup
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 ...
Definition: ProSHADE_data.cpp:2949
ProSHADE_settings::pdbBFactorNewVal
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
Definition: ProSHADE_settings.hpp:55
ProSHADE_internal_spheres::ProSHADE_sphere::allocateRotatedMap
void allocateRotatedMap(void)
This function allocates the rotated map memory.
Definition: ProSHADE_spheres.cpp:596
ProSHADE_internal_data::ProSHADE_data::zGridIndices
proshade_unsign zGridIndices
As far as I know, this is identical to the zDimIndices.
Definition: ProSHADE_data.hpp:70
ProSHADE_settings::setRecommendedFold
void setRecommendedFold(proshade_unsign val)
Sets the ProSHADE detected symmetry fold.
Definition: ProSHADE.cpp:1254
ProSHADE_internal_distances::generateSO3CoeffsFromEMatrices
void generateSO3CoeffsFromEMatrices(ProSHADE_internal_data::ProSHADE_data *obj1, ProSHADE_internal_data::ProSHADE_data *obj2, ProSHADE_settings *settings)
This function converts the E matrices to SO(3) coefficients.
Definition: ProSHADE_distances.cpp:701
ProSHADE_internal_io::applyWeights
void applyWeights(proshade_double *&map, std::string weightsFile, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_signed verbose, 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.
Definition: ProSHADE_io.cpp:563
ProSHADE_settings::setVariablesLeftOnAuto
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
Definition: ProSHADE.cpp:337
ProSHADE_internal_symmetry::findIcos6C5s
void findIcos6C5s(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, ProSHADE_internal_data::ProSHADE_data *dataObj, proshade_signed verbose, proshade_double minPeakHeight)
This function takes the list of C symmetries and finds the six C5 symmetries with given angles requir...
Definition: ProSHADE_symmetry.cpp:3020
ProSHADE_settings::removeWaters
bool removeWaters
Should all waters be removed from input PDB files?
Definition: ProSHADE_settings.hpp:45
ProSHADE_internal_data::ProSHADE_data::spheres
ProSHADE_internal_spheres::ProSHADE_sphere ** spheres
The set of concentric spheres to which the intermal density map has been projected.
Definition: ProSHADE_data.hpp:120
ProSHADE_internal_data::ProSHADE_data::normaliseMap
void normaliseMap(ProSHADE_settings *settings)
Function for normalising the map values to mean 0 and sd 1..
Definition: ProSHADE_data.cpp:1242
ProSHADE_internal_data::ProSHADE_data::findRequestedCSymmetryFromAngleAxis
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...
Definition: ProSHADE_symmetry.cpp:3895
ProSHADE_internal_maths::findAllPrimes
std::vector< proshade_unsign > findAllPrimes(proshade_unsign upTo)
This function finds all prime numbers up to the supplied limit.
Definition: ProSHADE_maths.cpp:2798
ProSHADE_internal_data::ProSHADE_data::originalPdbRotCenX
proshade_double originalPdbRotCenX
The centre of rotation as it relates to the original PDB positions (and not the ProSHADE internal map...
Definition: ProSHADE_data.hpp:102
ProSHADE_internal_data::ProSHADE_data::originalMapZCom
proshade_double originalMapZCom
The COM of the first map to be loaded/computed without any furhter changes being reflacted along the ...
Definition: ProSHADE_data.hpp:93
ProSHADE_internal_messages::printProgressMessage
void printProgressMessage(proshade_signed verbose, proshade_signed messageLevel, std::string message)
General stdout message printing.
Definition: ProSHADE_messages.cpp:70
ProSHADE_internal_data::ProSHADE_data::yDimSize
proshade_single yDimSize
This is the size of the map cell y dimension in Angstroms.
Definition: ProSHADE_data.hpp:60
ProSHADE_settings::setResolution
void setResolution(proshade_single resolution)
Sets the requested resolution in the appropriate variable.
Definition: ProSHADE.cpp:383
ProSHADE_settings::allDetectedCAxes
std::vector< std::vector< proshade_double > > allDetectedCAxes
The vector of all detected cyclic symmetry axes.
Definition: ProSHADE_settings.hpp:147
ProSHADE_internal_data::ProSHADE_data::removePhaseInormation
void removePhaseInormation(ProSHADE_settings *settings)
This function removes phase from the map, effectively converting it to Patterson map.
Definition: ProSHADE_data.cpp:3645
ProSHADE_internal_mapManip::moveMapByIndices
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.
Definition: ProSHADE_mapManip.cpp:763
ProSHADE_internal_io::readInMapHeader
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.
Definition: ProSHADE_io.cpp:109
ProSHADE_internal_symmetry::predictIcosAxes
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...
Definition: ProSHADE_symmetry.cpp:3142
ProSHADE_internal_data::ProSHADE_data::addExtraSpace
void addExtraSpace(ProSHADE_settings *settings)
This function increases the size of the map so that it can add empty space around it.
Definition: ProSHADE_data.cpp:1590
ProSHADE_internal_symmetry::detectTetrahedralSymmetry
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...
Definition: ProSHADE_symmetry.cpp:1485
ProSHADE_internal_misc::sortSymHlpInv
bool sortSymHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of two based on the fifth number, sorting highest first.
Definition: ProSHADE_misc.cpp:266
ProSHADE_internal_misc::addToStringVector
void addToStringVector(std::vector< std::string > *vecToAddTo, std::string elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:33
ProSHADE_internal_sphericalHarmonics::computeSphericalHarmonics
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.
Definition: ProSHADE_sphericalHarmonics.cpp:394
ProSHADE_internal_data::ProSHADE_data::readInPDB
void readInPDB(ProSHADE_settings *settings)
Function for reading pdb data.
Definition: ProSHADE_data.cpp:750
ProSHADE_internal_spheres::ProSHADE_sphere::setRotatedMappedData
void setRotatedMappedData(proshade_unsign pos, proshade_double value)
This function sets the rotated mapped data value to the given position.
Definition: ProSHADE_spheres.cpp:613
ProSHADE_internal_data::ProSHADE_data::getZFromPtr
proshade_signed * getZFromPtr(void)
This function allows access to the map start along the Z axis.
Definition: ProSHADE_data.cpp:3958
ProSHADE_internal_data::ProSHADE_data::getZToPtr
proshade_signed * getZToPtr(void)
This function allows access to the map last position along the Z axis.
Definition: ProSHADE_data.cpp:3988