ProSHADE  0.7.5.4 (MAR 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 (ProSHADE_settings *settings)
 Constructor for getting empty ProSHADE_data class. More...
 
 ProSHADE_data (ProSHADE_settings *settings, 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)
 This function initialises the basic ProSHADE_data variables and reads in a single structure. 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, bool firstModel=true)
 This function writes out the PDB formatted file coresponding to the structure so that its COM is at specific position. 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_settings *settings, 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 (ProSHADE_settings *settings)
 This function allocates the memory for the Wigner matrices for the calling object. More...
 
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< 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 detectSymmetryInStructure (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 and saves the results in the settings object. More...
 
void detectSymmetryInStructurePython (ProSHADE_settings *settings)
 This function runs the symmetry detection algorithms on this structure saving the axes in the settings object only. 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 findBestCScore (std::vector< proshade_double * > *CSym, proshade_unsign *symInd)
 This function locates the best scoring C symmetry axis, returning the score and best symmetry index. More...
 
proshade_double findBestDScore (std::vector< proshade_double * > *DSym, proshade_unsign *symInd)
 This function locates the best scoring D symmetry axis, returning the score and best symmetry index. More...
 
proshade_double findTScore (std::vector< proshade_double * > *TSym)
 This function takes the list of tetrahedral axes and returns a score for deciding whether T symmetry should be recommended. More...
 
proshade_double findOScore (std::vector< proshade_double * > *OSym)
 This function takes the list of octahedral axes and returns a score for deciding whether O symmetry should be recommended. More...
 
proshade_double findIScore (std::vector< proshade_double * > *ISym)
 This function takes the list of icosahedral axes and returns a score for deciding whether I symmetry should be recommended. 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)
 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)
 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, proshade_double eulA, proshade_double eulB, proshade_double eulG)
 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 rotateMap (ProSHADE_settings *settings, proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma)
 This function rotates a map based on the given Euler angles. More...
 
void translateMap (ProSHADE_settings *settings, 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 (ProSHADE_settings *settings)
 This function allocates the memory required for storing the rotated Spherical Harmonics coefficients. More...
 
void computeRotatedSH (ProSHADE_settings *settings)
 This function multiplies the objects spherical harmonics with the Wigner D matrices, obtaining rotated spherical harmonics coefficients. More...
 
void invertSHCoefficients (void)
 This function computes the shell mapped data from inverting the Spherical Harmonics coefficients. More...
 
void interpolateMapFromSpheres (ProSHADE_settings *settings, 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 computePdbRotationCentre (void)
 This function computes the optimal rotation centre for co-ordinates. More...
 
void computeOptimalTranslation (proshade_double eulA, proshade_double eulB, proshade_double eulG, proshade_double trsX, proshade_double trsY, proshade_double trsZ)
 This function computes and saves the optimal translation vector from the already determined translation function results. 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_unsign 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_double 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...
 
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)
 Function for reading map data using gemmi library. More...
 
void readInPDB (ProSHADE_settings *settings)
 Function for reading pdb data. More...
 
void allocateRRPMemory (ProSHADE_settings *settings)
 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 ( ProSHADE_settings settings)

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

40 {
41  //================================================ Initialise variables
42  // ... Variables regarding input file
43  this->fileName = "";
44  this->fileType = ProSHADE_internal_io::UNKNOWN;
45 
46  // ... Variables regarding map
47  this->internalMap = NULL;
48 
49  // ... Variables regarding map information
50  this->xDimSize = 0.0;
51  this->yDimSize = 0.0;
52  this->zDimSize = 0.0;
53  this->aAngle = 0.0;
54  this->bAngle = 0.0;
55  this->cAngle = 0.0;
56  this->xDimIndices = 0;
57  this->yDimIndices = 0;
58  this->zDimIndices = 0;
59  this->xGridIndices = 0;
60  this->yGridIndices = 0;
61  this->zGridIndices = 0;
62  this->xAxisOrder = 1;
63  this->yAxisOrder = 2;
64  this->zAxisOrder = 3;
65  this->xAxisOrigin = 0;
66  this->yAxisOrigin = 0;
67  this->zAxisOrigin = 0;
68  this->xCom = 0.0;
69  this->yCom = 0.0;
70  this->zCom = 0.0;
71 
72  // ... Variables regarding original input values (i.e. these do not change with ProSHADE manipulations)
73  this->xDimSizeOriginal = 0.0;
74  this->yDimSizeOriginal = 0.0;
75  this->zDimSizeOriginal = 0.0;
76  this->xDimIndicesOriginal = 0;
77  this->yDimIndicesOriginal = 0;
78  this->zDimIndicesOriginal = 0;
79  this->xAxisOriginOriginal = 0;
80  this->yAxisOriginOriginal = 0;
81  this->zAxisOriginOriginal = 0;
82  this->originalMapXCom = 0.0;
83  this->originalMapYCom = 0.0;
84  this->originalMapZCom = 0.0;
85  this->mapMovFromsChangeX = 0.0;
86  this->mapMovFromsChangeY = 0.0;
87  this->mapMovFromsChangeZ = 0.0;
88  this->mapCOMProcessChangeX = 0.0;
89  this->mapCOMProcessChangeY = 0.0;
90  this->mapCOMProcessChangeZ = 0.0;
91 
92  // ... Variables regarding rotation and translation of original input files
93  this->originalPdbRotCenX = 0.0;
94  this->originalPdbRotCenY = 0.0;
95  this->originalPdbRotCenZ = 0.0;
96  this->originalPdbTransX = 0.0;
97  this->originalPdbTransY = 0.0;
98  this->originalPdbTransZ = 0.0;
99 
100  // ... Variables regarding iterator positions
101  this->xFrom = 0;
102  this->yFrom = 0;
103  this->zFrom = 0;
104  this->xTo = 0;
105  this->yTo = 0;
106  this->zTo = 0;
107 
108  // ... Variables regarding SH mapping spheres
109  this->spherePos = std::vector<proshade_single> ( );
110  this->noSpheres = 0;
111  this->spheres = NULL;
112  this->sphericalHarmonics = NULL;
113  this->rotSphericalHarmonics = NULL;
114  this->maxShellBand = 0;
115 
116  // ... Variables regarding shape distance computations
117  this->rrpMatrices = NULL;
118  this->eMatrices = NULL;
119  this->so3Coeffs = NULL;
120  this->so3CoeffsInverse = NULL;
121  this->wignerMatrices = NULL;
122  this->integrationWeight = 0.0;
123  this->maxCompBand = 0;
124  this->translationMap = NULL;
125 
126 
127  // ... Control variables
128  this->isEmpty = true;
129 
130  //================================================ Done
131 
132 }

◆ ProSHADE_data() [2/2]

ProSHADE_internal_data::ProSHADE_data::ProSHADE_data ( ProSHADE_settings settings,
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 160 of file ProSHADE_data.cpp.

161 {
162  //================================================ Initialise variables
163  // ... Variables regarding input file
164  this->fileName = strName;
165  this->fileType = ProSHADE_internal_io::MAP;
166 
167  // ... Variables regarding map
168  this->internalMap = NULL;
169 
170  // ... Variables regarding map information
171  this->xDimSize = xDmSz;
172  this->yDimSize = yDmSz;
173  this->zDimSize = zDmSz;
174  this->aAngle = 90.0;
175  this->bAngle = 90.0;
176  this->cAngle = 90.0;
177  this->xDimIndices = xDmInd;
178  this->yDimIndices = yDmInd;
179  this->zDimIndices = zDmInd;
180  this->xGridIndices = xDmInd;
181  this->yGridIndices = yDmInd;
182  this->zGridIndices = zDmInd;
183  this->xAxisOrder = 1;
184  this->yAxisOrder = 2;
185  this->zAxisOrder = 3;
186  this->xAxisOrigin = xFr;
187  this->yAxisOrigin = yFr;
188  this->zAxisOrigin = zFr;
189  this->xCom = 0.0;
190  this->yCom = 0.0;
191  this->zCom = 0.0;
192 
193  // ... Variables regarding original input values (i.e. these do not change with ProSHADE manipulations)
194  this->xDimSizeOriginal = 0.0;
195  this->yDimSizeOriginal = 0.0;
196  this->zDimSizeOriginal = 0.0;
197  this->xDimIndicesOriginal = 0;
198  this->yDimIndicesOriginal = 0;
199  this->zDimIndicesOriginal = 0;
200  this->xAxisOriginOriginal = 0;
201  this->yAxisOriginOriginal = 0;
202  this->zAxisOriginOriginal = 0;
203  this->originalMapXCom = 0.0;
204  this->originalMapYCom = 0.0;
205  this->originalMapZCom = 0.0;
206  this->mapMovFromsChangeX = 0.0;
207  this->mapMovFromsChangeY = 0.0;
208  this->mapMovFromsChangeZ = 0.0;
209  this->mapCOMProcessChangeX = 0.0;
210  this->mapCOMProcessChangeY = 0.0;
211  this->mapCOMProcessChangeZ = 0.0;
212 
213  // ... Variables regarding rotation and translation of original input files
214  this->originalPdbRotCenX = 0.0;
215  this->originalPdbRotCenY = 0.0;
216  this->originalPdbRotCenZ = 0.0;
217  this->originalPdbTransX = 0.0;
218  this->originalPdbTransY = 0.0;
219  this->originalPdbTransZ = 0.0;
220 
221  // ... Variables regarding iterator positions
222  this->xFrom = xFr;
223  this->yFrom = yFr;
224  this->zFrom = zFr;
225  this->xTo = xT;
226  this->yTo = yT;
227  this->zTo = zT;
228 
229  // ... Variables regarding SH mapping spheres
230  this->spherePos = std::vector<proshade_single> ( );
231  this->noSpheres = 0;
232  this->spheres = NULL;
233  this->sphericalHarmonics = NULL;
234  this->rotSphericalHarmonics = NULL;
235  this->maxShellBand = 0;
236 
237  // ... Variables regarding shape distance computations
238  this->rrpMatrices = NULL;
239  this->eMatrices = NULL;
240  this->so3Coeffs = NULL;
241  this->so3CoeffsInverse = NULL;
242  this->wignerMatrices = NULL;
243  this->integrationWeight = 0.0;
244  this->maxCompBand = 0;
245  this->translationMap = NULL;
246 
247  // ... Control variables
248  this->isEmpty = false;
249  this->inputOrder = inputO;
250 
251  //================================================ Sanity checks
252  if ( static_cast<proshade_unsign> ( len ) != ( xDmInd * yDmInd * zDmInd ) )
253  {
254  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." );
255  }
256 
257  if ( ( static_cast<proshade_signed> ( xT - xFr ) != static_cast<proshade_signed> ( xDmInd - 1 ) ) ||
258  ( static_cast<proshade_signed> ( yT - yFr ) != static_cast<proshade_signed> ( yDmInd - 1 ) ) ||
259  ( static_cast<proshade_signed> ( zT - zFr ) != static_cast<proshade_signed> ( zDmInd - 1 ) ) )
260  {
261  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." );
262  }
263 
264  //================================================ Allocate the map memory
265  this->internalMap = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
266  ProSHADE_internal_misc::checkMemoryAllocation ( this->internalMap, __FILE__, __LINE__, __func__ );
267 
268  //================================================ Copy the values into the map
269  proshade_unsign arrPos = 0;
270  for ( proshade_unsign xIt = 0; xIt < this->xDimIndices; xIt++ )
271  {
272  for ( proshade_unsign yIt = 0; yIt < this->yDimIndices; yIt++ )
273  {
274  for ( proshade_unsign zIt = 0; zIt < this->zDimIndices; zIt++ )
275  {
276  arrPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
277  this->internalMap[arrPos] = static_cast<proshade_double> ( mapVals[arrPos] );
278  }
279  }
280  }
281 
282  //================================================ Release memory (it was allocated by the PyBind11 lambda function and needs to be released)
283  delete[] mapVals;
284 
285  //================================================ Done
286 
287 }

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

296 {
297  //================================================ Release the internal map
298  if ( this->internalMap != NULL )
299  {
300  delete[] this->internalMap;
301  }
302 
303  //================================================ Release the sphere mapping
304  if ( this->spheres != NULL )
305  {
306  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
307  {
308  if ( this->spheres[iter] != NULL )
309  {
310  delete this->spheres[iter];
311  this->spheres[iter] = NULL;
312  }
313  }
314  delete[] this->spheres;
315  }
316 
317  //================================================ Release the spherical harmonics
318  if ( this->sphericalHarmonics != NULL )
319  {
320  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
321  {
322  if ( this->sphericalHarmonics[iter] != NULL )
323  {
324  delete[] this->sphericalHarmonics[iter];
325  this->sphericalHarmonics[iter] = NULL;
326  }
327  }
328  delete[] this->sphericalHarmonics;
329  }
330 
331  //================================================ Release the rotated spherical harmonics
332  if ( this->rotSphericalHarmonics != NULL )
333  {
334  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
335  {
336  if ( this->rotSphericalHarmonics[iter] != NULL )
337  {
338  delete[] this->rotSphericalHarmonics[iter];
339  this->rotSphericalHarmonics[iter] = NULL;
340  }
341  }
342  delete[] this->rotSphericalHarmonics;
343  }
344 
345  //================================================ Release the RRP matrices (pre-computation for the energy levels descriptor)
346  if ( this->rrpMatrices != NULL )
347  {
348  for ( proshade_unsign bwIt = 0; bwIt < this->maxShellBand; bwIt++ )
349  {
350  if ( this->rrpMatrices[bwIt] != NULL )
351  {
352  for ( proshade_unsign shIt = 0; shIt < this->noSpheres; shIt++ )
353  {
354  if ( this->rrpMatrices[bwIt][shIt] != NULL )
355  {
356  delete[] this->rrpMatrices[bwIt][shIt];
357  }
358  }
359 
360  delete[] this->rrpMatrices[bwIt];
361  }
362  }
363 
364  delete[] this->rrpMatrices;
365  }
366 
367  //================================================ Release the E matrices
368  if ( this->eMatrices != NULL )
369  {
370  for ( proshade_unsign bandIter = 0; bandIter < this->maxCompBand; bandIter++ )
371  {
372  if ( this->eMatrices[bandIter] != NULL )
373  {
374  for ( proshade_unsign band2Iter = 0; band2Iter < static_cast<proshade_unsign> ( ( bandIter * 2 ) + 1 ); band2Iter++ )
375  {
376  if ( this->eMatrices[bandIter][band2Iter] != NULL )
377  {
378  delete[] this->eMatrices[bandIter][band2Iter];
379  }
380  }
381 
382  delete[] this->eMatrices[bandIter];
383  }
384  }
385 
386  delete[] this->eMatrices;
387  }
388 
389  //================================================ Release SOFT and inverse SOFT coefficients
390  if ( this->so3Coeffs != NULL )
391  {
392  delete[] this->so3Coeffs;
393  }
394  if ( this->so3CoeffsInverse != NULL )
395  {
396  delete[] this->so3CoeffsInverse;
397  }
398 
399  //================================================ Release Wigner matrices
400  if ( this->wignerMatrices != NULL )
401  {
402  for ( proshade_unsign bandIter = 1; bandIter < this->maxCompBand; bandIter++ )
403  {
404  if ( this->wignerMatrices[bandIter] != NULL )
405  {
406  for ( proshade_unsign order1Iter = 0; order1Iter < ( (bandIter * 2) + 1 ); order1Iter++ )
407  {
408  if ( this->wignerMatrices[bandIter][order1Iter] != NULL )
409  {
410  delete[] this->wignerMatrices[bandIter][order1Iter];
411  }
412  }
413  delete[] this->wignerMatrices[bandIter];
414  }
415  }
416  delete[] wignerMatrices;
417  }
418 
419  //================================================ Release translation map
420  if ( this->translationMap != NULL )
421  {
422  delete[] this->translationMap;
423  }
424 
425  //================================================ Release the angle-axis space rotation function
426  if ( this->sphereMappedRotFun.size() > 0 )
427  {
428  for ( proshade_unsign spIt = 0; spIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); spIt++ )
429  {
430  delete this->sphereMappedRotFun.at(spIt);
431  }
432  }
433 
434  //================================================ Done
435 
436 }

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

1356 {
1357  //================================================ Report function start
1358  std::stringstream hlpSS;
1359  hlpSS << "Adding extra " << settings->addExtraSpace << " angstroms.";
1360  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1361 
1362  //================================================ Figure how much indices need to change
1363  proshade_unsign xAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->xDimSize / this->xDimIndices ) );
1364  proshade_unsign yAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->yDimSize / this->yDimIndices ) );
1365  proshade_unsign zAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->zDimSize / this->zDimIndices ) );
1366 
1367  //================================================ Update internal data variables
1368  this->xDimSize += static_cast<proshade_single> ( 2 * xAddIndices ) * static_cast<proshade_single> ( this->xDimSize / this->xDimIndices );
1369  this->yDimSize += static_cast<proshade_single> ( 2 * yAddIndices ) * static_cast<proshade_single> ( this->yDimSize / this->yDimIndices );
1370  this->zDimSize += static_cast<proshade_single> ( 2 * zAddIndices ) * static_cast<proshade_single> ( this->zDimSize / this->zDimIndices );
1371 
1372  this->xDimIndices += 2 * xAddIndices;
1373  this->yDimIndices += 2 * yAddIndices;
1374  this->zDimIndices += 2 * zAddIndices;
1375 
1376  this->xGridIndices = this->xDimIndices;
1377  this->yGridIndices = this->yDimIndices;
1378  this->zGridIndices = this->zDimIndices;
1379 
1380  this->xAxisOrigin -= xAddIndices;
1381  this->yAxisOrigin -= yAddIndices;
1382  this->zAxisOrigin -= zAddIndices;
1383 
1384  this->xFrom -= xAddIndices;
1385  this->yFrom -= yAddIndices;
1386  this->zFrom -= zAddIndices;
1387 
1388  this->xTo += xAddIndices;
1389  this->yTo += yAddIndices;
1390  this->zTo += zAddIndices;
1391 
1392  //================================================ Allocate new map
1393  proshade_double* newMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1394  ProSHADE_internal_misc::checkMemoryAllocation ( newMap, __FILE__, __LINE__, __func__ );
1395 
1396  //================================================ Set new map to zeroes
1397  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1398  {
1399  newMap[iter] = 0.0;
1400  }
1401 
1402  //================================================ Update the map
1403  proshade_unsign newMapIndex, oldMapIndex;
1404  for ( proshade_unsign xIt = 0; xIt < (this->xDimIndices - xAddIndices); xIt++ )
1405  {
1406  //============================================ Check if point is applicable
1407  if ( xIt < xAddIndices ) { continue; }
1408 
1409  for ( proshade_unsign yIt = 0; yIt < (this->yDimIndices - yAddIndices); yIt++ )
1410  {
1411  //======================================== Check if point is applicable
1412  if ( yIt < yAddIndices ) { continue; }
1413 
1414  for ( proshade_unsign zIt = 0; zIt < (this->zDimIndices - zAddIndices); zIt++ )
1415  {
1416  //==================================== Check if point is applicable
1417  if ( zIt < zAddIndices ) { continue; }
1418 
1419  //==================================== Var init
1420  newMapIndex = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
1421  oldMapIndex = (zIt - zAddIndices) + (this->zDimIndices - ( 2 * zAddIndices ) ) * ( (yIt - yAddIndices) + (this->yDimIndices - ( 2 * yAddIndices ) ) * (xIt - xAddIndices) );
1422 
1423  newMap[newMapIndex] = this->internalMap[oldMapIndex];
1424  }
1425  }
1426  }
1427 
1428  //================================================ Copy new to old
1429  delete[] this->internalMap;
1430 
1431  this->internalMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1432  ProSHADE_internal_misc::checkMemoryAllocation ( this->internalMap, __FILE__, __LINE__, __func__ );
1433 
1434  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1435  {
1436  this->internalMap[iter] = newMap[iter];
1437  }
1438 
1439  //================================================ Release memory
1440  delete[] newMap;
1441 
1442  //================================================ Report function completion
1443  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Extra space added." );
1444 
1445  //================================================ Done
1446  return ;
1447 
1448 }

◆ allocateEMatrices()

void ProSHADE_internal_data::ProSHADE_data::allocateEMatrices ( ProSHADE_settings settings,
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]settingsA pointer to settings class containing all the information required for the task.
[in]bandThe minimal band of the comparison for which E matrices are computed.

Definition at line 280 of file ProSHADE_distances.cpp.

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

◆ allocateRotatedSHMemory()

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

This function allocates the memory required for storing the rotated Spherical Harmonics coefficients.

Parameters
[in]settingsThe settings object specifying how exactly the rotation is to be done.

Definition at line 818 of file ProSHADE_overlay.cpp.

819 {
820  //================================================ Allocate the main pointer and check
821  this->rotSphericalHarmonics = new proshade_complex* [this->noSpheres];
822  ProSHADE_internal_misc::checkMemoryAllocation ( this->rotSphericalHarmonics, __FILE__, __LINE__, __func__ );
823 
824  //================================================ For each sphere
825  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
826  {
827  //============================================ Allocate the sphere storage space
828  this->rotSphericalHarmonics[iter] = new proshade_complex [static_cast<proshade_unsign> ( pow ( (this->spheres[iter]->getLocalBandwidth() * 2), 2) )];
829  ProSHADE_internal_misc::checkMemoryAllocation ( this->rotSphericalHarmonics[iter], __FILE__, __LINE__, __func__ );
830 
831  //============================================ Set values to zeroes
832  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( pow ( (this->spheres[iter]->getLocalBandwidth() * 2), 2) ); it++ )
833  {
834  this->rotSphericalHarmonics[iter][it][0] = 0.0;
835  this->rotSphericalHarmonics[iter][it][1] = 0.0;
836  }
837  }
838 
839  //================================================ Done
840  return ;
841 
842 }

◆ allocateRRPMemory()

void ProSHADE_internal_data::ProSHADE_data::allocateRRPMemory ( ProSHADE_settings settings)
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.

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

Definition at line 33 of file ProSHADE_distances.cpp.

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

◆ 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 680 of file ProSHADE_distances.cpp.

681 {
682  //================================================ Allocate the memory
683  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 )];
684  this->so3CoeffsInverse = new fftw_complex [static_cast<proshade_unsign>( pow( static_cast<proshade_double> ( band ) * 2.0, 3.0 ) )];
685 
686  //================================================ Check memory allocation
687  ProSHADE_internal_misc::checkMemoryAllocation ( this->so3Coeffs, __FILE__, __LINE__, __func__ );
688  ProSHADE_internal_misc::checkMemoryAllocation ( this->so3CoeffsInverse, __FILE__, __LINE__, __func__ );
689 
690  //================================================ Done
691  return ;
692 
693 }

◆ allocateWignerMatricesSpace()

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

This function allocates the memory for the Wigner matrices for the calling object.

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

Definition at line 29 of file ProSHADE_wignerMatrices.cpp.

