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;
197 double _xSamplingRate;
198 double _ySamplingRate;
199 double _zSamplingRate;
206 std::vector<double> _shellPlacement;
209 double _mapResolution;
210 unsigned int _maxMapU;
211 unsigned int _maxMapV;
212 unsigned int _maxMapW;
213 float *_densityMapMap;
214 bool _densityMapComputed;
222 double _fourierCoeffPower;
223 double _bFactorChange;
224 double *_densityMapCor;
226 std::array<double,3> *_densityMapCorCoords;
234 unsigned int _noShellsWithData;
235 double **_shellMappedData;
246 unsigned int _bandwidthLimit;
247 unsigned int _oneDimmension;
248 double **_realSHCoeffs;
249 double **_imagSHCoeffs;
250 double *_sphericalHarmonicsWeights;
251 double **_semiNaiveTable;
252 double *_semiNaiveTableSpace;
253 fftw_complex *_shWorkspace;
254 bool _sphericalCoefficientsComputed;
255 bool _wasBandwithGiven;
258 bool _wasGlInterGiven;
261 double **_invRealData;
262 double **_invImagData;
265 double ***_rrpMatrices;
266 bool _rrpMatricesPrecomputed;
275 void getDensityMapFromPDB ( std::string fileName,
double *shellDistance,
double resolution,
276 unsigned int *bandwidth,
unsigned int *theta,
277 unsigned int *phi,
unsigned int *glIntegOrder,
279 double Bfactor = 80.0,
bool hpFirstLineCom =
false,
bool overlayDefaults =
false );
280 void getDensityMapFromMAP ( std::string fileName,
double *shellDistance,
double resolution,
281 unsigned int *bandwidth,
unsigned int *theta,
282 unsigned int *phi,
unsigned int *glIntegOrder,
284 bool overlayDefaults =
false );
285 void maskMap (
int hlpU,
int hlpV,
int hlpW,
double blurBy = 250.0,
double maxMapIQR = 3.0,
double extraMaskSpace = 3.0 );
288 bool removeIslands (
int hlpU,
int hlpV,
int hlpW,
int verbose = 0,
bool runAll =
false );
289 void translateMap (
double xShift,
double yShift,
double zShift );
290 void shiftMap (
double xShift,
double yShift,
double zShift );
291 std::array<double,6> getDensityMapFromMAPRebox ( std::string fileName,
double maxMapIQR,
double extraCS,
int verbose,
292 bool useCubicMaps,
double maskBlurFactor,
bool maskBlurFactorGiven,
294 void getDensityMapFromMAPFeatures ( std::string fileName,
double *minDensPreNorm,
double *maxDensPreNorm,
295 double *minDensPostNorm,
double *maxDensPostNorm,
double *postNormMean,
296 double *postNormSdev,
double *maskVolume,
double* totalVolume,
double *maskMean,
297 double *maskSdev,
double *maskMin,
double *maskMax,
double *maskDensityRMS,
298 double *allDensityRMS, std::array<double,3> *origRanges, std::array<double,3> *origDims,
299 double maxMapIQR,
double extraCS,
int verbose,
bool useCubicMaps,
double maskBlurFactor,
bool maskBlurFactorGiven,
303 void keepPhaseInMap (
double alpha,
double bFac,
304 unsigned int *bandwidth,
unsigned int *theta,
307 double maxMapIQR = 10.0,
int verbose = 0,
308 bool clearMapData =
true,
bool rotDefaults =
false,
bool overlapDefaults =
false,
309 double blurFactor = 500.0,
bool maskBlurFactorGiven =
false );
310 void mapPhaselessToSphere (
ProSHADE::ProSHADE_settings* settings,
double theta,
double phi,
double shellSz,
unsigned int manualShells = 0,
bool keepInMemory =
false,
bool rotDefaults =
false );
314 std::vector< std::vector<int> > findMapIslands (
int hlpU,
int hlpV,
int hlpW,
double *map,
double threshold = 0.0 );
315 void writeMap ( std::string fileName,
317 std::string axOrder =
"xyz",
318 float xFrom = std::numeric_limits<float>::infinity(),
319 float yFrom = std::numeric_limits<float>::infinity(),
320 float zFrom = std::numeric_limits<float>::infinity(),
321 float xTo = std::numeric_limits<float>::infinity(),
322 float yTo = std::numeric_limits<float>::infinity(),
323 float zTo = std::numeric_limits<float>::infinity(),
324 float xRange = std::numeric_limits<float>::infinity(),
325 float yRange = std::numeric_limits<float>::infinity(),
326 float zRange = std::numeric_limits<float>::infinity() );
327 void writeMap ( std::string fileName,
329 std::string axOrder =
"xyz",
330 float xFrom = std::numeric_limits<float>::infinity(),
331 float yFrom = std::numeric_limits<float>::infinity(),
332 float zFrom = std::numeric_limits<float>::infinity(),
333 float xTo = std::numeric_limits<float>::infinity(),
334 float yTo = std::numeric_limits<float>::infinity(),
335 float zTo = std::numeric_limits<float>::infinity(),
336 float xRange = std::numeric_limits<float>::infinity(),
337 float yRange = std::numeric_limits<float>::infinity(),
338 float zRange = std::numeric_limits<float>::infinity() );
339 void writePDB ( std::string templateName, std::string outputName,
340 double rotEulA = 0.0,
341 double rotEulB = 0.0,
342 double rotEulG = 0.0,
346 void deleteModel ( std::string modelPath );
349 inline double getMapXRange (
void ) {
return ( this->_xRange ); };
350 inline double getMapYRange (
void ) {
return ( this->_yRange ); };
351 inline double getMapZRange (
void ) {
return ( this->_zRange ); };
352 inline double* getMap (
void ) {
return ( this->_densityMapCor ); };
367 unsigned int _bandwidthLimit;
368 double _shellSpacing;
371 double _matrixPowerWeight;
372 unsigned int _minShellsToUse;
373 std::vector<int> _lsToIgnore;
374 bool _bothRRPsPreComputed;
380 double _distanceRotInv;
381 bool _rotInvComputed;
384 unsigned int _noShellsObj1;
385 unsigned int _noShellsObj2;
386 unsigned int _maxShellsToUse;
387 double **_obj1RealCoeffs;
388 double **_obj1ImagCoeffs;
389 double **_obj2RealCoeffs;
390 double **_obj2ImagCoeffs;
391 std::vector<double> _trSigmaWeights;
392 std::array<double,2> ***_trSigmaEMatrix;
393 bool _trSigmaPreComputed;
396 double _distanceTrSigma;
397 bool _trSigmaComputed;
400 fftw_complex *_so3Coeffs;
401 fftw_complex *_so3InvCoeffs;
402 fftw_complex *_so3Workspace1;
403 fftw_complex *_so3Workspace2;
404 double *_so3Workspace3;
405 bool _so3InvMapComputed;
408 std::array<double,3> _eulerAngles;
409 bool _eulerAnglesFound;
412 double _peakHeightThr;
417 std::vector< std::vector< std::vector< std::array<double,2> > > > _wignerMatrices;
418 bool _wignerMatricesComputed;
421 unsigned int _glIntegrationOrder;
422 std::vector<double> _glAbscissas;
423 std::vector<double> _glWeights;
426 bool _structureCoeffsRotated;
429 double gl20IntRR ( std::vector<double>* vals );
430 std::array<double,2> gl20IntCR ( std::vector< std::array<double,2> >* vals );
432 std::vector< std::vector< std::vector<double> > > getSingularValuesUandVMatrix ( std::vector< std::vector<double> > mat,
unsigned int dim,
ProSHADE::ProSHADE_settings* settings );
440 void precomputeTrSigmaDescriptor ( );
443 void setEulerAngles (
double alpha,
double beta,
double gamma );
444 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 );
445 bool checkPeakExistence (
double alpha,
double beta,
double gamma,
ProSHADE::ProSHADE_settings* settings,
double passThreshold = 0.3 );
446 std::vector< std::array<double,5> > findCnSymmetry ( std::vector< std::array<double,8> > peaks,
448 double axisErrorTolerance = 0.0,
450 double percAllowedToMiss = 0.33,
452 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 );
453 std::vector< std::vector< std::array<double,6> > > findDnSymmetry ( std::vector< std::array<double,5> > CnSymm,
double axisErrorTolerance = 0.1 );
454 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 );
455 std::vector< std::vector< std::array<double,5> > > findTetrSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *tetrSymmPeakAvg,
double axisErrorTolerance = 0.1 );
456 std::vector< std::vector< std::array<double,5> > > findOctaSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *octaSymmPeakAvg,
double axisErrorTolerance = 0.1 );
457 std::vector< std::vector< std::array<double,5> > > findIcosSymmetry ( std::vector< std::array<double,5> > CnSymm,
double *icosSymmPeakAvg,
double axisErrorTolerance = 0.1 );
462 double getPeakThreshold ( );
464 std::string saveName,
int verbose = 0, std::string axOrd =
"xyz",
465 bool internalUse =
false );
467 double *ob2YMov =
nullptr,
double *ob2ZMov =
nullptr );
486 std::vector<ProSHADE_data*> *all;
489 std::vector<int> _lsToIgnore;
490 double _matrixPowerWeight;
493 bool _energyLevelsComputed;
494 bool _trSigmaPreComputed;
495 bool _trSigmaComputed;
497 bool _so3InvMapComputed;
498 bool _eulerAnglesFound;
499 bool _wignerMatricesComputed;
500 bool _fullDistComputed;
503 std::vector<double> _distancesEnergyLevels;
504 std::vector<double> _distancesTraceSigma;
505 std::vector<double> _distancesFullRotation;
508 std::vector< std::vector< std::vector< std::vector< std::array<double,2> > > > > _EMatrices;
509 std::vector<fftw_complex*> _so3InverseCoeffs;
510 std::vector< std::array<double,3> > _eulerAngles;
511 std::vector< std::vector< std::vector< std::vector< std::array<double,2> > > > > _wignerMatrices;
512 std::vector<unsigned int> _enLevelsDoNotFollow;
513 std::vector<unsigned int> _trSigmaDoNotFollow;
516 double glIntRR ( std::vector<double>* vals,
double shellSep, std::vector<double>* glAbscissas, std::vector<double>* glWeights );
517 std::array<double,2> glIntCR ( std::vector< std::array<double,2> >* vals,
double shellSep, std::vector<double> *glAbscissas, std::vector<double> *glWeights );
518 std::vector<double> getSingularValues (
unsigned int strNo,
unsigned int band,
unsigned int dim,
ProSHADE::ProSHADE_settings* settings );
523 std::vector<int> ignoreL,
double matrixPowerWeight,
int verbose );
525 std::vector<int> ignoreL,
double matrixPowerWeight,
int verbose );
529 void precomputeTrSigmaDescriptor (
double shellSpacing, std::vector<unsigned int>* glIntegOrderVec,
ProSHADE::ProSHADE_settings* settings );
549 double mapResolution;
550 unsigned int bandwidth;
551 unsigned int glIntegOrder;
554 std::vector<unsigned int> bandwidthVec;
555 std::vector<unsigned int> glIntegOrderVec;
556 std::vector<unsigned int> thetaVec;
557 std::vector<unsigned int> phiVec;
561 double bFactorChange;
564 double noIQRsFromMap;
568 unsigned int manualShells;
576 std::vector<double> extraSpaceVec;
583 std::vector<int> ignoreLs;
586 std::vector <std::string> structFiles;
589 bool energyLevelDist;
595 bool saveWithAndWithout;
598 std::vector<double> energyLevelsDistances;
599 std::vector<double> traceSigmaDistances;
600 std::vector<double> fullRotationDistances;
601 std::vector< std::vector<double> > fragEnergyLevelsDistances;
602 std::vector< std::vector<double> > fragTraceSigmaDistances;
603 std::vector< std::vector<double> > fragfullRotationDistances;
606 double enLevelsThreshold;
607 double trSigmaThreshold;
618 std::vector<std::string>* matchedStrNames );
620 std::vector<std::string>* matchedStrNames );
621 std::vector<double> getEnergyLevelsDistances ( );
622 std::vector<double> getTraceSigmaDistances ( );
623 std::vector<double> getFullRotationDistances ( );
624 std::vector< std::vector<double> > getFragEnergyLevelsDistances( );
625 std::vector< std::vector<double> > getFragTraceSigmaDistances ( );
626 std::vector< std::vector<double> > getFragFullRotationDistances( );
642 std::string mapFragName;
643 double mapFragBoxFraction;
651 double minDensPreNorm;
652 double maxDensPreNorm;
653 double minDensPostNorm;
654 double maxDensPostNorm;
663 double maskDensityRMS;
664 double allDensityRMS;
665 std::array<double,3> origRanges;
666 std::array<double,3> origDims;
667 std::vector<std::string> fragFiles;
675 void printInfo (
int verbose );
677 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.