ProSHADE: ProSHADE_internal_data::ProSHADE_data Class Reference

| ProSHADE 0.7.5.1 (JAN 2021) Protein Shape Detection

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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, proshade_double matrixTolerance)
| 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, proshade_double matrixTolerance)
| This function predicts a list of all O 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...
std::vector< proshade_double * > | optimiseDihedralAngleFromAngleAxis (ProSHADE_settings *settings, proshade_double angle, proshade_double *axis1, proshade_double *axis2)
| ... 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 > > | computeGroupElementsForGroup (std::vector< std::vector< proshade_double > > *allCSyms, proshade_unsign grPosition)
| This function computes the group elements as rotation matrices (except for the identity element) for any detected cyclic point group. More...
std::vector< std::vector< proshade_double > > | computeGroupElementsForGroup (std::vector< proshade_double * > *allCSyms, proshade_unsign grPosition)
| This function computes the group elements as rotation matrices (except for the identity element) for any detected cyclic point group. 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] | settings | ProSHADE_settings object specifying what should be done.
  [out] | X | Empty 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] | settings | ProSHADE_settings object specifying what should be done.
  [in] | strName | The name of the structure for reference.
  [in] | mapVals | A pointer to array where all the map data are.
  [in] | len | The length of this map values array.
  [in] | xDmSz | The size of the x-axis dimension in Angstroms.
  [in] | yDmSz | The size of the y-axis dimension in Angstroms.
  [in] | zDmSz | The size of the z-axis dimension in Angstroms.
  [in] | xDmInd | The size of the x-axis dimension in indices.
  [in] | yDmInd | The size of the y-axis dimension in indices.
  [in] | zDmInd | The size of the z-axis dimension in indices.
  [in] | xFr | The first index statting position along the x-axis.
  [in] | yFr | The first index statting position along the y-axis.
  [in] | zFr | The first index statting position along the z-axis.
  [in] | xT | The last index end position along the x-axis.
  [in] | yT | The last index end position along the y-axis.
  [in] | zT | The last index end position along the z-axis.
  [in] | inputO | The input order for this structure.
  [out] | X | Empty data object with filled in values and map.

Definition at line 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] | X | N/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] | settings | A pointer to settings class containing all the information required for map manipulation.

Definition at line 1289 of file ProSHADE_data.cpp.

1290 {
1291 //================================================ Report function start
1292 std::stringstream hlpSS;
1293 hlpSS << "Adding extra " << settings->addExtraSpace << " angstroms.";
1294 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1295
1296 //================================================ Figure how much indices need to change
1297 proshade_unsign xAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->xDimSize / this->xDimIndices ) );
1298 proshade_unsign yAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->yDimSize / this->yDimIndices ) );
1299 proshade_unsign zAddIndices = ProSHADE_internal_mapManip::myRound ( settings->addExtraSpace / static_cast<proshade_single> ( this->zDimSize / this->zDimIndices ) );
1300
1301 //================================================ Update internal data variables
1302 this->xDimSize += static_cast<proshade_single> ( 2 * xAddIndices ) * static_cast<proshade_single> ( this->xDimSize / this->xDimIndices );
1303 this->yDimSize += static_cast<proshade_single> ( 2 * yAddIndices ) * static_cast<proshade_single> ( this->yDimSize / this->yDimIndices );
1304 this->zDimSize += static_cast<proshade_single> ( 2 * zAddIndices ) * static_cast<proshade_single> ( this->zDimSize / this->zDimIndices );
1305
1306 this->xDimIndices += 2 * xAddIndices;
1307 this->yDimIndices += 2 * yAddIndices;
1308 this->zDimIndices += 2 * zAddIndices;
1309
1310 this->xGridIndices = this->xDimIndices;
1311 this->yGridIndices = this->yDimIndices;
1312 this->zGridIndices = this->zDimIndices;
1313
1314 this->xAxisOrigin -= xAddIndices;
1315 this->yAxisOrigin -= yAddIndices;
1316 this->zAxisOrigin -= zAddIndices;
1317
1318 this->xFrom -= xAddIndices;
1319 this->yFrom -= yAddIndices;
1320 this->zFrom -= zAddIndices;
1321
1322 this->xTo += xAddIndices;
1323 this->yTo += yAddIndices;
1324 this->zTo += zAddIndices;
1325
1326 //================================================ Allocate new map
1327 proshade_double* newMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1328 ProSHADE_internal_misc::checkMemoryAllocation ( newMap, __FILE__, __LINE__, __func__ );
1329
1330 //================================================ Set new map to zeroes
1331 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1332 {
1333 newMap[iter] = 0.0;
1334 }
1335
1336 //================================================ Update the map
1337 proshade_unsign newMapIndex, oldMapIndex;
1338 for ( proshade_unsign xIt = 0; xIt < (this->xDimIndices - xAddIndices); xIt++ )
1339 {
1340 //============================================ Check if point is applicable
1341 if ( xIt < xAddIndices ) { continue; }
1342
1343 for ( proshade_unsign yIt = 0; yIt < (this->yDimIndices - yAddIndices); yIt++ )
1344 {
1345 //======================================== Check if point is applicable
1346 if ( yIt < yAddIndices ) { continue; }
1347
1348 for ( proshade_unsign zIt = 0; zIt < (this->zDimIndices - zAddIndices); zIt++ )
1349 {
1350 //==================================== Check if point is applicable
1351 if ( zIt < zAddIndices ) { continue; }
1352
1353 //==================================== Var init
1354 newMapIndex = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
1355 oldMapIndex = (zIt - zAddIndices) + (this->zDimIndices - ( 2 * zAddIndices ) ) * ( (yIt - yAddIndices) + (this->yDimIndices - ( 2 * yAddIndices ) ) * (xIt - xAddIndices) );
1356
1357 newMap[newMapIndex] = this->internalMap[oldMapIndex];
1358 }
1359 }
1360 }
1361
1362 //================================================ Copy new to old
1363 delete[] this->internalMap;
1364
1365 this->internalMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1366 ProSHADE_internal_misc::checkMemoryAllocation ( this->internalMap, __FILE__, __LINE__, __func__ );
1367
1368 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
1369 {
1370 this->internalMap[iter] = newMap[iter];
1371 }
1372
1373 //================================================ Release memory
1374 delete[] newMap;
1375
1376 //================================================ Report function completion
1377 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Extra space added." );
1378
1379 //================================================ Done
1380 return ;
1381
1382 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for the task.
  [in] | band | The 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] | settings | The 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] | settings | A 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] | band | The 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] | settings | A 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] | settings | A pointer to settings class containing all the information required for map manipulation.

Definition at line 1228 of file ProSHADE_data.cpp.

1229 {
1230 //================================================ Report function start
1231 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
1232
1233 //================================================ Initialise local variables
1234 proshade_unsign arrPos = 0;
1235 proshade_single xCOM = 0.0;
1236 proshade_single yCOM = 0.0;
1237 proshade_single zCOM = 0.0;
1238 proshade_single totDens = 0.0;
1239
1240 //================================================ Find the COM location
1241 for ( proshade_unsign xIt = 0; xIt < this->xDimIndices; xIt++ )
1242 {
1243 for ( proshade_unsign yIt = 0; yIt < this->yDimIndices; yIt++ )
1244 {
1245 for ( proshade_unsign zIt = 0; zIt < this->zDimIndices; zIt++ )
1246 {
1247 //==================================== Get index
1248 arrPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
1249
1250 //==================================== Get COM
1251 if ( this->internalMap[arrPos] > 0.0 )
1252 {
1253 xCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * xIt );
1254 yCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * yIt );
1255 zCOM += static_cast<proshade_single> ( this->internalMap[arrPos] * zIt );
1256 totDens += static_cast<proshade_single> ( this->internalMap[arrPos] );
1257 }
1258 }
1259 }
1260 }
1261 xCOM /= totDens;
1262 yCOM /= totDens;
1263 zCOM /= totDens;
1264
1265 //================================================ Find distance from COM to map centre in Angstroms
1266 proshade_single xDist = ( static_cast<proshade_single> ( this->xDimIndices / 2.0 ) - xCOM ) * static_cast<proshade_single> ( this->xDimSize / this->xDimIndices );
1267 proshade_single yDist = ( static_cast<proshade_single> ( this->yDimIndices / 2.0 ) - yCOM ) * static_cast<proshade_single> ( this->yDimSize / this->yDimIndices );
1268 proshade_single zDist = ( static_cast<proshade_single> ( this->zDimIndices / 2.0 ) - zCOM ) * static_cast<proshade_single> ( this->zDimSize / this->zDimIndices );
1269
1270 //================================================ Move the map within the box
1271 ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xDist, yDist, zDist, this->xDimSize, this->yDimSize, this->zDimSize, this->xDimIndices, this->yDimIndices, this->zDimIndices );
1272
1273 //================================================ Report function completion
1274 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map centered." );
1275
1276 //================================================ Done
1277 return ;
1278
1279 }

## ◆ computeGroupElementsForGroup() [1/2]

std::vector< std::vector< proshade_double > > ProSHADE_internal_data::ProSHADE_data::computeGroupElementsForGroup | ( | std::vector< proshade_double * > * | allCSyms,
|  | proshade_unsign | grPosition
| ) |  |

This function computes the group elements as rotation matrices (except for the identity element) for any detected cyclic point group.

Parameters

  [in] | allCSyms | A vector of double pointers, each array being a single Cyclic symmetry entry in a vector of all detected Cyclic symmetries.
  [in] | grPosition | An index of the C symmetry group which should have its group elements computed and returned.
  [out] | val | A vector containing vectors of 9 (rotation matrix) for each group element for the requested group, except for the identity element.

Definition at line 2317 of file ProSHADE_data.cpp.

2318 {
2319 //================================================ Sanity check
2320 if ( grPosition >= static_cast<proshade_unsign> ( allCSyms->size() ) )
2321 {
2322 std::stringstream hlpSS;
2323 hlpSS << "The request for group elements of group " << grPosition << " cannot be\n : processed, as the list of all groups does not have\n : group with this index.";
2324 throw ProSHADE_exception ( "Requested group elements for group which does not exist.", "ES00057", __FILE__, __LINE__, __func__, hlpSS.str() );
2325 }
2326
2327 //================================================ Initialise variables
2328 std::vector<std::vector< proshade_double > > ret;
2329 proshade_double groupAngle = ( 2 * M_PI ) / static_cast<proshade_double> ( allCSyms->at(grPosition)[0] );
2330 proshade_double thisElementAngle;
2331 proshade_double* rotMat = new proshade_double[9];
2332 ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
2333
2334 //================================================ Generate Cn elements
2335
2336 for ( proshade_unsign elIt = 1; elIt < static_cast<proshade_unsign> ( allCSyms->at(grPosition)[0] ); elIt++ )
2337 {
2338 //============================================ Find the element angle
2339 thisElementAngle = static_cast<proshade_double> ( elIt ) * groupAngle;
2340
2341 //============================================ Combine it with the group axis and get rotation matrix
2342 ProSHADE_internal_maths::getRotationMatrixFromAngleAxis ( rotMat,
2343 allCSyms->at(grPosition)[1],
2344 allCSyms->at(grPosition)[2],
2345 allCSyms->at(grPosition)[3],
2346 thisElementAngle );
2347
2348 //============================================ Save the element rotation matrix to the return vector
2349 std::vector<proshade_double> retEl;
2350 for ( unsigned int matIt = 0; matIt < 9; matIt++ )
2351 {
2352 ProSHADE_internal_misc::addToDoubleVector ( &retEl, rotMat[matIt] );
2353 }
2354 ProSHADE_internal_misc::addToDoubleVectorVector ( &ret, retEl );
2355 }
2356
2357 //================================================ Release memory
2358 delete[] rotMat;
2359
2360 //================================================ Done
2361 return ( ret );
2362
2363 }

## ◆ computeGroupElementsForGroup() [2/2]

std::vector< std::vector< proshade_double > > ProSHADE_internal_data::ProSHADE_data::computeGroupElementsForGroup | ( | std::vector< std::vector< proshade_double > > * | allCSyms,
|  | proshade_unsign | grPosition
| ) |  |

This function computes the group elements as rotation matrices (except for the identity element) for any detected cyclic point group.

Parameters

  [in] | allCSyms | A vector of vectors of doubles, each array being a single Cyclic symmetry entry in a vector of all detected Cyclic symmetries.
  [in] | grPosition | An index of the C symmetry group which should have its group elements computed and returned.
  [out] | val | A vector containing vectors of 9 (rotation matrix) for each group element for the requested group, except for the identity element.

Definition at line 2263 of file ProSHADE_data.cpp.

2264 {
2265 //================================================ Sanity check
2266 if ( grPosition >= static_cast<proshade_unsign> ( allCSyms->size() ) )
2267 {
2268 std::stringstream hlpSS;
2269 hlpSS << "The request for group elements of group " << grPosition << " cannot be\n : processed, as the list of all groups does not have\n : group with this index.";
2270 throw ProSHADE_exception ( "Requested group elements for group which does not exist.", "ES00057", __FILE__, __LINE__, __func__, hlpSS.str() );
2271 }
2272
2273 //================================================ Initialise variables
2274 std::vector<std::vector< proshade_double > > ret;
2275 proshade_double groupAngle = ( 2 * M_PI ) / static_cast<proshade_double> ( allCSyms->at(grPosition).at(0) );
2276 proshade_double thisElementAngle;
2277 proshade_double* rotMat = new proshade_double[9];
2278 ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
2279
2280 //================================================ Generate Cn elements
2281
2282 for ( proshade_unsign elIt = 1; elIt < static_cast<proshade_unsign> ( allCSyms->at(grPosition).at(0) ); elIt++ )
2283 {
2284 //============================================ Find the element angle
2285 thisElementAngle = static_cast<proshade_double> ( elIt ) * groupAngle;
2286
2287 //============================================ Combine it with the group axis and get rotation matrix
2288 ProSHADE_internal_maths::getRotationMatrixFromAngleAxis ( rotMat,
2289 allCSyms->at(grPosition).at(1),
2290 allCSyms->at(grPosition).at(2),
2291 allCSyms->at(grPosition).at(3),
2292 thisElementAngle );
2293
2294 //============================================ Save the element rotation matrix to the return vector
2295 std::vector<proshade_double> retEl;
2296 for ( unsigned int matIt = 0; matIt < 9; matIt++ )
2297 {
2298 ProSHADE_internal_misc::addToDoubleVector ( &retEl, rotMat[matIt] );
2299 }
2300 ProSHADE_internal_misc::addToDoubleVectorVector ( &ret, retEl );
2301 }
2302
2303 //================================================ Release memory
2304 delete[] rotMat;
2305
2306 //================================================ Done
2307 return ( ret );
2308
2309 }

## ◆ 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] | euA | The Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | euB | The Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | euG | The Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | transX | The translation to be done along the X-axis in Angstroms.
  [in] | transY | The translation to be done along the Y-axis in Angstroms.
  [in] | transZ | The 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
125 this->originalPdbTransX = this->mapCOMProcessChangeX;
126 this->originalPdbTransY = this->mapCOMProcessChangeY;
127 this->originalPdbTransZ = this->mapCOMProcessChangeZ;
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] | settings | The 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] | settings | A 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
46 ProSHADE_internal_distances::generateSO3CoeffsFromEMatrices ( this, this, settings );
47
48 //================================================ Compute the inverse SO(3) Fourier Transform (SOFT) on the newly computed coefficients
49 ProSHADE_internal_distances::computeInverseSOFTTransform ( this, this, settings );
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] | settings | A 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() ) );
113 descValR += ProSHADE_internal_maths::complexMultiplicationConjugRealOnly ( &this->sphericalHarmonics[shell1][arrPos1][0],
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] | settings | A pointer to settings class containing all the information required for map manipulation.

Definition at line 1542 of file ProSHADE_data.cpp.

1543 {
1544 //================================================ Report progress
1545 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting spherical harmonics decomposition." );
1546
1547 //================================================ Initialise memory
1548 this->sphericalHarmonics = new proshade_complex* [this->noSpheres];
1549 ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics, __FILE__, __LINE__, __func__ );
1550 for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1551 {
1552 this->sphericalHarmonics[iter] = new proshade_complex [(this->spheres[iter]->getLocalBandwidth() * 2) * (this->spheres[iter]->getLocalBandwidth() * 2)];
1553 ProSHADE_internal_misc::checkMemoryAllocation ( this->sphericalHarmonics[iter], __FILE__, __LINE__, __func__ );
1554 }
1555
1556 //================================================ Compute the spherical harmonics
1557 for ( proshade_unsign iter = 0; iter < this->noSpheres; iter++ )
1558 {
1559 //============================================ Report progress
1560 std::stringstream ss;
1561 ss << "Now decomposing sphere " << iter << ". " << "( Band is: " << this->spheres[iter]->getLocalBandwidth() << ").";
1562 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1563
1564 //============================================ Compute
1565 ProSHADE_internal_sphericalHarmonics::computeSphericalHarmonics ( this->spheres[iter]->getLocalBandwidth(), this->spheres[iter]->getMappedData(), this->sphericalHarmonics[iter] );
1566 }
1567
1568 //================================================ Report completion
1569 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Spherical harmonics decomposition complete." );
1570
1571 //======================================== Done
1572 return ;
1573
1574 }

## ◆ 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] | staticStructure | A 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] | settings | A 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] | settings | A pointer to settings class containing all the information required for reading in the map.
  [in] | newStr | A pointer reference to a new structure class which has all the same values except for the new bounds and adequately changed map.
  [in] | newBounds | A pointer to proshade_signed array of 6 storing the results - (0 = minX; 1 = maxX; 2 = minY; 3 = maxY; 4 - minZ; 5 = maxZ).

Definition at line 1090 of file ProSHADE_data.cpp.