30 {
31  //================================================ Sanity check
32  if ( this->maxCompBand == 0 )
33  {
34  throw ProSHADE_exception ( "Attempted allocating Wigner D matrices before\n : allocating E matrices memory.", "EW00024", __FILE__, __LINE__, __func__, "The E matrices and Wigner matrices both require to know\n : the bandwidth of the comparison (which may differ from the\n : object bandwidth). This is set when allocating E matrices\n : and therefore if it is 0 now, E matrices were not yet\n : allocated." );
35  }
36 
37  //================================================ Allocate bands
38  this->wignerMatrices = new proshade_complex** [this->maxCompBand];
39  ProSHADE_internal_misc::checkMemoryAllocation ( this->wignerMatrices, __FILE__, __LINE__, __func__ );
40 
41  //================================================ Allocate the arrays
42  for ( proshade_unsign bandIter = 0; bandIter < this->maxCompBand; bandIter++ )
43  {
44  //============================================ Allocate order 1
45  this->wignerMatrices[bandIter] = new proshade_complex* [(bandIter * 2) + 1];
46  ProSHADE_internal_misc::checkMemoryAllocation ( this->wignerMatrices[bandIter], __FILE__, __LINE__, __func__ );
47 
48  //============================================ Allocate order 2
49  for ( proshade_unsign order1Iter = 0; order1Iter < ( (bandIter * 2) + 1 ); order1Iter++ )
50  {
51  this->wignerMatrices[bandIter][order1Iter] = new proshade_complex [(bandIter * 2) + 1];
52  ProSHADE_internal_misc::checkMemoryAllocation ( this->wignerMatrices[bandIter], __FILE__, __LINE__, __func__ );
53  }
54  }
55 
56  //================================================ Done
57  return ;
58 
59 }

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

1295 {
1296  //================================================ Report function start
1297  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
1298 
1299  //================================================ Initialise local variables
1300  proshade_unsign arrPos = 0;
1301  proshade_single xCOM = 0.0;
1302  proshade_single yCOM = 0.0;
1303  proshade_single zCOM = 0.0;
1304  proshade_single totDens = 0.0;
1305 
1306  //================================================ Find the COM location
1307  for ( proshade_unsign xIt = 0; xIt < this->xDimIndices; xIt++ )
1308  {
1309  for ( proshade_unsign yIt = 0; yIt < this->yDimIndices; yIt++ )
1310  {
1311  for ( proshade_unsign zIt = 0; zIt < this->zDimIndices; zIt++ )
1312  {
1313  //==================================== Get index
1314  arrPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
1315 
1316  //==================================== Get COM
1317  if ( this->internalMap[arrPos] > 0.0 )
1318  {
1319  xCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * xIt );
1320  yCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * yIt );
1321  zCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * zIt );
1322  totDens += static_cast<proshade_single> ( this->internalMap[arrPos] );
1323  }
1324  }
1325  }
1326  }
1327  xCOM /= totDens;
1328  yCOM /= totDens;
1329  zCOM /= totDens;
1330 
1331  //================================================ Find distance from COM to map centre in Angstroms
1332  proshade_single xDist = ( static_cast<proshade_single> ( this->xDimIndices / 2.0 ) - xCOM ) * static_cast<proshade_single> ( this->xDimSize / this->xDimIndices );
1333  proshade_single yDist = ( static_cast<proshade_single> ( this->yDimIndices / 2.0 ) - yCOM ) * static_cast<proshade_single> ( this->yDimSize / this->yDimIndices );
1334  proshade_single zDist = ( static_cast<proshade_single> ( this->zDimIndices / 2.0 ) - zCOM ) * static_cast<proshade_single> ( this->zDimSize / this->zDimIndices );
1335 
1336  //================================================ Move the map within the box
1337  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xDist, yDist, zDist, this->xDimSize, this->yDimSize, this->zDimSize, this->xDimIndices, this->yDimIndices, this->zDimIndices );
1338 
1339  //================================================ Report function completion
1340  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map centered." );
1341 
1342  //================================================ Done
1343  return ;
1344 
1345 }

◆ computeOptimalTranslation()

void ProSHADE_internal_data::ProSHADE_data::computeOptimalTranslation ( proshade_double  eulA,
proshade_double  eulB,
proshade_double  eulG,
proshade_double  trsX,
proshade_double  trsY,
proshade_double  trsZ 
)

This function computes and saves the optimal translation vector from the already determined translation function results.

This function simply saves the determined optimal translation to the appropriate variable and does a simple modification to take into account any modifications that ProSHADE may have done to the internal map.

Parameters
[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]transXThe translation to be done along the X-axis in Angstroms.
[in]transYThe translation to be done along the Y-axis in Angstroms.
[in]transZThe translation to be done along the Z-axis in Angstroms.
Warning
This function will be called automatically by the getOptimalTranslation() function, so unless directAccess is being used, the user should not need to use this function.

Definition at line 109 of file ProSHADE_overlay.cpp.

110 {
111  //================================================ Reset class variables
112  this->originalPdbTransX = 0.0;
113  this->originalPdbTransY = 0.0;
114  this->originalPdbTransZ = 0.0;
115 
116  //================================================ Correctly apply any map modifications that ProSHADE may have done to the map to make sure map matches co-ordinates.
117  if ( ( eulA != 0.0 ) || ( eulB != 0.0 ) || ( eulG != 0.0 ) )
118  {
119  //============================================ If rotation is to be done, then ProSHADE processing map changes are already dealt with
120  ;
121  }
122  else
123  {
124  //============================================ In not, then they need to be added
128  }
129 
130  //================================================ Save the values
131  this->originalPdbTransX += trsX;
132  this->originalPdbTransY += trsY;
133  this->originalPdbTransZ += trsZ;
134 
135  //================================================ Done
136  return ;
137 
138 }

◆ computePdbRotationCentre()

void ProSHADE_internal_data::ProSHADE_data::computePdbRotationCentre ( void  )

This function computes the optimal rotation centre for co-ordinates.

This function computes the "visualisation world" (or co-ordinates space) position of the point about which the map was rotated, taking into account the internal ProSHADE map manipulations and other factors. By rotating the co-ordinates about this point, their position and orientation will be the same as the map position before translation function is computed.

Warning
This function will be called automatically by the getOptimalTranslation() function, so unless directAccess is being used, the user should not need to use this function.

Definition at line 68 of file ProSHADE_overlay.cpp.

69 {
70  //================================================ First. determine the sampling rates (value to multiply indices with to get Angstroms)
71  proshade_double xSamplRate = ( this->xDimSizeOriginal / static_cast<proshade_double> ( this->xDimIndicesOriginal ) );
72  proshade_double ySamplRate = ( this->yDimSizeOriginal / static_cast<proshade_double> ( this->yDimIndicesOriginal ) );
73  proshade_double zSamplRate = ( this->zDimSizeOriginal / static_cast<proshade_double> ( this->zDimIndicesOriginal ) );
74 
75  //================================================ Compute the rotation centre for the co-ordinates
76  proshade_double xRotPos = ( static_cast<proshade_double> ( this->xFrom - this->mapMovFromsChangeX ) * xSamplRate ) + // Corner X position in Angstroms
77  ( ( ( static_cast<proshade_double> ( this->xTo ) - static_cast<proshade_double> ( this->xFrom ) ) / 2.0 ) * xSamplRate ); // Half of box X size
78 
79  proshade_double yRotPos = ( static_cast<proshade_double> ( this->yFrom - this->mapMovFromsChangeY ) * ySamplRate ) + // Corner Y position in Angstroms
80  ( ( ( static_cast<proshade_double> ( this->yTo ) - static_cast<proshade_double> ( this->yFrom ) ) / 2.0 ) * ySamplRate ); // Half of box Y size
81 
82  proshade_double zRotPos = ( static_cast<proshade_double> ( this->zFrom - this->mapMovFromsChangeZ ) * zSamplRate ) + // Corner Z position in Angstroms
83  ( ( ( static_cast<proshade_double> ( this->zTo ) - static_cast<proshade_double> ( this->zFrom ) ) / 2.0 ) * zSamplRate ); // Half of box Z size
84 
85  //============================================ Modify by change during ProSHADE map processing
86  this->originalPdbRotCenX = xRotPos - ( this->mapCOMProcessChangeX / 2.0 );
87  this->originalPdbRotCenY = yRotPos - ( this->mapCOMProcessChangeY / 2.0 );
88  this->originalPdbRotCenZ = zRotPos - ( this->mapCOMProcessChangeZ / 2.0 );
89 
90  //================================================ Done
91  return ;
92 
93 }

◆ computeRotatedSH()

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

This function multiplies the objects spherical harmonics with the Wigner D matrices, obtaining rotated spherical harmonics coefficients.

Parameters
[in]settingsThe settings object specifying how exactly the rotation is to be done.

Definition at line 848 of file ProSHADE_overlay.cpp.

849 {
850  //================================================ Initialise variables
851  proshade_double WigDR, WigDI, *ShR, *ShI, retR, retI;
852  proshade_unsign arrPos;
853 
854  //================================================ Compute
855  for ( proshade_signed shell = 0; shell < static_cast<proshade_signed> ( this->noSpheres ); shell++ )
856  {
857  //============================================ For each band
858  for ( proshade_signed bandIter = 0; bandIter < static_cast<proshade_signed> ( this->spheres[shell]->getLocalBandwidth() ); bandIter++ )
859  {
860  //======================================== For each order1
861  for ( proshade_signed order1 = 0; order1 < ( ( bandIter * 2 ) + 1 ); order1++ )
862  {
863  //==================================== Get Spherical Harmonics value
864  ShR = getRealSphHarmValue ( bandIter, order1, shell );
865  ShI = getImagSphHarmValue ( bandIter, order1, shell );
866 
867  //==================================== For each order2
868  for ( proshade_signed order2 = 0; order2 < ( ( bandIter * 2 ) + 1 ); order2++ )
869  {
870  //================================ Get Wigner D values
871  this->getWignerMatrixValue ( bandIter, order1, order2, &WigDR, &WigDI );
872 
873  //================================ Multiply SH and Wigner
874  ProSHADE_internal_maths::complexMultiplication ( ShR, ShI, &WigDR, &WigDI, &retR, &retI );
875 
876  //================================ Save
877  arrPos = static_cast<proshade_unsign> ( seanindex ( order2-bandIter, bandIter, this->spheres[shell]->getLocalBandwidth() ) );
878  this->rotSphericalHarmonics[shell][arrPos][0] += retR;
879  this->rotSphericalHarmonics[shell][arrPos][1] += retI;
880  }
881  }
882  }
883  }
884 
885  //================================================ Done
886  return ;
887 
888 }

◆ 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 34 of file ProSHADE_symmetry.cpp.

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

◆ 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 61 of file ProSHADE_distances.cpp.

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

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

1609 {
1610  //================================================ Report progress
1611  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting spherical harmonics decomposition." );
1612 
1613  //================================================ Initialise memory
1614  this->sphericalHarmonics = new proshade_complex* [this->noSpheres];
1615  ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics, __FILE__, __LINE__, __func__ );
1616  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1617  {
1618  this->sphericalHarmonics[iter] = new proshade_complex [(this->spheres[iter]->getLocalBandwidth() * 2) * (this->spheres[iter]->getLocalBandwidth() * 2)];
1619  ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics[iter], __FILE__, __LINE__, __func__ );
1620  }
1621 
1622  //================================================ Compute the spherical harmonics
1623  for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1624  {
1625  //============================================ Report progress
1626  std::stringstream ss;
1627  ss << "Now decomposing sphere " << iter << ". " << "( Band is: " << this->spheres[iter]->getLocalBandwidth() << ").";
1628  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1629 
1630  //============================================ Compute
1631  ProSHADE_internal_sphericalHarmonics::computeSphericalHarmonics ( this->spheres[iter]->getLocalBandwidth(), this->spheres[iter]->getMappedData(), this->sphericalHarmonics[iter] );
1632  }
1633 
1634  //================================================ Report completion
1635  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Spherical harmonics decomposition complete." );
1636 
1637  //======================================== Done
1638  return ;
1639 
1640 }

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

390 {
391  //================================================ Do this using Fourier!
392  fftw_complex *tmpIn1 = NULL, *tmpOut1 = NULL, *tmpIn2 = NULL, *tmpOut2 = NULL, *resOut = NULL;
393  fftw_plan forwardFourierObj1, forwardFourierObj2, inverseFourierCombo;
394  proshade_unsign dimMult = staticStructure->getXDim() * staticStructure->getYDim() * staticStructure->getZDim();
395  ProSHADE_internal_overlay::allocateTranslationFunctionMemory ( tmpIn1, tmpOut1, tmpIn2, tmpOut2, this->translationMap, resOut, forwardFourierObj1, forwardFourierObj2, inverseFourierCombo, staticStructure->getXDim(), staticStructure->getYDim(), staticStructure->getZDim() );
396 
397  //================================================ Fill in input data
398  for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn1[iter][0] = staticStructure->getMapValue ( iter ); tmpIn1[iter][1] = 0.0; }
399  for ( proshade_unsign iter = 0; iter < dimMult; iter++ ) { tmpIn2[iter][0] = this->getMapValue ( iter ); tmpIn2[iter][1] = 0.0; }
400 
401  //================================================ Calculate Fourier
402  fftw_execute ( forwardFourierObj1 );
403  fftw_execute ( forwardFourierObj2 );
404 
405  //================================================ Combine Fourier coeffs and invert
406  ProSHADE_internal_overlay::combineFourierForTranslation ( tmpOut1, tmpOut2, resOut, staticStructure->getXDim(), staticStructure->getYDim(), staticStructure->getZDim() );
407  fftw_execute ( inverseFourierCombo );
408 
409  //================================================ Free memory
410  ProSHADE_internal_overlay::freeTranslationFunctionMemory ( tmpIn1, tmpOut1, tmpIn2, tmpOut2, resOut, forwardFourierObj1, forwardFourierObj2, inverseFourierCombo );
411 
412  //================================================ Done
413  return ;
414 
415 }

◆ 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 113 of file ProSHADE_symmetry.cpp.

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

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

1157 {
1158  //================================================ Report function start
1159  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Creating new structure according to the new bounds." );
1160 
1161  //================================================ Fill in basic info
1162  newStr->fileName = "N/A";
1163  newStr->fileType = ProSHADE_internal_io::MAP;
1164 
1165  //================================================ Fill in new structure values
1166  newStr->xDimIndices = static_cast<proshade_signed> ( newBounds[1] ) - static_cast<proshade_signed> ( newBounds[0] ) + 1;
1167  newStr->yDimIndices = static_cast<proshade_signed> ( newBounds[3] ) - static_cast<proshade_signed> ( newBounds[2] ) + 1;
1168  newStr->zDimIndices = static_cast<proshade_signed> ( newBounds[5] ) - static_cast<proshade_signed> ( newBounds[4] ) + 1;
1169 
1170  newStr->aAngle = this->aAngle;
1171  newStr->bAngle = this->aAngle;
1172  newStr->cAngle = this->aAngle;
1173 
1174  newStr->xDimSize = static_cast<proshade_single> ( newStr->xDimIndices ) * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) );
1175  newStr->yDimSize = static_cast<proshade_single> ( newStr->yDimIndices ) * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) );
1176  newStr->zDimSize = static_cast<proshade_single> ( newStr->zDimIndices ) * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) );
1177 
1178  newStr->xGridIndices = newStr->xDimIndices;
1179  newStr->yGridIndices = newStr->yDimIndices;
1180  newStr->zGridIndices = newStr->zDimIndices;
1181 
1182  newStr->xAxisOrder = this->xAxisOrder;
1183  newStr->yAxisOrder = this->yAxisOrder;
1184  newStr->zAxisOrder = this->zAxisOrder;
1185 
1186  newStr->xAxisOrigin = this->xAxisOrigin + newBounds[0];
1187  newStr->yAxisOrigin = this->yAxisOrigin + newBounds[2];
1188  newStr->zAxisOrigin = this->zAxisOrigin + newBounds[4];
1189 
1190  newStr->xFrom = this->xFrom + newBounds[0];
1191  newStr->yFrom = this->yFrom + newBounds[2];
1192  newStr->zFrom = this->zFrom + newBounds[4];
1193 
1194  newStr->xTo = this->xTo - ( (this->xDimIndices-1) - newBounds[1] );
1195  newStr->yTo = this->yTo - ( (this->yDimIndices-1) - newBounds[3] );
1196  newStr->zTo = this->zTo - ( (this->zDimIndices-1) - newBounds[5] );
1197 
1198  //================================================ Allocate new structure map
1199  newStr->internalMap = new proshade_double[newStr->xDimIndices * newStr->yDimIndices * newStr->zDimIndices];
1200  ProSHADE_internal_misc::checkMemoryAllocation ( newStr->internalMap, __FILE__, __LINE__, __func__ );
1201 
1202  //================================================ Copy the map
1203  ProSHADE_internal_mapManip::copyMapByBounds ( newStr->xFrom, newStr->xTo, newStr->yFrom, newStr->yTo, newStr->zFrom, newStr->zTo,
1204  this->xFrom, this->yFrom, this->zFrom, newStr->yDimIndices, newStr->zDimIndices,
1205  this->xDimIndices, this->yDimIndices, this->zDimIndices, newStr->internalMap, this->internalMap );
1206 
1207  //================================================ Report function completion
1208  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New structure created." );
1209 
1210  //================================================ Done
1211  return ;
1212 
1213 }

◆ deepCopyMap()

void ProSHADE_internal_data::ProSHADE_data::deepCopyMap ( proshade_double *&  saveTo,
proshade_unsign  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 2814 of file ProSHADE_data.cpp.

2815 {
2816  //================================================ Sanity check
2817  if ( saveTo != NULL )
2818  {
2819  ProSHADE_internal_messages::printWarningMessage ( verbose, "!!! ProSHADE WARNING !!! The deep copy pointer is not set to NULL. Cannot proceed and returning unmodified pointer.", "WB00040" );
2820  return ;
2821  }
2822 
2823  //================================================ Allocate the memory
2824  saveTo = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
2825 
2826  //================================================ Check memory allocation
2827  ProSHADE_internal_misc::checkMemoryAllocation ( saveTo, __FILE__, __LINE__, __func__ );
2828 
2829  //================================================ Copy internal map to the new pointer
2830  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
2831  {
2832  saveTo[iter] = this->internalMap[iter];
2833  }
2834 
2835  //================================================ Done
2836  return ;
2837 
2838 }

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

1774 {
1775  //================================================ Modify axis tolerance and matrix tolerance by sampling, if required by user
1776  if ( settings->axisErrToleranceDefault )
1777  {
1778  settings->axisErrTolerance = std::max ( 0.01, ( 2.0 * M_PI ) / this->maxShellBand );
1779  }
1780 
1781  //================================================ If C was requested, we will do it immediately - this allows for a significant speed-up.
1782  if ( settings->requestedSymmetryType == "C" )
1783  {
1784  //============================================ Report progress
1785  std::stringstream hlpSS;
1786  hlpSS << "Starting detection of cyclic point group C" << settings->requestedSymmetryFold;
1787  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1788 
1789  //============================================ Do simplified search only in the applicable data
1790  proshade_double symThres = 0.0;
1791  std::vector< proshade_double* > CSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, settings->requestedSymmetryFold, &symThres );
1792 
1793  //============================================ Save the best axis as the recommended one
1794  if ( settings->detectedSymmetry.size() == 0 ) { if ( CSyms.size() > 0 ) { settings->setDetectedSymmetry ( CSyms.at(0) ); } }
1795  if ( CSyms.size() > 0 )
1796  {
1797  settings->setRecommendedSymmetry ( "C" );
1798  settings->setRecommendedFold ( settings->requestedSymmetryFold );
1799 
1801  this->saveDetectedSymmetries ( settings, &CSyms, allCs );
1802  }
1803  else
1804  {
1805  settings->setRecommendedSymmetry ( "" );
1806  settings->setRecommendedFold ( 0 );
1807  }
1808 
1809  //============================================ Done
1810  return ;
1811  }
1812 
1813  //============================================ Report progress
1814  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting C symmetry detection." );
1815 
1816  //================================================ Initialise variables
1817  std::vector< proshade_double* > CSyms = getCyclicSymmetriesListFromAngleAxis ( settings );
1818 
1819  //================================================ Sanity check - was the rotation function mapped properly?
1820  if ( this->sphereMappedRotFun.size() < 1 )
1821  {
1822  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." );
1823  }
1824 
1825  //================================================ Sanity check - was any symmetry requested?
1826  if ( ( settings->requestedSymmetryType != "" ) && ( settings->requestedSymmetryType != "C" ) && ( settings->requestedSymmetryType != "D" ) && ( settings->requestedSymmetryType != "T" ) && ( settings->requestedSymmetryType != "O" ) && ( settings->requestedSymmetryType != "I" ) )
1827  {
1828  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." );
1829  }
1830 
1831  //================================================ Are we doing general search?
1832  if ( settings->requestedSymmetryType == "" )
1833  {
1834  //============================================ Run the symmetry detection functions for C, D, T, O and I symmetries
1835  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1836  std::vector< proshade_double* > ISyms = this->getPredictedIcosahedralSymmetriesList ( settings, &CSyms );
1837  std::vector< proshade_double* > OSyms = this->getPredictedOctahedralSymmetriesList ( settings, &CSyms );
1838  std::vector< proshade_double* > TSyms = this->getPredictedTetrahedralSymmetriesList ( settings, &CSyms );;
1839 
1840  //============================================ Decide on recommended symmetry
1841  this->saveRecommendedSymmetry ( settings, &CSyms, &DSyms, &TSyms, &OSyms, &ISyms, axes );
1842  }
1843 
1844  if ( settings->requestedSymmetryType == "D" )
1845  {
1846  //============================================ Run only the D symmetry detection and search for requested fold
1847  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1848  this->saveRequestedSymmetryD ( settings, &DSyms, axes );
1849  }
1850 
1851  if ( settings->requestedSymmetryType == "T" )
1852  {
1853  //============================================ Run only the T symmetry detection
1854  std::vector< proshade_double* > TSyms = this->getPredictedTetrahedralSymmetriesList ( settings, &CSyms );
1855  if ( TSyms.size() == 7 ) { settings->setRecommendedSymmetry ( "T" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSyms.size() ); it++ ) { settings->setDetectedSymmetry ( TSyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, TSyms.at(it) ); } }
1856  else { settings->setRecommendedSymmetry ( "" ); }
1857  }
1858 
1859  if ( settings->requestedSymmetryType == "O" )
1860  {
1861  //============================================ Run only the O symmetry detection
1862  std::vector< proshade_double* > OSyms = this->getPredictedOctahedralSymmetriesList ( settings, &CSyms );
1863  if ( OSyms.size() == 13 ) { settings->setRecommendedSymmetry ( "O" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSyms.size() ); it++ ) { settings->setDetectedSymmetry ( OSyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, OSyms.at(it) ); } }
1864  else { settings->setRecommendedSymmetry ( "" ); }
1865  }
1866 
1867  if ( settings->requestedSymmetryType == "I" )
1868  {
1869  //============================================ Run only the I symmetry detection
1870  std::vector< proshade_double* > ISyms = this->getPredictedIcosahedralSymmetriesList ( settings, &CSyms );
1871  if ( ISyms.size() == 31 ) { settings->setRecommendedSymmetry ( "I" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISyms.size() ); it++ ) { settings->setDetectedSymmetry ( ISyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, ISyms.at(it) ); } }
1872  else { settings->setRecommendedSymmetry ( "" ); }
1873  }
1874 
1875  //================================================ Save C symmetries to argument and if different from settings, to the settings as well
1876  this->saveDetectedSymmetries ( settings, &CSyms, allCs );
1877 
1878  //================================================ Done
1879  return ;
1880 
1881 }

◆ detectSymmetryInStructure()

