ProSHADE  0.7.6.6 (JUL 2022)
Protein Shape Detection
ProSHADE.cpp
Go to the documentation of this file.
1 
25 //==================================================== ProSHADE
26 #include "ProSHADE.hpp"
27 
34 #if defined ( _WIN64 ) || defined ( _WIN32 )
35 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( )
36 #else
38 #endif
39 {
40  //================================================ Settings regarding the task at hand
41  this->task = NA;
42 
43  //================================================ Settings regarding input files
44  this->forceP1 = true;
45  this->removeWaters = true;
46  this->firstModelOnly = true;
47  this->removeNegativeDensity = true;
48 
49  //================================================ Settings regarding the resolution of calculations
50  this->requestedResolution = -1.0;
51  this->changeMapResolution = false;
52  this->changeMapResolutionTriLinear = false;
53  this->resolutionOversampling = 0.5;
54 
55  //================================================ Settings regarding the PDB B-factor change
56  this->pdbBFactorNewVal = -1.0;
57 
58  //================================================ Settings regarding the bandwidth of calculations
59  this->maxBandwidth = 0;
60  this->rotationUncertainty = 0;
61  this->maxRadius = -1.0;
62 
63  //================================================ Settings regarding the phase
64  this->usePhase = true;
65 
66  //================================================ Settings regarding the spheres
67  this->maxSphereDists = 0.0;
68 
69  //================================================ Settings regarding the Gauss-Legendre integration
70  this->integOrder = 0;
71  this->integApproxSteps = 5;
72  this->noIntegrationSpeedup = false;
73 
74  //================================================ Settings regarding map normalisation
75  this->normaliseMap = false;
76 
77  //================================================ Settings regarding map inversion
78  this->invertMap = false;
79 
80  //================================================ Settings regarding map masking
81  this->blurFactor = 350.0;
82  this->maskingThresholdIQRs = 3.0;
83  this->maskMap = false;
84  this->useCorrelationMasking = false;
85  this->halfMapKernel = 0.0;
86  this->correlationKernel = 0.0;
87  this->saveMask = false;
88  this->maskFileName = "maskFile";
89  this->appliedMaskFileName = "";
90  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
91  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
92  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
93 
94  //================================================ Settings regarding Fourier weights
95  this->fourierWeightsFileName = "";
96 
97  //================================================ Settings regarding re-boxing
98  this->reBoxMap = false;
99  this->boundsExtraSpace = 3.0;
100  this->boundsSimilarityThreshold = 0;
101  this->useSameBounds = false;
102  this->forceBounds = new proshade_signed [6];
103 
104  //================================================ Settings regarding COM
105  this->moveToCOM = false;
106  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
107  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
108  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
109 
110  //================================================ Settings regarding extra cell space
111  this->addExtraSpace = 10.0;
112  this->coOrdsExtraSpace = 10.0;
113 
114  //================================================ Settings regarding shell settings
115  this->progressiveSphereMapping = true;
116 
117  //================================================ Settings regarding output file name
118  this->outName = "reBoxed";
119 
120  //================================================ Settings regarding distances computation
121  this->computeEnergyLevelsDesc = true;
122  this->computeTraceSigmaDesc = true;
123  this->computeRotationFuncDesc = true;
124  this->enLevMatrixPowerWeight = 1.0;
125 
126  //================================================ Settings regarding peak searching
127  this->peakNeighbours = 1;
128  this->noIQRsFromMedianNaivePeak = -999.9;
129 
130  //================================================ Settings regarding 1D grouping
131  this->smoothingFactor = 15.0;
132 
133  //================================================ Settings regarding the symmetry detection
134  this->findSymCentre = false;
135  this->useBiCubicInterpolationOnPeaks = true;
136  this->maxSymmetryFold = 30;
137  this->supportedSymmetryFold = 5;
138  this->fscThreshold = 0.3;
139  this->peakThresholdMin = 0.75;
140  this->fastISearch = true;
141  this->symMissPeakThres = 0.3;
142  this->axisErrTolerance = 0.01;
143  this->axisErrToleranceDefault = true;
144  this->minSymPeak = 0.5;
145  this->requestedSymmetryType = "";
146  this->requestedSymmetryFold = 0;
147 
148  //================================================ Settings regarding centre of map
149  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
150  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
151  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
152 
153  //================================================ Settings regarding the structure overlay
154  this->overlayStructureName = "movedStructure";
155  this->rotTrsJSONFile = "movedStructureOperations.json";
156 
157  //================================================ Settings regarding verbosity of the program
158  this->verbose = 1;
159  this->messageShift = 0;
160 
161  //================================================ Done
162 
163 }
164 
171 #if defined ( _WIN64 ) || defined ( _WIN32 )
172 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( ProSHADE_settings* settings )
173 #else
175 #endif
176 {
177  //================================================ Settings regarding the task at hand
178  this->task = settings->task;
179 
180  //================================================ Settings regarding input files
181  for ( size_t fIt = 0; fIt < settings->inputFiles.size(); fIt++ ) { this->inputFiles.push_back ( settings->inputFiles.at(fIt) ); }
182  this->forceP1 = settings->forceP1;
183  this->removeWaters = settings->removeWaters;
184  this->firstModelOnly = settings->firstModelOnly;
185  this->removeNegativeDensity = settings->removeNegativeDensity;
186 
187  //================================================ Settings regarding the resolution of calculations
188  this->requestedResolution = settings->requestedResolution;
189  this->changeMapResolution = settings->changeMapResolution;
190  this->changeMapResolutionTriLinear = settings->changeMapResolutionTriLinear;
191  this->resolutionOversampling = settings->resolutionOversampling;
192 
193  //================================================ Settings regarding the PDB B-factor change
194  this->pdbBFactorNewVal = settings->pdbBFactorNewVal;
195 
196  //================================================ Settings regarding the bandwidth of calculations
197  this->maxBandwidth = settings->maxBandwidth;
198  this->rotationUncertainty = settings->rotationUncertainty;
199  this->maxRadius = settings->maxRadius;
200 
201  //================================================ Settings regarding the phase
202  this->usePhase = settings->usePhase;
203 
204  //================================================ Settings regarding the spheres
205  this->maxSphereDists = settings->maxSphereDists;
206 
207  //================================================ Settings regarding the Gauss-Legendre integration
208  this->integOrder = settings->integOrder;
209  this->integApproxSteps = settings->integApproxSteps;
210  this->noIntegrationSpeedup = settings->noIntegrationSpeedup;
211 
212  //================================================ Settings regarding map normalisation
213  this->normaliseMap = settings->normaliseMap;
214 
215  //================================================ Settings regarding map inversion
216  this->invertMap = settings->invertMap;
217 
218  //================================================ Settings regarding map masking
219  this->blurFactor = settings->blurFactor;
220  this->maskingThresholdIQRs = settings->maskingThresholdIQRs;
221  this->maskMap = settings->maskMap;
222  this->useCorrelationMasking = settings->useCorrelationMasking;
223  this->halfMapKernel = settings->halfMapKernel;
224  this->correlationKernel = settings->correlationKernel;
225  this->saveMask = settings->saveMask;
226  this->maskFileName = settings->maskFileName;
227  this->appliedMaskFileName = settings->appliedMaskFileName;
228  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, settings->calcBounds.at(0) );
229  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, settings->calcBounds.at(1) );
230  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, settings->calcBounds.at(2) );
231 
232  //================================================ Settings regarding Fourier weights
233  this->fourierWeightsFileName = settings->fourierWeightsFileName;
234 
235  //================================================ Settings regarding re-boxing
236  this->reBoxMap = settings->reBoxMap;
237  this->boundsExtraSpace = settings->boundsExtraSpace;
238  this->boundsSimilarityThreshold = settings->boundsSimilarityThreshold;
239  this->useSameBounds = settings->useSameBounds;
240  this->forceBounds = new proshade_signed [6];
241  for ( size_t fbIt = 0; fbIt < 6; fbIt++ ) { this->forceBounds[fbIt] = settings->forceBounds[fbIt]; }
242 
243  //================================================ Settings regarding COM
244  this->moveToCOM = settings->moveToCOM;
245  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(0) );
246  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(1) );
247  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(2) );
248 
249  //================================================ Settings regarding extra cell space
250  this->addExtraSpace = settings->addExtraSpace;
251  this->coOrdsExtraSpace = settings->coOrdsExtraSpace;
252 
253  //================================================ Settings regarding shell settings
254  this->progressiveSphereMapping = settings->progressiveSphereMapping;
255 
256  //================================================ Settings regarding output file name
257  this->outName = settings->outName;
258 
259  //================================================ Settings regarding distances computation
260  this->computeEnergyLevelsDesc = settings->computeEnergyLevelsDesc;
261  this->computeTraceSigmaDesc = settings->computeTraceSigmaDesc;
262  this->computeRotationFuncDesc = settings->computeRotationFuncDesc;
263  this->enLevMatrixPowerWeight = settings->enLevMatrixPowerWeight;
264 
265  //================================================ Settings regarding peak searching
266  this->peakNeighbours = settings->peakNeighbours;
267  this->noIQRsFromMedianNaivePeak = settings->noIQRsFromMedianNaivePeak;
268 
269  //================================================ Settings regarding 1D grouping
270  this->smoothingFactor = settings->smoothingFactor;
271 
272  //================================================ Settings regarding the symmetry detection
273  this->findSymCentre = settings->findSymCentre;
274  this->useBiCubicInterpolationOnPeaks = settings->useBiCubicInterpolationOnPeaks;
275  this->maxSymmetryFold = settings->maxSymmetryFold;
276  this->supportedSymmetryFold = settings->supportedSymmetryFold;
277  this->fscThreshold = settings->fscThreshold;
278  this->peakThresholdMin = settings->peakThresholdMin;
279  this->fastISearch = settings->fastISearch;
280  this->symMissPeakThres = settings->symMissPeakThres;
281  this->axisErrTolerance = settings->axisErrTolerance;
282  this->axisErrToleranceDefault = settings->axisErrToleranceDefault;
283  this->minSymPeak = settings->minSymPeak;
284  this->requestedSymmetryType = settings->requestedSymmetryType;
285  this->requestedSymmetryFold = settings->requestedSymmetryFold;
286 
287  //================================================ Settings regarding centre of map
288  this->centrePosition.clear ( );
289  for ( size_t cpIt = 0; cpIt < settings->centrePosition.size(); cpIt++ )
290  {
291  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, settings->centrePosition.at(cpIt) );
292  }
293 
294  //================================================ Settings regarding the structure overlay
295  this->overlayStructureName = settings->overlayStructureName;
296  this->rotTrsJSONFile = settings->rotTrsJSONFile;
297 
298  //================================================ Settings regarding verbosity of the program
299  this->verbose = settings->verbose;
300  this->messageShift = settings->messageShift;
301 }
302 
311 #if defined ( _WIN64 ) || defined ( _WIN32 )
312 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
313 #else
314  ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
315 #endif
316 {
317  //================================================ Settings regarding the task at hand
318  this->task = taskToPerform;
319 
320  //================================================ Settings regarding input files
321  this->forceP1 = true;
322  this->removeWaters = true;
323  this->firstModelOnly = true;
324  this->removeNegativeDensity = true;
325 
326  //================================================ Settings regarding the resolution of calculations
327  this->requestedResolution = -1.0;
328  this->changeMapResolution = false;
329  this->changeMapResolutionTriLinear = false;
330  this->resolutionOversampling = 0.5;
331 
332  //================================================ Settings regarding the PDB B-factor change
333  this->pdbBFactorNewVal = -1.0;
334 
335  //================================================ Settings regarding the bandwidth of calculations
336  this->maxBandwidth = 0;
337  this->rotationUncertainty = 0;
338  this->maxRadius = -1.0;
339 
340  //================================================ Settings regarding the phase
341  this->usePhase = true;
342 
343  //================================================ Settings regarding the spheres
344  this->maxSphereDists = 0.0;
345 
346  //================================================ Settings regarding the Gauss-Legendre integration
347  this->integOrder = 0;
348  this->integApproxSteps = 5;
349  this->noIntegrationSpeedup = false;
350 
351  //================================================ Settings regarding map normalisation
352  this->normaliseMap = false;
353 
354  //================================================ Settings regarding map inversion
355  this->invertMap = false;
356 
357  //================================================ Settings regarding map masking
358  this->blurFactor = 350.0;
359  this->maskingThresholdIQRs = 3.0;
360  this->maskMap = false;
361  this->useCorrelationMasking = false;
362  this->halfMapKernel = 0.0;
363  this->correlationKernel = 0.0;
364  this->saveMask = false;
365  this->maskFileName = "maskFile";
366  this->appliedMaskFileName = "";
367  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
368  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
369  ProSHADE_internal_misc::addToDoubleVector ( &this->calcBounds, std::numeric_limits< proshade_double >::infinity() );
370 
371  //================================================ Settings regarding Fourier weights
372  this->fourierWeightsFileName = "";
373 
374  //================================================ Settings regarding COM
375  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
376  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
377  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
378 
379  //================================================ Settings regarding re-boxing
380  this->reBoxMap = false;
381  this->boundsExtraSpace = 3.0;
382  this->boundsSimilarityThreshold = 0;
383  this->useSameBounds = false;
384  this->forceBounds = new proshade_signed [6];
385 
386  //================================================ Settings regarding extra cell space
387  this->addExtraSpace = 10.0;
388  this->coOrdsExtraSpace = 10.0;
389 
390  //================================================ Settings regarding shell settings
391  this->progressiveSphereMapping = true;
392 
393  //================================================ Settings regarding output file name
394  this->outName = "reBoxed";
395 
396  //================================================ Settings regarding distances computation
397  this->computeEnergyLevelsDesc = true;
398  this->computeTraceSigmaDesc = true;
399  this->computeRotationFuncDesc = true;
400  this->enLevMatrixPowerWeight = 1.0;
401 
402  //================================================ Settings regarding peak searching
403  this->peakNeighbours = 1;
404  this->noIQRsFromMedianNaivePeak = -999.9;
405 
406  //================================================ Settings regarding 1D grouping
407  this->smoothingFactor = 15.0;
408 
409  //================================================ Settings regarding the symmetry detection
410  this->findSymCentre = false;
411  this->useBiCubicInterpolationOnPeaks = true;
412  this->maxSymmetryFold = 30;
413  this->supportedSymmetryFold = 5;
414  this->fscThreshold = 0.3;
415  this->peakThresholdMin = 0.75;
416  this->fastISearch = true;
417  this->symMissPeakThres = 0.3;
418  this->axisErrTolerance = 0.01;
419  this->axisErrToleranceDefault = true;
420  this->minSymPeak = 0.5;
421  this->requestedSymmetryType = "";
422  this->requestedSymmetryFold = 0;
423 
424  //================================================ Settings regarding centre of map
425  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
426  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
427  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
428 
429  //================================================ Settings regarding the structure overlay
430  this->overlayStructureName = "movedStructure";
431  this->rotTrsJSONFile = "movedStructureOperations.json";
432 
433  //================================================ Settings regarding verbosity of the program
434  this->verbose = 1;
435  this->messageShift = 0;
436 
437  //================================================ Task specific settings
438  switch ( this->task )
439  {
440  case NA:
441  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
442  std::cerr << "Error Code : " << "E000014" << std::endl << std::flush;
443  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
444  std::cerr << "File : " << "ProSHADE.cpp" << std::endl << std::flush;
445  std::cerr << "Line : " << 97 << std::endl << std::flush;
446  std::cerr << "Function : " << "ProSHADE_settings (Task) constructor" << std::endl << std::flush;
447  std::cerr << "Message : " << "No task has been specified for task specific constructor." << std::endl << std::flush;
448  std::cerr << "Further information : " << "This ProSHADE_settings class constructor is intended to\n : set the internal variables to default value given a\n : particular taks. By supplying this task as NA, this beats\n : the purpose of the constructor. Please use the\n : non-argumental constructor if task is not yet known." << std::endl << std::endl << std::flush;
450  exit ( EXIT_FAILURE );
451 
452  case Symmetry:
453  this->requestedResolution = 6.0;
454  this->pdbBFactorNewVal = 80.0;
455  this->changeMapResolution = true;
456  this->maskMap = false;
457  this->moveToCOM = true;
458  this->reBoxMap = false;
459  break;
460 
461  case Distances:
462  this->changeMapResolution = false;
463  this->maskMap = false;
464  this->moveToCOM = true;
465  this->reBoxMap = false;
466  break;
467 
468  case OverlayMap:
469  this->requestedResolution = 8.0;
470  this->changeMapResolution = true;
471  this->maskMap = false;
472  this->moveToCOM = false;
473  this->reBoxMap = false;
474  break;
475 
476  case MapManip:
477  this->changeMapResolution = false;
478  this->maskMap = true;
479  this->moveToCOM = false;
480  break;
481  }
482 
483  //================================================ Done
484 
485 }
486 
491 #if defined ( _WIN64 ) || defined ( _WIN32 )
492 __declspec(dllexport) ProSHADE_settings::~ProSHADE_settings ( void )
493 #else
495 #endif
496 {
497  //================================================ Release boundaries variable
498  delete[] this->forceBounds;
499 
500  //================================================ Done
501 
502 }
503 
507 {
508  //================================================ Determine the peak IQR from median threshold, unless given by user
509  const FloatingPoint< proshade_double > lhs ( this->noIQRsFromMedianNaivePeak ), rhs ( -999.9 );
510  if ( lhs.AlmostEquals( rhs ) )
511  {
512  //============================================ If using the old symmetry detection algorithm or distances computation, this will be used on many small peaks with few outliers. Use value of 5.0
513  if ( this->task == Distances ) { this->noIQRsFromMedianNaivePeak = 5.0; }
514  if ( this->task == Symmetry ) { this->noIQRsFromMedianNaivePeak = static_cast< proshade_double > ( std::max ( 0.0f, 1.0f - ( this->requestedResolution * 0.05f ) ) ); }
515  }
516 
517  //================================================ Done
518  return ;
519 
520 }
521 
529 #if defined ( _WIN64 ) || defined ( _WIN32 )
530 void __declspec(dllexport) ProSHADE_settings::addStructure ( std::string structure )
531 #else
532 void ProSHADE_settings::addStructure ( std::string structure )
533 #endif
534 {
535  //================================================ Use C++ version independent vector processing
536  ProSHADE_internal_misc::addToStringVector ( &( this->inputFiles ), structure );
537 
538  //================================================ Done
539  return ;
540 
541 }
542 
549 #if defined ( _WIN64 ) || defined ( _WIN32 )
550 void __declspec(dllexport) ProSHADE_settings::setResolution ( proshade_single resolution )
551 #else
552 void ProSHADE_settings::setResolution ( proshade_single resolution )
553 #endif
554 {
555  //================================================ Set the value
556  this->requestedResolution = resolution;
557 
558  //================================================ Done
559  return ;
560 
561 }
562 
569 #if defined ( _WIN64 ) || defined ( _WIN32 )
570 void __declspec(dllexport) ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
571 #else
572 void ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
573 #endif
574 {
575  //================================================ Set the value
576  this->pdbBFactorNewVal = newBF;
577 
578  //================================================ Done
579  return ;
580 
581 }
582 
589 #if defined ( _WIN64 ) || defined ( _WIN32 )
590 void __declspec(dllexport) ProSHADE_settings::setNormalisation ( bool normalise )
591 #else
592 void ProSHADE_settings::setNormalisation ( bool normalise )
593 #endif
594 {
595  //================================================ Set the value
596  this->normaliseMap = normalise;
597 
598  //================================================ Done
599  return ;
600 
601 }
602 
609 #if defined ( _WIN64 ) || defined ( _WIN32 )
610 void __declspec(dllexport) ProSHADE_settings::setMapInversion ( bool mInv )
611 #else
613 #endif
614 {
615  //================================================ Set the value
616  this->invertMap = mInv;
617 
618  //================================================ Done
619  return ;
620 
621 }
622 
629 #if defined ( _WIN64 ) || defined ( _WIN32 )
630 void __declspec(dllexport) ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
631 #else
632 void ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
633 #endif
634 {
635  //================================================ Set the value
636  this->verbose = verbosity;
637 
638  //================================================ Done
639  return ;
640 
641 }
642 
649 #if defined ( _WIN64 ) || defined ( _WIN32 )
650 void __declspec(dllexport) ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
651 #else
652 void ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
653 #endif
654 {
655  //================================================ Set the value
656  this->blurFactor = blurFac;
657 
658  //================================================ Done
659  return ;
660 
661 }
662 
670 #if defined ( _WIN64 ) || defined ( _WIN32 )
671 void __declspec(dllexport) ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
672 #else
673 void ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
674 #endif
675 {
676  //================================================ Set the value
677  this->maskingThresholdIQRs = noIQRs;
678 
679  //================================================ Done
680  return ;
681 
682 }
683 
690 #if defined ( _WIN64 ) || defined ( _WIN32 )
691 void __declspec(dllexport) ProSHADE_settings::setMasking ( bool mask )
692 #else
694 #endif
695 {
696  //================================================ Set the value
697  this->maskMap = mask;
698 
699  //================================================ Done
700  return ;
701 
702 }
703 
711 #if defined ( _WIN64 ) || defined ( _WIN32 )
712 void __declspec(dllexport) ProSHADE_settings::setCorrelationMasking ( bool corMask )
713 #else
715 #endif
716 {
717  //================================================ Set the value
718  this->useCorrelationMasking = corMask;
719 
720  //================================================ Done
721  return ;
722 
723 }
724 
733 #if defined ( _WIN64 ) || defined ( _WIN32 )
734 void __declspec(dllexport) ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
735 #else
736 void ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
737 #endif
738 {
739  //================================================ Set the value
740  this->halfMapKernel = typNoi;
741 
742  //================================================ Done
743  return ;
744 
745 }
746 
753 #if defined ( _WIN64 ) || defined ( _WIN32 )
754 void __declspec(dllexport) ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
755 #else
756 void ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
757 #endif
758 {
759  //================================================ Set the value
760  this->correlationKernel = minMS;
761 
762  //================================================ Done
763  return ;
764 
765 }
766 
773 #if defined ( _WIN64 ) || defined ( _WIN32 )
774 void __declspec(dllexport) ProSHADE_settings::setMaskSaving ( bool savMsk )
775 #else
777 #endif
778 {
779  //================================================ Set the value
780  this->saveMask = savMsk;
781 
782  //================================================ Done
783  return ;
784 
785 }
786 
793 #if defined ( _WIN64 ) || defined ( _WIN32 )
794 void __declspec(dllexport) ProSHADE_settings::setMaskFilename ( std::string mskFln )
795 #else
796 void ProSHADE_settings::setMaskFilename ( std::string mskFln )
797 #endif
798 {
799  //================================================ Set the value
800  this->maskFileName = mskFln;
801 
802  //================================================ Done
803  return ;
804 
805 }
806 
813 #if defined ( _WIN64 ) || defined ( _WIN32 )
814 void __declspec(dllexport) ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
815 #else
816 void ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
817 #endif
818 {
819  //================================================ Set the value
820  this->appliedMaskFileName = mskFln;
821 
822  //================================================ Done
823  return ;
824 
825 }
826 
833 #if defined ( _WIN64 ) || defined ( _WIN32 )
834 void __declspec(dllexport) ProSHADE_settings::setFourierWeightsFilename ( std::string fWgFln )
835 #else
837 #endif
838 {
839  //================================================ Set the value
840  this->fourierWeightsFileName = fWgFln;
841 
842  //================================================ Done
843  return ;
844 
845 }
846 
853 #if defined ( _WIN64 ) || defined ( _WIN32 )
854 void __declspec(dllexport) ProSHADE_settings::setMapReboxing ( bool reBx )
855 #else
857 #endif
858 {
859  //================================================ Set the value
860  this->reBoxMap = reBx;
861 
862  //================================================ Done
863  return ;
864 
865 }
866 
874 #if defined ( _WIN64 ) || defined ( _WIN32 )
875 void __declspec(dllexport) ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
876 #else
877 void ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
878 #endif
879 {
880  //================================================ Set the value
881  this->boundsExtraSpace = boundsExSp;
882 
883  //================================================ Done
884  return ;
885 
886 }
887 
894 #if defined ( _WIN64 ) || defined ( _WIN32 )
895 void __declspec(dllexport) ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
896 #else
897 void ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
898 #endif
899 {
900  //================================================ Set the value
901  this->boundsSimilarityThreshold = boundsThres;
902 
903  //================================================ Done
904  return ;
905 
906 }
907 
915 #if defined ( _WIN64 ) || defined ( _WIN32 )
916 void __declspec(dllexport) ProSHADE_settings::setSameBoundaries ( bool sameB )
917 #else
919 #endif
920 {
921  //================================================ Set the value
922  this->useSameBounds = sameB;
923 
924  //================================================ Done
925  return ;
926 
927 }
928 
936 #if defined ( _WIN64 ) || defined ( _WIN32 )
937 void __declspec(dllexport) ProSHADE_settings::setOutputFilename ( std::string oFileName )
938 #else
939 void ProSHADE_settings::setOutputFilename ( std::string oFileName )
940 #endif
941 {
942  //================================================ Set the value
943  this->outName = oFileName;
944 
945  //================================================ Done
946  return ;
947 
948 }
949 
956 #if defined ( _WIN64 ) || defined ( _WIN32 )
957 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChange ( bool mrChange )
958 #else
960 #endif
961 {
962  //================================================ Set the value
963  this->changeMapResolution = mrChange;
964 
965  //================================================ Done
966  return ;
967 
968 }
969 
976 #if defined ( _WIN64 ) || defined ( _WIN32 )
977 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChangeTriLinear ( bool mrChange )
978 #else
980 #endif
981 {
982  //================================================ Set the value
983  this->changeMapResolutionTriLinear = mrChange;
984 
985  //================================================ Done
986  return ;
987 
988 }
989 
996 #if defined ( _WIN64 ) || defined ( _WIN32 )
997 void __declspec(dllexport) ProSHADE_settings::setMapResolutionOverSampling ( proshade_single overS )
998 #else
1000 #endif
1001 {
1002  //================================================ Set the value
1003  this->resolutionOversampling = overS;
1004 
1005  //================================================ Done
1006  return ;
1007 
1008 }
1009 
1016 #if defined ( _WIN64 ) || defined ( _WIN32 )
1017 void __declspec(dllexport) ProSHADE_settings::setMapCentering ( bool com )
1018 #else
1020 #endif
1021 {
1022  //================================================ Set the value
1023  this->moveToCOM = com;
1024 
1025  //================================================ Done
1026  return ;
1027 
1028 }
1029 
1038 #if defined ( _WIN64 ) || defined ( _WIN32 )
1039 void __declspec(dllexport) ProSHADE_settings::setBoxCentering ( proshade_double xPos, proshade_double yPos, proshade_double zPos )
1040 #else
1041 void ProSHADE_settings::setBoxCentering ( proshade_double xPos, proshade_double yPos, proshade_double zPos )
1042 #endif
1043 {
1044  //================================================ If COM is on, issue warning!
1045  if ( this->moveToCOM )
1046  {
1047  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested specific map box centre and also centre of mass centring. These are mutually exclusive - turning COM centring off.", "WP00067" );
1048  this->moveToCOM = false;
1049  }
1050 
1051  //================================================ Set the values
1052  this->boxCentre.at(0) = xPos;
1053  this->boxCentre.at(1) = yPos;
1054  this->boxCentre.at(2) = zPos;
1055 
1056  //================================================ Done
1057  return ;
1058 
1059 }
1060 
1067 #if defined ( _WIN64 ) || defined ( _WIN32 )
1068 void __declspec(dllexport) ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
1069 #else
1070 void ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
1071 #endif
1072 {
1073  //================================================ Set the value
1074  this->addExtraSpace = exSpace;
1075 
1076  //================================================ Done
1077  return ;
1078 
1079 }
1080 
1087 #if defined ( _WIN64 ) || defined ( _WIN32 )
1088 void __declspec(dllexport) ProSHADE_settings::setCoordExtraSpace ( proshade_single exSpace )
1089 #else
1090 void ProSHADE_settings::setCoordExtraSpace ( proshade_single exSpace )
1091 #endif
1092 {
1093  //================================================ Set the value
1094  this->coOrdsExtraSpace = exSpace;
1095 
1096  //================================================ Done
1097  return ;
1098 
1099 }
1100 
1107 #if defined ( _WIN64 ) || defined ( _WIN32 )
1108 void __declspec(dllexport) ProSHADE_settings::setBandwidth ( proshade_unsign band )
1109 #else
1110 void ProSHADE_settings::setBandwidth ( proshade_unsign band )
1111 #endif
1112 {
1113  //================================================ Set the value
1114  this->maxBandwidth = band;
1115 
1116  //================================================ Done
1117  return ;
1118 
1119 }
1120 
1127 #if defined ( _WIN64 ) || defined ( _WIN32 )
1128 void __declspec(dllexport) ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
1129 #else
1130 void ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
1131 #endif
1132 {
1133  //================================================ Set the value
1134  this->maxSphereDists = sphDist;
1135 
1136  //================================================ Done
1137  return ;
1138 
1139 }
1140 
1147 #if defined ( _WIN64 ) || defined ( _WIN32 )
1148 void __declspec(dllexport) ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
1149 #else
1150 void ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
1151 #endif
1152 {
1153  //================================================ Set the value
1154  this->integOrder = intOrd;
1155 
1156  //================================================ Done
1157  return ;
1158 
1159 }
1160 
1168 #if defined ( _WIN64 ) || defined ( _WIN32 )
1169 void __declspec(dllexport) ProSHADE_settings::setIntegrationApproxSteps ( proshade_unsign noSteps )
1170 #else
1171 void ProSHADE_settings::setIntegrationApproxSteps ( proshade_unsign noSteps )
1172 #endif
1173 {
1174  //================================================ Set the value
1175  this->integApproxSteps = noSteps;
1176 
1177  //================================================ Done
1178  return ;
1179 
1180 }
1181 
1186 #if defined ( _WIN64 ) || defined ( _WIN32 )
1187 void __declspec(dllexport) ProSHADE_settings::setIntegrationSpeedUp ( bool speedup )
1188 #else
1190 #endif
1191 {
1192  //================================================ Set the value
1193  this->noIntegrationSpeedup = !speedup;
1194 
1195  //================================================ Done
1196  return ;
1197 
1198 }
1199 
1206 #if defined ( _WIN64 ) || defined ( _WIN32 )
1207 void __declspec(dllexport) ProSHADE_settings::setProgressiveSphereMapping ( bool progSphMap )
1208 #else
1210 #endif
1211 {
1212  //================================================ Set the value
1213  this->progressiveSphereMapping = progSphMap;
1214 
1215  //================================================ Done
1216  return ;
1217 
1218 }
1219 
1227 #if defined ( _WIN64 ) || defined ( _WIN32 )
1228 void __declspec(dllexport) ProSHADE_settings::setEnergyLevelsComputation ( bool enLevDesc )
1229 #else
1231 #endif
1232 {
1233  //======================================== Set the value
1234  this->computeEnergyLevelsDesc = enLevDesc;
1235 
1236  //======================================== Done
1237  return ;
1238 
1239 }
1240 
1248 #if defined ( _WIN64 ) || defined ( _WIN32 )
1249 void __declspec(dllexport) ProSHADE_settings::setTraceSigmaComputation ( bool trSigVal )
1250 #else
1252 #endif
1253 {
1254  //================================================ Set the value
1255  this->computeTraceSigmaDesc = trSigVal;
1256 
1257  //================================================ Done
1258  return ;
1259 
1260 }
1261 
1269 #if defined ( _WIN64 ) || defined ( _WIN32 )
1270 void __declspec(dllexport) ProSHADE_settings::setRotationFunctionComputation ( bool rotfVal )
1271 #else
1273 #endif
1274 {
1275  //================================================ Set the value
1276  this->computeRotationFuncDesc = rotfVal;
1277 
1278  //================================================ Done
1279  return ;
1280 
1281 }
1282 
1290 #if defined ( _WIN64 ) || defined ( _WIN32 )
1291 void __declspec(dllexport) ProSHADE_settings::setPeakNeighboursNumber ( proshade_unsign pkS )
1292 #else
1294 #endif
1295 {
1296  //================================================ Set the value
1297  this->peakNeighbours = pkS;
1298 
1299  //================================================ Done
1300  return ;
1301 
1302 }
1303 
1312 #if defined ( _WIN64 ) || defined ( _WIN32 )
1313 void __declspec(dllexport) ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1314 #else
1315 void ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1316 #endif
1317 {
1318  //================================================ Set the value
1319  this->noIQRsFromMedianNaivePeak = noIQRs;
1320 
1321  //================================================ Done
1322  return ;
1323 
1324 }
1325 
1334 #if defined ( _WIN64 ) || defined ( _WIN32 )
1335 void __declspec(dllexport) ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1336 #else
1337 void ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1338 #endif
1339 {
1340  //================================================ Set the value
1341  this->usePhase = phaseUsage;
1342 
1343  //================================================ Done
1344  return ;
1345 
1346 }
1347 
1356 #if defined ( _WIN64 ) || defined ( _WIN32 )
1357 void __declspec(dllexport) ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1358 #else
1359 void ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1360 #endif
1361 {
1362  //================================================ Set the value
1363  this->enLevMatrixPowerWeight = mPower;
1364 
1365  //================================================ Done
1366  return ;
1367 
1368 }
1369 
1378 #if defined ( _WIN64 ) || defined ( _WIN32 )
1379 void __declspec(dllexport) ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1380 #else
1381 void ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1382 #endif
1383 {
1384  //================================================ Set the value
1385  this->smoothingFactor = smFact;
1386 
1387  //================================================ Done
1388  return ;
1389 
1390 }
1391 
1399 #if defined ( _WIN64 ) || defined ( _WIN32 )
1400 void __declspec(dllexport) ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1401 #else
1402 void ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1403 #endif
1404 {
1405  //================================================ Set the value
1406  this->symMissPeakThres = mpThres;
1407 
1408  //================================================ Done
1409  return ;
1410 
1411 }
1412 
1420 #if defined ( _WIN64 ) || defined ( _WIN32 )
1421 void __declspec(dllexport) ProSHADE_settings::setSymmetryCentreSearch ( bool sCen )
1422 #else
1424 #endif
1425 {
1426  //================================================ Set the value
1427  this->findSymCentre = sCen;
1428 
1429  //================================================ Done
1430  return ;
1431 
1432 }
1433 
1441 #if defined ( _WIN64 ) || defined ( _WIN32 )
1442 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1443 #else
1444 void ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1445 #endif
1446 {
1447  //================================================ Set the value
1448  this->axisErrTolerance = axThres;
1449 
1450  //================================================ Done
1451  return ;
1452 
1453 }
1454 
1464 #if defined ( _WIN64 ) || defined ( _WIN32 )
1465 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThresholdBehaviour ( bool behav )
1466 #else
1468 #endif
1469 {
1470  //================================================ Set the value
1471  this->axisErrToleranceDefault = behav;
1472 
1473  //================================================ Done
1474  return ;
1475 
1476 }
1477 
1485 #if defined ( _WIN64 ) || defined ( _WIN32 )
1486 void __declspec(dllexport) ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1487 #else
1488 void ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1489 #endif
1490 {
1491  //================================================ Set the value
1492  this->minSymPeak = minSP;
1493 
1494  //================================================ Done
1495  return ;
1496 
1497 }
1498 
1505 #if defined ( _WIN64 ) || defined ( _WIN32 )
1506 void __declspec(dllexport) ProSHADE_settings::setRequestedSymmetry ( std::string val )
1507 #else
1509 #endif
1510 {
1511  //================================================ Set the value
1512  this->requestedSymmetryType = val;
1513 
1514  //================================================ Done
1515  return ;
1516 
1517 }
1518 
1525 #if defined ( _WIN64 ) || defined ( _WIN32 )
1526 void __declspec(dllexport) ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1527 #else
1528 void ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1529 #endif
1530 {
1531  //================================================ Set the value
1532  this->requestedSymmetryFold = val;
1533 
1534  //================================================ Done
1535  return ;
1536 
1537 }
1538 
1543 #if defined ( _WIN64 ) || defined ( _WIN32 )
1544 void __declspec(dllexport) ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1545 #else
1546 void ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1547 #endif
1548 {
1549  //================================================ Set the value
1550  this->overlayStructureName = filename;
1551 
1552  //================================================ Done
1553  return ;
1554 
1555 }
1556 
1561 #if defined ( _WIN64 ) || defined ( _WIN32 )
1562 void __declspec(dllexport) ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1563 #else
1564 void ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1565 #endif
1566 {
1567  //================================================ Set the value
1568  this->rotTrsJSONFile = filename;
1569 
1570  //================================================ Done
1571  return ;
1572 
1573 }
1574 
1579 #if defined ( _WIN64 ) || defined ( _WIN32 )
1580 void __declspec(dllexport) ProSHADE_settings::setBicubicInterpolationSearch ( bool bicubPeaks )
1581 #else
1583 #endif
1584 {
1585  //================================================ Set the value
1586  this->useBiCubicInterpolationOnPeaks = bicubPeaks;
1587 
1588  //================================================ Done
1589  return ;
1590 
1591 }
1592 
1597 #if defined ( _WIN64 ) || defined ( _WIN32 )
1598 void __declspec(dllexport) ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1599 #else
1600 void ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1601 #endif
1602 {
1603  //================================================ Set the value
1604  this->maxSymmetryFold = maxFold;
1605 
1606  //================================================ Done
1607  return ;
1608 
1609 }
1610 
1615 #if defined ( _WIN64 ) || defined ( _WIN32 )
1616 void __declspec(dllexport) ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1617 #else
1618 void ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1619 #endif
1620 {
1621  //================================================ Set the value
1622  this->fscThreshold = fscThr;
1623 
1624  //================================================ Done
1625  return ;
1626 
1627 }
1628 
1633 #if defined ( _WIN64 ) || defined ( _WIN32 )
1634 void __declspec(dllexport) ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1635 #else
1636 void ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1637 #endif
1638 {
1639  //================================================ Set the value
1640  this->peakThresholdMin = peakThr;
1641 
1642  //================================================ Done
1643  return ;
1644 
1645 }
1646 
1651 #if defined ( _WIN64 ) || defined ( _WIN32 )
1652 void __declspec(dllexport) ProSHADE_settings::setNegativeDensity ( bool nDens )
1653 #else
1655 #endif
1656 {
1657  //================================================ Set the value
1658  this->removeNegativeDensity = nDens;
1659 
1660  //================================================ Done
1661  return ;
1662 
1663 }
1664 
1673 void ProSHADE_settings::determineBandwidth ( proshade_unsign circumference )
1674 {
1675  //================================================ Check the current settings value is set to auto
1676  if ( this->maxBandwidth != 0 )
1677  {
1678  std::stringstream hlpSS;
1679  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1680  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1681  return ;
1682  }
1683 
1684  //================================================ Determine automatically
1686 
1687  //================================================ Determine max detectable fold for symmetry detection ( 2.0 - we want the fold detectable not only on the surface, but also on the inside of the structure and 2.0 means 3/4 depth
1688  //================================================ 5.0 - we want at least 3 points between any two members of the same fold to make sure the fold it detected correctly )
1689  this->supportedSymmetryFold = static_cast< proshade_unsign > ( ( static_cast< proshade_double > ( circumference ) / 2.0 ) / 5.0 );
1690  if ( this->supportedSymmetryFold < 5 ) { this->supportedSymmetryFold = 5; }
1691 
1692  //================================================ Report progress
1693  std::stringstream hlpSS;
1694  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1695  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1696 
1697  //================================================ Done
1698  return ;
1699 
1700 }
1701 
1710 void ProSHADE_settings::determineBandwidthFromAngle ( proshade_double uncertainty )
1711 {
1712  //================================================ Determine bandwidth
1713  if ( static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2 ) ) % 2 == 0 )
1714  {
1715  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) );
1716  }
1717  else
1718  {
1719  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) ) + 1;
1720  }
1721 
1722  //================================================ Report progress
1723  std::stringstream hlpSS;
1724  hlpSS << "The bandwidth was determined from uncertainty " << uncertainty << " degrees as: " << this->maxBandwidth;
1725  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1726 
1727  //================================================ Done
1728  return ;
1729 
1730 }
1731 
1741 void ProSHADE_settings::determineSphereDistances ( proshade_single maxMapRange )
1742 {
1743  //================================================ Check the current settings value is set to auto
1744  if ( this->maxSphereDists != 0.0f )
1745  {
1746  std::stringstream hlpSS;
1747  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1748  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1749  return ;
1750  }
1751 
1752  //================================================ Determine automatically
1754 
1755  //================================================ Report progress
1756  std::stringstream hlpSS;
1757  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1758  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1759 
1760  //================================================ Done
1761  return ;
1762 
1763 }
1764 
1773 void ProSHADE_settings::determineIntegrationOrder ( proshade_single maxMapRange )
1774 {
1775  //================================================ Check the current settings value is set to auto
1776  if ( this->integOrder != 0 )
1777  {
1778  std::stringstream hlpSS;
1779  hlpSS << "The integration order was determined as " << this->integOrder;
1780  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1781  return ;
1782  }
1783 
1784  //================================================ Determine automatically
1786 
1787  //================================================ Report progress
1788  std::stringstream hlpSS;
1789  hlpSS << "The integration order was determined as " << this->integOrder;
1790  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1791 
1792  //================================================ Done
1793  return ;
1794 
1795 }
1796 
1817 void ProSHADE_settings::determineAllSHValues ( proshade_unsign xDim, proshade_unsign yDim, proshade_single xDimAngs, proshade_single yDimAngs, proshade_single zDimAngs )
1818 {
1819  //================================================ Print progress message
1820  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 1, "Preparing spherical harmonics environment.", this->messageShift );
1821 
1822  //================================================ Modify dims by resolution
1823  proshade_unsign theoXDim = static_cast< proshade_unsign > ( std::ceil ( xDimAngs / ( this->requestedResolution / 2.0f ) ) );
1824  proshade_unsign theoYDim = static_cast< proshade_unsign > ( std::ceil ( yDimAngs / ( this->requestedResolution / 2.0f ) ) );
1825  proshade_unsign theoZDim = static_cast< proshade_unsign > ( std::ceil ( zDimAngs / ( this->requestedResolution / 2.0f ) ) );
1826 
1827  //================================================ If max radius is given, use it for speed up
1828  if ( this->maxRadius > 0.0 )
1829  {
1830  //============================================ Sanity check
1831  if ( static_cast< proshade_single > ( this->maxRadius * 2.0 ) > std::max ( xDimAngs, std::max( yDimAngs, zDimAngs ) ) )
1832  {
1833  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested maximum radius is larger than the maximum map dimension. Using the maximum map dimension instead.", "WM00074" );
1834  }
1835 
1836  //============================================ Reasonable radius
1837  else
1838  {
1839  theoXDim = static_cast< proshade_unsign > ( std::ceil ( ( this->maxRadius * 2.0 ) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1840  theoYDim = static_cast< proshade_unsign > ( std::ceil ( ( this->maxRadius * 2.0 ) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1841  theoZDim = static_cast< proshade_unsign > ( std::ceil ( ( this->maxRadius * 2.0 ) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1842  }
1843  }
1844 
1845  //================================================ Reduce calculation cost by using only density filled map part instead of the whole box
1846  if ( ( std::isinf ( this->calcBounds.at(0) ) || std::isinf ( this->calcBounds.at(1) ) || std::isinf ( this->calcBounds.at(2) ) ) && ( this->maxRadius < 0.0 ) )
1847  {
1848  //== Determine from sphere variance
1849  }
1850  else
1851  {
1852  //============================================ Data from mask are available - use them!
1853  theoXDim = static_cast< proshade_unsign > ( std::ceil ( this->calcBounds.at(0) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1854  theoYDim = static_cast< proshade_unsign > ( std::ceil ( this->calcBounds.at(1) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1855  theoZDim = static_cast< proshade_unsign > ( std::ceil ( this->calcBounds.at(2) / static_cast< proshade_double > ( this->requestedResolution / 2.0f ) ) );
1856  }
1857 
1858  //================================================ Find maximum circumference
1859  proshade_unsign maxDim = std::max ( theoXDim, std::max ( theoYDim, theoZDim ) );
1860  proshade_unsign minDim = std::min ( theoXDim, std::min ( theoYDim, theoZDim ) );
1861  proshade_unsign midDim = 0;
1862  if ( ( xDim < maxDim ) && ( xDim > minDim ) ) { midDim = theoXDim; }
1863  else if ( ( yDim < maxDim ) && ( yDim > minDim ) ) { midDim = theoYDim; }
1864  else { midDim = theoZDim; }
1865 
1866  proshade_unsign circ = ( maxDim ) + ( midDim );
1867 
1868  //================================================ Bandwidth
1869  if ( this->rotationUncertainty > 0.0 ) { this->determineBandwidthFromAngle ( this->rotationUncertainty ); }
1870  else { this->determineBandwidth ( circ ); }
1871 
1872  //================================================ Find maximum diagonal in Angstroms
1873  proshade_single maxDiag = static_cast< proshade_single > ( std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) +
1874  std::pow ( static_cast<proshade_single> ( midDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) ) );
1875 
1876  //================================================ Sphere distances
1877  this->determineSphereDistances ( maxDiag );
1878 
1879  //================================================ Integration order
1880  this->determineIntegrationOrder ( maxDiag );
1881 
1882  //================================================ Report function completion
1883  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 2, "Spherical harmonics environment prepared.", this->messageShift );
1884 
1885  //================================================ Done
1886  return ;
1887 
1888 }
1889 
1897 #if defined ( _WIN64 ) || defined ( _WIN32 )
1898 __declspec(dllexport) ProSHADE_run::ProSHADE_run ( ProSHADE_settings* settings )
1899 #else
1901 #endif
1902 {
1903  //================================================ Wellcome message if required
1905 
1906  //================================================ Save the general information
1907  this->noStructures = static_cast<proshade_unsign> ( settings->inputFiles.size() );
1908  this->verbose = static_cast<proshade_signed> ( settings->verbose );
1909 
1910  //================================================ Try to run ProSHADE
1911  try
1912  {
1913  //============================================ Depending on task, switch to correct function to call
1914  switch ( settings->task )
1915  {
1916  case NA:
1917  throw ProSHADE_exception ( "No task has been specified.", "E000001", __FILE__, __LINE__, __func__, "ProSHADE requires to be told which particular functiona-\n : lity (task) is requested from it. In order to do so, the\n : command line arguments specifying task need to be used\n : (if used from command line), or the ProSHADE_settings\n : object needs to have the member variable \'Task\' set to\n : one of the following values: Distances, Symmetry,\n : OverlayMap or MapManip." );
1918 
1919  case Symmetry:
1920  ProSHADE_internal_tasks::SymmetryDetectionTask ( settings, &this->mapCOMShift, &this->symRecommType, &this->symRecommFold, &this->RecomSymAxes, &this->allCSymAxes );
1921 
1922  break;
1923 
1924  case Distances:
1925  ProSHADE_internal_tasks::DistancesComputationTask ( settings, &this->enLevs, &this->trSigm, &this->rotFun );
1926  break;
1927 
1928  case OverlayMap:
1929  ProSHADE_internal_tasks::MapOverlayTask ( settings, &this->coordRotationCentre, &this->eulerAngles, &this->overlayTranslation );
1930  break;
1931 
1932  case MapManip:
1933  ProSHADE_internal_tasks::MapManipulationTask ( settings, &this->originalBounds, &this->reboxedBounds, &this->manipulatedMaps );
1934  break;
1935  }
1936  }
1937 
1938  //================================================ If this is ProSHADE exception, give all available info and terminate gracefully :-)
1939  catch ( ProSHADE_exception& err )
1940  {
1941  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1942  std::cerr << "Error Code : " << err.get_errc() << std::endl << std::flush;
1943  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
1944  std::cerr << "File : " << err.get_file() << std::endl << std::flush;
1945  std::cerr << "Line : " << err.get_line() << std::endl << std::flush;
1946  std::cerr << "Function : " << err.get_func() << std::endl << std::flush;
1947  std::cerr << "Message : " << err.what() << std::endl << std::flush;
1948  std::cerr << "Further information : " << err.get_info() << std::endl << std::endl << std::flush;
1949 
1950  //============================================ Done
1952  exit ( EXIT_FAILURE );
1953  }
1954 
1955  //================================================ Well, give all there is and just end
1956  catch ( ... )
1957  {
1958  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1959 
1960  //============================================ Try to find out more
1961 #if __cplusplus >= 201103L
1962  std::exception_ptr exc = std::current_exception();
1963  try
1964  {
1965  if (exc)
1966  {
1967  std::rethrow_exception ( exc );
1968  }
1969  }
1970  catch ( const std::exception& e )
1971  {
1972  std::cerr << "Caught unknown exception with following information: " << e.what() << std::endl << std::flush;
1973  }
1974 #else
1975  std::cerr << "Unknown error with no further explanation available. Please contact the author for help." << std::endl << std::flush;
1976 #endif
1977  std::cerr << "Terminating..." << std::endl << std::endl << std::flush;
1978 
1979  //============================================ Done
1981  exit ( EXIT_FAILURE );
1982  }
1983 
1984  //================================================ Terminating message
1986 
1987  //================================================ Done
1988 
1989 }
1990 
1995 #if defined ( _WIN64 ) || defined ( _WIN32 )
1996 __declspec(dllexport) ProSHADE_run::~ProSHADE_run ( )
1997 #else
1999 #endif
2000 {
2001  //================================================ Release reboxing pointers
2002  if ( this->originalBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->originalBounds.size() ); iter++ ) { delete[] this->originalBounds.at(iter); } }
2003  if ( this->reboxedBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->reboxedBounds.size() ); iter++ ) { delete[] this->reboxedBounds.at(iter); } }
2004  if ( this->manipulatedMaps.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->manipulatedMaps.size() ); iter++ ) { delete[] this->manipulatedMaps.at(iter); } }
2005 
2006  //================================================ Clear vectors
2007  this->enLevs.clear ( );
2008  this->trSigm.clear ( );
2009  this->rotFun.clear ( );
2010 
2011  //================================================ Delete symmetry axes memory
2012  if ( this->RecomSymAxes.size() > 0 )
2013  {
2014  for ( size_t iter = 0; iter < this->RecomSymAxes.size(); iter++ )
2015  {
2016  delete[] this->RecomSymAxes.at(iter);
2017  }
2018  this->RecomSymAxes.clear ( );
2019  }
2020 
2021  //================================================ Done
2022 
2023 }
2024 
2029 #if defined ( _WIN64 ) || defined ( _WIN32 )
2030 std::string __declspec(dllexport) ProSHADE_run::getSymmetryType ( )
2031 #else
2033 #endif
2034 
2035 {
2036  //================================================ Return the value
2037  return ( this->symRecommType );
2038 }
2039 
2044 #if defined ( _WIN64 ) || defined ( _WIN32 )
2045 proshade_unsign __declspec(dllexport) ProSHADE_run::getSymmetryFold ( )
2046 #else
2048 #endif
2049 {
2050  //================================================ Return the value
2051  return ( this->symRecommFold );
2052 }
2053 
2060 void ProSHADE_run::setRecommendedSymmetry ( std::string val )
2061 {
2062  //================================================ Set the value
2063  this->symRecommType = val;
2064 
2065  //================================================ Done
2066  return ;
2067 
2068 }
2069 
2077 void ProSHADE_run::setRecommendedFold ( proshade_unsign val )
2078 {
2079  //================================================ Set the value
2080  this->symRecommFold = val;
2081 
2082  //================================================ Done
2083  return ;
2084 
2085 }
2086 
2094 void ProSHADE_run::setRecommendedAxis ( proshade_double* sym )
2095 {
2096  //================================================ Set the value
2097  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->RecomSymAxes, sym );
2098 
2099  //================================================ Done
2100  return ;
2101 
2102 }
2103 
2109 #if defined ( _WIN64 ) || defined ( _WIN32 )
2110 void __declspec(dllexport) ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
2111 #else
2112 void ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
2113 #endif
2114 {
2115  //================================================ If no command line arguments, print help
2116  if ( argc == 1 ) { ProSHADE_internal_messages::printHelp ( ); }
2117 
2118  //================================================ Long options struct
2119  const struct option_port longopts[] =
2120  {
2121  { "version", no_argument, nullptr, 'v' },
2122  { "help", no_argument, nullptr, 'h' },
2123  { "verbose", required_argument, nullptr, '!' },
2124  { "distances", no_argument, nullptr, 'D' },
2125  { "mapManip", no_argument, nullptr, 'M' },
2126  { "symmetry", no_argument, nullptr, 'S' },
2127  { "symCentre", no_argument, nullptr, 'I' },
2128  { "overlay", no_argument, nullptr, 'O' },
2129  { "file", required_argument, nullptr, 'f' },
2130  { "forceSpgP1", no_argument, nullptr, 'u' },
2131  { "removeWaters", no_argument, nullptr, 'w' },
2132  { "firstModel", no_argument, nullptr, 'x' },
2133  { "resolution", required_argument, nullptr, 'r' },
2134  { "bandwidth", required_argument, nullptr, 'b' },
2135  { "sphereDists", required_argument, nullptr, 's' },
2136  { "extraSpace", required_argument, nullptr, 'e' },
2137  { "integOrder", required_argument, nullptr, 'i' },
2138  { "integApprox", required_argument, nullptr, 't' },
2139  { "invertMap", no_argument, nullptr, '@' },
2140  { "normalise", no_argument, nullptr, '#' },
2141  { "mask", no_argument, nullptr, '$' },
2142  { "saveMask", no_argument, nullptr, '%' },
2143  { "maskFile", required_argument, nullptr, '^' },
2144  { "applyMask", required_argument, nullptr, 'G' },
2145  { "maskBlurring", required_argument, nullptr, '&' },
2146  { "maskThreshold", required_argument, nullptr, '*' },
2147  { "mapReboxing", no_argument, nullptr, 'R' },
2148  { "boundsSpace", required_argument, nullptr, '(' },
2149  { "boundsThreshold", required_argument, nullptr, ')' },
2150  { "sameBoundaries", no_argument, nullptr, '-' },
2151  { "reBoxedFilename", required_argument, nullptr, 'g' },
2152  { "pdbTempFact", required_argument, nullptr, 'd' },
2153  { "center", no_argument, nullptr, 'c' },
2154  { "changeMapResol", no_argument, nullptr, 'j' },
2155  { "changeMapTriLin", no_argument, nullptr, 'a' },
2156  { "oversamplRate", required_argument, nullptr, 'K' },
2157  { "noPhase", no_argument, nullptr, 'p' },
2158  { "progressive", no_argument, nullptr, 'k' },
2159  { "noEnL", no_argument, nullptr, 'l' },
2160  { "noTrS", no_argument, nullptr, 'm' },
2161  { "noFRF", no_argument, nullptr, 'n' },
2162  { "EnLWeight", required_argument, nullptr, '_' },
2163  { "peakNeigh", required_argument, nullptr, '=' },
2164  { "peakThres", required_argument, nullptr, '+' },
2165  { "missAxThres", required_argument, nullptr, '[' },
2166  { "sameAxComp", required_argument, nullptr, ']' },
2167  { "axisComBeh", no_argument, nullptr, 'q' },
2168  { "bicubSearch", no_argument, nullptr, 'A' },
2169  { "maxSymPrime", required_argument, nullptr, 'B' },
2170  { "minPeakHeight", required_argument, nullptr, 'o' },
2171  { "fscThres", required_argument, nullptr, 'C' },
2172  { "peakMinThres", required_argument, nullptr, 'E' },
2173  { "reqSym", required_argument, nullptr, '{' },
2174  { "overlayFile", required_argument, nullptr, '}' },
2175  { "overlayJSONFile", required_argument, nullptr, 'y' },
2176  { "angUncertain", required_argument, nullptr, ';' },
2177  { "maxRadius", required_argument, nullptr, 'J' },
2178  { "fourierWeights", required_argument, nullptr, 'z' },
2179  { "keepNegDens", no_argument, nullptr, 'F' },
2180  { "coordExtraSpace", required_argument, nullptr, 'H' },
2181  { nullptr, 0, nullptr, 0 }
2182  };
2183 
2184  //================================================ Short options string
2185  const char* const shortopts = "AaB:b:C:cDd:E:e:Ff:G:g:H:hIi:J:jK:klmMno:Opqr:Rs:St:uvwxy:z:!:@#$%^:&:*:(:):-_:=:+:[:]:{:}:;:";
2186 
2187  //================================================ Parsing the options
2188  while ( true )
2189  {
2190  //============================================ Read the next option
2191  int opt = getopt_long_port ( argc, argv, shortopts, longopts, nullptr );
2192 
2193  //============================================ Done parsing
2194  if ( opt == -1 )
2195  {
2196  break;
2197  }
2198 
2199  //============================================ For each option, set the internal values appropriately
2200  switch ( opt )
2201  {
2202  //======================================= Print version info
2203  case 'v':
2204  {
2206  exit ( EXIT_SUCCESS );
2207  }
2208 
2209  //======================================= User needs help
2210  case 'h':
2211  {
2213  }
2214 
2215  //======================================= Save the argument as the verbosity value, or if no value given, just set to 3
2216  case '!':
2217  {
2218  this->setVerbosity ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
2219  continue;
2220  }
2221 
2222  //======================================= Set task to distances
2223  case 'D':
2224  {
2225  this->task = Distances;
2226  continue;
2227  }
2228 
2229  //======================================= Set task to map manipulation
2230  case 'M':
2231  {
2232  this->task = MapManip;
2233  continue;
2234  }
2235 
2236  //======================================= Set task to symmetry detection
2237  case 'S':
2238  {
2239  this->task = Symmetry;
2240 
2241  //=================================== Force default unless changed already by the user
2242  const FloatingPoint< proshade_single > lhs1 ( this->requestedResolution ), rhs1 ( -1.0f );
2243  if ( lhs1.AlmostEquals ( rhs1 ) ) { this->requestedResolution = 6.0; }
2244 
2245  const FloatingPoint< proshade_double > lhs2 ( this->pdbBFactorNewVal ), rhs2 ( -1.0 );
2246  if ( lhs2.AlmostEquals ( rhs2 ) ) { this->pdbBFactorNewVal = 80.0; }
2247  this->changeMapResolution = !this->changeMapResolution; // Switch value. This can be over-ridden by the user by using -j
2248  this->moveToCOM = !this->moveToCOM; // Switch value. This can be over-ridden by the user by using -c.
2249 
2250  continue;
2251  }
2252 
2253  //======================================= Set task to map overlay
2254  case 'O':
2255  {
2256  this->task = OverlayMap;
2257  continue;
2258  }
2259 
2260  //======================================= Save the argument as a file to read in
2261  case 'f':
2262  {
2263  this->addStructure ( std::string ( optarg ) );
2264  continue;
2265  }
2266 
2267  //======================================= Force the input PDB files to have P1 spacegroup
2268  case 'u':
2269  {
2270  this->forceP1 = !this->forceP1;
2271  continue;
2272  }
2273 
2274  //======================================= Remove waters from PDB input files?
2275  case 'w':
2276  {
2277  this->removeWaters = !this->removeWaters;
2278  continue;
2279  }
2280 
2281  //======================================= Use all models, or just the first one?
2282  case 'x':
2283  {
2284  this->firstModelOnly = !this->firstModelOnly;
2285  continue;
2286  }
2287 
2288  //======================================= Save the argument as the resolution value
2289  case 'r':
2290  {
2291  this->setResolution ( static_cast<proshade_single> ( atof ( optarg ) ) );
2292  continue;
2293  }
2294 
2295  //======================================= Save the argument as the bandwidth value
2296  case 'b':
2297  {
2298  this->setBandwidth ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2299  continue;
2300  }
2301 
2302  //======================================= Save the argument as the extra space value
2303  case 'e':
2304  {
2305  this->setExtraSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2306  continue;
2307  }
2308 
2309  //======================================= Save the argument as the co-ordinate extra space value
2310  case 'H':
2311  {
2312  this->setCoordExtraSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2313  continue;
2314  }
2315 
2316  //======================================= Save the argument as the intaggration order value
2317  case 'i':
2318  {
2319  this->setIntegrationOrder ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2320  continue;
2321  }
2322 
2323  //======================================= Save the argument as the sphere distance value
2324  case 's':
2325  {
2326  this->setSphereDistances ( static_cast<proshade_single> ( atof ( optarg ) ) );
2327  continue;
2328  }
2329 
2330  //======================================= Save the argument as the number of steps for Legendre polynomial decomposition onto terms approximation
2331  case 't':
2332  {
2333  this->setIntegrationApproxSteps ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2334  continue;
2335  }
2336 
2337  //======================================= Set map inversion to true
2338  case '@':
2339  {
2340  this->setMapInversion ( true );
2341  continue;
2342  }
2343 
2344  //======================================= Set map normalisation to true
2345  case '#':
2346  {
2347  this->setNormalisation ( true );
2348  continue;
2349  }
2350 
2351  //======================================= Set map masking to true
2352  case '$':
2353  {
2354  this->setMasking ( true );
2355  continue;
2356  }
2357 
2358  //======================================= Set map masking to true and mask map saving to true as well
2359  case '%':
2360  {
2361  this->setMasking ( true );
2362  this->setMaskSaving ( true );
2363  continue;
2364  }
2365 
2366  //======================================= Save the argument as the mask filename value
2367  case '^':
2368  {
2369  this->setMaskFilename ( static_cast<std::string> ( optarg ) );
2370  continue;
2371  }
2372 
2373  //======================================= Save the argument as the mask filename value
2374  case 'G':
2375  {
2376  this->setAppliedMaskFilename ( static_cast<std::string> ( optarg ) );
2377  continue;
2378  }
2379 
2380  //======================================= Save the argument as the Fourier weights filename value
2381  case 'z':
2382  {
2383  this->setFourierWeightsFilename ( static_cast<std::string> ( optarg ) );
2384  continue;
2385  }
2386 
2387  //======================================= Save the argument as the mask blurring factor value
2388  case '&':
2389  {
2390  this->setMaskBlurFactor ( static_cast<proshade_single> ( atof ( optarg ) ) );
2391  continue;
2392  }
2393 
2394  //======================================= Save the argument as the mask threshold (IQR) value
2395  case '*':
2396  {
2397  this->setMaskIQR ( static_cast<proshade_single> ( atof ( optarg ) ) );
2398  continue;
2399  }
2400 
2401  //======================================= Set map reboxing to true
2402  case 'R':
2403  {
2404  this->setMasking ( true );
2405  this->setMapReboxing ( true );
2406  continue;
2407  }
2408 
2409  //======================================= Save the argument as the bounds extra space value
2410  case '(':
2411  {
2412  this->setBoundsSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2413  continue;
2414  }
2415 
2416  //======================================= Save the argument as the bounds similarity threshold value
2417  case ')':
2418  {
2419  this->setBoundsThreshold ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
2420  continue;
2421  }
2422 
2423  //======================================= Set same boundaries to true
2424  case '-':
2425  {
2426  this->setSameBoundaries ( true );
2427  continue;
2428  }
2429 
2430  //======================================= Save the argument as the re-boxed structure filename value
2431  case 'g':
2432  {
2433  this->setOutputFilename ( static_cast<std::string> ( optarg ) );
2434  continue;
2435  }
2436 
2437  //======================================= Save the argument as the PDB B-factor new constant value
2438  case 'd':
2439  {
2440  this->setPDBBFactor ( static_cast<proshade_double> ( atof ( optarg ) ) );
2441  continue;
2442  }
2443 
2444  //======================================= Set map centering to true
2445  case 'c':
2446  {
2447  this->moveToCOM = !this->moveToCOM;
2448  continue;
2449  }
2450 
2451  //======================================= Set map resolution change using Fourier transforms to true
2452  case 'j':
2453  {
2454  this->changeMapResolution = !this->changeMapResolution;
2455  continue;
2456  }
2457 
2458  //======================================= Set map resolution change using real-space tri-linear interpolation to true
2459  case 'a':
2460  {
2461  this->setMapResolutionChangeTriLinear ( true );
2462  continue;
2463  }
2464 
2465  //======================================= Set map resolution over-sampling rate
2466  case 'K':
2467  {
2468  this->setMapResolutionOverSampling ( static_cast< proshade_single > ( atof ( optarg ) ) );
2469  continue;
2470  }
2471 
2472  //======================================= Set map phase removal to true
2473  case 'p':
2474  {
2475  this->setPhaseUsage ( false );
2476  continue;
2477  }
2478 
2479  //======================================= Set progressive shell mapping to true
2480  case 'k':
2481  {
2482  this->setProgressiveSphereMapping ( false );
2483  continue;
2484  }
2485 
2486  //======================================= Set energy level descriptor computation to false
2487  case 'l':
2488  {
2489  this->setEnergyLevelsComputation ( false );
2490  continue;
2491  }
2492 
2493  //======================================= Set trace sigma descriptor computation to false
2494  case 'm':
2495  {
2496  this->setTraceSigmaComputation ( false );
2497  continue;
2498  }
2499 
2500  //======================================= Set full rotation function descriptor computation to false
2501  case 'n':
2502  {
2503  this->setRotationFunctionComputation ( false );
2504  continue;
2505  }
2506 
2507  //======================================= Save the argument as the energy levels descriptor weight value
2508  case '_':
2509  {
2510  this->setEnLevShellWeight ( static_cast<proshade_double> ( atof ( optarg ) ) );
2511  continue;
2512  }
2513 
2514  //======================================= Save the argument as the peak neighbours minimum value
2515  case '=':
2516  {
2517  this->setPeakNeighboursNumber ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2518  continue;
2519  }
2520 
2521  //======================================= Save the argument as the peak IQR from median naive small peaks removal value
2522  case '+':
2523  {
2524  this->setPeakNaiveNoIQR ( static_cast<proshade_double> ( atof ( optarg ) ) );
2525  continue;
2526  }
2527 
2528  //======================================= Save the argument as the symmetry centre search required value
2529  case 'I':
2530  {
2531  this->setSymmetryCentreSearch ( true );
2532  continue;
2533  }
2534 
2535  //======================================= Save the argument as the missing axis threshold value
2536  case '[':
2537  {
2538  this->setMissingPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2539  continue;
2540  }
2541 
2542  //======================================= Save the argument as the missing axis threshold value
2543  case ']':
2544  {
2545  setAxisComparisonThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2546  continue;
2547  }
2548 
2549  //======================================= Save the argument as the missing axis threshold value
2550  case 'q':
2551  {
2552  this->setAxisComparisonThresholdBehaviour ( !this->axisErrToleranceDefault );
2553  continue;
2554  }
2555 
2556  //======================================= Save the argument as the bicubic interpolation search requirement value
2557  case 'A':
2558  {
2559  this->setBicubicInterpolationSearch ( !this->useBiCubicInterpolationOnPeaks );
2560  continue;
2561  }
2562 
2563  //======================================= Save the argument as the bicubic interpolation search requirement value
2564  case 'B':
2565  {
2566  setMaxSymmetryFold ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2567  continue;
2568  }
2569 
2570  //======================================= Minimum peak height for axis
2571  case 'o':
2572  {
2573  this->minSymPeak = static_cast<proshade_double> ( atof ( optarg ) );
2574  continue;
2575  }
2576 
2577  //======================================= Minimum FSC value for axis to be detected
2578  case 'C':
2579  {
2580  this->setFSCThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2581  continue;
2582  }
2583 
2584  //======================================= Minimum peak height value for axis to be considered possible
2585  case 'E':
2586  {
2587  this->setPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2588  continue;
2589  }
2590 
2591  //======================================= Save the argument as the requested symmetry and potentially fold value
2592  case '{':
2593  {
2594  std::string input = static_cast<std::string> ( optarg );
2595 
2596  if ( input.at(0) == 'C' )
2597  {
2598  this->setRequestedSymmetry ( "C" );
2599 
2600  std::string numHlp ( input.begin()+1, input.end() );
2601  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2602  else { std::cerr << "!!! ProSHADE ERROR !!! The input argument requests search for Cyclic/Dihedral symmetry, but does not specify the requested fold." << std::endl; exit ( EXIT_FAILURE ); }
2603  }
2604  else
2605  {
2606  if ( input.at(0) == 'D' )
2607  {
2608  this->setRequestedSymmetry ( "D" );
2609 
2610  std::string numHlp ( input.begin()+1, input.end() );
2611  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2612  else { std::cerr << "!!! ProSHADE ERROR !!! The input argument requests search for Cyclic/Dihedral symmetry, but does not specify the requested fold." << std::endl; exit ( EXIT_FAILURE ); }
2613  }
2614  else
2615  {
2616  if ( input.at(0) == 'T' )
2617  {
2618  this->setRequestedSymmetry ( "T" );
2619  }
2620  else
2621  {
2622  if ( input.at(0) == 'O' )
2623  {
2624  this->setRequestedSymmetry ( "O" );
2625  }
2626  else
2627  {
2628  if ( input.at(0) == 'I' )
2629  {
2630  this->setRequestedSymmetry ( "I" );
2631  }
2632  else
2633  {
2634  std::cerr << "!!! ProSHADE ERROR !!! Failed to parse the requested symmetry type. Allowed types are C, D, T, O and I, with C and D requiring to be followed by a number specifying the fold." << std::endl; exit ( EXIT_FAILURE );
2635  }
2636  }
2637  }
2638  }
2639  }
2640 
2641  continue;
2642  }
2643 
2644  //======================================= Save the argument as filename to save the overlay moved structure to value
2645  case '}':
2646  {
2647  this->setOverlaySaveFile ( static_cast<std::string> ( optarg ) );
2648  continue;
2649  }
2650 
2651  //======================================= Save the argument as filename to save the overlay operations to value
2652  case 'y':
2653  {
2654  this->setOverlayJsonFile ( static_cast<std::string> ( optarg ) );
2655  continue;
2656  }
2657 
2658  //======================================= Save the argument as angular uncertainty for bandwidth determination
2659  case ';':
2660  {
2661  this->rotationUncertainty = static_cast<proshade_double> ( atof ( optarg ) );
2662  continue;
2663  }
2664 
2665  //======================================= Save the argument as maximum map radius to be used
2666  case 'J':
2667  {
2668  this->maxRadius = static_cast< proshade_double > ( atof ( optarg ) );
2669  continue;
2670  }
2671 
2672  //======================================= Should the negative density from input files be removed?
2673  case 'F':
2674  {
2675  this->setNegativeDensity ( false );
2676  continue;
2677  }
2678 
2679  //======================================= Unknown option
2680  case '?':
2681  {
2682  //=================================== Save the argument as angular uncertainty for bandwidth determination
2683  if ( optopt )
2684  {
2685  std::cout << "!!! ProSHADE ERROR !!! Unrecognised short option -" << static_cast<char> ( optopt ) << " . Please use -h for help on the command line options." << std::endl;
2686  }
2687  else
2688  {
2689  std::cout << "!!! ProSHADE ERROR !!! Unrecognised long option " << argv[static_cast<int> (optind)-1] << " . Please use -h for help on the command line options." << std::endl;
2690  }
2691 
2692  //=================================== This case is handled by getopt_long, nothing more needed.
2693  exit ( EXIT_SUCCESS );
2694  }
2695 
2696  //======================================= Fallback option
2697  default:
2698  {
2700  }
2701  }
2702  }
2703 
2704  //================================================ Done
2705  return ;
2706 
2707 }
2708 
2713 #if defined ( _WIN64 ) || defined ( _WIN32 )
2714 void __declspec(dllexport) ProSHADE_settings::printSettings ( )
2715 #else
2717 #endif
2718 {
2719  //================================================ Print the currest values in the settings object
2720  //== Settings regarding the task at hand
2721  std::stringstream strstr;
2722  strstr.str(std::string());
2723  if ( this->task == NA ) { strstr << "NA"; }
2724  if ( this->task == Distances ) { strstr << "DISTANCES COMPUTATION"; }
2725  if ( this->task == MapManip ) { strstr << "MAP MANIPULATION"; }
2726  if ( this->task == Symmetry ) { strstr << "SYMMETRY DETECTION"; }
2727  if ( this->task == OverlayMap ) { strstr << "MAP OVERLAY"; }
2728  printf ( "Task to perform : %37s\n", strstr.str().c_str() );
2729 
2730  //== Settings regarding the input files
2731  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->inputFiles.size() ); iter++ )
2732  {
2733  strstr.str(std::string());
2734  strstr << this->inputFiles.at(iter);
2735  printf ( "File(s) to process : %37s\n", strstr.str().c_str() );
2736  }
2737 
2738  strstr.str(std::string());
2739  if ( this->forceP1 ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2740  printf ( "Force P1 spacegroup : %37s\n", strstr.str().c_str() );
2741 
2742  strstr.str(std::string());
2743  if ( this->removeWaters ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2744  printf ( "Waters removed : %37s\n", strstr.str().c_str() );
2745 
2746  strstr.str(std::string());
2747  if ( this->firstModelOnly ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2748  printf ( "Only 1st model : %37s\n", strstr.str().c_str() );
2749 
2750  strstr.str(std::string());
2751  if ( this->removeNegativeDensity ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2752  printf ( "Remove neg. dens. : %37s\n", strstr.str().c_str() );
2753 
2754  //== Settings regarding the resolution of calculations
2755  strstr.str(std::string());
2756  strstr << this->requestedResolution;
2757  printf ( "Resolution (comp) : %37s\n", strstr.str().c_str() );
2758 
2759  strstr.str(std::string());
2760  if ( this->changeMapResolution ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2761  printf ( "Change map resol : %37s\n", strstr.str().c_str() );
2762 
2763  strstr.str(std::string());
2764  if ( this->changeMapResolutionTriLinear ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2765  printf ( "Change map tri-lin : %37s\n", strstr.str().c_str() );
2766 
2767  strstr.str(std::string());
2768  strstr << this->resolutionOversampling;
2769  printf ( "Resolution oversampl: %37s\n", strstr.str().c_str() );
2770 
2771  //== Settings regarding the PDB B-factor change
2772  strstr.str(std::string());
2773  strstr << this->pdbBFactorNewVal;
2774  printf ( "PDB B-factor const : %37s\n", strstr.str().c_str() );
2775 
2776  //== Settings regarding the bandwidth of calculations
2777  strstr.str(std::string());
2778  strstr << this->maxBandwidth;
2779  printf ( "Bandwidth : %37s\n", strstr.str().c_str() );
2780 
2781  strstr.str(std::string());
2782  strstr << this->rotationUncertainty;
2783  printf ( "Rotation doubt : %37s\n", strstr.str().c_str() );
2784 
2785  //== Settings regarding the phase
2786  strstr.str(std::string());
2787  if ( this->usePhase ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2788  printf ( "Use phase info : %37s\n", strstr.str().c_str() );
2789 
2790  //== Settings regarding the spheres
2791  strstr.str(std::string());
2792  strstr << this->maxSphereDists;
2793  printf ( "Sphere distances : %37s\n", strstr.str().c_str() );
2794 
2795  //== Settings regarding the Gauss-Legendre integration
2796  strstr.str(std::string());
2797  strstr << this->integOrder;
2798  printf ( "Integration order : %37s\n", strstr.str().c_str() );
2799 
2800  //== Settings regarding integration approximation steps
2801  strstr.str(std::string());
2802  strstr << this->integApproxSteps;
2803  printf ( "Integ. approx. steps: %37s\n", strstr.str().c_str() );
2804 
2805  //== Settings regarding integration speedup
2806  strstr.str(std::string());
2807  if ( this->noIntegrationSpeedup ) { strstr << "FALSE"; } else { strstr << "TRUE"; }
2808  printf ( "Integration speedup : %37s\n", strstr.str().c_str() );
2809 
2810  //== Settings regarding map normalisation
2811  strstr.str(std::string());
2812  if ( this->normaliseMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2813  printf ( "Map normalisation : %37s\n", strstr.str().c_str() );
2814 
2815  //== Settings regarding map inversion
2816  strstr.str(std::string());
2817  if ( this->invertMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2818  printf ( "Map inversion : %37s\n", strstr.str().c_str() );
2819 
2820  //== Settings regarding map masking
2821  strstr.str(std::string());
2822  strstr << this->blurFactor;
2823  printf ( "Map blurring : %37s\n", strstr.str().c_str() );
2824 
2825  strstr.str(std::string());
2826  strstr << this->maskingThresholdIQRs;
2827  printf ( "Masking threshold : %37s\n", strstr.str().c_str() );
2828 
2829  strstr.str(std::string());
2830  if ( this->maskMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2831  printf ( "Map masking : %37s\n", strstr.str().c_str() );
2832 
2833  strstr.str(std::string());
2834  if ( this->useCorrelationMasking ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2835  printf ( "Correlation mask : %37s\n", strstr.str().c_str() );
2836 
2837  strstr.str(std::string());
2838  strstr << this->halfMapKernel;
2839  printf ( "Half-map kernel : %37s\n", strstr.str().c_str() );
2840 
2841  strstr.str(std::string());
2842  strstr << this->correlationKernel;
2843  printf ( "Correlation kernel : %37s\n", strstr.str().c_str() );
2844 
2845  strstr.str(std::string());
2846  if ( this->saveMask ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2847  printf ( "Saving mask : %37s\n", strstr.str().c_str() );
2848 
2849  strstr.str(std::string());
2850  strstr << this->maskFileName;
2851  printf ( "Map mask filename : %37s\n", strstr.str().c_str() );
2852 
2853  strstr.str(std::string());
2854  strstr << this->calcBounds.at(0) << " | " << this->calcBounds.at(1) << " | " << this->calcBounds.at(2);
2855  printf ( "Calculation bounds : %37s\n", strstr.str().c_str() );
2856 
2857  //== Settings regarding re-boxing
2858  strstr.str(std::string());
2859  if ( this->reBoxMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2860  printf ( "Map re-boxing : %37s\n", strstr.str().c_str() );
2861 
2862  strstr.str(std::string());
2863  strstr << this->boundsExtraSpace;
2864  printf ( "Bounds extra space : %37s\n", strstr.str().c_str() );
2865 
2866  strstr.str(std::string());
2867  strstr << this->boundsSimilarityThreshold;
2868  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2869 
2870  strstr.str(std::string());
2871  if ( this->useSameBounds ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2872  printf ( "Same boundaries : %37s\n", strstr.str().c_str() );
2873 
2874  strstr.str(std::string());
2875  if ( this->forceBounds != nullptr )
2876  {
2877  strstr << this->forceBounds[0] << " - " << this->forceBounds[1] << " | " << this->forceBounds[2] << " - " << this->forceBounds[3] << " | " << this->forceBounds[4] << " - " << this->forceBounds[5];
2878  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2879  }
2880  else
2881  {
2882  strstr << "Not allocated";
2883  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2884  }
2885 
2886  //== Settings regarding COM
2887  strstr.str(std::string());
2888  if ( this->moveToCOM ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2889  printf ( "Map COM centering : %37s\n", strstr.str().c_str() );
2890 
2891  strstr.str(std::string());
2892  strstr << this->boxCentre.at(0) << " ; " << this->boxCentre.at(1) << " ; " << this->boxCentre.at(2);
2893  printf ( "BOX centering : %37s\n", strstr.str().c_str() );
2894 
2895  //== Settings regarding extra cell space
2896  strstr.str(std::string());
2897  strstr << this->addExtraSpace;
2898  printf ( "Extra space : %37s\n", strstr.str().c_str() );
2899 
2900  strstr.str(std::string());
2901  strstr << this->coOrdsExtraSpace;
2902  printf ( "Extra co-ord space : %37s\n", strstr.str().c_str() );
2903 
2904  //== Settings regarding shell settings
2905  strstr.str(std::string());
2906  if ( this->progressiveSphereMapping ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2907  printf ( "Progressive spheres : %37s\n", strstr.str().c_str() );
2908 
2909  //== Settings regarding output file name
2910  strstr.str(std::string());
2911  strstr << this->outName;
2912  printf ( "Re-boxed filename : %37s\n", strstr.str().c_str() );
2913 
2914  //== Settings regarding distances computation
2915  strstr.str(std::string());
2916  if ( this->computeEnergyLevelsDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2917  printf ( "Energy lvl desc : %37s\n", strstr.str().c_str() );
2918 
2919  strstr.str(std::string());
2920  strstr << this->enLevMatrixPowerWeight;
2921  printf ( "Energy lvl weight : %37s\n", strstr.str().c_str() );
2922 
2923  strstr.str(std::string());
2924  if ( this->findSymCentre ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2925  printf ( "Symmetry centre : %37s\n", strstr.str().c_str() );
2926 
2927  strstr.str(std::string());
2928  if ( this->computeTraceSigmaDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2929  printf ( "Tr sigma desc : %37s\n", strstr.str().c_str() );
2930 
2931  strstr.str(std::string());
2932  if ( this->computeRotationFuncDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2933  printf ( "Full RF desc : %37s\n", strstr.str().c_str() );
2934 
2935  //== Settings regarding peak searching
2936  strstr.str(std::string());
2937  strstr << this->peakNeighbours;
2938  printf ( "Neightbours to peak : %37s\n", strstr.str().c_str() );
2939 
2940  strstr.str(std::string());
2941  strstr << this->noIQRsFromMedianNaivePeak;
2942  printf ( "Peak IQR threshold : %37s\n", strstr.str().c_str() );
2943 
2944  //== Settings regarding 1D grouping
2945  strstr.str(std::string());
2946  strstr << this->smoothingFactor;
2947  printf ( "Smoothing factor : %37s\n", strstr.str().c_str() );
2948 
2949  //== Settings regarding the symmetry detection
2950  strstr.str(std::string());
2951  strstr << this->symMissPeakThres;
2952  printf ( "Missing ax. thres : %37s\n", strstr.str().c_str() );
2953 
2954  strstr.str(std::string());
2955  strstr << this->axisErrTolerance;
2956  printf ( "Same ax. threshold : %37s\n", strstr.str().c_str() );
2957 
2958  strstr.str(std::string());
2959  if ( this->axisErrToleranceDefault ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2960  printf ( "Same ax. thre. decr.: %37s\n", strstr.str().c_str() );
2961 
2962  strstr.str(std::string());
2963  strstr << this->minSymPeak;
2964  printf ( "Min. sym. peak size : %37s\n", strstr.str().c_str() );
2965 
2966  strstr.str(std::string());
2967  strstr << this->requestedSymmetryType << "-" << this->requestedSymmetryFold;
2968  printf ( "Requested symm. : %37s\n", strstr.str().c_str() );
2969 
2970  strstr.str(std::string());
2971  if ( this->useBiCubicInterpolationOnPeaks ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2972  printf ( "Use bicubic interp. : %37s\n", strstr.str().c_str() );
2973 
2974  strstr.str(std::string());
2975  strstr << this->maxSymmetryFold;
2976  printf ( "Max symmetry fold : %37s\n", strstr.str().c_str() );
2977 
2978  strstr.str(std::string());
2979  strstr << this->fscThreshold;
2980  printf ( "FSC Threshold : %37s\n", strstr.str().c_str() );
2981 
2982  strstr.str(std::string());
2983  strstr << this->peakThresholdMin;
2984  printf ( "Peak Threshold : %37s\n", strstr.str().c_str() );
2985 
2986  strstr.str(std::string());
2987  if ( this->fastISearch ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2988  printf ( "Fast I Search : %37s\n", strstr.str().c_str() );
2989 
2990  //== Settings regarding the structure overlay
2991  strstr.str(std::string());
2992  strstr << this->overlayStructureName;
2993  printf ( "Overlay file : %37s\n", strstr.str().c_str() );
2994 
2995  strstr.str(std::string());
2996  strstr << this->rotTrsJSONFile;
2997  printf ( "JSON overlay file : %37s\n", strstr.str().c_str() );
2998 
2999  //== Settings regarding verbosity of the program
3000  strstr.str(std::string());
3001  strstr << this->verbose;
3002  printf ( "Verbosity : %37s\n", strstr.str().c_str() );
3003 
3004  //================================================ Done
3005  return ;
3006 
3007 }
3008 
3013 #if defined ( _WIN64 ) || defined ( _WIN32 )
3014 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEnergyLevelsVector ( )
3015 #else
3016 std::vector< proshade_double > ProSHADE_run::getEnergyLevelsVector ( )
3017 #endif
3018 {
3019  //================================================ Return the value
3020  return ( this->enLevs );
3021 }
3022 
3027 #if defined ( _WIN64 ) || defined ( _WIN32 )
3028 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTraceSigmaVector ( )
3029 #else
3030 std::vector< proshade_double > ProSHADE_run::getTraceSigmaVector ( )
3031 #endif
3032 {
3033  //================================================ Return the value
3034  return ( this->trSigm );
3035 }
3036 
3041 #if defined ( _WIN64 ) || defined ( _WIN32 )
3042 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getRotationFunctionVector ( )
3043 #else
3044 std::vector< proshade_double > ProSHADE_run::getRotationFunctionVector ( )
3045 #endif
3046 {
3047  //================================================ Return the value
3048  return ( this->rotFun );
3049 }
3050 
3056 {
3057  //================================================ Return the value
3058  return ( this->noStructures );
3059 }
3060 
3065 proshade_signed ProSHADE_run::getVerbose ( )
3066 {
3067  //================================================ Return the value
3068  return ( this->verbose );
3069 }
3070 
3076 {
3077  //================================================ Return the value
3078  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
3079 }
3080 
3086 {
3087  //================================================ Return the value
3088  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
3089 }
3090 
3096 #if defined ( _WIN64 ) || defined ( _WIN32 )
3097 std::vector< std::string > __declspec(dllexport) ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
3098 #else
3099 std::vector< std::string > ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
3100 #endif
3101 {
3102  //================================================ Sanity checks
3103  if ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) <= axisNo )
3104  {
3105  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
3106  return ( std::vector< std::string > ( ) );
3107  }
3108 
3109  //================================================ Initialise local variables
3110  std::vector< std::string > ret;
3111 
3112  //================================================ Input the axis data as strings
3113  std::stringstream ssHlp;
3114  ssHlp << this->RecomSymAxes.at(axisNo)[0];
3115  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3116  ssHlp.str ( "" );
3117 
3118  ssHlp << this->RecomSymAxes.at(axisNo)[1];
3119  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3120  ssHlp.str ( "" );
3121 
3122  ssHlp << this->RecomSymAxes.at(axisNo)[2];
3123  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3124  ssHlp.str ( "" );
3125 
3126  ssHlp << this->RecomSymAxes.at(axisNo)[3];
3127  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3128  ssHlp.str ( "" );
3129 
3130  ssHlp << this->RecomSymAxes.at(axisNo)[4];
3131  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3132  ssHlp.str ( "" );
3133 
3134  ssHlp << this->RecomSymAxes.at(axisNo)[5];
3135  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3136  ssHlp.str ( "" );
3137 
3138  ssHlp << this->RecomSymAxes.at(axisNo)[6];
3139  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3140  ssHlp.str ( "" );
3141 
3142  //================================================ Done
3143  return ( ret );
3144 
3145 }
3146 
3151 #if defined ( _WIN64 ) || defined ( _WIN32 )
3152 std::vector < std::vector< proshade_double > > __declspec(dllexport) ProSHADE_run::getAllCSyms ( )
3153 #else
3154 std::vector < std::vector< proshade_double > > ProSHADE_run::getAllCSyms ( )
3155 #endif
3156 {
3157  //================================================ Done
3158  return ( this->allCSymAxes );
3159 
3160 }
3161 
3166 #if defined ( _WIN64 ) || defined ( _WIN32 )
3167 std::vector < proshade_double > __declspec(dllexport) ProSHADE_run::getMapCOMProcessChange ( )
3168 #else
3169 std::vector < proshade_double > ProSHADE_run::getMapCOMProcessChange ( )
3170 #endif
3171 {
3172  //================================================ Done
3173  return ( this->mapCOMShift );
3174 
3175 }
3176 
3181 #if defined ( _WIN64 ) || defined ( _WIN32 )
3182 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
3183 #else
3184 std::vector< proshade_signed > ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
3185 #endif
3186 {
3187  //================================================ Sanity checks
3188  if ( noStructures <= strNo )
3189  {
3190  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3191  return ( std::vector< proshade_signed > ( ) );
3192  }
3193 
3194  //================================================ Initialise local variables
3195  std::vector< proshade_signed > ret;
3196 
3197  //================================================ Input the axis data as strings
3198  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[0] );
3199  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[1] );
3200  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[2] );
3201  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[3] );
3202  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[4] );
3203  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[5] );
3204 
3205  //================================================ Done
3206  return ( ret );
3207 }
3208 
3213 #if defined ( _WIN64 ) || defined ( _WIN32 )
3214 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
3215 #else
3216 std::vector< proshade_signed > ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
3217 #endif
3218 {
3219  //================================================ Sanity checks
3220  if ( noStructures <= strNo )
3221  {
3222  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3223  return ( std::vector< proshade_signed > ( ) );
3224  }
3225 
3226  //================================================ Initialise local variables
3227  std::vector< proshade_signed > ret;
3228 
3229  //================================================ Input the axis data as strings
3230  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[0] );
3231  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[1] );
3232  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[2] );
3233  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[3] );
3234  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[4] );
3235  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[5] );
3236 
3237  //================================================ Done
3238  return ( ret );
3239 }
3240 
3247 #if defined ( _WIN64 ) || defined ( _WIN32 )
3248 proshade_double __declspec(dllexport) ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
3249 #else
3250 proshade_double ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
3251 #endif
3252 {
3253  //================================================ Return the value
3254  return ( this->manipulatedMaps.at(strNo)[mapIndex] );
3255 }
3256 
3264 #if defined ( _WIN64 ) || defined ( _WIN32 )
3265 void __declspec(dllexport) getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
3266 #else
3267 void getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
3268 #endif
3269 {
3270  //================================================ Sanity checks
3271  if ( run->getNoStructures() <= strNo )
3272  {
3273  ProSHADE_internal_messages::printWarningMessage ( run->getVerbose(), "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3274  return ;
3275  }
3276 
3277  //================================================ Save the data into the output array
3278  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++)
3279  {
3280  reboxMap[iter] = static_cast<double> ( run->getMapValue ( strNo, iter ) );
3281  }
3282 
3283  //================================================ Done
3284  return ;
3285 
3286 }
3287 
3292 #if defined ( _WIN64 ) || defined ( _WIN32 )
3293 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEulerAngles ( )
3294 #else
3295 std::vector< proshade_double > ProSHADE_run::getEulerAngles ( )
3296 #endif
3297 {
3298  //================================================ Sanity check
3299  if ( this->eulerAngles.size() != 3 )
3300  {
3301  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested rotation/translation values for Overlay functionality without having successfully computed it. Please check the correct task was used and no other warnings/errors were obtained.", "WO00042" );
3302  return ( std::vector< proshade_double > ( ) );
3303  }
3304 
3305  //================================================ Return required value
3306  return ( this->eulerAngles );
3307 
3308 }
3309 
3314 #if defined ( _WIN64 ) || defined ( _WIN32 )
3315 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOptimalRotMat ( )
3316 #else
3317 std::vector< proshade_double > ProSHADE_run::getOptimalRotMat ( )
3318 #endif
3319 {
3320  //================================================ Sanity check
3321  if ( this->eulerAngles.size() != 3 )
3322  {
3323  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested rotation/translation values for Overlay functionality without having successfully computed it. Please check the correct task was used and no other warnings/errors were obtained.", "WO00042" );
3324  return ( std::vector< proshade_double > ( ) );
3325  }
3326 
3327  //================================================ Obtain the optimal rotation matrix
3328  proshade_double* rotMat = new proshade_double[9];
3329  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
3330  ProSHADE_internal_maths::getRotationMatrixFromEulerZYZAngles ( this->eulerAngles.at(0), this->eulerAngles.at(1), this->eulerAngles.at(2), rotMat );
3331 
3332  //================================================ Copy to the output variable
3333  std::vector< proshade_double > ret;
3334  for ( proshade_unsign iter = 0; iter < 9; iter++ ) { ProSHADE_internal_misc::addToDoubleVector ( &ret, rotMat[iter] ); }
3335 
3336  //================================================ Release the memory
3337  delete[] rotMat;
3338 
3339  //================================================ Return required value
3340  return ( ret );
3341 
3342 }
3343 
3348 #if defined ( _WIN64 ) || defined ( _WIN32 )
3349 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTranslationToOrigin ( )
3350 #else
3351 std::vector< proshade_double > ProSHADE_run::getTranslationToOrigin ( )
3352 #endif
3353 {
3354  //================================================ Sanity check
3355  if ( this->coordRotationCentre.size() != 3 )
3356  {
3357  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested rotation/translation values for Overlay functionality without having successfully computed it. Please check the correct task was used and no other warnings/errors were obtained.", "WO00042" );
3358  return ( std::vector< proshade_double > ( ) );
3359  }
3360 
3361  //================================================ Create return variable with negative values of the internal varariable
3362  std::vector < proshade_double > ret;
3363  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(0) );
3364  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(1) );
3365  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(2) );
3366 
3367  //================================================ Return required value
3368  return ( ret );
3369 
3370 }
3371 
3376 #if defined ( _WIN64 ) || defined ( _WIN32 )
3377 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOriginToOverlayTranslation ( )
3378 #else
3379 std::vector< proshade_double > ProSHADE_run::getOriginToOverlayTranslation ( )
3380 #endif
3381 {
3382  //================================================ Sanity check
3383  if ( this->overlayTranslation.size() != 3 )
3384  {
3385  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested rotation/translation values for Overlay functionality without having successfully computed it. Please check the correct task was used and no other warnings/errors were obtained.", "WO00042" );
3386  return ( std::vector< proshade_double > ( ) );
3387  }
3388 
3389  //================================================ Return required value
3390  return ( this->overlayTranslation );
3391 
3392 }
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:124
ProSHADE_settings::setOverlayJsonFile
void setOverlayJsonFile(std::string filename)
Sets the filename to which the overlay operations are to be save into.
Definition: ProSHADE.cpp:1564
ProSHADE_internal_tasks::MapOverlayTask
void MapOverlayTask(ProSHADE_settings *settings, std::vector< proshade_double > *rotationCentre, std::vector< proshade_double > *eulerAngles, std::vector< proshade_double > *finalTranslation)
The symmetry detection task driver function.
Definition: ProSHADE_tasks.cpp:632
ProSHADE_settings::setBoxCentering
void setBoxCentering(proshade_double xPos, proshade_double yPos, proshade_double zPos)
Sets the requested centre of box to be at the real space co-ordinates supplied.
Definition: ProSHADE.cpp:1041
ProSHADE_settings::maxBandwidth
proshade_unsign maxBandwidth
The bandwidth of spherical harmonics decomposition for the largest sphere.
Definition: ProSHADE_settings.hpp:59
ProSHADE_settings::integOrder
proshade_unsign integOrder
The order required for full Gauss-Legendre integration between the spheres.
Definition: ProSHADE_settings.hpp:70
ProSHADE_settings::rotTrsJSONFile
std::string rotTrsJSONFile
The filename to which the rotation and translation operations are to be saved into.
Definition: ProSHADE_settings.hpp:149
ProSHADE_settings::setEnLevShellWeight
void setEnLevShellWeight(proshade_double mPower)
Sets the weight of shell position for the energy levels computation.
Definition: ProSHADE.cpp:1359
ProSHADE_settings::computeTraceSigmaDesc
bool computeTraceSigmaDesc
If true, the trace sigma descriptor will be computed, otherwise all its computations will be omitted.
Definition: ProSHADE_settings.hpp:119
ProSHADE_settings::findSymCentre
bool findSymCentre
Should phase-less map be used to determine centre of symmetry?
Definition: ProSHADE_settings.hpp:130
ProSHADE_settings::setTraceSigmaComputation
void setTraceSigmaComputation(bool trSigVal)
Sets whether the trace sigma distance descriptor should be computed.
Definition: ProSHADE.cpp:1251
ProSHADE_settings::computeRotationFuncDesc
bool computeRotationFuncDesc
If true, the rotation function descriptor will be computed, otherwise all its computations will be om...
Definition: ProSHADE_settings.hpp:120
ProSHADE_settings::setSameBoundaries
void setSameBoundaries(bool sameB)
Sets whether same boundaries should be used in the appropriate variable.
Definition: ProSHADE.cpp:918
ProSHADE_settings::maxSymmetryFold
proshade_unsign maxSymmetryFold
The highest symmetry fold to search for.
Definition: ProSHADE_settings.hpp:138
ProSHADE_run::~ProSHADE_run
~ProSHADE_run(void)
Destructor for the ProSHADE class.
Definition: ProSHADE.cpp:1998
ProSHADE_settings::setMinimumMaskSize
void setMinimumMaskSize(proshade_single minMS)
Sets the requested minimum mask size.
Definition: ProSHADE.cpp:756
ProSHADE_settings::determineAllSHValues
void determineAllSHValues(proshade_unsign xDim, proshade_unsign yDim, proshade_single xDimAngs, proshade_single yDimAngs, proshade_single zDimAngs)
This function determines all the required values for spherical harmonics computation.
Definition: ProSHADE.cpp:1817
ProSHADE_run::getRotationFunctionVector
std::vector< proshade_double > getRotationFunctionVector(void)
This function returns the full rotation function distances vector from the first to all other structu...
Definition: ProSHADE.cpp:3044
ProSHADE_settings::setAppliedMaskFilename
void setAppliedMaskFilename(std::string mskFln)
Sets the filename of the mask data that should be applied to the input map.
Definition: ProSHADE.cpp:816
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:97
ProSHADE_settings::setBicubicInterpolationSearch
void setBicubicInterpolationSearch(bool bicubPeaks)
Sets the bicubic interpolation on peaks.
Definition: ProSHADE.cpp:1582
ProSHADE_settings::setPeakNaiveNoIQR
void setPeakNaiveNoIQR(proshade_double noIQRs)
Sets the number of IQRs from the median for threshold height a peak needs to be considered a peak.
Definition: ProSHADE.cpp:1315
ProSHADE_exception
This class is the representation of ProSHADE exception.
Definition: ProSHADE_exceptions.hpp:37
ProSHADE_settings::outName
std::string outName
The file name where the output structure(s) should be saved.
Definition: ProSHADE_settings.hpp:114
ProSHADE_settings::setMapInversion
void setMapInversion(bool mInv)
Sets the requested map inversion value in the appropriate variable.
Definition: ProSHADE.cpp:612
ProSHADE_exception::get_errc
virtual std::string get_errc(void)
This function returns the exception error code.
Definition: ProSHADE_exceptions.cpp:29
ProSHADE_settings::setMapResolutionChange
void setMapResolutionChange(bool mrChange)
Sets the requested map resolution change decision in the appropriate variable.
Definition: ProSHADE.cpp:959
ProSHADE_settings::setPeakNeighboursNumber
void setPeakNeighboursNumber(proshade_unsign pkS)
Sets the number of neighbour values that have to be smaller for an index to be considered a peak.
Definition: ProSHADE.cpp:1293
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:81
ProSHADE_run::getAllCSyms
std::vector< std::vector< proshade_double > > getAllCSyms(void)
This function returns a all symmetry axes as a vector of vectors of doubles.
Definition: ProSHADE.cpp:3154
ProSHADE_settings::maskMap
bool maskMap
Should the map be masked from noise?
Definition: ProSHADE_settings.hpp:83
ProSHADE_settings::requestedSymmetryFold
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
Definition: ProSHADE_settings.hpp:136
ProSHADE_run::getNoSymmetryAxes
proshade_unsign getNoSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:3075
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:135
ProSHADE_internal_maths::getRotationMatrixFromEulerZYZAngles
void getRotationMatrixFromEulerZYZAngles(proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *matrix)
Function to find the rotation matrix from Euler angles (ZYZ convention).
Definition: ProSHADE_maths.cpp:1019
ProSHADE_settings::setSphereDistances
void setSphereDistances(proshade_single sphDist)
Sets the requested distance between spheres in the appropriate variable.
Definition: ProSHADE.cpp:1130
ProSHADE_settings::setVerbosity
void setVerbosity(proshade_signed verbosity)
Sets the requested verbosity in the appropriate variable.
Definition: ProSHADE.cpp:632
ProSHADE_settings::removeNegativeDensity
bool removeNegativeDensity
Should the negative density be removed from input files?
Definition: ProSHADE_settings.hpp:47
ProSHADE_settings::setMinimumPeakForAxis
void setMinimumPeakForAxis(proshade_double minSP)
Sets the minimum peak height for symmetry axis to be considered.
Definition: ProSHADE.cpp:1488
ProSHADE_settings::saveMask
bool saveMask
Should the mask be saved?
Definition: ProSHADE_settings.hpp:87
ProSHADE_settings::requestedResolution
proshade_single requestedResolution
The resolution to which the calculations are to be done.
Definition: ProSHADE_settings.hpp:50
ProSHADE_settings::minSymPeak
proshade_double minSymPeak
Minimum average peak for symmetry axis to be considered as "real".
Definition: ProSHADE_settings.hpp:134
ProSHADE_exception::get_info
virtual std::string get_info(void)
This function returns the exception description.
Definition: ProSHADE_exceptions.cpp:53
ProSHADE_settings::setAxisComparisonThresholdBehaviour
void setAxisComparisonThresholdBehaviour(bool behav)
Sets the automatic symmetry axis tolerance decreasing.
Definition: ProSHADE.cpp:1467
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:111
ProSHADE_settings::maxSphereDists
proshade_single maxSphereDists
The distance between spheres in spherical mapping for the largest sphere.
Definition: ProSHADE_settings.hpp:67
ProSHADE_run::getEulerAngles
std::vector< proshade_double > getEulerAngles(void)
This function returns the vector of Euler angles with best overlay correlation.
Definition: ProSHADE.cpp:3295
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:131
ProSHADE_settings::setPDBBFactor
void setPDBBFactor(proshade_double newBF)
Sets the requested B-factor value for PDB files in the appropriate variable.
Definition: ProSHADE.cpp:572
ProSHADE_settings::addStructure
void addStructure(std::string structure)
Adds a structure file name to the appropriate variable.
Definition: ProSHADE.cpp:532
ProSHADE_settings::determineIntegrationOrder
void determineIntegrationOrder(proshade_single maxMapRange)
This function determines the integration order for the between spheres integration.
Definition: ProSHADE.cpp:1773
ProSHADE_settings::setMaskIQR
void setMaskIQR(proshade_single noIQRs)
Sets the requested number of IQRs for masking threshold in the appropriate variable.
Definition: ProSHADE.cpp:673
ProSHADE_settings::setMissingPeakThreshold
void setMissingPeakThreshold(proshade_double mpThres)
Sets the threshold for starting the missing peaks procedure.
Definition: ProSHADE.cpp:1402
ProSHADE_run::getVerbose
proshade_signed getVerbose(void)
This function returns the verbose value.
Definition: ProSHADE.cpp:3065
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:82
ProSHADE_settings::useCorrelationMasking
bool useCorrelationMasking
Should the blurring masking (false) or the correlation masking (true) be used?
Definition: ProSHADE_settings.hpp:84
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:64
ProSHADE_settings::setSymmetryCentreSearch
void setSymmetryCentreSearch(bool sCen)
Sets the symmetry centre search on or off.
Definition: ProSHADE.cpp:1423
ProSHADE_settings::setMapCentering
void setMapCentering(bool com)
Sets the requested map centering decision value in the appropriate variable.
Definition: ProSHADE.cpp:1019
ProSHADE_settings::setMaskBlurFactor
void setMaskBlurFactor(proshade_single blurFac)
Sets the requested map blurring factor in the appropriate variable.
Definition: ProSHADE.cpp:652
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:102
ProSHADE_settings::setPeakThreshold
void setPeakThreshold(proshade_double peakThr)
Sets the minimum peak height threshold for axis to be considered possible.
Definition: ProSHADE.cpp:1636
ProSHADE_settings::setPhaseUsage
void setPhaseUsage(bool phaseUsage)
Sets whether the phase information will be used.
Definition: ProSHADE.cpp:1337
ProSHADE_settings::maskFileName
std::string maskFileName
The filename to which mask should be saved.
Definition: ProSHADE_settings.hpp:88
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:152
ProSHADE_settings::setFSCThreshold
void setFSCThreshold(proshade_double fscThr)
Sets the minimum FSC threshold for axis to be considered detected.
Definition: ProSHADE.cpp:1618
ProSHADE_settings::setBandwidth
void setBandwidth(proshade_unsign band)
Sets the requested spherical harmonics bandwidth in the appropriate variable.
Definition: ProSHADE.cpp:1110
ProSHADE_settings::messageShift
proshade_signed messageShift
This value allows shifting the messages to create more readable log for sub-processes.
Definition: ProSHADE_settings.hpp:153
ProSHADE_settings::setBoundsSpace
void setBoundsSpace(proshade_single boundsExSp)
Sets the requested number of angstroms for extra space in re-boxing in the appropriate variable.
Definition: ProSHADE.cpp:877
ProSHADE_exception::get_func
virtual std::string get_func(void)
This function returns the exception causing function name.
Definition: ProSHADE_exceptions.cpp:47
ProSHADE_settings::changeMapResolutionTriLinear
bool changeMapResolutionTriLinear
Should maps be re-sampled to obtain the required resolution?
Definition: ProSHADE_settings.hpp:52
ProSHADE_settings::setOutputFilename
void setOutputFilename(std::string oFileName)
Sets the requested output file name in the appropriate variable.
Definition: ProSHADE.cpp:939
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_mapManip::removeWaters
void removeWaters(gemmi::Structure *pdbFile, bool firstModel)
This function removed all waters from PDB input file.
Definition: ProSHADE_mapManip.cpp:518
ProSHADE_settings::useBiCubicInterpolationOnPeaks
bool useBiCubicInterpolationOnPeaks
This variable switch decides whether best symmetry is detected from peak indices, or whether bicubic ...
Definition: ProSHADE_settings.hpp:137
ProSHADE_internal_spheres::autoDetermineSphereDistances
proshade_single autoDetermineSphereDistances(proshade_single maxMapRange, proshade_single resolution)
This function determines the sphere distances for sphere mapping.
Definition: ProSHADE_spheres.cpp:538
ProSHADE_run::getSymmetryAxis
std::vector< std::string > getSymmetryAxis(proshade_unsign axisNo)
This function returns a single symmetry axis as a vector of strings from the recommended symmetry axe...
Definition: ProSHADE.cpp:3099
ProSHADE_settings::setAxisComparisonThreshold
void setAxisComparisonThreshold(proshade_double axThres)
Sets the threshold for matching symmetry axes.
Definition: ProSHADE.cpp:1444
ProSHADE_internal_tasks::SymmetryDetectionTask
void SymmetryDetectionTask(ProSHADE_settings *settings, std::vector< proshade_double > *mapCOMShift, std::string *symT, proshade_unsign *symF, std::vector< proshade_double * > *symA, std::vector< std::vector< proshade_double > > *allCs)
The symmetry detection task driver function.
Definition: ProSHADE_tasks.cpp:290
ProSHADE_settings::peakThresholdMin
proshade_double peakThresholdMin
The threshold for peak height above which axes are considered possible.
Definition: ProSHADE_settings.hpp:141
ProSHADE_internal_tasks::MapManipulationTask
void MapManipulationTask(ProSHADE_settings *settings, std::vector< proshade_signed * > *originalBounds, std::vector< proshade_signed * > *reboxedBounds, std::vector< proshade_double * > *manipulatedMaps)
The re-boxing task driver function.
Definition: ProSHADE_tasks.cpp:35
ProSHADE_settings::forceP1
bool forceP1
Should the P1 spacegroup be forced on the input PDB files?
Definition: ProSHADE_settings.hpp:44
ProSHADE_settings::setTypicalNoiseSize
void setTypicalNoiseSize(proshade_single typNoi)
Sets the requested "fake" half-map kernel in the appropriate variable.
Definition: ProSHADE.cpp:736
ProSHADE_settings::calcBounds
std::vector< proshade_double > calcBounds
The boundaries to be used for deciding the calculation thresholds (band, integration order,...
Definition: ProSHADE_settings.hpp:90
ProSHADE_internal_misc::addToSignedVector
void addToSignedVector(std::vector< proshade_signed > *vecToAddTo, proshade_signed elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:121
ProSHADE_run
This class provides the access point to the library.
Definition: ProSHADE.hpp:39
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:433
ProSHADE_settings::task
ProSHADE_Task task
This custom type variable determines which task to perfom (i.e. symmetry detection,...
Definition: ProSHADE_settings.hpp:40
ProSHADE_settings::setMaskFilename
void setMaskFilename(std::string mskFln)
Sets where the mask should be saved.
Definition: ProSHADE.cpp:796
ProSHADE_run::getSymmetryFold
proshade_unsign getSymmetryFold(void)
This is the main accessor function for the user to get to know what symmetry fold ProSHADE has detect...
Definition: ProSHADE.cpp:2047
ProSHADE_settings::setCoordExtraSpace
void setCoordExtraSpace(proshade_single exSpace)
Sets the requested co-ordinates extra space value in the appropriate variable.
Definition: ProSHADE.cpp:1090
ProSHADE_run::getTranslationToOrigin
std::vector< proshade_double > getTranslationToOrigin(void)
This function returns the negative values of the position of the rotation centre (the point about whi...
Definition: ProSHADE.cpp:3351
ProSHADE_settings::reBoxMap
bool reBoxMap
This switch decides whether re-boxing is needed.
Definition: ProSHADE_settings.hpp:96
ProSHADE_settings::appliedMaskFileName
std::string appliedMaskFileName
The filename from which mask data will be read from.
Definition: ProSHADE_settings.hpp:89
getReBoxedMap
void getReBoxedMap(ProSHADE_run *run, proshade_unsign strNo, double *reboxMap, int len)
This function returns the re-boxed structure map 1D array for the processed structure.
Definition: ProSHADE.cpp:3267
ProSHADE_settings::resolutionOversampling
proshade_single resolutionOversampling
How much (%) should the requested resolution be over-sampled by map re-sampling?
Definition: ProSHADE_settings.hpp:53
ProSHADE_settings::coOrdsExtraSpace
proshade_single coOrdsExtraSpace
This number of Angstroms will be added before and any co-ordinates to make sure there is no atom dire...
Definition: ProSHADE_settings.hpp:108
ProSHADE_settings::normaliseMap
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
Definition: ProSHADE_settings.hpp:75
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:107
ProSHADE_settings::setRequestedFold
void setRequestedFold(proshade_unsign val)
Sets the user requested symmetry fold.
Definition: ProSHADE.cpp:1528
ProSHADE_settings
This class stores all the settings and is passed to the executive classes instead of a multitude of p...
Definition: ProSHADE_settings.hpp:37
ProSHADE_settings::fscThreshold
proshade_double fscThreshold
The threshold for FSC value under which the axis is considered to be likely noise.
Definition: ProSHADE_settings.hpp:140
ProSHADE_settings::determineBandwidthFromAngle
void determineBandwidthFromAngle(proshade_double uncertainty)
This function determines the bandwidth for the spherical harmonics computation from the allowed rotat...
Definition: ProSHADE.cpp:1710
ProSHADE_settings::setIntegrationSpeedUp
void setIntegrationSpeedUp(bool speedup)
Sets the variable deciding if integration speedup should be used or not.
Definition: ProSHADE.cpp:1189
ProSHADE_settings::integApproxSteps
proshade_unsign integApproxSteps
The number of steps taken in the approximation of Legendre polynomial decomposition to terms.
Definition: ProSHADE_settings.hpp:71
ProSHADE_settings::getCommandLineParams
void getCommandLineParams(int argc, char **argv)
This function parses the command line arguments into the settings object.
Definition: ProSHADE.cpp:2112
ProSHADE_internal_tasks::DistancesComputationTask
void DistancesComputationTask(ProSHADE_settings *settings, std::vector< proshade_double > *enLevs, std::vector< proshade_double > *trSigm, std::vector< proshade_double > *rotFun)
The distances computation task driver function.
Definition: ProSHADE_tasks.cpp:147
ProSHADE_run::getSymmetryType
std::string getSymmetryType(void)
This is the main accessor function for the user to get to know what symmetry type ProSHADE has detect...
Definition: ProSHADE.cpp:2032
ProSHADE_settings::supportedSymmetryFold
proshade_unsign supportedSymmetryFold
Maximum supported fold by the map.
Definition: ProSHADE_settings.hpp:139
ProSHADE_internal_messages::printWellcomeMessage
void printWellcomeMessage(proshade_signed verbose)
Wellcome message printing.
Definition: ProSHADE_messages.cpp:31
ProSHADE.hpp
This is the main header file providing the main access class and its functions.
ProSHADE_run::getEnergyLevelsVector
std::vector< proshade_double > getEnergyLevelsVector(void)
This function returns the energy level distances vector from the first to all other structures.
Definition: ProSHADE.cpp:3016
ProSHADE_internal_messages::printTerminateMessage
void printTerminateMessage(proshade_signed verbose)
Final message printing.
Definition: ProSHADE_messages.cpp:49
ProSHADE_settings::setMapReboxing
void setMapReboxing(bool reBx)
Sets whether re-boxing needs to be done in the appropriate variable.
Definition: ProSHADE.cpp:856
ProSHADE_settings::setMaxSymmetryFold
void setMaxSymmetryFold(proshade_unsign maxFold)
Sets the maximum symmetry fold (well, the maximum prime symmetry fold).
Definition: ProSHADE.cpp:1600
ProSHADE_settings::correlationKernel
proshade_single correlationKernel
This value in Angstrom will be used as the kernel for the map-FHM correlation computation.
Definition: ProSHADE_settings.hpp:86
ProSHADE_settings::setNegativeDensity
void setNegativeDensity(bool nDens)
Sets the internal variable deciding whether input files negative density should be removed.
Definition: ProSHADE.cpp:1654
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:78
ProSHADE_settings::centrePosition
std::vector< proshade_double > centrePosition
The position of the centre of the map in "real space" co-ordinates.
Definition: ProSHADE_settings.hpp:145
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:98
ProSHADE_settings::setCorrelationMasking
void setCorrelationMasking(bool corMask)
Sets the requested map masking type in the appropriate variable.
Definition: ProSHADE.cpp:714
ProSHADE_settings::setProgressiveSphereMapping
void setProgressiveSphereMapping(bool progSphMap)
Sets the requested sphere mapping value settings approach in the appropriate variable.
Definition: ProSHADE.cpp:1209
ProSHADE_settings::setIntegrationApproxSteps
void setIntegrationApproxSteps(proshade_unsign noSteps)
Sets the requested number of steps used in approximating Legendre polynomial decomposition to steps i...
Definition: ProSHADE.cpp:1171
ProSHADE_settings::changeMapResolution
bool changeMapResolution
Should maps be re-sampled to obtain the required resolution?
Definition: ProSHADE_settings.hpp:51
ProSHADE_settings::setIntegrationOrder
void setIntegrationOrder(proshade_unsign intOrd)
Sets the requested order for the Gauss-Legendre integration in the appropriate variable.
Definition: ProSHADE.cpp:1150
ProSHADE_settings::setRotationFunctionComputation
void setRotationFunctionComputation(bool rotfVal)
Sets whether the rotation function distance descriptor should be computed.
Definition: ProSHADE.cpp:1272
ProSHADE_run::getReBoxedBounds
std::vector< proshade_signed > getReBoxedBounds(proshade_unsign strNo)
This function returns a specific structure re-boxed bounds.
Definition: ProSHADE.cpp:3216
ProSHADE_settings::rotationUncertainty
proshade_double rotationUncertainty
Alternative to bandwidth - the angle in degrees to which the rotation function accuracy should be com...
Definition: ProSHADE_settings.hpp:60
ProSHADE_settings::~ProSHADE_settings
~ProSHADE_settings(void)
Destructor for the ProSHADE_settings class.
Definition: ProSHADE.cpp:494
ProSHADE_settings::setOverlaySaveFile
void setOverlaySaveFile(std::string filename)
Sets the filename to which the overlay structure is to be save into.
Definition: ProSHADE.cpp:1546
ProSHADE_settings::overlayStructureName
std::string overlayStructureName
The filename to which the rotated and translated moving structure is to be saved.
Definition: ProSHADE_settings.hpp:148
ProSHADE_settings::determineBandwidth
void determineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE.cpp:1673
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:103
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:123
ProSHADE_settings::maxRadius
proshade_double maxRadius
The maximum distance from centre in Angstroms for a map value to still be used.
Definition: ProSHADE_settings.hpp:61
ProSHADE_internal_spheres::autoDetermineIntegrationOrder
proshade_unsign autoDetermineIntegrationOrder(proshade_single maxMapRange, proshade_single sphereDist)
This function determines the integration order for the between spheres integration.
Definition: ProSHADE_spheres.cpp:562
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:127
ProSHADE_run::ProSHADE_run
ProSHADE_run(ProSHADE_settings *settings)
Contructor for the ProSHADE_run class.
Definition: ProSHADE.cpp:1900
ProSHADE_run::getMapValue
proshade_double getMapValue(proshade_unsign strNo, proshade_unsign mapIndex)
This function returns a single, specific structure map value.
Definition: ProSHADE.cpp:3250
ProSHADE_settings::setMapResolutionOverSampling
void setMapResolutionOverSampling(proshade_single overS)
Sets the requested map resolution over-sampling.
Definition: ProSHADE.cpp:999
ProSHADE_settings::setFourierWeightsFilename
void setFourierWeightsFilename(std::string fWgFln)
Sets the filename of the mask data that should be applied to the input map.
Definition: ProSHADE.cpp:836
ProSHADE_settings::halfMapKernel
proshade_single halfMapKernel
This value in Angstrom will be used as the kernel for the "fake half-map" computation.
Definition: ProSHADE_settings.hpp:85
ProSHADE_settings::boxCentre
std::vector< proshade_double > boxCentre
If box centre is to be in any other location, this variable will hold the real space location that sh...
Definition: ProSHADE_settings.hpp:104
ProSHADE_run::getNoRecommendedSymmetryAxes
proshade_unsign getNoRecommendedSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:3085
ProSHADE_settings::determineSphereDistances
void determineSphereDistances(proshade_single maxMapRange)
This function determines the sphere distances for sphere mapping.
Definition: ProSHADE.cpp:1741
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:73
ProSHADE_settings::setGroupingSmoothingFactor
void setGroupingSmoothingFactor(proshade_double smFact)
Sets the grouping smoothing factor into the proper variable.
Definition: ProSHADE.cpp:1381
ProSHADE_internal_spheres::autoDetermineBandwidth
proshade_unsign autoDetermineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE_spheres.cpp:516
ProSHADE_settings::setRequestedSymmetry
void setRequestedSymmetry(std::string val)
Sets the user requested symmetry type.
Definition: ProSHADE.cpp:1508
ProSHADE_settings::setExtraSpace
void setExtraSpace(proshade_single exSpace)
Sets the requested map extra space value in the appropriate variable.
Definition: ProSHADE.cpp:1070
ProSHADE_settings::forceBounds
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
Definition: ProSHADE_settings.hpp:100
ProSHADE_settings::fourierWeightsFileName
std::string fourierWeightsFileName
The filename from which Fourier weights data will be read from.
Definition: ProSHADE_settings.hpp:93
ProSHADE_exception::get_line
virtual int long get_line(void)
This function returns the exception location line.
Definition: ProSHADE_exceptions.cpp:41
ProSHADE_settings::inputFiles
std::vector< std::string > inputFiles
This vector contains the filenames of all input structure files.
Definition: ProSHADE_settings.hpp:43
ProSHADE_settings::setMapResolutionChangeTriLinear
void setMapResolutionChangeTriLinear(bool mrChange)
Sets the requested map resolution change decision using tri-linear interpolation in the appropriate v...
Definition: ProSHADE.cpp:979
ProSHADE_settings::setMaskSaving
void setMaskSaving(bool savMsk)
Sets whether the mask should be saved.
Definition: ProSHADE.cpp:776
ProSHADE_exception::get_file
virtual std::string get_file(void)
This function returns the exception location file name.
Definition: ProSHADE_exceptions.cpp:35
ProSHADE_settings::ProSHADE_settings
ProSHADE_settings(void)
Contructor for the ProSHADE_settings class.
Definition: ProSHADE.cpp:37
ProSHADE_settings::firstModelOnly
bool firstModelOnly
Shoud only the first PDB model be used, or should all models be used?
Definition: ProSHADE_settings.hpp:46
ProSHADE_settings::setBoundsThreshold
void setBoundsThreshold(proshade_signed boundsThres)
Sets the threshold for number of indices difference acceptable to make index sizes same in the approp...
Definition: ProSHADE.cpp:897
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:132
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:99
ProSHADE_settings::setMasking
void setMasking(bool mask)
Sets the requested map masking decision value in the appropriate variable.
Definition: ProSHADE.cpp:693
ProSHADE_settings::pdbBFactorNewVal
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
Definition: ProSHADE_settings.hpp:56
ProSHADE_run::getOptimalRotMat
std::vector< proshade_double > getOptimalRotMat(void)
This function returns the vector forming rotation matrix (rows first) with best overlay correlation.
Definition: ProSHADE.cpp:3317
ProSHADE_run::getOriginalBounds
std::vector< proshade_signed > getOriginalBounds(proshade_unsign strNo)
This function returns a specific structure original bounds.
Definition: ProSHADE.cpp:3184
ProSHADE_settings::setVariablesLeftOnAuto
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
Definition: ProSHADE.cpp:506
ProSHADE_run::getTraceSigmaVector
std::vector< proshade_double > getTraceSigmaVector(void)
This function returns the trace sigma distances vector from the first to all other structures.
Definition: ProSHADE.cpp:3030
ProSHADE_settings::noIntegrationSpeedup
bool noIntegrationSpeedup
This option turns off the integration speedup (only using abscissas and weights up to appropriate l f...
Definition: ProSHADE_settings.hpp:72
ProSHADE_settings::removeWaters
bool removeWaters
Should all waters be removed from input PDB files?
Definition: ProSHADE_settings.hpp:45
ProSHADE_internal_messages::printHelp
void printHelp(void)
This function prints the help screen in the case -h is called, or if command line arguments cannot be...
Definition: ProSHADE_messages.cpp:119
ProSHADE_internal_messages::printProgressMessage
void printProgressMessage(proshade_signed verbose, proshade_signed messageLevel, std::string message, proshade_signed messageShift=0)
General stdout message printing.
Definition: ProSHADE_messages.cpp:71
ProSHADE_settings::setResolution
void setResolution(proshade_single resolution)
Sets the requested resolution in the appropriate variable.
Definition: ProSHADE.cpp:552
ProSHADE_settings::printSettings
void printSettings(void)
This function prints the current values in the settings object.
Definition: ProSHADE.cpp:2716
ProSHADE_run::getNoStructures
proshade_unsign getNoStructures(void)
This function returns the number of structures used.
Definition: ProSHADE.cpp:3055
ProSHADE_run::getMapCOMProcessChange
std::vector< proshade_double > getMapCOMProcessChange(void)
This function returns the internal map COM shift.
Definition: ProSHADE.cpp:3169
ProSHADE_settings::fastISearch
bool fastISearch
Should FSC be computed for all possible I matches, or just for the best one according to FR?
Definition: ProSHADE_settings.hpp:142
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_settings::enLevMatrixPowerWeight
proshade_double enLevMatrixPowerWeight
If RRP matrices shell position is to be weighted by putting the position as an exponent,...
Definition: ProSHADE_settings.hpp:118
ProSHADE_run::getOriginToOverlayTranslation
std::vector< proshade_double > getOriginToOverlayTranslation(void)
This function returns the translation required to move the structure from origin to optimal overlay.
Definition: ProSHADE.cpp:3379
ProSHADE_settings::setNormalisation
void setNormalisation(bool normalise)
Sets the requested map normalisation value in the appropriate variable.
Definition: ProSHADE.cpp:592
ProSHADE_settings::setEnergyLevelsComputation
void setEnergyLevelsComputation(bool enLevDesc)
Sets whether the energy level distance descriptor should be computed.
Definition: ProSHADE.cpp:1230
ProSHADE_settings::computeEnergyLevelsDesc
bool computeEnergyLevelsDesc
If true, the energy levels descriptor will be computed, otherwise all its computations will be omitte...
Definition: ProSHADE_settings.hpp:117