1091 {
1092 //================================================ Report function start
1093 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Creating new structure according to the new bounds." );
1094
1095 //================================================ Fill in basic info
1096 newStr->fileName = "N/A";
1097 newStr->fileType = ProSHADE_internal_io::MAP;
1098
1099 //================================================ Fill in new structure values
1100 newStr->xDimIndices = static_cast<proshade_signed> ( newBounds[1] ) - static_cast<proshade_signed> ( newBounds[0] ) + 1;
1101 newStr->yDimIndices = static_cast<proshade_signed> ( newBounds[3] ) - static_cast<proshade_signed> ( newBounds[2] ) + 1;
1102 newStr->zDimIndices = static_cast<proshade_signed> ( newBounds[5] ) - static_cast<proshade_signed> ( newBounds[4] ) + 1;
1103
1104 newStr->aAngle = this->aAngle;
1105 newStr->bAngle = this->aAngle;
1106 newStr->cAngle = this->aAngle;
1107
1108 newStr->xDimSize = static_cast<proshade_single> ( newStr->xDimIndices ) * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) );
1109 newStr->yDimSize = static_cast<proshade_single> ( newStr->yDimIndices ) * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) );
1110 newStr->zDimSize = static_cast<proshade_single> ( newStr->zDimIndices ) * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) );
1111
1112 newStr->xGridIndices = newStr->xDimIndices;
1113 newStr->yGridIndices = newStr->yDimIndices;
1114 newStr->zGridIndices = newStr->zDimIndices;
1115
1116 newStr->xAxisOrder = this->xAxisOrder;
1117 newStr->yAxisOrder = this->yAxisOrder;
1118 newStr->zAxisOrder = this->zAxisOrder;
1119
1120 newStr->xAxisOrigin = this->xAxisOrigin + newBounds[0];
1121 newStr->yAxisOrigin = this->yAxisOrigin + newBounds[2];
1122 newStr->zAxisOrigin = this->zAxisOrigin + newBounds[4];
1123
1124 newStr->xFrom = this->xFrom + newBounds[0];
1125 newStr->yFrom = this->yFrom + newBounds[2];
1126 newStr->zFrom = this->zFrom + newBounds[4];
1127
1128 newStr->xTo = this->xTo - ( (this->xDimIndices-1) - newBounds[1] );
1129 newStr->yTo = this->yTo - ( (this->yDimIndices-1) - newBounds[3] );
1130 newStr->zTo = this->zTo - ( (this->zDimIndices-1) - newBounds[5] );
1131
1132 //================================================ Allocate new structure map
1133 newStr->internalMap = new proshade_double[newStr->xDimIndices * newStr->yDimIndices * newStr->zDimIndices];
1134 ProSHADE_internal_misc::checkMemoryAllocation ( newStr->internalMap, __FILE__, __LINE__, __func__ );
1135
1136 //================================================ Copy the map
1137 ProSHADE_internal_mapManip::copyMapByBounds ( newStr->xFrom, newStr->xTo, newStr->yFrom, newStr->yTo, newStr->zFrom, newStr->zTo,
1138 this->xFrom, this->yFrom, this->zFrom, newStr->yDimIndices, newStr->zDimIndices,
1139 this->xDimIndices, this->yDimIndices, this->zDimIndices, newStr->internalMap, this->internalMap );
1140
1141 //================================================ Report function completion
1142 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New structure created." );
1143
1144 //================================================ Done
1145 return ;
1146
1147 }

## ◆ 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] | saveTo | A pointer where the internal map should be deep copied into.
  [in] | verbose | How loud the run should be?

Definition at line 2796 of file ProSHADE_data.cpp.

2797 {
2798 //================================================ Sanity check
2799 if ( saveTo != NULL )
2800 {
2801 ProSHADE_internal_messages::printWarningMessage ( verbose, "!!! ProSHADE WARNING !!! The deep copy pointer is not set to NULL. Cannot proceed and returning unmodified pointer.", "WB00040" );
2802 return ;
2803 }
2804
2805 //================================================ Allocate the memory
2806 saveTo = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
2807
2808 //================================================ Check memory allocation
2809 ProSHADE_internal_misc::checkMemoryAllocation ( saveTo, __FILE__, __LINE__, __func__ );
2810
2811 //================================================ Copy internal map to the new pointer
2812 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
2813 {
2814 saveTo[iter] = this->internalMap[iter];
2815 }
2816
2817 //================================================ Done
2818 return ;
2819
2820 }

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

Definition at line 1707 of file ProSHADE_data.cpp.

1708 {
1709 //================================================ Modify axis tolerance and matrix tolerance by sampling, if required by user
1710 if ( settings->axisErrToleranceDefault )
1711 {
1712 settings->axisErrTolerance = std::max ( 0.01, ( 2.0 * M_PI ) / this->maxShellBand );
1713 }
1714 // proshade_double matrixTolerance = ( M_PI / ( this->maxShellBand ) );
1715
1716 //================================================ If C was requested, we will do it immediately - this allows for a significant speed-up.
1717 if ( settings->requestedSymmetryType == "C" )
1718 {
1719 //============================================ Report progress
1720 std::stringstream hlpSS;
1721 hlpSS << "Starting detection of cyclic point group C" << settings->requestedSymmetryFold;
1722 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, hlpSS.str() );
1723
1724 //============================================ Do simplified search only in the applicable data
1725 proshade_double symThres = 0.0;
1726 std::vector< proshade_double* > CSyms = this->findRequestedCSymmetryFromAngleAxis ( settings, settings->requestedSymmetryFold, &symThres );
1727
1728 //============================================ Save the best axis as the recommended one
1729 if ( settings->detectedSymmetry.size() == 0 ) { if ( CSyms.size() > 0 ) { settings->setDetectedSymmetry ( CSyms.at(0) ); } }
1730 if ( CSyms.size() > 0 )
1731 {
1732 settings->setRecommendedSymmetry ( "C" );
1733 settings->setRecommendedFold ( settings->requestedSymmetryFold );
1734
1735 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSyms.at(0) );
1736 this->saveDetectedSymmetries ( settings, &CSyms, allCs );
1737 }
1738 else
1739 {
1740 settings->setRecommendedSymmetry ( "" );
1741 settings->setRecommendedFold ( 0 );
1742 }
1743
1744 //============================================ Done
1745 return ;
1746 }
1747
1748 //============================================ Report progress
1749 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting C symmetry detection." );
1750
1751 //================================================ Initialise variables
1752 std::vector< proshade_double* > CSyms = getCyclicSymmetriesListFromAngleAxis ( settings );
1753
1754 //================================================ Sanity check - was the rotation function mapped properly?
1755 if ( this->sphereMappedRotFun.size() < 1 )
1756 {
1757 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." );
1758 }
1759
1760 //================================================ Sanity check - was any symmetry requested?
1761 if ( ( settings->requestedSymmetryType != "" ) && ( settings->requestedSymmetryType != "C" ) && ( settings->requestedSymmetryType != "D" ) && ( settings->requestedSymmetryType != "T" ) && ( settings->requestedSymmetryType != "O" ) && ( settings->requestedSymmetryType != "I" ) )
1762 {
1763 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." );
1764 }
1765
1766 //================================================ Are we doing general search?
1767 if ( settings->requestedSymmetryType == "" )
1768 {
1769 //============================================ Run the symmetry detection functions for C, D, T, O and I symmetries
1770 std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1771 std::vector< proshade_double* > ISyms = this->getIcosahedralSymmetriesList ( settings, &CSyms ); //, matrixTolerance );
1772 std::vector< proshade_double* > OSyms; std::vector< proshade_double* > TSyms;
1773 if ( ISyms.size() < 31 ) { OSyms = this->getOctahedralSymmetriesList ( settings, &CSyms ); //, matrixTolerance );
1774 if ( OSyms.size() < 13 ) { TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms ); } }
1775
1776 //============================================ Decide on recommended symmetry
1777 this->saveRecommendedSymmetry ( settings, &CSyms, &DSyms, &TSyms, &OSyms, &ISyms, axes );
1778 }
1779
1780 if ( settings->requestedSymmetryType == "D" )
1781 {
1782 //============================================ Run only the D symmetry detection and search for requested fold
1783 std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1784 this->saveRequestedSymmetryD ( settings, &DSyms, axes );
1785 }
1786
1787 if ( settings->requestedSymmetryType == "T" )
1788 {
1789 //============================================ Run only the T symmetry detection and search for requested fold
1790 std::cerr << "Sadly, this functionality is not yet implemented. Please use the -z option to use the original peak searching symmetry detection algorithm." << std::endl;
1791 // std::vector< proshade_double* > TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms );
1792 // settings->setRecommendedFold ( 0 );
1793 // 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) ); } }
1794 // else { settings->setRecommendedSymmetry ( "" ); }
1795 }
1796
1797 if ( settings->requestedSymmetryType == "O" )
1798 {
1799 std::cerr << "Sadly, this functionality is not yet implemented. Please use the -z option to use the original peak searching symmetry detection algorithm." << std::endl;
1800 }
1801
1802 if ( settings->requestedSymmetryType == "I" )
1803 {
1804 std::cerr << "Sadly, this functionality is not yet implemented. Please use the -z option to use the original peak searching symmetry detection algorithm." << std::endl;
1805 }
1806
1807 //================================================ Save C symmetries to argument and if different from settings, to the settings as well
1808 this->saveDetectedSymmetries ( settings, &CSyms, allCs );
1809
1810 //================================================ Done
1811 return ;
1812
1813 }

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

Definition at line 1587 of file ProSHADE_data.cpp.

1588 {
1589 //================================================ Initialise variables
1590 std::vector< proshade_double* > CSyms = this->getCyclicSymmetriesList ( settings );
1591
1592 //================================================ Was any particular symmetry requested?
1593 if ( settings->requestedSymmetryType == "" )
1594 {
1595 //============================================ Run the symmetry detection functions for C, D, T, O and I symmetries
1596 std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1597 std::vector< proshade_double* > ISyms = this->getIcosahedralSymmetriesList ( settings, &CSyms );
1598 std::vector< proshade_double* > OSyms; std::vector< proshade_double* > TSyms;
1599 if ( ISyms.size() < 31 ) { OSyms = this->getOctahedralSymmetriesList ( settings, &CSyms ); if ( OSyms.size() < 13 ) { TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms ); } }
1600
1601 //============================================ Decide on recommended symmetry
1602 this->saveRecommendedSymmetry ( settings, &CSyms, &DSyms, &TSyms, &OSyms, &ISyms, axes );
1603 }
1604
1605 if ( settings->requestedSymmetryType == "C" )
1606 {
1607 //============================================ Run only the C symmetry detection and search for requested fold
1608 this->saveRequestedSymmetryC ( settings, &CSyms, axes );
1609 }
1610
1611 if ( settings->requestedSymmetryType == "D" )
1612 {
1613 //============================================ Run only the D symmetry detection and search for requested fold
1614 std::vector< proshade_double* > DSyms = this->getDihedralSymmetriesList ( settings, &CSyms );
1615 this->saveRequestedSymmetryD ( settings, &DSyms, axes );
1616 }
1617
1618 if ( settings->requestedSymmetryType == "T" )
1619 {
1620 //============================================ Run only the T symmetry detection and search for requested fold
1621 std::vector< proshade_double* > TSyms = this->getTetrahedralSymmetriesList ( settings, &CSyms );
1622 settings->setRecommendedFold ( 0 );
1623 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) ); } }
1624 else { settings->setRecommendedSymmetry ( "" ); }
1625 }
1626
1627 if ( settings->requestedSymmetryType == "O" )
1628 {
1629 //============================================ Run only the O symmetry detection and search for requested fold
1630 std::vector< proshade_double* > OSyms = this->getOctahedralSymmetriesList ( settings, &CSyms );
1631 settings->setRecommendedFold ( 0 );
1632 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) ); } }
1633 else { settings->setRecommendedSymmetry ( "" ); }
1634 }
1635
1636 if ( settings->requestedSymmetryType == "I" )
1637 {
1638 //============================================ Run only the T symmetry detection and search for requested fold
1639 std::vector< proshade_double* > ISyms = this->getIcosahedralSymmetriesList ( settings, &CSyms );
1640 settings->setRecommendedFold ( 0 );
1641 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) ); } }
1642 else { settings->setRecommendedSymmetry ( "" ); }
1643 }
1644
1645 if ( ( settings->requestedSymmetryType != "" ) && ( settings->requestedSymmetryType != "C" ) && ( settings->requestedSymmetryType != "D" ) && ( settings->requestedSymmetryType != "T" ) && ( settings->requestedSymmetryType != "O" ) && ( settings->requestedSymmetryType != "I" ) )
1646 {
1647 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." );
1648 }
1649
1650 //================================================ Save C symmetries to argument and if different from settings, to the settings as well
1651 bool isArgSameAsSettings = true;
1652 for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( CSyms.size() ); cIt++ )
1653 {
1654 std::vector< proshade_double > nextSym;
1655 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[0] );
1656 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[1] );
1657 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[2] );
1658 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[3] );
1659 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[4] );
1660 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms.at(cIt)[5] );
1661 ProSHADE_internal_misc::addToDoubleVectorVector ( allCs, nextSym );
1662
1663 if ( ( cIt == 0 ) && ( settings->allDetectedCAxes.size() == 0 ) ) { isArgSameAsSettings = false; }
1664 if ( !isArgSameAsSettings ) { ProSHADE_internal_misc::addToDoubleVectorVector ( &settings->allDetectedCAxes, nextSym ); }
1665
1666 nextSym.clear ( );
1667 }
1668
1669 //================================================ Release memory
1670 for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( CSyms.size() ); it++ ) { delete[] CSyms.at(it); }
1671
1672 //================================================ Done
1673 return ;
1674
1675 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for map symmetry detection.

Definition at line 1684 of file ProSHADE_data.cpp.

1685 {
1686 //================================================ Run the algorithm
1687 this->detectSymmetryInStructure ( settings, &settings->detectedSymmetry, &settings->allDetectedCAxes );
1688
1689 //================================================ Done
1690 return ;
1691
1692 }

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

720 {
721 //================================================ Set ends to origin + size - 1
722 this->xTo = this->xFrom + this->xDimIndices - 1;
723 this->yTo = this->yFrom + this->yDimIndices - 1;
724 this->zTo = this->zFrom + this->zDimIndices - 1;
725
726 //================================================ Done
727 return ;
728
729 }

## ◆ 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] | CSym | This is the complete list of the ProSHADE detected C axes in the ProSHADE format.
  [in] | symInd | A pointer to variable where the best symmetry axis index will be stored.
  [out] | ret | The score of the best scoring C axis.

Definition at line 1870 of file ProSHADE_data.cpp.

1871 {
1872 //================================================ Sanity check
1873 if ( CSym->size() == 0 ) { *symInd = 0; return ( 0.0 ); }
1874
1875 //================================================ Initalise variables
1876 proshade_double ret = CSym->at(0)[5];
1877 *symInd = 0;
1878 proshade_double frac = 0.0;
1879
1880 //================================================ Check all other axes
1881 // THIS NEEDS TO BE IMPROVED USING THE MAXIMUM LIKELIHOOD FOR THIS FOLD
1882 for ( proshade_unsign ind = 1; ind < static_cast<proshade_unsign>( CSym->size() ); ind++ )
1883 {
1884 //============================================ If higher fold than already leading one (do not care for lower fold and lower average height axes)
1885 if ( CSym->at(ind)[0] > CSym->at(*symInd)[0] )
1886 {
1887 //======================================== How much higher fold is it? Also, adding some protection against large syms supported only by a subset and a minimum requirement.
1888 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] );
1889
1890 //======================================== Check if the new is "better" according to this criteria.
1891 if ( frac >= 1.0 && ( ( CSym->at(*symInd)[5] * 0.85 ) < CSym->at(ind)[5] ) )
1892 {
1893 //==================================== And it is! Save and try next one.
1894 *symInd = ind;
1895 ret = CSym->at(ind)[5];
1896 }
1897 }
1898 }
1899
1900 //================================================ Done
1901 return ( ret );
1902
1903 }

## ◆ 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] | DSym | This is the complete list of the ProSHADE detected D axes in the ProSHADE format.
  [in] | symInd | A pointer to variable where the best symmetry axis index will be stored.
  [out] | ret | The score of the best scoring D axis.

Definition at line 1914 of file ProSHADE_data.cpp.

1915 {
1916 //================================================ Sort the vector
1917 std::sort ( DSym->begin(), DSym->end(), ProSHADE_internal_misc::sortDSymHlpInv );
1918
1919 //================================================ Initalise variables
1920 proshade_double ret = 0.0;
1921 proshade_double frac = 0.0;
1922 if ( DSym->size() > 0 )
1923 {
1924 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] );
1925 *symInd = 0;
1926 }
1927 else { return ( ret ); }
1928
1929 //================================================ Check all other axes
1930 // THIS NEEDS TO BE IMPROVED USING THE MAXIMUM LIKELIHOOD FOR THIS FOLD
1931 for ( proshade_unsign ind = 1; ind < static_cast<proshade_unsign>( DSym->size() ); ind++ )
1932 {
1933 //============================================ If higher fold than already leading one (do not care for lower fold and lower average height axes)
1934 if ( ( DSym->at(ind)[0] + DSym->at(ind)[6] ) > ( DSym->at(*symInd)[0] + DSym->at(*symInd)[6] ) )
1935 {
1936 //======================================== How much higher fold is it? Also, adding some protection against large syms supported only by a subset and a minimum requirement.
1937 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 );
1938
1939 //======================================== Check if the new is "better" according to this criteria.
1940 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] ) )
1941 {
1942 //==================================== And it is! Save and try next one.
1943 *symInd = ind;
1944 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] );
1945 }
1946 }
1947 }
1948
1949 //================================================ Done
1950 return ( ret );
1951
1952 }

## ◆ 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] | ISym | This is the complete list of the ProSHADE detected I symmetry axes in the ProSHADE format.
  [out] | ret | The score of the I symmetry.

Definition at line 2028 of file ProSHADE_data.cpp.

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

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