void ProSHADE_internal_data::ProSHADE_data::detectSymmetryInStructure ( 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 and saves the results in the settings object.

This function is the symmetry detection starting point. It decides whether a specific symmetry is being sought after, or whether a general symmetry search is required. Consequently, it calls the appropriate functions and ends up with saving the resulting predictions into the settings object supplied. It also saves all the detected symmetry groups to the settings object for further processing and programmatical access.

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

1654 {
1655  //================================================ Initialise variables
1656  std::vector< proshade_double* > CSyms = this->getCyclicSymmetriesList ( settings );
1657 
1658  //================================================ Was any particular symmetry requested?
1659  if ( settings->requestedSymmetryType == "" )
1660  {
1661  //============================================ Run the symmetry detection functions for C, D, T, O and I symmetries
1662  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1663  std::vector< proshade_double* > ISyms = this->getIcosahedralSymmetriesList ( settings, &CSyms );
1664  std::vector< proshade_double* > OSyms; std::vector< proshade_double* > TSyms;
1665  if ( ISyms.size() < 31 ) { OSyms = this->getOctahedralSymmetriesList ( settings, &CSyms ); if ( OSyms.size() < 13 ) { TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms ); } }
1666 
1667  //============================================ Decide on recommended symmetry
1668  this->saveRecommendedSymmetry ( settings, &CSyms, &DSyms, &TSyms, &OSyms, &ISyms, axes );
1669  }
1670 
1671  if ( settings->requestedSymmetryType == "C" )
1672  {
1673  //============================================ Run only the C symmetry detection and search for requested fold
1674  this->saveRequestedSymmetryC ( settings, &CSyms, axes );
1675  }
1676 
1677  if ( settings->requestedSymmetryType == "D" )
1678  {
1679  //============================================ Run only the D symmetry detection and search for requested fold
1680  std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1681  this->saveRequestedSymmetryD ( settings, &DSyms, axes );
1682  }
1683 
1684  if ( settings->requestedSymmetryType == "T" )
1685  {
1686  //============================================ Run only the T symmetry detection and search for requested fold
1687  std::vector< proshade_double* > TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms );
1688  settings->setRecommendedFold ( 0 );
1689  if ( TSyms.size() == 7 ) { settings->setRecommendedSymmetry ( "T" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSyms.size() ); it++ ) { settings->setDetectedSymmetry ( TSyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, TSyms.at(it) ); } }
1690  else { settings->setRecommendedSymmetry ( "" ); }
1691  }
1692 
1693  if ( settings->requestedSymmetryType == "O" )
1694  {
1695  //============================================ Run only the O symmetry detection and search for requested fold
1696  std::vector< proshade_double* > OSyms = this->getOctahedralSymmetriesList ( settings, &CSyms );
1697  settings->setRecommendedFold ( 0 );
1698  if ( OSyms.size() == 13 ) { settings->setRecommendedSymmetry ( "O" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSyms.size() ); it++ ) { settings->setDetectedSymmetry ( OSyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, OSyms.at(it) ); } }
1699  else { settings->setRecommendedSymmetry ( "" ); }
1700  }
1701 
1702  if ( settings->requestedSymmetryType == "I" )
1703  {
1704  //============================================ Run only the T symmetry detection and search for requested fold
1705  std::vector< proshade_double* > ISyms = this->getIcosahedralSymmetriesList ( settings, &CSyms );
1706  settings->setRecommendedFold ( 0 );
1707  if ( ISyms.size() == 31 ) { settings->setRecommendedSymmetry ( "I" ); for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISyms.size() ); it++ ) { settings->setDetectedSymmetry ( ISyms.at(it) ); ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, ISyms.at(it) ); } }
1708  else { settings->setRecommendedSymmetry ( "" ); }
1709  }
1710 
1711  if ( ( settings->requestedSymmetryType != "" ) && ( settings->requestedSymmetryType != "C" ) && ( settings->requestedSymmetryType != "D" ) && ( settings->requestedSymmetryType != "T" ) && ( settings->requestedSymmetryType != "O" ) && ( settings->requestedSymmetryType != "I" ) )
1712  {
1713  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." );
1714  }
1715 
1716  //================================================ Save C symmetries to argument and if different from settings, to the settings as well
1717  bool isArgSameAsSettings = true;
1718  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( CSyms.size() ); cIt++ )
1719  {
1720  std::vector< proshade_double > nextSym;
1721  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[0] );
1722  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[1] );
1723  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[2] );
1724  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[3] );
1725  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[4] );
1726  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[5] );
1728 
1729  if ( ( cIt == 0 ) && ( settings->allDetectedCAxes.size() == 0 ) ) { isArgSameAsSettings = false; }
1730  if ( !isArgSameAsSettings ) { ProSHADE_internal_misc::addToDoubleVectorVector ( &settings->allDetectedCAxes, nextSym ); }
1731 
1732  nextSym.clear ( );
1733  }
1734 
1735  //================================================ Release memory
1736  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( CSyms.size() ); it++ ) { delete[] CSyms.at(it); }
1737 
1738  //================================================ Done
1739  return ;
1740 
1741 }

◆ detectSymmetryInStructurePython()

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

This function runs the symmetry detection algorithms on this structure saving the axes in the settings object only.

This function runs the detectSymmetryInStructure() function without requiring the vector of double pointers arguments, so that it is simply callable from Python. The axes are saved in the settings object for later retrieval.

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

Definition at line 1750 of file ProSHADE_data.cpp.

1751 {
1752  //================================================ Run the algorithm
1753  this->detectSymmetryInStructure ( settings, &settings->detectedSymmetry, &settings->allDetectedCAxes );
1754 
1755  //================================================ Done
1756  return ;
1757 
1758 }

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

786 {
787  //================================================ Set ends to origin + size - 1
788  this->xTo = this->xFrom + this->xDimIndices - 1;
789  this->yTo = this->yFrom + this->yDimIndices - 1;
790  this->zTo = this->zFrom + this->zDimIndices - 1;
791 
792  //================================================ Done
793  return ;
794 
795 }

◆ findBestCScore()

proshade_double ProSHADE_internal_data::ProSHADE_data::findBestCScore ( std::vector< proshade_double * > *  CSym,
proshade_unsign *  symInd 
)

This function locates the best scoring C symmetry axis, returning the score and best symmetry index.

This function takes the list of detected C symmetries and decides which of them is the best, taking into account the folds and the average heights. This is not the best approach, I would look into MLE of symmetry presence givent the height and fold, but for now this should do.

Parameters
[in]CSymThis is the complete list of the ProSHADE detected C axes in the ProSHADE format.
[in]symIndA pointer to variable where the best symmetry axis index will be stored.
[out]retThe score of the best scoring C axis.

Definition at line 1938 of file ProSHADE_data.cpp.

1939 {
1940  //================================================ Sanity check
1941  if ( CSym->size() == 0 ) { *symInd = 0; return ( 0.0 ); }
1942 
1943  //================================================ Initalise variables
1944  proshade_double ret = CSym->at(0)[5];
1945  *symInd = 0;
1946  proshade_double frac = 0.0;
1947 
1948  //================================================ Check all other axes
1949 // THIS NEEDS TO BE IMPROVED USING THE MAXIMUM LIKELIHOOD FOR THIS FOLD
1950  for ( proshade_unsign ind = 1; ind < static_cast<proshade_unsign>( CSym->size() ); ind++ )
1951  {
1952  //============================================ If higher fold than already leading one (do not care for lower fold and lower average height axes)
1953  if ( CSym->at(ind)[0] > CSym->at(*symInd)[0] )
1954  {
1955  //======================================== How much higher fold is it? Also, adding some protection against large syms supported only by a subset and a minimum requirement.
1956  frac = ( std::abs( CSym->at(ind)[5]- 0.5 ) / std::abs( CSym->at(*symInd)[5] - 0.5 ) ) / ( CSym->at(*symInd)[0] / CSym->at(ind)[0] );
1957 
1958  //======================================== Check if the new is "better" according to this criteria.
1959  if ( frac >= 1.0 && ( ( CSym->at(*symInd)[5] * 0.85 ) < CSym->at(ind)[5] ) )
1960  {
1961  //==================================== And it is! Save and try next one.
1962  *symInd = ind;
1963  ret = CSym->at(ind)[5];
1964  }
1965  }
1966  }
1967 
1968  //================================================ Done
1969  return ( ret );
1970 
1971 }

◆ findBestDScore()

proshade_double ProSHADE_internal_data::ProSHADE_data::findBestDScore ( std::vector< proshade_double * > *  DSym,
proshade_unsign *  symInd 
)

This function locates the best scoring D symmetry axis, returning the score and best symmetry index.

This function takes the list of detected D symmetries and decides which of them is the best, taking into account the folds and the average heights. This is not the best approach, I would look into MLE of symmetry presence givent the height and folds, but for now this should do.

Parameters
[in]DSymThis is the complete list of the ProSHADE detected D axes in the ProSHADE format.
[in]symIndA pointer to variable where the best symmetry axis index will be stored.
[out]retThe score of the best scoring D axis.

Definition at line 1982 of file ProSHADE_data.cpp.

1983 {
1984  //================================================ Sort the vector
1985  std::sort ( DSym->begin(), DSym->end(), ProSHADE_internal_misc::sortDSymHlpInv );
1986 
1987  //================================================ Initalise variables
1988  proshade_double ret = 0.0;
1989  proshade_double frac = 0.0;
1990  if ( DSym->size() > 0 )
1991  {
1992  ret = ( ( DSym->at(0)[0] * DSym->at(0)[5] ) + ( DSym->at(0)[6] * DSym->at(0)[11] ) ) / ( DSym->at(0)[0] + DSym->at(0)[6] );
1993  *symInd = 0;
1994  }
1995  else { return ( ret ); }
1996 
1997  //================================================ Check all other axes
1998 // THIS NEEDS TO BE IMPROVED USING THE MAXIMUM LIKELIHOOD FOR THIS FOLD
1999  for ( proshade_unsign ind = 1; ind < static_cast<proshade_unsign>( DSym->size() ); ind++ )
2000  {
2001  //============================================ If higher fold than already leading one (do not care for lower fold and lower average height axes)
2002  if ( ( DSym->at(ind)[0] + DSym->at(ind)[6] ) > ( DSym->at(*symInd)[0] + DSym->at(*symInd)[6] ) )
2003  {
2004  //======================================== How much higher fold is it? Also, adding some protection against large syms supported only by a subset and a minimum requirement.
2005  frac = std::max ( std::min ( ( ( DSym->at(*symInd)[0] + DSym->at(*symInd)[6] ) / ( DSym->at(ind)[0] + DSym->at(ind)[6] ) ) * 1.5, 0.9 ), 0.6 );
2006 
2007  //======================================== Check if the new is "better" according to this criteria.
2008  if ( ( ( ( DSym->at(*symInd)[0] * DSym->at(*symInd)[5] ) + ( DSym->at(*symInd)[6] * DSym->at(*symInd)[11] ) ) / ( DSym->at(*symInd)[0] + DSym->at(*symInd)[6] ) * frac ) < ( ( DSym->at(ind)[0] * DSym->at(ind)[5] ) + ( DSym->at(ind)[6] * DSym->at(ind)[11] ) ) / ( DSym->at(ind)[0] + DSym->at(ind)[6] ) )
2009  {
2010  //==================================== And it is! Save and try next one.
2011  *symInd = ind;
2012  ret = ( ( DSym->at(ind)[0] * DSym->at(ind)[5] ) + ( DSym->at(ind)[6] * DSym->at(ind)[11] ) ) / ( DSym->at(ind)[0] + DSym->at(ind)[6] );
2013  }
2014  }
2015  }
2016 
2017  //================================================ Done
2018  return ( ret );
2019 
2020 }

◆ findIScore()

proshade_double ProSHADE_internal_data::ProSHADE_data::findIScore ( std::vector< proshade_double * > *  ISym)

This function takes the list of icosahedral axes and returns a score for deciding whether I symmetry should be recommended.

This function simply checks if the complete I symmetry is present (returning 0.0 if not). If present, the function will compute the fold weighted average axis height for the whole symmetry and return this number.

Parameters
[in]ISymThis is the complete list of the ProSHADE detected I symmetry axes in the ProSHADE format.
[out]retThe score of the I symmetry.

Definition at line 2096 of file ProSHADE_data.cpp.

2097 {
2098  //================================================ Initialise variables
2099  proshade_double ret = 0.0;
2100  proshade_double foldSum = 0.0;
2101 
2102  //================================================ Check the T symmetry for being complete
2103  if ( ISym->size() == 31 )
2104  {
2105  //============================================ Compute the weighted fold
2106  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( ISym->size() ); cIt++ )
2107  {
2108  ret += ISym->at(cIt)[0] * ISym->at(cIt)[5];
2109  foldSum += ISym->at(cIt)[0];
2110  }
2111 
2112  //============================================ Weight
2113  ret /= foldSum;
2114  }
2115 
2116  //================================================ Done
2117  return ( ret );
2118 
2119 }

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

2929 {
2930  //================================================ Initialise variables
2931  this->xCom = 0.0;
2932  this->yCom = 0.0;
2933  this->zCom = 0.0;
2934  proshade_double totNonZeroPoints = 0.0;
2935  proshade_signed mapIt = 0;
2936 
2937  //================================================ Compute COM from 0 ; 0 ; 0
2938  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
2939  {
2940  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
2941  {
2942  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
2943  {
2944  //==================================== Find map index
2945  mapIt = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
2946 
2947  //==================================== Use only positive density
2948  if ( this->internalMap[mapIt] <= 0.0 ) { continue; }
2949 
2950  //==================================== Compute Index COM
2951  this->xCom += this->internalMap[mapIt] * static_cast<proshade_double> ( xIt + this->xFrom );
2952  this->yCom += this->internalMap[mapIt] * static_cast<proshade_double> ( yIt + this->yFrom );
2953  this->zCom += this->internalMap[mapIt] * static_cast<proshade_double> ( zIt + this->zFrom );
2954  totNonZeroPoints += this->internalMap[mapIt];
2955  }
2956  }
2957  }
2958 
2959  this->xCom /= totNonZeroPoints;
2960  this->yCom /= totNonZeroPoints;
2961  this->zCom /= totNonZeroPoints;
2962 
2963  //================================================ Convert to real world
2964  this->xCom = ( static_cast<proshade_double> ( this->xFrom ) * ( this->xDimSizeOriginal / static_cast<proshade_double> ( this->xDimIndicesOriginal ) ) ) +
2965  ( ( this->xCom - static_cast<proshade_double> ( this->xFrom ) ) *
2966  ( this->xDimSizeOriginal / static_cast<proshade_double> ( this->xDimIndicesOriginal ) ) );
2967  this->yCom = ( static_cast<proshade_double> ( this->yFrom ) * ( this->yDimSizeOriginal / static_cast<proshade_double> ( this->yDimIndicesOriginal ) ) ) +
2968  ( ( this->yCom - static_cast<proshade_double> ( this->yFrom ) ) *
2969  ( this->yDimSizeOriginal / static_cast<proshade_double> ( this->yDimIndicesOriginal ) ) );
2970  this->zCom = ( static_cast<proshade_double> ( this->zFrom ) * ( this->zDimSizeOriginal / static_cast<proshade_double> ( this->zDimIndicesOriginal ) ) ) +
2971  ( ( this->zCom - static_cast<proshade_double> ( this->zFrom ) ) *
2972  ( this->zDimSizeOriginal / static_cast<proshade_double> ( this->zDimIndicesOriginal ) ) );
2973 
2974  //================================================ Done
2975  return ;
2976 
2977 }

◆ findOScore()

proshade_double ProSHADE_internal_data::ProSHADE_data::findOScore ( std::vector< proshade_double * > *  OSym)

This function takes the list of octahedral axes and returns a score for deciding whether O symmetry should be recommended.

This function simply checks if the complete O symmetry is present (returning 0.0 if not). If present, the function will compute the fold weighted average axis height for the whole symmetry and return this number.

Parameters
[in]OSymThis is the complete list of the ProSHADE detected O symmetry axes in the ProSHADE format.
[out]retThe score of the O symmetry.

Definition at line 2063 of file ProSHADE_data.cpp.

2064 {
2065  //================================================ Initialise variables
2066  proshade_double ret = 0.0;
2067  proshade_double foldSum = 0.0;
2068 
2069  //================================================ Check the O symmetry for being complete
2070  if ( OSym->size() == 13 )
2071  {
2072  //============================================ Compute the weighted fold
2073  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( OSym->size() ); cIt++ )
2074  {
2075  ret += OSym->at(cIt)[0] * OSym->at(cIt)[5];
2076  foldSum += OSym->at(cIt)[0];
2077  }
2078 
2079  //============================================ Weight
2080  ret /= foldSum;
2081  }
2082 
2083  //================================================ Done
2084  return ( ret );
2085 
2086 }

◆ 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 3692 of file ProSHADE_symmetry.cpp.

3693 {
3694  //================================================ Initialise variables
3695  proshade_double soughtAngle;
3696  std::vector< proshade_double > allPeakHeights;
3697  std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup* > peakGroups;
3698  std::vector< proshade_double* > ret;
3699  bool newPeak;
3700 
3701  //================================================ Make sure we have a clean start
3702  this->sphereMappedRotFun.clear();
3703 
3704  //================================================ Convert rotation function to only the required angle-axis space spheres and find all peaks
3705  for ( proshade_double angIt = 1.0; angIt < static_cast<proshade_double> ( fold ); angIt += 1.0 )
3706  {
3707  //============================================ Figure the angles to form the symmetry
3708  soughtAngle = angIt * ( 2.0 * M_PI / static_cast<proshade_double> ( fold ) );
3709 
3710  //============================================ Create the angle-axis sphere with correct radius (angle)
3711  this->sphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere ( soughtAngle,
3712  M_PI / static_cast<proshade_double> ( fold ),
3713  this->maxShellBand * 2.0,
3714  soughtAngle,
3715  static_cast<proshade_unsign> ( angIt - 1.0 ) ) );
3716 
3717  //=========================================== Interpolate rotation function onto the sphere
3718  this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
3719 
3720  //============================================ Find all peaks for this sphere
3721  this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->findAllPeaks ( settings->peakNeighbours, &allPeakHeights );
3722  }
3723 
3724  //============================================ Report progress
3725  std::stringstream hlpSS;
3726  hlpSS << "Found a total of " << std::pow ( this->maxShellBand * 2.0 * (fold-1), 2.0 ) - allPeakHeights.size() << " non-peaks for thresholding.";
3727  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS.str() );
3728 
3729  //================================================ Determine the threshold for significant peaks
3730  *peakThres = std::max ( settings->minSymPeak, determinePeakThreshold ( allPeakHeights, settings->noIQRsFromMedianNaivePeak ) );
3731 
3732  //============================================ Report progress
3733  std::stringstream hlpSS2;
3734  hlpSS2 << "Determined peak threshold " << *peakThres << ".";
3735  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS2.str() );
3736 
3737  //================================================ Remove small peaks
3738  for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
3739  {
3740  this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( *peakThres );
3741  }
3742 
3743  //================================================ Group peaks
3744  for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); sphIt++ )
3745  {
3746  //============================================ For each peak
3747  for ( proshade_unsign pkIt = 0; pkIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().size() ); pkIt++ )
3748  {
3749  //======================================== Check if peak belongs to an already detected peak group
3750  newPeak = true;
3751  for ( proshade_unsign pkGrpIt = 0; pkGrpIt < static_cast<proshade_unsign> ( peakGroups.size() ); pkGrpIt++ )
3752  {
3753  if ( peakGroups.at(pkGrpIt)->checkIfPeakBelongs ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first, this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second, sphIt, settings->axisErrTolerance, settings->verbose ) ) { newPeak = false; break; }
3754  }
3755 
3756  //======================================== If already added, go to next one
3757  if ( !newPeak ) { continue; }
3758 
3759  //======================================== If not, create a new group with this peak
3760  peakGroups.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first,
3761  this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second,
3762  sphIt,
3763  this->sphereMappedRotFun.at(sphIt)->getAngularDim() ) );
3764  }
3765  }
3766 
3767  //================================================ For each peak group, look for the requested fold
3768  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( peakGroups.size() ); grIt++ )
3769  {
3770  //============================================ Report progress
3771  std::stringstream hlpSS3;
3772  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 ";
3773  for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( peakGroups.at(grIt)->getSpherePositions().size() ); sphIt++ ) { hlpSS3 << peakGroups.at(grIt)->getSpherePositions().at(sphIt) << " ; "; }
3774  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 5, hlpSS3.str() );
3775 
3776  //============================================ Find point groups in the peak group
3777  peakGroups.at(grIt)->findCyclicPointGroupsGivenFold ( this->sphereMappedRotFun, settings->axisErrTolerance, &ret, settings->useBiCubicInterpolationOnPeaks, fold, settings->verbose );
3778 
3779  //============================================ Release the memory
3780  delete peakGroups.at(grIt);
3781  }
3782 
3783  //================================================ Sort ret by peak height
3784  std::sort ( ret.begin(), ret.end(), sortProSHADESymmetryByPeak );
3785 
3786  //================================================ Done
3787  return ( ret );
3788 
3789 }

◆ findTScore()

proshade_double ProSHADE_internal_data::ProSHADE_data::findTScore ( std::vector< proshade_double * > *  TSym)

This function takes the list of tetrahedral axes and returns a score for deciding whether T symmetry should be recommended.

This function simply checks if the complete T symmetry is present (returning 0.0 if not). If present, the function will compute the fold weighted average axis height for the whole symmetry and return this number.

Parameters
[in]TSymThis is the complete list of the ProSHADE detected T symmetry axes in the ProSHADE format.
[out]retThe score of the T symmetry.

Definition at line 2030 of file ProSHADE_data.cpp.

2031 {
2032  //================================================ Initialise variables
2033  proshade_double ret = 0.0;
2034  proshade_double foldSum = 0.0;
2035 
2036  //================================================ Check the T symmetry for being complete
2037  if ( TSym->size() == 7 )
2038  {
2039  //============================================ Compute the weighted fold
2040  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( TSym->size() ); cIt++ )
2041  {
2042  ret += TSym->at(cIt)[0] * TSym->at(cIt)[5];
2043  foldSum += TSym->at(cIt)[0];
2044  }
2045 
2046  //============================================ Weight
2047  ret /= foldSum;
2048  }
2049 
2050  //================================================ Done
2051  return ( ret );
2052 
2053 }

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

