20 #include "ProSHADE_version.h" 21 #include "ProSHADE_rvapi.h" 24 #ifndef __PROSHADE_INTERNAL_LIBRARY__ 25 #define __PROSHADE_INTERNAL_LIBRARY__ 39 class ProSHADE_comparePairwise;
56 std::vector<unsigned int> bandwidth;
57 std::vector<unsigned int> glIntegOrder;
58 std::vector<unsigned int> theta;
59 std::vector<unsigned int> phi;
70 unsigned int manualShells;
84 std::vector<int> ignoreLs;
87 std::vector <std::string> structFiles;
90 std::vector< std::array<double,8> > rfPeaks;
91 std::vector< std::vector<std::array<double,5> > > tetrSymm;
92 double tetrSymmPeakAvg;
93 std::vector< std::array<double,5> > tetrElems;
94 std::vector< std::vector<std::array<double,5> > > octaSymm;
95 double octaSymmPeakAvg;
96 std::vector< std::array<double,5> > octaElems;
97 std::vector< std::vector<std::array<double,5> > > icosSymm;
98 double icosSymmPeakAvg;
99 std::vector< std::array<double,5> > icosElems;
102 double peakHeightNoIQRs;
103 double peakDistanceForReal;
104 int peakSurroundingPoints;
107 double aaErrorTolerance;
108 double symGapTolerance;
115 std::vector< std::array<double,5> >
cnSymm;
117 std::vector< std::vector<std::array<double,6> > >
dnSymm;
130 unsigned int symmetryFold,
133 unsigned int symmetryFold,
137 std::vector< std::vector<std::array<double,6> > >
getDSymmetries ( );
140 std::vector< std::array<double,5> > tetrSymm,
141 std::vector< std::array<double,5> > allCs,
142 double axisErrorTolerance = 0.1,
144 std::vector< std::array<double,5> >
generateTetrElements ( std::vector< std::array<double,5> > symmAxes,
149 std::vector< std::array<double,5> > octaSymm,
150 std::vector< std::array<double,5> > allCs,
151 double axisErrorTolerance = 0.1,
153 std::vector< std::array<double,5> >
generateOctaElements ( std::vector< std::array<double,5> > symmAxes,
158 std::vector< std::array<double,5> > icosSymm,
159 std::vector< std::array<double,5> > allCs,
160 double axisErrorTolerance = 0.1,
162 std::vector< std::array<double,5> >
generateIcosElements ( std::vector< std::array<double,5> > symmAxes,
185 std::string _inputFileName;
189 double _shellSpacing;
190 double _maxExtraCellularSpace;
194 double _xSamplingRate;
195 double _ySamplingRate;
196 double _zSamplingRate;
203 std::vector<double> _shellPlacement;
206 double _mapResolution;
207 unsigned int _maxMapU;
208 unsigned int _maxMapV;
209 unsigned int _maxMapW;
210 float *_densityMapMap;
211 bool _densityMapComputed;
216 double _fourierCoeffPower;
217 double _bFactorChange;
218 double *_densityMapCor;
220 std::array<double,3> *_densityMapCorCoords;
228 unsigned int _noShellsWithData;
229 double **_shellMappedData;
240 unsigned int _bandwidthLimit;
241 unsigned int _oneDimmension;
242 double **_realSHCoeffs;
243 double **_imagSHCoeffs;
244 double *_sphericalHarmonicsWeights;
245 double **_semiNaiveTable;
246 double *_semiNaiveTableSpace;
247 fftw_complex *_shWorkspace;
248 bool _sphericalCoefficientsComputed;
249 bool _wasBandwithGiven;
252 bool _wasGlInterGiven;
255 double **_invRealData;
256 double **_invImagData;
259 double ***_rrpMatrices;
260 bool _rrpMatricesPrecomputed;
269 void getDensityMapFromPDB ( std::string fileName,
double *shellDistance,
double resolution,
270 unsigned int *bandwidth,
unsigned int *theta,
271 unsigned int *phi,
unsigned int *glIntegOrder,
273 double Bfactor = 80.0,
bool hpFirstLineCom =
false,
bool overlayDefaults =
false );
274 void getDensityMapFromMAP ( std::string fileName,
double *shellDistance,
double resolution,
275 unsigned int *bandwidth,
unsigned int *theta,
276 unsigned int *phi,
unsigned int *glIntegOrder,
278 bool overlayDefaults =
false );
279 void maskMap (
int hlpU,
int hlpV,
int hlpW,
double blurBy = 250.0,
double maxMapIQR = 3.0,
double extraMaskSpace = 3.0 );
282 bool removeIslands (
int hlpU,
int hlpV,
int hlpW,
int verbose = 0,
bool runAll =
false );
283 void translateMap (
double xShift,
double yShift,
double zShift );
284 void shiftMap (
double xShift,
double yShift,
double zShift );
286 std::array<double,6> getDensityMapFromMAPRebox ( std::string fileName,
double maxMapIQR,
double extraCS,
int verbose,
287 bool useCubicMaps,
double maskBlurFactor,
bool maskBlurFactorGiven,
289 void getDensityMapFromMAPFeatures ( std::string fileName,
double *minDensPreNorm,
double *maxDensPreNorm,
290 double *minDensPostNorm,
double *maxDensPostNorm,
double *postNormMean,
291 double *postNormSdev,
double *maskVolume,
double* totalVolume,
double *maskMean,
292 double *maskSdev,
double *maskMin,
double *maskMax,
double *maskDensityRMS,
293 double *allDensityRMS, std::array<double,3> *origRanges, std::array<double,3> *origDims,
294 double maxMapIQR,
double extraCS,
int verbose,
bool useCubicMaps,
double maskBlurFactor,
bool maskBlurFactorGiven,
298 void keepPhaseInMap (
double alpha,
double bFac,
299 unsigned int *bandwidth,
unsigned int *theta,
302 double maxMapIQR = 10.0,
int verbose = 0,
303 bool clearMapData =
true,
bool rotDefaults =
false,
bool overlapDefaults =
false,
304 double blurFactor = 500.0,
bool maskBlurFactorGiven =
false );
305 void mapPhaselessToSphere (
ProSHADE::ProSHADE_settings* settings,
double theta,
double phi,
double shellSz,
unsigned int manualShells = 0,
bool keepInMemory =
false,
bool rotDefaults =
false );
309 std::vector< std::vector<int> > findMapIslands (
int hlpU,
int hlpV,
int hlpW,
double *map,
double threshold = 0.0 );
310 void writeMap ( std::string fileName,
312 std::string axOrder =
"xyz",
313 float xFrom = std::numeric_limits<float>::infinity(),
314 float yFrom = std::numeric_limits<float>::infinity(),
315 float zFrom = std::numeric_limits<float>::infinity(),
316 float xTo = std::numeric_limits<float>::infinity(),
317 float yTo = std::numeric_limits<float>::infinity(),
318 float zTo = std::numeric_limits<float>::infinity(),
319 float xRange = std::numeric_limits<float>::infinity(),
320 float yRange = std::numeric_limits<float>::infinity(),
321 float zRange = std::numeric_limits<float>::infinity() );
322 void writeMap ( std::string fileName,
324 std::string axOrder =
"xyz",
325 float xFrom = std::numeric_limits<float>::infinity(),
326 float yFrom = std::numeric_limits<float>::infinity(),
327 float zFrom = std::numeric_limits<float>::infinity(),
328 float xTo = std::numeric_limits<float>::infinity(),
329 float yTo = std::numeric_limits<float>::infinity(),
330 float zTo = std::numeric_limits<float>::infinity(),
331 float xRange = std::numeric_limits<float>::infinity(),
332 float yRange = std::numeric_limits<float>::infinity(),
333 float zRange = std::numeric_limits<float>::infinity() );
334 void writePDB ( std::string templateName, std::string outputName,
335 double rotEulA = 0.0,
336 double rotEulB = 0.0,
337 double rotEulG = 0.0,
341 void deleteModel ( std::string modelPath );
344 inline double getMapXRange (
void ) {
return ( this->_xRange ); };
345 inline double getMapYRange (
void ) {
return ( this->_yRange ); };
346 inline double getMapZRange (
void ) {
return ( this->_zRange ); };
347 inline double* getMap (
void ) {
return ( this->_densityMapCor ); };
362 unsigned int _bandwidthLimit;
363 double _shellSpacing;
366 double _matrixPowerWeight;
367 unsigned int _minShellsToUse;
368 std::vector<int> _lsToIgnore;
369 bool _bothRRPsPreComputed;
375 double _distanceRotInv;
376 bool _rotInvComputed;
379 unsigned int _noShellsObj1;
380 unsigned int _noShellsObj2;
381 unsigned int _maxShellsToUse;
382 double **_obj1RealCoeffs;
383 double **_obj1ImagCoeffs;
384 double **_obj2RealCoeffs;
385 double **_obj2ImagCoeffs;
386 std::vector<double> _trSigmaWeights;
387 std::array<double,2> ***_trSigmaEMatrix;
388 bool _trSigmaPreComputed;
391 double _distanceTrSigma;
392 bool _trSigmaComputed;
395 fftw_complex *_so3Coeffs;
396 fftw_complex *_so3InvCoeffs;
397 fftw_complex *_so3Workspace1;
398 fftw_complex *_so3Workspace2;
399 double *_so3Workspace3;
400 bool _so3InvMapComputed;
403 std::array<double,3> _eulerAngles;
404 bool _eulerAnglesFound;
407 double _peakHeightThr;
412 std::vector< std::vector< std::vector< std::array<double,2> > > > _wignerMatrices;
413 bool _wignerMatricesComputed;
416 unsigned int _glIntegrationOrder;
417 std::vector<double> _glAbscissas;
418 std::vector<double> _glWeights;
421 bool _structureCoeffsRotated;
424 double gl20IntRR ( std::vector<double>* vals );
425 std::array<double,2> gl20IntCR ( std::vector< std::array<double,2> >* vals );
427 std::vector< std::vector< std::vector<double> > > getSingularValuesUandVMatrix ( std::vector< std::vector<double> > mat,
unsigned int dim,
ProSHADE::ProSHADE_settings* settings );
435 void precomputeTrSigmaDescriptor ( );
438 void setEulerAngles (
double alpha,
double beta,
double gamma );
439 std::vector< std::array<double,8> > getSO3Peaks (
ProSHADE::ProSHADE_settings* settings,
double noIQRs = 1.5,
bool freeMem =
true,
int peakSize = 1,
double realDist = 0.4,
int verbose = 1 );
440 bool checkPeakExistence (
double alpha,
double beta,
double gamma,
ProSHADE::ProSHADE_settings* settings,
double passThreshold = 0.3 );
441 std::vector< std::array<double,5> > findCnSymmetry ( std::vector< std::array<double,8> > peaks,
443 double axisErrorTolerance = 0.0,
445 double percAllowedToMiss = 0.33,
447 std::vector< std::array<double,5> > findCnSymmetryClear ( std::vector< std::array<double,5> > CnSymm,
ProSHADE::ProSHADE_settings* settings,
double maxGap = 0.2,
bool *pf =
nullptr );
448 std::vector< std::vector< std::array<double,6> > > findDnSymmetry ( std::vector< std::array<double,5> > CnSymm,
double axisErrorTolerance = 0.1 );
449 std::vector< std::vector< std::array<double,6> > > findDnSymmetryClear ( std::vector< std::vector< std::array<double,6> > > DnSymm,
ProSHADE::ProSHADE_settings* settings,
double maxGap = 0.2,
bool *pf =
nullptr );
450 std::vector< std::vector< std::array<double,5> > > findTetrSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *tetrSymmPeakAvg,
double axisErrorTolerance = 0.1 );
451 std::vector< std::vector< std::array<double,5> > > findOctaSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *octaSymmPeakAvg,
double axisErrorTolerance = 0.1 );
452 std::vector< std::vector< std::array<double,5> > > findIcosSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *icosSymmPeakAvg,
double axisErrorTolerance = 0.1 );
457 double getPeakThreshold ( );
459 std::string saveName,
int verbose = 0, std::string axOrd =
"xyz",
460 bool internalUse =
false );
462 double *ob2YMov =
nullptr,
double *ob2ZMov =
nullptr );
481 std::vector<ProSHADE_data*> *all;
484 std::vector<int> _lsToIgnore;
485 double _matrixPowerWeight;
488 bool _energyLevelsComputed;
489 bool _trSigmaPreComputed;
490 bool _trSigmaComputed;
492 bool _so3InvMapComputed;
493 bool _eulerAnglesFound;
494 bool _wignerMatricesComputed;
495 bool _fullDistComputed;
498 std::vector<double> _distancesEnergyLevels;
499 std::vector<double> _distancesTraceSigma;
500 std::vector<double> _distancesFullRotation;
503 std::vector< std::vector< std::vector< std::vector< std::array<double,2> > > > > _EMatrices;
504 std::vector<fftw_complex*> _so3InverseCoeffs;
505 std::vector< std::array<double,3> > _eulerAngles;
506 std::vector< std::vector< std::vector< std::vector< std::array<double,2> > > > > _wignerMatrices;
507 std::vector<unsigned int> _enLevelsDoNotFollow;
508 std::vector<unsigned int> _trSigmaDoNotFollow;
511 double glIntRR ( std::vector<double>* vals,
double shellSep, std::vector<double>* glAbscissas, std::vector<double>* glWeights );
512 std::array<double,2> glIntCR ( std::vector< std::array<double,2> >* vals,
double shellSep, std::vector<double> *glAbscissas, std::vector<double> *glWeights );
513 std::vector<double> getSingularValues (
unsigned int strNo,
unsigned int band,
unsigned int dim,
ProSHADE::ProSHADE_settings* settings );
518 std::vector<int> ignoreL,
double matrixPowerWeight,
int verbose );
520 std::vector<int> ignoreL,
double matrixPowerWeight,
int verbose );
524 void precomputeTrSigmaDescriptor (
double shellSpacing, std::vector<unsigned int>* glIntegOrderVec,
ProSHADE::ProSHADE_settings* settings );
544 double mapResolution;
545 unsigned int bandwidth;
546 unsigned int glIntegOrder;
549 std::vector<unsigned int> bandwidthVec;
550 std::vector<unsigned int> glIntegOrderVec;
551 std::vector<unsigned int> thetaVec;
552 std::vector<unsigned int> phiVec;
556 double bFactorChange;
559 double noIQRsFromMap;
563 unsigned int manualShells;
571 std::vector<double> extraSpaceVec;
578 std::vector<int> ignoreLs;
581 std::vector <std::string> structFiles;
584 bool energyLevelDist;
590 bool saveWithAndWithout;
593 std::vector<double> energyLevelsDistances;
594 std::vector<double> traceSigmaDistances;
595 std::vector<double> fullRotationDistances;
596 std::vector< std::vector<double> > fragEnergyLevelsDistances;
597 std::vector< std::vector<double> > fragTraceSigmaDistances;
598 std::vector< std::vector<double> > fragfullRotationDistances;
601 double enLevelsThreshold;
602 double trSigmaThreshold;
613 std::vector<std::string>* matchedStrNames );
615 std::vector<std::string>* matchedStrNames );
616 std::vector<double> getEnergyLevelsDistances ( );
617 std::vector<double> getTraceSigmaDistances ( );
618 std::vector<double> getFullRotationDistances ( );
619 std::vector< std::vector<double> > getFragEnergyLevelsDistances( );
620 std::vector< std::vector<double> > getFragTraceSigmaDistances ( );
621 std::vector< std::vector<double> > getFragFullRotationDistances( );
637 std::string mapFragName;
638 double mapFragBoxFraction;
646 double minDensPreNorm;
647 double maxDensPreNorm;
648 double minDensPostNorm;
649 double maxDensPostNorm;
658 double maskDensityRMS;
659 double allDensityRMS;
660 std::array<double,3> origRanges;
661 std::array<double,3> origDims;
662 std::vector<std::string> fragFiles;
670 void printInfo (
int verbose );
672 std::vector<std::string> getFragmentsList (
void );
This class deals with reading in the data and computing structure specific information including the ...
This class is responsible for reading in map and computing all its features and other possible map ma...
std::vector< std::vector< std::array< double, 6 > > > dnSymmClear
This variable holds the gap corrected Dihedral symmetry results.
unsigned int checkFileType(std::string fileName)
This function checks the input file for being either PDB or MAP formatted.
std::vector< std::array< double, 5 > > cnSymm
This variable holds the complete Cyclic symmetry results.
void printResultsClear(int verbose)
This function prints the cleared results to the screen.
std::vector< std::array< double, 5 > > generateTetrElements(std::vector< std::array< double, 5 > > symmAxes, ProSHADE::ProSHADE_settings *settings, int verbose=0)
This function generates the 12 unique tetrahedral symmetry group elements from the already detected a...
std::vector< std::array< double, 5 > > generateTetrAxes(ProSHADE_comparePairwise *cmpObj, ProSHADE::ProSHADE_settings *settings, std::vector< std::array< double, 5 > > tetrSymm, std::vector< std::array< double, 5 > > allCs, double axisErrorTolerance=0.1, int verbose=0)
This function generates all the tetrahedral symmetry axes from a pair detected by findTetrSymmetry fu...
This namespace contains all the internal objects and their forward declarations.
std::vector< std::array< double, 5 > > icosAxes
This variable holds the 31 unique axes of the octahedral symmetry, if they are found.
std::vector< std::array< double, 5 > > generateOctaElements(std::vector< std::array< double, 5 > > symmAxes, ProSHADE::ProSHADE_settings *settings, int verbose=0)
This function generates the 24 octahedral symmetry group elements from the axes generated by generate...
std::vector< std::array< double, 5 > > generateOctaAxes(ProSHADE_comparePairwise *cmpObj, ProSHADE::ProSHADE_settings *settings, std::vector< std::array< double, 5 > > octaSymm, std::vector< std::array< double, 5 > > allCs, double axisErrorTolerance=0.1, int verbose=0)
This function generates all the ctahedral symmetry elements from a pair detected by findOctaSymmetry ...
This is the executive class responsible for comparing strictly two structures.
std::vector< std::array< double, 5 > > generateIcosAxes(ProSHADE_comparePairwise *cmpObj, ProSHADE::ProSHADE_settings *settings, std::vector< std::array< double, 5 > > icosSymm, std::vector< std::array< double, 5 > > allCs, double axisErrorTolerance=0.1, int verbose=0)
This function generates all the icosahedral symmetry elements from a pair detected by findIcosSymmetr...
std::vector< std::array< double, 5 > > cnSymmClear
This variable holds the gap corrected Cyclic symmetry results.
std::vector< std::array< double, 5 > > generateIcosElements(std::vector< std::array< double, 5 > > symmAxes, ProSHADE::ProSHADE_settings *settings, int verbose=0)
This function generates the 60 icosahedral symmetry group elements from the axes generated by generat...
void printResultsClearHTML(ProSHADE::ProSHADE_settings *settings)
This function prints the cleared results to the HTML file.
bool inputStructureDataType
This variable tells whether input data type is PDB or not.
std::vector< std::array< double, 5 > > getCSymmetries()
This function gives the user programmatical access to the detected C-symmetries.
std::vector< std::array< double, 8 > > getRotFnPeaks()
This function gives the user programmatical access to the symmetry peaks of the symmetry detection pr...
void printResultsRequestHTML(std::string symmetryType, unsigned int symmetryFold, ProSHADE::ProSHADE_settings *settings)
This function prints the cleared results to the HTML report file.
This is the class which computes the symmetry in a single structure.
ProSHADE_symmetry()
Contructor for the ProSHADE_symmetry class.
This is the executive class responsible for comparing two or more structures.
std::vector< std::array< double, 5 > > tetrAxes
This variable holds the 7 unique axes of the tetrahedral symmetry, if they are found.
This is the executive class for computing distances between two or more structures.
This class stores all the settings and is passed to the executive classes instead of multitude of par...
std::vector< std::array< double, 5 > > octaAxes
This variable holds the 13 unique axes of the octahedral symmetry, if they are found.
std::vector< std::vector< std::array< double, 6 > > > getDSymmetries()
This function gives the user programmatical access to the detected D-symmetries.
void printResultsRequest(std::string symmetryType, unsigned int symmetryFold, int verbose)
This function prints the cleared results to the screen.
std::vector< std::vector< std::array< double, 6 > > > dnSymm
This variable holds the complete Dihedral symmetry results.