2911 {
2912 //================================================ Initialise variables
2913 this->xCom = 0.0;
2914 this->yCom = 0.0;
2915 this->zCom = 0.0;
2916 proshade_double totNonZeroPoints = 0.0;
2917 proshade_signed mapIt = 0;
2918
2919 //================================================ Compute COM from 0 ; 0 ; 0
2920 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
2921 {
2922 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
2923 {
2924 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
2925 {
2926 //==================================== Find map index
2927 mapIt = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
2928
2929 //==================================== Use only positive density
2930 if ( this->internalMap[mapIt] <= 0.0 ) { continue; }
2931
2932 //==================================== Compute Index COM
2933 this->xCom += this->internalMap[mapIt] * static_cast<proshade_double> ( xIt + this->xFrom );
2934 this->yCom += this->internalMap[mapIt] * static_cast<proshade_double> ( yIt + this->yFrom );
2935 this->zCom += this->internalMap[mapIt] * static_cast<proshade_double> ( zIt + this->zFrom );
2936 totNonZeroPoints += this->internalMap[mapIt];
2937 }
2938 }
2939 }
2940
2941 this->xCom /= totNonZeroPoints;
2942 this->yCom /= totNonZeroPoints;
2943 this->zCom /= totNonZeroPoints;
2944
2945 //================================================ Convert to real world
2946 this->xCom = ( static_cast<proshade_double> ( this->xFrom ) * ( this->xDimSizeOriginal / static_cast<proshade_double> ( this->xDimIndicesOriginal ) ) ) +
2947 ( ( this->xCom - static_cast<proshade_double> ( this->xFrom ) ) *
2948 ( this->xDimSizeOriginal / static_cast<proshade_double> ( this->xDimIndicesOriginal ) ) );
2949 this->yCom = ( static_cast<proshade_double> ( this->yFrom ) * ( this->yDimSizeOriginal / static_cast<proshade_double> ( this->yDimIndicesOriginal ) ) ) +
2950 ( ( this->yCom - static_cast<proshade_double> ( this->yFrom ) ) *
2951 ( this->yDimSizeOriginal / static_cast<proshade_double> ( this->yDimIndicesOriginal ) ) );
2952 this->zCom = ( static_cast<proshade_double> ( this->zFrom ) * ( this->zDimSizeOriginal / static_cast<proshade_double> ( this->zDimIndicesOriginal ) ) ) +
2953 ( ( this->zCom - static_cast<proshade_double> ( this->zFrom ) ) *
2954 ( this->zDimSizeOriginal / static_cast<proshade_double> ( this->zDimIndicesOriginal ) ) );
2955
2956 //================================================ Done
2957 return ;
2958
2959 }

## ◆ 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] | OSym | This is the complete list of the ProSHADE detected O symmetry axes in the ProSHADE format.
  [out] | ret | The score of the O symmetry.

Definition at line 1995 of file ProSHADE_data.cpp.

1996 {
1997 //================================================ Initialise variables
1998 proshade_double ret = 0.0;
1999 proshade_double foldSum = 0.0;
2000
2001 //================================================ Check the O symmetry for being complete
2002 if ( OSym->size() == 13 )
2003 {
2004 //============================================ Compute the weighted fold
2005 for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( OSym->size() ); cIt++ )
2006 {
2007 ret += OSym->at(cIt)[0] * OSym->at(cIt)[5];
2008 foldSum += OSym->at(cIt)[0];
2009 }
2010
2011 //============================================ Weight
2012 ret /= foldSum;
2013 }
2014
2015 //================================================ Done
2016 return ( ret );
2017
2018 }

## ◆ findRequestedCSymmetryFromAngleAxis()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::findRequestedCSymmetryFromAngleAxis | ( | ProSHADE_settings * | settings,
|  | proshade_unsign | fold,
|  | proshade_double * | peakThres
| ) |  |

This function searches the angle-axis representation of the rotation function for a cyclic point group with given fold.

This function is a simplification of the getCyclicSymmetriesListFromAngleAxis() function, where this function does not map the whole rotation function, but rothar only to the spheres it knows it will required. Moreover, it does not search for all cyclic point groups, but only those which span all the spheres (angles) and therefore have the required fold.

In terms of operations, this function interpolates the rotation function values onto the spheres it requires, then it finds peaks and removes the small peaks, so that these can then be grouped. For each group which spans all the angles it then finds the index with highest sum of peak height over all spheres. It can then do the bi-cubic interpolation if requested. Finally, all the detected peaks are sorted by the peak height and returned.

Parameters

  [in] | settings | ProSHADE_settings object containing all the settings for this run.
  [in] | fold | The fold which should be sought for by the function.
  [in] | peakThres | The threshold used to cut peaks.
  [out] | ret | Vector of double pointers to arrays having the standard ProSHADE symmetry group structure.

Definition at line 3713 of file ProSHADE_symmetry.cpp.

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

## ◆ 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] | TSym | This is the complete list of the ProSHADE detected T symmetry axes in the ProSHADE format.
  [out] | ret | The score of the T symmetry.

Definition at line 1962 of file ProSHADE_data.cpp.

1963 {
1964 //================================================ Initialise variables
1965 proshade_double ret = 0.0;
1966 proshade_double foldSum = 0.0;
1967
1968 //================================================ Check the T symmetry for being complete
1969 if ( TSym->size() == 7 )
1970 {
1971 //============================================ Compute the weighted fold
1972 for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( TSym->size() ); cIt++ )
1973 {
1974 ret += TSym->at(cIt)[0] * TSym->at(cIt)[5];
1975 foldSum += TSym->at(cIt)[0];
1976 }
1977
1978 //============================================ Weight
1979 ret /= foldSum;
1980 }
1981
1982 //================================================ Done
1983 return ( ret );
1984
1985 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for map symmetry detection.
  [in] | axesList | A vector of ints specifying which C axes from the full list are members of the group.
  [in] | groupType | An optional string specifying for which symmetry type the group elements are to be computed. Leave empty if you want to use the supplied axes without any questions being asked.
  [in] | matrixTolerance | The maximum allowed trace difference for two matrices to still be considered the same.
  [out] | val | A vector containing a vector of 9 doubles (rotation matrix) for each group element for the requested group.

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

## ◆ getAnySphereRadius()

proshade_double ProSHADE_internal_data::ProSHADE_data::getAnySphereRadius | ( | proshade_unsign | shell | ) |

This function allows access to the radius of any particular sphere.

Parameters

  [out] | X | The distance of the requested sphere to the centre of the coordinates.

Definition at line 3136 of file ProSHADE_data.cpp.

3137 {
3138 //================================================ Done
3139 return ( this->spheres[shell]->getShellRadius() );
3140
3141 }

## ◆ getBestRotationMapPeaksEulerAngles()

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

This function returns a vector of three floats, the three Euler angles of the best peak in the rotation map.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for map overlay.
  [out] | val | A vector of the Euler angles of the best peak in the rotation function map.

Definition at line 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
1235 ProSHADE_internal_peakSearch::getBestPeakEulerAngsNaive ( this->getInvSO3Coeffs (),
1236 this->getMaxBand() * 2,
1237 &eulA, &eulB, &eulG, settings );
1238
1239 //================================================ Re-format to vector
1240 ProSHADE_internal_misc::addToDoubleVector ( &ret, eulA );
1241 ProSHADE_internal_misc::addToDoubleVector ( &ret, eulB );
1242 ProSHADE_internal_misc::addToDoubleVector ( &ret, eulG );
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] | staticStructure | A pointer to the data class object of the other ( static ) structure.
  [out] | X | A vector of doubles with the optimal translation vector in Angstroms.

Definition at line 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;
314 ProSHADE_internal_overlay::findHighestValueInMap ( this->getTranslationFnPointer(),
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] | X | The bandwidth used for this comparison.

Definition at line 3235 of file ProSHADE_data.cpp.

3236 {
3237 //================================================ Done
3238 return ( this->maxCompBand );
3239
3240 }

## ◆ 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] | settings | A 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] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [out] | ret | A vector of arrays containing all detected cyclic point groups in the standard ProSHADE format, i.e. [0] = fold, [1] = x-axis, [2] = y-axis, [3] = z-axis, [4] = angle, [5] = average peak height.

Definition at line 3574 of file ProSHADE_symmetry.cpp.

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

## ◆ 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] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.

Definition at line 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;
1262 ProSHADE_internal_misc::addToUnsignVector ( &DSymInd, ax1 );
1263 ProSHADE_internal_misc::addToUnsignVector ( &DSymInd, ax2 );
1264 ProSHADE_internal_misc::addToUnsignVectorVector ( &settings->allDetectedDAxes, DSymInd );
1265
1266 }
1267 else
1268 {
1269 ProSHADE_internal_symmetry::saveDSymmetry ( &ret, CSymList, ax2, ax1 );
1270
1271 std::vector< proshade_unsign > DSymInd;
1272 ProSHADE_internal_misc::addToUnsignVector ( &DSymInd, ax2 );
1273 ProSHADE_internal_misc::addToUnsignVector ( &DSymInd, ax1 );
1274 ProSHADE_internal_misc::addToUnsignVectorVector ( &settings->allDetectedDAxes, 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] | band | The band for which the E matrix subset order * order should be returned.
  [out] | X | Pointer to pointer of complex matrix with dimensions order * order of the E matrices.

Definition at line 3183 of file ProSHADE_data.cpp.

3184 {
3185 //================================================ Done
3186 return ( this->eMatrices[band] );
3187
3188 }

## ◆ getEMatrixValue()

void ProSHADE_internal_data::ProSHADE_data::getEMatrixValue | ( | proshade_unsign | band,
|  | proshade_unsign | order1,
|  | proshade_unsign | order2,
|  | proshade_double * | valueReal,
|  | proshade_double * | valueImag
| ) |  |

This function allows access to E matrix by knowing the band, order1 and order2 indices.

Parameters

  [in] | band | The band for which the E matrix value should be returned.
  [in] | order1 | The first order for which the E matrix value should be returned.
  [in] | order2 | The second order for which the E matrix value should be returned.
  [in] | valueReal | The proshade_double number pointer to where the real part of the value will be saved.
  [in] | valueImag | The proshade_double number pointer to where the imaginary part of the value will be saved.

Definition at line 3198 of file ProSHADE_data.cpp.

3199 {
3200 //================================================ Set pointer
3201 *valueReal = this->eMatrices[band][order1][order2][0];
3202 *valueImag = this->eMatrices[band][order1][order2][1];
3203
3204 //================================================ Done
3205 return ;
3206
3207 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.

Definition at line 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?
2638 if ( ProSHADE_internal_symmetry::detectIcosahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
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 {
2662 ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedIAxes, csIt );
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] | band | The band for which the imaginary E matrix values are requested.
  [in] | order | The order for which the imaginary E matrix values are requested.
  [in] | eMatsLMImag | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 3556 of file ProSHADE_data.cpp.

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

## ◆ getImagRotFunction()

void ProSHADE_internal_data::ProSHADE_data::getImagRotFunction | ( | double * | rotFunImag,
|  | int | len
| ) |  |

This function fills the input array with the imaginary rotation function values.

Parameters

  [in] | rotFunImag | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 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 rotFunImag[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][1] );
3649 }
3650
3651 //================================================ Done
3652 return ;
3653
3654 }

## ◆ getImagSO3Coeffs()

void ProSHADE_internal_data::ProSHADE_data::getImagSO3Coeffs | ( | double * | so3CoefsImag,
|  | int | len
| ) |  |

This function fills the input array with the imaginary SO(3) coefficient values.

Parameters

  [in] | so3CoefsImag | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 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 so3CoefsImag[iter] = static_cast<double> ( this->so3Coeffs[iter][1] );
3598 }
3599
3600 //================================================ Done
3601 return ;
3602
3603 }

## ◆ 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] | X | Pointer to the value of the internal private spherical harmonics imaginary value of the given index.

Definition at line 3123 of file ProSHADE_data.cpp.

3124 {
3125 //================================================ Done
3126 return ( &this->sphericalHarmonics[shell][seanindex ( static_cast<proshade_signed> ( order ) - static_cast<proshade_signed> ( band ),
3127 band,
3128 this->spheres[shell]->getLocalBandwidth() )][1] );
3129
3130 }

## ◆ getImagTranslationFunction()

void ProSHADE_internal_data::ProSHADE_data::getImagTranslationFunction | ( | double * | trsFunImag,
|  | int | len
| ) |  |

This function fills the input array with the imaginary translation function values.

Parameters

  [in] | trsFunImag | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 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 trsFunImag[iter] = static_cast<double> ( this->translationMap[iter][1] );
3685 }
3686
3687 //================================================ Done
3688 return ;
3689
3690 }

## ◆ getIntegrationWeight()

proshade_double ProSHADE_internal_data::ProSHADE_data::getIntegrationWeight | ( | void |  | ) |

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

Parameters

  [out] | X | The integration weight for the object or 0.0 if not yet computed.

Definition at line 3147 of file ProSHADE_data.cpp.

3148 {
3149 //================================================ Done
3150 return ( this->integrationWeight );
3151
3152 }

## ◆ getInternalMap()

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

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

Parameters

  [out] | internalMap | Pointer to the first position in the internal map array.

Definition at line 3415 of file ProSHADE_data.cpp.

3416 {
3417 //================================================ Return the requested value
3418 return ( this->internalMap );
3419 }

## ◆ getInvSO3Coeffs()

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

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

Parameters

  [out] | X | The internal inverse SO(3) coefficients array variable.

Definition at line 3213 of file ProSHADE_data.cpp.

3214 {
3215 //================================================ Done
3216 return ( this->so3CoeffsInverse );
3217
3218 }

## ◆ getMapValue()

proshade_double ProSHADE_internal_data::ProSHADE_data::getMapValue | ( | proshade_unsign | pos | ) |

This function returns the internal map representation value of a particular array position.

Parameters

  [in] | pos | The position in the map array, of which the value should be returned.
  [out] | X | The internal map representation value at position pos.

Definition at line 2976 of file ProSHADE_data.cpp.

2977 {
2978 //================================================ Return the value
2979 return ( this->internalMap[pos] );
2980 }

## ◆ getMaxBand()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxBand | ( | void |  | ) |

This function returns the maximum band value for the object.

Parameters

  [out] | X | The largest number of bands used in any shell of the object.

Definition at line 2986 of file ProSHADE_data.cpp.

2987 {
2988 //================================================ Return the value
2989 return ( this->maxShellBand );
2990 }

## ◆ getMaxSpheres()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getMaxSpheres | ( | void |  | ) |

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

Parameters

  [out] | X | The total number of spheres to which the structure is mapped.

Definition at line 2965 of file ProSHADE_data.cpp.

2966 {
2967 //================================================ Return the value
2968 return ( this->noSpheres );
2969 }

## ◆ getNoRecommendedSymmetryAxes()

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

This function returns the number of detected recommended symmetry axes.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for map manipulation.
  [out] | val | The length of the recommended symmetry axes vector.

Definition at line 3755 of file ProSHADE_data.cpp.

3756 {
3757 //================================================ Return the value
3758 return ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) );
3759 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.

Definition at line 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 {
2126 ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedOAxes, csIt );
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] | settings | A pointer to settings class containing all the information required for map symmetry detection.
  [in] | obj2 | A pointer to the data class object of the other ( static ) structure.

Definition at line 35 of file ProSHADE_overlay.cpp.

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
47 ProSHADE_internal_distances::generateSO3CoeffsFromEMatrices ( obj2, this, settings );
48
49 //================================================ Compute the inverse SO(3) Fourier Transform (SOFT) on the newly computed coefficients
50 ProSHADE_internal_distances::computeInverseSOFTTransform ( obj2, this, settings );
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,
|  | proshade_double | matrixTolerance
| ) |  |

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( 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 generate their combinations point group elements. These can in turn be used to generate the remainder of the axes (iteratively). Once complete, all the predicted axes are in the ret variable.

\Warning This function does not check if the correct number of C axes was found, it is assumed this will be checked when the determination of which symmetry was found.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.
  [in] | matrixTolerance | The maximum allowed trace difference for two matrices to be still considered the same.
  [out] | ret | A 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 2692 of file ProSHADE_symmetry.cpp.

2693 {
2694 //================================================ Initialise variables
2695 std::vector< proshade_double* > ret;
2696
2697 //================================================ Report progress
2698 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting I symmetry prediction." );
2699
2700 //================================================ Are the basic requirements for icosahedral symmetry met?
2701 if ( ProSHADE_internal_symmetry::detectIcosahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2702 {
2703 //============================================ Generate the rest of the axes
2704 ProSHADE_internal_symmetry::predictIcosAxes ( settings, CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak, matrixTolerance );
2705 }
2706 std::cout << "The Icos search is now complete..." << std::endl;
2707 exit(0);
2708 //================================================ Report progress
2709 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "I symmetry prediction complete." );
2710
2711 //================================================ Done
2712 return ( ret );
2713
2714 }

## ◆ getPredictedOctahedralSymmetriesList()

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

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 generate their combinations point group elements. These can in turn be used to generate the remainder of the axes (iteratively). Once complete, all the predicted axes are in the ret variable.

\Warning This function does not check if the correct number of C axes was found, it is assumed this will be checked when the determination of which symmetry was found.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.
  [in] | matrixTolerance | The maximum allowed trace difference for two matrices to be still considered the same.
  [out] | ret | A 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 2731 of file ProSHADE_symmetry.cpp.

2732 {
2733 //================================================ Initialise variables
2734 std::vector< proshade_double* > ret;
2735
2736 //================================================ Report progress
2737 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting O symmetry prediction." );
2738
2739 //================================================ Are the basic requirements for icosahedral symmetry met?
2740 if ( ProSHADE_internal_symmetry::detectOctahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
2741 {
2742 //============================================ Generate the rest of the axes
2743 ProSHADE_internal_symmetry::predictOctaAxes ( CSymList, &ret, settings->axisErrTolerance, this, settings->verbose, settings->minSymPeak, matrixTolerance );
2744 }
2745
2746 //================================================ Report progress
2747 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "O symmetry prediction complete." );
2748
2749 //================================================ Done
2750 return ( ret );
2751
2752 }

## ◆ getRealEMatrixValuesForLM()

void ProSHADE_internal_data::ProSHADE_data::getRealEMatrixValuesForLM | ( | proshade_signed | band,
|  | proshade_signed | order1,
|  | double * | eMatsLMReal,
|  | int | len
| ) |  |

This function fills the input array with the real E matrix values for particular band and order1 (l as opposed to l').

Parameters

  [in] | band | The band for which the real E matrix values are requested.
  [in] | order | The order for which the real E matrix values are requested.
  [in] | eMatsLMReal | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 3536 of file ProSHADE_data.cpp.

3537 {
3538 //================================================ Save the data into the output array
3539 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3540 {
3541 eMatsLMReal[iter] = static_cast<double> ( this->eMatrices[band][order1][iter][0] );
3542 }
3543
3544 //================================================ Done
3545 return ;
3546
3547 }

## ◆ getRealRotFunction()

void ProSHADE_internal_data::ProSHADE_data::getRealRotFunction | ( | double * | rotFunReal,
|  | int | len
| ) |  |

This function fills the input array with the real rotation function values.

Parameters

  [in] | rotFunReal | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 3625 of file ProSHADE_data.cpp.

3626 {
3627 //================================================ Save the data into the output array
3628 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3629 {
3630 rotFunReal[iter] = static_cast<double> ( this->so3CoeffsInverse[iter][0] );
3631 }
3632
3633 //================================================ Done
3634 return ;
3635
3636 }

## ◆ getRealSO3Coeffs()

void ProSHADE_internal_data::ProSHADE_data::getRealSO3Coeffs | ( | double * | so3CoefsReal,
|  | int | len
| ) |  |

This function fills the input array with the real SO(3) coefficient values.

Parameters

  [in] | so3CoefsReal | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 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 so3CoefsReal[iter] = static_cast<double> ( this->so3Coeffs[iter][0] );
3580 }
3581
3582 //================================================ Done
3583 return ;
3584
3585 }