2553 {
2554  //================================================ Initialise variables
2555  std::vector<std::vector< proshade_double > > ret;
2556 
2557  //================================================ Select which symmetry type are we computing for
2558  if ( groupType == "C" )
2559  {
2560  //============================================ Sanity check
2561  axesToGroupTypeSanityCheck ( 1, static_cast<proshade_unsign> ( axesList.size() ), groupType );
2562 
2563  //============================================ Generate elements
2564  ret = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(0)).at(1),
2565  settings->allDetectedCAxes.at(axesList.at(0)).at(2),
2566  settings->allDetectedCAxes.at(axesList.at(0)).at(3),
2567  settings->allDetectedCAxes.at(axesList.at(0)).at(0) );
2568 
2569  //============================================ Check the element to form a group
2570  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2571  else
2572  {
2573  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." );
2574  }
2575  }
2576  else if ( groupType == "D" )
2577  {
2578  //============================================ Sanity check
2579  axesToGroupTypeSanityCheck ( 2, static_cast<proshade_unsign> ( axesList.size() ), groupType );
2580 
2581  //============================================ Generate elements for both axes
2582  std::vector<std::vector< proshade_double > > first = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(0)).at(1),
2583  settings->allDetectedCAxes.at(axesList.at(0)).at(2),
2584  settings->allDetectedCAxes.at(axesList.at(0)).at(3),
2585  settings->allDetectedCAxes.at(axesList.at(0)).at(0) );
2586  std::vector<std::vector< proshade_double > > second = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(1)).at(1),
2587  settings->allDetectedCAxes.at(axesList.at(1)).at(2),
2588  settings->allDetectedCAxes.at(axesList.at(1)).at(3),
2589  settings->allDetectedCAxes.at(axesList.at(1)).at(0) );
2590 
2591  //============================================ Join the element lists
2592  ret = joinElementsFromDifferentGroups ( &first, &second, matrixTolerance, true );
2593 
2594  //============================================ Check the element to form a group
2595  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2596  else
2597  {
2598  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." );
2599  }
2600  }
2601  else if ( groupType == "T" )
2602  {
2603  //============================================ Sanity check
2604  axesToGroupTypeSanityCheck ( 7, static_cast<proshade_unsign> ( axesList.size() ), groupType );
2605 
2606  //============================================ Generate elements for all four C3 axes first
2607  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2608  {
2609  //======================================== If this is a C3 axis
2610  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 3 )
2611  {
2612  //==================================== Generate the elements
2613  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2614  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2615  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2616  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2617 
2618  //==================================== Join the elements to any already found
2619  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2620  }
2621  }
2622 
2623  //============================================ Generate elements for all three C2 axes second
2624  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2625  {
2626  //======================================== If this is a C3 axis
2627  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 2 )
2628  {
2629  //==================================== Generate the elements
2630  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2631  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2632  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2633  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2634 
2635  //==================================== Join the elements to any already found
2636  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2637  }
2638  }
2639 
2640  //============================================ Check the element to form a group
2641  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2642  else
2643  {
2644  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." );
2645  }
2646  }
2647  else if ( groupType == "O" )
2648  {
2649  //============================================ Sanity check
2650  axesToGroupTypeSanityCheck ( 13, static_cast<proshade_unsign> ( axesList.size() ), groupType );
2651 
2652  //============================================ Generate elements for all three C4 axes first
2653  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2654  {
2655  //======================================== If this is a C3 axis
2656  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 4 )
2657  {
2658  //==================================== Generate the elements
2659  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2660  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2661  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2662  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2663 
2664  //==================================== Join the elements to any already found
2665  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2666  }
2667  }
2668 
2669  //============================================ Generate elements for all four C3 axes first
2670  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2671  {
2672  //======================================== If this is a C3 axis
2673  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 3 )
2674  {
2675  //==================================== Generate the elements
2676  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2677  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2678  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2679  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2680 
2681  //==================================== Join the elements to any already found
2682  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2683  }
2684  }
2685 
2686  //============================================ Generate elements for all six C2 axes next
2687  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2688  {
2689  //======================================== If this is a C3 axis
2690  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 2 )
2691  {
2692  //==================================== Generate the elements
2693  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2694  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2695  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2696  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2697 
2698  //==================================== Join the elements to any already found
2699  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2700  }
2701  }
2702 
2703  //============================================ Check the element to form a group
2704  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2705  else
2706  {
2707  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." );
2708  }
2709  }
2710  else if ( groupType == "I" )
2711  {
2712  //============================================ Sanity check
2713  axesToGroupTypeSanityCheck ( 31, static_cast<proshade_unsign> ( axesList.size() ), groupType );
2714 
2715  //============================================ Generate elements for all six C5 axes first
2716  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2717  {
2718  //======================================== If this is a C5 axis
2719  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 5 )
2720  {
2721  //==================================== Generate the elements
2722  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2723  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2724  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2725  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2726 
2727  //==================================== Join the elements to any already found
2728  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2729  }
2730  }
2731 
2732  //============================================ Generate elements for all ten C3 axes next
2733  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2734  {
2735  //======================================== If this is a C3 axis
2736  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 3 )
2737  {
2738  //==================================== Generate the elements
2739  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2740  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2741  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2742  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2743 
2744  //==================================== Join the elements to any already found
2745  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2746  }
2747  }
2748 
2749  //============================================ Generate elements for all fifteen C2 axes lastly
2750  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2751  {
2752  //======================================== If this is a C3 axis
2753  if ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) == 2 )
2754  {
2755  //==================================== Generate the elements
2756  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2757  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2758  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2759  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2760 
2761  //==================================== Join the elements to any already found
2762  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, false );
2763  }
2764  }
2765 
2766  //============================================ Check the element to form a group
2767  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2768  else
2769  {
2770  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." );
2771  }
2772  }
2773  else if ( groupType == "X" )
2774  {
2775  //============================================ User forced no checking for unspecified symmetry
2776  for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( axesList.size() ); grIt++ )
2777  {
2778  //======================================== Compute group elements
2779  std::vector<std::vector< proshade_double > > els = computeGroupElementsForGroup ( settings->allDetectedCAxes.at(axesList.at(grIt)).at(1),
2780  settings->allDetectedCAxes.at(axesList.at(grIt)).at(2),
2781  settings->allDetectedCAxes.at(axesList.at(grIt)).at(3),
2782  settings->allDetectedCAxes.at(axesList.at(grIt)).at(0) );
2783 
2784  //======================================== Join the elements to any already found
2785  ret = joinElementsFromDifferentGroups ( &els, &ret, matrixTolerance, true );
2786  }
2787 
2788  //============================================ Check the element to form a group
2789  if ( checkElementsFormGroup ( &ret, matrixTolerance ) ) { return ( ret ); }
2790  else
2791  {
2792  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." );
2793  }
2794  }
2795  else
2796  {
2797  std::stringstream hlpSS;
2798  hlpSS << "Unknown symmetry type: >" << groupType << "<";
2799  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." );
2800  }
2801 
2802  //================================================ Done
2803  return ( ret );
2804 
2805 }

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

3155 {
3156  //================================================ Done
3157  return ( this->spheres[shell]->getShellRadius() );
3158 
3159 }

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

1229 {
1230  //================================================ Initialise local variables
1231  std::vector < proshade_double > ret;
1232  proshade_double eulA, eulB, eulG;
1233 
1234  //================================================ Get inverse SO(3) map top peak Euler angle values
1236  this->getMaxBand() * 2,
1237  &eulA, &eulB, &eulG, settings );
1238 
1239  //================================================ Re-format to vector
1243 
1244  //================================================ Done
1245  return ( ret );
1246 
1247 }

◆ getBestTranslationMapPeaksAngstrom()

std::vector< proshade_double > ProSHADE_internal_data::ProSHADE_data::getBestTranslationMapPeaksAngstrom ( ProSHADE_internal_data::ProSHADE_data staticStructure,
proshade_double  eulA,
proshade_double  eulB,
proshade_double  eulG 
)

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

309 {
310  //================================================ Initialise local variables
311  std::vector< proshade_double > ret;
312  proshade_double mapPeak = 0.0;
313  proshade_double trsX = 0.0, trsY = 0.0, trsZ = 0.0;
315  staticStructure->getXDim(),
316  staticStructure->getYDim(),
317  staticStructure->getZDim(),
318  &trsX,
319  &trsY,
320  &trsZ,
321  &mapPeak );
322 
323  //================================================ Dont translate over half
324  if ( trsX > ( staticStructure->getXDim() / 2 ) ) { trsX = trsX - this->getXDim(); }
325  if ( trsY > ( staticStructure->getYDim() / 2 ) ) { trsY = trsY - this->getYDim(); }
326  if ( trsZ > ( staticStructure->getZDim() / 2 ) ) { trsZ = trsZ - this->getZDim(); }
327 
328  //================================================ Move map
329  proshade_single xCor = ( staticStructure->xFrom - this->xFrom ) *
330  ( static_cast<proshade_double> ( staticStructure->getXDimSize() ) / staticStructure->getXDim() );
331  proshade_single yCor = ( staticStructure->yFrom - this->yFrom ) *
332  ( static_cast<proshade_double> ( staticStructure->getYDimSize() ) / staticStructure->getYDim() );
333  proshade_single zCor = ( staticStructure->zFrom - this->zFrom ) *
334  ( static_cast<proshade_double> ( staticStructure->getZDimSize() ) / staticStructure->getZDim() );
335  proshade_single xMov = staticStructure->mapCOMProcessChangeX - xCor -
336  ( trsX * static_cast<proshade_double> ( staticStructure->getXDimSize() ) / staticStructure->getXDim() );
337  proshade_single yMov = staticStructure->mapCOMProcessChangeY - yCor -
338  ( trsY * static_cast<proshade_double> ( staticStructure->getYDimSize() ) / staticStructure->getYDim() );
339  proshade_single zMov = staticStructure->mapCOMProcessChangeZ - zCor -
340  ( trsZ * static_cast<proshade_double> ( staticStructure->getZDimSize() ) / staticStructure->getZDim() );
341  proshade_single modXMov = xMov;
342  proshade_single modYMov = yMov;
343  proshade_single modZMov = zMov;
344 
345  //================================================ Save results as vector
346  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -xMov ) );
347  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -yMov ) );
348  ProSHADE_internal_misc::addToDoubleVector ( &ret, static_cast<proshade_double> ( -zMov ) );
349 
350  //================================================ Save original from variables for PDB output
351  this->mapMovFromsChangeX = this->xFrom;
352  this->mapMovFromsChangeY = this->yFrom;
353  this->mapMovFromsChangeZ = this->zFrom;
354 
355  //================================================ Move the map
356  ProSHADE_internal_mapManip::moveMapByIndices ( &modXMov, &modYMov, &modZMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
357  this->getXFromPtr(), this->getXToPtr(),
358  this->getYFromPtr(), this->getYToPtr(),
359  this->getZFromPtr(), this->getZToPtr(),
360  this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
361 
362  ProSHADE_internal_mapManip::moveMapByFourier ( this->getInternalMap(), modXMov, modYMov, modZMov,
363  this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
364  this->getXDim(), this->getYDim(), this->getZDim() );
365 
366  //================================================ Keep only the change in from and to variables
367  this->mapMovFromsChangeX = this->xFrom - this->mapMovFromsChangeX;
368  this->mapMovFromsChangeY = this->yFrom - this->mapMovFromsChangeY;
369  this->mapMovFromsChangeZ = this->zFrom - this->mapMovFromsChangeZ;
370 
371  //================================================ Compute the optimal rotation centre for co-ordinates
372  this->computePdbRotationCentre ( );
373  this->computeOptimalTranslation ( eulA, eulB, eulG, -xMov, -yMov, -zMov );
374 
375  //================================================ Done
376  return ( ret );
377 
378 }

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

3254 {
3255  //================================================ Done
3256  return ( this->maxCompBand );
3257 
3258 }

◆ 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 191 of file ProSHADE_symmetry.cpp.

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

◆ 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 3553 of file ProSHADE_symmetry.cpp.

3554 {
3555  //================================================ Initialise variables
3556  std::vector< proshade_unsign > primes = ProSHADE_internal_maths::findAllPrimes ( settings->maxSymmetryFold );
3557  std::vector< proshade_double* > ret, tmpHolder;
3558  std::vector< proshade_unsign > testedFolds;
3559  proshade_double symThres;
3560  proshade_unsign foldToTest;
3561  bool foldDone, anyNewSyms = true;
3562 
3563  //================================================ For each found prime number in the limit
3564  for ( proshade_unsign prIt = 0; prIt < static_cast< proshade_unsign > ( primes.size() ); prIt++ )
3565  {
3566  //============================================ Report progress
3567  std::stringstream hlpSS;
3568  hlpSS << "Searching for prime fold symmetry C" << primes.at(prIt) << ".";
3569  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
3570 
3571  //============================================ Get all symmetries for this prime fold
3572  std::vector< proshade_double* > prSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, primes.at(prIt), &symThres );
3573 
3574  //============================================ Save the detected C symmetries
3575  for ( proshade_unsign axIt = 0; axIt < static_cast< proshade_unsign > ( prSyms.size() ); axIt++ )
3576  {
3577  //======================================== Is this symmetry passing the threshold?
3578  if ( prSyms.at(axIt)[5] >= symThres )
3579  {
3580  //==================================== Add this symmetry to final list
3581  if ( ProSHADE_internal_maths::isAxisUnique ( &ret, prSyms.at(axIt), settings->axisErrTolerance, true ) )
3582  {
3583  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ret, prSyms.at(axIt) );
3584  }
3585  }
3586 
3587  //======================================== Release memory
3588  delete[] prSyms.at(axIt);
3589  }
3590  }
3591 
3592  //================================================ Was anything found?
3593  if ( ret.size() < 1 ) { return ( ret ); }
3594 
3595  //================================================ Check for prime symmetry fold multiples
3596  while ( anyNewSyms )
3597  {
3598  //============================================ Initialise new iteration
3599  anyNewSyms = false;
3600 
3601  //============================================ For each passing symmetry, look if there are any combinations of symmetries that would contain it
3602  for ( proshade_unsign axIt1 = 0; axIt1 < static_cast< proshade_unsign > ( ret.size() ); axIt1++ )
3603  {
3604  for ( proshade_unsign axIt2 = 0; axIt2 < static_cast< proshade_unsign > ( ret.size() ); axIt2++ )
3605  {
3606  //==================================== Initialise iteration
3607  foldToTest = ret.at(axIt1)[0] * ret.at(axIt2)[0];
3608  if ( foldToTest > settings->maxSymmetryFold ) { continue; }
3609 
3610  //==================================== Was this fold tested already?
3611  foldDone = false;
3612  for ( proshade_unsign fIt = 0; fIt < static_cast< proshade_unsign > ( testedFolds.size() ); fIt++ ) { if ( testedFolds.at(fIt) == foldToTest ) { foldDone = true; break; } }
3613  if ( foldDone ) { continue; }
3614  else { ProSHADE_internal_misc::addToUnsignVector ( &testedFolds, foldToTest ); }
3615 
3616  //==================================== Report progress
3617  std::stringstream hlpSS2;
3618  hlpSS2 << "Searching for fold combination of detected folds " << ret.at(axIt1)[0] << " and " << ret.at(axIt2)[0] << ", i.e. C" << foldToTest << ".";
3619  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS2.str() );
3620 
3621  //==================================== Get all symmetries for this fold
3622  std::vector< proshade_double* > prSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, foldToTest, &symThres );
3623 
3624  //==================================== For each detected group with the required fold
3625  for ( proshade_unsign newAxIt = 0; newAxIt < static_cast< proshade_unsign > ( prSyms.size() ); newAxIt++ )
3626  {
3627  if ( prSyms.at(newAxIt)[5] >= symThres )
3628  {
3629  //================================ Add to detected axes
3630  if ( ProSHADE_internal_maths::isAxisUnique ( &ret, prSyms.at(newAxIt), settings->axisErrTolerance, true ) )
3631  {
3632  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &tmpHolder, prSyms.at(newAxIt) );
3633  }
3634  }
3635 
3636  //==================================== Release memory
3637  delete[] prSyms.at(newAxIt);
3638  }
3639  }
3640  }
3641 
3642  //============================================ Add newly found groups and repeat if need be
3643  if ( tmpHolder.size() > 0 )
3644  {
3645  for ( proshade_unsign tmpIt = 0; tmpIt < static_cast< proshade_unsign > ( tmpHolder.size() ); tmpIt++ )
3646  {
3647  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &ret, tmpHolder.at(tmpIt) );
3648  delete[] tmpHolder.at(tmpIt);
3649  }
3650 
3651  anyNewSyms = true;
3652  tmpHolder.clear ( );
3653  }
3654  }
3655 
3656  //================================================ Sort the vector
3657  std::sort ( ret.begin(), ret.end(), ProSHADE_internal_misc::sortSymHlpInv );
3658 
3659  //================================================ Done
3660  return ( ret );
3661 }

◆ 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 1222 of file ProSHADE_symmetry.cpp.

1223 {
1224  //================================================ Initialise variables
1225  std::vector< proshade_double* > ret;
1226  proshade_double dotProduct;
1227 
1228  //================================================ Report progress
1229  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting D symmetry detection." );
1230 
1231  //================================================If not enough axes, just end here
1232  if ( CSymList->size() < 2 ) { return ( ret ); }
1233 
1234  //================================================ For each unique pair of axes
1235  for ( proshade_unsign ax1 = 0; ax1 < static_cast<proshade_unsign> ( CSymList->size() ); ax1++ )
1236  {
1237  //============================================ Ignore small axes
1238  if ( CSymList->at(ax1)[5] < settings->minSymPeak ) { continue; }
1239 
1240  for ( proshade_unsign ax2 = 1; ax2 < static_cast<proshade_unsign> ( CSymList->size() ); ax2++ )
1241  {
1242  //======================================= Use unique pairs only
1243  if ( ax1 >= ax2 ) { continue; }
1244 
1245  //======================================== Ignore small axes
1246  if ( CSymList->at(ax2)[5] < settings->minSymPeak ) { continue; }
1247 
1248  //======================================= Compute the dot product
1249  dotProduct = ProSHADE_internal_maths::computeDotProduct ( &CSymList->at(ax1)[1], &CSymList->at(ax1)[2],
1250  &CSymList->at(ax1)[3], &CSymList->at(ax2)[1],
1251  &CSymList->at(ax2)[2], &CSymList->at(ax2)[3] );
1252 
1253  //======================================== If close to zero, these two axes are perpendicular
1254  if ( std::abs( dotProduct ) < settings->axisErrTolerance )
1255  {
1256  //==================================== Save
1257  if ( CSymList->at(ax1)[0] >= CSymList->at(ax2)[0] )
1258  {
1259  ProSHADE_internal_symmetry::saveDSymmetry ( &ret, CSymList, ax1, ax2 );
1260 
1261  std::vector< proshade_unsign > DSymInd;
1265 
1266  }
1267  else
1268  {
1269  ProSHADE_internal_symmetry::saveDSymmetry ( &ret, CSymList, ax2, ax1 );
1270 
1271  std::vector< proshade_unsign > DSymInd;
1275  }
1276  }
1277  }
1278  }
1279 
1280  //================================================ Report progress
1281  std::stringstream hlpSS;
1282  hlpSS << "Detected " << ret.size() << " D symmetries.";
1283  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, hlpSS.str() );
1284 
1285  //================================================ Done
1286  return ( ret );
1287 
1288 }

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

3202 {
3203  //================================================ Done
3204  return ( this->eMatrices[band] );
3205 
3206 }

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

3217 {
3218  //================================================ Set pointer
3219  *valueReal = this->eMatrices[band][order1][order2][0];
3220  *valueImag = this->eMatrices[band][order1][order2][1];
3221 
3222  //================================================ Done
3223  return ;
3224 
3225 }

◆ 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 2629 of file ProSHADE_symmetry.cpp.

2630 {
2631  //================================================ Initialise variables
2632  std::vector< proshade_double* > ret;
2633 
2634  //================================================ Report progress
2635  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting I symmetry detection." );
2636 
2637  //================================================ Are the basic requirements for icosahedral symmetry met?
2639  {
2640  //============================================ Search for all the symmetry axes
2641  ProSHADE_internal_symmetry::findIcos6C5s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2642  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 ); }
2643 
2644  ProSHADE_internal_symmetry::findIcos10C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2645  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 ); }
2646 
2647  ProSHADE_internal_symmetry::findIcos15C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2648  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 ); }
2649  else
2650  {
2651  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
2652  {
2653  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
2654  {
2655  if ( ( CSymList->at(csIt)[0] == ret.at(retIt)[0] ) &&
2656  ( CSymList->at(csIt)[1] == ret.at(retIt)[1] ) &&
2657  ( CSymList->at(csIt)[2] == ret.at(retIt)[2] ) &&
2658  ( CSymList->at(csIt)[3] == ret.at(retIt)[3] ) &&
2659  ( CSymList->at(csIt)[4] == ret.at(retIt)[4] ) &&
2660  ( CSymList->at(csIt)[5] == ret.at(retIt)[5] ) )
2661  {
2663  }
2664  }
2665  }
2666  }
2667  }
2668 
2669  //================================================ Report progress
2670  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "I symmetry detection complete." );
2671 
2672  //================================================ Done
2673  return ( ret );
2674 
2675 }

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

3575 {
3576  //================================================ Save the data into the output array
3577  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3578  {
3579  eMatsLMImag[iter] = static_cast<double> ( this->eMatrices[band][order1][iter][1] );
3580  }
3581 
3582  //================================================ Done
3583  return ;
3584 
3585 }

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

3662 {
3663  //================================================ Save the data into the output array
3664  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3665  {
3666  rotFunImag[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][1] );
3667  }
3668 
3669  //================================================ Done
3670  return ;
3671 
3672 }

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

3611 {
3612  //================================================ Save the data into the output array
3613  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3614  {
3615  so3CoefsImag[iter] = static_cast<double> ( this->so3Coeffs[iter][1] );
3616  }
3617 
3618  //================================================ Done
3619  return ;
3620 
3621 }

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

3142 {
3143  //================================================ Done
3144  return ( &this->sphericalHarmonics[shell][seanindex ( static_cast<proshade_signed> ( order ) - static_cast<proshade_signed> ( band ),
3145  band,
3146  this->spheres[shell]->getLocalBandwidth() )][1] );
3147 
3148 }

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

3698 {
3699  //================================================ Save the data into the output array
3700  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3701  {
3702  trsFunImag[iter] = static_cast<double> ( this->translationMap[iter][1] );
3703  }
3704 
3705  //================================================ Done
3706  return ;
3707 
3708 }

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

3166 {
3167  //================================================ Done
3168  return ( this->integrationWeight );
3169 
3170 }

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

3434 {
3435  //================================================ Return the requested value
3436  return ( this->internalMap );
3437 }

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

3232 {
3233  //================================================ Done
3234  return ( this->so3CoeffsInverse );
3235 
3236 }

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

2995 {
2996  //================================================ Return the value
2997  return ( this->internalMap[pos] );
2998 }

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

3005 {
3006  //================================================ Return the value
3007  return ( this->maxShellBand );
3008 }

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

2984 {
2985  //================================================ Return the value
2986  return ( this->noSpheres );
2987 }

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

3774 {
3775  //================================================ Return the value
3776  return ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) );
3777 }

◆ 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 2093 of file ProSHADE_symmetry.cpp.

2094 {
2095  //================================================ Initialise variables
2096  std::vector< proshade_double* > ret;
2097 
2098  //================================================ Report progress
2099  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting O symmetry detection." );
2100 
2101  //================================================ Are the basic requirements for tetrahedral symmetry met?
2102  if ( ProSHADE_internal_symmetry::detectOctahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2103  {
2104  //============================================ Search for all the symmetry axes
2105  ProSHADE_internal_symmetry::findOcta3C4s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2106  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 ); }
2107 
2108  ProSHADE_internal_symmetry::findOcta4C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2109  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 ); }
2110 
2111  ProSHADE_internal_symmetry::findOcta6C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
2112  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 ); }
2113  else
2114  {
2115  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
2116  {
2117  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
2118  {
2119  if ( ( CSymList->at(csIt)[0] == ret.at(retIt)[0] ) &&
2120  ( CSymList->at(csIt)[1] == ret.at(retIt)[1] ) &&
2121  ( CSymList->at(csIt)[2] == ret.at(retIt)[2] ) &&
2122  ( CSymList->at(csIt)[3] == ret.at(retIt)[3] ) &&
2123  ( CSymList->at(csIt)[4] == ret.at(retIt)[4] ) &&
2124  ( CSymList->at(csIt)[5] == ret.at(retIt)[5] ) )
2125  {
2127  }
2128  }
2129  }
2130  }
2131  }
2132 
2133  //================================================ Report progress
2134  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "O symmetry detection complete." );
2135 
2136  //================================================ Done
2137  return ( ret );
2138 
2139 }

◆ 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< 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 2691 of file ProSHADE_symmetry.cpp.

