ProSHADE  0.7.6.0 (JUL 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 re-boxing
89  this->reBoxMap = false;
90  this->boundsExtraSpace = 3.0;
91  this->boundsSimilarityThreshold = 0;
92  this->useSameBounds = false;
93  this->forceBounds = new proshade_signed [6];
94 
95  //================================================ Settings regarding COM
96  this->moveToCOM = false;
97 
98  //================================================ Settings regarding extra cell space
99  this->addExtraSpace = 10.0;
100 
101  //================================================ Settings regarding shell settings
102  this->progressiveSphereMapping = false;
103 
104  //================================================ Settings regarding output file name
105  this->outName = "reBoxed";
106 
107  //================================================ Settings regarding distances computation
108  this->computeEnergyLevelsDesc = true;
109  this->computeTraceSigmaDesc = true;
110  this->computeRotationFuncDesc = true;
111  this->enLevMatrixPowerWeight = 1.0;
112 
113  //================================================ Settings regarding peak searching
114  this->peakNeighbours = 1;
115  this->noIQRsFromMedianNaivePeak = -999.9;
116 
117  //================================================ Settings regarding 1D grouping
118  this->smoothingFactor = 15.0;
119 
120  //================================================ Settings regarding the symmetry detection
121  this->usePeakSearchInRotationFunctionSpace = true;
122  this->useBiCubicInterpolationOnPeaks = true;
123  this->maxSymmetryFold = 30;
124  this->fscThreshold = 0.80;
125  this->peakThresholdMin = 0.80;
126  this->symMissPeakThres = 0.3;
127  this->axisErrTolerance = 0.01;
128  this->axisErrToleranceDefault = true;
129  this->minSymPeak = 0.3;
130  this->recommendedSymmetryType = "";
131  this->recommendedSymmetryFold = 0;
132  this->requestedSymmetryType = "";
133  this->requestedSymmetryFold = 0;
134  this->detectedSymmetry.clear ( );
135 
136  //================================================ Settings regarding the structure overlay
137  this->overlayStructureName = "movedStructure";
138  this->rotTrsJSONFile = "movedStructureOperations.json";
139 
140  //================================================ Settings regarding verbosity of the program
141  this->verbose = 1;
142 
143  //================================================ Done
144 
145 }
146 
155 #if defined ( _WIN64 ) || defined ( _WIN32 )
156 __declspec(dllexport) ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
157 #else
158  ProSHADE_settings::ProSHADE_settings ( ProSHADE_Task taskToPerform )
159 #endif
160 {
161  //================================================ Settings regarding the task at hand
162  this->task = taskToPerform;
163 
164  //================================================ Settings regarding input files
165  this->forceP1 = true;
166  this->removeWaters = true;
167  this->firstModelOnly = true;
168  this->removeNegativeDensity = true;
169 
170  //================================================ Settings regarding the resolution of calculations
171  this->requestedResolution = -1.0;
172  this->changeMapResolution = false;
173  this->changeMapResolutionTriLinear = false;
174 
175  //================================================ Settings regarding the PDB B-factor change
176  this->pdbBFactorNewVal = -1.0;
177 
178  //================================================ Settings regarding the bandwidth of calculations
179  this->maxBandwidth = 0;
180  this->rotationUncertainty = 0;
181 
182  //================================================ Settings regarding the phase
183  this->usePhase = true;
184 
185  //================================================ Settings regarding the spheres
186  this->maxSphereDists = 0.0;
187 
188  //================================================ Settings regarding the Gauss-Legendre integration
189  this->integOrder = 0;
190  this->taylorSeriesCap = 10;
191 
192  //================================================ Settings regarding map normalisation
193  this->normaliseMap = false;
194 
195  //================================================ Settings regarding map inversion
196  this->invertMap = false;
197 
198  //================================================ Settings regarding map masking
199  this->blurFactor = 350.0;
200  this->maskingThresholdIQRs = 3.0;
201  this->maskMap = false;
202  this->useCorrelationMasking = false;
203  this->halfMapKernel = 0.0;
204  this->correlationKernel = 0.0;
205  this->saveMask = false;
206  this->maskFileName = "maskFile";
207  this->appliedMaskFileName = "";
208  this->detectedSymmetry.clear ( );
209 
210  //================================================ Settings regarding re-boxing
211  this->reBoxMap = false;
212  this->boundsExtraSpace = 3.0;
213  this->boundsSimilarityThreshold = 0;
214  this->useSameBounds = false;
215  this->forceBounds = new proshade_signed [6];
216 
217  //================================================ Settings regarding extra cell space
218  this->addExtraSpace = 10.0;
219 
220  //================================================ Settings regarding shell settings
221  this->progressiveSphereMapping = false;
222 
223  //================================================ Settings regarding output file name
224  this->outName = "reBoxed";
225 
226  //================================================ Settings regarding distances computation
227  this->computeEnergyLevelsDesc = true;
228  this->computeTraceSigmaDesc = true;
229  this->computeRotationFuncDesc = true;
230  this->enLevMatrixPowerWeight = 1.0;
231 
232  //================================================ Settings regarding peak searching
233  this->peakNeighbours = 1;
234  this->noIQRsFromMedianNaivePeak = -999.9;
235 
236  //================================================ Settings regarding 1D grouping
237  this->smoothingFactor = 15.0;
238 
239  //================================================ Settings regarding the symmetry detection
240  this->usePeakSearchInRotationFunctionSpace = true;
241  this->useBiCubicInterpolationOnPeaks = true;
242  this->maxSymmetryFold = 30;
243  this->fscThreshold = 0.80;
244  this->peakThresholdMin = 0.80;
245  this->symMissPeakThres = 0.3;
246  this->axisErrTolerance = 0.01;
247  this->axisErrToleranceDefault = true;
248  this->minSymPeak = 0.3;
249  this->recommendedSymmetryType = "";
250  this->recommendedSymmetryFold = 0;
251  this->requestedSymmetryType = "";
252  this->requestedSymmetryFold = 0;
253 
254  //================================================ Settings regarding the structure overlay
255  this->overlayStructureName = "movedStructure";
256  this->rotTrsJSONFile = "movedStructureOperations.json";
257 
258  //================================================ Settings regarding verbosity of the program
259  this->verbose = 1;
260 
261  //================================================ Task specific settings
262  switch ( this->task )
263  {
264  case NA:
265  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
266  std::cerr << "Error Code : " << "E000014" << std::endl << std::flush;
267  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
268  std::cerr << "File : " << "ProSHADE.cpp" << std::endl << std::flush;
269  std::cerr << "Line : " << 97 << std::endl << std::flush;
270  std::cerr << "Function : " << "ProSHADE_settings (Task) constructor" << std::endl << std::flush;
271  std::cerr << "Message : " << "No task has been specified for task specific constructor." << std::endl << std::flush;
272  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;
274  exit ( EXIT_FAILURE );
275 
276  case Symmetry:
277  this->requestedResolution = 6.0;
278  this->pdbBFactorNewVal = 80.0;
279  this->changeMapResolution = true;
280  this->maskMap = false;
281  this->moveToCOM = true;
282  this->reBoxMap = false;
283  break;
284 
285  case Distances:
286  this->changeMapResolution = false;
287  this->maskMap = false;
288  this->moveToCOM = true;
289  this->reBoxMap = false;
290  break;
291 
292  case OverlayMap:
293  this->requestedResolution = 8.0;
294  this->changeMapResolution = true;
295  this->maskMap = false;
296  this->moveToCOM = false;
297  this->reBoxMap = false;
298  break;
299 
300  case MapManip:
301  this->changeMapResolution = false;
302  this->maskMap = true;
303  this->moveToCOM = false;
304  break;
305  }
306 
307  //================================================ Done
308 
309 }
310 
315 #if defined ( _WIN64 ) || defined ( _WIN32 )
316 __declspec(dllexport) ProSHADE_settings::~ProSHADE_settings ( void )
317 #else
319 #endif
320 {
321  //================================================ Release boundaries variable
322  delete[] this->forceBounds;
323 
324  //================================================ Release symmetry axes
325  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); } } }
326 
327  //================================================ Done
328 
329 }
330 
334 {
335  //================================================ Determine the peak IQR from median threshold, unless given by user
336  const FloatingPoint< proshade_double > lhs ( this->noIQRsFromMedianNaivePeak ), rhs ( -999.9 );
337  if ( lhs.AlmostEquals( rhs ) )
338  {
339  //============================================ 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
340  if ( this->task == Distances ) { this->noIQRsFromMedianNaivePeak = 5.0; }
341  if ( ( this->task == Symmetry ) && ( !this->usePeakSearchInRotationFunctionSpace ) ) { this->noIQRsFromMedianNaivePeak = 5.0; }
342 
343  //============================================ If using the new symmetry detection algorithm, this needs to be decreasing with resolution. How much, that is a bit arbitrary...
344  if ( ( this->task == Symmetry ) && ( this->usePeakSearchInRotationFunctionSpace ) ) { this->noIQRsFromMedianNaivePeak = static_cast< proshade_double > ( std::max ( 0.0f, 1.0f - ( this->requestedResolution * 0.05f ) ) ); }
345  }
346 
347  //================================================ Done
348  return ;
349 
350 }
351 
359 #if defined ( _WIN64 ) || defined ( _WIN32 )
360 void __declspec(dllexport) ProSHADE_settings::addStructure ( std::string structure )
361 #else
362 void ProSHADE_settings::addStructure ( std::string structure )
363 #endif
364 {
365  //================================================ Use C++ version independent vector processing
366  ProSHADE_internal_misc::addToStringVector ( &( this->inputFiles ), structure );
367 
368  //================================================ Done
369  return ;
370 
371 }
372 
379 #if defined ( _WIN64 ) || defined ( _WIN32 )
380 void __declspec(dllexport) ProSHADE_settings::setResolution ( proshade_single resolution )
381 #else
382 void ProSHADE_settings::setResolution ( proshade_single resolution )
383 #endif
384 {
385  //================================================ Set the value
386  this->requestedResolution = resolution;
387 
388  //================================================ Done
389  return ;
390 
391 }
392 
399 #if defined ( _WIN64 ) || defined ( _WIN32 )
400 void __declspec(dllexport) ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
401 #else
402 void ProSHADE_settings::setPDBBFactor ( proshade_double newBF )
403 #endif
404 {
405  //================================================ Set the value
406  this->pdbBFactorNewVal = newBF;
407 
408  //================================================ Done
409  return ;
410 
411 }
412 
419 #if defined ( _WIN64 ) || defined ( _WIN32 )
420 void __declspec(dllexport) ProSHADE_settings::setNormalisation ( bool normalise )
421 #else
422 void ProSHADE_settings::setNormalisation ( bool normalise )
423 #endif
424 {
425  //================================================ Set the value
426  this->normaliseMap = normalise;
427 
428  //================================================ Done
429  return ;
430 
431 }
432 
439 #if defined ( _WIN64 ) || defined ( _WIN32 )
440 void __declspec(dllexport) ProSHADE_settings::setMapInversion ( bool mInv )
441 #else
443 #endif
444 {
445  //================================================ Set the value
446  this->invertMap = mInv;
447 
448  //================================================ Done
449  return ;
450 
451 }
452 
459 #if defined ( _WIN64 ) || defined ( _WIN32 )
460 void __declspec(dllexport) ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
461 #else
462 void ProSHADE_settings::setVerbosity ( proshade_signed verbosity )
463 #endif
464 {
465  //================================================ Set the value
466  this->verbose = verbosity;
467 
468  //================================================ Done
469  return ;
470 
471 }
472 
479 #if defined ( _WIN64 ) || defined ( _WIN32 )
480 void __declspec(dllexport) ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
481 #else
482 void ProSHADE_settings::setMaskBlurFactor ( proshade_single blurFac )
483 #endif
484 {
485  //================================================ Set the value
486  this->blurFactor = blurFac;
487 
488  //================================================ Done
489  return ;
490 
491 }
492 
500 #if defined ( _WIN64 ) || defined ( _WIN32 )
501 void __declspec(dllexport) ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
502 #else
503 void ProSHADE_settings::setMaskIQR ( proshade_single noIQRs )
504 #endif
505 {
506  //================================================ Set the value
507  this->maskingThresholdIQRs = noIQRs;
508 
509  //================================================ Done
510  return ;
511 
512 }
513 
520 #if defined ( _WIN64 ) || defined ( _WIN32 )
521 void __declspec(dllexport) ProSHADE_settings::setMasking ( bool mask )
522 #else
524 #endif
525 {
526  //================================================ Set the value
527  this->maskMap = mask;
528 
529  //================================================ Done
530  return ;
531 
532 }
533 
541 #if defined ( _WIN64 ) || defined ( _WIN32 )
542 void __declspec(dllexport) ProSHADE_settings::setCorrelationMasking ( bool corMask )
543 #else
545 #endif
546 {
547  //================================================ Set the value
548  this->useCorrelationMasking = corMask;
549 
550  //================================================ Done
551  return ;
552 
553 }
554 
563 #if defined ( _WIN64 ) || defined ( _WIN32 )
564 void __declspec(dllexport) ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
565 #else
566 void ProSHADE_settings::setTypicalNoiseSize ( proshade_single typNoi )
567 #endif
568 {
569  //================================================ Set the value
570  this->halfMapKernel = typNoi;
571 
572  //================================================ Done
573  return ;
574 
575 }
576 
583 #if defined ( _WIN64 ) || defined ( _WIN32 )
584 void __declspec(dllexport) ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
585 #else
586 void ProSHADE_settings::setMinimumMaskSize ( proshade_single minMS )
587 #endif
588 {
589  //================================================ Set the value
590  this->correlationKernel = minMS;
591 
592  //================================================ Done
593  return ;
594 
595 }
596 
603 #if defined ( _WIN64 ) || defined ( _WIN32 )
604 void __declspec(dllexport) ProSHADE_settings::setMaskSaving ( bool savMsk )
605 #else
607 #endif
608 {
609  //================================================ Set the value
610  this->saveMask = savMsk;
611 
612  //================================================ Done
613  return ;
614 
615 }
616 
623 #if defined ( _WIN64 ) || defined ( _WIN32 )
624 void __declspec(dllexport) ProSHADE_settings::setMaskFilename ( std::string mskFln )
625 #else
626 void ProSHADE_settings::setMaskFilename ( std::string mskFln )
627 #endif
628 {
629  //================================================ Set the value
630  this->maskFileName = mskFln;
631 
632  //================================================ Done
633  return ;
634 
635 }
636 
643 #if defined ( _WIN64 ) || defined ( _WIN32 )
644 void __declspec(dllexport) ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
645 #else
646 void ProSHADE_settings::setAppliedMaskFilename ( std::string mskFln )
647 #endif
648 {
649  //================================================ Set the value
650  this->appliedMaskFileName = mskFln;
651 
652  //================================================ Done
653  return ;
654 
655 }
656 
663 #if defined ( _WIN64 ) || defined ( _WIN32 )
664 void __declspec(dllexport) ProSHADE_settings::setMapReboxing ( bool reBx )
665 #else
667 #endif
668 {
669  //================================================ Set the value
670  this->reBoxMap = reBx;
671 
672  //================================================ Done
673  return ;
674 
675 }
676 
684 #if defined ( _WIN64 ) || defined ( _WIN32 )
685 void __declspec(dllexport) ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
686 #else
687 void ProSHADE_settings::setBoundsSpace ( proshade_single boundsExSp )
688 #endif
689 {
690  //================================================ Set the value
691  this->boundsExtraSpace = boundsExSp;
692 
693  //================================================ Done
694  return ;
695 
696 }
697 
704 #if defined ( _WIN64 ) || defined ( _WIN32 )
705 void __declspec(dllexport) ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
706 #else
707 void ProSHADE_settings::setBoundsThreshold ( proshade_signed boundsThres )
708 #endif
709 {
710  //================================================ Set the value
711  this->boundsSimilarityThreshold = boundsThres;
712 
713  //================================================ Done
714  return ;
715 
716 }
717 
725 #if defined ( _WIN64 ) || defined ( _WIN32 )
726 void __declspec(dllexport) ProSHADE_settings::setSameBoundaries ( bool sameB )
727 #else
729 #endif
730 {
731  //================================================ Set the value
732  this->useSameBounds = sameB;
733 
734  //================================================ Done
735  return ;
736 
737 }
738 
746 #if defined ( _WIN64 ) || defined ( _WIN32 )
747 void __declspec(dllexport) ProSHADE_settings::setOutputFilename ( std::string oFileName )
748 #else
749 void ProSHADE_settings::setOutputFilename ( std::string oFileName )
750 #endif
751 {
752  //================================================ Set the value
753  this->outName = oFileName;
754 
755  //================================================ Done
756  return ;
757 
758 }
759 
766 #if defined ( _WIN64 ) || defined ( _WIN32 )
767 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChange ( bool mrChange )
768 #else
770 #endif
771 {
772  //================================================ Set the value
773  this->changeMapResolution = mrChange;
774 
775  //================================================ Done
776  return ;
777 
778 }
779 
786 #if defined ( _WIN64 ) || defined ( _WIN32 )
787 void __declspec(dllexport) ProSHADE_settings::setMapResolutionChangeTriLinear ( bool mrChange )
788 #else
790 #endif
791 {
792  //================================================ Set the value
793  this->changeMapResolutionTriLinear = mrChange;
794 
795  //================================================ Done
796  return ;
797 
798 }
799 
806 #if defined ( _WIN64 ) || defined ( _WIN32 )
807 void __declspec(dllexport) ProSHADE_settings::setMapCentering ( bool com )
808 #else
810 #endif
811 {
812  //================================================ Set the value
813  this->moveToCOM = com;
814 
815  //================================================ Done
816  return ;
817 
818 }
819 
826 #if defined ( _WIN64 ) || defined ( _WIN32 )
827 void __declspec(dllexport) ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
828 #else
829 void ProSHADE_settings::setExtraSpace ( proshade_single exSpace )
830 #endif
831 {
832  //================================================ Set the value
833  this->addExtraSpace = exSpace;
834 
835  //================================================ Done
836  return ;
837 
838 }
839 
846 #if defined ( _WIN64 ) || defined ( _WIN32 )
847 void __declspec(dllexport) ProSHADE_settings::setBandwidth ( proshade_unsign band )
848 #else
849 void ProSHADE_settings::setBandwidth ( proshade_unsign band )
850 #endif
851 {
852  //================================================ Set the value
853  this->maxBandwidth = band;
854 
855  //================================================ Done
856  return ;
857 
858 }
859 
866 #if defined ( _WIN64 ) || defined ( _WIN32 )
867 void __declspec(dllexport) ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
868 #else
869 void ProSHADE_settings::setSphereDistances ( proshade_single sphDist )
870 #endif
871 {
872  //================================================ Set the value
873  this->maxSphereDists = sphDist;
874 
875  //================================================ Done
876  return ;
877 
878 }
879 
886 #if defined ( _WIN64 ) || defined ( _WIN32 )
887 void __declspec(dllexport) ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
888 #else
889 void ProSHADE_settings::setIntegrationOrder ( proshade_unsign intOrd )
890 #endif
891 {
892  //================================================ Set the value
893  this->integOrder = intOrd;
894 
895  //================================================ Done
896  return ;
897 
898 }
899 
907 #if defined ( _WIN64 ) || defined ( _WIN32 )
908 void __declspec(dllexport) ProSHADE_settings::setTaylorSeriesCap ( proshade_unsign tayCap )
909 #else
910 void ProSHADE_settings::setTaylorSeriesCap ( proshade_unsign tayCap )
911 #endif
912 {
913  //================================================ Set the value
914  this->taylorSeriesCap = tayCap;
915 
916  //================================================ Done
917  return ;
918 
919 }
920 
927 #if defined ( _WIN64 ) || defined ( _WIN32 )
928 void __declspec(dllexport) ProSHADE_settings::setProgressiveSphereMapping ( bool progSphMap )
929 #else
931 #endif
932 {
933  //================================================ Set the value
934  this->progressiveSphereMapping = progSphMap;
935 
936  //================================================ Done
937  return ;
938 
939 }
940 
948 #if defined ( _WIN64 ) || defined ( _WIN32 )
949 void __declspec(dllexport) ProSHADE_settings::setEnergyLevelsComputation ( bool enLevDesc )
950 #else
952 #endif
953 {
954  //======================================== Set the value
955  this->computeEnergyLevelsDesc = enLevDesc;
956 
957  //======================================== Done
958  return ;
959 
960 }
961 
969 #if defined ( _WIN64 ) || defined ( _WIN32 )
970 void __declspec(dllexport) ProSHADE_settings::setTraceSigmaComputation ( bool trSigVal )
971 #else
973 #endif
974 {
975  //================================================ Set the value
976  this->computeTraceSigmaDesc = trSigVal;
977 
978  //================================================ Done
979  return ;
980 
981 }
982 
990 #if defined ( _WIN64 ) || defined ( _WIN32 )
991 void __declspec(dllexport) ProSHADE_settings::setRotationFunctionComputation ( bool rotfVal )
992 #else
994 #endif
995 {
996  //================================================ Set the value
997  this->computeRotationFuncDesc = rotfVal;
998 
999  //================================================ Done
1000  return ;
1001 
1002 }
1003 
1011 #if defined ( _WIN64 ) || defined ( _WIN32 )
1012 void __declspec(dllexport) ProSHADE_settings::setPeakNeighboursNumber ( proshade_unsign pkS )
1013 #else
1015 #endif
1016 {
1017  //================================================ Set the value
1018  this->peakNeighbours = pkS;
1019 
1020  //================================================ Done
1021  return ;
1022 
1023 }
1024 
1033 #if defined ( _WIN64 ) || defined ( _WIN32 )
1034 void __declspec(dllexport) ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1035 #else
1036 void ProSHADE_settings::setPeakNaiveNoIQR ( proshade_double noIQRs )
1037 #endif
1038 {
1039  //================================================ Set the value
1040  this->noIQRsFromMedianNaivePeak = noIQRs;
1041 
1042  //================================================ Done
1043  return ;
1044 
1045 }
1046 
1055 #if defined ( _WIN64 ) || defined ( _WIN32 )
1056 void __declspec(dllexport) ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1057 #else
1058 void ProSHADE_settings::setPhaseUsage ( bool phaseUsage )
1059 #endif
1060 {
1061  //================================================ Set the value
1062  this->usePhase = phaseUsage;
1063 
1064  //================================================ Done
1065  return ;
1066 
1067 }
1068 
1077 #if defined ( _WIN64 ) || defined ( _WIN32 )
1078 void __declspec(dllexport) ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1079 #else
1080 void ProSHADE_settings::setEnLevShellWeight ( proshade_double mPower )
1081 #endif
1082 {
1083  //================================================ Set the value
1084  this->enLevMatrixPowerWeight = mPower;
1085 
1086  //================================================ Done
1087  return ;
1088 
1089 }
1090 
1099 #if defined ( _WIN64 ) || defined ( _WIN32 )
1100 void __declspec(dllexport) ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1101 #else
1102 void ProSHADE_settings::setGroupingSmoothingFactor ( proshade_double smFact )
1103 #endif
1104 {
1105  //================================================ Set the value
1106  this->smoothingFactor = smFact;
1107 
1108  //================================================ Done
1109  return ;
1110 
1111 }
1112 
1120 #if defined ( _WIN64 ) || defined ( _WIN32 )
1121 void __declspec(dllexport) ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1122 #else
1123 void ProSHADE_settings::setMissingPeakThreshold ( proshade_double mpThres )
1124 #endif
1125 {
1126  //================================================ Set the value
1127  this->symMissPeakThres = mpThres;
1128 
1129  //================================================ Done
1130  return ;
1131 
1132 }
1133 
1141 #if defined ( _WIN64 ) || defined ( _WIN32 )
1142 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1143 #else
1144 void ProSHADE_settings::setAxisComparisonThreshold ( proshade_double axThres )
1145 #endif
1146 {
1147  //================================================ Set the value
1148  this->axisErrTolerance = axThres;
1149 
1150  //================================================ Done
1151  return ;
1152 
1153 }
1154 
1164 #if defined ( _WIN64 ) || defined ( _WIN32 )
1165 void __declspec(dllexport) ProSHADE_settings::setAxisComparisonThresholdBehaviour ( bool behav )
1166 #else
1168 #endif
1169 {
1170  //================================================ Set the value
1171  this->axisErrToleranceDefault = behav;
1172 
1173  //================================================ Done
1174  return ;
1175 
1176 }
1177 
1185 #if defined ( _WIN64 ) || defined ( _WIN32 )
1186 void __declspec(dllexport) ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1187 #else
1188 void ProSHADE_settings::setMinimumPeakForAxis ( proshade_double minSP )
1189 #endif
1190 {
1191  //================================================ Set the value
1192  this->minSymPeak = minSP;
1193 
1194  //================================================ Done
1195  return ;
1196 
1197 }
1198 
1207 #if defined ( _WIN64 ) || defined ( _WIN32 )
1208 void __declspec(dllexport) ProSHADE_settings::setRecommendedSymmetry ( std::string val )
1209 #else
1211 #endif
1212 {
1213  //================================================ Set the value
1214  this->recommendedSymmetryType = val;
1215 
1216  //================================================ Done
1217  return ;
1218 
1219 }
1220 
1230 #if defined ( _WIN64 ) || defined ( _WIN32 )
1231 void __declspec(dllexport) ProSHADE_settings::setRecommendedFold ( proshade_unsign val )
1232 #else
1233 void ProSHADE_settings::setRecommendedFold ( proshade_unsign val )
1234 #endif
1235 {
1236  //================================================ Set the value
1237  this->recommendedSymmetryFold = val;
1238 
1239  //================================================ Done
1240  return ;
1241 
1242 }
1243 
1250 #if defined ( _WIN64 ) || defined ( _WIN32 )
1251 void __declspec(dllexport) ProSHADE_settings::setRequestedSymmetry ( std::string val )
1252 #else
1254 #endif
1255 {
1256  //================================================ Set the value
1257  this->requestedSymmetryType = val;
1258 
1259  //================================================ Done
1260  return ;
1261 
1262 }
1263 
1270 #if defined ( _WIN64 ) || defined ( _WIN32 )
1271 void __declspec(dllexport) ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1272 #else
1273 void ProSHADE_settings::setRequestedFold ( proshade_unsign val )
1274 #endif
1275 {
1276  //================================================ Set the value
1277  this->requestedSymmetryFold = val;
1278 
1279  //================================================ Done
1280  return ;
1281 
1282 }
1283 
1291 #if defined ( _WIN64 ) || defined ( _WIN32 )
1292 void __declspec(dllexport) ProSHADE_settings::setDetectedSymmetry ( proshade_double* sym )
1293 #else
1294 void ProSHADE_settings::setDetectedSymmetry ( proshade_double* sym )
1295 #endif
1296 {
1297  //================================================ Allocate memory
1298  proshade_double* hlpAxis = new proshade_double [7];
1299  ProSHADE_internal_misc::checkMemoryAllocation ( hlpAxis, __FILE__, __LINE__, __func__ );
1300 
1301  //================================================ Copy (deep) data
1302  hlpAxis[0] = sym[0];
1303  hlpAxis[1] = sym[1];
1304  hlpAxis[2] = sym[2];
1305  hlpAxis[3] = sym[3];
1306  hlpAxis[4] = sym[4];
1307  hlpAxis[5] = sym[5];
1308  hlpAxis[6] = sym[6];
1309 
1310  //================================================ Save
1311  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->detectedSymmetry, hlpAxis );
1312 
1313  //================================================ Release memory
1314  delete[] hlpAxis;
1315 
1316  //================================================ Done
1317  return ;
1318 
1319 }
1320 
1325 #if defined ( _WIN64 ) || defined ( _WIN32 )
1326 void __declspec(dllexport) ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1327 #else
1328 void ProSHADE_settings::setOverlaySaveFile ( std::string filename )
1329 #endif
1330 {
1331  //================================================ Set the value
1332  this->overlayStructureName = filename;
1333 
1334  //================================================ Done
1335  return ;
1336 
1337 }
1338 
1343 #if defined ( _WIN64 ) || defined ( _WIN32 )
1344 void __declspec(dllexport) ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1345 #else
1346 void ProSHADE_settings::setOverlayJsonFile ( std::string filename )
1347 #endif
1348 {
1349  //================================================ Set the value
1350  this->rotTrsJSONFile = filename;
1351 
1352  //================================================ Done
1353  return ;
1354 
1355 }
1356 
1361 #if defined ( _WIN64 ) || defined ( _WIN32 )
1362 void __declspec(dllexport) ProSHADE_settings::setSymmetryRotFunPeaks ( bool rotFunPeaks )
1363 #else
1365 #endif
1366 {
1367  //================================================ Set the value
1368  this->usePeakSearchInRotationFunctionSpace = rotFunPeaks;
1369 
1370  //================================================ Done
1371  return ;
1372 
1373 }
1374 
1379 #if defined ( _WIN64 ) || defined ( _WIN32 )
1380 void __declspec(dllexport) ProSHADE_settings::setBicubicInterpolationSearch ( bool bicubPeaks )
1381 #else
1383 #endif
1384 {
1385  //================================================ Set the value
1386  this->useBiCubicInterpolationOnPeaks = bicubPeaks;
1387 
1388  //================================================ Done
1389  return ;
1390 
1391 }
1392 
1397 #if defined ( _WIN64 ) || defined ( _WIN32 )
1398 void __declspec(dllexport) ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1399 #else
1400 void ProSHADE_settings::setMaxSymmetryFold ( proshade_unsign maxFold )
1401 #endif
1402 {
1403  //================================================ Set the value
1404  this->maxSymmetryFold = maxFold;
1405 
1406  //================================================ Done
1407  return ;
1408 
1409 }
1410 
1415 #if defined ( _WIN64 ) || defined ( _WIN32 )
1416 void __declspec(dllexport) ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1417 #else
1418 void ProSHADE_settings::setFSCThreshold ( proshade_double fscThr )
1419 #endif
1420 {
1421  //================================================ Set the value
1422  this->fscThreshold = fscThr;
1423 
1424  //================================================ Done
1425  return ;
1426 
1427 }
1428 
1433 #if defined ( _WIN64 ) || defined ( _WIN32 )
1434 void __declspec(dllexport) ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1435 #else
1436 void ProSHADE_settings::setPeakThreshold ( proshade_double peakThr )
1437 #endif
1438 {
1439  //================================================ Set the value
1440  this->peakThresholdMin = peakThr;
1441 
1442  //================================================ Done
1443  return ;
1444 
1445 }
1446 
1451 #if defined ( _WIN64 ) || defined ( _WIN32 )
1452 void __declspec(dllexport) ProSHADE_settings::setNegativeDensity ( bool nDens )
1453 #else
1455 #endif
1456 {
1457  //================================================ Set the value
1458  this->removeNegativeDensity = nDens;
1459 
1460  //================================================ Done
1461  return ;
1462 
1463 }
1464 
1473 void ProSHADE_settings::determineBandwidth ( proshade_unsign circumference )
1474 {
1475  //================================================ Check the current settings value is set to auto
1476  if ( this->maxBandwidth != 0 )
1477  {
1478  std::stringstream hlpSS;
1479  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1481  return ;
1482  }
1483 
1484  //================================================ Determine automatically
1486 
1487  //================================================ Report progress
1488  std::stringstream hlpSS;
1489  hlpSS << "The bandwidth was determined as: " << this->maxBandwidth;
1491 
1492  //================================================ Done
1493  return ;
1494 
1495 }
1496 
1505 void ProSHADE_settings::determineBandwidthFromAngle ( proshade_double uncertainty )
1506 {
1507  //================================================ Determine bandwidth
1508  if ( static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2 ) ) % 2 == 0 )
1509  {
1510  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) );
1511  }
1512  else
1513  {
1514  this->maxBandwidth = static_cast<proshade_unsign> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) ) + 1;
1515  }
1516 
1517  //================================================ Report progress
1518  std::stringstream hlpSS;
1519  hlpSS << "The bandwidth was determined from uncertainty " << uncertainty << " degrees as: " << this->maxBandwidth;
1521 
1522  //================================================ Done
1523  return ;
1524 
1525 }
1526 
1536 void ProSHADE_settings::determineSphereDistances ( proshade_single maxMapRange )
1537 {
1538  //================================================ Check the current settings value is set to auto
1539  if ( this->maxSphereDists != 0.0f )
1540  {
1541  std::stringstream hlpSS;
1542  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1544  return ;
1545  }
1546 
1547  //================================================ Determine automatically
1549 
1550  //================================================ Report progress
1551  std::stringstream hlpSS;
1552  hlpSS << "The sphere distances were determined as " << this->maxSphereDists << " Angstroms.";
1554 
1555  //================================================ Done
1556  return ;
1557 
1558 }
1559 
1568 void ProSHADE_settings::determineIntegrationOrder ( proshade_single maxMapRange )
1569 {
1570  //================================================ Check the current settings value is set to auto
1571  if ( this->integOrder != 0 )
1572  {
1573  std::stringstream hlpSS;
1574  hlpSS << "The integration order was determined as " << this->integOrder;
1576  return ;
1577  }
1578 
1579  //================================================ Determine automatically
1581 
1582  //================================================ Report progress
1583  std::stringstream hlpSS;
1584  hlpSS << "The integration order was determined as " << this->integOrder;
1586 
1587  //================================================ Done
1588  return ;
1589 
1590 }
1591 
1612 void ProSHADE_settings::determineAllSHValues ( proshade_unsign xDim, proshade_unsign yDim, proshade_single xDimAngs, proshade_single yDimAngs, proshade_single zDimAngs )
1613 {
1614  //================================================ Print progress message
1615  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 1, "Preparing spherical harmonics environment." );
1616 
1617  //================================================ Modify dims by resolution
1618  proshade_unsign theoXDim = static_cast< proshade_unsign > ( std::ceil ( xDimAngs / ( this->requestedResolution / 2.0f ) ) );
1619  proshade_unsign theoYDim = static_cast< proshade_unsign > ( std::ceil ( yDimAngs / ( this->requestedResolution / 2.0f ) ) );
1620  proshade_unsign theoZDim = static_cast< proshade_unsign > ( std::ceil ( zDimAngs / ( this->requestedResolution / 2.0f ) ) );
1621 
1622  //================================================ Find maximum circumference
1623  proshade_unsign maxDim = std::max ( theoXDim, std::max ( theoYDim, theoZDim ) );
1624  proshade_unsign minDim = std::min ( theoXDim, std::min ( theoYDim, theoZDim ) );
1625  proshade_unsign midDim = 0;
1626  if ( ( xDim < maxDim ) && ( xDim > minDim ) ) { midDim = theoXDim; }
1627  else if ( ( yDim < maxDim ) && ( yDim > minDim ) ) { midDim = theoYDim; }
1628  else { midDim = theoZDim; }
1629 
1630  proshade_unsign circ = ( maxDim ) + ( midDim );
1631 
1632  //================================================ Bandwidth
1633  if ( this->rotationUncertainty > 0.0 ) { this->determineBandwidthFromAngle ( this->rotationUncertainty ); }
1634  else { this->determineBandwidth ( circ ); }
1635 
1636  //================================================ Find maximum diagonal in Angstroms
1637  proshade_single maxDiag = static_cast< proshade_single > ( std::sqrt ( std::pow ( static_cast<proshade_single> ( maxDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) +
1638  std::pow ( static_cast<proshade_single> ( midDim ) * ( this->requestedResolution / 2.0f ), 2.0f ) ) );
1639 
1640  //================================================ Sphere distances
1641  this->determineSphereDistances ( maxDiag );
1642 
1643  //================================================ Integration order
1644  this->determineIntegrationOrder ( maxDiag );
1645 
1646  //================================================ Report function completion
1647  ProSHADE_internal_messages::printProgressMessage ( this->verbose, 2, "Spherical harmonics environment prepared." );
1648 
1649  //================================================ Done
1650  return ;
1651 
1652 }
1653 
1661 #if defined ( _WIN64 ) || defined ( _WIN32 )
1662 __declspec(dllexport) ProSHADE_run::ProSHADE_run ( ProSHADE_settings* settings )
1663 #else
1665 #endif
1666 {
1667  //================================================ Wellcome message if required
1669 
1670  //================================================ Save the general information
1671  this->noStructures = static_cast<proshade_unsign> ( settings->inputFiles.size() );
1672  this->verbose = static_cast<proshade_signed> ( settings->verbose );
1673 
1674  //================================================ Try to run ProSHADE
1675  try
1676  {
1677  //============================================ Depending on task, switch to correct function to call
1678  switch ( settings->task )
1679  {
1680  case NA:
1681  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." );
1682 
1683  case Symmetry:
1684  ProSHADE_internal_tasks::SymmetryDetectionTask ( settings, &this->RecomSymAxes, &this->allCSymAxes, &this->mapCOMShift );
1685  this->setSymmetryResults ( settings );
1686  break;
1687 
1688  case Distances:
1689  ProSHADE_internal_tasks::DistancesComputationTask ( settings, &this->enLevs, &this->trSigm, &this->rotFun );
1690  break;
1691 
1692  case OverlayMap:
1693  ProSHADE_internal_tasks::MapOverlayTask ( settings, &this->coordRotationCentre, &this->eulerAngles, &this->overlayTranslation );
1694  break;
1695 
1696  case MapManip:
1697  ProSHADE_internal_tasks::MapManipulationTask ( settings, &this->originalBounds, &this->reboxedBounds, &this->manipulatedMaps );
1698  break;
1699  }
1700  }
1701 
1702  //================================================ If this is ProSHADE exception, give all available info and terminate gracefully :-)
1703  catch ( ProSHADE_exception& err )
1704  {
1705  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1706  std::cerr << "Error Code : " << err.get_errc() << std::endl << std::flush;
1707  std::cerr << "ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
1708  std::cerr << "File : " << err.get_file() << std::endl << std::flush;
1709  std::cerr << "Line : " << err.get_line() << std::endl << std::flush;
1710  std::cerr << "Function : " << err.get_func() << std::endl << std::flush;
1711  std::cerr << "Message : " << err.what() << std::endl << std::flush;
1712  std::cerr << "Further information : " << err.get_info() << std::endl << std::endl << std::flush;
1713 
1714  //============================================ Done
1716  exit ( EXIT_FAILURE );
1717  }
1718 
1719  //================================================ Well, give all there is and just end
1720  catch ( ... )
1721  {
1722  std::cerr << std::endl << "=====================" << std::endl << "!! ProSHADE ERROR !!" << std::endl << "=====================" << std::endl << std::flush;
1723 
1724  //============================================ Try to find out more
1725 #if __cplusplus >= 201103L
1726  std::exception_ptr exc = std::current_exception();
1727  try
1728  {
1729  if (exc)
1730  {
1731  std::rethrow_exception ( exc );
1732  }
1733  }
1734  catch ( const std::exception& e )
1735  {
1736  std::cerr << "Caught unknown exception with following information: " << e.what() << std::endl << std::flush;
1737  }
1738 #else
1739  std::cerr << "Unknown error with no further explanation available. Please contact the author for help." << std::endl << std::flush;
1740 #endif
1741  std::cerr << "Terminating..." << std::endl << std::endl << std::flush;
1742 
1743  //============================================ Done
1745  exit ( EXIT_FAILURE );
1746  }
1747 
1748  //================================================ Terminating message
1750 
1751  //================================================ Done
1752 
1753 }
1754 
1759 #if defined ( _WIN64 ) || defined ( _WIN32 )
1760 __declspec(dllexport) ProSHADE_run::~ProSHADE_run ( )
1761 #else
1763 #endif
1764 {
1765  //================================================ Release reboxing pointers
1766  if ( this->originalBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->originalBounds.size() ); iter++ ) { delete[] this->originalBounds.at(iter); } }
1767  if ( this->reboxedBounds.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->reboxedBounds.size() ); iter++ ) { delete[] this->reboxedBounds.at(iter); } }
1768  if ( this->manipulatedMaps.size() > 0 ) { for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->manipulatedMaps.size() ); iter++ ) { delete[] this->manipulatedMaps.at(iter); } }
1769 
1770  //================================================ Clear vectors
1771  this->enLevs.clear ( );
1772  this->trSigm.clear ( );
1773  this->rotFun.clear ( );
1774 
1775  //================================================ Delete symmetry axes memory
1776  if ( this->RecomSymAxes.size() > 0 )
1777  {
1778  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->RecomSymAxes.size() ); iter++ )
1779  {
1780  delete[] this->RecomSymAxes.at(iter);
1781  }
1782  this->RecomSymAxes.clear ( );
1783  }
1784 
1785  //================================================ Done
1786 
1787 }
1788 
1793 #if defined ( _WIN64 ) || defined ( _WIN32 )
1794 std::string __declspec(dllexport) ProSHADE_run::getSymmetryType ( )
1795 #else
1797 #endif
1798 
1799 {
1800  //================================================ Return the value
1801  return ( this->symRecommType );
1802 }
1803 
1808 #if defined ( _WIN64 ) || defined ( _WIN32 )
1809 proshade_unsign __declspec(dllexport) ProSHADE_run::getSymmetryFold ( )
1810 #else
1812 #endif
1813 {
1814  //================================================ Return the value
1815  return ( this->symRecommFold );
1816 }
1817 
1824 void ProSHADE_run::setRecommendedSymmetry ( std::string val )
1825 {
1826  //================================================ Set the value
1827  this->symRecommType = val;
1828 
1829  //================================================ Done
1830  return ;
1831 
1832 }
1833 
1841 void ProSHADE_run::setRecommendedFold ( proshade_unsign val )
1842 {
1843  //================================================ Set the value
1844  this->symRecommFold = val;
1845 
1846  //================================================ Done
1847  return ;
1848 
1849 }
1850 
1858 void ProSHADE_run::setRecommendedAxis ( proshade_double* sym )
1859 {
1860  //================================================ Set the value
1861  ProSHADE_internal_misc::deepCopyAxisToDblPtrVector ( &this->RecomSymAxes, sym );
1862 
1863  //================================================ Done
1864  return ;
1865 
1866 }
1867 
1875 void ProSHADE_run::setSymmetryResults ( ProSHADE_settings* settings )
1876 {
1877  //================================================ Save type and fold
1878  this->setRecommendedSymmetry ( settings->recommendedSymmetryType );
1879  this->setRecommendedFold ( settings->recommendedSymmetryFold );
1880 
1881  //================================================ Done
1882  return ;
1883 
1884 }
1885 
1891 #if defined ( _WIN64 ) || defined ( _WIN32 )
1892 void __declspec(dllexport) ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
1893 #else
1894 void ProSHADE_settings::getCommandLineParams ( int argc, char** argv )
1895 #endif
1896 {
1897  //================================================ If no command line arguments, print help
1898  if ( argc == 1 ) { ProSHADE_internal_messages::printHelp ( ); }
1899 
1900  //================================================ Long options struct
1901  const struct option_port longopts[] =
1902  {
1903  { "version", no_argument, nullptr, 'v' },
1904  { "help", no_argument, nullptr, 'h' },
1905  { "verbose", required_argument, nullptr, '!' },
1906  { "distances", no_argument, nullptr, 'D' },
1907  { "mapManip", no_argument, nullptr, 'M' },
1908  { "symmetry", no_argument, nullptr, 'S' },
1909  { "overlay", no_argument, nullptr, 'O' },
1910  { "file", required_argument, nullptr, 'f' },
1911  { "forceSpgP1", no_argument, nullptr, 'u' },
1912  { "removeWaters", no_argument, nullptr, 'w' },
1913  { "firstModel", no_argument, nullptr, 'x' },
1914  { "resolution", required_argument, nullptr, 'r' },
1915  { "bandwidth", required_argument, nullptr, 'b' },
1916  { "sphereDists", required_argument, nullptr, 's' },
1917  { "extraSpace", required_argument, nullptr, 'e' },
1918  { "integOrder", required_argument, nullptr, 'i' },
1919  { "taylorCap", required_argument, nullptr, 't' },
1920  { "invertMap", no_argument, nullptr, '@' },
1921  { "normalise", no_argument, nullptr, '#' },
1922  { "mask", no_argument, nullptr, '$' },
1923  { "saveMask", no_argument, nullptr, '%' },
1924  { "maskFile", required_argument, nullptr, '^' },
1925  { "applyMask", required_argument, nullptr, 'G' },
1926  { "maskBlurring", required_argument, nullptr, '&' },
1927  { "maskThreshold", required_argument, nullptr, '*' },
1928  { "mapReboxing", no_argument, nullptr, 'R' },
1929  { "boundsSpace", required_argument, nullptr, '(' },
1930  { "boundsThreshold", required_argument, nullptr, ')' },
1931  { "sameBoundaries", no_argument, nullptr, '-' },
1932  { "reBoxedFilename", required_argument, nullptr, 'g' },
1933  { "pdbTempFact", required_argument, nullptr, 'd' },
1934  { "center", no_argument, nullptr, 'c' },
1935  { "changeMapResol", no_argument, nullptr, 'j' },
1936  { "changeMapTriLin", no_argument, nullptr, 'a' },
1937  { "noPhase", no_argument, nullptr, 'p' },
1938  { "progressive", no_argument, nullptr, 'k' },
1939  { "noEnL", no_argument, nullptr, 'l' },
1940  { "noTrS", no_argument, nullptr, 'm' },
1941  { "noFRF", no_argument, nullptr, 'n' },
1942  { "EnLWeight", required_argument, nullptr, '_' },
1943  { "peakNeigh", required_argument, nullptr, '=' },
1944  { "peakThres", required_argument, nullptr, '+' },
1945  { "missAxThres", required_argument, nullptr, '[' },
1946  { "sameAxComp", required_argument, nullptr, ']' },
1947  { "axisComBeh", no_argument, nullptr, 'q' },
1948  { "bicubSearch", no_argument, nullptr, 'A' },
1949  { "maxSymPrime", required_argument, nullptr, 'B' },
1950  { "minPeakHeight", required_argument, nullptr, 'o' },
1951  { "fscThres", required_argument, nullptr, 'C' },
1952  { "peakMinThres", required_argument, nullptr, 'E' },
1953  { "reqSym", required_argument, nullptr, '{' },
1954  { "overlayFile", required_argument, nullptr, '}' },
1955  { "overlayJSONFile", required_argument, nullptr, 'y' },
1956  { "angUncertain", required_argument, nullptr, ';' },
1957  { "usePeaksInRotFun",no_argument, nullptr, 'z' },
1958  { "keepNegDens", no_argument, nullptr, 'F' },
1959  { nullptr, 0, nullptr, 0 }
1960  };
1961 
1962  //================================================ Short options string
1963  const char* const shortopts = "AaB:b:C:cd:DE:e:Ff:G:g:hi:jklmMno:Opqr:Rs:St:uvwxy:z!:@#$%^:&:*:(:):-_:=:+:[:]:{:}:;:";
1964 
1965  //================================================ Parsing the options
1966  while ( true )
1967  {
1968  //============================================ Read the next option
1969  int opt = getopt_long_port ( argc, argv, shortopts, longopts, nullptr );
1970 
1971  //============================================ Done parsing
1972  if ( opt == -1 )
1973  {
1974  break;
1975  }
1976 
1977  //============================================ For each option, set the internal values appropriately
1978  switch ( opt )
1979  {
1980  //======================================= Print version info
1981  case 'v':
1982  {
1984  exit ( EXIT_SUCCESS );
1985  }
1986 
1987  //======================================= User needs help
1988  case 'h':
1989  {
1991  }
1992 
1993  //======================================= Save the argument as the verbosity value, or if no value given, just set to 3
1994  case '!':
1995  {
1996  this->setVerbosity ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
1997  continue;
1998  }
1999 
2000  //======================================= Set task to distances
2001  case 'D':
2002  {
2003  this->task = Distances;
2004  continue;
2005  }
2006 
2007  //======================================= Set task to map manipulation
2008  case 'M':
2009  {
2010  this->task = MapManip;
2011  continue;
2012  }
2013 
2014  //======================================= Set task to symmetry detection
2015  case 'S':
2016  {
2017  this->task = Symmetry;
2018 
2019  //=================================== Force default unless changed already by the user
2020  const FloatingPoint< proshade_single > lhs1 ( this->requestedResolution ), rhs1 ( -1.0f );
2021  if ( lhs1.AlmostEquals ( rhs1 ) ) { this->requestedResolution = 6.0; }
2022 
2023  const FloatingPoint< proshade_double > lhs2 ( this->pdbBFactorNewVal ), rhs2 ( -1.0 );
2024  if ( lhs2.AlmostEquals ( rhs2 ) ) { this->pdbBFactorNewVal = 80.0; }
2025  this->changeMapResolution = !this->changeMapResolution; // Switch value. This can be over-ridden by the user by using -j
2026  this->moveToCOM = !this->moveToCOM; // Switch value. This can be over-ridden by the user by using -c.
2027 
2028  continue;
2029  }
2030 
2031  //======================================= Set task to map overlay
2032  case 'O':
2033  {
2034  this->task = OverlayMap;
2035  continue;
2036  }
2037 
2038  //======================================= Save the argument as a file to read in
2039  case 'f':
2040  {
2041  this->addStructure ( std::string ( optarg ) );
2042  continue;
2043  }
2044 
2045  //======================================= Force the input PDB files to have P1 spacegroup
2046  case 'u':
2047  {
2048  this->forceP1 = !this->forceP1;
2049  continue;
2050  }
2051 
2052  //======================================= Remove waters from PDB input files?
2053  case 'w':
2054  {
2055  this->removeWaters = !this->removeWaters;
2056  continue;
2057  }
2058 
2059  //======================================= Use all models, or just the first one?
2060  case 'x':
2061  {
2062  this->firstModelOnly = !this->firstModelOnly;
2063  continue;
2064  }
2065 
2066  //======================================= Save the argument as the resolution value
2067  case 'r':
2068  {
2069  this->setResolution ( static_cast<proshade_single> ( atof ( optarg ) ) );
2070  continue;
2071  }
2072 
2073  //======================================= Save the argument as the bandwidth value
2074  case 'b':
2075  {
2076  this->setBandwidth ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2077  continue;
2078  }
2079 
2080  //======================================= Save the argument as the extra space value
2081  case 'e':
2082  {
2083  this->setExtraSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2084  continue;
2085  }
2086 
2087  //======================================= Save the argument as the intaggration order value
2088  case 'i':
2089  {
2090  this->setIntegrationOrder ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2091  continue;
2092  }
2093 
2094  //======================================= Save the argument as the sphere distance value
2095  case 's':
2096  {
2097  this->setSphereDistances ( static_cast<proshade_single> ( atof ( optarg ) ) );
2098  continue;
2099  }
2100 
2101  //======================================= Save the argument as the taylor series cap value
2102  case 't':
2103  {
2104  this->setTaylorSeriesCap ( static_cast<proshade_unsign> ( atof ( optarg ) ) );
2105  continue;
2106  }
2107 
2108  //======================================= Set map inversion to true
2109  case '@':
2110  {
2111  this->setMapInversion ( true );
2112  continue;
2113  }
2114 
2115  //======================================= Set map normalisation to true
2116  case '#':
2117  {
2118  this->setNormalisation ( true );
2119  continue;
2120  }
2121 
2122  //======================================= Set map masking to true
2123  case '$':
2124  {
2125  this->setMasking ( true );
2126  continue;
2127  }
2128 
2129  //======================================= Set map masking to true and mask map saving to true as well
2130  case '%':
2131  {
2132  this->setMasking ( true );
2133  this->setMaskSaving ( true );
2134  continue;
2135  }
2136 
2137  //======================================= Save the argument as the mask filename value
2138  case '^':
2139  {
2140  this->setMaskFilename ( static_cast<std::string> ( optarg ) );
2141  continue;
2142  }
2143 
2144  //======================================= Save the argument as the mask filename value
2145  case 'G':
2146  {
2147  this->setAppliedMaskFilename ( static_cast<std::string> ( optarg ) );
2148  continue;
2149  }
2150 
2151  //======================================= Save the argument as the mask blurring factor value
2152  case '&':
2153  {
2154  this->setMaskBlurFactor ( static_cast<proshade_single> ( atof ( optarg ) ) );
2155  continue;
2156  }
2157 
2158  //======================================= Save the argument as the mask threshold (IQR) value
2159  case '*':
2160  {
2161  this->setMaskIQR ( static_cast<proshade_single> ( atof ( optarg ) ) );
2162  continue;
2163  }
2164 
2165  //======================================= Set map reboxing to true
2166  case 'R':
2167  {
2168  this->setMasking ( true );
2169  this->setMapReboxing ( true );
2170  continue;
2171  }
2172 
2173  //======================================= Save the argument as the bounds extra space value
2174  case '(':
2175  {
2176  this->setBoundsSpace ( static_cast<proshade_single> ( atof ( optarg ) ) );
2177  continue;
2178  }
2179 
2180  //======================================= Save the argument as the bounds similarity threshold value
2181  case ')':
2182  {
2183  this->setBoundsThreshold ( static_cast<proshade_signed> ( atoi ( optarg ) ) );
2184  continue;
2185  }
2186 
2187  //======================================= Set same boundaries to true
2188  case '-':
2189  {
2190  this->setSameBoundaries ( true );
2191  continue;
2192  }
2193 
2194  //======================================= Save the argument as the re-boxed structure filename value
2195  case 'g':
2196  {
2197  this->setOutputFilename ( static_cast<std::string> ( optarg ) );
2198  continue;
2199  }
2200 
2201  //======================================= Save the argument as the PDB B-factor new constant value
2202  case 'd':
2203  {
2204  this->setPDBBFactor ( static_cast<proshade_double> ( atof ( optarg ) ) );
2205  continue;
2206  }
2207 
2208  //======================================= Set map centering to true
2209  case 'c':
2210  {
2211  this->moveToCOM = !this->moveToCOM;
2212  continue;
2213  }
2214 
2215  //======================================= Set map resolution change using Fourier transforms to true
2216  case 'j':
2217  {
2218  this->changeMapResolution = !this->changeMapResolution;
2219  continue;
2220  }
2221 
2222  //======================================= Set map resolution change using real-space tri-linear interpolation to true
2223  case 'a':
2224  {
2225  this->setMapResolutionChangeTriLinear ( true );
2226  continue;
2227  }
2228 
2229  //======================================= Set map phase removal to true
2230  case 'p':
2231  {
2232  this->setPhaseUsage ( false );
2233  continue;
2234  }
2235 
2236  //======================================= Set progressive shell mapping to true
2237  case 'k':
2238  {
2239  this->setProgressiveSphereMapping ( true );
2240  continue;
2241  }
2242 
2243  //======================================= Set energy level descriptor computation to false
2244  case 'l':
2245  {
2246  this->setEnergyLevelsComputation ( false );
2247  continue;
2248  }
2249 
2250  //======================================= Set trace sigma descriptor computation to false
2251  case 'm':
2252  {
2253  this->setTraceSigmaComputation ( false );
2254  continue;
2255  }
2256 
2257  //======================================= Set full rotation function descriptor computation to false
2258  case 'n':
2259  {
2260  this->setRotationFunctionComputation ( false );
2261  continue;
2262  }
2263 
2264  //======================================= Save the argument as the energy levels descriptor weight value
2265  case '_':
2266  {
2267  this->setEnLevShellWeight ( static_cast<proshade_double> ( atof ( optarg ) ) );
2268  continue;
2269  }
2270 
2271  //======================================= Save the argument as the peak neighbours minimum value
2272  case '=':
2273  {
2274  this->setPeakNeighboursNumber ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2275  continue;
2276  }
2277 
2278  //======================================= Save the argument as the peak IQR from median naive small peaks removal value
2279  case '+':
2280  {
2281  this->setPeakNaiveNoIQR ( static_cast<proshade_double> ( atof ( optarg ) ) );
2282  continue;
2283  }
2284 
2285  //======================================= Save the argument as the missing axis threshold value
2286  case '[':
2287  {
2288  this->setMissingPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2289  continue;
2290  }
2291 
2292  //======================================= Save the argument as the missing axis threshold value
2293  case ']':
2294  {
2295  setAxisComparisonThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2296  continue;
2297  }
2298 
2299  //======================================= Save the argument as the missing axis threshold value
2300  case 'q':
2301  {
2302  this->setAxisComparisonThresholdBehaviour ( !this->axisErrToleranceDefault );
2303  continue;
2304  }
2305 
2306  //======================================= Save the argument as the bicubic interpolation search requirement value
2307  case 'A':
2308  {
2309  this->setBicubicInterpolationSearch ( !this->useBiCubicInterpolationOnPeaks );
2310  continue;
2311  }
2312 
2313  //======================================= Save the argument as the bicubic interpolation search requirement value
2314  case 'B':
2315  {
2316  setMaxSymmetryFold ( static_cast<proshade_unsign> ( atoi ( optarg ) ) );
2317  continue;
2318  }
2319 
2320  //======================================= Minimum peak height for axis
2321  case 'o':
2322  {
2323  this->minSymPeak = static_cast<proshade_double> ( atof ( optarg ) );
2324  continue;
2325  }
2326 
2327  //======================================= Minimum FSC value for axis to be detected
2328  case 'C':
2329  {
2330  this->setFSCThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2331  continue;
2332  }
2333 
2334  //======================================= Minimum peak height value for axis to be considered possible
2335  case 'E':
2336  {
2337  this->setPeakThreshold ( static_cast<proshade_double> ( atof ( optarg ) ) );
2338  continue;
2339  }
2340 
2341  //======================================= Save the argument as the requested symmetry and potentially fold value
2342  case '{':
2343  {
2344  std::string input = static_cast<std::string> ( optarg );
2345 
2346  if ( input.at(0) == 'C' )
2347  {
2348  this->setRequestedSymmetry ( "C" );
2349 
2350  std::string numHlp ( input.begin()+1, input.end() );
2351  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2352  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 ); }
2353  }
2354  else
2355  {
2356  if ( input.at(0) == 'D' )
2357  {
2358  this->setRequestedSymmetry ( "D" );
2359 
2360  std::string numHlp ( input.begin()+1, input.end() );
2361  if ( numHlp.length() > 0 ) { this->setRequestedFold ( static_cast< proshade_unsign > ( atoi ( numHlp.c_str() ) ) ); }
2362  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 ); }
2363  }
2364  else
2365  {
2366  if ( input.at(0) == 'T' )
2367  {
2368  this->setRequestedSymmetry ( "T" );
2369  }
2370  else
2371  {
2372  if ( input.at(0) == 'O' )
2373  {
2374  this->setRequestedSymmetry ( "O" );
2375  }
2376  else
2377  {
2378  if ( input.at(0) == 'I' )
2379  {
2380  this->setRequestedSymmetry ( "I" );
2381  }
2382  else
2383  {
2384  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 );
2385  }
2386  }
2387  }
2388  }
2389  }
2390 
2391  continue;
2392  }
2393 
2394  //======================================= Save the argument as filename to save the overlay moved structure to value
2395  case '}':
2396  {
2397  this->setOverlaySaveFile ( static_cast<std::string> ( optarg ) );
2398  continue;
2399  }
2400 
2401  //======================================= Save the argument as filename to save the overlay operations to value
2402  case 'y':
2403  {
2404  this->setOverlayJsonFile ( static_cast<std::string> ( optarg ) );
2405  continue;
2406  }
2407 
2408  //======================================= Save the argument as angular uncertainty for bandwidth determination
2409  case ';':
2410  {
2411  this->rotationUncertainty = static_cast<proshade_double> ( atof ( optarg ) );
2412  continue;
2413  }
2414 
2415  //======================================= Forces usage of the old symmetry detection algorithm - DEPRECATED
2416  case 'z':
2417  {
2418  this->setSymmetryRotFunPeaks ( false );
2419  continue;
2420  }
2421 
2422  //======================================= Should the negative density from input files be removed?
2423  case 'F':
2424  {
2425  this->setNegativeDensity ( false );
2426  continue;
2427  }
2428 
2429  //======================================= Unknown option
2430  case '?':
2431  {
2432  //=================================== Save the argument as angular uncertainty for bandwidth determination
2433  if ( optopt )
2434  {
2435  std::cout << "!!! ProSHADE ERROR !!! Unrecognised short option -" << static_cast<char> ( optopt ) << " . Please use -h for help on the command line options." << std::endl;
2436  }
2437  else
2438  {
2439  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;
2440  }
2441 
2442  //=================================== This case is handled by getopt_long, nothing more needed.
2443  exit ( EXIT_SUCCESS );
2444  }
2445 
2446  //======================================= Fallback option
2447  default:
2448  {
2450  }
2451  }
2452  }
2453 
2454  //================================================ Done
2455  return ;
2456 
2457 }
2458 
2463 #if defined ( _WIN64 ) || defined ( _WIN32 )
2464 void __declspec(dllexport) ProSHADE_settings::printSettings ( )
2465 #else
2467 #endif
2468 {
2469  //================================================ Print the currest values in the settings object
2470  //== Settings regarding the task at hand
2471  std::stringstream strstr;
2472  strstr.str(std::string());
2473  if ( this->task == NA ) { strstr << "NA"; }
2474  if ( this->task == Distances ) { strstr << "DISTANCES COMPUTATION"; }
2475  if ( this->task == MapManip ) { strstr << "MAP MANIPULATION"; }
2476  if ( this->task == Symmetry ) { strstr << "SYMMETRY DETECTION"; }
2477  if ( this->task == OverlayMap ) { strstr << "MAP OVERLAY"; }
2478  printf ( "Task to perform : %37s\n", strstr.str().c_str() );
2479 
2480  //== Settings regarding the input files
2481  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->inputFiles.size() ); iter++ )
2482  {
2483  strstr.str(std::string());
2484  strstr << this->inputFiles.at(iter);
2485  printf ( "File(s) to process : %37s\n", strstr.str().c_str() );
2486  }
2487 
2488  strstr.str(std::string());
2489  if ( this->forceP1 ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2490  printf ( "Force P1 spacegroup : %37s\n", strstr.str().c_str() );
2491 
2492  strstr.str(std::string());
2493  if ( this->removeWaters ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2494  printf ( "Waters removed : %37s\n", strstr.str().c_str() );
2495 
2496  strstr.str(std::string());
2497  if ( this->firstModelOnly ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2498  printf ( "Only 1st model : %37s\n", strstr.str().c_str() );
2499 
2500  strstr.str(std::string());
2501  if ( this->removeNegativeDensity ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2502  printf ( "Remove neg. dens. : %37s\n", strstr.str().c_str() );
2503 
2504  //== Settings regarding the resolution of calculations
2505  strstr.str(std::string());
2506  strstr << this->requestedResolution;
2507  printf ( "Resolution (comp) : %37s\n", strstr.str().c_str() );
2508 
2509  strstr.str(std::string());
2510  if ( this->changeMapResolution ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2511  printf ( "Change map resol : %37s\n", strstr.str().c_str() );
2512 
2513  strstr.str(std::string());
2514  if ( this->changeMapResolutionTriLinear ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2515  printf ( "Change map tri-lin : %37s\n", strstr.str().c_str() );
2516 
2517  //== Settings regarding the PDB B-factor change
2518  strstr.str(std::string());
2519  strstr << this->pdbBFactorNewVal;
2520  printf ( "PDB B-factor const : %37s\n", strstr.str().c_str() );
2521 
2522  //== Settings regarding the bandwidth of calculations
2523  strstr.str(std::string());
2524  strstr << this->maxBandwidth;
2525  printf ( "Bandwidth : %37s\n", strstr.str().c_str() );
2526 
2527  strstr.str(std::string());
2528  strstr << this->rotationUncertainty;
2529  printf ( "Rotation doubt : %37s\n", strstr.str().c_str() );
2530 
2531  //== Settings regarding the phase
2532  strstr.str(std::string());
2533  if ( this->usePhase ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2534  printf ( "Use phase info : %37s\n", strstr.str().c_str() );
2535 
2536  //== Settings regarding the spheres
2537  strstr.str(std::string());
2538  strstr << this->maxSphereDists;
2539  printf ( "Sphere distances : %37s\n", strstr.str().c_str() );
2540 
2541  //== Settings regarding the Gauss-Legendre integration
2542  strstr.str(std::string());
2543  strstr << this->integOrder;
2544  printf ( "Integration order : %37s\n", strstr.str().c_str() );
2545 
2546  strstr.str(std::string());
2547  strstr << this->taylorSeriesCap;
2548  printf ( "Taylor series cap : %37s\n", strstr.str().c_str() );
2549 
2550  //== Settings regarding map normalisation
2551  strstr.str(std::string());
2552  if ( this->normaliseMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2553  printf ( "Map normalisation : %37s\n", strstr.str().c_str() );
2554 
2555  //== Settings regarding map inversion
2556  strstr.str(std::string());
2557  if ( this->invertMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2558  printf ( "Map inversion : %37s\n", strstr.str().c_str() );
2559 
2560  //== Settings regarding map masking
2561  strstr.str(std::string());
2562  strstr << this->blurFactor;
2563  printf ( "Map blurring : %37s\n", strstr.str().c_str() );
2564 
2565  strstr.str(std::string());
2566  strstr << this->maskingThresholdIQRs;
2567  printf ( "Masking threshold : %37s\n", strstr.str().c_str() );
2568 
2569  strstr.str(std::string());
2570  if ( this->maskMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2571  printf ( "Map masking : %37s\n", strstr.str().c_str() );
2572 
2573  strstr.str(std::string());
2574  if ( this->useCorrelationMasking ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2575  printf ( "Correlation mask : %37s\n", strstr.str().c_str() );
2576 
2577  strstr.str(std::string());
2578  strstr << this->halfMapKernel;
2579  printf ( "Half-map kernel : %37s\n", strstr.str().c_str() );
2580 
2581  strstr.str(std::string());
2582  strstr << this->correlationKernel;
2583  printf ( "Correlation kernel : %37s\n", strstr.str().c_str() );
2584 
2585  strstr.str(std::string());
2586  if ( this->saveMask ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2587  printf ( "Saving mask : %37s\n", strstr.str().c_str() );
2588 
2589  strstr.str(std::string());
2590  strstr << this->maskFileName;
2591  printf ( "Map mask filename : %37s\n", strstr.str().c_str() );
2592 
2593  //== Settings regarding re-boxing
2594  strstr.str(std::string());
2595  if ( this->reBoxMap ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2596  printf ( "Map re-boxing : %37s\n", strstr.str().c_str() );
2597 
2598  strstr.str(std::string());
2599  strstr << this->boundsExtraSpace;
2600  printf ( "Bounds extra space : %37s\n", strstr.str().c_str() );
2601 
2602  strstr.str(std::string());
2603  strstr << this->boundsSimilarityThreshold;
2604  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2605 
2606  strstr.str(std::string());
2607  if ( this->useSameBounds ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2608  printf ( "Same boundaries : %37s\n", strstr.str().c_str() );
2609 
2610  strstr.str(std::string());
2611  if ( this->forceBounds != nullptr )
2612  {
2613  strstr << this->forceBounds[0] << " - " << this->forceBounds[1] << " | " << this->forceBounds[2] << " - " << this->forceBounds[3] << " | " << this->forceBounds[4] << " - " << this->forceBounds[5];
2614  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2615  }
2616  else
2617  {
2618  strstr << "Not allocated";
2619  printf ( "Bounds similarity : %37s\n", strstr.str().c_str() );
2620  }
2621 
2622  //== Settings regarding COM
2623  strstr.str(std::string());
2624  if ( this->moveToCOM ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2625  printf ( "Map COM centering : %37s\n", strstr.str().c_str() );
2626 
2627  //== Settings regarding extra cell space
2628  strstr.str(std::string());
2629  strstr << this->addExtraSpace;
2630  printf ( "Extra space : %37s\n", strstr.str().c_str() );
2631 
2632  //== Settings regarding shell settings
2633  strstr.str(std::string());
2634  if ( this->progressiveSphereMapping ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2635  printf ( "Progressive spheres : %37s\n", strstr.str().c_str() );
2636 
2637  //== Settings regarding output file name
2638  strstr.str(std::string());
2639  strstr << this->outName;
2640  printf ( "Re-boxed filename : %37s\n", strstr.str().c_str() );
2641 
2642  //== Settings regarding distances computation
2643  strstr.str(std::string());
2644  if ( this->computeEnergyLevelsDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2645  printf ( "Energy lvl desc : %37s\n", strstr.str().c_str() );
2646 
2647  strstr.str(std::string());
2648  strstr << this->enLevMatrixPowerWeight;
2649  printf ( "Energy lvl weight : %37s\n", strstr.str().c_str() );
2650 
2651  strstr.str(std::string());
2652  if ( this->computeTraceSigmaDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2653  printf ( "Tr sigma desc : %37s\n", strstr.str().c_str() );
2654 
2655  strstr.str(std::string());
2656  if ( this->computeRotationFuncDesc ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2657  printf ( "Full RF desc : %37s\n", strstr.str().c_str() );
2658 
2659  //== Settings regarding peak searching
2660  strstr.str(std::string());
2661  strstr << this->peakNeighbours;
2662  printf ( "Neightbours to peak : %37s\n", strstr.str().c_str() );
2663 
2664  strstr.str(std::string());
2665  strstr << this->noIQRsFromMedianNaivePeak;
2666  printf ( "Peak IQR threshold : %37s\n", strstr.str().c_str() );
2667 
2668  //== Settings regarding 1D grouping
2669  strstr.str(std::string());
2670  strstr << this->smoothingFactor;
2671  printf ( "Smoothing factor : %37s\n", strstr.str().c_str() );
2672 
2673  //== Settings regarding the symmetry detection
2674  strstr.str(std::string());
2675  strstr << this->symMissPeakThres;
2676  printf ( "Missing ax. thres : %37s\n", strstr.str().c_str() );
2677 
2678  strstr.str(std::string());
2679  strstr << this->axisErrTolerance;
2680  printf ( "Same ax. threshold : %37s\n", strstr.str().c_str() );
2681 
2682  strstr.str(std::string());
2683  if ( this->axisErrToleranceDefault ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2684  printf ( "Same ax. thre. decr.: %37s\n", strstr.str().c_str() );
2685 
2686  strstr.str(std::string());
2687  strstr << this->minSymPeak;
2688  printf ( "Min. sym. peak size : %37s\n", strstr.str().c_str() );
2689 
2690  strstr.str(std::string());
2691  strstr << this->recommendedSymmetryType << "-" << this->recommendedSymmetryFold;
2692  printf ( "Recommended symm. : %37s\n", strstr.str().c_str() );
2693 
2694  strstr.str(std::string());
2695  strstr << this->requestedSymmetryType << "-" << this->requestedSymmetryFold;
2696  printf ( "Requested symm. : %37s\n", strstr.str().c_str() );
2697 
2698  strstr.str(std::string());
2699  if ( this->usePeakSearchInRotationFunctionSpace ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2700  printf ( "Use RF Peaks : %37s\n", strstr.str().c_str() );
2701 
2702  strstr.str(std::string());
2703  if ( this->useBiCubicInterpolationOnPeaks ) { strstr << "TRUE"; } else { strstr << "FALSE"; }
2704  printf ( "Use bicubic interp. : %37s\n", strstr.str().c_str() );
2705 
2706  strstr.str(std::string());
2707  strstr << this->maxSymmetryFold;
2708  printf ( "Max symmetry fold : %37s\n", strstr.str().c_str() );
2709 
2710  strstr.str(std::string());
2711  strstr << this->fscThreshold;
2712  printf ( "FSC Threshold : %37s\n", strstr.str().c_str() );
2713 
2714  strstr.str(std::string());
2715  strstr << this->peakThresholdMin;
2716  printf ( "Peak Threshold : %37s\n", strstr.str().c_str() );
2717 
2718  //== Settings regarding the structure overlay
2719  strstr.str(std::string());
2720  strstr << this->overlayStructureName;
2721  printf ( "Overlay file : %37s\n", strstr.str().c_str() );
2722 
2723  strstr.str(std::string());
2724  strstr << this->rotTrsJSONFile;
2725  printf ( "JSON overlay file : %37s\n", strstr.str().c_str() );
2726 
2727  //== Settings regarding verbosity of the program
2728  strstr.str(std::string());
2729  strstr << this->verbose;
2730  printf ( "Verbosity : %37s\n", strstr.str().c_str() );
2731 
2732  //================================================ Done
2733  return ;
2734 
2735 }
2736 
2741 #if defined ( _WIN64 ) || defined ( _WIN32 )
2742 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEnergyLevelsVector ( )
2743 #else
2744 std::vector< proshade_double > ProSHADE_run::getEnergyLevelsVector ( )
2745 #endif
2746 {
2747  //================================================ Return the value
2748  return ( this->enLevs );
2749 }
2750 
2755 #if defined ( _WIN64 ) || defined ( _WIN32 )
2756 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTraceSigmaVector ( )
2757 #else
2758 std::vector< proshade_double > ProSHADE_run::getTraceSigmaVector ( )
2759 #endif
2760 {
2761  //================================================ Return the value
2762  return ( this->trSigm );
2763 }
2764 
2769 #if defined ( _WIN64 ) || defined ( _WIN32 )
2770 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getRotationFunctionVector ( )
2771 #else
2772 std::vector< proshade_double > ProSHADE_run::getRotationFunctionVector ( )
2773 #endif
2774 {
2775  //================================================ Return the value
2776  return ( this->rotFun );
2777 }
2778 
2784 {
2785  //================================================ Return the value
2786  return ( this->noStructures );
2787 }
2788 
2793 proshade_signed ProSHADE_run::getVerbose ( )
2794 {
2795  //================================================ Return the value
2796  return ( this->verbose );
2797 }
2798 
2804 {
2805  //================================================ Return the value
2806  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
2807 }
2808 
2814 {
2815  //================================================ Return the value
2816  return ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) );
2817 }
2818 
2824 #if defined ( _WIN64 ) || defined ( _WIN32 )
2825 std::vector< std::string > __declspec(dllexport) ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
2826 #else
2827 std::vector< std::string > ProSHADE_run::getSymmetryAxis ( proshade_unsign axisNo )
2828 #endif
2829 {
2830  //================================================ Sanity checks
2831  if ( static_cast<proshade_unsign> ( this->RecomSymAxes.size() ) <= axisNo )
2832  {
2833  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested symmetry index does not exist. Returning empty vector.", "WS00039" );
2834  return ( std::vector< std::string > ( ) );
2835  }
2836 
2837  //================================================ Initialise local variables
2838  std::vector< std::string > ret;
2839 
2840  //================================================ Input the axis data as strings
2841  std::stringstream ssHlp;
2842  ssHlp << this->RecomSymAxes.at(axisNo)[0];
2843  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2844  ssHlp.str ( "" );
2845 
2846  ssHlp << this->RecomSymAxes.at(axisNo)[1];
2847  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2848  ssHlp.str ( "" );
2849 
2850  ssHlp << this->RecomSymAxes.at(axisNo)[2];
2851  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2852  ssHlp.str ( "" );
2853 
2854  ssHlp << this->RecomSymAxes.at(axisNo)[3];
2855  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2856  ssHlp.str ( "" );
2857 
2858  ssHlp << this->RecomSymAxes.at(axisNo)[4];
2859  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2860  ssHlp.str ( "" );
2861 
2862  ssHlp << this->RecomSymAxes.at(axisNo)[5];
2863  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2864  ssHlp.str ( "" );
2865 
2866  ssHlp << this->RecomSymAxes.at(axisNo)[6];
2867  ProSHADE_internal_misc::addToStringVector ( &ret, ssHlp.str() );
2868  ssHlp.str ( "" );
2869 
2870  //================================================ Done
2871  return ( ret );
2872 
2873 }
2874 
2879 #if defined ( _WIN64 ) || defined ( _WIN32 )
2880 std::vector < std::vector< proshade_double > > __declspec(dllexport) ProSHADE_run::getAllCSyms ( )
2881 #else
2882 std::vector < std::vector< proshade_double > > ProSHADE_run::getAllCSyms ( )
2883 #endif
2884 {
2885  //================================================ Done
2886  return ( this->allCSymAxes );
2887 
2888 }
2889 
2894 #if defined ( _WIN64 ) || defined ( _WIN32 )
2895 std::vector < proshade_double > __declspec(dllexport) ProSHADE_run::getMapCOMProcessChange ( )
2896 #else
2897 std::vector < proshade_double > ProSHADE_run::getMapCOMProcessChange ( )
2898 #endif
2899 {
2900  //================================================ Done
2901  return ( this->mapCOMShift );
2902 
2903 }
2904 
2909 #if defined ( _WIN64 ) || defined ( _WIN32 )
2910 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
2911 #else
2912 std::vector< proshade_signed > ProSHADE_run::getOriginalBounds ( proshade_unsign strNo )
2913 #endif
2914 {
2915  //================================================ Sanity checks
2916  if ( noStructures <= strNo )
2917  {
2918  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
2919  return ( std::vector< proshade_signed > ( ) );
2920  }
2921 
2922  //================================================ Initialise local variables
2923  std::vector< proshade_signed > ret;
2924 
2925  //================================================ Input the axis data as strings
2926  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[0] );
2927  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[1] );
2928  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[2] );
2929  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[3] );
2930  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[4] );
2931  ProSHADE_internal_misc::addToSignedVector ( &ret, this->originalBounds.at( strNo )[5] );
2932 
2933  //================================================ Done
2934  return ( ret );
2935 }
2936 
2941 #if defined ( _WIN64 ) || defined ( _WIN32 )
2942 std::vector< proshade_signed > __declspec(dllexport) ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
2943 #else
2944 std::vector< proshade_signed > ProSHADE_run::getReBoxedBounds ( proshade_unsign strNo )
2945 #endif
2946 {
2947  //================================================ Sanity checks
2948  if ( noStructures <= strNo )
2949  {
2950  ProSHADE_internal_messages::printWarningMessage ( this->verbose, "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
2951  return ( std::vector< proshade_signed > ( ) );
2952  }
2953 
2954  //================================================ Initialise local variables
2955  std::vector< proshade_signed > ret;
2956 
2957  //================================================ Input the axis data as strings
2958  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[0] );
2959  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[1] );
2960  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[2] );
2961  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[3] );
2962  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[4] );
2963  ProSHADE_internal_misc::addToSignedVector ( &ret, this->reboxedBounds.at( strNo )[5] );
2964 
2965  //================================================ Done
2966  return ( ret );
2967 }
2968 
2975 #if defined ( _WIN64 ) || defined ( _WIN32 )
2976 proshade_double __declspec(dllexport) ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
2977 #else
2978 proshade_double ProSHADE_run::getMapValue ( proshade_unsign strNo, proshade_unsign mapIndex )
2979 #endif
2980 {
2981  //================================================ Return the value
2982  return ( this->manipulatedMaps.at(strNo)[mapIndex] );
2983 }
2984 
2992 #if defined ( _WIN64 ) || defined ( _WIN32 )
2993 void __declspec(dllexport) getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
2994 #else
2995 void getReBoxedMap ( ProSHADE_run* run, proshade_unsign strNo, double *reboxMap, int len )
2996 #endif
2997 {
2998  //================================================ Sanity checks
2999  if ( run->getNoStructures() <= strNo )
3000  {
3001  ProSHADE_internal_messages::printWarningMessage ( run->getVerbose(), "!!! ProSHADE WARNING !!! Requested bounds for structure index which does not exist. Returning empty vector.", "WB00041" );
3002  return ;
3003  }
3004 
3005  //================================================ Save the data into the output array
3006  for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++)
3007  {
3008  reboxMap[iter] = static_cast<double> ( run->getMapValue ( strNo, iter ) );
3009  }
3010 
3011  //================================================ Done
3012  return ;
3013 
3014 }
3015 
3020 #if defined ( _WIN64 ) || defined ( _WIN32 )
3021 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getEulerAngles ( )
3022 #else
3023 std::vector< proshade_double > ProSHADE_run::getEulerAngles ( )
3024 #endif
3025 {
3026  //================================================ Sanity check
3027  if ( this->eulerAngles.size() != 3 )
3028  {
3029  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" );
3030  return ( std::vector< proshade_double > ( ) );
3031  }
3032 
3033  //================================================ Return required value
3034  return ( this->eulerAngles );
3035 
3036 }
3037 
3042 #if defined ( _WIN64 ) || defined ( _WIN32 )
3043 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOptimalRotMat ( )
3044 #else
3045 std::vector< proshade_double > ProSHADE_run::getOptimalRotMat ( )
3046 #endif
3047 {
3048  //================================================ Sanity check
3049  if ( this->eulerAngles.size() != 3 )
3050  {
3051  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" );
3052  return ( std::vector< proshade_double > ( ) );
3053  }
3054 
3055  //================================================ Obtain the optimal rotation matrix
3056  proshade_double* rotMat = new proshade_double[9];
3057  ProSHADE_internal_misc::checkMemoryAllocation ( rotMat, __FILE__, __LINE__, __func__ );
3058  ProSHADE_internal_maths::getRotationMatrixFromEulerZXZAngles ( this->eulerAngles.at(0), this->eulerAngles.at(1), this->eulerAngles.at(2), rotMat );
3059 
3060  //================================================ Copy to the output variable
3061  std::vector< proshade_double > ret;
3062  for ( proshade_unsign iter = 0; iter < 9; iter++ ) { ProSHADE_internal_misc::addToDoubleVector ( &ret, rotMat[iter] ); }
3063 
3064  //================================================ Release the memory
3065  delete[] rotMat;
3066 
3067  //================================================ Return required value
3068  return ( ret );
3069 
3070 }
3071 
3076 #if defined ( _WIN64 ) || defined ( _WIN32 )
3077 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getTranslationToOrigin ( )
3078 #else
3079 std::vector< proshade_double > ProSHADE_run::getTranslationToOrigin ( )
3080 #endif
3081 {
3082  //================================================ Sanity check
3083  if ( this->coordRotationCentre.size() != 3 )
3084  {
3085  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" );
3086  return ( std::vector< proshade_double > ( ) );
3087  }
3088 
3089  //================================================ Create return variable with negative values of the internal varariable
3090  std::vector < proshade_double > ret;
3091  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(0) );
3092  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(1) );
3093  ProSHADE_internal_misc::addToDoubleVector ( &ret, -this->coordRotationCentre.at(2) );
3094 
3095  //================================================ Return required value
3096  return ( ret );
3097 
3098 }
3099 
3104 #if defined ( _WIN64 ) || defined ( _WIN32 )
3105 std::vector< proshade_double > __declspec(dllexport) ProSHADE_run::getOriginToOverlayTranslation ( )
3106 #else
3107 std::vector< proshade_double > ProSHADE_run::getOriginToOverlayTranslation ( )
3108 #endif
3109 {
3110  //================================================ Sanity check
3111  if ( this->overlayTranslation.size() != 3 )
3112  {
3113  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" );
3114  return ( std::vector< proshade_double > ( ) );
3115  }
3116 
3117  //================================================ Return required value
3118  return ( this->overlayTranslation );
3119 
3120 }
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:115
ProSHADE_settings::setOverlayJsonFile
void setOverlayJsonFile(std::string filename)
Sets the filename to which the overlay operations are to be save into.
Definition: ProSHADE.cpp:1346
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:377
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:125
ProSHADE_settings::setEnLevShellWeight
void setEnLevShellWeight(proshade_double mPower)
Sets the weight of shell position for the energy levels computation.
Definition: ProSHADE.cpp:1080
ProSHADE_settings::setTraceSigmaComputation
void setTraceSigmaComputation(bool trSigVal)
Sets whether the trace sigma distance descriptor should be computed.
Definition: ProSHADE.cpp:972
ProSHADE_settings::setSameBoundaries
void setSameBoundaries(bool sameB)
Sets whether same boundaries should be used in the appropriate variable.
Definition: ProSHADE.cpp:728
ProSHADE_run::~ProSHADE_run
~ProSHADE_run(void)
Destructor for the ProSHADE class.
Definition: ProSHADE.cpp:1762
ProSHADE_settings::setMinimumMaskSize
void setMinimumMaskSize(proshade_single minMS)
Sets the requested minimum mask size.
Definition: ProSHADE.cpp:586
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:1612
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:2772
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:646
ProSHADE_settings::setBicubicInterpolationSearch
void setBicubicInterpolationSearch(bool bicubPeaks)
Sets the bicubic interpolation on peaks.
Definition: ProSHADE.cpp:1382
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:1036
ProSHADE_exception
This class is the representation of ProSHADE exception.
Definition: ProSHADE_exceptions.hpp:37
ProSHADE_settings::setMapInversion
void setMapInversion(bool mInv)
Sets the requested map inversion value in the appropriate variable.
Definition: ProSHADE.cpp:442
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:769
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:1014
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:2882
ProSHADE_run::getNoSymmetryAxes
proshade_unsign getNoSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:2803
ProSHADE_settings::setSphereDistances
void setSphereDistances(proshade_single sphDist)
Sets the requested distance between spheres in the appropriate variable.
Definition: ProSHADE.cpp:869
ProSHADE_settings::setVerbosity
void setVerbosity(proshade_signed verbosity)
Sets the requested verbosity in the appropriate variable.
Definition: ProSHADE.cpp:462
ProSHADE_settings::setMinimumPeakForAxis
void setMinimumPeakForAxis(proshade_double minSP)
Sets the minimum peak height for symmetry axis to be considered.
Definition: ProSHADE.cpp:1188
ProSHADE_settings::requestedResolution
proshade_single requestedResolution
The resolution to which the calculations are to be done.
Definition: ProSHADE_settings.hpp:50
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:1167
ProSHADE_settings::setDetectedSymmetry
void setDetectedSymmetry(proshade_double *sym)
Sets the final detected symmetry axes information.
Definition: ProSHADE.cpp:1294
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:3023
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:1011
ProSHADE_settings::setPDBBFactor
void setPDBBFactor(proshade_double newBF)
Sets the requested B-factor value for PDB files in the appropriate variable.
Definition: ProSHADE.cpp:402
ProSHADE_settings::addStructure
void addStructure(std::string structure)
Adds a structure file name to the appropriate variable.
Definition: ProSHADE.cpp:362
ProSHADE_settings::determineIntegrationOrder
void determineIntegrationOrder(proshade_single maxMapRange)
This function determines the integration order for the between spheres integration.
Definition: ProSHADE.cpp:1568
ProSHADE_settings::setMaskIQR
void setMaskIQR(proshade_single noIQRs)
Sets the requested number of IQRs for masking threshold in the appropriate variable.
Definition: ProSHADE.cpp:503
ProSHADE_settings::setMissingPeakThreshold
void setMissingPeakThreshold(proshade_double mpThres)
Sets the threshold for starting the missing peaks procedure.
Definition: ProSHADE.cpp:1123
ProSHADE_run::getVerbose
proshade_signed getVerbose(void)
This function returns the verbose value.
Definition: ProSHADE.cpp:2793
ProSHADE_settings::setMapCentering
void setMapCentering(bool com)
Sets the requested map centering decision value in the appropriate variable.
Definition: ProSHADE.cpp:809
ProSHADE_settings::setMaskBlurFactor
void setMaskBlurFactor(proshade_single blurFac)
Sets the requested map blurring factor in the appropriate variable.
Definition: ProSHADE.cpp:482
ProSHADE_internal_messages::printWarningMessage
void printWarningMessage(proshade_signed verbose, std::string message, std::string warnCode)
General stderr message printing (used for warnings).
Definition: ProSHADE_messages.cpp:101
ProSHADE_settings::setPeakThreshold
void setPeakThreshold(proshade_double peakThr)
Sets the minimum peak height threshold for axis to be considered possible.
Definition: ProSHADE.cpp:1436
ProSHADE_settings::setPhaseUsage
void setPhaseUsage(bool phaseUsage)
Sets whether the phase information will be used.
Definition: ProSHADE.cpp:1058
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:140
ProSHADE_settings::setFSCThreshold
void setFSCThreshold(proshade_double fscThr)
Sets the minimum FSC threshold for axis to be considered detected.
Definition: ProSHADE.cpp:1418
ProSHADE_settings::setBandwidth
void setBandwidth(proshade_unsign band)
Sets the requested spherical harmonics bandwidth in the appropriate variable.
Definition: ProSHADE.cpp:849
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:687
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::setOutputFilename
void setOutputFilename(std::string oFileName)
Sets the requested output file name in the appropriate variable.
Definition: ProSHADE.cpp:749
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:504
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:2827
ProSHADE_settings::setAxisComparisonThreshold
void setAxisComparisonThreshold(proshade_double axThres)
Sets the threshold for matching symmetry axes.
Definition: ProSHADE.cpp:1144
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::setTypicalNoiseSize
void setTypicalNoiseSize(proshade_single typNoi)
Sets the requested "fake" half-map kernel in the appropriate variable.
Definition: ProSHADE.cpp:566
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:310
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:626
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:1811
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:3079
ProSHADE_settings::setSymmetryRotFunPeaks
void setSymmetryRotFunPeaks(bool rotFunPeaks)
Sets the symmetry detection algorithm type.
Definition: ProSHADE.cpp:1364
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:2995
ProSHADE_settings::setRequestedFold
void setRequestedFold(proshade_unsign val)
Sets the user requested symmetry fold.
Definition: ProSHADE.cpp:1273
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::determineBandwidthFromAngle
void determineBandwidthFromAngle(proshade_double uncertainty)
This function determines the bandwidth for the spherical harmonics computation from the allowed rotat...
Definition: ProSHADE.cpp:1505
ProSHADE_settings::getCommandLineParams
void getCommandLineParams(int argc, char **argv)
This function parses the command line arguments into the settings object.
Definition: ProSHADE.cpp:1894
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:1796
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:2744
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:666
ProSHADE_settings::setRecommendedSymmetry
void setRecommendedSymmetry(std::string val)
Sets the ProSHADE detected symmetry type.
Definition: ProSHADE.cpp:1210
ProSHADE_settings::setMaxSymmetryFold
void setMaxSymmetryFold(proshade_unsign maxFold)
Sets the maximum symmetry fold (well, the maximum prime symmetry fold).
Definition: ProSHADE.cpp:1400
ProSHADE_settings::setNegativeDensity
void setNegativeDensity(bool nDens)
Sets the internal variable deciding whether input files negative density should be removed.
Definition: ProSHADE.cpp:1454
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:910
ProSHADE_settings::setCorrelationMasking
void setCorrelationMasking(bool corMask)
Sets the requested map masking type in the appropriate variable.
Definition: ProSHADE.cpp:544
ProSHADE_settings::setProgressiveSphereMapping
void setProgressiveSphereMapping(bool progSphMap)
Sets the requested sphere mapping value settings approach in the appropriate variable.
Definition: ProSHADE.cpp:930
ProSHADE_settings::setIntegrationOrder
void setIntegrationOrder(proshade_unsign intOrd)
Sets the requested order for the Gauss-Legendre integration in the appropriate variable.
Definition: ProSHADE.cpp:889
ProSHADE_settings::setRotationFunctionComputation
void setRotationFunctionComputation(bool rotfVal)
Sets whether the rotation function distance descriptor should be computed.
Definition: ProSHADE.cpp:993
ProSHADE_run::getReBoxedBounds
std::vector< proshade_signed > getReBoxedBounds(proshade_unsign strNo)
This function returns a specific structure re-boxed bounds.
Definition: ProSHADE.cpp:2944
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:318
ProSHADE_settings::setOverlaySaveFile
void setOverlaySaveFile(std::string filename)
Sets the filename to which the overlay structure is to be save into.
Definition: ProSHADE.cpp:1328
ProSHADE_settings::determineBandwidth
void determineBandwidth(proshade_unsign circumference)
This function determines the bandwidth for the spherical harmonics computation.
Definition: ProSHADE.cpp:1473
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_run::ProSHADE_run
ProSHADE_run(ProSHADE_settings *settings)
Contructor for the ProSHADE_run class.
Definition: ProSHADE.cpp:1664
ProSHADE_run::getMapValue
proshade_double getMapValue(proshade_unsign strNo, proshade_unsign mapIndex)
This function returns a single, specific structure map value.
Definition: ProSHADE.cpp:2978
ProSHADE_run::getNoRecommendedSymmetryAxes
proshade_unsign getNoRecommendedSymmetryAxes(void)
This function returns the number of detected recommended symmetry axes.
Definition: ProSHADE.cpp:2813
ProSHADE_settings::determineSphereDistances
void determineSphereDistances(proshade_single maxMapRange)
This function determines the sphere distances for sphere mapping.
Definition: ProSHADE.cpp:1536
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:67
ProSHADE_settings::setGroupingSmoothingFactor
void setGroupingSmoothingFactor(proshade_double smFact)
Sets the grouping smoothing factor into the proper variable.
Definition: ProSHADE.cpp:1102
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:1253
ProSHADE_settings::setExtraSpace
void setExtraSpace(proshade_single exSpace)
Sets the requested map extra space value in the appropriate variable.
Definition: ProSHADE.cpp:829
ProSHADE_settings::recommendedSymmetryFold
proshade_unsign recommendedSymmetryFold
The fold of the recommended symmetry C or D type, 0 otherwise.
Definition: ProSHADE_settings.hpp:126
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:789
ProSHADE_settings::setMaskSaving
void setMaskSaving(bool savMsk)
Sets whether the mask should be saved.
Definition: ProSHADE.cpp:606
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::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:707
ProSHADE_settings::setMasking
void setMasking(bool mask)
Sets the requested map masking decision value in the appropriate variable.
Definition: ProSHADE.cpp:523
ProSHADE_settings::setRecommendedFold
void setRecommendedFold(proshade_unsign val)
Sets the ProSHADE detected symmetry fold.
Definition: ProSHADE.cpp:1233
ProSHADE_settings::usePeakSearchInRotationFunctionSpace
bool usePeakSearchInRotationFunctionSpace
This variable switch decides whether symmetry detection will be done using peak search in rotation fu...
Definition: ProSHADE_settings.hpp:129
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:3045
ProSHADE_run::getOriginalBounds
std::vector< proshade_signed > getOriginalBounds(proshade_unsign strNo)
This function returns a specific structure original bounds.
Definition: ProSHADE.cpp:2912
ProSHADE_settings::setVariablesLeftOnAuto
void setVariablesLeftOnAuto(void)
Function to determine general values that the user left on auto-determination.
Definition: ProSHADE.cpp:333
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:2758
ProSHADE_internal_messages::printProgressMessage
void printProgressMessage(proshade_signed verbose, proshade_signed messageLevel, std::string message)
General stdout message printing.
Definition: ProSHADE_messages.cpp:70
ProSHADE_internal_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:118
ProSHADE_settings::setResolution
void setResolution(proshade_single resolution)
Sets the requested resolution in the appropriate variable.
Definition: ProSHADE.cpp:382
ProSHADE_settings::printSettings
void printSettings(void)
This function prints the current values in the settings object.
Definition: ProSHADE.cpp:2466
ProSHADE_run::getNoStructures
proshade_unsign getNoStructures(void)
This function returns the number of structures used.
Definition: ProSHADE.cpp:2783
ProSHADE_run::getMapCOMProcessChange
std::vector< proshade_double > getMapCOMProcessChange(void)
This function returns the internal map COM shift.
Definition: ProSHADE.cpp:2897
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:287
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:3107
ProSHADE_settings::setNormalisation
void setNormalisation(bool normalise)
Sets the requested map normalisation value in the appropriate variable.
Definition: ProSHADE.cpp:422
ProSHADE_settings::setEnergyLevelsComputation
void setEnergyLevelsComputation(bool enLevDesc)
Sets whether the energy level distance descriptor should be computed.
Definition: ProSHADE.cpp:951