## ◆ 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] | X | Pointer to the value of the internal private spherical harmonics real value of the given index.

Definition at line 3110 of file ProSHADE_data.cpp.

3111 {
3112 //================================================ Done
3113 return ( &this->sphericalHarmonics[shell][seanindex ( static_cast<proshade_signed> ( order ) - static_cast<proshade_signed> ( band ),
3114 band,
3115 this->spheres[shell]->getLocalBandwidth() )][0] );
3116
3117 }

## ◆ getRealTranslationFunction()

void ProSHADE_internal_data::ProSHADE_data::getRealTranslationFunction | ( | double * | trsFunReal,
|  | int | len
| ) |  |

This function fills the input array with the real translation function values.

Parameters

  [in] | trsFunReal | The array to which the values will be written into.
  [in] | len | The lenght of the array.

Definition at line 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 trsFunReal[iter] = static_cast<double> ( this->translationMap[iter][0] );
3667 }
3668
3669 //================================================ Done
3670 return ;
3671
3672 }

## ◆ getReBoxBoundaries()

void ProSHADE_internal_data::ProSHADE_data::getReBoxBoundaries | ( | ProSHADE_settings * | settings,
|  | proshade_signed *& | ret
| ) |  |

This function finds the boundaries enclosing positive map values and adds some extra space.

This function firstly finds the boundaries which enclose the positive map values and then it proceeds to add a given amount of space to all dimensions (positive and negative) to make sure the map does not end exactly at the bounds. It returns the new boundaries in the ret variable if they are smaller than the original bounds, or just the original bounds in case decrease was not achieved.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for reading in the map.
  [in] | ret | A pointer to proshade_signed array of 6 storing the results - (0 = minX; 1 = maxX; 2 = minY; 3 = maxY; 4 - minZ; 5 = maxZ).

Definition at line 1035 of file ProSHADE_data.cpp.

1036 {
1037 //================================================ Report function start
1038 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Finding new boundaries." );
1039
1040 //================================================ If same bounds as first one are required, test if possible and return these instead
1041 if ( settings->useSameBounds && ( this->inputOrder != 0 ) )
1042 {
1043 for ( proshade_unsign iter = 0; iter < 6; iter++ ) { ret[iter] = settings->forceBounds[iter]; }
1044 }
1045 //================================================ In this case, bounds need to be found de novo
1046 else
1047 {
1048 //============================================ Find the non-zero bounds
1049 ProSHADE_internal_mapManip::getNonZeroBounds ( this->internalMap, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1050 this->xDimSize, this->yDimSize, this->zDimSize, ret );
1051
1052 //============================================ Add the extra space
1053 ProSHADE_internal_mapManip::addExtraBoundSpace ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
1054 this->xDimSize, this->yDimSize, this->zDimSize, ret, settings->boundsExtraSpace );
1055
1056 //============================================ Beautify boundaries
1057 ProSHADE_internal_mapManip::beautifyBoundaries ( ret, this->xDimIndices, this->yDimIndices, this->zDimIndices, settings->boundsSimilarityThreshold, settings->verbose );
1058
1059 //============================================ Report function results
1060 std::stringstream ssHlp;
1061 ssHlp << "New boundaries are: " << ret[1] - ret[0] + 1 << " x " << ret[3] - ret[2] + 1 << " x " << ret[5] - ret[4] + 1;
1062 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, ssHlp.str() );
1063
1064 //============================================ If need be, save boundaries to be used for all other structure
1065 if ( settings->useSameBounds && ( this->inputOrder == 0 ) )
1066 {
1067 for ( proshade_unsign iter = 0; iter < 6; iter++ ) { settings->forceBounds[iter] = ret[iter]; }
1068 }
1069 }
1070
1071 //================================================ Report function completion
1072 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "New boundaries determined." );
1073
1074 //================================================ Done
1075 return ;
1076
1077 }

## ◆ getRecommendedSymmetryFold()

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

This function simply returns the detected recommended symmetry fold.

Parameters

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

Definition at line 3743 of file ProSHADE_data.cpp.

3744 {
3745 //================================================ Return the value
3746 return ( settings->recommendedSymmetryFold );
3747
3748 }

## ◆ getRecommendedSymmetryType()

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

This function simply returns the detected recommended symmetry type.

Parameters

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

Definition at line 3732 of file ProSHADE_data.cpp.

3733 {
3734 //================================================ Return the value
3735 return ( settings->recommendedSymmetryType );
3736
3737 }

## ◆ getRotMatrixFromRotFunInds()

void ProSHADE_internal_data::ProSHADE_data::getRotMatrixFromRotFunInds | ( | proshade_signed | aI,
|  | proshade_signed | bI,
|  | proshade_signed | gI,
|  | double * | rotMat,
|  | int | len
| ) |  |

This function takes rotation function indices, converts them to Euler angles and these to rotation matrix, which it then returns.

Parameters

  [in] | aI | The index along the Euler alpha dimension.
  [in] | bI | The index along the Euler beta dimension.
  [in] | gI | The index along the Euler gamma dimension.
  [in] | rotMat | The array to which the rotation matrix will be written into.
  [in] | len | The lenght of the array (must be 9).

Definition at line 3700 of file ProSHADE_data.cpp.

3701 {
3702 //================================================ Get Euler angles
3703 proshade_double eA, eB, eG;
3704 ProSHADE_internal_maths::getEulerZXZFromSOFTPosition ( this->getMaxBand(), aI, bI, gI, &eA, &eB, &eG );
3705
3706 //================================================ Prepare internal rotation matrix memory
3707 proshade_double* rMat = NULL;
3708 rMat = new proshade_double[9];
3709 ProSHADE_internal_misc::checkMemoryAllocation ( rMat, __FILE__, __LINE__, __func__ );
3710
3711 //================================================ Convert to rotation matrix
3712 ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( eA, eB, eG, rMat );
3713
3714 //================================================ Copy to output
3715 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++ )
3716 {
3717 rotMat[iter] = static_cast<double> ( rMat[iter] );
3718 }
3719
3720 //================================================ Release internal memory
3721 delete[] rMat;
3722
3723 //================================================ Done
3724 return ;
3725
3726 }

## ◆ getRRPValue()

proshade_double ProSHADE_internal_data::ProSHADE_data::getRRPValue | ( | proshade_unsign | band,
|  | proshade_unsign | sh1,
|  | proshade_unsign | sh2
| ) |  |

This function allows access to the priva internal RRP matrices.

Parameters

  [out] | X | The value of the internal private RRP matrix for the given indices.

Definition at line 2996 of file ProSHADE_data.cpp.

2997 {
2998 //================================================ Return the value
2999 return ( this->rrpMatrices[band][sh1][sh2] );
3000 }

## ◆ getShellBandwidth()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getShellBandwidth | ( | proshade_unsign | shell | ) |

This function allows access to the bandwidth of a particular shell.

Parameters

  [in] | shell | The index of the shell for which the bandwidth is required.
  [out] | X | The bandwidth of the requested shell.

Definition at line 3159 of file ProSHADE_data.cpp.

3160 {
3161 //================================================ Done
3162 return ( this->spheres[shell]->getLocalBandwidth ( ) );
3163
3164 }

## ◆ getSO3Coeffs()

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

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

Parameters

  [out] | X | The internal SO(3) coefficients array variable.

Definition at line 3224 of file ProSHADE_data.cpp.

3225 {
3226 //================================================ Done
3227 return ( this->so3Coeffs );
3228
3229 }

## ◆ getSpherePositions()

void ProSHADE_internal_data::ProSHADE_data::getSpherePositions | ( | ProSHADE_settings * | settings | ) |

This function determines the sphere positions (radii) for sphere mapping.

This function determines the radii of the concentric spheres (as measured from the centre of the map). This is done by checking if these values have already been as and if not, then the radii are placed between points of the map starting between the centre point and its neighbours and then adding spheres until the most outlying diagonal point is covered.

Parameters

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

Definition at line 1442 of file ProSHADE_data.cpp.

1443 {
1444 //================================================ Check the current settings value is set to auto
1445 if ( this->spherePos.size() != 0 )
1446 {
1447 std::stringstream hlpSS;
1448 hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1449 for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1450 hlpSS << " Angstroms.";
1451 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1452 return ;
1453 }
1454
1455 //================================================ Find maximum diagonal
1456 proshade_unsign maxDim = std::max ( this->xDimSize, std::max ( this->yDimSize, this->zDimSize ) );
1457 proshade_unsign minDim = std::min ( this->xDimSize, std::min ( this->yDimSize, this->zDimSize ) );
1458 proshade_unsign midDim = 0;
1459 if ( ( this->xDimSize < maxDim ) && ( this->xDimSize > minDim ) ) { midDim = this->xDimSize; }
1460 else if ( ( this->yDimSize < maxDim ) && ( this->yDimSize > minDim ) ) { midDim = this->yDimSize; }
1461 else { midDim = this->zDimSize; }
1462
1463 proshade_single maxDiag = std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ), 2.0 ) +
1464 std::pow ( static_cast<proshade_single> ( midDim ), 2.0 ) );
1465
1466 //================================================ Set between the points
1467 for ( proshade_single iter = 0.5; ( iter * settings->maxSphereDists ) < ( maxDiag / 2.0 ); iter += 1.0 )
1468 {
1469 ProSHADE_internal_misc::addToSingleVector ( &this->spherePos, ( iter * settings->maxSphereDists ) );
1470 }
1471
1472 //================================================ Save the number of spheres
1473 this->noSpheres = static_cast<proshade_unsign> ( this->spherePos.size() );
1474
1475 //================================================ Report progress
1476 std::stringstream hlpSS;
1477 hlpSS << "The sphere distances were determined as " << this->spherePos.at(0);
1478 for ( proshade_unsign iter = 1; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ ) { hlpSS << "; " << this->spherePos.at(iter); }
1479 hlpSS << " Angstroms.";
1480 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 3, hlpSS.str() );
1481
1482 //================================================ Done
1483 return ;
1484
1485 }

## ◆ getSpherePosValue()

proshade_double ProSHADE_internal_data::ProSHADE_data::getSpherePosValue | ( | proshade_unsign | shell | ) |

This function allows access to sphere positions.

Parameters

  [in] | shell | The index of the sphere for which the position (radius) is to be obtained.
  [out] | X | The radius of the sphere with index shell.

Definition at line 3171 of file ProSHADE_data.cpp.

3172 {
3173 //================================================ Done
3174 return ( this->spherePos.at(shell) );
3175
3176 }

## ◆ getSymmetryAxis()

std::vector< std::string > ProSHADE_internal_data::ProSHADE_data::getSymmetryAxis | ( | ProSHADE_settings * | settings,
|  | proshade_unsign | axisNo
| ) |  |

This function returns a single symmetry axis as a vector of strings from the recommended symmetry axes list.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for map symmetry detection.
  [in] | axisNo | The index of the axis to be returned.
  [out] | val | A vector of strings containing the symmetry axis fold, x, y, z axis element, angle and peak height in this order.

Definition at line 3767 of file ProSHADE_data.cpp.

3768 {
3769 //================================================ Sanity checks
3770 if ( static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ) <= axisNo )
3771 {
3772 ProSHADE_internal_messages::printWarningMessage ( settings->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
3773 return ( std::vector< std::string > ( ) );
3774 }
3775
3776 //================================================ Initialise local variables
3777 std::vector< std::string > ret;
3778
3779 //================================================ Input the axis data as strings
3780 std::stringstream ssHlp;
3781 ssHlp << settings->detectedSymmetry.at(axisNo)[0];
3782 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3783 ssHlp.str ( "" );
3784
3785 ssHlp << settings->detectedSymmetry.at(axisNo)[1];
3786 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3787 ssHlp.str ( "" );
3788
3789 ssHlp << settings->detectedSymmetry.at(axisNo)[2];
3790 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3791 ssHlp.str ( "" );
3792
3793 ssHlp << settings->detectedSymmetry.at(axisNo)[3];
3794 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3795 ssHlp.str ( "" );
3796
3797 ssHlp << settings->detectedSymmetry.at(axisNo)[4];
3798 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3799 ssHlp.str ( "" );
3800
3801 ssHlp << settings->detectedSymmetry.at(axisNo)[5];
3802 ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3803 ssHlp.str ( "" );
3804
3805 //================================================ Done
3806 return ( ret );
3807
3808 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for symmetry detection.
  [in] | CSymList | A vector containing the already detected Cyclic symmetries.

Definition at line 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?
1349 if ( ProSHADE_internal_symmetry::detectTetrahedralSymmetry ( CSymList, settings->axisErrTolerance, settings->minSymPeak ) )
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 {
1370 ProSHADE_internal_misc::addToUnsignVector ( &settings->allDetectedTAxes, csIt );
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] | translationMap | Pointer to the first position in the translation function map array.

Definition at line 3425 of file ProSHADE_data.cpp.

3426 {
3427 //================================================ Return the requested value
3428 return ( this->translationMap );
3429 }

## ◆ getWignerMatrixValue()

void ProSHADE_internal_data::ProSHADE_data::getWignerMatrixValue | ( | proshade_unsign | band,
|  | proshade_unsign | order1,
|  | proshade_unsign | order2,
|  | proshade_double * | valueReal,
|  | proshade_double * | valueImag
| ) |  |

This function allows access to the Wigner D matrix by knowing the band, order1 and order2 indices.

Parameters

  [in] | band | The band for which the Wigner D matrix value should be returned.
  [in] | order1 | The first order for which the Wigner D matrix value should be returned.
  [in] | order2 | The second order for which the Wigner D matrix value should be returned.
  [in] | valueReal | The proshade_double number pointer to where the real part of the value will be saved.
  [in] | valueImag | The proshade_double number pointer to where the imaginary part of the value will be saved.

Definition at line 3250 of file ProSHADE_data.cpp.

3251 {
3252 //================================================ Set pointer
3253 *valueReal = this->wignerMatrices[band][order1][order2][0];
3254 *valueImag = this->wignerMatrices[band][order1][order2][1];
3255
3256 //================================================ Done
3257 return ;
3258
3259 }

## ◆ getXAxisOrigin()

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

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

Parameters

  [out] | xAxisOrigin | The value of X axis origin for the map.

Definition at line 3385 of file ProSHADE_data.cpp.

3386 {
3387 //================================================ Return the requested value
3388 return ( &this->xAxisOrigin );
3389 }

## ◆ getXDim()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getXDim | ( | void |  | ) |

This function allows access to the map size in indices along the X axis.

Parameters

  [out] | xDimSize | The size of the internal map in indices along the X axis.

Definition at line 3295 of file ProSHADE_data.cpp.

3296 {
3297 //================================================ Return the requested value
3298 return ( this->xDimIndices );
3299 }

## ◆ getXDimSize()

proshade_single ProSHADE_internal_data::ProSHADE_data::getXDimSize | ( | void |  | ) |

This function allows access to the map size in angstroms along the X axis.

Parameters

  [out] | xDimSize | The size of the internal map in angstroms along the X axis.

Definition at line 3265 of file ProSHADE_data.cpp.

3266 {
3267 //================================================ Return the requested value
3268 return ( this->xDimSize );
3269 }

## ◆ getXFromPtr()

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

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

Parameters

  [out] | xFrom | Pointer to the starting index along the X axis.

Definition at line 3325 of file ProSHADE_data.cpp.

3326 {
3327 //================================================ Return the requested value
3328 return ( &this->xFrom );
3329 }

## ◆ getXToPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getXToPtr | ( | void |  | ) |

This function allows access to the map last position along the X axis.

Parameters

  [out] | xFrom | Pointer to the final index along the X axis.

Definition at line 3355 of file ProSHADE_data.cpp.

3356 {
3357 //================================================ Return the requested value
3358 return ( &this->xTo );
3359 }

## ◆ getYAxisOrigin()

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

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

Parameters

  [out] | yAxisOrigin | The value of Y axis origin for the map.

Definition at line 3395 of file ProSHADE_data.cpp.

3396 {
3397 //================================================ Return the requested value
3398 return ( &this->yAxisOrigin );
3399 }

## ◆ getYDim()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getYDim | ( | void |  | ) |

This function allows access to the map size in indices along the Y axis.

Parameters

  [out] | xDimSize | The size of the internal map in indices along the Y axis.

Definition at line 3305 of file ProSHADE_data.cpp.

3306 {
3307 //================================================ Return the requested value
3308 return ( this->yDimIndices );
3309 }

## ◆ getYDimSize()

proshade_single ProSHADE_internal_data::ProSHADE_data::getYDimSize | ( | void |  | ) |

This function allows access to the map size in angstroms along the Y axis.

Parameters

  [out] | xDimSize | The size of the internal map in angstroms along the Y axis.

Definition at line 3275 of file ProSHADE_data.cpp.

3276 {
3277 //================================================ Return the requested value
3278 return ( this->yDimSize );
3279 }

## ◆ getYFromPtr()

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

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

Parameters

  [out] | yFrom | Pointer to the starting index along the Y axis.

Definition at line 3335 of file ProSHADE_data.cpp.

3336 {
3337 //================================================ Return the requested value
3338 return ( &this->yFrom );
3339 }

## ◆ getYToPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getYToPtr | ( | void |  | ) |

This function allows access to the map last position along the Y axis.

Parameters

  [out] | yFrom | Pointer to the final index along the Y axis.

Definition at line 3365 of file ProSHADE_data.cpp.

3366 {
3367 //================================================ Return the requested value
3368 return ( &this->yTo );
3369 }

## ◆ getZAxisOrigin()

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

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

Parameters

  [out] | zAxisOrigin | The value of Z axis origin for the map.

Definition at line 3405 of file ProSHADE_data.cpp.

3406 {
3407 //================================================ Return the requested value
3408 return ( &this->zAxisOrigin );
3409 }

## ◆ getZDim()

proshade_unsign ProSHADE_internal_data::ProSHADE_data::getZDim | ( | void |  | ) |

This function allows access to the map size in indices along the Z axis.

Parameters

  [out] | xDimSize | The size of the internal map in indices along the Z axis.

Definition at line 3315 of file ProSHADE_data.cpp.

3316 {
3317 //================================================ Return the requested value
3318 return ( this->zDimIndices );
3319 }

## ◆ getZDimSize()

proshade_single ProSHADE_internal_data::ProSHADE_data::getZDimSize | ( | void |  | ) |

This function allows access to the map size in angstroms along the Z axis.

Parameters

  [out] | xDimSize | The size of the internal map in angstroms along the Z axis.

Definition at line 3285 of file ProSHADE_data.cpp.

3286 {
3287 //================================================ Return the requested value
3288 return ( this->zDimSize );
3289 }

## ◆ getZFromPtr()

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

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

Parameters

  [out] | zFrom | Pointer to the starting index along the Z axis.

Definition at line 3345 of file ProSHADE_data.cpp.

3346 {
3347 //================================================ Return the requested value
3348 return ( &this->zFrom );
3349 }

## ◆ getZToPtr()

proshade_signed * ProSHADE_internal_data::ProSHADE_data::getZToPtr | ( | void |  | ) |

This function allows access to the map last position along the Z axis.

Parameters

  [out] | zFrom | Pointer to the final index along the Z axis.

Definition at line 3375 of file ProSHADE_data.cpp.

3376 {
3377 //================================================ Return the requested value
3378 return ( &this->zTo );
3379 }

## ◆ 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] | settings | The settings object specifying how exactly the rotation is to be done.
  [in] | densityMapRotated | The 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] | settings | A pointer to settings class containing all the information required for reading in the map.