2692 {
2693  //================================================ Initialise variables
2694  std::vector< proshade_double* > ret;
2695 
2696  //================================================ Report progress
2697  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting I symmetry prediction." );
2698 
2699  //================================================ Are the basic requirements for icosahedral symmetry met?
2701  {
2702  //============================================ Generate the rest of the axes
2703  ProSHADE_internal_symmetry::predictIcosAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
2704 
2705  //============================================ Get heights for the predicted axes
2707 
2708  //============================================ Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
2709  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ret.size() ); retIt++ )
2710  {
2711  ProSHADE_internal_misc::addToDblPtrVector ( CSymList, ret.at(retIt) );
2712  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, static_cast < proshade_unsign > ( CSymList->size() ) );
2713  }
2714  }
2715 
2716 
2717  //================================================ Report progress
2718  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "I symmetry prediction complete." );
2719 
2720  //================================================ Done
2721  return ( ret );
2722 
2723 }

◆ 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 2739 of file ProSHADE_symmetry.cpp.

2740 {
2741  //================================================ Initialise variables
2742  std::vector< proshade_double* > ret;
2743 
2744  //================================================ Report progress
2745  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting O symmetry prediction." );
2746 
2747  //================================================ Are the basic requirements for icosahedral symmetry met?
2748  if ( ProSHADE_internal_symmetry::detectOctahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2749  {
2750  //============================================ Generate the rest of the axes
2751  ProSHADE_internal_symmetry::predictOctaAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
2752 
2753  //============================================ Get heights for the predicted axes
2755 
2756  //============================================ Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
2757  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ret.size() ); retIt++ )
2758  {
2759  ProSHADE_internal_misc::addToDblPtrVector ( CSymList, ret.at(retIt) );
2760  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, static_cast < proshade_unsign > ( CSymList->size() ) );
2761  }
2762  }
2763 
2764  //================================================ Report progress
2765  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "O symmetry prediction complete." );
2766 
2767  //================================================ Done
2768  return ( ret );
2769 
2770 }

◆ 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 3960 of file ProSHADE_symmetry.cpp.

3961 {
3962  //================================================ Initialise variables
3963  std::vector< proshade_double* > ret;
3964 
3965  //================================================ Report progress
3966  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting T symmetry prediction." );
3967 
3968  //================================================ Are the basic requirements for icosahedral symmetry met?
3970  {
3971  //============================================ Generate the rest of the axes
3972  ProSHADE_internal_symmetry::predictTetraAxes ( CSymList, &ret, settings->axisErrTolerance, settings->minSymPeak );
3973 
3974  //============================================ Get heights for the predicted axes
3976 
3977  //============================================ Add predicted axes to detected C axes list and also to the settings Icosahedral symmetry list
3978  for ( proshade_unsign retIt = 0; retIt < static_cast < proshade_unsign > ( ret.size() ); retIt++ )
3979  {
3980  ProSHADE_internal_misc::addToDblPtrVector ( CSymList, ret.at(retIt) );
3981  ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, static_cast < proshade_unsign > ( CSymList->size() ) );
3982  }
3983  }
3984 
3985  //================================================ Report progress
3986  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "T symmetry prediction complete." );
3987 
3988  //================================================ Done
3989  return ( ret );
3990 
3991 }

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

3555 {
3556  //================================================ Save the data into the output array
3557  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3558  {
3559  eMatsLMReal[iter] = static_cast<double> ( this->eMatrices[band][order1][iter][0] );
3560  }
3561 
3562  //================================================ Done
3563  return ;
3564 
3565 }

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

3644 {
3645  //================================================ Save the data into the output array
3646  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3647  {
3648  rotFunReal[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][0] );
3649  }
3650 
3651  //================================================ Done
3652  return ;
3653 
3654 }

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

3593 {
3594  //================================================ Save the data into the output array
3595  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3596  {
3597  so3CoefsReal[iter] = static_cast<double> ( this->so3Coeffs[iter][0] );
3598  }
3599 
3600  //================================================ Done
3601  return ;
3602 
3603 }

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

3129 {
3130  //================================================ Done
3131  return ( &this->sphericalHarmonics[shell][seanindex ( static_cast<proshade_signed> ( order ) - static_cast<proshade_signed> ( band ),
3132  band,
3133  this->spheres[shell]->getLocalBandwidth() )][0] );
3134 
3135 }

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

3680 {
3681  //================================================ Save the data into the output array
3682  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3683  {
3684  trsFunReal[iter] = static_cast<double> ( this->translationMap[iter][0] );
3685  }
3686 
3687  //================================================ Done
3688  return ;
3689 
3690 }

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

1102 {
1103  //================================================ Report function start
1104  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Finding new boundaries." );
1105 
1106  //================================================ If same bounds as first one are required, test if possible and return these instead
1107  if ( settings->useSameBounds && ( this->inputOrder != 0 ) )
1108  {
1109  for ( proshade_unsign iter = 0; iter < 6; iter++ ) { ret[iter] = settings->forceBounds[iter]; }
1110  }
1111  //================================================ In this case, bounds need to be found de novo
1112  else
1113  {
1114  //============================================ Find the non-zero bounds
1116  this->xDimSize, this->yDimSize, this->zDimSize, ret );
1117 
1118  //============================================ Add the extra space
1120  this->xDimSize, this->yDimSize, this->zDimSize, ret, settings->boundsExtraSpace );
1121 
1122  //============================================ Beautify boundaries
1124 
1125  //============================================ Report function results
1126  std::stringstream ssHlp;
1127  ssHlp << "New boundaries are: " << ret[1] - ret[0] + 1 << " x " << ret[3] - ret[2] + 1 << " x " << ret[5] - ret[4] + 1;
1128  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, ssHlp.str() );
1129 
1130  //============================================ If need be, save boundaries to be used for all other structure
1131  if ( settings->useSameBounds && ( this->inputOrder == 0 ) )
1132  {
1133  for ( proshade_unsign iter = 0; iter < 6; iter++ ) { settings->forceBounds[iter] = ret[iter]; }
1134  }
1135  }
1136 
1137  //================================================ Report function completion
1138  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New boundaries determined." );
1139 
1140  //================================================ Done
1141  return ;
1142 
1143 }

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

3762 {
3763  //================================================ Return the value
3764  return ( settings->recommendedSymmetryFold );
3765 
3766 }

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

3751 {
3752  //================================================ Return the value
3753  return ( settings->recommendedSymmetryType );
3754 
3755 }

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

3719 {
3720  //================================================ Get Euler angles
3721  proshade_double eA, eB, eG;
3722  ProSHADE_internal_maths::getEulerZXZFromSOFTPosition ( this->getMaxBand(), aI, bI, gI, &eA, &eB, &eG );
3723 
3724  //================================================ Prepare internal rotation matrix memory
3725  proshade_double* rMat = NULL;
3726  rMat = new proshade_double[9];
3727  ProSHADE_internal_misc::checkMemoryAllocation ( rMat, __FILE__, __LINE__, __func__ );
3728 
3729  //================================================ Convert to rotation matrix
3731 
3732  //================================================ Copy to output
3733  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3734  {
3735  rotMat[iter] = static_cast<double> ( rMat[iter] );
3736  }
3737 
3738  //================================================ Release internal memory
3739  delete[] rMat;
3740 
3741  //================================================ Done
3742  return ;
3743 
3744 }

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

3015 {
3016  //================================================ Return the value
3017  return ( this->rrpMatrices[band][sh1][sh2] );
3018 }

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

3178 {
3179  //================================================ Done
3180  return ( this->spheres[shell]->getLocalBandwidth ( ) );
3181 
3182 }

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

3243 {
3244  //================================================ Done
3245  return ( this->so3Coeffs );
3246 
3247 }

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

1508 {
1509  //================================================ Check the current settings value is set to auto
1510  if ( this->spherePos.size() != 0 )
1511  {
1512  std::stringstream hlpSS;
1513  hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1514  for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1515  hlpSS << " Angstroms.";
1516  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1517  return ;
1518  }
1519 
1520  //================================================ Find maximum diagonal
1521  proshade_unsign maxDim = std::max ( this->xDimSize, std::max ( this->yDimSize, this->zDimSize ) );
1522  proshade_unsign minDim = std::min ( this->xDimSize, std::min ( this->yDimSize, this->zDimSize ) );
1523  proshade_unsign midDim = 0;
1524  if ( ( this->xDimSize < maxDim ) && ( this->xDimSize > minDim ) ) { midDim = this->xDimSize; }
1525  else if ( ( this->yDimSize < maxDim ) && ( this->yDimSize > minDim ) ) { midDim = this->yDimSize; }
1526  else { midDim = this->zDimSize; }
1527 
1528  proshade_single maxDiag = std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ), 2.0 ) +
1529  std::pow ( static_cast<proshade_single> ( midDim ), 2.0 ) );
1530 
1531  //================================================ Set between the points
1532  for ( proshade_single iter = 0.5; ( iter * settings->maxSphereDists ) < ( maxDiag / 2.0 ); iter += 1.0 )
1533  {
1534  ProSHADE_internal_misc::addToSingleVector ( &this->spherePos, ( iter * settings->maxSphereDists ) );
1535  }
1536 
1537  //================================================ Save the number of spheres
1538  this->noSpheres = static_cast<proshade_unsign> ( this->spherePos.size() );
1539 
1540  //================================================ Report progress
1541  std::stringstream hlpSS;
1542  hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1543  for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1544  hlpSS << " Angstroms.";
1545  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1546 
1547  //================================================ Done
1548  return ;
1549 
1550 }

◆ getSpherePosValue()

proshade_double 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 3189 of file ProSHADE_data.cpp.

3190 {
3191  //================================================ Done
3192  return ( this->spherePos.at(shell) );
3193 
3194 }

◆ 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 and peak height in this order.

Definition at line 3785 of file ProSHADE_data.cpp.

3786 {
3787  //================================================ Sanity checks
3788  if ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) <= axisNo )
3789  {
3790  ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
3791  return ( std::vector< std::string > ( ) );
3792  }
3793 
3794  //================================================ Initialise local variables
3795  std::vector< std::string > ret;
3796 
3797  //================================================ Input the axis data as strings
3798  std::stringstream ssHlp;
3799  ssHlp << settings->detectedSymmetry.at(axisNo)[0];
3800  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3801  ssHlp.str ( "" );
3802 
3803  ssHlp << settings->detectedSymmetry.at(axisNo)[1];
3804  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3805  ssHlp.str ( "" );
3806 
3807  ssHlp << settings->detectedSymmetry.at(axisNo)[2];
3808  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3809  ssHlp.str ( "" );
3810 
3811  ssHlp << settings->detectedSymmetry.at(axisNo)[3];
3812  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3813  ssHlp.str ( "" );
3814 
3815  ssHlp << settings->detectedSymmetry.at(axisNo)[4];
3816  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3817  ssHlp.str ( "" );
3818 
3819  ssHlp << settings->detectedSymmetry.at(axisNo)[5];
3820  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3821  ssHlp.str ( "" );
3822 
3823  //================================================ Done
3824  return ( ret );
3825 
3826 }

◆ 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 1340 of file ProSHADE_symmetry.cpp.

1341 {
1342  //================================================ Initialise variables
1343  std::vector< proshade_double* > ret;
1344 
1345  //================================================ Report progress
1346  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting T symmetry detection." );
1347 
1348  //================================================ Are the basic requirements for tetrahedral symmetry met?
1350  {
1351  //============================================ Search for all the symmetry axes
1352  ProSHADE_internal_symmetry::findTetra4C3s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
1353  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 ); }
1354 
1355  ProSHADE_internal_symmetry::findTetra3C2s ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak );
1356  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 ); }
1357  else
1358  {
1359  for ( proshade_unsign csIt = 0; csIt < static_cast<proshade_unsign> ( CSymList->size() ); csIt++ )
1360  {
1361  for ( proshade_unsign retIt = 0; retIt < static_cast<proshade_unsign> ( ret.size() ); retIt++ )
1362  {
1363  if ( ( CSymList->at(csIt)[0] == ret.at(retIt)[0] ) &&
1364  ( CSymList->at(csIt)[1] == ret.at(retIt)[1] ) &&
1365  ( CSymList->at(csIt)[2] == ret.at(retIt)[2] ) &&
1366  ( CSymList->at(csIt)[3] == ret.at(retIt)[3] ) &&
1367  ( CSymList->at(csIt)[4] == ret.at(retIt)[4] ) &&
1368  ( CSymList->at(csIt)[5] == ret.at(retIt)[5] ) )
1369  {
1371  }
1372  }
1373  }
1374  }
1375  }
1376 
1377  //================================================ Report progress
1378  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "T symmetry detection complete." );
1379 
1380  //================================================ Done
1381  return ( ret );
1382 
1383 }

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

3444 {
3445  //================================================ Return the requested value
3446  return ( this->translationMap );
3447 }

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

3269 {
3270  //================================================ Set pointer
3271  *valueReal = this->wignerMatrices[band][order1][order2][0];
3272  *valueImag = this->wignerMatrices[band][order1][order2][1];
3273 
3274  //================================================ Done
3275  return ;
3276 
3277 }

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

3404 {
3405  //================================================ Return the requested value
3406  return ( &this->xAxisOrigin );
3407 }

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

3314 {
3315  //================================================ Return the requested value
3316  return ( this->xDimIndices );
3317 }

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

3284 {
3285  //================================================ Return the requested value
3286  return ( this->xDimSize );
3287 }

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

3344 {
3345  //================================================ Return the requested value
3346  return ( &this->xFrom );
3347 }

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

3374 {
3375  //================================================ Return the requested value
3376  return ( &this->xTo );
3377 }

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

3414 {
3415  //================================================ Return the requested value
3416  return ( &this->yAxisOrigin );
3417 }

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

3324 {
3325  //================================================ Return the requested value
3326  return ( this->yDimIndices );
3327 }

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

3294 {
3295  //================================================ Return the requested value
3296  return ( this->yDimSize );
3297 }

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

3354 {
3355  //================================================ Return the requested value
3356  return ( &this->yFrom );
3357 }

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

3384 {
3385  //================================================ Return the requested value
3386  return ( &this->yTo );
3387 }

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

3424 {
3425  //================================================ Return the requested value
3426  return ( &this->zAxisOrigin );
3427 }

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

3334 {
3335  //================================================ Return the requested value
3336  return ( this->zDimIndices );
3337 }

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

3304 {
3305  //================================================ Return the requested value
3306  return ( this->zDimSize );
3307 }

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

3364 {
3365  //================================================ Return the requested value
3366  return ( &this->zFrom );
3367 }

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

3394 {
3395  //================================================ Return the requested value
3396  return ( &this->zTo );
3397 }

◆ interpolateMapFromSpheres()

void ProSHADE_internal_data::ProSHADE_data::interpolateMapFromSpheres ( ProSHADE_settings settings,
proshade_double *&  densityMapRotated 
)

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

Parameters
[in]settingsThe settings object specifying how exactly the rotation is to be done.
[in]densityMapRotatedThe pointer to allocated memory where the new map values will be held.

Definition at line 1042 of file ProSHADE_overlay.cpp.

1043 {
1044  //================================================ Initialise variables
1045  proshade_double rad = 0.0, lon = 0.0, lat = 0.0, newU = 0.0, newV = 0.0, newW = 0.0;
1046  proshade_unsign lowerLonL = 0, upperLonL = 0, lowerLonU = 0, upperLonU = 0, lowerLatL = 0, upperLatL = 0, lowerLatU = 0, upperLatU = 0, lowerShell = 0, upperShell = 0;
1047  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;
1048  proshade_double lowerShellValue = 0.0, upperShellValue = 0.0;
1049  proshade_double xSamplingRate = static_cast<proshade_double> ( this->xDimSize ) / this->xDimIndices;
1050  proshade_double ySamplingRate = static_cast<proshade_double> ( this->yDimSize ) / this->yDimIndices;
1051  proshade_double zSamplingRate = static_cast<proshade_double> ( this->zDimSize ) / this->zDimIndices;
1052  proshade_signed arrPos;
1053  std::vector<proshade_double> lonCOU, latCOU, lonCOL, latCOL;
1054 
1055  for ( proshade_signed uIt = 0; uIt < static_cast<proshade_signed> (this->xDimIndices); uIt++ )
1056  {
1057  for ( proshade_signed vIt = 0; vIt < static_cast<proshade_signed> (this->yDimIndices); vIt++ )
1058  {
1059  for ( proshade_signed wIt = 0; wIt < static_cast<proshade_signed> (this->zDimIndices); wIt++ )
1060  {
1061  //==================================== Convert to centered coords
1062  newU = static_cast<proshade_double> ( uIt - ( static_cast<proshade_signed> (this->xDimIndices) / 2 ) );
1063  newV = static_cast<proshade_double> ( vIt - ( static_cast<proshade_signed> (this->yDimIndices) / 2 ) );
1064  newW = static_cast<proshade_double> ( wIt - ( static_cast<proshade_signed> (this->zDimIndices) / 2 ) );
1065 
1066  //==================================== Deal with 0 ; 0 ; 0
1067  if ( ( newU == 0.0 ) && ( newV == 0.0 ) && ( newW == 0.0 ) )
1068  {
1069  arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
1070  densityMapRotated[arrPos] = this->internalMap[arrPos];
1071  continue;
1072  }
1073 
1074  //==================================== Convert to spherical coords
1075  rad = sqrt ( pow( ( newU * xSamplingRate ), 2.0 ) +
1076  pow( ( newV * ySamplingRate ), 2.0 ) +
1077  pow( ( newW * zSamplingRate ), 2.0 ) );
1078  lon = atan2 ( ( newV * ySamplingRate ), ( newU * xSamplingRate ) );
1079  lat = asin ( ( newW * zSamplingRate ) / rad );
1080 
1081  //==================================== Deal with nan's
1082  if ( rad != rad ) { rad = 0.0; }
1083  if ( lon != lon ) { lon = 0.0; }
1084  if ( lat != lat ) { lat = 0.0; }
1085 
1086  //==================================== Find shells above and below
1087  lowerShell = 0;
1088  upperShell = 0;
1089  for ( proshade_unsign iter = 0; iter < (this->noSpheres-1); iter++ )
1090  {
1091  if ( ( this->spherePos.at(iter) <= rad ) && ( this->spherePos.at(iter+1) > rad ) )
1092  {
1093  lowerShell = iter;
1094  upperShell = iter+1;
1095  break;
1096  }
1097  }
1098 
1099  if ( upperShell == 0 )
1100  {
1101  arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
1102  densityMapRotated[arrPos] = 0.0;
1103  continue;
1104  }
1105 
1106  //==================================== Get the longitude and lattitude cut-offs for this shell resolution
1107  lonCOL.clear(); latCOL.clear(); lonCOU.clear(); latCOU.clear();
1108  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCOL, &latCOL, this->spheres[lowerShell]->getLocalAngRes() );
1109  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCOU, &latCOU, this->spheres[upperShell]->getLocalAngRes() );
1110 
1111  //==================================== Find the angle cutoffs around the point
1112  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOL.size() ); iter++ )
1113  {
1114  if ( iter == ( static_cast<proshade_unsign> ( lonCOL.size() ) - 1 ) )
1115  {
1116  lowerLonL = 0;
1117  upperLonL = 1;
1118  break;
1119  }
1120  if ( ( std::floor(10000. * lonCOL.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOL.at(iter+1)) > std::floor(10000. * lon) ) )
1121  {
1122  lowerLonL = iter;
1123  upperLonL = iter+1;
1124  break;
1125  }
1126  }
1127  if ( upperLonL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLonL = 0; }
1128 
1129  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( lonCOU.size() ); iter++ )
1130  {
1131  if ( iter == ( static_cast<proshade_unsign> ( lonCOU.size() ) - 1 ) )
1132  {
1133  lowerLonU = 0;
1134  upperLonU = 1;
1135  break;
1136  }
1137  if ( ( std::floor(10000. * lonCOU.at(iter)) <= std::floor(10000. * lon) ) && ( std::floor(10000. * lonCOU.at(iter+1)) > std::floor(10000. * lon) ) )
1138  {
1139  lowerLonU = iter;
1140  upperLonU = iter+1;
1141  break;
1142  }
1143  }
1144  if ( upperLonU == this->spheres[upperShell]->getLocalAngRes() ) { upperLonU = 0; }
1145 
1146  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOL.size() ); iter++ )
1147  {
1148  if ( iter == ( static_cast<proshade_unsign> ( latCOL.size() ) - 1 ) )
1149  {
1150  lowerLatL = 0;
1151  upperLatL = 1;
1152  break;
1153  }
1154  if ( ( std::floor(10000. * latCOL.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOL.at(iter+1)) > std::floor(10000. * lat) ) )
1155  {
1156  lowerLatL = iter;
1157  upperLatL = iter+1;
1158  break;
1159  }
1160  }
1161  if ( upperLatL == this->spheres[lowerShell]->getLocalAngRes() ) { upperLatL = 0; }
1162 
1163  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( latCOU.size() ); iter++ )
1164  {
1165  if ( iter == ( static_cast<proshade_unsign> ( latCOU.size() ) - 1 ) )
1166  {
1167  lowerLatU = 0;
1168  upperLatU = 1;
1169  break;
1170  }
1171  if ( ( std::floor(10000. * latCOU.at(iter)) <= std::floor(10000. * lat) ) && ( std::floor(10000. * latCOU.at(iter+1)) > std::floor(10000. * lat) ) )
1172  {
1173  lowerLatU = iter;
1174  upperLatU = iter+1;
1175  break;
1176  }
1177  }
1178  if ( upperLatU == this->spheres[upperShell]->getLocalAngRes() ) { upperLatU = 0; }
1179 
1180  //==================================== Interpolate lower shell
1181  x00 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1182  x01 = this->spheres[lowerShell]->getRotatedMappedData ( lowerLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1183  x10 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + lowerLonL );
1184  x11 = this->spheres[lowerShell]->getRotatedMappedData ( upperLatL * this->spheres[lowerShell]->getLocalAngRes() + upperLonL );
1185 
1186  distLLon = std::abs ( lon - lonCOL.at(lowerLonL) ) / ( std::abs( lon - lonCOL.at(lowerLonL) ) + std::abs( lon - lonCOL.at(upperLonL) ) );
1187  valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1188  valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1189 
1190  distLLat = std::abs ( lat - latCOL.at(lowerLatL) ) / ( std::abs( lat - latCOL.at(lowerLatL) ) + std::abs( lat - latCOL.at(upperLatL) ) );
1191  lowerShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1192 
1193  //==================================== Interpolate upper shell
1194  x00 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1195  x01 = this->spheres[upperShell]->getRotatedMappedData ( lowerLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1196  x10 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + lowerLonU );
1197  x11 = this->spheres[upperShell]->getRotatedMappedData ( upperLatU * this->spheres[upperShell]->getLocalAngRes() + upperLonU );
1198 
1199  distLLon = std::abs ( lon - lonCOU.at(lowerLonU) ) / ( std::abs( lon - lonCOU.at(lowerLonU) ) + std::abs( lon - lonCOU.at(upperLonU) ) );
1200  valLLon = ( ( 1.0 - distLLon ) * x00 ) + ( distLLon * x01 );
1201  valULon = ( ( 1.0 - distLLon ) * x10 ) + ( distLLon * x11 );
1202 
1203  distLLat = std::abs ( lat - latCOU.at(lowerLatU) ) / ( std::abs( lat - latCOU.at(lowerLatU) ) + std::abs( lat - latCOU.at(upperLatU) ) );
1204  upperShellValue = ( ( 1.0 - distLLat ) * valLLon ) + ( distLLat * valULon );
1205 
1206  //==================================== Interpolate between shells
1207  distLRad = std::abs ( rad - this->spherePos.at(lowerShell) ) / ( std::abs( rad - this->spherePos.at(lowerShell) ) +
1208  std::abs( rad - this->spherePos.at(upperShell) ) );
1209 
1210  arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
1211  densityMapRotated[arrPos] = ( ( 1.0 - distLRad ) * lowerShellValue ) + ( distLRad * upperShellValue );
1212  }
1213 
1214  }
1215 
1216  }
1217 
1218  //================================================ Done
1219  return ;
1220 
1221 }

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

