ProSHADE  0.7.6.2 (DEC 2021)
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 
54  //================================================ Settings regarding the PDB B-factor change
55  this->pdbBFactorNewVal = -1.0;
56 
57  //================================================ Settings regarding the bandwidth of calculations
58  this->maxBandwidth = 0;
59  this->rotationUncertainty = 0;
60 
61  //================================================ Settings regarding the phase
62  this->usePhase = true;
63 
64  //================================================ Settings regarding the spheres
65  this->maxSphereDists = 0.0;
66 
67  //================================================ Settings regarding the Gauss-Legendre integration
68  this->integOrder = 0;
69  this->taylorSeriesCap = 10;
70 
71  //================================================ Settings regarding map normalisation
72  this->normaliseMap = false;
73 
74  //================================================ Settings regarding map inversion
75  this->invertMap = false;
76 
77  //================================================ Settings regarding map masking
78  this->blurFactor = 350.0;
79  this->maskingThresholdIQRs = 3.0;
80  this->maskMap = false;
81  this->useCorrelationMasking = false;
82  this->halfMapKernel = 0.0;
83  this->correlationKernel = 0.0;
84  this->saveMask = false;
85  this->maskFileName = "maskFile";
86  this->appliedMaskFileName = "";
87 
88  //================================================ Settings regarding Fourier weights
89  this->fourierWeightsFileName = "";
90 
91  //================================================ Settings regarding re-boxing
92  this->reBoxMap = false;
93  this->boundsExtraSpace = 3.0;
94  this->boundsSimilarityThreshold = 0;
95  this->useSameBounds = false;
96  this->forceBounds = new proshade_signed [6];
97 
98  //================================================ Settings regarding COM
99  this->moveToCOM = false;
100  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
101  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
102  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
103 
104  //================================================ Settings regarding extra cell space
105  this->addExtraSpace = 10.0;
106  this->coOrdsExtraSpace = 10.0;
107 
108  //================================================ Settings regarding shell settings
109  this->progressiveSphereMapping = false;
110 
111  //================================================ Settings regarding output file name
112  this->outName = "reBoxed";
113 
114  //================================================ Settings regarding distances computation
115  this->computeEnergyLevelsDesc = true;
116  this->computeTraceSigmaDesc = true;
117  this->computeRotationFuncDesc = true;
118  this->enLevMatrixPowerWeight = 1.0;
119 
120  //================================================ Settings regarding peak searching
121  this->peakNeighbours = 1;
122  this->noIQRsFromMedianNaivePeak = -999.9;
123 
124  //================================================ Settings regarding 1D grouping
125  this->smoothingFactor = 15.0;
126 
127  //================================================ Settings regarding the symmetry detection
128  this->findSymCentre = false;
129  this->useBiCubicInterpolationOnPeaks = true;
130  this->maxSymmetryFold = 30;
131  this->fscThreshold = 0.33;
132  this->peakThresholdMin = 0.75;
133  this->fastISearch = true;
134  this->symMissPeakThres = 0.3;
135  this->axisErrTolerance = 0.01;
136  this->axisErrToleranceDefault = true;
137  this->minSymPeak = 0.3;
138  this->recommendedSymmetryType = "";
139  this->recommendedSymmetryFold = 0;
140  this->requestedSymmetryType = "";
141  this->requestedSymmetryFold = 0;
142  this->detectedSymmetry.clear ( );
143 
144  //================================================ Settings regarding centre of map
145  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
146  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
147  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
148 
149  //================================================ Settings regarding the structure overlay
150  this->overlayStructureName = "movedStructure";
151  this->rotTrsJSONFile = "movedStructureOperations.json";
152 
153  //================================================ Settings regarding verbosity of the program
154  this->verbose = 1;
155  this->messageShift = 0;
156 
157  //================================================ Done
158 
159 }
160 
167 #if defined ( _WIN64 ) || defined ( _WIN32 )
168 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( ProSHADE_settings* settings )
169 #else
171 #endif
172 {
173  //================================================ Settings regarding the task at hand
174  this->task = settings->task;
175 
176  //================================================ Settings regarding input files
177  for ( size_t fIt = 0; fIt < settings->inputFiles.size(); fIt++ ) { this->inputFiles.push_back ( settings->inputFiles.at(fIt) ); }
178  this->forceP1 = settings->forceP1;
179  this->removeWaters = settings->removeWaters;
180  this->firstModelOnly = settings->firstModelOnly;
181  this->removeNegativeDensity = settings->removeNegativeDensity;
182 
183  //================================================ Settings regarding the resolution of calculations
184  this->requestedResolution = settings->requestedResolution;
185  this->changeMapResolution = settings->changeMapResolution;
186  this->changeMapResolutionTriLinear = settings->changeMapResolutionTriLinear;
187 
188  //================================================ Settings regarding the PDB B-factor change
189  this->pdbBFactorNewVal = settings->pdbBFactorNewVal;
190 
191  //================================================ Settings regarding the bandwidth of calculations
192  this->maxBandwidth = settings->maxBandwidth;
193  this->rotationUncertainty = settings->rotationUncertainty;
194 
195  //================================================ Settings regarding the phase
196  this->usePhase = settings->usePhase;
197 
198  //================================================ Settings regarding the spheres
199  this->maxSphereDists = settings->maxSphereDists;
200 
201  //================================================ Settings regarding the Gauss-Legendre integration
202  this->integOrder = settings->integOrder;
203  this->taylorSeriesCap = settings->taylorSeriesCap;
204 
205  //================================================ Settings regarding map normalisation
206  this->normaliseMap = settings->normaliseMap;
207 
208  //================================================ Settings regarding map inversion
209  this->invertMap = settings->invertMap;
210 
211  //================================================ Settings regarding map masking
212  this->blurFactor = settings->blurFactor;
213  this->maskingThresholdIQRs = settings->maskingThresholdIQRs;
214  this->maskMap = settings->maskMap;
215  this->useCorrelationMasking = settings->useCorrelationMasking;
216  this->halfMapKernel = settings->halfMapKernel;
217  this->correlationKernel = settings->correlationKernel;
218  this->saveMask = settings->saveMask;
219  this->maskFileName = settings->maskFileName;
220  this->appliedMaskFileName = settings->appliedMaskFileName;
221 
222  //================================================ Settings regarding Fourier weights
223  this->fourierWeightsFileName = settings->fourierWeightsFileName;
224 
225  //================================================ Settings regarding re-boxing
226  this->reBoxMap = settings->reBoxMap;
227  this->boundsExtraSpace = settings->boundsExtraSpace;
228  this->boundsSimilarityThreshold = settings->boundsSimilarityThreshold;
229  this->useSameBounds = settings->useSameBounds;
230  this->forceBounds = new proshade_signed [6];
231  for ( size_t fbIt = 0; fbIt < 6; fbIt++ ) { this->forceBounds[fbIt] = settings->forceBounds[fbIt]; }
232 
233  //================================================ Settings regarding COM
234  this->moveToCOM = settings->moveToCOM;
235  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(0) );
236  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(1) );
237  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, settings->boxCentre.at(2) );
238 
239  //================================================ Settings regarding extra cell space
240  this->addExtraSpace = settings->addExtraSpace;
241  this->coOrdsExtraSpace = settings->coOrdsExtraSpace;
242 
243  //================================================ Settings regarding shell settings
244  this->progressiveSphereMapping = settings->progressiveSphereMapping;
245 
246  //================================================ Settings regarding output file name
247  this->outName = settings->outName;
248 
249  //================================================ Settings regarding distances computation
250  this->computeEnergyLevelsDesc = settings->computeEnergyLevelsDesc;
251  this->computeTraceSigmaDesc = settings->computeTraceSigmaDesc;
252  this->computeRotationFuncDesc = settings->computeRotationFuncDesc;
253  this->enLevMatrixPowerWeight = settings->enLevMatrixPowerWeight;
254 
255  //================================================ Settings regarding peak searching
256  this->peakNeighbours = settings->peakNeighbours;
257  this->noIQRsFromMedianNaivePeak = settings->noIQRsFromMedianNaivePeak;
258 
259  //================================================ Settings regarding 1D grouping
260  this->smoothingFactor = settings->smoothingFactor;
261 
262  //================================================ Settings regarding the symmetry detection
263  this->findSymCentre = settings->findSymCentre;
264  this->useBiCubicInterpolationOnPeaks = settings->useBiCubicInterpolationOnPeaks;
265  this->maxSymmetryFold = settings->maxSymmetryFold;
266  this->fscThreshold = settings->fscThreshold;
267  this->peakThresholdMin = settings->peakThresholdMin;
268  this->fastISearch = settings->fastISearch;
269  this->symMissPeakThres = settings->symMissPeakThres;
270  this->axisErrTolerance = settings->axisErrTolerance;
271  this->axisErrToleranceDefault = settings->axisErrToleranceDefault;
272  this->minSymPeak = settings->minSymPeak;
273  this->recommendedSymmetryType = settings->recommendedSymmetryType;
274  this->recommendedSymmetryFold = settings->recommendedSymmetryFold;
275  this->requestedSymmetryType = settings->requestedSymmetryType;
276  this->requestedSymmetryFold = settings->requestedSymmetryFold;
277 
278 
279  this->detectedSymmetry.clear ( );
280  for ( size_t dsIt = 0; dsIt < settings->detectedSymmetry.size(); dsIt++ )
281  {
282  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->detectedSymmetry, settings->detectedSymmetry.at(dsIt) );
283  }
284 
285  //================================================ Settings regarding centre of map
286  this->centrePosition.clear ( );
287  for ( size_t cpIt = 0; cpIt < settings->centrePosition.size(); cpIt++ )
288  {
289  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, settings->centrePosition.at(cpIt) );
290  }
291 
292  //================================================ Settings regarding the structure overlay
293  this->overlayStructureName = settings->overlayStructureName;
294  this->rotTrsJSONFile = settings->rotTrsJSONFile;
295 
296  //================================================ Settings regarding verbosity of the program
297  this->verbose = settings->verbose;
298  this->messageShift = settings->messageShift;
299 }
300 
309 #if defined ( _WIN64 ) || defined ( _WIN32 )
310 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
311 #else
312  ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
313 #endif
314 {
315  //================================================ Settings regarding the task at hand
316  this->task = taskToPerform;
317 
318  //================================================ Settings regarding input files
319  this->forceP1 = true;
320  this->removeWaters = true;
321  this->firstModelOnly = true;
322  this->removeNegativeDensity = true;
323 
324  //================================================ Settings regarding the resolution of calculations
325  this->requestedResolution = -1.0;
326  this->changeMapResolution = false;
327  this->changeMapResolutionTriLinear = false;
328 
329  //================================================ Settings regarding the PDB B-factor change
330  this->pdbBFactorNewVal = -1.0;
331 
332  //================================================ Settings regarding the bandwidth of calculations
333  this->maxBandwidth = 0;
334  this->rotationUncertainty = 0;
335 
336  //================================================ Settings regarding the phase
337  this->usePhase = true;
338 
339  //================================================ Settings regarding the spheres
340  this->maxSphereDists = 0.0;
341 
342  //================================================ Settings regarding the Gauss-Legendre integration
343  this->integOrder = 0;
344  this->taylorSeriesCap = 10;
345 
346  //================================================ Settings regarding map normalisation
347  this->normaliseMap = false;
348 
349  //================================================ Settings regarding map inversion
350  this->invertMap = false;
351 
352  //================================================ Settings regarding map masking
353  this->blurFactor = 350.0;
354  this->maskingThresholdIQRs = 3.0;
355  this->maskMap = false;
356  this->useCorrelationMasking = false;
357  this->halfMapKernel = 0.0;
358  this->correlationKernel = 0.0;
359  this->saveMask = false;
360  this->maskFileName = "maskFile";
361  this->appliedMaskFileName = "";
362 
363  //================================================ Settings regarding Fourier weights
364  this->fourierWeightsFileName = "";
365 
366  //================================================ Settings regarding COM
367  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
368  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
369  ProSHADE_internal_misc::addToDoubleVector ( &this->boxCentre, std::numeric_limits< proshade_double >::infinity() );
370 
371  //================================================ Settings regarding re-boxing
372  this->reBoxMap = false;
373  this->boundsExtraSpace = 3.0;
374  this->boundsSimilarityThreshold = 0;
375  this->useSameBounds = false;
376  this->forceBounds = new proshade_signed [6];
377 
378  //================================================ Settings regarding extra cell space
379  this->addExtraSpace = 10.0;
380  this->coOrdsExtraSpace = 10.0;
381 
382  //================================================ Settings regarding shell settings
383  this->progressiveSphereMapping = false;
384 
385  //================================================ Settings regarding output file name
386  this->outName = "reBoxed";
387 
388  //================================================ Settings regarding distances computation
389  this->computeEnergyLevelsDesc = true;
390  this->computeTraceSigmaDesc = true;
391  this->computeRotationFuncDesc = true;
392  this->enLevMatrixPowerWeight = 1.0;
393 
394  //================================================ Settings regarding peak searching
395  this->peakNeighbours = 1;
396  this->noIQRsFromMedianNaivePeak = -999.9;
397 
398  //================================================ Settings regarding 1D grouping
399  this->smoothingFactor = 15.0;
400 
401  //================================================ Settings regarding the symmetry detection
402  this->findSymCentre = false;
403  this->useBiCubicInterpolationOnPeaks = true;
404  this->maxSymmetryFold = 30;
405  this->fscThreshold = 0.33;
406  this->peakThresholdMin = 0.75;
407  this->fastISearch = true;
408  this->symMissPeakThres = 0.3;
409  this->axisErrTolerance = 0.01;
410  this->axisErrToleranceDefault = true;
411  this->minSymPeak = 0.3;
412  this->recommendedSymmetryType = "";
413  this->recommendedSymmetryFold = 0;
414  this->requestedSymmetryType = "";
415  this->requestedSymmetryFold = 0;
416  this->detectedSymmetry.clear ( );
417 
418  //================================================ Settings regarding centre of map
419  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
420  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
421  ProSHADE_internal_misc::addToDoubleVector ( &this->centrePosition, std::numeric_limits< proshade_double >::infinity() );
422 
423  //================================================ Settings regarding the structure overlay
424  this->overlayStructureName = "movedStructure";
425  this->rotTrsJSONFile = "movedStructureOperations.json";
426 
427  //================================================ Settings regarding verbosity of the program
428  this->verbose = 1;
429  this->messageShift = 0;
430 
431  //================================================ Task specific settings
432  switch ( this->task )
433  {
434  case NA:
435  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
436  std::cerr << "Error Code : " << "E000014" << std::endl << std::flush;
437  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
438  std::cerr << "File : " << "ProSHADE.cpp" << std::endl << std::flush;
439  std::cerr << "Line : " << 97 << std::endl << std::flush;
440  std::cerr << "Function : " << "ProSHADE_settings (Task) constructor" << std::endl << std::flush;
441  std::cerr << "Message : " << "No task has been specified for task specific constructor." << std::endl << std::flush;
442  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;
444  exit ( EXIT_FAILURE );
445 
446  case Symmetry:
447  this->requestedResolution = 6.0;
448  this->pdbBFactorNewVal = 80.0;
449  this->changeMapResolution = true;
450  this->maskMap = false;
451  this->moveToCOM = true;
452  this->reBoxMap = false;
453  break;
454 
455  case Distances:
456  this->changeMapResolution = false;
457  this->maskMap = false;
458  this->moveToCOM = true;
459  this->reBoxMap = false;
460  break;
461 
462  case OverlayMap:
463  this->requestedResolution = 8.0;
464  this->changeMapResolution = true;
465  this->maskMap = false;
466  this->moveToCOM = false;
467  this->reBoxMap = false;
468  break;
469 
470  case MapManip:
471  this->changeMapResolution = false;
472  this->maskMap = true;
473  this->moveToCOM = false;
474  break;
475  }
476 
477  //================================================ Done
478 
479 }
480 
485 #if defined ( _WIN64 ) || defined ( _WIN32 )
486 __declspec(dllexport) ProSHADE_settings::~ProSHADE_settings ( void )
487 #else
489 #endif
490 {
491  //================================================ Release boundaries variable
492  delete[] this->forceBounds;
493 
494  //================================================ Release symmetry axes
495  if ( this->detectedSymmetry.size() > 0 ) { for ( proshade_unsign it = 0; it < static_cast<proshade_unsign> ( this->detectedSymmetry.size() ); it++ ) { if ( this->detectedSymmetry.at(it) != nullptr ) { delete[] this->detectedSymmetry.at(it); } } }
496 
497  //================================================ Done
498 
499 }
500 
504 {
505  //================================================ Determine the peak IQR from median threshold, unless given by user
506  const FloatingPoint< proshade_double > lhs ( this->noIQRsFromMedianNaivePeak ), rhs ( -999.9 );
507  if ( lhs.AlmostEquals( rhs ) )
508  {
509  //============================================ 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
510  if ( this->task == Distances ) { this->noIQRsFromMedianNaivePeak = 5.0; }
511  if ( this->task == Symmetry ) { this->noIQRsFromMedianNaivePeak = static_cast< proshade_double > ( std::max ( 0.0f, 1.0f - ( this->requestedResolution * 0.05f ) ) ); }
512  }
513 
514  //================================================ Done
515  return ;
516 
517 }
518 
526 #if defined ( _WIN64 ) || defined ( _WIN32 )
527 void __declspec(dllexport) ProSHADE_settings::addStructure ( std::string structure )
528 #else
529 void ProSHADE_settings::addStructure ( std::string structure )
530 #endif
531 {
532  //================================================ Use C++ version independent vector processing
533  ProSHADE_internal_misc::addToStringVector ( &( this->inputFiles ), structure );
534 
535  //================================================ Done
536  return ;
537 
538 }
539 
546 #if defined ( _WIN64 ) || defined ( _WIN32 )
547 void __declspec(dllexport) ProSHADE_settings::setResolution ( proshade_single resolution )
548 #else
549 void ProSHADE_settings::setResolution ( proshade_single resolution )
550 #endif
551 {
552  //================================================ Set the value
553  this->requestedResolution = resolution;
554 
555  //================================================ Done
556  return ;
557 
558 }
559 
566 #if defined ( _WIN64 ) || defined ( _WIN32 )
567 void __declspec(dllexport) ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
568 #else
569 void ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
570 #endif
571 {
572  //================================================ Set the value
573  this->pdbBFactorNewVal = newBF;
574 
575  //================================================ Done
576  return ;
577 
578 }
579 
586 #if defined ( _WIN64 ) || defined ( _WIN32 )
587 void __declspec(dllexport) ProSHADE_settings::setNormalisation ( bool normalise )
588 #else
589 void ProSHADE_settings::setNormalisation ( bool normalise )
590 #endif
591 {
592  //================================================ Set the value
593  this->normaliseMap = normalise;
594 
595  //================================================ Done
596  return ;
597 
598 }
599 
606 #if defined ( _WIN64 ) || defined ( _WIN32 )
607 void __declspec(dllexport) ProSHADE_settings::setMapInversion ( bool mInv )
608 #else
610 #endif
611 {
612  //================================================ Set the value
613  this->invertMap = mInv;
614 
615  //================================================ Done
616  return ;
617 
618 }
619 
626 #if defined ( _WIN64 ) || defined ( _WIN32 )
627 void __declspec(dllexport) ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
628 #else
629 void ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
630 #endif
631 {
632  //================================================ Set the value
633  this->verbose = verbosity;
634 
635  //================================================ Done
636  return ;
637 
638 }
639 
646 #if defined ( _WIN64 ) || defined ( _WIN32 )
647 void __declspec(dllexport) ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
648 #else
649 void ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
650 #endif
651 {
652  //================================================ Set the value
653  this->blurFactor = blurFac;
654 
655  //================================================ Done
656  return ;
657 
658 }
659 
667 #if defined ( _WIN64 ) || defined ( _WIN32 )
668 void __declspec(dllexport) ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
669 #else
670 void ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
671 #endif
672 {
673  //================================================ Set the value
674  this->maskingThresholdIQRs = noIQRs;
675 
676  //================================================ Done
677  return ;
678 
679 }
680 
687 #if defined ( _WIN64 ) || defined ( _WIN32 )
688 void __declspec(dllexport) ProSHADE_settings::setMasking ( bool mask )
689 #else
691 #endif
692 {
693  //================================================ Set the value
694  this->maskMap = mask;
695 
696  //================================================ Done
697  return ;
698 
699 }
700 
708 #if defined ( _WIN64 ) || defined ( _WIN32 )
709 void __declspec(dllexport) ProSHADE_settings::setCorrelationMasking ( bool corMask )
710 #else
712 #endif
713 {
714  //================================================ Set the value
715  this->useCorrelationMasking = corMask;
716 
717  //================================================ Done
718  return ;
719 
720 }
721 
730 #if defined ( _WIN64 ) || defined ( _WIN32 )
731 void __declspec(dllexport) ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
732 #else
733 void ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
734 #endif
735 {
736  //================================================ Set the value
737  this->halfMapKernel = typNoi;
738 
739  //================================================ Done
740  return ;
741 
742 }
743 
750 #if defined ( _WIN64 ) || defined ( _WIN32 )
751 void __declspec(dllexport) ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
752 #else
753 void ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
754 #endif
755 {
756  //================================================ Set the value
757  this->correlationKernel = minMS;
758 
759  //================================================ Done
760  return ;
761 
762 }
763 
770 #if defined ( _WIN64 ) || defined ( _WIN32 )
771 void __declspec(dllexport) ProSHADE_settings::setMaskSaving ( bool savMsk )
772 #else
774 #endif
775 {
776  //================================================ Set the value
777  this->saveMask = savMsk;
778 
779  //================================================ Done
780  return ;
781 
782 }
783 
790 #if defined ( _WIN64 ) || defined ( _WIN32 )
791 void __declspec(dllexport) ProSHADE_settings::setMaskFilename ( std::string mskFln )
792 #else
793 void ProSHADE_settings::setMaskFilename ( std::string mskFln )
794 #endif
795 {
796  //================================================ Set the value
797  this->maskFileName = mskFln;
798 
799  //================================================ Done
800  return ;
801 
802 }
803 
810 #if defined ( _WIN64 ) || defined ( _WIN32 )
811 void __declspec(dllexport) ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
812 #else
813 void ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
814 #endif
815 {
816  //================================================ Set the value
817  this->appliedMaskFileName = mskFln;
818 
819  //================================================ Done
820  return ;
821 
822 }
823 
830 #if defined ( _WIN64 ) || defined ( _WIN32 )
831 void __declspec(dllexport) ProSHADE_settings::setFourierWeightsFilename ( std::string fWgFln )
832 #else
834 #endif
835 {
836  //================================================ Set the value
837  this->fourierWeightsFileName = fWgFln;
838 
839  //================================================ Done
840  return ;
841 
842 }
843 
850 #if defined ( _WIN64 ) || defined ( _WIN32 )
851 void __declspec(dllexport) ProSHADE_settings::setMapReboxing ( bool reBx )
852 #else
854 #endif
855 {
856  //================================================ Set the value
857  this->reBoxMap = reBx;
858 
859  //================================================ Done
860  return ;
861 
862 }
863 
871 #if defined ( _WIN64 ) || defined ( _WIN32 )
872 void __declspec(dllexport) ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
873 #else
874 void ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
875 #endif
876 {
877  //================================================ Set the value
878  this->boundsExtraSpace = boundsExSp;
879 
880  //================================================ Done
881  return ;
882 
883 }
884 
891 #if defined ( _WIN64 ) || defined ( _WIN32 )
892 void __declspec(dllexport) ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
893 #else
894 void ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
895 #endif
896 {
897  //================================================ Set the value
898  this->boundsSimilarityThreshold = boundsThres;
899 
900  //================================================ Done
901  return ;
902 
903 }
904 
912 #if defined ( _WIN64 ) || defined ( _WIN32 )
913 void __declspec(dllexport) ProSHADE_settings::setSameBoundaries ( bool sameB )
914 #else
916 #endif
917 {
918  //================================================ Set the value
919  this->useSameBounds = sameB;
920 
921  //================================================ Done
922  return ;
923 
924 }
925 
933 #if defined ( _WIN64 ) || defined ( _WIN32 )
934 void __declspec(dllexport) ProSHADE_settings::setOutputFilename ( std::string oFileName )
935 #else
936 void ProSHADE_settings::setOutputFilename ( std::string oFileName )
937 #endif
938 {
939  //================================================ Set the value
940  this->outName = oFileName;
941 
942  //================================================ Done
943  return ;
944 
945 }
946 
953 #if defined ( _WIN64 ) || defined ( _WIN32 )
954 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChange ( bool mrChange )
955 #else
957 #endif
958 {
959  //================================================ Set the value
960  this->changeMapResolution = mrChange;
961 
962  //================================================ Done
963  return ;
964 
965 }
966 
973 #if defined ( _WIN64 ) || defined ( _WIN32 )
974 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChangeTriLinear ( bool mrChange )
975 #else
977 #endif
978 {
979  //================================================ Set the value
980  this->changeMapResolutionTriLinear = mrChange;
981 
982  //================================================ Done
983  return ;
984 
985 }
986 
993 #if defined ( _WIN64 ) || defined ( _WIN32 )
994 void __declspec(dllexport) ProSHADE_settings::setMapCentering ( bool com )
995 #else
997 #endif
998 {
999  //================================================ Set the value
1000  this->moveToCOM = com;
1001 
1002  //================================================ Done
1003  return ;
1004 
1005 }
1006 
1015 #if defined ( _WIN64 ) || defined ( _WIN32 )
1016 void __declspec(dllexport) ProSHADE_settings::setBoxCentering ( proshade_double xPos, proshade_double yPos, proshade_double zPos )
1017 #else
1018 void ProSHADE_settings::setBoxCentering ( proshade_double xPos, proshade_double yPos, proshade_double zPos )
1019 #endif
1020 {
1021  //================================================ If COM is on, issue warning!
1022  if ( this->moveToCOM )
1023  {
1024  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" );
1025  this->moveToCOM = false;
1026  }
1027 
1028  //================================================ Set the values
1029  this->boxCentre.at(0) = xPos;
1030  this->boxCentre.at(1) = yPos;
1031  this->boxCentre.at(2) = zPos;
1032 
1033  //================================================ Done
1034  return ;
1035 
1036 }
1037 
1044 #if defined ( _WIN64 ) || defined ( _WIN32 )
1045 void __declspec(dllexport) ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
1046 #else
1047 void ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
1048 #endif
1049 {
1050  //================================================ Set the value
1051  this->addExtraSpace = exSpace;
1052 
1053  //================================================ Done
1054  return ;
1055 
1056 }
1057 
1064 #if defined ( _WIN64 ) || defined ( _WIN32 )
1065 void __declspec(dllexport) ProSHADE_settings::setCoordExtraSpace ( proshade_single exSpace )
1066 #else
1067 void ProSHADE_settings::setCoordExtraSpace ( proshade_single exSpace )
1068 #endif
1069 {
1070  //================================================ Set the value
1071  this->coOrdsExtraSpace = exSpace;
1072 
1073  //================================================ Done
1074  return ;
1075 
1076 }
1077 
1084 #if defined ( _WIN64 ) || defined ( _WIN32 )
1085 void __declspec(dllexport) ProSHADE_settings::setBandwidth ( proshade_unsign band )
1086 #else
1087 void ProSHADE_settings::setBandwidth ( proshade_unsign band )
1088 #endif
1089 {
1090  //================================================ Set the value
1091  this->maxBandwidth = band;
1092 
1093  //================================================ Done
1094  return ;
1095 
1096 }
1097 
1104 #if defined ( _WIN64 ) || defined ( _WIN32 )
1105 void __declspec(dllexport) ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
1106 #else
1107 void ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
1108 #endif
1109 {
1110  //================================================ Set the value
1111  this->maxSphereDists = sphDist;
1112 
1113  //================================================ Done
1114  return ;
1115 
1116 }
1117 
1124 #if defined ( _WIN64 ) || defined ( _WIN32 )
1125 void __declspec(dllexport) ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
1126 #else
1127 void ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
1128 #endif
1129 {
1130  //================================================ Set the value
1131  this->integOrder = intOrd;
1132 
1133  //================================================ Done
1134  return ;
1135 
1136 }
1137 
1145 #if defined ( _WIN64 ) || defined ( _WIN32 )
1146 void __declspec(dllexport) ProSHADE_settings::setTaylorSeriesCap ( proshade_unsign tayCap )
1147 #else
1148 void ProSHADE_settings::setTaylorSeriesCap ( proshade_unsign tayCap )
1149 #endif
1150 {
1151  //================================================ Set the value
1152  this->taylorSeriesCap = tayCap;
1153 
1154  //================================================ Done
1155  return ;
1156 
1157 }
1158 
1165 #if defined ( _WIN64 ) || defined ( _WIN32 )
1166 void __declspec(dllexport) ProSHADE_settings::setProgressiveSphereMapping ( bool progSphMap )
1167 #else
1169 #endif
1170 {
1171  //================================================ Set the value
1172  this->progressiveSphereMapping = progSphMap;
1173 
1174  //================================================ Done
1175  return ;
1176 
1177 }
1178 
1186 #if defined ( _WIN64 ) || defined ( _WIN32 )
1187 void __declspec(dllexport) ProSHADE_settings::setEnergyLevelsComputation ( bool enLevDesc )
1188 #else
1190 #endif
1191 {
1192  //======================================== Set the value
1193  this->computeEnergyLevelsDesc = enLevDesc;
1194 
1195  //======================================== Done
1196  return ;
1197 
1198 }
1199 
1207 #if defined ( _WIN64 ) || defined ( _WIN32 )
1208 void __declspec(dllexport) ProSHADE_settings::setTraceSigmaComputation ( bool trSigVal )
1209 #else
1211 #endif
1212 {
1213  //================================================ Set the value
1214  this->computeTraceSigmaDesc = trSigVal;
1215 
1216  //================================================ Done
1217  return ;
1218 
1219 }
1220 
1228 #if defined ( _WIN64 ) || defined ( _WIN32 )
1229 void __declspec(dllexport) ProSHADE_settings::setRotationFunctionComputation ( bool rotfVal )
1230 #else
1232 #endif
1233 {
1234  //================================================ Set the value
1235  this->computeRotationFuncDesc = rotfVal;
1236 
1237  //================================================ Done
1238  return ;
1239 
1240 }
1241 
1249 #if defined ( _WIN64 ) || defined ( _WIN32 )
1250 void __declspec(dllexport) ProSHADE_settings::setPeakNeighboursNumber ( proshade_unsign pkS )
1251 #else
1253 #endif
1254 {
1255  //================================================ Set the value
1256  this->peakNeighbours = pkS;
1257 
1258  //================================================ Done
1259  return ;
1260 
1261 }
1262 
1271 #if defined ( _WIN64 ) || defined ( _WIN32 )
1272 void __declspec(dllexport) ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1273 #else
1274 void ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1275 #endif
1276 {
1277  //================================================ Set the value
1278  this->noIQRsFromMedianNaivePeak = noIQRs;
1279 
1280  //================================================ Done
1281  return ;
1282 
1283 }
1284 
1293 #if defined ( _WIN64 ) || defined ( _WIN32 )
1294 void __declspec(dllexport) ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1295 #else
1296 void ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1297 #endif
1298 {
1299  //================================================ Set the value
1300  this->usePhase = phaseUsage;
1301 
1302  //================================================ Done
1303  return ;
1304 
1305 }
1306 
1315 #if defined ( _WIN64 ) || defined ( _WIN32 )
1316 void __declspec(dllexport) ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1317 #else
1318 void ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1319 #endif
1320 {
1321  //================================================ Set the value
1322  this->enLevMatrixPowerWeight = mPower;
1323 
1324  //================================================ Done
1325  return ;
1326 
1327 }
1328 
1337 #if defined ( _WIN64 ) || defined ( _WIN32 )
1338 void __declspec(dllexport) ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1339 #else
1340 void ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1341 #endif
1342 {
1343  //================================================ Set the value
1344  this->smoothingFactor = smFact;
1345 
1346  //================================================ Done
1347  return ;
1348 
1349 }
1350 
1358 #if defined ( _WIN64 ) || defined ( _WIN32 )
1359 void __declspec(dllexport) ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1360 #else
1361 void ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1362 #endif
1363 {
1364  //================================================ Set the value
1365  this->symMissPeakThres = mpThres;
1366 
1367  //================================================ Done
1368  return ;
1369 
1370 }
1371 
1379 #if defined ( _WIN64 ) || defined ( _WIN32 )
1380 void __declspec(dllexport) ProSHADE_settings::setSymmetryCentreSearch ( bool sCen )
1381 #else
1383 #endif
1384 {
1385  //================================================ Set the value
1386  this->findSymCentre = sCen;
1387 
1388  //================================================ Done
1389  return ;
1390 
1391 }
1392 
1400 #if defined ( _WIN64 ) || defined ( _WIN32 )
1401 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1402 #else
1403 void ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1404 #endif
1405 {
1406  //================================================ Set the value
1407  this->axisErrTolerance = axThres;
1408 
1409  //================================================ Done
1410  return ;
1411 
1412 }
1413 
1423 #if defined ( _WIN64 ) || defined ( _WIN32 )
1424 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThresholdBehaviour ( bool behav )
1425 #else
1427 #endif
1428 {
1429  //================================================ Set the value
1430  this->axisErrToleranceDefault = behav;
1431 
1432  //================================================ Done
1433  return ;
1434 
1435 }
1436 
1444 #if defined ( _WIN64 ) || defined ( _WIN32 )
1445 void __declspec(dllexport) ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1446 #else
1447 void ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1448 #endif
1449 {
1450  //================================================ Set the value
1451  this->minSymPeak = minSP;
1452 
1453  //================================================ Done
1454  return ;
1455 
1456 }
1457 
1466 #if defined ( _WIN64 ) || defined ( _WIN32 )
1467 void __declspec(dllexport) ProSHADE_settings::setRecommendedSymmetry ( std::string val )
1468 #else
1470 #endif
1471 {
1472  //================================================ Set the value
1473  this->recommendedSymmetryType = val;
1474 
1475  //================================================ Done
1476  return ;
1477 
1478 }
1479 
1489 #if defined ( _WIN64 ) || defined ( _WIN32 )
1490 void __declspec(dllexport) ProSHADE_settings::setRecommendedFold ( proshade_unsign val )
1491 #else
1492 void ProSHADE_settings::setRecommendedFold ( proshade_unsign val )
1493 #endif
1494 {
1495  //================================================ Set the value
1496  this->recommendedSymmetryFold = val;
1497 
1498  //================================================ Done
1499  return ;
1500 
1501 }
1502 
1509 #if defined ( _WIN64 ) || defined ( _WIN32 )
1510 void __declspec(dllexport) ProSHADE_settings::setRequestedSymmetry ( std::string val )
1511 #else
1513 #endif
1514 {
1515  //================================================ Set the value
1516  this->requestedSymmetryType = val;
1517 
1518  //================================================ Done
1519  return ;
1520 
1521 }
1522 
1529 #if defined ( _WIN64 ) || defined ( _WIN32 )
1530 void __declspec(dllexport) ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1531 #else
1532 void ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1533 #endif
1534 {
1535  //================================================ Set the value
1536  this->requestedSymmetryFold = val;
1537 
1538  //================================================ Done
1539  return ;
1540 
1541 }
1542 
1550 #if defined ( _WIN64 ) || defined ( _WIN32 )
1551 void __declspec(dllexport) ProSHADE_settings::setDetectedSymmetry ( proshade_double* sym )
1552 #else
1553 void ProSHADE_settings::setDetectedSymmetry ( proshade_double* sym )
1554 #endif
1555 {
1556  //================================================ Allocate memory
1557  proshade_double* hlpAxis = new proshade_double [7];
1558  ProSHADE_internal_misc::checkMemoryAllocation ( hlpAxis, __FILE__, __LINE__, __func__ );
1559 
1560  //================================================ Copy (deep) data
1561  hlpAxis[0] = sym[0];
1562  hlpAxis[1] = sym[1];
1563  hlpAxis[2] = sym[2];
1564  hlpAxis[3] = sym[3];
1565  hlpAxis[4] = sym[4];
1566  hlpAxis[5] = sym[5];
1567  hlpAxis[6] = sym[6];
1568 
1569  //================================================ Save
1570  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->detectedSymmetry, hlpAxis );
1571 
1572  //================================================ Release memory
1573  delete[] hlpAxis;
1574 
1575  //================================================ Done
1576  return ;
1577 
1578 }
1579 
1584 #if defined ( _WIN64 ) || defined ( _WIN32 )
1585 void __declspec(dllexport) ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1586 #else
1587 void ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1588 #endif
1589 {
1590  //================================================ Set the value
1591  this->overlayStructureName = filename;
1592 
1593  //================================================ Done
1594  return ;
1595 
1596 }
1597 
1602 #if defined ( _WIN64 ) || defined ( _WIN32 )
1603 void __declspec(dllexport) ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1604 #else
1605 void ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1606 #endif
1607 {
1608  //================================================ Set the value
1609  this->rotTrsJSONFile = filename;
1610 
1611  //================================================ Done
1612  return ;
1613 
1614 }
1615 
1620 #if defined ( _WIN64 ) || defined ( _WIN32 )
1621 void __declspec(dllexport) ProSHADE_settings::setBicubicInterpolationSearch ( bool bicubPeaks )
1622 #else
1624 #endif
1625 {
1626  //================================================ Set the value
1627  this->useBiCubicInterpolationOnPeaks = bicubPeaks;
1628 
1629  //================================================ Done
1630  return ;
1631 
1632 }
1633 
1638 #if defined ( _WIN64 ) || defined ( _WIN32 )
1639 void __declspec(dllexport) ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1640 #else
1641 void ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1642 #endif
1643 {
1644  //================================================ Set the value
1645  this->maxSymmetryFold = maxFold;
1646 
1647  //================================================ Done
1648  return ;
1649 
1650 }
1651 
1656 #if defined ( _WIN64 ) || defined ( _WIN32 )
1657 void __declspec(dllexport) ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1658 #else
1659 void ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1660 #endif
1661 {
1662  //================================================ Set the value
1663  this->fscThreshold = fscThr;
1664 
1665  //================================================ Done
1666  return ;
1667 
1668 }
1669 
1674 #if defined ( _WIN64 ) || defined ( _WIN32 )
1675 void __declspec(dllexport) ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1676 #else
1677 void ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1678 #endif
1679 {
1680  //================================================ Set the value
1681  this->peakThresholdMin = peakThr;
1682 
1683  //================================================ Done
1684  return ;
1685 
1686 }
1687 
1692 #if defined ( _WIN64 ) || defined ( _WIN32 )
1693 void __declspec(dllexport) ProSHADE_settings::setNegativeDensity ( bool nDens )
1694 #else
1696 #endif
1697 {
1698  //================================================ Set the value
1699  this->removeNegativeDensity = nDens;
1700 
1701  //================================================ Done
1702  return ;
1703 
1704 }
1705 
1714 void ProSHADE_settings::determineBandwidth ( proshade_unsign circumference )
1715 {
1716  //================================================ Check the current settings value is set to auto
1717  if ( this->maxBandwidth != 0 )
1718  {
1719  std::stringstream hlpSS;
1720  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1721  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1722  return ;
1723  }
1724 
1725  //================================================ Determine automatically
1727 
1728  //================================================ Report progress
1729  std::stringstream hlpSS;
1730  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1731  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1732 
1733  //================================================ Done
1734  return ;
1735 
1736 }
1737 
1746 void ProSHADE_settings::determineBandwidthFromAngle ( proshade_double uncertainty )
1747 {
1748  //================================================ Determine bandwidth
1749  if ( static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2 ) ) % 2 == 0 )
1750  {
1751  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) );
1752  }
1753  else
1754  {
1755  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) ) + 1;
1756  }
1757 
1758  //================================================ Report progress
1759  std::stringstream hlpSS;
1760  hlpSS << "The bandwidth was determined from uncertainty " << uncertainty << " degrees as: " << this->maxBandwidth;
1761  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1762 
1763  //================================================ Done
1764  return ;
1765 
1766 }
1767 
1777 void ProSHADE_settings::determineSphereDistances ( proshade_single maxMapRange )
1778 {
1779  //================================================ Check the current settings value is set to auto
1780  if ( this->maxSphereDists != 0.0f )
1781  {
1782  std::stringstream hlpSS;
1783  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1784  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1785  return ;
1786  }
1787 
1788  //================================================ Determine automatically
1790 
1791  //================================================ Report progress
1792  std::stringstream hlpSS;
1793  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1794  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1795 
1796  //================================================ Done
1797  return ;
1798 
1799 }
1800 
1809 void ProSHADE_settings::determineIntegrationOrder ( proshade_single maxMapRange )
1810 {
1811  //================================================ Check the current settings value is set to auto
1812  if ( this->integOrder != 0 )
1813  {
1814  std::stringstream hlpSS;
1815  hlpSS << "The integration order was determined as " << this->integOrder;
1816  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1817  return ;
1818  }
1819 
1820  //================================================ Determine automatically
1822 
1823  //================================================ Report progress
1824  std::stringstream hlpSS;
1825  hlpSS << "The integration order was determined as " << this->integOrder;
1826  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 3, hlpSS.str(), this->messageShift );
1827 
1828  //================================================ Done
1829  return ;
1830 
1831 }
1832 
1853 void ProSHADE_settings::determineAllSHValues ( proshade_unsign xDim, proshade_unsign yDim, proshade_single xDimAngs, proshade_single yDimAngs, proshade_single zDimAngs )
1854 {
1855  //================================================ Print progress message
1856  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 1, "Preparing spherical harmonics environment.", this->messageShift );
1857 
1858  //================================================ Modify dims by resolution
1859  proshade_unsign theoXDim = static_cast< proshade_unsign > ( std::ceil ( xDimAngs / ( this->requestedResolution / 2.0f ) ) );
1860  proshade_unsign theoYDim = static_cast< proshade_unsign > ( std::ceil ( yDimAngs / ( this->requestedResolution / 2.0f ) ) );
1861  proshade_unsign theoZDim = static_cast< proshade_unsign > ( std::ceil ( zDimAngs / ( this->requestedResolution / 2.0f ) ) );
1862 
1863  //================================================ Find maximum circumference
1864  proshade_unsign maxDim = std::max ( theoXDim, std::max ( theoYDim, theoZDim ) );
1865  proshade_unsign minDim = std::min ( theoXDim, std::min ( theoYDim, theoZDim ) );
1866  proshade_unsign midDim = 0;
1867  if ( ( xDim < maxDim ) && ( xDim > minDim ) ) { midDim = theoXDim; }
1868  else if ( ( yDim < maxDim ) && ( yDim > minDim ) ) { midDim = theoYDim; }
1869  else { midDim = theoZDim; }
1870 
1871  proshade_unsign circ = ( maxDim ) + ( midDim );
1872 
1873  //================================================ Bandwidth
1874  if ( this->rotationUncertainty > 0.0 ) { this->determineBandwidthFromAngle ( this->rotationUncertainty ); }
1875  else { this->determineBandwidth ( circ ); }
1876 
1877  //================================================ Find maximum diagonal in Angstroms
1878  proshade_single maxDiag = static_cast< proshade_single > ( std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) +
1879  std::pow ( static_cast<proshade_single> ( midDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) ) );
1880 
1881  //================================================ Sphere distances
1882  this->determineSphereDistances ( maxDiag );
1883 
1884  //================================================ Integration order
1885  this->determineIntegrationOrder ( maxDiag );
1886 
1887  //================================================ Report function completion
1888  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 2, "Spherical harmonics environment prepared.", this->messageShift );
1889 
1890  //================================================ Done
1891  return ;
1892 
1893 }
1894 
1902 #if defined ( _WIN64 ) || defined ( _WIN32 )
1903 __declspec(dllexport) ProSHADE_run::ProSHADE_run ( ProSHADE_settings* settings )
1904 #else
1906 #endif
1907 {
1908  //================================================ Wellcome message if required
1910 
1911  //================================================ Save the general information
1912  this->noStructures = static_cast<proshade_unsign> ( settings->inputFiles.size() );
1913  this->verbose = static_cast<proshade_signed> ( settings->verbose );
1914 
1915  //================================================ Try to run ProSHADE
1916  try
1917  {
1918  //============================================ Depending on task, switch to correct function to call
1919  switch ( settings->task )
1920  {
1921  case NA:
1922  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." );
1923 
1924  case Symmetry:
1925  ProSHADE_internal_tasks::SymmetryDetectionTask ( settings, &this->RecomSymAxes, &this->allCSymAxes, &this->mapCOMShift );
1926  this->setSymmetryResults ( settings );
1927  break;
1928 
1929  case Distances:
1930  ProSHADE_internal_tasks::DistancesComputationTask ( settings, &this->enLevs, &this->trSigm, &this->rotFun );
1931  break;
1932 
1933  case OverlayMap:
1934  ProSHADE_internal_tasks::MapOverlayTask ( settings, &this->coordRotationCentre, &this->eulerAngles, &this->overlayTranslation );
1935  break;
1936 
1937  case MapManip:
1938  ProSHADE_internal_tasks::MapManipulationTask ( settings, &this->originalBounds, &this->reboxedBounds, &this->manipulatedMaps );
1939  break;
1940  }
1941  }
1942 
1943  //================================================ If this is ProSHADE exception, give all available info and terminate gracefully :-)
1944  catch ( ProSHADE_exception& err )
1945  {
1946  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1947  std::cerr << "Error Code : " << err.get_errc() << std::endl << std::flush;
1948  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
1949  std::cerr << "File : " << err.get_file() << std::endl << std::flush;
1950  std::cerr << "Line : " << err.get_line() << std::endl << std::flush;
1951  std::cerr << "Function : " << err.get_func() << std::endl << std::flush;
1952  std::cerr << "Message : " << err.what() << std::endl << std::flush;
1953  std::cerr << "Further information : " << err.get_info() << std::endl << std::endl << std::flush;
1954 
1955  //============================================ Done
1957  exit ( EXIT_FAILURE );
1958  }
1959 
1960  //================================================ Well, give all there is and just end
1961  catch ( ... )
1962  {
1963  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1964 
1965  //============================================ Try to find out more
1966 #if __cplusplus >= 201103L
1967  std::exception_ptr exc = std::current_exception();
1968  try
1969  {
1970  if (exc)
1971  {
1972  std::rethrow_exception ( exc );
1973  }
1974  }
1975  catch ( const std::exception& e )
1976  {
1977  std::cerr << "Caught unknown exception with following information: " << e.what() << std::endl << std::flush;
1978  }
1979 #else
1980  std::cerr << "Unknown error with no further explanation available. Please contact the author for help." << std::endl << std::flush;
1981 #endif
1982  std::cerr << "Terminating..." << std::endl << std::endl << std::flush;
1983 
1984  //============================================ Done
1986  exit ( EXIT_FAILURE );
1987  }
1988 
1989  //================================================ Terminating message
1991 
1992  //================================================ Done
1993 
1994 }
1995 
2000 #if defined ( _WIN64 ) || defined ( _WIN32 )
2001 __declspec(dllexport) ProSHADE_run::~ProSHADE_run ( )
2002 #else
2004 #endif
2005 {
2006  //================================================ Release reboxing pointers
2007  if ( this->originalBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->originalBounds.size() ); iter++ ) { delete[] this->originalBounds.at(iter); } }
2008  if ( this->reboxedBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->reboxedBounds.size() ); iter++ ) { delete[] this->reboxedBounds.at(iter); } }
2009  if ( this->manipulatedMaps.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->manipulatedMaps.size() ); iter++ ) { delete[] this->manipulatedMaps.at(iter); } }
2010 
2011  //================================================ Clear vectors
2012  this->enLevs.clear ( );
2013  this->trSigm.clear ( );
2014  this->rotFun.clear ( );
2015 
2016  //================================================ Delete symmetry axes memory
2017  if ( this->RecomSymAxes.size() > 0 )
2018  {
2019  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->RecomSymAxes.size() ); iter++ )
2020  {
2021  delete[] this->RecomSymAxes.at(iter);
2022  }
2023  this->RecomSymAxes.clear ( );
2024  }
2025 
2026  //================================================ Done
2027 
2028 }
2029 
2034 #if defined ( _WIN64 ) || defined ( _WIN32 )
2035 std::string __declspec(dllexport) ProSHADE_run::getSymmetryType ( )
2036 #else
2038 #endif
2039 
2040 {
2041  //================================================ Return the value
2042  return ( this->symRecommType );
2043 }
2044 
2049 #if defined ( _WIN64 ) || defined ( _WIN32 )
2050 proshade_unsign __declspec(dllexport) ProSHADE_run::getSymmetryFold ( )
2051 #else
2053 #endif
2054 {
2055  //================================================ Return the value
2056  return ( this->symRecommFold );
2057 }
2058 
2065 void ProSHADE_run::setRecommendedSymmetry ( std::string val )
2066 {
2067  //================================================ Set the value
2068  this->symRecommType = val;
2069 
2070  //================================================ Done
2071  return ;
2072 
2073 }
2074 
2082 void ProSHADE_run::setRecommendedFold ( proshade_unsign val )
2083 {
2084  //================================================ Set the value
2085  this->symRecommFold = val;
2086 
2087  //================================================ Done
2088  return ;
2089 
2090 }
2091 
2099 void ProSHADE_run::setRecommendedAxis ( proshade_double* sym )
2100 {
2101  //================================================ Set the value
2102  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->RecomSymAxes, sym );
2103 
2104  //================================================ Done
2105  return ;
2106 
2107 }
2108 
2116 void ProSHADE_run::setSymmetryResults ( ProSHADE_settings* settings )
2117 {
2118  //================================================ Save type and fold
2119  this->setRecommendedSymmetry ( settings->recommendedSymmetryType );
2120  this->setRecommendedFold ( settings->recommendedSymmetryFold );
2121 
2122  //================================================ Done
2123  return ;
2124 
2125 }
2126 
2132 #if defined ( _WIN64 ) || defined ( _WIN32 )
2133 void __declspec(dllexport) ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
2134 #else
2135 void ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
2136 #endif
2137 {
2138  //================================================ If no command line arguments, print help
2139  if ( argc == 1 ) { ProSHADE_internal_messages::printHelp ( ); }
2140 
2141  //================================================ Long options struct
2142  const struct option_port longopts[] =
2143  {
2144  { "version", no_argument, nullptr, 'v' },
2145  { "help", no_argument, nullptr, 'h' },
2146  { "verbose", required_argument, nullptr, '!' },
2147  { "distances", no_argument, nullptr, 'D' },
2148  { "mapManip", no_argument, nullptr, 'M' },
2149  { "symmetry", no_argument, nullptr, 'S' },
2150  { "symCentre", no_argument, nullptr, 'I' },
2151  { "overlay", no_argument, nullptr, 'O' },
2152  { "file", required_argument, nullptr, 'f' },
2153  { "forceSpgP1", no_argument, nullptr, 'u' },
2154  { "removeWaters", no_argument, nullptr, 'w' },
2155  { "firstModel", no_argument, nullptr, 'x' },
2156  { "resolution", required_argument, nullptr, 'r' },
2157  { "bandwidth", required_argument, nullptr, 'b' },
2158  { "sphereDists", required_argument, nullptr, 's' },
2159  { "extraSpace", required_argument, nullptr, 'e' },
2160  { "integOrder", required_argument, nullptr, 'i' },
2161  { "taylorCap", required_argument, nullptr, 't' },
2162  { "invertMap", no_argument, nullptr, '@' },
2163  { "normalise", no_argument, nullptr, '#' },
2164  { "mask", no_argument, nullptr, '$' },
2165  { "saveMask", no_argument, nullptr, '%' },
2166  { "maskFile", required_argument, nullptr, '^' },
2167  { "applyMask", required_argument, nullptr, 'G' },
2168  { "maskBlurring", required_argument, nullptr, '&' },
2169  { "maskThreshold", required_argument, nullptr, '*' },
2170  { "mapReboxing", no_argument, nullptr, 'R' },
2171  { "boundsSpace", required_argument, nullptr, '(' },
2172  { "boundsThreshold", required_argument, nullptr, ')' },
2173  { "sameBoundaries", no_argument, nullptr, '-' },
2174  { "reBoxedFilename", required_argument, nullptr, 'g' },
2175  { "pdbTempFact", required_argument, nullptr, 'd' },
2176  { "center", no_argument, nullptr, 'c' },
2177  { "changeMapResol", no_argument, nullptr, 'j' },
2178  { "changeMapTriLin", no_argument, nullptr, 'a' },
2179  { "noPhase", no_argument, nullptr, 'p' },
2180  { "progressive", no_argument, nullptr, 'k' },
2181  { "noEnL", no_argument, nullptr, 'l' },
2182  { "noTrS", no_argument, nullptr, 'm' },
2183  { "noFRF", no_argument, nullptr, 'n' },
2184  { "EnLWeight", required_argument, nullptr, '_' },
2185  { "peakNeigh", required_argument, nullptr, '=' },
2186  { "peakThres", required_argument, nullptr, '+' },
2187  { "missAxThres", required_argument, nullptr, '[' },
2188  { "sameAxComp", required_argument, nullptr, ']' },
2189  { "axisComBeh", no_argument, nullptr, 'q' },
2190  { "bicubSearch", no_argument, nullptr, 'A' },
2191  { "maxSymPrime", required_argument, nullptr, 'B' },
2192  { "minPeakHeight", required_argument, nullptr, 'o' },
2193  { "fscThres", required_argument, nullptr, 'C' },
2194  { "peakMinThres", required_argument, nullptr, 'E' },
2195  { "reqSym", required_argument, nullptr, '{' },
2196  { "overlayFile", required_argument, nullptr, '}' },
2197  { "overlayJSONFile", required_argument, nullptr, 'y' },
2198  { "angUncertain", required_argument, nullptr, ';' },
2199  { "fourierWeights", required_argument, nullptr, 'z' },
2200  { "keepNegDens", no_argument, nullptr, 'F' },
2201  { "coordExtraSpace", required_argument, nullptr, 'H' },
2202  { nullptr, 0, nullptr, 0 }
2203  };
2204 
2205  //================================================ Short options string
2206  const char* const shortopts = "AaB:b:C:cDd:E:e:Ff:G:g:H:hIi:jklmMno:Opqr:Rs:St:uvwxy:z:!:@#$%^:&:*:(:):-_:=:+:[:]:{:}:;:";
2207 
2208  //================================================ Parsing the options
2209  while ( true )
2210  {
2211  //============================================ Read the next option
2212  int opt = getopt_long_port ( argc, argv, shortopts, longopts, nullptr );
2213 
2214  //============================================ Done parsing
2215  if ( opt == -1 )
2216  {
2217  break;
2218  }
2219 
2220  //============================================ For each option, set the internal values appropriately
2221  switch ( opt )
2222  {
2223  //======================================= Print version info
2224  case 'v':
2225  {
2227  exit ( EXIT_SUCCESS );
2228  }
2229 
2230  //======================================= User needs help
2231  case 'h':
2232  {
2234  }
2235 
2236  //======================================= Save the argument as the verbosity value, or if no value given, just set to 3
2237  case '!':
2238  {
2239  this->setVerbosity ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
2240  continue;
2241  }
2242 
2243  //======================================= Set task to distances
2244  case 'D':
2245  {
2246  this->task = Distances;
2247  continue;
2248  }
2249 
2250  //======================================= Set task to map manipulation
2251  case 'M':
2252  {
2253  this->task = MapManip;
2254  continue;
2255  }
2256 
2257  //======================================= Set task to symmetry detection
2258  case 'S':
2259  {
2260  this->task = Symmetry;
2261 
2262  //=================================== Force default unless changed already by the user
2263  const FloatingPoint< proshade_single > lhs1 ( this->requestedResolution ), rhs1 ( -1.0f );
2264  if ( lhs1.AlmostEquals ( rhs1 ) ) { this->requestedResolution = 6.0; }
2265 
2266  const FloatingPoint< proshade_double > lhs2 ( this->pdbBFactorNewVal ), rhs2 ( -1.0 );
2267  if ( lhs2.AlmostEquals ( rhs2 ) ) { this->pdbBFactorNewVal = 80.0; }
2268  this->changeMapResolution = !this->changeMapResolution; // Switch value. This can be over-ridden by the user by using -j
2269  this->moveToCOM = !this->moveToCOM; // Switch value. This can be over-ridden by the user by using -c.
2270 
2271  continue;
2272  }
2273 
2274  //======================================= Set task to map overlay
2275  case 'O':
2276  {
2277  this->task = OverlayMap;
2278  continue;
2279  }
2280 
2281  //======================================= Save the argument as a file to read in
2282  case 'f':
2283  {
2284  this->addStructure ( std::string ( optarg ) );
2285  continue;
2286  }
2287 
2288  //======================================= Force the input PDB files to have P1 spacegroup
2289  case 'u':
2290  {
2291  this->forceP1 = !this->forceP1;
2292  continue;
2293  }
2294 
2295  //======================================= Remove waters from PDB input files?
2296  case 'w':
2297  {
2298  this->removeWaters = !this->removeWaters;
2299  continue;
2300  }
2301 
2302  //======================================= Use all models, or just the first one?
2303  case 'x':
2304  {
2305  this->firstModelOnly = !this->firstModelOnly;
2306  continue;
2307  }
2308 
2309  //======================================= Save the argument as the resolution value
2310  case 'r':
2311  {
2312  this->setResolution ( static_cast<proshade_single> ( atof ( optarg ) ) );
2313  continue;
2314  }
2315 
2316  //======================================= Save the argument as the bandwidth value
2317  case 'b':
2318  {
2319  this->setBandwidth ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2320  continue;
2321  }
2322 
2323  //======================================= Save the argument as the extra space value
2324  case 'e':
2325  {
2326  this->setExtraSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2327  continue;
2328  }
2329 
2330  //======================================= Save the argument as the co-ordinate extra space value
2331  case 'H':
2332  {
2333  this->setCoordExtraSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2334  continue;
2335  }
2336 
2337  //======================================= Save the argument as the intaggration order value
2338  case 'i':
2339  {
2340  this->setIntegrationOrder ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2341  continue;
2342  }
2343 
2344  //======================================= Save the argument as the sphere distance value
2345  case 's':
2346  {
2347  this->setSphereDistances ( static_cast<proshade_single> ( atof ( optarg ) ) );
2348  continue;
2349  }
2350 
2351  //======================================= Save the argument as the taylor series cap value
2352  case 't':
2353  {
2354  this->setTaylorSeriesCap ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2355  continue;
2356  }
2357 
2358  //======================================= Set map inversion to true
2359  case '@':
2360  {
2361  this->setMapInversion ( true );
2362  continue;
2363  }
2364 
2365  //======================================= Set map normalisation to true
2366  case '#':
2367  {
2368  this->setNormalisation ( true );
2369  continue;
2370  }
2371 
2372  //======================================= Set map masking to true
2373  case '$':
2374  {
2375  this->setMasking ( true );
2376  continue;
2377  }
2378 
2379  //======================================= Set map masking to true and mask map saving to true as well
2380  case '%':
2381  {
2382  this->setMasking ( true );
2383  this->setMaskSaving ( true );
2384  continue;
2385  }
2386 
2387  //======================================= Save the argument as the mask filename value
2388  case '^':
2389  {
2390  this->setMaskFilename ( static_cast<std::string> ( optarg ) );
2391  continue;
2392  }
2393 
2394  //======================================= Save the argument as the mask filename value
2395  case 'G':
2396  {
2397  this->setAppliedMaskFilename ( static_cast<std::string> ( optarg ) );
2398  continue;
2399  }
2400 
2401  //======================================= Save the argument as the Fourier weights filename value
2402  case 'z':
2403  {
2404  this->setFourierWeightsFilename ( static_cast<std::string> ( optarg ) );
2405  continue;
2406  }
2407 
2408  //======================================= Save the argument as the mask blurring factor value
2409  case '&':
2410  {
2411  this->setMaskBlurFactor ( static_cast<proshade_single> ( atof ( optarg ) ) );
2412  continue;
2413  }
2414 
2415  //======================================= Save the argument as the mask threshold (IQR) value
2416  case '*':
2417  {
2418  this->setMaskIQR ( static_cast<proshade_single> ( atof ( optarg ) ) );
2419  continue;
2420  }
2421 
2422  //======================================= Set map reboxing to true
2423  case 'R':
2424  {
2425  this->setMasking ( true );
2426  this->setMapReboxing ( true );
2427  continue;
2428  }
2429 
2430  //======================================= Save the argument as the bounds extra space value
2431  case '(':
2432  {
2433  this->setBoundsSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2434  continue;
2435  }
2436 
2437  //======================================= Save the argument as the bounds similarity threshold value
2438  case ')':
2439  {
2440  this->setBoundsThreshold ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
2441  continue;
2442  }
2443 
2444  //======================================= Set same boundaries to true
2445  case '-':
2446  {
2447  this->setSameBoundaries ( true );
2448  continue;
2449  }
2450 
2451  //======================================= Save the argument as the re-boxed structure filename value
2452  case 'g':
2453  {
2454  this->setOutputFilename ( static_cast<std::string> ( optarg ) );
2455  continue;
2456  }
2457 
2458  //======================================= Save the argument as the PDB B-factor new constant value
2459  case 'd':
2460  {
2461  this->setPDBBFactor ( static_cast<proshade_double> ( atof ( optarg ) ) );
2462  continue;
2463  }
2464 
2465  //======================================= Set map centering to true
2466  case 'c':
2467  {
2468  this->moveToCOM = !this->moveToCOM;
2469  continue;
2470  }
2471 
2472  //======================================= Set map resolution change using Fourier transforms to true
2473  case 'j':
2474  {
2475  this->changeMapResolution = !this->changeMapResolution;
2476  continue;
2477  }
2478 
2479  //======================================= Set map resolution change using real-space tri-linear interpolation to true
2480  case 'a':
2481  {
2482  this->setMapResolutionChangeTriLinear ( true );
2483  continue;
2484  }
2485 
2486  //======================================= Set map phase removal to true
2487  case 'p':
2488  {
2489  this->setPhaseUsage ( false );
2490  continue;
2491  }
2492 
2493  //======================================= Set progressive shell mapping to true
2494  case 'k':
2495  {
2496  this->setProgressiveSphereMapping ( true );
2497  continue;
2498  }
2499 
2500  //======================================= Set energy level descriptor computation to false
2501  case 'l':
2502  {
2503  this->setEnergyLevelsComputation ( false );
2504  continue;
2505  }
2506 
2507  //======================================= Set trace sigma descriptor computation to false
2508  case 'm':
2509  {
2510  this->setTraceSigmaComputation ( false );
2511  continue;
2512  }
2513 
2514  //======================================= Set full rotation function descriptor computation to false
2515  case 'n':
2516  {
2517  this->setRotationFunctionComputation ( false );
2518  continue;
2519  }
2520 
2521  //======================================= Save the argument as the energy levels descriptor weight value
2522  case '_':
2523  {
2524  this->setEnLevShellWeight ( static_cast<proshade_double> ( atof ( optarg ) ) );
2525  continue;
2526  }
2527 
2528  //======================================= Save the argument as the peak neighbours minimum value
2529  case '=':
2530  {
2531  this->setPeakNeighboursNumber ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2532  continue;
2533  }
2534 
2535  //======================================= Save the argument as the peak IQR from median naive small peaks removal value
2536  case '+':
2537  {
2538  this->setPeakNaiveNoIQR ( static_cast<proshade_double> ( atof ( optarg ) ) );
2539  continue;
2540  }
2541 
2542  //======================================= Save the argument as the symmetry centre search required value
2543  case 'I':
2544  {
2545  this->setSymmetryCentreSearch ( true );
2546  continue;
2547  }
2548 
2549  //======================================= Save the argument as the missing axis threshold value
2550  case '[':
2551  {
2552  this->setMissingPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2553  continue;
2554  }
2555 
2556  //======================================= Save the argument as the missing axis threshold value
2557  case ']':
2558  {
2559  setAxisComparisonThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2560  continue;
2561  }
2562 
2563  //======================================= Save the argument as the missing axis threshold value
2564  case 'q':
2565  {
2566  this->setAxisComparisonThresholdBehaviour ( !this->axisErrToleranceDefault );
2567  continue;
2568  }
2569 
2570  //======================================= Save the argument as the bicubic interpolation search requirement value
2571  case 'A':
2572  {
2573  this->setBicubicInterpolationSearch ( !this->useBiCubicInterpolationOnPeaks );
2574  continue;
2575  }
2576 
2577  //======================================= Save the argument as the bicubic interpolation search requirement value
2578  case 'B':
2579  {
2580  setMaxSymmetryFold ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2581  continue;
2582  }
2583 
2584  //======================================= Minimum peak height for axis
2585  case 'o':
2586  {
2587  this->minSymPeak = static_cast<proshade_double> ( atof ( optarg ) );
2588  continue;
2589  }
2590 
2591  //======================================= Minimum FSC value for axis to be detected
2592  case 'C':
2593  {
2594  this->setFSCThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2595  continue;
2596  }
2597 
2598  //======================================= Minimum peak height value for axis to be considered possible
2599  case 'E':
2600  {
2601  this->setPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2602  continue;
2603  }
2604 
2605  //======================================= Save the argument as the requested symmetry and potentially fold value
2606  case '{':
2607  {
2608  std::string input = static_cast<std::string> ( optarg );
2609 
2610  if ( input.at(0) == 'C' )
2611  {
2612  this->setRequestedSymmetry ( "C" );
2613 
2614  std::string numHlp ( input.begin()+1, input.end() );
2615  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2616  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 ); }
2617  }
2618  else
2619  {
2620  if ( input.at(0) == 'D' )
2621  {
2622  this->setRequestedSymmetry ( "D" );
2623 
2624  std::string numHlp ( input.begin()+1, input.end() );
2625  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2626  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 ); }
2627  }
2628  else
2629  {
2630  if ( input.at(0) == 'T' )
2631  {
2632  this->setRequestedSymmetry ( "T" );
2633  }
2634  else
2635  {
2636  if ( input.at(0) == 'O' )
2637  {
2638  this->setRequestedSymmetry ( "O" );
2639  }
2640  else
2641  {
2642  if ( input.at(0) == 'I' )
2643  {
2644  this->setRequestedSymmetry ( "I" );
2645  }
2646  else
2647  {
2648  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 );
2649  }
2650  }
2651  }
2652  }
2653  }
2654 
2655  continue;
2656  }
2657 
2658  //======================================= Save the argument as filename to save the overlay moved structure to value
2659  case '}':
2660  {
2661  this->setOverlaySaveFile ( static_cast<std::string> ( optarg ) );
2662  continue;
2663  }
2664 
2665  //======================================= Save the argument as filename to save the overlay operations to value
2666  case 'y':
2667  {
2668  this->setOverlayJsonFile ( static_cast<std::string> ( optarg ) );
2669  continue;
2670  }
2671 
2672  //======================================= Save the argument as angular uncertainty for bandwidth determination
2673  case ';':
2674  {
2675  this->rotationUncertainty = static_cast<proshade_double> ( atof ( optarg ) );
2676  continue;
2677  }
2678 
2679  //======================================= Should the negative density from input files be removed?
2680  case 'F':
2681  {
2682  this->setNegativeDensity ( false );
2683  continue;
2684  }
2685 
2686  //======================================= Unknown option
2687  case '?':
2688  {
2689  //=================================== Save the argument as angular uncertainty for bandwidth determination
2690  if ( optopt )
2691  {
2692  std::cout << "!!! ProSHADE ERROR !!! Unrecognised short option -" << static_cast<char> ( optopt ) << " . Please use -h for help on the command line options." << std::endl;
2693  }
2694  else
2695  {
2696  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;
2697  }
2698 
2699  //=================================== This case is handled by getopt_long, nothing more needed.
2700  exit ( EXIT_SUCCESS );
2701  }
2702 
2703  //======================================= Fallback option
2704  default:
2705  {
2707  }
2708  }
2709  }
2710 
2711  //================================================ Done
2712  return ;
2713 
2714 }
2715 
2720 #if defined ( _WIN64 ) || defined ( _WIN32 )
2721 void __declspec(dllexport) ProSHADE_settings::printSettings ( )
2722 #else
2724 #endif
2725 {
2726  //================================================ Print the currest values in the settings object
2727  //== Settings regarding the task at hand
2728  std::stringstream strstr;
2729  strstr.str(std::string());
2730  if ( this->task == NA ) { strstr << "NA"; }
2731  if ( this->task == Distances ) { strstr << "DISTANCES COMPUTATION"; }
2732  if ( this->task == MapManip ) { strstr << "MAP MANIPULATION"; }
2733  if ( this->task == Symmetry ) { strstr << "SYMMETRY DETECTION"; }
2734  if ( this->task == OverlayMap ) { strstr << "MAP OVERLAY"; }
2735  printf ( "Task to perform : %37s\n", strstr.str().c_str() );
2736 
2737  //== Settings regarding the input files
2738  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->inputFiles.size() ); iter++ )
2739  {
2740  strstr.str(std::string());
2741  strstr << this->inputFiles.at(iter);
2742  printf ( "File(s) to process : %37s\n", strstr.str().c_str() );
2743  }
2744 
2745  strstr.str(std::string());
2746  if ( this->forceP1 ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2747  printf ( "Force P1 spacegroup : %37s\n", strstr.str().c_str() );
2748 
2749  strstr.str(std::string());
2750  if ( this->removeWaters ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2751  printf ( "Waters removed : %37s\n", strstr.str().c_str() );
2752 
2753  strstr.str(std::string());
2754  if ( this->firstModelOnly ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2755  printf ( "Only 1st model : %37s\n", strstr.str().c_str() );
2756 
2757  strstr.str(std::string());
2758  if ( this->removeNegativeDensity ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2759  printf ( "Remove neg. dens. : %37s\n", strstr.str().c_str() );
2760 
2761  //== Settings regarding the resolution of calculations
2762  strstr.str(std::string());
2763  strstr << this->requestedResolution;
2764  printf ( "Resolution (comp) : %37s\n", strstr.str().c_str() );
2765 
2766  strstr.str(std::string());
2767  if ( this->changeMapResolution ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2768  printf ( "Change map resol : %37s\n", strstr.str().c_str() );
2769 
2770  strstr.str(std::string());
2771  if ( this->changeMapResolutionTriLinear ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2772  printf ( "Change map tri-lin : %37s\n", strstr.str().c_str() );
2773 
2774  //== Settings regarding the PDB B-factor change
2775  strstr.str(std::string());
2776  strstr << this->pdbBFactorNewVal;
2777  printf ( "PDB B-factor const : %37s\n", strstr.str().c_str() );
2778 
2779  //== Settings regarding the bandwidth of calculations
2780  strstr.str(std::string());
2781  strstr << this->maxBandwidth;
2782  printf ( "Bandwidth : %37s\n", strstr.str().c_str() );
2783 
2784  strstr.str(std::string());
2785  strstr << this->rotationUncertainty;
2786  printf ( "Rotation doubt : %37s\n", strstr.str().c_str() );
2787 
2788  //== Settings regarding the phase
2789  strstr.str(std::string());
2790  if ( this->usePhase ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2791  printf ( "Use phase info : %37s\n", strstr.str().c_str() );
2792 
2793  //== Settings regarding the spheres
2794  strstr.str(std::string());
2795  strstr << this->maxSphereDists;
2796  printf ( "Sphere distances : %37s\n", strstr.str().c_str() );
2797 
2798  //== Settings regarding the Gauss-Legendre integration
2799  strstr.str(std::string());
2800  strstr << this->integOrder;
2801  printf ( "Integration order : %37s\n", strstr.str().c_str() );
2802 
2803  strstr.str(std::string());
2804  strstr << this->taylorSeriesCap;
2805  printf ( "Taylor series cap : %37s\n", strstr.str().c_str() );
2806 
2807  //== Settings regarding map normalisation
2808  strstr.str(std::string());
2809  if ( this->normaliseMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2810  printf ( "Map normalisation : %37s\n", strstr.str().c_str() );
2811 
2812  //== Settings regarding map inversion
2813  strstr.str(std::string());
2814  if ( this->invertMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2815  printf ( "Map inversion : %37s\n", strstr.str().c_str() );
2816 
2817  //== Settings regarding map masking
2818  strstr.str(std::string());
2819  strstr << this->blurFactor;
2820  printf ( "Map blurring : %37s\n", strstr.str().c_str() );
2821 
2822  strstr.str(std::string());
2823  strstr << this->maskingThresholdIQRs;
2824  printf ( "Masking threshold : %37s\n", strstr.str().c_str() );
2825 
2826  strstr.str(std::string());
2827  if ( this->maskMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2828  printf ( "Map masking : %37s\n", strstr.str().c_str() );
2829 
2830  strstr.str(std::string());
2831  if ( this->useCorrelationMasking ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2832  printf ( "Correlation mask : %37s\n", strstr.str().c_str() );
2833 
2834  strstr.str(std::string());
2835  strstr << this->halfMapKernel;
2836  printf ( "Half-map kernel : %37s\n", strstr.str().c_str() );
2837 
2838  strstr.str(std::string());
2839  strstr << this->correlationKernel;
2840  printf ( "Correlation kernel : %37s\n", strstr.str().c_str() );
2841 
2842  strstr.str(std::string());
2843  if ( this->saveMask ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2844  printf ( "Saving mask : %37s\n", strstr.str().c_str() );
2845 
2846  strstr.str(std::string());
2847  strstr << this->maskFileName;
2848  printf ( "Map mask filename : %37s\n", strstr.str().c_str() );
2849 
2850  //== Settings regarding re-boxing
2851  strstr.str(std::string());
2852  if ( this->reBoxMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2853  printf ( "Map re-boxing : %37s\n", strstr.str().c_str() );
2854 
2855  strstr.str(std::string());
2856  strstr << this->boundsExtraSpace;
2857  printf ( "Bounds extra space : %37s\n", strstr.str().c_str() );
2858 
2859  strstr.str(std::string());
2860  strstr << this->boundsSimilarityThreshold;
2861  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2862 
2863  strstr.str(std::string());
2864  if ( this->useSameBounds ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2865  printf ( "Same boundaries : %37s\n", strstr.str().c_str() );
2866 
2867  strstr.str(std::string());
2868  if ( this->forceBounds != nullptr )
2869  {
2870  strstr << this->forceBounds[0] << " - " << this->forceBounds[1] << " | " << this->forceBounds[2] << " - " << this->forceBounds[3] << " | " << this->forceBounds[4] << " - " << this->forceBounds[5];
2871  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2872  }
2873  else
2874  {
2875  strstr << "Not allocated";
2876  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2877  }
2878 
2879  //== Settings regarding COM
2880  strstr.str(std::string());
2881  if ( this->moveToCOM ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2882  printf ( "Map COM centering : %37s\n", strstr.str().c_str() );
2883 
2884  strstr.str(std::string());
2885  strstr << this->boxCentre.at(0) << " ; " << this->boxCentre.at(1) << " ; " << this->boxCentre.at(2);
2886  printf ( "BOX centering : %37s\n", strstr.str().c_str() );
2887 
2888  //== Settings regarding extra cell space
2889  strstr.str(std::string());
2890  strstr << this->addExtraSpace;
2891  printf ( "Extra space : %37s\n", strstr.str().c_str() );
2892 
2893  strstr.str(std::string());
2894  strstr << this->coOrdsExtraSpace;
2895  printf ( "Extra co-ord space : %37s\n", strstr.str().c_str() );
2896 
2897  //== Settings regarding shell settings
2898  strstr.str(std::string());
2899  if ( this->progressiveSphereMapping ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2900  printf ( "Progressive spheres : %37s\n", strstr.str().c_str() );
2901 
2902  //== Settings regarding output file name
2903  strstr.str(std::string());
2904  strstr << this->outName;
2905  printf ( "Re-boxed filename : %37s\n", strstr.str().c_str() );
2906 
2907  //== Settings regarding distances computation
2908  strstr.str(std::string());
2909  if ( this->computeEnergyLevelsDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2910  printf ( "Energy lvl desc : %37s\n", strstr.str().c_str() );
2911 
2912  strstr.str(std::string());
2913  strstr << this->enLevMatrixPowerWeight;
2914  printf ( "Energy lvl weight : %37s\n", strstr.str().c_str() );
2915 
2916  strstr.str(std::string());
2917  if ( this->findSymCentre ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2918  printf ( "Symmetry centre : %37s\n", strstr.str().c_str() );
2919 
2920  strstr.str(std::string());
2921  if ( this->computeTraceSigmaDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2922  printf ( "Tr sigma desc : %37s\n", strstr.str().c_str() );
2923 
2924  strstr.str(std::string());
2925  if ( this->computeRotationFuncDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2926  printf ( "Full RF desc : %37s\n", strstr.str().c_str() );
2927 
2928  //== Settings regarding peak searching
2929  strstr.str(std::string());
2930  strstr << this->peakNeighbours;
2931  printf ( "Neightbours to peak : %37s\n", strstr.str().c_str() );
2932 
2933  strstr.str(std::string());
2934  strstr << this->noIQRsFromMedianNaivePeak;
2935  printf ( "Peak IQR threshold : %37s\n", strstr.str().c_str() );
2936 
2937  //== Settings regarding 1D grouping
2938  strstr.str(std::string());
2939  strstr << this->smoothingFactor;
2940  printf ( "Smoothing factor : %37s\n", strstr.str().c_str() );
2941 
2942  //== Settings regarding the symmetry detection
2943  strstr.str(std::string());
2944  strstr << this->symMissPeakThres;
2945  printf ( "Missing ax. thres : %37s\n", strstr.str().c_str() );
2946 
2947  strstr.str(std::string());
2948  strstr << this->axisErrTolerance;
2949  printf ( "Same ax. threshold : %37s\n", strstr.str().c_str() );
2950 
2951  strstr.str(std::string());
2952  if ( this->axisErrToleranceDefault ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2953  printf ( "Same ax. thre. decr.: %37s\n", strstr.str().c_str() );
2954 
2955  strstr.str(std::string());
2956  strstr << this->minSymPeak;
2957  printf ( "Min. sym. peak size : %37s\n", strstr.str().c_str() );
2958 
2959  strstr.str(std::string());
2960  strstr << this->recommendedSymmetryType << "-" << this->recommendedSymmetryFold;
2961  printf ( "Recommended symm. : %37s\n", strstr.str().c_str() );
2962 
2963  strstr.str(std::string());
2964  strstr << this->requestedSymmetryType << "-" << this->requestedSymmetryFold;
2965  printf ( "Requested symm. : %37s\n", strstr.str().c_str() );
2966 
2967  strstr.str(std::string());
2968  if ( this->useBiCubicInterpolationOnPeaks ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2969  printf ( "Use bicubic interp. : %37s\n", strstr.str().c_str() );
2970 
2971  strstr.str(std::string());
2972  strstr << this->maxSymmetryFold;
2973  printf ( "Max symmetry fold : %37s\n", strstr.str().c_str() );
2974 
2975  strstr.str(std::string());
2976  strstr << this->fscThreshold;
2977  printf ( "FSC Threshold : %37s\n", strstr.str().c_str() );
2978 
2979  strstr.str(std::string());
2980  strstr << this->peakThresholdMin;
2981  printf ( "Peak Threshold : %37s\n", strstr.str().c_str() );
2982 
2983  strstr.str(std::string());
2984  if ( this->fastISearch ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2985  printf ( "Fast I Search : %37s\n", strstr.str().c_str() );
2986 
2987  //== Settings regarding the structure overlay
2988  strstr.str(std::string());
2989  strstr << this->overlayStructureName;
2990  printf ( "Overlay file : %37s\n", strstr.str().c_str() );
2991 
2992  strstr.str(std::string());
2993  strstr << this->rotTrsJSONFile;
2994  printf ( "JSON overlay file : %37s\n", strstr.str().c_str() );
2995 
2996  //== Settings regarding verbosity of the program
2997  strstr.str(std::string());
2998  strstr << this->verbose;
2999  printf ( "Verbosity : %37s\n", strstr.str().c_str() );
3000 
3001  //================================================ Done
3002  return ;
3003 
3004 }
3005 
3010 #if defined ( _WIN64 ) || defined ( _WIN32 )
3011 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEnergyLevelsVector ( )
3012 #else
3013 std::vector< proshade_double > ProSHADE_run::getEnergyLevelsVector ( )
3014 #endif
3015 {
3016  //================================================ Return the value
3017  return ( this->enLevs );
3018 }
3019 
3024 #if defined ( _WIN64 ) || defined ( _WIN32 )
3025 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTraceSigmaVector ( )
3026 #else
3027 std::vector< proshade_double > ProSHADE_run::getTraceSigmaVector ( )
3028 #endif
3029 {
3030  //================================================ Return the value
3031  return ( this->trSigm );
3032 }
3033 
3038 #if defined ( _WIN64 ) || defined ( _WIN32 )
3039 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getRotationFunctionVector ( )
3040 #else
3041 std::vector< proshade_double > ProSHADE_run::getRotationFunctionVector ( )
3042 #endif
3043 {
3044  //================================================ Return the value
3045  return ( this->rotFun );
3046 }
3047 
3053 {
3054  //================================================ Return the value
3055  return ( this->noStructures );
3056 }
3057 
3062 proshade_signed ProSHADE_run::getVerbose ( )
3063 {
3064  //================================================ Return the value
3065  return ( this->verbose );
3066 }
3067 
3073 {
3074  //================================================ Return the value
3075  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
3076 }
3077 
3083 {
3084  //================================================ Return the value
3085  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
3086 }
3087 
3093 #if defined ( _WIN64 ) || defined ( _WIN32 )
3094 std::vector< std::string > __declspec(dllexport) ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
3095 #else
3096 std::vector< std::string > ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
3097 #endif
3098 {
3099  //================================================ Sanity checks
3100  if ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) <= axisNo )
3101  {
3102  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
3103  return ( std::vector< std::string > ( ) );
3104  }
3105 
3106  //================================================ Initialise local variables
3107  std::vector< std::string > ret;
3108 
3109  //================================================ Input the axis data as strings
3110  std::stringstream ssHlp;
3111  ssHlp << this->RecomSymAxes.at(axisNo)[0];
3112  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3113  ssHlp.str ( "" );
3114 
3115  ssHlp << this->RecomSymAxes.at(axisNo)[1];
3116  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3117  ssHlp.str ( "" );
3118 
3119  ssHlp << this->RecomSymAxes.at(axisNo)[2];
3120  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3121  ssHlp.str ( "" );
3122 
3123  ssHlp << this->RecomSymAxes.at(axisNo)[3];
3124  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3125  ssHlp.str ( "" );
3126 
3127  ssHlp << this->RecomSymAxes.at(axisNo)[4];
3128  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3129  ssHlp.str ( "" );
3130 
3131  ssHlp << this->RecomSymAxes.at(axisNo)[5];
3132  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3133  ssHlp.str ( "" );
3134 
3135  ssHlp << this->RecomSymAxes.at(axisNo)[6];
3136  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
3137  ssHlp.str ( "" );
3138 
3139  //================================================ Done
3140  return ( ret );
3141 
3142 }
3143 
3148 #if defined ( _WIN64 ) || defined ( _WIN32 )
3149 std::vector < std::vector< proshade_double > > __declspec(dllexport) ProSHADE_run::getAllCSyms ( )
3150 #else
3151 std::vector < std::vector< proshade_double > > ProSHADE_run::getAllCSyms ( )
3152 #endif
3153 {
3154  //================================================ Done
3155  return ( this->allCSymAxes );
3156 
3157 }
3158 
3163 #if defined ( _WIN64 ) || defined ( _WIN32 )
3164 std::vector < proshade_double > __declspec(dllexport) ProSHADE_run::getMapCOMProcessChange ( )
3165 #else
3166 std::vector < proshade_double > ProSHADE_run::getMapCOMProcessChange ( )
3167 #endif
3168 {
3169  //================================================ Done
3170  return ( this->mapCOMShift );
3171 
3172 }
3173 
3178 #if defined ( _WIN64 ) || defined ( _WIN32 )
3179 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
3180 #else
3181 std::vector< proshade_signed > ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
3182 #endif
3183 {
3184  //================================================ Sanity checks
3185  if ( noStructures <= strNo )
3186  {
3187  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3188  return ( std::vector< proshade_signed > ( ) );
3189  }
3190 
3191  //================================================ Initialise local variables
3192  std::vector< proshade_signed > ret;
3193 
3194  //================================================ Input the axis data as strings
3195  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[0] );
3196  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[1] );
3197  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[2] );
3198  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[3] );
3199  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[4] );
3200  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[5] );
3201 
3202  //================================================ Done
3203  return ( ret );
3204 }
3205 
3210 #if defined ( _WIN64 ) || defined ( _WIN32 )
3211 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
3212 #else
3213 std::vector< proshade_signed > ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
3214 #endif
3215 {
3216  //================================================ Sanity checks
3217  if ( noStructures <= strNo )
3218  {
3219  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3220  return ( std::vector< proshade_signed > ( ) );
3221  }
3222 
3223  //================================================ Initialise local variables
3224  std::vector< proshade_signed > ret;
3225 
3226  //================================================ Input the axis data as strings
3227  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[0] );
3228  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[1] );
3229  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[2] );
3230  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[3] );
3231  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[4] );
3232  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[5] );
3233 
3234  //================================================ Done
3235  return ( ret );
3236 }
3237 
3244 #if defined ( _WIN64 ) || defined ( _WIN32 )
3245 proshade_double __declspec(dllexport) ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
3246 #else
3247 proshade_double ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
3248 #endif
3249 {
3250  //================================================ Return the value
3251  return ( this->manipulatedMaps.at(strNo)[mapIndex] );
3252 }
3253 
3261 #if defined ( _WIN64 ) || defined ( _WIN32 )
3262 void __declspec(dllexport) getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
3263 #else
3264 void getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
3265 #endif
3266 {
3267  //================================================ Sanity checks
3268  if ( run->getNoStructures() <= strNo )
3269  {
3270  ProSHADE_internal_messages::printWarningMessage ( run->getVerbose(), "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3271  return ;
3272  }
3273 
3274  //================================================ Save the data into the output array
3275  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++)
3276  {
3277  reboxMap[iter] = static_cast<double> ( run->getMapValue ( strNo, iter ) );
3278  }
3279 
3280  //================================================ Done
3281  return ;
3282 
3283 }
3284 
3289 #if defined ( _WIN64 ) || defined ( _WIN32 )
3290 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEulerAngles ( )
3291 #else
3292 std::vector< proshade_double > ProSHADE_run::getEulerAngles ( )
3293 #endif
3294 {
3295  //================================================ Sanity check
3296  if ( this->eulerAngles.size() != 3 )
3297  {
3298  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" );
3299  return ( std::vector< proshade_double > ( ) );
3300  }
3301 
3302  //================================================ Return required value
3303  return ( this->eulerAngles );
3304 
3305 }
3306 
3311 #if defined ( _WIN64 ) || defined ( _WIN32 )
3312 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOptimalRotMat ( )
3313 #else
3314 std::vector< proshade_double > ProSHADE_run::getOptimalRotMat ( )
3315 #endif
3316 {
3317  //================================================ Sanity check
3318  if ( this->eulerAngles.size() != 3 )
3319  {
3320  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" );
3321  return ( std::vector< proshade_double > ( ) );
3322  }
3323 
3324  //================================================ Obtain the optimal rotation matrix
3325  proshade_double* rotMat = new proshade_double[9];
3326  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
3327  ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( this->eulerAngles.at(0), this->eulerAngles.at(1), this->eulerAngles.at(2), rotMat );
3328 
3329  //================================================ Copy to the output variable
3330  std::vector< proshade_double > ret;
3331  for ( proshade_unsign iter = 0; iter < 9; iter++ ) { ProSHADE_internal_misc::addToDoubleVector ( &ret, rotMat[iter] ); }
3332 
3333  //================================================ Release the memory
3334  delete[] rotMat;
3335 
3336  //================================================ Return required value
3337  return ( ret );
3338 
3339 }
3340 
3345 #if defined ( _WIN64 ) || defined ( _WIN32 )
3346 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTranslationToOrigin ( )
3347 #else
3348 std::vector< proshade_double > ProSHADE_run::getTranslationToOrigin ( )
3349 #endif
3350 {
3351  //================================================ Sanity check
3352  if ( this->coordRotationCentre.size() != 3 )
3353  {
3354  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" );
3355  return ( std::vector< proshade_double > ( ) );
3356  }
3357 
3358  //================================================ Create return variable with negative values of the internal varariable
3359  std::vector < proshade_double > ret;
3360  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(0) );
3361  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(1) );
3362  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(2) );
3363 
3364  //================================================ Return required value
3365  return ( ret );
3366 
3367 }
3368 
3373 #if defined ( _WIN64 ) || defined ( _WIN32 )
3374 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOriginToOverlayTranslation ( )
3375 #else
3376 std::vector< proshade_double > ProSHADE_run::getOriginToOverlayTranslation ( )
3377 #endif
3378 {
3379  //================================================ Sanity check
3380  if ( this->overlayTranslation.size() != 3 )
3381  {
3382  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" );
3383  return ( std::vector< proshade_double > ( ) );
3384  }
3385 
3386  //================================================ Return required value
3387  return ( this->overlayTranslation );
3388 
3389 }
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:120
ProSHADE_settings::setOverlayJsonFile
void setOverlayJsonFile(std::string filename)
Sets the filename to which the overlay operations are to be save into.
Definition: ProSHADE.cpp:1605
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:609
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:1018
ProSHADE_settings::maxBandwidth
proshade_unsign maxBandwidth
The bandwidth of spherical harmonics decomposition for the largest sphere.
Definition: ProSHADE_settings.hpp:58
ProSHADE_settings::integOrder
proshade_unsign integOrder
The order required for full Gauss-Legendre integration between the spheres.
Definition: ProSHADE_settings.hpp:68
ProSHADE_settings::recommendedSymmetryType
std::string recommendedSymmetryType
The symmetry type that ProSHADE finds the best fitting for the structure. Possible values are "" for ...
Definition: ProSHADE_settings.hpp:131
ProSHADE_settings::rotTrsJSONFile
std::string rotTrsJSONFile
The filename to which the rotation and translation operations are to be saved into.
Definition: ProSHADE_settings.hpp:146
ProSHADE_settings::setEnLevShellWeight
void setEnLevShellWeight(proshade_double mPower)
Sets the weight of shell position for the energy levels computation.
Definition: ProSHADE.cpp:1318
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:115
ProSHADE_settings::findSymCentre
bool findSymCentre
Should phase-less map be used to determine centre of symmetry?
Definition: ProSHADE_settings.hpp:126
ProSHADE_settings::setTraceSigmaComputation
void setTraceSigmaComputation(bool trSigVal)
Sets whether the trace sigma distance descriptor should be computed.
Definition: ProSHADE.cpp:1210
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:116
ProSHADE_settings::setSameBoundaries
void setSameBoundaries(bool sameB)
Sets whether same boundaries should be used in the appropriate variable.
Definition: ProSHADE.cpp:915
ProSHADE_settings::maxSymmetryFold
proshade_unsign maxSymmetryFold
The highest symmetry fold to search for.
Definition: ProSHADE_settings.hpp:136
ProSHADE_settings::taylorSeriesCap
proshade_unsign taylorSeriesCap
The max limit on the Taylor series expansion done for the abscissas of the Gauss-Legendre integration...
Definition: ProSHADE_settings.hpp:69
ProSHADE_run::~ProSHADE_run
~ProSHADE_run(void)
Destructor for the ProSHADE class.
Definition: ProSHADE.cpp:2003
ProSHADE_settings::setMinimumMaskSize
void setMinimumMaskSize(proshade_single minMS)
Sets the requested minimum mask size.
Definition: ProSHADE.cpp:753
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:1853
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:3041
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:813
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:93
ProSHADE_settings::setBicubicInterpolationSearch
void setBicubicInterpolationSearch(bool bicubPeaks)
Sets the bicubic interpolation on peaks.
Definition: ProSHADE.cpp:1623
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:1274
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:110
ProSHADE_settings::setMapInversion
void setMapInversion(bool mInv)
Sets the requested map inversion value in the appropriate variable.
Definition: ProSHADE.cpp:609
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:956
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:1252
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:78
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:3151
ProSHADE_settings::maskMap
bool maskMap
Should the map be masked from noise?
Definition: ProSHADE_settings.hpp:80
ProSHADE_settings::requestedSymmetryFold
proshade_unsign requestedSymmetryFold
The fold of the requested symmetry (only applicable to C and D symmetry types).
Definition: ProSHADE_settings.hpp:134
ProSHADE_run::getNoSymmetryAxes
proshade_unsign getNoSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:3072
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:133
ProSHADE_settings::setSphereDistances
void setSphereDistances(proshade_single sphDist)
Sets the requested distance between spheres in the appropriate variable.
Definition: ProSHADE.cpp:1107
ProSHADE_settings::setVerbosity
void setVerbosity(proshade_signed verbosity)
Sets the requested verbosity in the appropriate variable.
Definition: ProSHADE.cpp:629
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:1447
ProSHADE_settings::saveMask
bool saveMask
Should the mask be saved?
Definition: ProSHADE_settings.hpp:84
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:130
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:1426
ProSHADE_settings::setDetectedSymmetry
void setDetectedSymmetry(proshade_double *sym)
Sets the final detected symmetry axes information.
Definition: ProSHADE.cpp:1553
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:107
ProSHADE_settings::maxSphereDists
proshade_single maxSphereDists
The distance between spheres in spherical mapping for the largest sphere.
Definition: ProSHADE_settings.hpp:65
ProSHADE_run::getEulerAngles
std::vector< proshade_double > getEulerAngles(void)
This function returns the vector of Euler angles with best overlay correlation.
Definition: ProSHADE.cpp:3292
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:127
ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles
void getRotationMatrixFromEulerZXZAngles(proshade_double eulerAlpha, proshade_double eulerBeta, proshade_double eulerGamma, proshade_double *matrix)
Function to find the rotation matrix from Euler angles (ZXZ convention).
Definition: ProSHADE_maths.cpp:1020
ProSHADE_settings::setPDBBFactor
void setPDBBFactor(proshade_double newBF)
Sets the requested B-factor value for PDB files in the appropriate variable.
Definition: ProSHADE.cpp:569
ProSHADE_settings::addStructure
void addStructure(std::string structure)
Adds a structure file name to the appropriate variable.
Definition: ProSHADE.cpp:529
ProSHADE_settings::determineIntegrationOrder
void determineIntegrationOrder(proshade_single maxMapRange)
This function determines the integration order for the between spheres integration.
Definition: ProSHADE.cpp:1809
ProSHADE_settings::setMaskIQR
void setMaskIQR(proshade_single noIQRs)
Sets the requested number of IQRs for masking threshold in the appropriate variable.
Definition: ProSHADE.cpp:670
ProSHADE_settings::setMissingPeakThreshold
void setMissingPeakThreshold(proshade_double mpThres)
Sets the threshold for starting the missing peaks procedure.
Definition: ProSHADE.cpp:1361
ProSHADE_run::getVerbose
proshade_signed getVerbose(void)
This function returns the verbose value.
Definition: ProSHADE.cpp:3062
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:79
ProSHADE_settings::useCorrelationMasking
bool useCorrelationMasking
Should the blurring masking (false) or the correlation masking (true) be used?
Definition: ProSHADE_settings.hpp:81
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:62
ProSHADE_settings::setSymmetryCentreSearch
void setSymmetryCentreSearch(bool sCen)
Sets the symmetry centre search on or off.
Definition: ProSHADE.cpp:1382
ProSHADE_settings::setMapCentering
void setMapCentering(bool com)
Sets the requested map centering decision value in the appropriate variable.
Definition: ProSHADE.cpp:996
ProSHADE_settings::setMaskBlurFactor
void setMaskBlurFactor(proshade_single blurFac)
Sets the requested map blurring factor in the appropriate variable.
Definition: ProSHADE.cpp:649
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:1677
ProSHADE_settings::setPhaseUsage
void setPhaseUsage(bool phaseUsage)
Sets whether the phase information will be used.
Definition: ProSHADE.cpp:1296
ProSHADE_settings::maskFileName
std::string maskFileName
The filename to which mask should be saved.
Definition: ProSHADE_settings.hpp:85
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:149
ProSHADE_settings::setFSCThreshold
void setFSCThreshold(proshade_double fscThr)
Sets the minimum FSC threshold for axis to be considered detected.
Definition: ProSHADE.cpp:1659
ProSHADE_settings::setBandwidth
void setBandwidth(proshade_unsign band)
Sets the requested spherical harmonics bandwidth in the appropriate variable.
Definition: ProSHADE.cpp:1087
ProSHADE_settings::messageShift
proshade_signed messageShift
This value allows shifting the messages to create more readable log for sub-processes.
Definition: ProSHADE_settings.hpp:150
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:874
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:936
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:506
ProSHADE_settings::useBiCubicInterpolationOnPeaks
bool useBiCubicInterpolationOnPeaks
This variable switch decides whether best symmetry is detected from peak indices, or whether bicubic ...
Definition: ProSHADE_settings.hpp:135
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:537
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:3096
ProSHADE_settings::setAxisComparisonThreshold
void setAxisComparisonThreshold(proshade_double axThres)
Sets the threshold for matching symmetry axes.
Definition: ProSHADE.cpp:1403
ProSHADE_settings::peakThresholdMin
proshade_double peakThresholdMin
The threshold for peak height above which axes are considered possible.
Definition: ProSHADE_settings.hpp:138
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:733
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:335
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:793
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:2052
ProSHADE_settings::setCoordExtraSpace
void setCoordExtraSpace(proshade_single exSpace)
Sets the requested co-ordinates extra space value in the appropriate variable.
Definition: ProSHADE.cpp:1067
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:3348
ProSHADE_settings::reBoxMap
bool reBoxMap
This switch decides whether re-boxing is needed.
Definition: ProSHADE_settings.hpp:92
ProSHADE_settings::appliedMaskFileName
std::string appliedMaskFileName
The filename from which mask data will be read from.
Definition: ProSHADE_settings.hpp:86
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:3264
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:104
ProSHADE_settings::normaliseMap
bool normaliseMap
Should the map be normalised to mean 0 sd 1?
Definition: ProSHADE_settings.hpp:72
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:103
ProSHADE_settings::setRequestedFold
void setRequestedFold(proshade_unsign val)
Sets the user requested symmetry fold.
Definition: ProSHADE.cpp:1532
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:137
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:1746
ProSHADE_settings::getCommandLineParams
void getCommandLineParams(int argc, char **argv)
This function parses the command line arguments into the settings object.
Definition: ProSHADE.cpp:2135
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:2037
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:3013
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:853
ProSHADE_settings::setRecommendedSymmetry
void setRecommendedSymmetry(std::string val)
Sets the ProSHADE detected symmetry type.
Definition: ProSHADE.cpp:1469
ProSHADE_settings::setMaxSymmetryFold
void setMaxSymmetryFold(proshade_unsign maxFold)
Sets the maximum symmetry fold (well, the maximum prime symmetry fold).
Definition: ProSHADE.cpp:1641
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:83
ProSHADE_settings::setNegativeDensity
void setNegativeDensity(bool nDens)
Sets the internal variable deciding whether input files negative density should be removed.
Definition: ProSHADE.cpp:1695
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:75
ProSHADE_settings::setTaylorSeriesCap
void setTaylorSeriesCap(proshade_unsign tayCap)
Sets the requested Taylor series cap for the Gauss-Legendre integration in the appropriate variable.
Definition: ProSHADE.cpp:1148
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:142
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:94
ProSHADE_settings::setCorrelationMasking
void setCorrelationMasking(bool corMask)
Sets the requested map masking type in the appropriate variable.
Definition: ProSHADE.cpp:711
ProSHADE_settings::setProgressiveSphereMapping
void setProgressiveSphereMapping(bool progSphMap)
Sets the requested sphere mapping value settings approach in the appropriate variable.
Definition: ProSHADE.cpp:1168
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:1127
ProSHADE_settings::setRotationFunctionComputation
void setRotationFunctionComputation(bool rotfVal)
Sets whether the rotation function distance descriptor should be computed.
Definition: ProSHADE.cpp:1231
ProSHADE_run::getReBoxedBounds
std::vector< proshade_signed > getReBoxedBounds(proshade_unsign strNo)
This function returns a specific structure re-boxed bounds.
Definition: ProSHADE.cpp:3213
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:59
ProSHADE_settings::~ProSHADE_settings
~ProSHADE_settings(void)
Destructor for the ProSHADE_settings class.
Definition: ProSHADE.cpp:488
ProSHADE_settings::setOverlaySaveFile
void setOverlaySaveFile(std::string filename)
Sets the filename to which the overlay structure is to be save into.
Definition: ProSHADE.cpp:1587
ProSHADE_settings::overlayStructureName
std::string overlayStructureName
The filename to which the rotated and translated moving structure is to be saved.
Definition: ProSHADE_settings.hpp:145
ProSHADE_settings::determineBandwidth
void determineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE.cpp:1714
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:99
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:119
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:561
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:123
ProSHADE_run::ProSHADE_run
ProSHADE_run(ProSHADE_settings *settings)
Contructor for the ProSHADE_run class.
Definition: ProSHADE.cpp:1905
ProSHADE_run::getMapValue
proshade_double getMapValue(proshade_unsign strNo, proshade_unsign mapIndex)
This function returns a single, specific structure map value.
Definition: ProSHADE.cpp:3247
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:833
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:82
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:100
ProSHADE_run::getNoRecommendedSymmetryAxes
proshade_unsign getNoRecommendedSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:3082
ProSHADE_settings::determineSphereDistances
void determineSphereDistances(proshade_single maxMapRange)
This function determines the sphere distances for sphere mapping.
Definition: ProSHADE.cpp:1777
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:68
ProSHADE_settings::setGroupingSmoothingFactor
void setGroupingSmoothingFactor(proshade_double smFact)
Sets the grouping smoothing factor into the proper variable.
Definition: ProSHADE.cpp:1340
ProSHADE_internal_spheres::autoDetermineBandwidth
proshade_unsign autoDetermineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE_spheres.cpp:515
ProSHADE_settings::setRequestedSymmetry
void setRequestedSymmetry(std::string val)
Sets the user requested symmetry type.
Definition: ProSHADE.cpp:1512
ProSHADE_settings::setExtraSpace
void setExtraSpace(proshade_single exSpace)
Sets the requested map extra space value in the appropriate variable.
Definition: ProSHADE.cpp:1047
ProSHADE_settings::forceBounds
proshade_signed * forceBounds
These will be the boundaries to be forced upon the map.
Definition: ProSHADE_settings.hpp:96
ProSHADE_settings::fourierWeightsFileName
std::string fourierWeightsFileName
The filename from which Fourier weights data will be read from.
Definition: ProSHADE_settings.hpp:89
ProSHADE_settings::detectedSymmetry
std::vector< proshade_double * > detectedSymmetry
The vector of detected symmetry axes.
Definition: ProSHADE_settings.hpp:154
ProSHADE_settings::recommendedSymmetryFold
proshade_unsign recommendedSymmetryFold
The fold of the recommended symmetry C or D type, 0 otherwise.
Definition: ProSHADE_settings.hpp:132
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:976
ProSHADE_settings::setMaskSaving
void setMaskSaving(bool savMsk)
Sets whether the mask should be saved.
Definition: ProSHADE.cpp:773
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:894
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:128
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:95
ProSHADE_settings::setMasking
void setMasking(bool mask)
Sets the requested map masking decision value in the appropriate variable.
Definition: ProSHADE.cpp:690
ProSHADE_settings::pdbBFactorNewVal
proshade_double pdbBFactorNewVal
Change all PDB B-factors to this value (for smooth maps).
Definition: ProSHADE_settings.hpp:55
ProSHADE_settings::setRecommendedFold
void setRecommendedFold(proshade_unsign val)
Sets the ProSHADE detected symmetry fold.
Definition: ProSHADE.cpp:1492
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:3314
ProSHADE_run::getOriginalBounds
std::vector< proshade_signed > getOriginalBounds(proshade_unsign strNo)
This function returns a specific structure original bounds.
Definition: ProSHADE.cpp:3181
ProSHADE_settings::setVariablesLeftOnAuto
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
Definition: ProSHADE.cpp:503
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:3027
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:549
ProSHADE_settings::printSettings
void printSettings(void)
This function prints the current values in the settings object.
Definition: ProSHADE.cpp:2723
ProSHADE_run::getNoStructures
proshade_unsign getNoStructures(void)
This function returns the number of structures used.
Definition: ProSHADE.cpp:3052
ProSHADE_run::getMapCOMProcessChange
std::vector< proshade_double > getMapCOMProcessChange(void)
This function returns the internal map COM shift.
Definition: ProSHADE.cpp:3166
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:139
ProSHADE_internal_misc::addToStringVector
void addToStringVector(std::vector< std::string > *vecToAddTo, std::string elementToAdd)
Adds the element to the vector.
Definition: ProSHADE_misc.cpp:33
ProSHADE_internal_tasks::SymmetryDetectionTask
void SymmetryDetectionTask(ProSHADE_settings *settings, std::vector< proshade_double * > *axes, std::vector< std::vector< proshade_double > > *allCs, std::vector< proshade_double > *mapCOMShift)
The symmetry detection task driver function.
Definition: ProSHADE_tasks.cpp:288
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:114
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:3376
ProSHADE_settings::setNormalisation
void setNormalisation(bool normalise)
Sets the requested map normalisation value in the appropriate variable.
Definition: ProSHADE.cpp:589
ProSHADE_settings::setEnergyLevelsComputation
void setEnergyLevelsComputation(bool enLevDesc)
Sets whether the energy level distance descriptor should be computed.
Definition: ProSHADE.cpp:1189
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:113