Definition at line 894 of file ProSHADE_data.cpp.

895 {
896 //================================================ Report function start
897 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion." );
898
899 //================================================ Initialise variables
900 proshade_signed arrayPos, invPos;
901
902 //================================================ Create helper map
903 proshade_double* hlpMap = new proshade_double [this->xDimIndices * this->yDimIndices * this->zDimIndices];
904 ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
905
906 //================================================ Save map values to the helper map
907 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
908 {
909 hlpMap[iter] = this->internalMap[iter];
910 }
911
912 //================================================ Invert the values
913 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
914 {
915 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
916 {
917 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
918 {
919 //==================================== Var init
920 arrayPos = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
921 invPos = ( (this->zDimIndices-1) - zIt ) + this->zDimIndices * ( ( (this->yDimIndices-1) - yIt ) + this->yDimIndices * ( (this->xDimIndices-1) - xIt ) );
922
923 //==================================== And save
924 this->internalMap[invPos] = hlpMap[arrayPos];
925 }
926 }
927 }
928
929 //================================================ Release memory
930 delete[] hlpMap;
931
932 //================================================ Report function completion
933 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map inversion completed." );
934
935 //================================================ Done
936 return ;
937
938 }

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

Definition at line 1499 of file ProSHADE_data.cpp.

1500 {
1501 //================================================ Report progress
1502 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Starting sphere mapping procedure." );
1503
1504 //================================================ Determine spherical harmonics variables
1505 settings->determineAllSHValues ( this->xDimIndices, this->yDimIndices, this->zDimIndices );
1506 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere settings determined." );
1507
1508 //================================================ Find number of spheres supported
1509 this->getSpherePositions ( settings );
1510 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere positions obtained." );
1511
1512 //================================================ Create sphere objects and map the density
1513 this->spheres = new ProSHADE_internal_spheres::ProSHADE_sphere* [ this->noSpheres ];
1514 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->spherePos.size() ); iter++ )
1515 {
1516 std::stringstream ss;
1517 ss << "Now mapping sphere " << iter << " .";
1518 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, ss.str() );
1519
1520 this->spheres[iter] = new ProSHADE_internal_spheres::ProSHADE_sphere ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
1521 this->xDimSize, this->yDimSize, this->zDimSize, iter,
1522 &this->spherePos, settings->progressiveSphereMapping, settings->maxBandwidth,
1523 this->internalMap, &this->maxShellBand );
1524 }
1525
1526 //================================================ Report completion
1527 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Sphere mapping procedure completed." );
1528
1529 //================================================ Done
1530 return ;
1531
1532 }

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

Definition at line 995 of file ProSHADE_data.cpp.

996 {
997 //================================================ Report function start
998 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Computing mask." );
999
1000 //================================================ Initialise the blurred map
1001 proshade_double* blurredMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
1002 ProSHADE_internal_misc::checkMemoryAllocation ( blurredMap, __FILE__, __LINE__, __func__ );
1003
1004 //================================================ Compute blurred map
1005 ProSHADE_internal_mapManip::blurSharpenMap ( this->internalMap, blurredMap, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1006 this->xDimSize, this->yDimSize, this->zDimSize, settings->blurFactor );
1007
1008 //================================================ Compute mask from blurred map and save it into the original map
1009 ProSHADE_internal_mapManip::getMaskFromBlurr ( blurredMap, this->internalMap, this->xDimIndices, this->yDimIndices, this->zDimIndices, settings->maskingThresholdIQRs );
1010
1011 //================================================ Print the mask if need be
1012 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 ); } }
1013
1014 //================================================ Release memory
1015 delete[] blurredMap;
1016
1017 //================================================ Report function completion
1018 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Mask computed." );
1019
1020 //================================================ Done
1021 return ;
1022
1023 }

## ◆ normaliseEMatrixValue()

void ProSHADE_internal_data::ProSHADE_data::normaliseEMatrixValue | ( | proshade_unsign | band,
|  | proshade_unsign | order1,
|  | proshade_unsign | order2,
|  | proshade_double | normF
| ) |  |

This function allows normalising the E matrix value.

Parameters

  [in] | band | The band indice of the E matrix to which the value should be assigned.
  [in] | order1 | The first order indice of the E matrix to which the value should be assigned.
  [in] | order2 | The second order indice of the E matrix to which the value should be assigned.
  [in] | normF | The value by which the original E matrix value will be divided to normalise it.

Definition at line 3484 of file ProSHADE_data.cpp.

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

## ◆ normaliseMap()

void ProSHADE_internal_data::ProSHADE_data::normaliseMap | ( | ProSHADE_settings * | settings | ) |

Function for normalising the map values to mean 0 and sd 1..

This function takes the map and changes its value to have mean 0 and standard deviation of 1. This should make wo maps with very different density levels more comparable, but it remains to be seen if this causes any trouble. Can be turned off using the settings options.

Parameters

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

Definition at line 948 of file ProSHADE_data.cpp.

949 {
950 //================================================ Report function start
951 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation." );
952
953 //================================================ Initialise vector of map values
954 std::vector<proshade_double> mapVals ( this->xDimIndices * this->yDimIndices * this->zDimIndices, 0.0 );
955
956 //================================================ Get all map values
957 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
958 {
959 mapVals.at(iter) = this->internalMap[iter];
960 }
961
962 //================================================ Get mean and sd
963 proshade_double* meanSD = new proshade_double[2];
964 ProSHADE_internal_maths::vectorMeanAndSD ( &mapVals, meanSD );
965
966 //================================================ Normalise the values
967 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
968 {
969 this->internalMap[iter] = ( this->internalMap[iter] - meanSD[0] ) / meanSD[1];
970 }
971
972 //================================================ Clear the vector
973 mapVals.clear ( );
974
975 //================================================ Release memory
976 delete[] meanSD;
977
978 //================================================ Report function completion
979 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Map normalisation completed." );
980
981 //================================================ Done
982 return ;
983
984 }

## ◆ optimiseDihedralAngleFromAngleAxis()

std::vector< proshade_double * > ProSHADE_internal_data::ProSHADE_data::optimiseDihedralAngleFromAngleAxis | ( | ProSHADE_settings * | settings,
|  | proshade_double | angle,
|  | proshade_double * | axis1,
|  | proshade_double * | axis2
| ) |  |

...

...

Parameters

  [in] | settings | ProSHADE_settings object containing all the settings for this run.
  [in] | angle | The cosine of angle to which the two axes should be optimised to.
  [in] | axis1 | The first axis to be optimised.
  [in] | axis2 | The second axis to be optimised.
  [out] | ret | Vector of double pointers to arrays having the standard ProSHADE symmetry group structure.

Definition at line 3822 of file ProSHADE_symmetry.cpp.

3823 {
3824 //================================================ Initialise variables
3825 std::vector< proshade_double* > ret;
3826 std::vector<ProSHADE_internal_spheres::ProSHADE_rotFun_sphere*> ax1SphereMappedRotFun, ax2SphereMappedRotFun;
3827 std::cout << "ANGLE: " << angle << std::endl;
3828
3829 //================================================ Convert rotation function to only the required angle-axis space spheres and find all peaks for first axis
3830 for ( proshade_double angIt = 1.0; angIt < axis1[0]; angIt += 1.0 )
3831 {
3832 //============================================ Create the angle-axis sphere with correct radius (angle)
3833 ax1SphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere ( axis1[4],
3834 M_PI / static_cast<proshade_double> ( axis1[0] ),
3835 this->maxShellBand * 2.0,
3836 axis1[4],
3837 static_cast<proshade_unsign> ( angIt - 1.0 ) ) );
3838
3839 //=========================================== Interpolate rotation function onto the sphere
3840 ax1SphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
3841 }
3842
3843 //================================================ Convert rotation function to only the required angle-axis space spheres and find all peaks for second axis
3844 for ( proshade_double angIt = 1.0; angIt < axis2[0]; angIt += 1.0 )
3845 {
3846 //============================================ Create the angle-axis sphere with correct radius (angle)
3847 ax2SphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere ( axis2[4],
3848 M_PI / static_cast<proshade_double> ( axis2[0] ),
3849 this->maxShellBand * 2.0,
3850 axis2[4],
3851 static_cast<proshade_unsign> ( angIt - 1.0 ) ) );
3852
3853 //=========================================== Interpolate rotation function onto the sphere
3854 ax2SphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
3855 }
3856
3857 //================================================ Change axis1 to improve the angle
3858 std::cout << "Original axes : " << axis1[1] << " ; " << axis1[2] << " ; " << axis1[3] << " AND " << axis2[1] << " ; " << axis2[2] << " ; " << axis2[3] << std::endl;
3859 proshade_double angErr = 0.05;
3860 proshade_double dotProd, dotProdHlp, bestAngErr, axNorm, bestX = 0.0, bestY = 0.0, bestZ = 0.0;
3861 bool axisImproved = true;
3862 while ( axisImproved && angErr > 0.0001 )
3863 {
3864 //============================================ Find current error
3865 dotProd = ProSHADE_internal_maths::computeDotProduct ( &axis1[1], &axis1[2], &axis1[3], &axis2[1], &axis2[2], &axis2[3] );
3866 angErr = std::abs ( std::abs ( angle ) - std::abs ( dotProd ) );
3867 std::cout << " !!! Angle error : " << angErr << std::endl;
3868
3869 //============================================ Can we improve by moving a bit?
3870 axisImproved = false;
3871 bestAngErr = angErr;
3872 for ( proshade_double xCh = -1.0; xCh < 1.1; xCh += 1.0 )
3873 {
3874 for ( proshade_double yCh = -1.0; yCh < 1.1; yCh += 1.0 )
3875 {
3876 for ( proshade_double zCh = -1.0; zCh < 1.1; zCh += 1.0 )
3877 {
3878 //================================ Test changed axis
3879 axNorm = std::sqrt ( std::pow( axis1[1] + (xCh * angErr), 2.0 ) + std::pow( axis1[2] + (yCh * angErr), 2.0 ) + std::pow ( axis1[3] + (zCh * angErr), 2.0 ) );
3880 dotProdHlp = ProSHADE_internal_maths::computeDotProduct ( ( axis1[1] + (xCh * angErr) ) / axNorm,
3881 ( axis1[2] + (yCh * angErr) ) / axNorm,
3882 ( axis1[3] + (zCh * angErr) ) / axNorm, axis2[1], axis2[2], axis2[3] );
3883
3884 if ( bestAngErr > std::abs ( std::abs ( angle ) - std::abs ( dotProdHlp ) ) )
3885 {
3886 //============================ Improvement!
3887 bestX = ( axis1[1] + (xCh * angErr) ) / axNorm;
3888 bestY = ( axis1[2] + (yCh * angErr) ) / axNorm;
3889 bestZ = ( axis1[3] + (zCh * angErr) ) / axNorm;
3890 axisImproved = true;
3891 bestAngErr = std::abs ( std::abs ( angle ) - std::abs ( dotProdHlp ) );
3892 }
3893 }
3894 }
3895 }
3896
3897 //============================================ If improved, try again
3898 if ( axisImproved ) { axis1[1] = bestX; axis1[2] = bestY; axis1[3] = bestZ; }
3899 }
3900
3901 std::cout << "Angle improved axes: " << axis1[1] << " ; " << axis1[2] << " ; " << axis1[3] << " AND " << axis2[1] << " ; " << axis2[2] << " ; " << axis2[3] << std::endl;
3902
3903 //================================================ Keeping the angle, search for highest peak
3904 proshade_double curSum = 0.0;
3905 proshade_double lat, lon, bestSumChange, bestSum = 0.0, sumChange = 0.005;
3906 bool sumImproved = true;
3907 while ( sumImproved && sumChange > 0.00001 )
3908 {
3909 std::cout << std::endl << " !!! New iteration axes: " << axis1[1] << " ; " << axis1[2] << " ; " << axis1[3] << " AND " << axis2[1] << " ; " << axis2[2] << " ; " << axis2[3] << std::endl;
3910 sumImproved = false;
3911 bestSum = 0.0;
3912
3913 lon = atan2 ( axis1[2], axis1[1] );
3914 lat = asin ( axis1[3] );
3915 for ( proshade_unsign sph1It = 0; sph1It < static_cast< proshade_unsign > ( ax1SphereMappedRotFun.size() ); sph1It++ )
3916 {
3917 bestSum += ax1SphereMappedRotFun.at(sph1It)->getSphereLatLonLinearInterpolationPos ( lat, lon );
3918 }
3919
3920 lon = atan2 ( axis2[2], axis2[1] );
3921 lat = asin ( axis2[3] );
3922 for ( proshade_unsign sph2It = 0; sph2It < static_cast< proshade_unsign > ( ax2SphereMappedRotFun.size() ); sph2It++ )
3923 {
3924 bestSum += ax2SphereMappedRotFun.at(sph2It)->getSphereLatLonLinearInterpolationPos ( lat, lon );
3925 }
3926
3927 std::cout << " !!! !!! Current best sum is: " << bestSum << std::endl;
3928
3929 bestSumChange = bestSum;
3930 for ( proshade_double xCh = -1.0; xCh < 1.1; xCh += 1.0 )
3931 {
3932 for ( proshade_double yCh = -1.0; yCh < 1.1; yCh += 1.0 )
3933 {
3934 for ( proshade_double zCh = -1.0; zCh < 1.1; zCh += 1.0 )
3935 {
3936 curSum = 0.0;
3937
3938 axNorm = std::sqrt ( std::pow( axis1[1] + ( xCh * sumChange ), 2.0 ) + std::pow( axis1[2] + ( yCh * sumChange ), 2.0 ) + std::pow ( axis1[3] + ( zCh * sumChange ), 2.0 ) );
3939 lon = atan2 ( ( axis1[2] + ( yCh * sumChange ) ) / axNorm, ( axis1[1] + ( xCh * sumChange ) ) / axNorm );
3940 lat = asin ( ( axis1[3] + ( zCh * sumChange ) ) / axNorm );
3941 for ( proshade_unsign sph1It = 0; sph1It < static_cast< proshade_unsign > ( ax1SphereMappedRotFun.size() ); sph1It++ )
3942 {
3943 curSum += ax1SphereMappedRotFun.at(sph1It)->getSphereLatLonLinearInterpolationPos ( lat, lon );
3944 }
3945
3946 axNorm = std::sqrt ( std::pow( axis2[1] + ( xCh * sumChange ), 2.0 ) + std::pow( axis2[2] + ( yCh * sumChange ), 2.0 ) + std::pow ( axis2[3] + ( zCh * sumChange ), 2.0 ) );
3947 lon = atan2 ( ( axis2[2] + ( yCh * sumChange ) ) / axNorm, ( axis2[1] + ( xCh * sumChange ) ) / axNorm );
3948 lat = asin ( ( axis2[3] + ( zCh * sumChange ) ) / axNorm );
3949 for ( proshade_unsign sph2It = 0; sph2It < static_cast< proshade_unsign > ( ax2SphereMappedRotFun.size() ); sph2It++ )
3950 {
3951 curSum += ax2SphereMappedRotFun.at(sph2It)->getSphereLatLonLinearInterpolationPos ( lat, lon );
3952 }
3953
3954 if ( curSum > bestSumChange )
3955 {
3956 sumImproved = true;
3957 bestX = ( xCh * sumChange );
3958 bestY = ( yCh * sumChange );
3959 bestZ = ( zCh * sumChange );
3960 bestSumChange = curSum;
3961 }
3962 }
3963 }
3964 }
3965
3966 if ( sumImproved )
3967 {
3968 axis1[1] += bestX;
3969 axis1[2] += bestY;
3970 axis1[3] += bestZ;
3971 axNorm = std::sqrt ( std::pow( axis1[1], 2.0 ) + std::pow( axis1[2], 2.0 ) + std::pow ( axis1[3], 2.0 ) );
3972 axis1[1] /= axNorm;
3973 axis1[2] /= axNorm;
3974 axis1[3] /= axNorm;
3975
3976
3977 axis2[1] += bestX;
3978 axis2[2] += bestY;
3979 axis2[3] += bestZ;
3980 axNorm = std::sqrt ( std::pow( axis2[1], 2.0 ) + std::pow( axis2[2], 2.0 ) + std::pow ( axis2[3], 2.0 ) );
3981 axis2[1] /= axNorm;
3982 axis2[2] /= axNorm;
3983 axis2[3] /= axNorm;
3984
3985
3986 sumChange = bestSumChange - bestSum;
3987 std::cout << " !!! END iteration axes: " << axis1[1] << " ; " << axis1[2] << " ; " << axis1[3] << " AND " << axis2[1] << " ; " << axis2[2] << " ; " << axis2[3] << std::endl;
3988 }
3989 }
3990
3991 std::cout << "Sum improved axes: " << axis1[1] << " ; " << axis1[2] << " ; " << axis1[3] << " AND " << axis2[1] << " ; " << axis2[2] << " ; " << axis2[3] << std::endl;
3992
3993 //================================================
3994 std::cout << "Finally, the best sum on changed axes is " << bestSum << " ." << std::endl;
3995
3996
3997 // //================================================ Initialise variables
3998 // proshade_double soughtAngle;
3999 // std::vector< proshade_double > allPeakHeights;
4000 // std::vector< ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup* > peakGroups;
4001 // std::vector< proshade_double* > ret;
4002 // bool newPeak;
4003 //
4004 // //================================================ Make sure we have a clean start
4005 // this->sphereMappedRotFun.clear();
4006 //
4007 // //================================================ Convert rotation function to only the required angle-axis space spheres and find all peaks
4008 // for ( proshade_double angIt = 1.0; angIt < static_cast<proshade_double> ( fold ); angIt += 1.0 )
4009 // {
4010 // //============================================ Figure the angles to form the symmetry
4011 // soughtAngle = angIt * ( 2.0 * M_PI / static_cast<proshade_double> ( fold ) );
4012 //
4013 // //============================================ Create the angle-axis sphere with correct radius (angle)
4014 // this->sphereMappedRotFun.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_sphere ( soughtAngle,
4015 // M_PI / static_cast<proshade_double> ( fold ),
4016 // this->maxShellBand * 2.0,
4017 // soughtAngle,
4018 // static_cast<proshade_unsign> ( angIt - 1.0 ) ) );
4019 //
4020 // //=========================================== Interpolate rotation function onto the sphere
4021 // this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->interpolateSphereValues ( this->getInvSO3Coeffs ( ) );
4022 //
4023 // //============================================ Find all peaks for this sphere
4024 // this->sphereMappedRotFun.at(static_cast<proshade_unsign> ( angIt - 1.0 ))->findAllPeaks ( settings->peakNeighbours, &allPeakHeights );
4025 // }
4026 //
4027 // //============================================ Report progress
4028 // std::stringstream hlpSS;
4029 // hlpSS << "Found a total of " << std::pow ( this->maxShellBand * 2.0 * (fold-1), 2.0 ) - allPeakHeights.size() << " non-peaks for thresholding.";
4030 // ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS.str() );
4031 //
4032 // //================================================ Determine the threshold for significant peaks
4033 // *peakThres = std::max ( settings->minSymPeak, determinePeakThreshold ( allPeakHeights, settings->noIQRsFromMedianNaivePeak ) );
4034 //
4035 // //============================================ Report progress
4036 // std::stringstream hlpSS2;
4037 // hlpSS2 << "Determined peak threshold " << *peakThres << ".";
4038 // ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 4, hlpSS2.str() );
4039 //
4040 // //================================================ Remove small peaks
4041 // for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ )
4042 // {
4043 // this->sphereMappedRotFun.at(shIt)->removeSmallPeaks ( *peakThres );
4044 // }
4045 //
4046 // proshade_unsign tc = 0;
4047 // for ( proshade_unsign shIt = 0; shIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); shIt++ ) { tc += this->sphereMappedRotFun.at(shIt)->getPeaks().size(); }
4048 //
4049 //
4050 // //================================================ Group peaks
4051 // for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.size() ); sphIt++ )
4052 // {
4053 // //============================================ For each peak
4054 // for ( proshade_unsign pkIt = 0; pkIt < static_cast<proshade_unsign> ( this->sphereMappedRotFun.at(sphIt)->getPeaks().size() ); pkIt++ )
4055 // {
4056 // //======================================== Check if peak belongs to an already detected peak group
4057 // newPeak = true;
4058 // for ( proshade_unsign pkGrpIt = 0; pkGrpIt < static_cast<proshade_unsign> ( peakGroups.size() ); pkGrpIt++ )
4059 // {
4060 // 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; }
4061 // }
4062 //
4063 // //======================================== If already added, go to next one
4064 // if ( !newPeak ) { continue; }
4065 //
4066 // //======================================== If not, create a new group with this peak
4067 // peakGroups.emplace_back ( new ProSHADE_internal_spheres::ProSHADE_rotFun_spherePeakGroup ( this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).first,
4068 // this->sphereMappedRotFun.at(sphIt)->getPeaks().at(pkIt).second,
4069 // sphIt,
4070 // this->sphereMappedRotFun.at(sphIt)->getAngularDim() ) );
4071 // }
4072 // }
4073 //
4074 // //================================================ For each peak group, look for the requested fold
4075 // for ( proshade_unsign grIt = 0; grIt < static_cast<proshade_unsign> ( peakGroups.size() ); grIt++ )
4076 // {
4077 // //============================================ Report progress
4078 // std::stringstream hlpSS3;
4079 // 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 ";
4080 // for ( proshade_unsign sphIt = 0; sphIt < static_cast<proshade_unsign> ( peakGroups.at(grIt)->getSpherePositions().size() ); sphIt++ ) { hlpSS3 << peakGroups.at(grIt)->getSpherePositions().at(sphIt) << " ; "; }
4081 // ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 5, hlpSS3.str() );
4082 //
4083 // //============================================ Find point groups in the peak group
4084 // peakGroups.at(grIt)->findCyclicPointGroupsGivenFold ( this->sphereMappedRotFun, settings->axisErrTolerance, &ret, settings->useBiCubicInterpolationOnPeaks, fold, settings->verbose );
4085 //
4086 // //============================================ Release the memory
4087 // delete peakGroups.at(grIt);
4088 // }
4089 //
4090 // //================================================ Sort ret by peak height
4091 // std::sort ( ret.begin(), ret.end(), sortProSHADESymmetryByPeak );
4092
4093 //================================================ Done
4094 return ( ret );
4095
4096 }

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