961 {
962  //================================================ Report function start
963  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion." );
964 
965  //================================================ Initialise variables
966  proshade_signed arrayPos, invPos;
967 
968  //================================================ Create helper map
969  proshade_double* hlpMap = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
970  ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
971 
972  //================================================ Save map values to the helper map
973  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
974  {
975  hlpMap[iter] = this->internalMap[iter];
976  }
977 
978  //================================================ Invert the values
979  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
980  {
981  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
982  {
983  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
984  {
985  //==================================== Var init
986  arrayPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
987  invPos = ( (this->zDimIndices-1) - zIt ) + this->zDimIndices * ( ( (this->yDimIndices-1) - yIt ) + this->yDimIndices * ( (this->xDimIndices-1) - xIt ) );
988 
989  //==================================== And save
990  this->internalMap[invPos] = hlpMap[arrayPos];
991  }
992  }
993  }
994 
995  //================================================ Release memory
996  delete[] hlpMap;
997 
998  //================================================ Report function completion
999  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map inversion completed." );
1000 
1001  //================================================ Done
1002  return ;
1003 
1004 }

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

949 {
950  //================================================ Initialise local variables
951  double *sigR = NULL, *sigI = NULL, *rcoeffs = NULL, *icoeffs = NULL, *weights = NULL, *workspace = NULL;
952  fftw_plan idctPlan, ifftPlan;
953 
954  //================================================ For each shell
955  for ( int shell = 0; shell < static_cast<int> ( this->noSpheres ); shell++ )
956  {
957  //=========================================== Initialise internal variables
958  proshade_unsign oneDim = this->spheres[shell]->getLocalBandwidth() * 2;
959 
960  //=========================================== Allocate memory
961  ProSHADE_internal_overlay::initialiseInverseSHComputation ( this->spheres[shell]->getLocalBandwidth(), sigR, sigI, rcoeffs, icoeffs, weights, workspace, idctPlan, ifftPlan );
962 
963  //=========================================== Compute weights for the transform using the appropriate shell related band
964  makeweights ( this->spheres[shell]->getLocalBandwidth(), weights );
965 
966  //============================================ Allocate rotated shell mapped data memory
967  this->spheres[shell]->allocateRotatedMap ( );
968 
969  //============================================ Load SH coeffs to arrays
970  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
971  {
972  rcoeffs[iter] = this->rotSphericalHarmonics[shell][iter][0];
973  icoeffs[iter] = this->rotSphericalHarmonics[shell][iter][1];
974  sigR[iter] = 0.0;
975  sigI[iter] = 0.0;
976  }
977 
978  //============================================ Get inverse spherical harmonics transform for the shell
979  InvFST_semi_fly ( rcoeffs,
980  icoeffs,
981  sigR,
982  sigI,
983  this->spheres[shell]->getLocalBandwidth(),
984  workspace,
985  0,
986  this->spheres[shell]->getLocalBandwidth(),
987  &idctPlan,
988  &ifftPlan );
989 
990  //=========================================== Copy the results to the rotated shells array
991  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( oneDim * oneDim ); iter++ )
992  {
993  this->spheres[shell]->setRotatedMappedData ( iter, sigR[iter] );
994  }
995 
996  //=========================================== Release the plans
997  fftw_destroy_plan ( idctPlan );
998  fftw_destroy_plan ( ifftPlan );
999 
1000  //=========================================== Release the memory
1001  delete[] sigR;
1002  delete[] rcoeffs;
1003  delete[] weights;
1004  delete[] workspace;
1005  }
1006 
1007  //================================================ Done
1008  return ;
1009 
1010 }

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

1565 {
1566  //================================================ Report progress
1567  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting sphere mapping procedure." );
1568 
1569  //================================================ Determine spherical harmonics variables
1570  settings->determineAllSHValues ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
1571  this->xDimSize, this->yDimSize, this->zDimSize );
1572  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere settings determined." );
1573 
1574  //================================================ Find number of spheres supported
1575  this->getSpherePositions ( settings );
1576  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere positions obtained." );
1577 
1578  //================================================ Create sphere objects and map the density
1580  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ )
1581  {
1582  std::stringstream ss;
1583  ss << "Now mapping sphere " << iter << " .";
1584  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1585 
1587  this->xDimSize, this->yDimSize, this->zDimSize, iter,
1588  &this->spherePos, settings->progressiveSphereMapping, settings->maxBandwidth,
1589  this->internalMap, &this->maxShellBand );
1590  }
1591 
1592  //================================================ Report completion
1593  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere mapping procedure completed." );
1594 
1595  //================================================ Done
1596  return ;
1597 
1598 }

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

1062 {
1063  //================================================ Report function start
1064  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Computing mask." );
1065 
1066  //================================================ Initialise the blurred map
1067  proshade_double* blurredMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1068  ProSHADE_internal_misc::checkMemoryAllocation ( blurredMap, __FILE__, __LINE__, __func__ );
1069 
1070  //================================================ Compute blurred map
1072  this->xDimSize, this->yDimSize, this->zDimSize, settings->blurFactor );
1073 
1074  //================================================ Compute mask from blurred map and save it into the original map
1076 
1077  //================================================ Print the mask if need be
1078  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 ); } }
1079 
1080  //================================================ Release memory
1081  delete[] blurredMap;
1082 
1083  //================================================ Report function completion
1084  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Mask computed." );
1085 
1086  //================================================ Done
1087  return ;
1088 
1089 }

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

3503 {
3504  //================================================ Mutate
3505  this->eMatrices[band][order1][order2][0] /= normF;
3506  this->eMatrices[band][order1][order2][1] /= normF;
3507 
3508  //================================================ Done
3509  return ;
3510 
3511 }

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

1015 {
1016  //================================================ Report function start
1017  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation." );
1018 
1019  //================================================ Initialise vector of map values
1020  std::vector<proshade_double> mapVals ( this->xDimIndices * this->yDimIndices * this->zDimIndices, 0.0 );
1021 
1022  //================================================ Get all map values
1023  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1024  {
1025  mapVals.at(iter) = this->internalMap[iter];
1026  }
1027 
1028  //================================================ Get mean and sd
1029  proshade_double* meanSD = new proshade_double[2];
1030  ProSHADE_internal_maths::vectorMeanAndSD ( &mapVals, meanSD );
1031 
1032  //================================================ Normalise the values
1033  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1034  {
1035  this->internalMap[iter] = ( this->internalMap[iter] - meanSD[0] ) / meanSD[1];
1036  }
1037 
1038  //================================================ Clear the vector
1039  mapVals.clear ( );
1040 
1041  //================================================ Release memory
1042  delete[] meanSD;
1043 
1044  //================================================ Report function completion
1045  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map normalisation completed." );
1046 
1047  //================================================ Done
1048  return ;
1049 
1050 }

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

1465 {
1466  //================================================ Invert map
1467  if ( settings->invertMap ) { this->invertMirrorMap ( settings ); }
1468  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion (mirror image) not requested." ); }
1469 
1470  //================================================ Normalise map
1471  if ( settings->normaliseMap ) { this->normaliseMap ( settings ); }
1472  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation not requested." ); }
1473 
1474  //================================================ Compute mask
1475  if ( settings->maskMap ) { this->maskMap ( settings ); }
1476  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Masking not requested." ); }
1477 
1478  //================================================ Centre map
1479  if ( settings->moveToCOM ) { this->centreMapOnCOM ( settings ); }
1480  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map centering not requested." ); }
1481 
1482  //================================================ Add extra space
1483  if ( settings->addExtraSpace != 0.0 ) { this->addExtraSpace ( settings ); }
1484  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Extra space not requested." ); }
1485 
1486  //================================================ Remove phase, if required
1487  if ( !settings->usePhase ) { this->removePhaseInormation ( settings ); ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information removed from the data." ); }
1488  else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information retained in the data." ); }
1489 
1490  //================================================ Set settings values which were left on AUTO by user and will not be set later
1491  settings->setVariablesLeftOnAuto ( );
1492 
1493  //================================================ Done
1494  return ;
1495 
1496 }

◆ readInMAP()

void ProSHADE_internal_data::ProSHADE_data::readInMAP ( ProSHADE_settings settings)
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.

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

Definition at line 501 of file ProSHADE_data.cpp.

502 {
503  //================================================ Open the file
504  gemmi::Ccp4<float> map;
505  map.read_ccp4 ( gemmi::MaybeGzipped ( this->fileName.c_str() ) );
506 
507  //================================================ Convert to XYZ and create complete map, if need be
508  map.setup ( gemmi::GridSetup::ReorderOnly, NAN );
509 
510  //================================================ Read in the rest of the map file header
512  &this->xDimIndices, &this->yDimIndices, &this->zDimIndices,
513  &this->xDimSize, &this->yDimSize, &this->zDimSize,
514  &this->aAngle, &this->bAngle, &this->cAngle,
515  &this->xFrom, &this->yFrom, &this->zFrom,
516  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin,
517  &this->xAxisOrder, &this->yAxisOrder, &this->zAxisOrder,
518  &this->xGridIndices, &this->yGridIndices, &this->zGridIndices );
519 
520  //================================================ Save the map density to ProSHADE variable
521  ProSHADE_internal_io::readInMapData ( &map, this->internalMap, this->xDimIndices, this->yDimIndices, this->zDimIndices, this->xAxisOrder, this->yAxisOrder, this->zAxisOrder );
522 
523  //================================================ Set resolution if need be
524  if ( settings->requestedResolution < 0.0 )
525  {
526  settings->setResolution ( std::min ( static_cast<proshade_double> ( this->xDimSize ) / static_cast<proshade_double> ( this->xDimIndices ),
527  std::min ( static_cast<proshade_double> ( this->yDimSize ) / static_cast<proshade_double> ( this->yDimIndices ),
528  static_cast<proshade_double> ( this->zDimSize ) / static_cast<proshade_double> ( this->zDimIndices ) ) ) * 2.0 );
529  }
530 
531  //================================================ Set iterators from and to
532  this->figureIndexStartStop ( );
533 
534  //================================================ If specific resolution is requested, make sure the map has it
535  if ( settings->changeMapResolution || settings->changeMapResolutionTriLinear )
536  {
537  //============================================ Find COM pre map re-sampling
538  proshade_double xMapCOMPreReSampl = 0.0, yMapCOMPreReSampl = 0.0, zMapCOMPreReSampl = 0.0;
539  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xMapCOMPreReSampl, &yMapCOMPreReSampl, &zMapCOMPreReSampl,
540  this->xDimSize, this->yDimSize, this->zDimSize,
541  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
542 
543  //============================================ Get real world start position pre-sampling
544  proshade_double xOrPre = this->xFrom * ( this->xDimSize / static_cast<proshade_double> ( this->xDimIndices ) );
545  proshade_double yOrPre = this->yFrom * ( this->yDimSize / static_cast<proshade_double> ( this->yDimIndices ) );
546  proshade_double zOrPre = this->zFrom * ( this->zDimSize / static_cast<proshade_double> ( this->zDimIndices ) );
547 
548  //============================================ Re-sample map
549  this->reSampleMap ( settings );
550 
551  //============================================ Find COM post map re-sampling
552  proshade_double xMapCOMPostReSampl = 0.0, yMapCOMPostReSampl = 0.0, zMapCOMPostReSampl = 0.0;
553  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xMapCOMPostReSampl, &yMapCOMPostReSampl, &zMapCOMPostReSampl,
554  this->xDimSize, this->yDimSize, this->zDimSize,
555  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
556 
557  //============================================ Get real world start position post sampling
558  proshade_double xOrPst = this->xFrom * ( this->xDimSize / static_cast<proshade_double> ( this->xDimIndices ) );
559  proshade_double yOrPst = this->yFrom * ( this->yDimSize / static_cast<proshade_double> ( this->yDimIndices ) );
560  proshade_double zOrPst = this->zFrom * ( this->zDimSize / static_cast<proshade_double> ( this->zDimIndices ) );
561 
562  //============================================ Final translation
563  proshade_double xFinMov = ( xMapCOMPreReSampl - xMapCOMPostReSampl ) - ( xOrPre - xOrPst );
564  proshade_double yFinMov = ( yMapCOMPreReSampl - yMapCOMPostReSampl ) - ( yOrPre - yOrPst );
565  proshade_double zFinMov = ( zMapCOMPreReSampl - zMapCOMPostReSampl ) - ( zOrPre - zOrPst );
566 
567  //============================================ Remove any sampling induced shift
568  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xFinMov, yFinMov, zFinMov,
569  this->xDimSize, this->yDimSize, this->zDimSize,
570  this->xDimIndices, this->yDimIndices, this->zDimIndices );
571  }
572 
573  //================================================ Save the original sizes
574  this->xDimSizeOriginal = this->xDimSize;
575  this->yDimSizeOriginal = this->yDimSize;
576  this->zDimSizeOriginal = this->zDimSize;
577 
578  //================================================ Save the original index counts
579  this->xDimIndicesOriginal = this->xDimIndices;
580  this->yDimIndicesOriginal = this->yDimIndices;
581  this->zDimIndicesOriginal = this->zDimIndices;
582 
583  //================================================ Save the original axis origins
584  this->xAxisOriginOriginal = this->xAxisOrigin;
585  this->yAxisOriginOriginal = this->yAxisOrigin;
586  this->zAxisOriginOriginal = this->zAxisOrigin;
587 
588  //================================================ Compute and save the COM
589  this->findMapCOM ( );
590  this->originalMapXCom = this->xCom;
591  this->originalMapYCom = this->yCom;
592  this->originalMapZCom = this->zCom;
593 
594  //================================================ Done
595 
596 }

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

608 {
609  //================================================ Set resolution if need be
610  if ( settings->requestedResolution < 0.0 )
611  {
612  settings->setResolution ( 8.0 );
613  }
614 
615  //================================================ Open PDB file for reading
616  gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
617 
618  //================================================ Change B-factors if need be
619  if ( settings->pdbBFactorNewVal >= 0.0 )
620  {
622  }
623 
624  //================================================ Remove waters if required
625  if ( settings->removeWaters )
626  {
628  }
629 
630  //================================================ Get PDB COM values
631  proshade_double xCOMPdb, yCOMPdb, zCOMPdb;
632  ProSHADE_internal_mapManip::findPDBCOMValues ( pdbFile, &xCOMPdb, &yCOMPdb, &zCOMPdb, settings->firstModelOnly );
633 
634  //================================================ Find the ranges
635  proshade_single xF, xT, yF, yT, zF, zT;
636  ProSHADE_internal_mapManip::determinePDBRanges ( pdbFile, &xF, &xT, &yF, &yT, &zF, &zT, settings->firstModelOnly );
637 
638  //================================================ Move ranges to have all FROM values 20
639  proshade_single xMov = 20.0 - xF;
640  proshade_single yMov = 20.0 - yF;
641  proshade_single zMov = 20.0 - zF;
642  ProSHADE_internal_mapManip::movePDBForMapCalc ( &pdbFile, xMov, yMov, zMov, settings->firstModelOnly );
643 
644  //================================================ Set the angstrom sizes
645  this->xDimSize = xT - xF + 40.0;
646  this->yDimSize = yT - yF + 40.0;
647  this->zDimSize = zT - zF + 40.0;
648 
649  //================================================ Generate map from nicely placed atoms (cell size will be range + 40)
650  ProSHADE_internal_mapManip::generateMapFromPDB ( pdbFile, this->internalMap, settings->requestedResolution, this->xDimSize, this->yDimSize, this->zDimSize, &this->xTo, &this->yTo, &this->zTo, settings->forceP1, settings->firstModelOnly );
651 
652  //================================================ Set the internal variables to correct values
653  this->setPDBMapValues ( );
654 
655  //================================================ Compute reverse movement based on COMs. If there is more than 1 models, simply moving back the xyzMov is not enough.
656  proshade_double xCOMMap, yCOMMap, zCOMMap;
657  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xCOMMap, &yCOMMap, &zCOMMap,
658  this->xDimSize, this->yDimSize, this->zDimSize,
659  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
660 
661  if ( pdbFile.models.size() > 1 )
662  {
663  xMov = xCOMMap - xCOMPdb;
664  yMov = yCOMMap - yCOMPdb;
665  zMov = zCOMMap - zCOMPdb;
666  }
667 
668  //================================================ Move map back to the original PDB location
669  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize,
670  &this->xFrom, &this->xTo, &this->yFrom, &this->yTo, &this->zFrom, &this->zTo,
671  &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
672  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
673  this->xDimIndices, this->yDimIndices, this->zDimIndices );
674 
675  //================================================ If specific resolution is requested, make sure the map has it
676  if ( settings->changeMapResolution || settings->changeMapResolutionTriLinear )
677  {
678  //============================================ Find COM pre map re-sampling
679  proshade_double xMapCOMPreReSampl = 0.0, yMapCOMPreReSampl = 0.0, zMapCOMPreReSampl = 0.0;
680  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xMapCOMPreReSampl, &yMapCOMPreReSampl, &zMapCOMPreReSampl,
681  this->xDimSize, this->yDimSize, this->zDimSize,
682  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
683 
684  //============================================ Get real world start position pre-sampling
685  proshade_double xOrPre = this->xFrom * ( this->xDimSize / static_cast<proshade_double> ( this->xDimIndices ) );
686  proshade_double yOrPre = this->yFrom * ( this->yDimSize / static_cast<proshade_double> ( this->yDimIndices ) );
687  proshade_double zOrPre = this->zFrom * ( this->zDimSize / static_cast<proshade_double> ( this->zDimIndices ) );
688 
689  //============================================ Re-sample map
690  this->reSampleMap ( settings );
691 
692  //============================================ Find COM post map re-sampling
693  proshade_double xMapCOMPostReSampl = 0.0, yMapCOMPostReSampl = 0.0, zMapCOMPostReSampl = 0.0;
694  ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xMapCOMPostReSampl, &yMapCOMPostReSampl, &zMapCOMPostReSampl,
695  this->xDimSize, this->yDimSize, this->zDimSize,
696  this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
697 
698  //============================================ Get real world start position post sampling
699  proshade_double xOrPst = this->xFrom * ( this->xDimSize / static_cast<proshade_double> ( this->xDimIndices ) );
700  proshade_double yOrPst = this->yFrom * ( this->yDimSize / static_cast<proshade_double> ( this->yDimIndices ) );
701  proshade_double zOrPst = this->zFrom * ( this->zDimSize / static_cast<proshade_double> ( this->zDimIndices ) );
702 
703  //============================================ Final translation
704  proshade_double xFinMov = ( xMapCOMPreReSampl - xMapCOMPostReSampl ) - ( xOrPre - xOrPst );
705  proshade_double yFinMov = ( yMapCOMPreReSampl - yMapCOMPostReSampl ) - ( yOrPre - yOrPst );
706  proshade_double zFinMov = ( zMapCOMPreReSampl - zMapCOMPostReSampl ) - ( zOrPre - zOrPst );
707 
708  //============================================ Remove any sampling induced shift
709  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xFinMov, yFinMov, zFinMov,
710  this->xDimSize, this->yDimSize, this->zDimSize,
711  this->xDimIndices, this->yDimIndices, this->zDimIndices );
712  }
713 
714  //================================================ Save the original sizes
715  this->xDimSizeOriginal = this->xDimSize;
716  this->yDimSizeOriginal = this->yDimSize;
717  this->zDimSizeOriginal = this->zDimSize;
718 
719  //================================================ Save the original index counts
720  this->xDimIndicesOriginal = this->xDimIndices;
721  this->yDimIndicesOriginal = this->yDimIndices;
722  this->zDimIndicesOriginal = this->zDimIndices;
723 
724  //================================================ Save the original axis origins
725  this->xAxisOriginOriginal = this->xAxisOrigin;
726  this->yAxisOriginOriginal = this->yAxisOrigin;
727  this->zAxisOriginOriginal = this->zAxisOrigin;
728 
729  //================================================ Compute and save the COM
730  this->findMapCOM ( );
731  this->originalMapXCom = this->xCom;
732  this->originalMapYCom = this->yCom;
733  this->originalMapZCom = this->zCom;
734 
735  //================================================ Done
736  return;
737 
738 }

◆ readInStructure()

void ProSHADE_internal_data::ProSHADE_data::readInStructure ( std::string  fName,
proshade_unsign  inputO,
ProSHADE_settings settings 
)

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.

Definition at line 447 of file ProSHADE_data.cpp.

448 {
449  //================================================ Report function start
450  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting to read the structure: " + fName );
451 
452  //================================================ Check if instance is empty
453  if ( !this->isEmpty )
454  {
455  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 );
456  }
457 
458  //================================================ Save the filename
459  this->fileName = fName;
460 
461  //================================================ Check what is the input format
463 
464  //================================================ Save input order
465  this->inputOrder = inputO;
466 
467  //================================================ Decide how to proceed
468  switch ( this->fileType )
469  {
470  case ProSHADE_internal_io::UNKNOWN:
471  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." );
472  break;
473 
474  case ProSHADE_internal_io::PDB:
475  this->readInPDB ( settings );
476  break;
477 
478  case ProSHADE_internal_io::MAP:
479  this->readInMAP ( settings );
480  break;
481  }
482 
483  //================================================ This structure is now full
484  this->isEmpty = false;
485 
486  //================================================ Report function completion
487  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Structure read in successfully." );
488 
489  //================================================ Done
490  return ;
491 
492 }

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

3051 {
3052  //================================================ Report function start
3053  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
3054 
3055  //================================================ Copy map for processing
3056  fftw_complex* mapCoeffs = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3057  fftw_complex* pattersonMap = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3058 
3059  //================================================ Check memory allocation
3060  ProSHADE_internal_misc::checkMemoryAllocation ( mapCoeffs, __FILE__, __LINE__, __func__ );
3061  ProSHADE_internal_misc::checkMemoryAllocation ( pattersonMap, __FILE__, __LINE__, __func__ );
3062 
3063  //================================================ Copy data to mask
3064  for ( proshade_unsign iter = 0; iter < (this->xDimIndices * this->yDimIndices * this->zDimIndices); iter++ )
3065  {
3066  pattersonMap[iter][0] = this->internalMap[iter];
3067  pattersonMap[iter][1] = 0.0;
3068  }
3069 
3070  //================================================ Prepare FFTW plans
3071  fftw_plan forward = fftw_plan_dft_3d ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
3072  pattersonMap, mapCoeffs, FFTW_FORWARD, FFTW_ESTIMATE );
3073  fftw_plan inverse = fftw_plan_dft_3d ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
3074  mapCoeffs, pattersonMap, FFTW_BACKWARD, FFTW_ESTIMATE );
3075 
3076  //================================================ Run forward Fourier
3077  fftw_execute ( forward );
3078 
3079  //================================================ Remove the phase
3081 
3082  //================================================ Run inverse Fourier
3083  fftw_execute ( inverse );
3084 
3085  //================================================ Save the results
3086  proshade_signed mapIt, patIt, patX, patY, patZ;
3087  for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
3088  {
3089  for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
3090  {
3091  for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
3092  {
3093  //==================================== Centre patterson map
3094  patX = xIt - ( static_cast<proshade_signed> ( this->xDimIndices ) / 2 ); if ( patX < 0 ) { patX += this->xDimIndices; }
3095  patY = yIt - ( static_cast<proshade_signed> ( this->yDimIndices ) / 2 ); if ( patY < 0 ) { patY += this->yDimIndices; }
3096  patZ = zIt - ( static_cast<proshade_signed> ( this->zDimIndices ) / 2 ); if ( patZ < 0 ) { patZ += this->zDimIndices; }
3097 
3098  //==================================== Find indices
3099  mapIt = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
3100  patIt = patZ + this->zDimIndices * ( patY + this->yDimIndices * patX );
3101 
3102  //==================================== Copy
3103  this->internalMap[mapIt] = pattersonMap[patIt][0];
3104  }
3105  }
3106  }
3107 
3108  //================================================ Release memory
3109  delete[] pattersonMap;
3110  delete[] mapCoeffs;
3111 
3112  //================================================ Delete FFTW plans
3113  fftw_destroy_plan ( forward );
3114  fftw_destroy_plan ( inverse );
3115 
3116  //================================================ Report function completion
3117  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Phase information removed." );
3118 
3119  //================================================ Done
3120  return ;
3121 
3122 }

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