Warning
  This function MUST be called on any structure that is to be processed by ProSHADE.

Definition at line 1398 of file ProSHADE_data.cpp.

1399 {
1400 //================================================ Invert map
1401 if ( settings->invertMap ) { this->invertMirrorMap ( settings ); }
1402 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map inversion (mirror image) not requested." ); }
1403
1404 //================================================ Normalise map
1405 if ( settings->normaliseMap ) { this->normaliseMap ( settings ); }
1406 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map normalisation not requested." ); }
1407
1408 //================================================ Compute mask
1409 //if ( settings->maskMap ) { if ( settings->useCorrelationMasking ) { this->maskMapCorrelation ( settings ); } else { this->maskMap ( settings ); } }
1410 if ( settings->maskMap ) { this->maskMap ( settings ); }
1411 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Masking not requested." ); }
1412
1413 //================================================ Centre map
1414 if ( settings->moveToCOM ) { this->centreMapOnCOM ( settings ); }
1415 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Map centering not requested." ); }
1416
1417 //================================================ Add extra space
1418 if ( settings->addExtraSpace != 0.0 ) { this->addExtraSpace ( settings ); }
1419 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Extra space not requested." ); }
1420
1421 //================================================ Remove phase, if required
1422 if ( !settings->usePhase ) { this->removePhaseInormation ( settings ); ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information removed from the data." ); }
1423 else { ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Phase information retained in the data." ); }
1424
1425 //================================================ Set settings values which were left on AUTO by user and will not be set later
1426 settings->setVariablesLeftOnAuto ( );
1427
1428 //================================================ Done
1429 return ;
1430
1431 }

## ◆ 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] | settings | A 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
511 ProSHADE_internal_io::readInMapHeader ( &map,
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 this->reSampleMap ( settings );
538 }
539
540 //================================================ Save the original sizes
541 this->xDimSizeOriginal = this->xDimSize;
542 this->yDimSizeOriginal = this->yDimSize;
543 this->zDimSizeOriginal = this->zDimSize;
544
545 //================================================ Save the original index counts
546 this->xDimIndicesOriginal = this->xDimIndices;
547 this->yDimIndicesOriginal = this->yDimIndices;
548 this->zDimIndicesOriginal = this->zDimIndices;
549
550 //================================================ Save the original axis origins
551 this->xAxisOriginOriginal = this->xAxisOrigin;
552 this->yAxisOriginOriginal = this->yAxisOrigin;
553 this->zAxisOriginOriginal = this->zAxisOrigin;
554
555 //================================================ Compute and save the COM
556 this->findMapCOM ( );
557 this->originalMapXCom = this->xCom;
558 this->originalMapYCom = this->yCom;
559 this->originalMapZCom = this->zCom;
560
561 //================================================ Done
562
563 }

## ◆ readInPDB()

void ProSHADE_internal_data::ProSHADE_data::readInPDB | ( | ProSHADE_settings * | settings | ) |
| protected

Function for reading pdb data.

This function reads in the pdb data using the information from the settings object, converts the co-ordinates onto a theoretical map and and saves all the results into the structure calling it.

Parameters

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

Warning
  For multiple models, this function works, but the map is not perfectly fitted to the PDB file.

Definition at line 574 of file ProSHADE_data.cpp.

575 {
576 //================================================ Set resolution if need be
577 if ( settings->requestedResolution < 0.0 )
578 {
579 settings->setResolution ( 8.0 );
580 }
581
582 //================================================ Open PDB file for reading
583 gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
584
585 //================================================ Change B-factors if need be
586 if ( settings->pdbBFactorNewVal >= 0.0 )
587 {
588 ProSHADE_internal_mapManip::changePDBBFactors ( &pdbFile, settings->pdbBFactorNewVal, settings->firstModelOnly );
589 }
590
591 //================================================ Remove waters if required
592 if ( settings->removeWaters )
593 {
594 ProSHADE_internal_mapManip::removeWaters ( &pdbFile, settings->firstModelOnly );
595 }
596
597 //================================================ Get PDB COM values
598 proshade_double xCOMPdb, yCOMPdb, zCOMPdb;
599 ProSHADE_internal_mapManip::findPDBCOMValues ( pdbFile, &xCOMPdb, &yCOMPdb, &zCOMPdb, settings->firstModelOnly );
600
601 //================================================ Find the ranges
602 proshade_single xF, xT, yF, yT, zF, zT;
603 ProSHADE_internal_mapManip::determinePDBRanges ( pdbFile, &xF, &xT, &yF, &yT, &zF, &zT, settings->firstModelOnly );
604
605 //================================================ Move ranges to have all FROM values 20
606 proshade_single xMov = 20.0 - xF;
607 proshade_single yMov = 20.0 - yF;
608 proshade_single zMov = 20.0 - zF;
609 ProSHADE_internal_mapManip::movePDBForMapCalc ( &pdbFile, xMov, yMov, zMov, settings->firstModelOnly );
610
611 //================================================ Set the angstrom sizes
612 this->xDimSize = xT - xF + 40.0;
613 this->yDimSize = yT - yF + 40.0;
614 this->zDimSize = zT - zF + 40.0;
615
616 //================================================ Generate map from nicely placed atoms (cell size will be range + 40)
617 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 );
618
619 //================================================ Set the internal variables to correct values
620 this->setPDBMapValues ( );
621
622 //================================================ Compute reverse movement based on COMs. If there is more than 1 models, simply moving back the xyzMov is not enough.
623 proshade_double xCOMMap, yCOMMap, zCOMMap;
624 ProSHADE_internal_mapManip::findMAPCOMValues ( this->internalMap, &xCOMMap, &yCOMMap, &zCOMMap,
625 this->xDimSize, this->yDimSize, this->zDimSize,
626 this->xFrom, this->xTo, this->yFrom, this->yTo, this->zFrom, this->zTo );
627
628 if ( pdbFile.models.size() > 1 )
629 {
630 xMov = xCOMMap - xCOMPdb;
631 yMov = yCOMMap - yCOMPdb;
632 zMov = zCOMMap - zCOMPdb;
633 }
634
635 //================================================ Move map back to the original PDB location
636 ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize,
637 &this->xFrom, &this->xTo, &this->yFrom, &this->yTo, &this->zFrom, &this->zTo,
638 &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
639 ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
640 this->xDimIndices, this->yDimIndices, this->zDimIndices );
641
642 //================================================ If specific resolution is requested, make sure the map has it
643 if ( settings->changeMapResolution || settings->changeMapResolutionTriLinear )
644 {
645 this->reSampleMap ( settings );
646 }
647
648 //================================================ Save the original sizes
649 this->xDimSizeOriginal = this->xDimSize;
650 this->yDimSizeOriginal = this->yDimSize;
651 this->zDimSizeOriginal = this->zDimSize;
652
653 //================================================ Save the original index counts
654 this->xDimIndicesOriginal = this->xDimIndices;
655 this->yDimIndicesOriginal = this->yDimIndices;
656 this->zDimIndicesOriginal = this->zDimIndices;
657
658 //================================================ Save the original axis origins
659 this->xAxisOriginOriginal = this->xAxisOrigin;
660 this->yAxisOriginOriginal = this->yAxisOrigin;
661 this->zAxisOriginOriginal = this->zAxisOrigin;
662
663 //================================================ Compute and save the COM
664 this->findMapCOM ( );
665 this->originalMapXCom = this->xCom;
666 this->originalMapYCom = this->yCom;
667 this->originalMapZCom = this->zCom;
668
669 //================================================ Done
670 return;
671
672 }

## ◆ 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] | fName | The file name of the file which should be loaded.
  [in] | inputO | The order of this structure in this run's input.
  [in] | settings | A pointer to settings class containing all the information required for reading in the map.

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
462 this->fileType = ProSHADE_internal_io::figureDataType ( this->fileName );
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] | settings | A pointer to settings class containing all the information required for map manipulation.

Definition at line 3032 of file ProSHADE_data.cpp.

3033 {
3034 //================================================ Report function start
3035 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 1, "Centering map onto its COM." );
3036
3037 //================================================ Copy map for processing
3038 fftw_complex* mapCoeffs = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3039 fftw_complex* pattersonMap = new fftw_complex[this->xDimIndices * this->yDimIndices * this->zDimIndices];
3040
3041 //================================================ Check memory allocation
3042 ProSHADE_internal_misc::checkMemoryAllocation ( mapCoeffs, __FILE__, __LINE__, __func__ );
3043 ProSHADE_internal_misc::checkMemoryAllocation ( pattersonMap, __FILE__, __LINE__, __func__ );
3044
3045 //================================================ Copy data to mask
3046 for ( proshade_unsign iter = 0; iter < (this->xDimIndices * this->yDimIndices * this->zDimIndices); iter++ )
3047 {
3048 pattersonMap[iter][0] = this->internalMap[iter];
3049 pattersonMap[iter][1] = 0.0;
3050 }
3051
3052 //================================================ Prepare FFTW plans
3053 fftw_plan forward = fftw_plan_dft_3d ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
3054 pattersonMap, mapCoeffs, FFTW_FORWARD, FFTW_ESTIMATE );
3055 fftw_plan inverse = fftw_plan_dft_3d ( this->xDimIndices, this->yDimIndices, this->zDimIndices,
3056 mapCoeffs, pattersonMap, FFTW_BACKWARD, FFTW_ESTIMATE );
3057
3058 //================================================ Run forward Fourier
3059 fftw_execute ( forward );
3060
3061 //================================================ Remove the phase
3062 ProSHADE_internal_mapManip::removeMapPhase ( mapCoeffs, this->xDimIndices, this->yDimIndices, this->zDimIndices );
3063
3064 //================================================ Run inverse Fourier
3065 fftw_execute ( inverse );
3066
3067 //================================================ Save the results
3068 proshade_signed mapIt, patIt, patX, patY, patZ;
3069 for ( proshade_signed xIt = 0; xIt < static_cast<proshade_signed> ( this->xDimIndices ); xIt++ )
3070 {
3071 for ( proshade_signed yIt = 0; yIt < static_cast<proshade_signed> ( this->yDimIndices ); yIt++ )
3072 {
3073 for ( proshade_signed zIt = 0; zIt < static_cast<proshade_signed> ( this->zDimIndices ); zIt++ )
3074 {
3075 //==================================== Centre patterson map
3076 patX = xIt - ( static_cast<proshade_signed> ( this->xDimIndices ) / 2 ); if ( patX < 0 ) { patX += this->xDimIndices; }
3077 patY = yIt - ( static_cast<proshade_signed> ( this->yDimIndices ) / 2 ); if ( patY < 0 ) { patY += this->yDimIndices; }
3078 patZ = zIt - ( static_cast<proshade_signed> ( this->zDimIndices ) / 2 ); if ( patZ < 0 ) { patZ += this->zDimIndices; }
3079
3080 //==================================== Find indices
3081 mapIt = zIt + this->zDimIndices * ( yIt + this->yDimIndices * xIt );
3082 patIt = patZ + this->zDimIndices * ( patY + this->yDimIndices * patX );
3083
3084 //==================================== Copy
3085 this->internalMap[mapIt] = pattersonMap[patIt][0];
3086 }
3087 }
3088 }
3089
3090 //================================================ Release memory
3091 delete[] pattersonMap;
3092 delete[] mapCoeffs;
3093
3094 //================================================ Delete FFTW plans
3095 fftw_destroy_plan ( forward );
3096 fftw_destroy_plan ( inverse );
3097
3098 //================================================ Report function completion
3099 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 2, "Phase information removed." );
3100
3101 //================================================ Done
3102 return ;
3103
3104 }

## ◆ reportOverlayResults()

void ProSHADE_internal_data::ProSHADE_data::reportOverlayResults | ( | ProSHADE_settings * | settings,
|  | std::vector< proshade_double > * | rotationCentre,
|  | std::vector< proshade_double > * | eulerAngles,
|  | std::vector< proshade_double > * | finalTranslation
| ) |  |

This function reports the results of the overlay mode.

Parameters

  [in] | settings | ProSHADE_settings object specifying the details of how the computations should be done.
  [in] | rotationCentre | Pointer to vector for saving the position of the centre of rotation about which the rotation is to be done.
  [in] | mapBoxMovement | Pointer to vector for saving the sum of all translations done internally by ProSHADE to this input map.
  [in] | eulerAngles | Pointer to vector where the three Euler angles will be saved into.
  [in] | finalTranslation | Pointer to a vector where the translation required to move structure from origin to optimal overlay with static structure will be saved into.

Definition at line 3856 of file ProSHADE_data.cpp.

3857 {
3858 //================================================ Empty line
3859 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, "" );
3860
3861 //================================================ Write out rotation centre translation results
3862 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);
3863 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotCen.str() );
3864
3865 //================================================ Write out rotation matrix about origin
3866 proshade_double* rotMat = new proshade_double[9];
3867 ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
3868 ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( eulerAngles->at(0), eulerAngles->at(1), eulerAngles->at(2), rotMat );
3869
3870 std::stringstream rotMatSS;
3871 rotMatSS << std::setprecision (3) << std::showpos << "The rotation matrix about origin is : " << rotMat[0] << " " << rotMat[1] << " " << rotMat[2] << std::endl;
3872 rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[3] << " " << rotMat[4] << " " << rotMat[5] << std::endl;
3873 rotMatSS << std::setprecision (3) << std::showpos << " : " << rotMat[6] << " " << rotMat[7] << " " << rotMat[8];
3874 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, rotMatSS.str() );
3875
3876 delete[] rotMat;
3877
3878 //================================================ Write out origin to overlay translation results
3879 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);
3880 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, finTrs.str() );
3881
3882 //================================================ Done
3883 return ;
3884
3885 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for map symmetry detection reporting.

Definition at line 2828 of file ProSHADE_data.cpp.

2829 {
2830 //================================================ Improve this!
2831 if ( settings->recommendedSymmetryType == "" )
2832 {
2833 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, "Did not detect any symmetry!" );
2834 }
2835 else
2836 {
2837 std::stringstream ssHlp;
2838 ssHlp << std::endl << "Detected " << settings->recommendedSymmetryType << " symmetry with fold " << settings->recommendedSymmetryFold << " .";
2839 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2840
2841 if ( settings->detectedSymmetry.size() > 0 )
2842 {
2843 ssHlp.clear(); ssHlp.str ( "" );
2844 ssHlp << " Fold X Y Z Angle Height";
2845 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2846 }
2847 for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->detectedSymmetry.size() ); symIt++ )
2848 {
2849 ssHlp.clear(); ssHlp.str ( "" );
2850 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];
2851 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2852 }
2853
2854 std::stringstream hlpSS3;
2855 ssHlp.clear(); ssHlp.str ( "" );
2856 hlpSS3 << std::endl << "However, since the selection of the recommended symmetry needs improvement, here is a list of all detected C symmetries:";
2857 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, hlpSS3.str() );
2858
2859 if ( settings->allDetectedCAxes.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->allDetectedCAxes.size() ); symIt++ )
2866 {
2867 ssHlp.clear(); ssHlp.str ( "" );
2868 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];
2869 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2870 }
2871
2872 hlpSS3.clear(); hlpSS3.str ( "" );
2873 hlpSS3 << std::endl << "Also, for the same reason, here is a list of all detected D symmetries:";
2874 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, hlpSS3.str() );
2875
2876 if ( settings->allDetectedDAxes.size() > 0 )
2877 {
2878 ssHlp.clear(); ssHlp.str ( "" );
2879 ssHlp << " Fold X Y Z Angle Height";
2880 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2881 }
2882 for ( proshade_unsign symIt = 0; symIt < static_cast<proshade_unsign> ( settings->allDetectedDAxes.size() ); symIt++ )
2883 {
2884 ssHlp.clear(); ssHlp.str ( "" );
2885 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];
2886 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2887
2888 for ( proshade_unsign axIt = 1; axIt < static_cast<proshade_unsign> ( settings->allDetectedDAxes.at(symIt).size() ); axIt++ )
2889 {
2890 ssHlp.clear(); ssHlp.str ( "" );
2891 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];
2892 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2893 }
2894
2895 ssHlp.clear(); ssHlp.str ( "" );
2896 ProSHADE_internal_messages::printProgressMessage ( settings->verbose, 0, ssHlp.str() );
2897 }
2898
2899 }
2900
2901 //================================================ Done
2902 return ;
2903
2904 }

## ◆ reSampleMap()

void ProSHADE_internal_data::ProSHADE_data::reSampleMap | ( | ProSHADE_settings * | settings | ) |

This function changes the internal map sampling to conform to particular resolution value.

This function will take the requested resolution value from the settings object and will proceed to change the internal map sampling to conform to requested resolution / 2 and therefore to the requested resolution map.

Parameters

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

Definition at line 1156 of file ProSHADE_data.cpp.

1157 {
1158 //================================================ Initialise the return variable
1159 proshade_single* changeVals = new proshade_single[6];
1160
1161 //================================================ Now re-sample the map
1162 if ( settings->changeMapResolution )
1163 {
1164 ProSHADE_internal_mapManip::reSampleMapToResolutionFourier ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1165 this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1166
1167 if ( settings->changeMapResolutionTriLinear )
1168 {
1169 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" );
1170 }
1171 }
1172 if ( settings->changeMapResolutionTriLinear && !settings->changeMapResolution )
1173 {
1174 ProSHADE_internal_mapManip::reSampleMapToResolutionTrilinear ( this->internalMap, settings->requestedResolution, this->xDimIndices, this->yDimIndices, this->zDimIndices,
1175 this->xDimSize, this->yDimSize, this->zDimSize, changeVals );
1176
1177 }
1178
1179 //================================================ Set the internal values to reflect the new map size
1180 this->xDimIndices += static_cast<proshade_unsign> ( changeVals[0] );
1181 this->yDimIndices += static_cast<proshade_unsign> ( changeVals[1] );
1182 this->zDimIndices += static_cast<proshade_unsign> ( changeVals[2] );
1183
1184 this->xGridIndices = this->xDimIndices;
1185 this->yGridIndices = this->yDimIndices;
1186 this->zGridIndices = this->zDimIndices;
1187
1188 this->xTo += static_cast<proshade_unsign> ( changeVals[0] );
1189 this->yTo += static_cast<proshade_unsign> ( changeVals[1] );
1190 this->zTo += static_cast<proshade_unsign> ( changeVals[2] );
1191
1192 this->xDimSize = changeVals[3];
1193 this->yDimSize = changeVals[4];
1194 this->zDimSize = changeVals[5];
1195
1196 //================================================ Figure how much the new map moved
1197 proshade_single xMov = -( ( this->xFrom * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices - changeVals[0] ) ) ) -
1198 ( this->xFrom * ( this->xDimSize / static_cast<proshade_single> ( this->xDimIndices ) ) ) );
1199 proshade_single yMov = -( ( this->yFrom * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices - changeVals[1] ) ) ) -
1200 ( this->yFrom * ( this->yDimSize / static_cast<proshade_single> ( this->yDimIndices ) ) ) );
1201 proshade_single zMov = -( ( this->zFrom * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices - changeVals[2] ) ) ) -
1202 ( this->zFrom * ( this->zDimSize / static_cast<proshade_single> ( this->zDimIndices ) ) ) );
1203
1204 //================================================ Move by indices (this should be sufficient)
1205 ProSHADE_internal_mapManip::moveMapByIndices ( &xMov, &yMov, &zMov, this->xDimSize, this->yDimSize, this->zDimSize, &this->xFrom, &this->xTo,
1206 &this->yFrom, &this->yTo, &this->zFrom, &this->zTo, &this->xAxisOrigin, &this->yAxisOrigin, &this->zAxisOrigin );
1207
1208 ProSHADE_internal_mapManip::moveMapByFourier ( this->internalMap, xMov, yMov, zMov, this->xDimSize, this->yDimSize, this->zDimSize,
1209 this->xDimIndices, this->yDimIndices, this->zDimIndices );
1210
1211 //================================================ Release memory
1212 delete[] changeVals;
1213
1214 //================================================ Done
1215 return ;
1216
1217 }

## ◆ 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] | settings | The settings object specifying how exactly the rotation is to be done.
  [in] | eulerAlpha | The rotation expressed as a pointer to Euler alpha angle.
  [in] | eulerBeta | The rotation expressed as a pointer to Euler beta angle.
  [in] | eulerGamma | The rotation expressed as a pointer to Euler gamma angle.

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

Definition at line 1828 of file ProSHADE_data.cpp.

1829 {
1830 //================================================ Initialise variables
1831 bool isArgSameAsSettings = true;
1832
1833 //================================================ For each detected point group
1834 for ( proshade_unsign cIt = 0; cIt < static_cast<proshade_unsign> ( CSyms->size() ); cIt++ )
1835 {
1836 //============================================ Create vector to replace the pointer
1837 std::vector< proshade_double > nextSym;
1838 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[0] );
1839 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[1] );
1840 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[2] );
1841 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[3] );
1842 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[4] );
1843 ProSHADE_internal_misc::addToDoubleVector ( &nextSym, CSyms->at(cIt)[5] );
1844 ProSHADE_internal_misc::addToDoubleVectorVector ( allCs, nextSym );
1845
1846 //============================================ Copy the vector to output variable and if different, then also to settings object
1847 if ( ( cIt == 0 ) && ( settings->allDetectedCAxes.size() == 0 ) ) { isArgSameAsSettings = false; }
1848 if ( !isArgSameAsSettings ) { ProSHADE_internal_misc::addToDoubleVectorVector ( &settings->allDetectedCAxes, nextSym ); }
1849
1850 //============================================ Release memory
1851 nextSym.clear ( );
1852 delete[] CSyms->at(cIt);
1853 }
1854
1855 //================================================ Done
1856 return ;
1857
1858 }

## ◆ 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] | settings | A pointer to settings class containing all the information required for map symmetry detection.
  [in] | CSym | A vector of pointers to double arrays, each array being a single Cyclic symmetry entry.
  [in] | DSym | A vector of pointers to double arrays, each array being a single Dihedral symmetry entry.
  [in] | TSym | A vector of pointers to double arrays, all of which together form the axes of tetrahedral symmetry.
  [in] | OSym | A vector of pointers to double arrays, all of which together form the axes of octahedral symmetry.
  [in] | ISym | A vector of pointers to double arrays, all of which together form the axes of icosahedral symmetry.
  [in] | axes | A vector to which all the axes of the recommended symmetry (if any) will be saved.

Definition at line 2067 of file ProSHADE_data.cpp.

2068 {
2069 //================================================ Initialise variables
2070 proshade_double cScore = 0.0, dScore = 0.0, tScore = 0.0, oScore = 0.0, iScore = 0.0;
2071 proshade_unsign bestCIndex, bestDIndex;
2072
2073 //================================================ Find a score for each input symmetry type.
2074 cScore = this->findBestCScore ( CSym, &bestCIndex );
2075 dScore = this->findBestDScore ( DSym, &bestDIndex );
2076 tScore = this->findTScore ( TSym );
2077 oScore = this->findOScore ( OSym );
2078 iScore = this->findIScore ( ISym );
2079
2080 //================================================ Find the best available score - !!! Modified weights for the predicted symmetries as they have heights 0.0 (predicted) ...
2081 proshade_double bestWeightedScore = std::max ( cScore, std::max ( dScore * 1.1, std::max ( tScore * 3000.0, std::max ( oScore * 4000.0, iScore * 5000.0 ) ) ) );
2082
2083 //================================================ No score? Well, no symmetry.
2084 if ( bestWeightedScore < 0.05 ) { settings->setRecommendedSymmetry ( "" ); return; }
2085
2086 if ( bestWeightedScore == cScore )
2087 {
2088 settings->setRecommendedSymmetry ( "C" );
2089 settings->setRecommendedFold ( CSym->at(bestCIndex)[0] );
2090 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(bestCIndex) );
2091 if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at(bestCIndex) ); }
2092
2093 //============================================ Warn if resolution does not really support this fold
2094 if ( ( ( 360.0 / static_cast<double> ( CSym->at(bestCIndex)[0] ) ) - ( 360.0 / static_cast<double> ( CSym->at(bestCIndex)[0] + 1 ) ) ) <
2095 ( 360.0 / static_cast<double> ( settings->maxBandwidth * 4.0 ) ) )
2096 {
2097 std::stringstream hlpSS;
2098 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).";
2099 ProSHADE_internal_messages::printWarningMessage ( settings->verbose, hlpSS.str(), "WS00054" );
2100 }
2101 }
2102 if ( bestWeightedScore == dScore * 1.1 )
2103 {
2104 settings->setRecommendedSymmetry ( "D" );
2105 settings->setRecommendedFold ( std::max ( DSym->at(bestDIndex)[0], DSym->at(bestDIndex)[6] ) );
2106 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, DSym->at(bestDIndex) );
2107 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestDIndex)[6] );
2108 if ( settings->detectedSymmetry.size() == 0 )
2109 {
2110 settings->setDetectedSymmetry ( DSym->at(bestDIndex) );
2111 settings->setDetectedSymmetry ( &DSym->at(bestDIndex)[6] );
2112 }
2113
2114 //============================================ Warn if resolution does not really support this fold
2115 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 ) ) ) <
2116 ( 360.0 / static_cast<double> ( settings->maxBandwidth * 4.0 ) ) )
2117 {
2118 std::stringstream hlpSS;
2119 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).";
2120 ProSHADE_internal_messages::printWarningMessage ( settings->verbose, hlpSS.str(), "WS00054" );
2121 }
2122 }
2123 if ( bestWeightedScore == tScore * 3000.0 )
2124 {
2125 settings->setRecommendedSymmetry ( "T" );
2126 settings->setRecommendedFold ( 0 );
2127 for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, TSym->at(it) ); }
2128 if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( TSym->size() ); it++ ) { settings->setDetectedSymmetry ( TSym->at(it) ); } }
2129 }
2130 if ( bestWeightedScore == oScore * 4000.0 )
2131 {
2132 settings->setRecommendedSymmetry ( "O" );
2133 settings->setRecommendedFold ( 0 );
2134 for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, OSym->at(it) ); }
2135 if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( OSym->size() ); it++ ) { settings->setDetectedSymmetry ( OSym->at(it) ); } }
2136 }
2137 if ( bestWeightedScore == iScore * 5000.0 )
2138 {
2139 settings->setRecommendedSymmetry ( "I" );
2140 settings->setRecommendedFold ( 0 );
2141 for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISym->size() ); it++ ) { ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, ISym->at(it) ); }
2142 if ( settings->detectedSymmetry.size() == 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( ISym->size() ); it++ ) { settings->setDetectedSymmetry ( ISym->at(it) ); } }
2143 }
2144
2145 //================================================ Done
2146 return ;
2147
2148 }

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

Definition at line 2161 of file ProSHADE_data.cpp.

2162 {
2163 //================================================ Initialise variables
2164 proshade_unsign bestIndex = 0;
2165 proshade_double highestSym = 0.0;
2166
2167 //================================================ Search for best fold
2168 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( CSym->size() ); iter++ )
2169 {
2170 //============================================ Check if it is tbe correct fold
2171 if ( CSym->at(iter)[0] != settings->requestedSymmetryFold ) { continue; }
2172
2173 //============================================ If correct, is it the highest found?
2174 if ( CSym->at(iter)[5] > highestSym )
2175 {
2176 highestSym = CSym->at(iter)[5];
2177 bestIndex = iter;
2178 }
2179 }
2180
2181 //================================================ Found?
2182 if ( highestSym > 0.0 )
2183 {
2184 settings->setRecommendedSymmetry ( "C" );
2185 settings->setRecommendedFold ( CSym->at(bestIndex)[0] );
2186 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, CSym->at(bestIndex) );
2187
2188 if ( settings->detectedSymmetry.size() == 0 ) { settings->setDetectedSymmetry ( CSym->at(bestIndex) ); }
2189 }
2190 else
2191 {
2192 settings->setRecommendedSymmetry ( "" );
2193 settings->setRecommendedFold ( 0 );
2194 }
2195
2196 //================================================ Done
2197 return ;
2198
2199 }

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

Definition at line 2212 of file ProSHADE_data.cpp.

2213 {
2214 //================================================ Initialise variables
2215 proshade_unsign bestIndex = 0;
2216 proshade_double highestSym = 0.0;
2217
2218 //================================================ Search for best fold
2219 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( DSym->size() ); iter++ )
2220 {
2221 //============================================ Check if it is tbe correct fold
2222 if ( std::max ( DSym->at(iter)[0], DSym->at(iter)[6] ) != settings->requestedSymmetryFold ) { continue; }
2223
2224 //============================================ If correct, is it the highest found?
2225 if ( ( DSym->at(iter)[5] + DSym->at(iter)[11] ) > highestSym )
2226 {
2227 highestSym = ( DSym->at(iter)[5] + DSym->at(iter)[11] );
2228 bestIndex = iter;
2229 }
2230 }
2231
2232 //================================================ Found?
2233 if ( highestSym > 0.0 )
2234 {
2235 settings->setRecommendedSymmetry ( "D" );
2236 settings->setRecommendedFold ( std::max ( DSym->at(bestIndex)[0], DSym->at(bestIndex)[6] ) );
2237 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, DSym->at(bestIndex) );
2238 ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( axes, &DSym->at(bestIndex)[6] );
2239
2240 if ( settings->detectedSymmetry.size() == 0 )
2241 {
2242 settings->setDetectedSymmetry ( DSym->at(bestIndex) );
2243 settings->setDetectedSymmetry ( &DSym->at(bestIndex)[6] );
2244 }
2245 }
2246 else
2247 {
2248 settings->setRecommendedSymmetry ( "" );
2249 settings->setRecommendedFold ( 0 );
2250 }
2251
2252 //================================================ Done
2253 return ;
2254
2255 }

## ◆ 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] | band | The band indice of the E matrix to which the value should be assigned.
  [in] | order1 | The first order indice of the E matrix to which the value should be assigned.
  [in] | order2 | The second order indice of the E matrix to which the value should be assigned.
  [in] | val | The value which should be saved.

Definition at line 3466 of file ProSHADE_data.cpp.

3467 {
3468 //================================================ Mutate
3469 this->eMatrices[band][order1][order2][0] = val[0];
3470 this->eMatrices[band][order1][order2][1] = val[1];
3471
3472 //================================================ Done
3473 return ;
3474
3475 }

## ◆ setIntegrationWeight()

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

This function allows setting the integration weight for the object.

Parameters

  [in] | intW | The integration weight to be set for this object.

Definition at line 3435 of file ProSHADE_data.cpp.

3436 {
3437 //================================================ Mutate
3438 this->integrationWeight = intW;
3439
3440 //================================================ Done
3441 return ;
3442
3443 }

## ◆ setIntegrationWeightCumul()

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

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

Parameters

  [in] | intW | The integration weight to be added to the current value for this object.

Definition at line 3449 of file ProSHADE_data.cpp.