3875 {
3876  //================================================ Empty line
3878 
3879  //================================================ Write out rotation centre translation results
3880  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);
3881  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotCen.str() );
3882 
3883  //================================================ Write out rotation matrix about origin
3884  proshade_double* rotMat = new proshade_double[9];
3885  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
3886  ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( eulerAngles->at(0), eulerAngles->at(1), eulerAngles->at(2), rotMat );
3887 
3888  std::stringstream rotMatSS;
3889  rotMatSS << std::setprecision (3) << std::showpos << "The rotation matrix about origin is : " << rotMat[0] << " " << rotMat[1] << " " << rotMat[2] << std::endl;
3890  rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[3] << " " << rotMat[4] << " " << rotMat[5] << std::endl;
3891  rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[6] << " " << rotMat[7] << " " << rotMat[8];
3892  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotMatSS.str() );
3893 
3894  delete[] rotMat;
3895 
3896  //================================================ Write out origin to overlay translation results
3897  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);
3898  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, finTrs.str() );
3899 
3900  //================================================ Done
3901  return ;
3902 
3903 }

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

2847 {
2848  //================================================ Improve this!
2849  if ( settings->recommendedSymmetryType == "" )
2850  {
2851  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, "Did not detect any symmetry!" );
2852  }
2853  else
2854  {
2855  std::stringstream ssHlp;
2856  ssHlp << std::endl << "Detected " << settings->recommendedSymmetryType << " symmetry with fold " << settings->recommendedSymmetryFold << " .";
2857  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2858 
2859  if ( settings->detectedSymmetry.size() > 0 )
2860  {
2861  ssHlp.clear(); ssHlp.str ( "" );
2862  ssHlp << " Fold X Y Z Angle Height";
2863  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2864  }
2865  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ); symIt++ )
2866  {
2867  ssHlp.clear(); ssHlp.str ( "" );
2868  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];
2869  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2870  }
2871 
2872  std::stringstream hlpSS3;
2873  ssHlp.clear(); ssHlp.str ( "" );
2874  hlpSS3 << std::endl << "However, since the selection of the recommended symmetry needs improvement, here is a list of all detected C symmetries:";
2875  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, hlpSS3.str() );
2876 
2877  if ( settings->allDetectedCAxes.size() > 0 )
2878  {
2879  ssHlp.clear(); ssHlp.str ( "" );
2880  ssHlp << " Fold X Y Z Angle Height";
2881  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2882  }
2883  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->allDetectedCAxes.size() ); symIt++ )
2884  {
2885  ssHlp.clear(); ssHlp.str ( "" );
2886  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];
2887  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2888  }
2889 
2890  hlpSS3.clear(); hlpSS3.str ( "" );
2891  hlpSS3 << std::endl << "Also, for the same reason, here is a list of all detected D symmetries:";
2892  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, hlpSS3.str() );
2893 
2894  if ( settings->allDetectedDAxes.size() > 0 )
2895  {
2896  ssHlp.clear(); ssHlp.str ( "" );
2897  ssHlp << " Fold X Y Z Angle Height";
2898  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2899  }
2900  for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->allDetectedDAxes.size() ); symIt++ )
2901  {
2902  ssHlp.clear(); ssHlp.str ( "" );
2903  ssHlp << std::showpos << std::fixed << std::setprecision(0) << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[0] << std::setprecision(5) << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[1] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[2] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[3] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[4] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(0))[5];
2904  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2905 
2906  for ( proshade_unsign axIt = 1; axIt < static_cast<proshade_unsign> ( settings->allDetectedDAxes.at(symIt).size() ); axIt++ )
2907  {
2908  ssHlp.clear(); ssHlp.str ( "" );
2909  ssHlp << std::showpos << std::fixed << std::setprecision(0) << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[0] << std::setprecision(5) << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[1] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[2] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[3] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[4] << " " << settings->allDetectedCAxes.at(settings->allDetectedDAxes.at(symIt).at(axIt))[5];
2910  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2911  }
2912 
2913  ssHlp.clear(); ssHlp.str ( "" );
2914  ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2915  }
2916 
2917  }
2918 
2919  //================================================ Done
2920  return ;
2921 
2922 }

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

1223 {
1224  //================================================ Initialise the return variable
1225  proshade_single* changeVals = new proshade_single[6];
1226 
1227  //================================================ Now re-sample the map
1228  if ( settings->changeMapResolution )
1229  {
1230  ProSHADE_internal_mapManip::reSampleMapToResolutionFourier ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1231  this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1232 
1233  if ( settings->changeMapResolutionTriLinear )
1234  {
1235  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" );
1236  }
1237  }
1238  if ( settings->changeMapResolutionTriLinear && !settings->changeMapResolution )
1239  {
1240  ProSHADE_internal_mapManip::reSampleMapToResolutionTrilinear ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1241  this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1242 
1243  }
1244 
1245  //================================================ Set the internal values to reflect the new map size
1246  this->xDimIndices += static_cast<proshade_unsign> ( changeVals[0] );
1247  this->yDimIndices += static_cast<proshade_unsign> ( changeVals[1] );
1248  this->zDimIndices += static_cast<proshade_unsign> ( changeVals[2] );
1249 
1250  this->xGridIndices = this->xDimIndices;
1251  this->yGridIndices = this->yDimIndices;
1252  this->zGridIndices = this->zDimIndices;
1253 
1254  this->xTo += static_cast<proshade_unsign> ( changeVals[0] );
1255  this->yTo += static_cast<proshade_unsign> ( changeVals[1] );
1256  this->zTo += static_cast<proshade_unsign> ( changeVals[2] );
1257 
1258  this->xDimSize = changeVals[3];
1259  this->yDimSize = changeVals[4];
1260  this->zDimSize = changeVals[5];
1261 
1262  //================================================ Figure how much the new map moved
1263  proshade_single xMov = -( ( this->xFrom * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices - changeVals[0] ) ) ) -
1264  ( this->xFrom * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) ) ) );
1265  proshade_single yMov = -( ( this->yFrom * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices - changeVals[1] ) ) ) -
1266  ( this->yFrom * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) ) ) );
1267  proshade_single zMov = -( ( this->zFrom * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices - changeVals[2] ) ) ) -
1268  ( this->zFrom * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) ) ) );
1269 
1270  //================================================ Move by indices (this should be sufficient)
1271  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize, &this->xFrom, &this->xTo,
1272  &this->yFrom, &this->yTo, &this->zFrom, &this->zTo, &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
1273 
1274  ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
1275  this->xDimIndices, this->yDimIndices, this->zDimIndices );
1276 
1277  //================================================ Release memory
1278  delete[] changeVals;
1279 
1280  //================================================ Done
1281  return ;
1282 
1283 }

◆ rotateMap()

void ProSHADE_internal_data::ProSHADE_data::rotateMap ( 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 736 of file ProSHADE_overlay.cpp.

737 {
738  //================================================ Set maximum comparison bandwidth to maximum object bandwidth
739  this->maxCompBand = this->spheres[this->noSpheres-1]->getLocalBandwidth();
740 
741  //================================================ Save map COM after processing but before rotation
742  this->findMapCOM ( );
743  this->mapCOMProcessChangeX = this->xCom - this->originalMapXCom;
744  this->mapCOMProcessChangeY = this->yCom - this->originalMapYCom;
745  this->mapCOMProcessChangeZ = this->zCom - this->originalMapZCom;
746 
747  //================================================ Compute the Wigner D matrices for the Euler angles
748  ProSHADE_internal_wigner::computeWignerMatricesForRotation ( settings, this, -eulerAlpha, eulerBeta, -eulerGamma );
749 
750  //================================================ Initialise rotated Spherical Harmonics memory
751  this->allocateRotatedSHMemory ( settings );
752 
753  //================================================ Multiply SH coeffs by Wigner
754  this->computeRotatedSH ( settings );
755 
756  //================================================ Inverse the SH coeffs to shells
757  this->invertSHCoefficients ( );
758 
759  //================================================ Find spherical cut-offs
760  std::vector<proshade_double> lonCO, latCO;
761  ProSHADE_internal_overlay::computeAngularThreshold ( &lonCO, &latCO, settings->maxBandwidth * 2 );
762 
763  //================================================ Allocate memory for the rotated map
764  proshade_double *densityMapRotated = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
765  ProSHADE_internal_misc::checkMemoryAllocation ( densityMapRotated, __FILE__, __LINE__, __func__ );
766  for ( unsigned int iter = 0; iter < static_cast<unsigned int> ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ ) { densityMapRotated[iter] = 0.0; }
767 
768  //================================================ Interpolate onto cartesian grid
769  this->interpolateMapFromSpheres ( settings, densityMapRotated );
770 
771  //================================================ Copy map
772  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
773  {
774  this->internalMap[iter] = densityMapRotated[iter];
775  }
776 
777  //================================================ Release rotated map (original is now rotated)
778  delete[] densityMapRotated;
779 
780  //================================================ Done
781  return ;
782 
783 }

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

1897 {
1898  //================================================ Initialise variables
1899  bool isArgSameAsSettings = true;
1900 
1901  //================================================ For each detected point group
1902  for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( CSyms->size() ); cIt++ )
1903  {
1904  //============================================ Create vector to replace the pointer
1905  std::vector< proshade_double > nextSym;
1906  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[0] );
1907  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[1] );
1908  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[2] );
1909  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[3] );
1910  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[4] );
1911  ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[5] );
1913 
1914  //============================================ Copy the vector to output variable and if different, then also to settings object
1915  if ( ( cIt == 0 ) && ( settings->allDetectedCAxes.size() == 0 ) ) { isArgSameAsSettings = false; }
1916  if ( !isArgSameAsSettings ) { ProSHADE_internal_misc::addToDoubleVectorVector ( &settings->allDetectedCAxes, nextSym ); }
1917 
1918  //============================================ Release memory
1919  nextSym.clear ( );
1920  delete[] CSyms->at(cIt);
1921  }
1922 
1923  //================================================ Done
1924  return ;
1925 
1926 }

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

This function takes all the detected symmetry results and decides on which are to be recommended for this structure.

This function starts by obtaining the scores (fold weighted height averages) for each of the detectable symmetry types. Then, it proceeds to compute which of these should be recommended by ProSHADE based on a little shaky combination of axes number and score. This part needs to be improved by using ML estimation, when I get the time.

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.

Definition at line 2135 of file ProSHADE_data.cpp.

2136 {
2137  //================================================ Initialise variables
2138  proshade_double cScore = 0.0, dScore = 0.0, tScore = 0.0, oScore = 0.0, iScore = 0.0;
2139  proshade_unsign bestCIndex, bestDIndex;
2140 
2141  //================================================ Find a score for each input symmetry type.
2142  cScore = this->findBestCScore ( CSym, &bestCIndex );
2143  dScore = this->findBestDScore ( DSym, &bestDIndex );
2144  tScore = this->findTScore ( TSym );
2145  oScore = this->findOScore ( OSym );
2146  iScore = this->findIScore ( ISym );
2147 
2148  //================================================ Find the best available score - !!! Modified weights for the predicted symmetries as they have heights 0.0 (predicted) ...
2149  proshade_double bestWeightedScore = std::max ( cScore, std::max ( dScore * 1.1, std::max ( tScore * 3000.0, std::max ( oScore * 4000.0, iScore * 5000.0 ) ) ) );
2150 
2151  //================================================ No score? Well, no symmetry.
2152  if ( bestWeightedScore < 0.05 ) { settings->setRecommendedSymmetry ( "" ); return; }
2153 
2154  if ( bestWeightedScore == cScore )
2155  {
2156  settings->setRecommendedSymmetry ( "C" );
2157  settings->setRecommendedFold ( CSym->at(bestCIndex)[0] );
2158  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(bestCIndex) );
2159  if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at(bestCIndex) ); }
2160 
2161  //============================================ Warn if resolution does not really support this fold
2162  if ( ( ( 360.0 / static_cast<double> ( CSym->at(bestCIndex)[0] ) ) - ( 360.0 / static_cast<double> ( CSym->at(bestCIndex)[0] + 1 ) ) ) <
2163  ( 360.0 / static_cast<double> ( settings->maxBandwidth * 4.0 ) ) )
2164  {
2165  std::stringstream hlpSS;
2166  hlpSS << "!!! ProSHADE WARNING !!! Reporting symmetry C" << CSym->at(bestCIndex)[0] << ", however, the grid sampling does not provide reasonable accuracy for symmetry with such high fold and therefore ProSHADE cannot responsibly claim this symmetry to be correct. It is suggested that the grid sampling is increased for more accurate symmetry detection. (Set higher resolution using -r).";
2167  ProSHADE_internal_messages::printWarningMessage ( settings->verbose, hlpSS.str(), "WS00054" );
2168  }
2169  }
2170  if ( bestWeightedScore == dScore * 1.1 )
2171  {
2172  settings->setRecommendedSymmetry ( "D" );
2173  settings->setRecommendedFold ( std::max ( DSym->at(bestDIndex)[0], DSym->at(bestDIndex)[6] ) );
2174  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, DSym->at(bestDIndex) );
2175  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestDIndex)[6] );
2176  if ( settings->detectedSymmetry.size() == 0 )
2177  {
2178  settings->setDetectedSymmetry ( DSym->at(bestDIndex) );
2179  settings->setDetectedSymmetry ( &DSym->at(bestDIndex)[6] );
2180  }
2181 
2182  //============================================ Warn if resolution does not really support this fold
2183  if ( ( ( 360.0 / static_cast<double> ( std::max ( DSym->at(bestDIndex)[0], DSym->at(bestDIndex)[6] ) ) ) - ( 360.0 / static_cast<double> ( std::max ( DSym->at(bestDIndex)[0], DSym->at(bestDIndex)[6] ) + 1 ) ) ) <
2184  ( 360.0 / static_cast<double> ( settings->maxBandwidth * 4.0 ) ) )
2185  {
2186  std::stringstream hlpSS;
2187  hlpSS << "!!! ProSHADE WARNING !!! Reporting symmetry D" << std::max ( DSym->at(bestDIndex)[0], DSym->at(bestDIndex)[6] ) << ", however, the grid sampling does not provide reasonable accuracy for symmetry with such high fold and therefore ProSHADE cannot responsibly claim this symmetry to be correct. It is suggested that the grid sampling is increased for more accurate symmetry detection. (Set higher resolution using -r).";
2188  ProSHADE_internal_messages::printWarningMessage ( settings->verbose, hlpSS.str(), "WS00054" );
2189  }
2190  }
2191  if ( bestWeightedScore == tScore * 3000.0 )
2192  {
2193  settings->setRecommendedSymmetry ( "T" );
2194  settings->setRecommendedFold ( 0 );
2195  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, TSym->at(it) ); }
2196  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSym->size() ); it++ ) { settings->setDetectedSymmetry ( TSym->at(it) ); } }
2197  }
2198  if ( bestWeightedScore == oScore * 4000.0 )
2199  {
2200  settings->setRecommendedSymmetry ( "O" );
2201  settings->setRecommendedFold ( 0 );
2202  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, OSym->at(it) ); }
2203  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSym->size() ); it++ ) { settings->setDetectedSymmetry ( OSym->at(it) ); } }
2204  }
2205  if ( bestWeightedScore == iScore * 5000.0 )
2206  {
2207  settings->setRecommendedSymmetry ( "I" );
2208  settings->setRecommendedFold ( 0 );
2209  for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, ISym->at(it) ); }
2210  if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISym->size() ); it++ ) { settings->setDetectedSymmetry ( ISym->at(it) ); } }
2211  }
2212 
2213  //================================================ Done
2214  return ;
2215 
2216 }

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

2230 {
2231  //================================================ Initialise variables
2232  proshade_unsign bestIndex = 0;
2233  proshade_double highestSym = 0.0;
2234 
2235  //================================================ Search for best fold
2236  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( CSym->size() ); iter++ )
2237  {
2238  //============================================ Check if it is tbe correct fold
2239  if ( CSym->at(iter)[0] != settings->requestedSymmetryFold ) { continue; }
2240 
2241  //============================================ If correct, is it the highest found?
2242  if ( CSym->at(iter)[5] > highestSym )
2243  {
2244  highestSym = CSym->at(iter)[5];
2245  bestIndex = iter;
2246  }
2247  }
2248 
2249  //================================================ Found?
2250  if ( highestSym > 0.0 )
2251  {
2252  settings->setRecommendedSymmetry ( "C" );
2253  settings->setRecommendedFold ( CSym->at(bestIndex)[0] );
2254  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(bestIndex) );
2255 
2256  if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at(bestIndex) ); }
2257  }
2258  else
2259  {
2260  settings->setRecommendedSymmetry ( "" );
2261  settings->setRecommendedFold ( 0 );
2262  }
2263 
2264  //================================================ Done
2265  return ;
2266 
2267 }

◆ saveRequestedSymmetryD()

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

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

2281 {
2282  //================================================ Initialise variables
2283  proshade_unsign bestIndex = 0;
2284  proshade_double highestSym = 0.0;
2285 
2286  //================================================ Search for best fold
2287  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( DSym->size() ); iter++ )
2288  {
2289  //============================================ Check if it is tbe correct fold
2290  if ( std::max ( DSym->at(iter)[0], DSym->at(iter)[6] ) != settings->requestedSymmetryFold ) { continue; }
2291 
2292  //============================================ If correct, is it the highest found?
2293  if ( ( DSym->at(iter)[5] + DSym->at(iter)[11] ) > highestSym )
2294  {
2295  highestSym = ( DSym->at(iter)[5] + DSym->at(iter)[11] );
2296  bestIndex = iter;
2297  }
2298  }
2299 
2300  //================================================ Found?
2301  if ( highestSym > 0.0 )
2302  {
2303  settings->setRecommendedSymmetry ( "D" );
2304  settings->setRecommendedFold ( std::max ( DSym->at(bestIndex)[0], DSym->at(bestIndex)[6] ) );
2305  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, DSym->at(bestIndex) );
2306  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestIndex)[6] );
2307 
2308  if ( settings->detectedSymmetry.size() == 0 )
2309  {
2310  settings->setDetectedSymmetry ( DSym->at(bestIndex) );
2311  settings->setDetectedSymmetry ( &DSym->at(bestIndex)[6] );
2312  }
2313  }
2314  else
2315  {
2316  settings->setRecommendedSymmetry ( "" );
2317  settings->setRecommendedFold ( 0 );
2318  }
2319 
2320  //================================================ Done
2321  return ;
2322 
2323 }

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

3485 {
3486  //================================================ Mutate
3487  this->eMatrices[band][order1][order2][0] = val[0];
3488  this->eMatrices[band][order1][order2][1] = val[1];
3489 
3490  //================================================ Done
3491  return ;
3492 
3493 }

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

3454 {
3455  //================================================ Mutate
3456  this->integrationWeight = intW;
3457 
3458  //================================================ Done
3459  return ;
3460 
3461 }

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

3468 {
3469  //================================================ Mutate
3470  this->integrationWeight += intW;
3471 
3472  //================================================ Done
3473  return ;
3474 
3475 }

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

745 {
746  //================================================ Set starts to 0
747  this->xFrom = 0;
748  this->yFrom = 0;
749  this->zFrom = 0;
750 
751  //================================================ Set angles to 90 degrees
752  this->aAngle = 90.0;
753  this->bAngle = 90.0;
754  this->cAngle = 90.0;
755 
756  //================================================ Set dimension sizes in indices
757  this->xDimIndices = this->xTo;
758  this->yDimIndices = this->yTo;
759  this->zDimIndices = this->zTo;
760 
761  //================================================ Set grid indexing to cell indexing
762  this->xGridIndices = this->xDimIndices;
763  this->yGridIndices = this->yDimIndices;
764  this->zGridIndices = this->zDimIndices;
765 
766  //================================================ Set axis order
767  this->xAxisOrder = 1;
768  this->yAxisOrder = 2;
769  this->zAxisOrder = 3;
770 
771  //================================================ Set origin to the first index
772  this->xAxisOrigin = this->xFrom;
773  this->yAxisOrigin = this->yFrom;
774  this->zAxisOrigin = this->zFrom;
775 
776  //================================================ Done
777  return ;
778 
779 }

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

3519 {
3520  //================================================ Mutate
3521  this->so3Coeffs[position][0] = val[0];
3522  this->so3Coeffs[position][1] = val[1];
3523 
3524  //================================================ Done
3525  return ;
3526 
3527 }

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

3537 {
3538  //================================================ Mutate
3539  this->wignerMatrices[band][order1][order2][0] = val[0];
3540  this->wignerMatrices[band][order1][order2][1] = val[1];
3541 
3542  //================================================ Done
3543  return ;
3544 
3545 }

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

3031 {
3032  if ( this->spheres[shell]->getLocalBandwidth( ) >= bandVal )
3033  {
3034  return ( true );
3035  }
3036  else
3037  {
3038  return ( false );
3039  }
3040 }

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

3633 {
3634  //================================================ Return the value
3635  return ( static_cast<int> ( so3CoefLoc ( order1, order2, band, this->getMaxBand() ) ) );
3636 }

◆ translateMap()

void ProSHADE_internal_data::ProSHADE_data::translateMap ( ProSHADE_settings settings,
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 795 of file ProSHADE_overlay.cpp.

796 {
797  //================================================ Initialise local variables
798  proshade_single xMov = -trsX, yMov = -trsY, zMov = -trsZ;
799 
800  //================================================ Move the whole map frame to minimise the Fourier movement
801  ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
802  this->getXFromPtr(), this->getXToPtr(), this->getYFromPtr(), this->getYToPtr(),
803  this->getZFromPtr(), this->getZToPtr(), this->getXAxisOrigin(), this->getYAxisOrigin(), this->getZAxisOrigin() );
804 
805  //================================================ Finalise the movement by in-frame Fourier movement
806  ProSHADE_internal_mapManip::moveMapByFourier ( this->getInternalMap(), xMov, yMov, zMov, this->getXDimSize(), this->getYDimSize(), this->getZDimSize(),
807  this->getXDim(), this->getYDim(), this->getZDim() );
808 
809  //================================================ Done
810  return ;
811 
812 }

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