3450 {
3451 //================================================ Mutate
3452 this->integrationWeight += intW;
3453
3454 //================================================ Done
3455 return ;
3456
3457 }

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

679 {
680 //================================================ Set starts to 0
681 this->xFrom = 0;
682 this->yFrom = 0;
683 this->zFrom = 0;
684
685 //================================================ Set angles to 90 degrees
686 this->aAngle = 90.0;
687 this->bAngle = 90.0;
688 this->cAngle = 90.0;
689
690 //================================================ Set dimension sizes in indices
691 this->xDimIndices = this->xTo;
692 this->yDimIndices = this->yTo;
693 this->zDimIndices = this->zTo;
694
695 //================================================ Set grid indexing to cell indexing
696 this->xGridIndices = this->xDimIndices;
697 this->yGridIndices = this->yDimIndices;
698 this->zGridIndices = this->zDimIndices;
699
700 //================================================ Set axis order
701 this->xAxisOrder = 1;
702 this->yAxisOrder = 2;
703 this->zAxisOrder = 3;
704
705 //================================================ Set origin to the first index
706 this->xAxisOrigin = this->xFrom;
707 this->yAxisOrigin = this->yFrom;
708 this->zAxisOrigin = this->zFrom;
709
710 //================================================ Done
711 return ;
712
713 }

## ◆ setSO3CoeffValue()

void ProSHADE_internal_data::ProSHADE_data::setSO3CoeffValue | ( | proshade_unsign | position,
|  | proshade_complex | val
| ) |  |

This function allows setting the SOFT coefficient values using array position and value.

Parameters

  [in] | position | The 1D array position at which the new value should be saved.
  [in] | val | Complex value to be saved into the array.

Definition at line 3500 of file ProSHADE_data.cpp.

3501 {
3502 //================================================ Mutate
3503 this->so3Coeffs[position][0] = val[0];
3504 this->so3Coeffs[position][1] = val[1];
3505
3506 //================================================ Done
3507 return ;
3508
3509 }

## ◆ setWignerMatrixValue()

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

This function allows setting the Wigner D matrix value by its band, order1 and order2 co-ordinate.

Parameters

  [in] | val | proshade_complex value of the Wigner D matrix at position band, order1, order2.
  [in] | band | The band of the Wigner D matrix value.
  [in] | order1 | The first order of the Wigner D matrix value.
  [in] | order2 | The second order of the Wigner D matrix value.

Definition at line 3518 of file ProSHADE_data.cpp.

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

## ◆ shellBandExists()

bool ProSHADE_internal_data::ProSHADE_data::shellBandExists | ( | proshade_unsign | shell,
|  | proshade_unsign | bandVal
| ) |  |

This function checks if particular shell has a particular band.

This function is useful for the progressive shell mapping, where it may not be clear in one part of the code whether a particular shell does or does not have a particular band value. Therefore, this function allows simple check.

Parameters

  [in] | shell | The index (number) of the shell for which the check should be done.
  [in] | bandVal | The band value which should be sought for the shell.
  [out] | X | True if the shell has the band, false otherwise.

Definition at line 3012 of file ProSHADE_data.cpp.

3013 {
3014 if ( this->spheres[shell]->getLocalBandwidth( ) >= bandVal )
3015 {
3016 return ( true );
3017 }
3018 else
3019 {
3020 return ( false );
3021 }
3022 }

## ◆ so3CoeffsArrayIndex()

int ProSHADE_internal_data::ProSHADE_data::so3CoeffsArrayIndex | ( | proshade_signed | order1,
|  | proshade_signed | order2,
|  | proshade_signed | band
| ) |  |

This function gets the SO(3) coefficients array index for a particular so(3) band, order1 and order2 position.

It should be noted that this function assumes that the orders are in the format -l < 0 < l and NOT 0 < 2l + 1.

Parameters

  [in] | order1 | The first order for which the SO(3) value index is requested.
  [in] | order2 | The second order for which the SO(3) value index is requested.
  [in] | band | The band for which the SO(3) value index is requested.
  [out] | val | Index position of the SO(3) value.

Definition at line 3614 of file ProSHADE_data.cpp.

3615 {
3616 //================================================ Return the value
3617 return ( static_cast<int> ( so3CoefLoc ( order1, order2, band, this->getMaxBand() ) ) );
3618 }

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

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

Definition at line 741 of file ProSHADE_data.cpp.

742 {
743 //================================================ Create and prepare new Grid gemmi object
744 gemmi::Grid<float> mapData;
745 mapData.set_unit_cell ( this->xDimSize, this->yDimSize, this->zDimSize, this->aAngle, this->bAngle, this->cAngle );
746 mapData.set_size_without_checking ( this->xDimIndices, this->yDimIndices, this->zDimIndices );
747 mapData.axis_order = gemmi::AxisOrder::XYZ;
748 mapData.spacegroup = &gemmi::get_spacegroup_p1();
749
750 //================================================ Create and prepare new Ccp4 gemmi object
751 gemmi::Ccp4<float> map;
752 map.grid = mapData;
753 map.update_ccp4_header ( mode );
754
755 //================================================ Fill in the header
756 ProSHADE_internal_io::writeOutMapHeader ( &map,
757 this->xDimIndices, this->yDimIndices, this->zDimIndices,
758 this->xDimSize, this->yDimSize, this->zDimSize,
759 this->aAngle, this->bAngle, this->cAngle,
760 this->xFrom, this->yFrom, this->zFrom,
761 this->xAxisOrigin, this->yAxisOrigin, this->zAxisOrigin,
762 this->xAxisOrder, this->yAxisOrder, this->zAxisOrder,
763 this->xGridIndices, this->yGridIndices, this->zGridIndices,
764 title, mode );
765
766 //================================================ Copy internal map to grid
767 proshade_unsign arrPos = 0;
768 for ( proshade_unsign uIt = 0; uIt < this->xDimIndices; uIt++ )
769 {
770 for ( proshade_unsign vIt = 0; vIt < this->yDimIndices; vIt++ )
771 {
772 for ( proshade_unsign wIt = 0; wIt < this->zDimIndices; wIt++ )
773 {
774 arrPos = wIt + this->zDimIndices * ( vIt + this->yDimIndices * uIt );
775 map.grid.set_value ( uIt, vIt, wIt, static_cast<float> ( this->internalMap[arrPos] ) );
776 }
777 }
778 }
779
780 //================================================ Update the statistics in the header
781 map.update_ccp4_header ( mode, true );
782
783 //================================================ Write out the map
784 map.write_ccp4_map ( fName );
785
786 //================================================ Done
787 return ;
788
789 }

## ◆ writeMask()

void ProSHADE_internal_data::ProSHADE_data::writeMask | ( | std::string | fName,
|  | proshade_double * | mask
| ) |  |

Function for writing out a mask in MRC MAP format.

This function takes a mask map and the filename and proceeds to write out the mask into the requested file name in th MRC MAP format. It assumes that the mask has the same dimmensions as the map.

Parameters

  [in] | fileName | The filename (including path) to where the output should be saved.
  [in] | mask | Pointer to the mask map array.

Definition at line 857 of file ProSHADE_data.cpp.

858 {
859 //================================================ Allocate the memory
860 proshade_double* hlpMap = new proshade_double[this->xDimIndices * this->yDimIndices * this->zDimIndices];
861 ProSHADE_internal_misc::checkMemoryAllocation ( hlpMap, __FILE__, __LINE__, __func__ );
862
863 //================================================ Copy original map and over-write with the mask
864 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
865 {
866 hlpMap[iter] = this->internalMap[iter];
867 this->internalMap[iter] = mask[iter];
868 }
869
870 //================================================ Write out the mask
871 this->writeMap ( fName );
872
873 //================================================ Copy the original map values back
874 for ( proshade_unsign iter = 0; iter < ( this->xDimIndices * this->yDimIndices * this->zDimIndices ); iter++ )
875 {
876 this->internalMap[iter] = hlpMap[iter];
877 }
878
879 //================================================ Release memory
880 delete[] hlpMap;
881
882 //================================================ Done
883 return ;
884 }

## ◆ writeOutOverlayFiles()

void ProSHADE_internal_data::ProSHADE_data::writeOutOverlayFiles | ( | ProSHADE_settings * | settings,
|  | proshade_double | eulA,
|  | proshade_double | eulB,
|  | proshade_double | eulG,
|  | std::vector< proshade_double > * | rotCentre,
|  | std::vector< proshade_double > * | ultimateTranslation
| ) |  |

This function writes out the rotated map, co-ordinates and transformation JSON file.

This function takes basically all the results of the overlay mode and appropriately applies them to write out the moved density map, if possible the moved co-ordinates and also the overlay operations listing JSON file.

Parameters

  [in] | settings | A pointer to settings class containing all the information required for map manipulation.
  [in] | eulA | The Euler alpha angle value, by which the moving structure is to be rotated by.
  [in] | eulB | The Euler beta angle value, by which the moving structure is to be rotated by.
  [in] | eulG | The Euler gamma angle value, by which the moving structure is to be rotated by.
  [in] | rotCentre | The rotation centre position.
  [in] | ultimateTranslation | The final translation as determined by the translation function.

Definition at line 3822 of file ProSHADE_data.cpp.

3823 {
3824 //================================================ Write out rotated map
3825 std::stringstream fNameHlp;
3826 fNameHlp << settings->overlayStructureName << ".map";
3827 this->writeMap ( fNameHlp.str() );
3828
3829 //================================================ Write out rotated co-ordinates if possible
3830 if ( ProSHADE_internal_io::isFilePDB ( this->fileName ) )
3831 {
3832 fNameHlp.str("");
3833 fNameHlp << settings->overlayStructureName << ".pdb";
3834 this->writePdb ( fNameHlp.str(), eulA, eulB, eulG, ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2), settings->firstModelOnly );
3835 }
3836
3837 //================================================ Write out the json file with the results
3838 ProSHADE_internal_io::writeRotationTranslationJSON ( rotCentre->at(0), rotCentre->at(1), rotCentre->at(2),
3839 eulA, eulB, eulG,
3840 ultimateTranslation->at(0), ultimateTranslation->at(1), ultimateTranslation->at(2),
3841 settings->rotTrsJSONFile );
3842
3843 //================================================ Done
3844 return ;
3845
3846 }

## ◆ 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] | fName | The filename (including path) to where the output PDB file should be saved.
  [in] | euA | The Euler angle alpha by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | euB | The Euler angle beta by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | euG | The Euler angle gamma by which the co-ordinates should be rotated (leave empty if no rotation is required).
  [in] | trsX | The translation to be done along X-axis in Angstroms.
  [in] | trsY | The translation to be done along Y-axis in Angstroms.
  [in] | trsZ | The translation to be done along Z-axis in Angstroms.
  [in] | firstModel | Should only the first model, or rather all of them be used?

Definition at line 806 of file ProSHADE_data.cpp.

807 {
808 //================================================ Check for co-ordinate origin
809 if ( !ProSHADE_internal_io::isFilePDB ( this->fileName ) )
810 {
811 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." );
812 }
813
814 //================================================ Open PDB file for reading
815 gemmi::Structure pdbFile = gemmi::read_structure ( gemmi::MaybeGzipped ( this->fileName ) );
816
817 //================================================ If the map was rotated, do the same for the co-ordinates, making sure we take into account the rotation centre of the map
818 if ( ( euA != 0.0 ) || ( euB != 0.0 ) || ( euG != 0.0 ) )
819 {
820 //============================================ Rotate the co-ordinates
821 ProSHADE_internal_mapManip::rotatePDBCoordinates ( &pdbFile, euA, euB, euG, this->originalPdbRotCenX, this->originalPdbRotCenY, this->originalPdbRotCenZ, firstModel );
822 }
823
824 //================================================ Translate by required translation and the map centering (if applied)
825 ProSHADE_internal_mapManip::translatePDBCoordinates ( &pdbFile, trsX, trsY, trsZ, firstModel );
826
827 //================================================ Write the PDB file
828 std::ofstream outCoOrdFile;
829 outCoOrdFile.open ( fName.c_str() );
830
831 if ( outCoOrdFile.is_open() )
832 {
833 gemmi::PdbWriteOptions opt;
834 write_pdb ( pdbFile, outCoOrdFile, opt );
835 }
836 else
837 {
838 std::stringstream hlpMessage;
839 hlpMessage << "Failed to open the PDB file " << fName << " for output.";
840 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." );
841 }
842
843 outCoOrdFile.close ( );
844
845 //================================================ Done
846 return ;
847 }

## ◆ zeroPaddToDims()

void ProSHADE_internal_data::ProSHADE_data::zeroPaddToDims | ( | proshade_unsign | xDim,
|  | proshade_unsign | yDim,
|  | proshade_unsign | zDim
| ) |  |

This function changes the size of a structure to fit the supplied new limits.

This function increases the map size by symetrically adding zeroes in each required dimension. The first zero is always added AFTER the structure, so for even size increases, there will be misplacement of centre of mass. The map position in the "real" world should not change.

Parameters

  [in] | xDim | The X dimension size to which this structure should be padded into.
  [in] | yDim | The Y dimension size to which this structure should be padded into.
  [in] | zDim | The Z dimension size to which this structure should be padded into.

Definition at line 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:

- src/proshade/ProSHADE_data.hpp
- src/proshade/ProSHADE_data.cpp
- src/proshade/ProSHADE_distances.cpp
- src/proshade/ProSHADE_overlay.cpp
- src/proshade/ProSHADE_symmetry.cpp
- src/proshade/ProSHADE_wignerMatrices.cpp

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:162
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:3690
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:106
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:172
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:182
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:3285
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_settings::determineAllSHValues
void determineAllSHValues(proshade_unsign xDim, proshade_unsign yDim, proshade_unsign zDim)
This function determines all the required values for spherical harmonics computation.
Definition: ProSHADE.cpp:1314
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:178
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:2028
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_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_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:2212
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:3385
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:137
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_settings::allDetectedDAxes
std::vector< std::vector< proshade_unsign > > allDetectedDAxes
The vector of all detected dihedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:191
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:126
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:1828
ProSHADE_settings::maskMap
bool maskMap
Should the map be masked from noise?
Definition: ProSHADE_settings.hpp:128
ProSHADE_settings::requestedSymmetryFold
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
Definition: ProSHADE_settings.hpp:175
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:174
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:3265
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:3415
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:3275
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:132
ProSHADE_settings::requestedResolution
proshade_single requestedResolution
The resolution to which the calculations are to be done.
Definition: ProSHADE_settings.hpp:98
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:171
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_internal_symmetry::predictIcosAxes
void predictIcosAxes(ProSHADE_settings *settings, 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, proshade_double matrixTolerance)
This function predicts all icosahedral point group symmetry axes from the cyclic point groups list.
Definition: ProSHADE_symmetry.cpp:2944
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:149
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:113
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:168
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:1442
ProSHADE_internal_data::ProSHADE_data::invertMirrorMap
void invertMirrorMap(ProSHADE_settings *settings)
Function for inverting the map to its mirror image.
Definition: ProSHADE_data.cpp:894
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:1870
ProSHADE_internal_data::ProSHADE_data::computeGroupElementsForGroup
std::vector< std::vector< proshade_double > > computeGroupElementsForGroup(std::vector< std::vector< proshade_double > > *allCSyms, proshade_unsign grPosition)
This function computes the group elements as rotation matrices (except for the identity element) for ...
Definition: ProSHADE_data.cpp:2263
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:127
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:110
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:192
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:133
ProSHADE_settings::allDetectedOAxes
std::vector< proshade_unsign > allDetectedOAxes
The vector of all detected octahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:193
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:1228
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:3325
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:185
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:2067
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:3250
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:100
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:678
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:2910
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:3295
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:177
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:857
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:2161
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:93
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:1701
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:2823
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:3110
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_maths::getRotationMatrixFromAngleAxis
void getRotationMatrixFromAngleAxis(proshade_double *rotMat, proshade_double x, proshade_double y, proshade_double z, proshade_double ang)
This function converts the axis-angle representation to the rotation matrix representation.
Definition: ProSHADE_maths.cpp:1343
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:741
ProSHADE_internal_data::ProSHADE_data::getMaxBand
proshade_unsign getMaxBand(void)
This function returns the maximum band value for the object.
Definition: ProSHADE_data.cpp:2986
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:2765
ProSHADE_settings::normaliseMap
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
Definition: ProSHADE_settings.hpp:120
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:146
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:3305
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:995
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:3123
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:1914
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:3425
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:123
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:1995
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:3315
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:138
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:806
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:99
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:2371
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
prependIdentity
void prependIdentity(std::vector< std::vector< proshade_double > > *vecToPrepend)
This function adds identity matrix as the first element of the vector of vectors of doubles.
Definition: ProSHADE_data.cpp:2390
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:181
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:2397
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:2976
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:3365
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:143
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:161
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::predictOctaAxes
void predictOctaAxes(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, proshade_double matrixTolerance)
This function predicts all octahedral point group symmetry axes from the cyclic point groups list.
Definition: ProSHADE_symmetry.cpp:3161
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:1587
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:3405
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:3257
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:165
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:1156
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:3355
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:3335
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:1962
ProSHADE_internal_data::ProSHADE_data::figureIndexStartStop
void figureIndexStartStop(void)
Function for determining iterator start and stop positions.
Definition: ProSHADE_data.cpp:719
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::getInvSO3Coeffs
proshade_complex * getInvSO3Coeffs(void)
This function allows access to the inverse SO(3) coefficients array.
Definition: ProSHADE_data.cpp:3213
ProSHADE_settings::allDetectedIAxes
std::vector< proshade_unsign > allDetectedIAxes
The vector of all detected icosahedral symmetry axes indices in allDetectedCAxes.
Definition: ProSHADE_settings.hpp:194
ProSHADE_settings::forceBounds
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
Definition: ProSHADE_settings.hpp:140
ProSHADE_settings::detectedSymmetry
std::vector< proshade_double * > detectedSymmetry
The vector of detected symmetry axes.
Definition: ProSHADE_settings.hpp:189
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:173
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:3395
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:3574
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:95
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:169
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:139
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_settings::pdbBFactorNewVal
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
Definition: ProSHADE_settings.hpp:103
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:94
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:948
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:3713
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:2476
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:190
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:3032
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:1289
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:393
ProSHADE_internal_data::ProSHADE_data::readInPDB
void readInPDB(ProSHADE_settings *settings)
Function for reading pdb data.
Definition: ProSHADE_data.cpp:574
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:3345
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:3375
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:3329