808 {
809  //================================================ Create and prepare new Grid gemmi object
810  gemmi::Grid<float> mapData;
811  mapData.set_unit_cell ( this->xDimSize, this->yDimSize, this->zDimSize, this->aAngle, this->bAngle, this->cAngle );
812  mapData.set_size_without_checking ( this->xDimIndices, this->yDimIndices, this->zDimIndices );
813  mapData.axis_order = gemmi::AxisOrder::XYZ;
814  mapData.spacegroup = &gemmi::get_spacegroup_p1();
815 
816  //================================================ Create and prepare new Ccp4 gemmi object
817  gemmi::Ccp4<float> map;
818  map.grid = mapData;
819  map.update_ccp4_header ( mode );
820 
821  //================================================ Fill in the header
823  this->xDimIndices, this->yDimIndices, this->zDimIndices,
824  this->xDimSize, this->yDimSize, this->zDimSize,
825  this->aAngle, this->bAngle, this->cAngle,
826  this->xFrom, this->yFrom, this->zFrom,
827  this->xAxisOrigin, this->yAxisOrigin, this->zAxisOrigin,
828  this->xAxisOrder, this->yAxisOrder, this->zAxisOrder,
829  this->xGridIndices, this->yGridIndices, this->zGridIndices,
830  title, mode );
831 
832  //================================================ Copy internal map to grid
833  proshade_unsign arrPos = 0;
834  for ( proshade_unsign uIt = 0; uIt < this->xDimIndices; uIt++ )
835  {
836  for ( proshade_unsign vIt = 0; vIt < this->yDimIndices; vIt++ )
837  {
838  for ( proshade_unsign wIt = 0; wIt < this->zDimIndices; wIt++ )
839  {
840  arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
841  map.grid.set_value ( uIt, vIt, wIt, static_cast<float> ( this->internalMap[arrPos] ) );
842  }
843  }
844  }
845 
846  //================================================ Update the statistics in the header
847  map.update_ccp4_header ( mode, true );
848 
849  //================================================ Write out the map
850  map.write_ccp4_map ( fName );
851 
852  //================================================ Done
853  return ;
854 
855 }

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

924 {
925  //================================================ Allocate the memory
926  proshade_double* hlpMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
927  ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
928 
929  //================================================ Copy original map and over-write with the mask
930  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
931  {
932  hlpMap[iter] = this->internalMap[iter];
933  this->internalMap[iter] = mask[iter];
934  }
935 
936  //================================================ Write out the mask
937  this->writeMap ( fName );
938 
939  //================================================ Copy the original map values back
940  for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
941  {
942  this->internalMap[iter] = hlpMap[iter];
943  }
944 
945  //================================================ Release memory
946  delete[] hlpMap;
947 
948  //================================================ Done
949  return ;
950 }

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

3841 {
3842  //================================================ Write out rotated map
3843  std::stringstream fNameHlp;
3844  fNameHlp << settings->overlayStructureName << ".map";
3845  this->writeMap ( fNameHlp.str() );
3846 
3847  //================================================ Write out rotated co-ordinates if possible
3848  if ( ProSHADE_internal_io::isFilePDB ( this->fileName ) )
3849  {
3850  fNameHlp.str("");
3851  fNameHlp << settings->overlayStructureName << ".pdb";
3852  this->writePdb ( fNameHlp.str(), eulA, eulB, eulG, ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2), settings->firstModelOnly );
3853  }
3854 
3855  //================================================ Write out the json file with the results
3856  ProSHADE_internal_io::writeRotationTranslationJSON ( rotCentre->at(0), rotCentre->at(1), rotCentre->at(2),
3857  eulA, eulB, eulG,
3858  ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2),
3859  settings->rotTrsJSONFile );
3860 
3861  //================================================ Done
3862  return ;
3863 
3864 }

◆ 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,
bool  firstModel = true 
)

This function writes out the PDB formatted file coresponding to the structure so that its COM is at specific position.

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, rotate and translate them according to the arguments and then write the resulting co-ordinates into a new file.

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]firstModelShould only the first model, or rather all of them be used?

Definition at line 872 of file ProSHADE_data.cpp.

873 {
874  //================================================ Check for co-ordinate origin
875  if ( !ProSHADE_internal_io::isFilePDB ( this->fileName ) )
876  {
877  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." );
878  }
879 
880  //================================================ Open PDB file for reading
881  gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
882 
883  //================================================ If the map was rotated, do the same for the co-ordinates, making sure we take into account the rotation centre of the map
884  if ( ( euA != 0.0 ) || ( euB != 0.0 ) || ( euG != 0.0 ) )
885  {
886  //============================================ Rotate the co-ordinates
887  ProSHADE_internal_mapManip::rotatePDBCoordinates ( &pdbFile, euA, euB, euG, this->originalPdbRotCenX, this->originalPdbRotCenY, this->originalPdbRotCenZ, firstModel );
888  }
889 
890  //================================================ Translate by required translation and the map centering (if applied)
891  ProSHADE_internal_mapManip::translatePDBCoordinates ( &pdbFile, trsX, trsY, trsZ, firstModel );
892 
893  //================================================ Write the PDB file
894  std::ofstream outCoOrdFile;
895  outCoOrdFile.open ( fName.c_str() );
896 
897  if ( outCoOrdFile.is_open() )
898  {
899  gemmi::PdbWriteOptions opt;
900  write_pdb ( pdbFile, outCoOrdFile, opt );
901  }
902  else
903  {
904  std::stringstream hlpMessage;
905  hlpMessage << "Failed to open the PDB file " << fName << " for output.";
906  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." );
907  }
908 
909  outCoOrdFile.close ( );
910 
911  //================================================ Done
912  return ;
913 }

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

599 {
600  //================================================ Sanity check
601  if ( ( this->xDimIndices > xDim ) || ( this->yDimIndices > yDim ) || ( this->zDimIndices > zDim ) )
602  {
603  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." );
604  }
605 
606  //================================================ If done, do nothing
607  if ( ( this->xDimIndices == xDim ) && ( this->yDimIndices == yDim ) && ( this->zDimIndices == zDim ) ) { return ; }
608 
609  //================================================ Find out how many zeroes need to be added before and after
610  proshade_unsign addXPre, addYPre, addZPre, addXPost, addYPost, addZPost;
611  ProSHADE_internal_overlay::computeBeforeAfterZeroCounts ( &addXPre, &addYPre, &addZPre, &addXPost, &addYPost, &addZPost, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices );
612 
613  //================================================ Create a new map
614  proshade_double* newMap = new proshade_double [xDim * yDim * zDim];
615 
616  //================================================ Do the hard work
617  ProSHADE_internal_overlay::paddMapWithZeroes ( this->internalMap, newMap, xDim, yDim, zDim, this->xDimIndices, this->yDimIndices, this->zDimIndices, addXPre, addYPre, addZPre );
618 
619  //================================================ Create a new internal map and copy
620  delete[] this->internalMap;
621  this->internalMap = new proshade_double [xDim * yDim * zDim];
622  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( xDim * yDim * zDim ); iter++ ) { this->internalMap[iter] = newMap[iter]; }
623 
624  //================================================ Release memory
625  delete[] newMap;
626 
627  //================================================ Update map related variables
628  this->xDimSize = xDim * ( this->xDimSize / this->xDimIndices );
629  this->yDimSize = yDim * ( this->yDimSize / this->yDimIndices );
630  this->zDimSize = zDim * ( this->zDimSize / this->zDimIndices );
631  this->xDimIndices = xDim ; this->yDimIndices = yDim ; this->zDimIndices = zDim;
632  this->xGridIndices = xDim ; this->yGridIndices = yDim ; this->zGridIndices = zDim;
633  this->xFrom -= addXPre ; this->yFrom -= addYPre ; this->zFrom -= addZPre;
634  this->xTo += addXPost; this->yTo += addYPost; this->zTo += addZPost;
635  this->xAxisOrigin -= addXPre ; this->yAxisOrigin -= addYPre ; this->zAxisOrigin -= addZPre ;
636 
637  //================================================ Done
638  return ;
639 
640 }

The documentation for this class was generated from the following files:
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:165
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:577
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:3669
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:109
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:1122
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:175
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:57
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:2152
ProSHADE_settings::rotTrsJSONFile
std::string rotTrsJSONFile
The filename to which the rotation and translation operations are to be saved into.
Definition: ProSHADE_settings.hpp:185
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:3303
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:425
ProSHADE_internal_data::ProSHADE_data::interpolateMapFromSpheres
void interpolateMapFromSpheres(ProSHADE_settings *settings, proshade_double *&densityMapRotated)
This function interpolates the density map from the sphere mapped data.
Definition: ProSHADE_overlay.cpp:1042
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_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:393
ProSHADE_settings::maxSymmetryFold
proshade_unsign maxSymmetryFold
The highest symmetry fold to search for.
Definition: ProSHADE_settings.hpp:181
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::computeOptimalTranslation
void computeOptimalTranslation(proshade_double eulA, proshade_double eulB, proshade_double eulG, proshade_double trsX, proshade_double trsY, proshade_double trsZ)
This function computes and saves the optimal translation vector from the already determined translati...
Definition: ProSHADE_overlay.cpp:109
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:2486
ProSHADE_internal_data::ProSHADE_data::xAxisOrder
proshade_unsign xAxisOrder
This is the order of the x axis.
Definition: ProSHADE_data.hpp:71
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_unsign 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:1966
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_internal_data::ProSHADE_data::findIScore
proshade_double findIScore(std::vector< proshade_double * > *ISym)
This function takes the list of icosahedral axes and returns a score for deciding whether I symmetry ...
Definition: ProSHADE_data.cpp:2096
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:3130
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:4013
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::saveRequestedSymmetryD
void saveRequestedSymmetryD(ProSHADE_settings *settings, std::vector< proshade_double * > *DSym, std::vector< proshade_double * > *axes)
This function takes the D symmetries and searched for the requested symmetry.
Definition: ProSHADE_data.cpp:2280
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:3403
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:140
ProSHADE_internal_spheres::ProSHADE_rotFun_sphere
This class contains all inputed data for the rotation function angle-axis converted spheres.
Definition: ProSHADE_maths.hpp:51
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:1115
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:3803
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:194
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:129
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:1896
ProSHADE_settings::maskMap
bool maskMap
Should the map be masked from noise?
Definition: ProSHADE_settings.hpp:131
ProSHADE_settings::requestedSymmetryFold
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
Definition: ProSHADE_settings.hpp:178
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:177
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:3283
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:188
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:3433
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:315
ProSHADE_internal_data::ProSHADE_data::noSpheres
proshade_unsign noSpheres
The number of spheres with map projected onto them.
Definition: ProSHADE_data.hpp:119
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:3293
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:310
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:1012
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:135
ProSHADE_settings::requestedResolution
proshade_single requestedResolution
The resolution to which the calculations are to be done.
Definition: ProSHADE_settings.hpp:101
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:143
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:174
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:225
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:912
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:1077
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:792
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:152
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:554
ProSHADE_settings::maxSphereDists
proshade_single maxSphereDists
The distance between spheres in spherical mapping for the largest sphere.
Definition: ProSHADE_settings.hpp:116
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:171
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:1507
ProSHADE_internal_data::ProSHADE_data::invertMirrorMap
void invertMirrorMap(ProSHADE_settings *settings)
Function for inverting the map to its mirror image.
Definition: ProSHADE_data.cpp:960
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:1005
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:1222
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:2445
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:657
ProSHADE_internal_data::ProSHADE_data::findBestCScore
proshade_double findBestCScore(std::vector< proshade_double * > *CSym, proshade_unsign *symInd)
This function locates the best scoring C symmetry axis, returning the score and best symmetry index.
Definition: ProSHADE_data.cpp:1938
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:130
ProSHADE_internal_data::ProSHADE_data::computePdbRotationCentre
void computePdbRotationCentre(void)
This function computes the optimal rotation centre for co-ordinates.
Definition: ProSHADE_overlay.cpp:68
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:113
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_unsign 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:2206
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_internal_maths::complexMultiplication
void complexMultiplication(proshade_double *r1, proshade_double *i1, proshade_double *r2, proshade_double *i2, proshade_double *retReal, proshade_double *retImag)
Function to multiply two complex numbers.
Definition: ProSHADE_maths.cpp:38
ProSHADE_settings::allDetectedTAxes
std::vector< proshade_unsign > allDetectedTAxes
The vector of all detected tetrahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:195
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:292
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:1158
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:630
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:368
ProSHADE_settings::maskFileName
std::string maskFileName
The filename to which mask should be saved.
Definition: ProSHADE_settings.hpp:136
ProSHADE_settings::allDetectedOAxes
std::vector< proshade_unsign > allDetectedOAxes
The vector of all detected octahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:196
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:471
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:1294
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:3343
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:188
ProSHADE_internal_mapManip::beautifyBoundaries
void beautifyBoundaries(proshade_signed *&bounds, proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_signed boundsDiffThres, proshade_signed verbose)
Function for modifying boundaries to a mathematically more pleasant values.
Definition: ProSHADE_mapManip.cpp:1897
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:1059
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::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)
This function takes all the detected symmetry results and decides on which are to be recommended for ...
Definition: ProSHADE_data.cpp:2135
ProSHADE_internal_data::ProSHADE_data::getWignerMatrixValue
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.
Definition: ProSHADE_data.cpp:3268
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:103
ProSHADE_internal_data::ProSHADE_data::getPredictedIcosahedralSymmetriesList
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:2691
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:744
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:2928
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:3313
ProSHADE_internal_mapManip::removeWaters
void removeWaters(gemmi::Structure *pdbFile, bool firstModel)
This function removed all waters from PDB input file.
Definition: ProSHADE_mapManip.cpp:485
ProSHADE_settings::useBiCubicInterpolationOnPeaks
bool useBiCubicInterpolationOnPeaks
This variable switch decides whether best symmetry is detected from peak indices, or whether bicubic ...
Definition: ProSHADE_settings.hpp:180
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:64
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:923
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_internal_data::ProSHADE_data::saveRequestedSymmetryC
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.
Definition: ProSHADE_data.cpp:2229
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:260
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:96
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:1705
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:142
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_misc::sortDSymHlpInv
bool sortDSymHlpInv(const proshade_double *a, const proshade_double *b)
This function compares two arrays of the ProSHADE dihedral symmetry list based on combination of axes...
Definition: ProSHADE_misc.cpp:256
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:351
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_unsign 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:2841
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:287
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::getRealSphHarmValue
proshade_double * getRealSphHarmValue(proshade_unsign band, proshade_unsign order, proshade_unsign shell)
This function allows access to the private internal real spherical harmonics values.
Definition: ProSHADE_data.cpp:3128
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::zDimIndicesOriginal
proshade_unsign zDimIndicesOriginal
This is the size of the map cell z dimension in indices.
Definition: ProSHADE_data.hpp:87
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_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:807
ProSHADE_internal_data::ProSHADE_data::getMaxBand
proshade_unsign getMaxBand(void)
This function returns the maximum band value for the object.
Definition: ProSHADE_data.cpp:3004
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:948
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:2783
ProSHADE_settings::normaliseMap
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
Definition: ProSHADE_settings.hpp:123
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:149
ProSHADE_internal_mapManip::getNonZeroBounds
void getNonZeroBounds(proshade_double *map, proshade_signed xDim, proshade_signed yDim, proshade_signed zDim, proshade_single xAngs, proshade_single yAngs, proshade_single zAngs, proshade_signed *&ret)
Function for finding the map boundaries enclosing positive only values.
Definition: ProSHADE_mapManip.cpp:1065
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:3323
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:1061
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_unsign 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:1445
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_internal_data::ProSHADE_data::getCyclicSymmetriesList
std::vector< proshade_double * > getCyclicSymmetriesList(ProSHADE_settings *settings)
This function obtains a list of all C symmetries from already computed self-rotation map.
Definition: ProSHADE_symmetry.cpp:191
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_signed yDimIndices, proshade_signed zDimIndices, proshade_signed origXDimIndices, proshade_signed origYDimIndices, proshade_signed origZDimIndices, proshade_double *&newMap, proshade_double *origMap)
This function copies an old map to a new map with different boundaries.
Definition: ProSHADE_mapManip.cpp:2063
ProSHADE_internal_data::ProSHADE_data::getImagSphHarmValue
proshade_double * getImagSphHarmValue(proshade_unsign band, proshade_unsign order, proshade_unsign shell)
This function allows access to the private internal imaginary spherical harmonics values.
Definition: ProSHADE_data.cpp:3141
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::findBestDScore
proshade_double findBestDScore(std::vector< proshade_double * > *DSym, proshade_unsign *symInd)
This function locates the best scoring D symmetry axis, returning the score and best symmetry index.
Definition: ProSHADE_data.cpp:1982
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:3960
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:172
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:515
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:3443
ProSHADE_settings::setRecommendedSymmetry
void setRecommendedSymmetry(std::string val)
Sets the ProSHADE detected symmetry type.
Definition: ProSHADE.cpp:1009
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:126
ProSHADE_internal_data::ProSHADE_data::findOScore
proshade_double findOScore(std::vector< proshade_double * > *OSym)
This function takes the list of octahedral axes and returns a score for deciding whether O symmetry s...
Definition: ProSHADE_data.cpp:2063
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:3333
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:1611
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:141
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, bool firstModel=true)
This function writes out the PDB formatted file coresponding to the structure so that its COM is at s...
Definition: ProSHADE_data.cpp:872
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:1018
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:902
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:558
ProSHADE_settings::changeMapResolution
bool changeMapResolution
Should maps be re-sampled to obtain the required resolution?
Definition: ProSHADE_settings.hpp:102
ProSHADE_settings::determineAllSHValues
void determineAllSHValues(proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim, proshade_double xDimAngs, proshade_double yDimAngs, proshade_double zDimAngs)
This function determines all the required values for spherical harmonics computation.
Definition: ProSHADE.cpp:1320
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:334
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:2397
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:859
ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup
This class contains peak groups detected in the rotation function mapped spheres.
Definition: ProSHADE_spheres.hpp:130
ProSHADE_settings::overlayStructureName
std::string overlayStructureName
The filename to which the rotated and translated moving structure is to be saved.
Definition: ProSHADE_settings.hpp:184
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:2613
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:2994
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:3383
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:146
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:164
ProSHADE_internal_data::ProSHADE_data::readInMAP
void readInMAP(ProSHADE_settings *settings)
Function for reading map data using gemmi library.
Definition: ProSHADE_data.cpp:501
ProSHADE_internal_symmetry::getPeaksAngleAxisPositions
std::vector< proshade_double * > getPeaksAngleAxisPositions(std::vector< proshade_double * > allPeaks, proshade_unsign verbose)
This function converts peaks ZXZ Euler anles to angle-axis representation for further processing.
Definition: ProSHADE_symmetry.cpp:256
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::detectSymmetryInStructure
void detectSymmetryInStructure(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 and saves the results in the s...
Definition: ProSHADE_data.cpp:1653
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::getZAxisOrigin
proshade_signed * getZAxisOrigin(void)
This function allows access to the map Z axis origin value.
Definition: ProSHADE_data.cpp:3423
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:242
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_unsign 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:3236
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:168
ProSHADE_internal_symmetry::predictIcosAxes
void predictIcosAxes(std::vector< proshade_double * > *CSymList, std::vector< proshade_double * > *ret, proshade_double axErr, proshade_double minPeakHeight)
This function predicts all icosahedral point group symmetry axes from the cyclic point groups list.
Definition: ProSHADE_symmetry.cpp:2964
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_data::ProSHADE_data::zAxisOrder
proshade_unsign zAxisOrder
This is the order of the z axis.
Definition: ProSHADE_data.hpp:73
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:1222
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:277
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_unsign 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:2272
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:625
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:65
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:3373
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:3353
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:362
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:961
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:1301
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:210
ProSHADE_internal_data::ProSHADE_data::findTScore
proshade_double findTScore(std::vector< proshade_double * > *TSym)
This function takes the list of tetrahedral axes and returns a score for deciding whether T symmetry ...
Definition: ProSHADE_data.cpp:2030
ProSHADE_internal_data::ProSHADE_data::figureIndexStartStop
void figureIndexStartStop(void)
Function for determining iterator start and stop positions.
Definition: ProSHADE_data.cpp:785
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:432
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:2739
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:3231
ProSHADE_settings::allDetectedIAxes
std::vector< proshade_unsign > allDetectedIAxes
The vector of all detected icosahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:197
ProSHADE_settings::forceBounds
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
Definition: ProSHADE_settings.hpp:143
ProSHADE_settings::detectedSymmetry
std::vector< proshade_double * > detectedSymmetry
The vector of detected symmetry axes.
Definition: ProSHADE_settings.hpp:192
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:176
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_data::ProSHADE_data::allocateRRPMemory
void allocateRRPMemory(ProSHADE_settings *settings)
This function allocates the required memory for the RRP matrices.
Definition: ProSHADE_distances.cpp:33
ProSHADE_internal_data::ProSHADE_data::getIcosahedralSymmetriesList
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.
Definition: ProSHADE_symmetry.cpp:2629
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:1359
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:3413
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:3553
ProSHADE_internal_data::ProSHADE_data::computeRotatedSH
void computeRotatedSH(ProSHADE_settings *settings)
This function multiplies the objects spherical harmonics with the Wigner D matrices,...
Definition: ProSHADE_overlay.cpp:848
ProSHADE_internal_data::ProSHADE_data::getTetrahedralSymmetriesList
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.
Definition: ProSHADE_symmetry.cpp:1340
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::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:686
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:98
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:497
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_unsign 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:2354
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:172
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:142
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:2333
ProSHADE_settings::pdbBFactorNewVal
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
Definition: ProSHADE_settings.hpp:106
ProSHADE_internal_spheres::ProSHADE_sphere::allocateRotatedMap
void allocateRotatedMap(void)
This function allocates the rotated map memory.
Definition: ProSHADE_spheres.cpp:599
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:1028
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:706
ProSHADE_settings::setVariablesLeftOnAuto
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
Definition: ProSHADE.cpp:316
ProSHADE_settings::removeWaters
bool removeWaters
Should all waters be removed from input PDB files?
Definition: ProSHADE_settings.hpp:97
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:1014
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:3692
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:2693
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_data::ProSHADE_data::getOctahedralSymmetriesList
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.
Definition: ProSHADE_symmetry.cpp:2093
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:357
ProSHADE_internal_symmetry::printSymmetryCompletion
void printSymmetryCompletion(proshade_unsign noSyms, proshade_unsign verbose)
This function simply prints the summary and warnings for cyclic symmetries detection completion.
Definition: ProSHADE_symmetry.cpp:1085
ProSHADE_settings::allDetectedCAxes
std::vector< std::vector< proshade_double > > allDetectedCAxes
The vector of all detected cyclic symmetry axes.
Definition: ProSHADE_settings.hpp:193
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:3050
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:744
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:103
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:1355
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:1396
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:243
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:395
ProSHADE_internal_data::ProSHADE_data::readInPDB
void readInPDB(ProSHADE_settings *settings)
Function for reading pdb data.
Definition: ProSHADE_data.cpp:607
ProSHADE_internal_spheres::ProSHADE_sphere::setRotatedMappedData
void setRotatedMappedData(proshade_unsign pos, proshade_double value)
This function sets the rotated mapped data value to the given position.
Definition: ProSHADE_spheres.cpp:616
ProSHADE_internal_data::ProSHADE_data::getZFromPtr
proshade_signed * getZFromPtr(void)
This function allows access to the map start along the Z axis.
Definition: ProSHADE_data.cpp:3363
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:3393
ProSHADE_internal_data::ProSHADE_data::allocateRotatedSHMemory
void allocateRotatedSHMemory(ProSHADE_settings *settings)
This function allocates the memory required for storing the rotated Spherical Harmonics coefficients.
Definition: ProSHADE_overlay.cpp:818
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_unsign 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:3308