34 #if defined ( _WIN64 ) || defined ( _WIN32 )
46 this->firstModelOnly =
true;
47 this->removeNegativeDensity =
true;
50 this->requestedResolution = -1.0;
51 this->changeMapResolution =
false;
52 this->changeMapResolutionTriLinear =
false;
55 this->pdbBFactorNewVal = -1.0;
58 this->maxBandwidth = 0;
59 this->rotationUncertainty = 0;
62 this->usePhase =
true;
65 this->maxSphereDists = 0.0;
69 this->taylorSeriesCap = 10;
72 this->normaliseMap =
false;
75 this->invertMap =
false;
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 =
"";
89 this->fourierWeightsFileName =
"";
92 this->reBoxMap =
false;
93 this->boundsExtraSpace = 3.0;
94 this->boundsSimilarityThreshold = 0;
95 this->useSameBounds =
false;
96 this->forceBounds =
new proshade_signed [6];
99 this->moveToCOM =
false;
102 this->addExtraSpace = 10.0;
105 this->progressiveSphereMapping =
false;
108 this->outName =
"reBoxed";
111 this->computeEnergyLevelsDesc =
true;
112 this->computeTraceSigmaDesc =
true;
113 this->computeRotationFuncDesc =
true;
114 this->enLevMatrixPowerWeight = 1.0;
117 this->peakNeighbours = 1;
118 this->noIQRsFromMedianNaivePeak = -999.9;
121 this->smoothingFactor = 15.0;
124 this->useBiCubicInterpolationOnPeaks =
true;
125 this->maxSymmetryFold = 30;
126 this->fscThreshold = 0.65;
127 this->peakThresholdMin = 0.80;
128 this->symMissPeakThres = 0.3;
129 this->axisErrTolerance = 0.01;
130 this->axisErrToleranceDefault =
true;
131 this->minSymPeak = 0.3;
132 this->recommendedSymmetryType =
"";
133 this->recommendedSymmetryFold = 0;
134 this->requestedSymmetryType =
"";
135 this->requestedSymmetryFold = 0;
136 this->detectedSymmetry.clear ( );
139 this->overlayStructureName =
"movedStructure";
140 this->rotTrsJSONFile =
"movedStructureOperations.json";
157 #if defined ( _WIN64 ) || defined ( _WIN32 )
164 this->task = taskToPerform;
167 this->forceP1 =
true;
169 this->firstModelOnly =
true;
170 this->removeNegativeDensity =
true;
173 this->requestedResolution = -1.0;
174 this->changeMapResolution =
false;
175 this->changeMapResolutionTriLinear =
false;
178 this->pdbBFactorNewVal = -1.0;
181 this->maxBandwidth = 0;
182 this->rotationUncertainty = 0;
185 this->usePhase =
true;
188 this->maxSphereDists = 0.0;
191 this->integOrder = 0;
192 this->taylorSeriesCap = 10;
195 this->normaliseMap =
false;
198 this->invertMap =
false;
201 this->blurFactor = 350.0;
202 this->maskingThresholdIQRs = 3.0;
203 this->maskMap =
false;
204 this->useCorrelationMasking =
false;
205 this->halfMapKernel = 0.0;
206 this->correlationKernel = 0.0;
207 this->saveMask =
false;
208 this->maskFileName =
"maskFile";
209 this->appliedMaskFileName =
"";
212 this->fourierWeightsFileName =
"";
215 this->reBoxMap =
false;
216 this->boundsExtraSpace = 3.0;
217 this->boundsSimilarityThreshold = 0;
218 this->useSameBounds =
false;
219 this->forceBounds =
new proshade_signed [6];
222 this->addExtraSpace = 10.0;
225 this->progressiveSphereMapping =
false;
228 this->outName =
"reBoxed";
231 this->computeEnergyLevelsDesc =
true;
232 this->computeTraceSigmaDesc =
true;
233 this->computeRotationFuncDesc =
true;
234 this->enLevMatrixPowerWeight = 1.0;
237 this->peakNeighbours = 1;
238 this->noIQRsFromMedianNaivePeak = -999.9;
241 this->smoothingFactor = 15.0;
244 this->useBiCubicInterpolationOnPeaks =
true;
245 this->maxSymmetryFold = 30;
246 this->fscThreshold = 0.65;
247 this->peakThresholdMin = 0.80;
248 this->symMissPeakThres = 0.3;
249 this->axisErrTolerance = 0.01;
250 this->axisErrToleranceDefault =
true;
251 this->minSymPeak = 0.3;
252 this->recommendedSymmetryType =
"";
253 this->recommendedSymmetryFold = 0;
254 this->requestedSymmetryType =
"";
255 this->requestedSymmetryFold = 0;
256 this->detectedSymmetry.clear ( );
259 this->overlayStructureName =
"movedStructure";
260 this->rotTrsJSONFile =
"movedStructureOperations.json";
266 switch ( this->task )
269 std::cerr << std::endl <<
"=====================" << std::endl <<
"!! ProSHADE ERROR !!" << std::endl <<
"=====================" << std::endl << std::flush;
270 std::cerr <<
"Error Code : " <<
"E000014" << std::endl << std::flush;
271 std::cerr <<
"ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
272 std::cerr <<
"File : " <<
"ProSHADE.cpp" << std::endl << std::flush;
273 std::cerr <<
"Line : " << 97 << std::endl << std::flush;
274 std::cerr <<
"Function : " <<
"ProSHADE_settings (Task) constructor" << std::endl << std::flush;
275 std::cerr <<
"Message : " <<
"No task has been specified for task specific constructor." << std::endl << std::flush;
276 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;
278 exit ( EXIT_FAILURE );
281 this->requestedResolution = 6.0;
282 this->pdbBFactorNewVal = 80.0;
283 this->changeMapResolution =
true;
284 this->maskMap =
false;
285 this->moveToCOM =
true;
286 this->reBoxMap =
false;
290 this->changeMapResolution =
false;
291 this->maskMap =
false;
292 this->moveToCOM =
true;
293 this->reBoxMap =
false;
297 this->requestedResolution = 8.0;
298 this->changeMapResolution =
true;
299 this->maskMap =
false;
300 this->moveToCOM =
false;
301 this->reBoxMap =
false;
305 this->changeMapResolution =
false;
306 this->maskMap =
true;
307 this->moveToCOM =
false;
319 #if defined ( _WIN64 ) || defined ( _WIN32 )
326 delete[] this->forceBounds;
329 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); } } }
341 if ( lhs.AlmostEquals( rhs ) )
360 #if defined ( _WIN64 ) || defined ( _WIN32 )
380 #if defined ( _WIN64 ) || defined ( _WIN32 )
387 this->requestedResolution = resolution;
400 #if defined ( _WIN64 ) || defined ( _WIN32 )
407 this->pdbBFactorNewVal = newBF;
420 #if defined ( _WIN64 ) || defined ( _WIN32 )
427 this->normaliseMap = normalise;
440 #if defined ( _WIN64 ) || defined ( _WIN32 )
447 this->invertMap = mInv;
460 #if defined ( _WIN64 ) || defined ( _WIN32 )
467 this->verbose = verbosity;
480 #if defined ( _WIN64 ) || defined ( _WIN32 )
487 this->blurFactor = blurFac;
501 #if defined ( _WIN64 ) || defined ( _WIN32 )
508 this->maskingThresholdIQRs = noIQRs;
521 #if defined ( _WIN64 ) || defined ( _WIN32 )
528 this->maskMap = mask;
542 #if defined ( _WIN64 ) || defined ( _WIN32 )
549 this->useCorrelationMasking = corMask;
564 #if defined ( _WIN64 ) || defined ( _WIN32 )
571 this->halfMapKernel = typNoi;
584 #if defined ( _WIN64 ) || defined ( _WIN32 )
591 this->correlationKernel = minMS;
604 #if defined ( _WIN64 ) || defined ( _WIN32 )
611 this->saveMask = savMsk;
624 #if defined ( _WIN64 ) || defined ( _WIN32 )
631 this->maskFileName = mskFln;
644 #if defined ( _WIN64 ) || defined ( _WIN32 )
651 this->appliedMaskFileName = mskFln;
664 #if defined ( _WIN64 ) || defined ( _WIN32 )
671 this->fourierWeightsFileName = fWgFln;
684 #if defined ( _WIN64 ) || defined ( _WIN32 )
691 this->reBoxMap = reBx;
705 #if defined ( _WIN64 ) || defined ( _WIN32 )
712 this->boundsExtraSpace = boundsExSp;
725 #if defined ( _WIN64 ) || defined ( _WIN32 )
732 this->boundsSimilarityThreshold = boundsThres;
746 #if defined ( _WIN64 ) || defined ( _WIN32 )
753 this->useSameBounds = sameB;
767 #if defined ( _WIN64 ) || defined ( _WIN32 )
774 this->outName = oFileName;
787 #if defined ( _WIN64 ) || defined ( _WIN32 )
794 this->changeMapResolution = mrChange;
807 #if defined ( _WIN64 ) || defined ( _WIN32 )
814 this->changeMapResolutionTriLinear = mrChange;
827 #if defined ( _WIN64 ) || defined ( _WIN32 )
834 this->moveToCOM = com;
847 #if defined ( _WIN64 ) || defined ( _WIN32 )
854 this->addExtraSpace = exSpace;
867 #if defined ( _WIN64 ) || defined ( _WIN32 )
874 this->maxBandwidth = band;
887 #if defined ( _WIN64 ) || defined ( _WIN32 )
894 this->maxSphereDists = sphDist;
907 #if defined ( _WIN64 ) || defined ( _WIN32 )
914 this->integOrder = intOrd;
928 #if defined ( _WIN64 ) || defined ( _WIN32 )
935 this->taylorSeriesCap = tayCap;
948 #if defined ( _WIN64 ) || defined ( _WIN32 )
955 this->progressiveSphereMapping = progSphMap;
969 #if defined ( _WIN64 ) || defined ( _WIN32 )
976 this->computeEnergyLevelsDesc = enLevDesc;
990 #if defined ( _WIN64 ) || defined ( _WIN32 )
997 this->computeTraceSigmaDesc = trSigVal;
1011 #if defined ( _WIN64 ) || defined ( _WIN32 )
1018 this->computeRotationFuncDesc = rotfVal;
1032 #if defined ( _WIN64 ) || defined ( _WIN32 )
1039 this->peakNeighbours = pkS;
1054 #if defined ( _WIN64 ) || defined ( _WIN32 )
1061 this->noIQRsFromMedianNaivePeak = noIQRs;
1076 #if defined ( _WIN64 ) || defined ( _WIN32 )
1083 this->usePhase = phaseUsage;
1098 #if defined ( _WIN64 ) || defined ( _WIN32 )
1105 this->enLevMatrixPowerWeight = mPower;
1120 #if defined ( _WIN64 ) || defined ( _WIN32 )
1127 this->smoothingFactor = smFact;
1141 #if defined ( _WIN64 ) || defined ( _WIN32 )
1148 this->symMissPeakThres = mpThres;
1162 #if defined ( _WIN64 ) || defined ( _WIN32 )
1169 this->axisErrTolerance = axThres;
1185 #if defined ( _WIN64 ) || defined ( _WIN32 )
1192 this->axisErrToleranceDefault = behav;
1206 #if defined ( _WIN64 ) || defined ( _WIN32 )
1213 this->minSymPeak = minSP;
1228 #if defined ( _WIN64 ) || defined ( _WIN32 )
1235 this->recommendedSymmetryType = val;
1251 #if defined ( _WIN64 ) || defined ( _WIN32 )
1258 this->recommendedSymmetryFold = val;
1271 #if defined ( _WIN64 ) || defined ( _WIN32 )
1278 this->requestedSymmetryType = val;
1291 #if defined ( _WIN64 ) || defined ( _WIN32 )
1298 this->requestedSymmetryFold = val;
1312 #if defined ( _WIN64 ) || defined ( _WIN32 )
1319 proshade_double* hlpAxis =
new proshade_double [7];
1323 hlpAxis[0] = sym[0];
1324 hlpAxis[1] = sym[1];
1325 hlpAxis[2] = sym[2];
1326 hlpAxis[3] = sym[3];
1327 hlpAxis[4] = sym[4];
1328 hlpAxis[5] = sym[5];
1329 hlpAxis[6] = sym[6];
1346 #if defined ( _WIN64 ) || defined ( _WIN32 )
1353 this->overlayStructureName = filename;
1364 #if defined ( _WIN64 ) || defined ( _WIN32 )
1371 this->rotTrsJSONFile = filename;
1382 #if defined ( _WIN64 ) || defined ( _WIN32 )
1389 this->useBiCubicInterpolationOnPeaks = bicubPeaks;
1400 #if defined ( _WIN64 ) || defined ( _WIN32 )
1407 this->maxSymmetryFold = maxFold;
1418 #if defined ( _WIN64 ) || defined ( _WIN32 )
1425 this->fscThreshold = fscThr;
1436 #if defined ( _WIN64 ) || defined ( _WIN32 )
1443 this->peakThresholdMin = peakThr;
1454 #if defined ( _WIN64 ) || defined ( _WIN32 )
1461 this->removeNegativeDensity = nDens;
1481 std::stringstream hlpSS;
1482 hlpSS <<
"The bandwidth was determined as: " << this->
maxBandwidth;
1491 std::stringstream hlpSS;
1492 hlpSS <<
"The bandwidth was determined as: " << this->
maxBandwidth;
1511 if (
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2 ) ) % 2 == 0 )
1513 this->
maxBandwidth =
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) );
1517 this->
maxBandwidth =
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) ) + 1;
1521 std::stringstream hlpSS;
1522 hlpSS <<
"The bandwidth was determined from uncertainty " << uncertainty <<
" degrees as: " << this->
maxBandwidth;
1544 std::stringstream hlpSS;
1545 hlpSS <<
"The sphere distances were determined as " << this->
maxSphereDists <<
" Angstroms.";
1554 std::stringstream hlpSS;
1555 hlpSS <<
"The sphere distances were determined as " << this->
maxSphereDists <<
" Angstroms.";
1576 std::stringstream hlpSS;
1577 hlpSS <<
"The integration order was determined as " << this->
integOrder;
1586 std::stringstream hlpSS;
1587 hlpSS <<
"The integration order was determined as " << this->
integOrder;
1621 proshade_unsign theoXDim =
static_cast< proshade_unsign
> ( std::ceil ( xDimAngs / ( this->
requestedResolution / 2.0f ) ) );
1622 proshade_unsign theoYDim =
static_cast< proshade_unsign
> ( std::ceil ( yDimAngs / ( this->
requestedResolution / 2.0f ) ) );
1623 proshade_unsign theoZDim =
static_cast< proshade_unsign
> ( std::ceil ( zDimAngs / ( this->
requestedResolution / 2.0f ) ) );
1626 proshade_unsign maxDim = std::max ( theoXDim, std::max ( theoYDim, theoZDim ) );
1627 proshade_unsign minDim = std::min ( theoXDim, std::min ( theoYDim, theoZDim ) );
1628 proshade_unsign midDim = 0;
1629 if ( ( xDim < maxDim ) && ( xDim > minDim ) ) { midDim = theoXDim; }
1630 else if ( ( yDim < maxDim ) && ( yDim > minDim ) ) { midDim = theoYDim; }
1631 else { midDim = theoZDim; }
1633 proshade_unsign circ = ( maxDim ) + ( midDim );
1640 proshade_single maxDiag =
static_cast< proshade_single
> ( std::sqrt ( std::pow (
static_cast<proshade_single
> ( maxDim ) * ( this->
requestedResolution / 2.0f ), 2.0f ) +
1641 std::pow (
static_cast<proshade_single
> ( midDim ) * ( this->
requestedResolution / 2.0f ), 2.0f ) ) );
1664 #if defined ( _WIN64 ) || defined ( _WIN32 )
1674 this->noStructures =
static_cast<proshade_unsign
> ( settings->
inputFiles.size() );
1675 this->verbose =
static_cast<proshade_signed
> ( settings->
verbose );
1681 switch ( settings->
task )
1684 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." );
1688 this->setSymmetryResults ( settings );
1708 std::cerr << std::endl <<
"=====================" << std::endl <<
"!! ProSHADE ERROR !!" << std::endl <<
"=====================" << std::endl << std::flush;
1709 std::cerr <<
"Error Code : " << err.
get_errc() << std::endl << std::flush;
1710 std::cerr <<
"ProSHADE version : " << PROSHADE_VERSION << std::endl << std::flush;
1711 std::cerr <<
"File : " << err.
get_file() << std::endl << std::flush;
1712 std::cerr <<
"Line : " << err.
get_line() << std::endl << std::flush;
1713 std::cerr <<
"Function : " << err.
get_func() << std::endl << std::flush;
1714 std::cerr <<
"Message : " << err.what() << std::endl << std::flush;
1715 std::cerr <<
"Further information : " << err.
get_info() << std::endl << std::endl << std::flush;
1719 exit ( EXIT_FAILURE );
1725 std::cerr << std::endl <<
"=====================" << std::endl <<
"!! ProSHADE ERROR !!" << std::endl <<
"=====================" << std::endl << std::flush;
1728 #if __cplusplus >= 201103L
1729 std::exception_ptr exc = std::current_exception();
1734 std::rethrow_exception ( exc );
1737 catch (
const std::exception& e )
1739 std::cerr <<
"Caught unknown exception with following information: " << e.what() << std::endl << std::flush;
1742 std::cerr <<
"Unknown error with no further explanation available. Please contact the author for help." << std::endl << std::flush;
1744 std::cerr <<
"Terminating..." << std::endl << std::endl << std::flush;
1748 exit ( EXIT_FAILURE );
1762 #if defined ( _WIN64 ) || defined ( _WIN32 )
1769 if ( this->originalBounds.size() > 0 ) {
for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->originalBounds.size() ); iter++ ) {
delete[] this->originalBounds.at(iter); } }
1770 if ( this->reboxedBounds.size() > 0 ) {
for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->reboxedBounds.size() ); iter++ ) {
delete[] this->reboxedBounds.at(iter); } }
1771 if ( this->manipulatedMaps.size() > 0 ) {
for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->manipulatedMaps.size() ); iter++ ) {
delete[] this->manipulatedMaps.at(iter); } }
1774 this->enLevs.clear ( );
1775 this->trSigm.clear ( );
1776 this->rotFun.clear ( );
1779 if ( this->RecomSymAxes.size() > 0 )
1781 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->RecomSymAxes.size() ); iter++ )
1783 delete[] this->RecomSymAxes.at(iter);
1785 this->RecomSymAxes.clear ( );
1796 #if defined ( _WIN64 ) || defined ( _WIN32 )
1804 return ( this->symRecommType );
1811 #if defined ( _WIN64 ) || defined ( _WIN32 )
1818 return ( this->symRecommFold );
1827 void ProSHADE_run::setRecommendedSymmetry ( std::string val )
1830 this->symRecommType = val;
1844 void ProSHADE_run::setRecommendedFold ( proshade_unsign val )
1847 this->symRecommFold = val;
1861 void ProSHADE_run::setRecommendedAxis ( proshade_double* sym )
1894 #if defined ( _WIN64 ) || defined ( _WIN32 )
1904 const struct option_port longopts[] =
1906 {
"version", no_argument,
nullptr,
'v' },
1907 {
"help", no_argument,
nullptr,
'h' },
1908 {
"verbose", required_argument,
nullptr,
'!' },
1909 {
"distances", no_argument,
nullptr,
'D' },
1910 {
"mapManip", no_argument,
nullptr,
'M' },
1911 {
"symmetry", no_argument,
nullptr,
'S' },
1912 {
"overlay", no_argument,
nullptr,
'O' },
1913 {
"file", required_argument,
nullptr,
'f' },
1914 {
"forceSpgP1", no_argument,
nullptr,
'u' },
1915 {
"removeWaters", no_argument,
nullptr,
'w' },
1916 {
"firstModel", no_argument,
nullptr,
'x' },
1917 {
"resolution", required_argument,
nullptr,
'r' },
1918 {
"bandwidth", required_argument,
nullptr,
'b' },
1919 {
"sphereDists", required_argument,
nullptr,
's' },
1920 {
"extraSpace", required_argument,
nullptr,
'e' },
1921 {
"integOrder", required_argument,
nullptr,
'i' },
1922 {
"taylorCap", required_argument,
nullptr,
't' },
1923 {
"invertMap", no_argument,
nullptr,
'@' },
1924 {
"normalise", no_argument,
nullptr,
'#' },
1925 {
"mask", no_argument,
nullptr,
'$' },
1926 {
"saveMask", no_argument,
nullptr,
'%' },
1927 {
"maskFile", required_argument,
nullptr,
'^' },
1928 {
"applyMask", required_argument,
nullptr,
'G' },
1929 {
"maskBlurring", required_argument,
nullptr,
'&' },
1930 {
"maskThreshold", required_argument,
nullptr,
'*' },
1931 {
"mapReboxing", no_argument,
nullptr,
'R' },
1932 {
"boundsSpace", required_argument,
nullptr,
'(' },
1933 {
"boundsThreshold", required_argument,
nullptr,
')' },
1934 {
"sameBoundaries", no_argument,
nullptr,
'-' },
1935 {
"reBoxedFilename", required_argument,
nullptr,
'g' },
1936 {
"pdbTempFact", required_argument,
nullptr,
'd' },
1937 {
"center", no_argument,
nullptr,
'c' },
1938 {
"changeMapResol", no_argument,
nullptr,
'j' },
1939 {
"changeMapTriLin", no_argument,
nullptr,
'a' },
1940 {
"noPhase", no_argument,
nullptr,
'p' },
1941 {
"progressive", no_argument,
nullptr,
'k' },
1942 {
"noEnL", no_argument,
nullptr,
'l' },
1943 {
"noTrS", no_argument,
nullptr,
'm' },
1944 {
"noFRF", no_argument,
nullptr,
'n' },
1945 {
"EnLWeight", required_argument,
nullptr,
'_' },
1946 {
"peakNeigh", required_argument,
nullptr,
'=' },
1947 {
"peakThres", required_argument,
nullptr,
'+' },
1948 {
"missAxThres", required_argument,
nullptr,
'[' },
1949 {
"sameAxComp", required_argument,
nullptr,
']' },
1950 {
"axisComBeh", no_argument,
nullptr,
'q' },
1951 {
"bicubSearch", no_argument,
nullptr,
'A' },
1952 {
"maxSymPrime", required_argument,
nullptr,
'B' },
1953 {
"minPeakHeight", required_argument,
nullptr,
'o' },
1954 {
"fscThres", required_argument,
nullptr,
'C' },
1955 {
"peakMinThres", required_argument,
nullptr,
'E' },
1956 {
"reqSym", required_argument,
nullptr,
'{' },
1957 {
"overlayFile", required_argument,
nullptr,
'}' },
1958 {
"overlayJSONFile", required_argument,
nullptr,
'y' },
1959 {
"angUncertain", required_argument,
nullptr,
';' },
1960 {
"fourierWeights", required_argument,
nullptr,
'z' },
1961 {
"keepNegDens", no_argument,
nullptr,
'F' },
1962 {
nullptr, 0,
nullptr, 0 }
1966 const char*
const shortopts =
"AaB:b:C:cd:DE:e:Ff:G:g:hi:jklmMno:Opqr:Rs:St:uvwxy:z:!:@#$%^:&:*:(:):-_:=:+:[:]:{:}:;:";
1972 int opt = getopt_long_port ( argc, argv, shortopts, longopts,
nullptr );
1987 exit ( EXIT_SUCCESS );
1999 this->setVerbosity (
static_cast<proshade_signed
> ( atoi ( optarg ) ) );
2006 this->task = Distances;
2013 this->task = MapManip;
2020 this->task = Symmetry;
2023 const FloatingPoint< proshade_single > lhs1 ( this->requestedResolution ), rhs1 ( -1.0f );
2024 if ( lhs1.AlmostEquals ( rhs1 ) ) { this->requestedResolution = 6.0; }
2026 const FloatingPoint< proshade_double > lhs2 ( this->pdbBFactorNewVal ), rhs2 ( -1.0 );
2027 if ( lhs2.AlmostEquals ( rhs2 ) ) { this->pdbBFactorNewVal = 80.0; }
2028 this->changeMapResolution = !this->changeMapResolution;
2029 this->moveToCOM = !this->moveToCOM;
2037 this->task = OverlayMap;
2044 this->addStructure ( std::string ( optarg ) );
2051 this->forceP1 = !this->forceP1;
2065 this->firstModelOnly = !this->firstModelOnly;
2072 this->setResolution (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2079 this->setBandwidth (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2086 this->setExtraSpace (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2093 this->setIntegrationOrder (
static_cast<proshade_unsign
> ( atof ( optarg ) ) );
2100 this->setSphereDistances (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2107 this->setTaylorSeriesCap (
static_cast<proshade_unsign
> ( atof ( optarg ) ) );
2114 this->setMapInversion (
true );
2121 this->setNormalisation (
true );
2128 this->setMasking (
true );
2135 this->setMasking (
true );
2136 this->setMaskSaving (
true );
2143 this->setMaskFilename (
static_cast<std::string
> ( optarg ) );
2150 this->setAppliedMaskFilename (
static_cast<std::string
> ( optarg ) );
2157 this->setFourierWeightsFilename (
static_cast<std::string
> ( optarg ) );
2164 this->setMaskBlurFactor (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2171 this->setMaskIQR (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2178 this->setMasking (
true );
2179 this->setMapReboxing (
true );
2186 this->setBoundsSpace (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2193 this->setBoundsThreshold (
static_cast<proshade_signed
> ( atoi ( optarg ) ) );
2200 this->setSameBoundaries (
true );
2207 this->setOutputFilename (
static_cast<std::string
> ( optarg ) );
2214 this->setPDBBFactor (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2221 this->moveToCOM = !this->moveToCOM;
2228 this->changeMapResolution = !this->changeMapResolution;
2235 this->setMapResolutionChangeTriLinear (
true );
2242 this->setPhaseUsage (
false );
2249 this->setProgressiveSphereMapping (
true );
2256 this->setEnergyLevelsComputation (
false );
2263 this->setTraceSigmaComputation (
false );
2270 this->setRotationFunctionComputation (
false );
2277 this->setEnLevShellWeight (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2284 this->setPeakNeighboursNumber (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2291 this->setPeakNaiveNoIQR (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2298 this->setMissingPeakThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2305 setAxisComparisonThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2312 this->setAxisComparisonThresholdBehaviour ( !this->axisErrToleranceDefault );
2319 this->setBicubicInterpolationSearch ( !this->useBiCubicInterpolationOnPeaks );
2326 setMaxSymmetryFold (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2333 this->minSymPeak =
static_cast<proshade_double
> ( atof ( optarg ) );
2340 this->setFSCThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2347 this->setPeakThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2354 std::string input =
static_cast<std::string
> ( optarg );
2356 if ( input.at(0) ==
'C' )
2358 this->setRequestedSymmetry (
"C" );
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 ); }
2366 if ( input.at(0) ==
'D' )
2368 this->setRequestedSymmetry (
"D" );
2370 std::string numHlp ( input.begin()+1, input.end() );
2371 if ( numHlp.length() > 0 ) { this->setRequestedFold (
static_cast< proshade_unsign
> ( atoi ( numHlp.c_str() ) ) ); }
2372 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 ); }
2376 if ( input.at(0) ==
'T' )
2378 this->setRequestedSymmetry (
"T" );
2382 if ( input.at(0) ==
'O' )
2384 this->setRequestedSymmetry (
"O" );
2388 if ( input.at(0) ==
'I' )
2390 this->setRequestedSymmetry (
"I" );
2394 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 );
2407 this->setOverlaySaveFile (
static_cast<std::string
> ( optarg ) );
2414 this->setOverlayJsonFile (
static_cast<std::string
> ( optarg ) );
2421 this->rotationUncertainty =
static_cast<proshade_double
> ( atof ( optarg ) );
2428 this->setNegativeDensity (
false );
2438 std::cout <<
"!!! ProSHADE ERROR !!! Unrecognised short option -" <<
static_cast<char> ( optopt ) <<
" . Please use -h for help on the command line options." << std::endl;
2442 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;
2446 exit ( EXIT_SUCCESS );
2466 #if defined ( _WIN64 ) || defined ( _WIN32 )
2474 std::stringstream strstr;
2475 strstr.str(std::string());
2476 if ( this->task == NA ) { strstr <<
"NA"; }
2477 if ( this->task == Distances ) { strstr <<
"DISTANCES COMPUTATION"; }
2478 if ( this->task == MapManip ) { strstr <<
"MAP MANIPULATION"; }
2479 if ( this->task == Symmetry ) { strstr <<
"SYMMETRY DETECTION"; }
2480 if ( this->task == OverlayMap ) { strstr <<
"MAP OVERLAY"; }
2481 printf (
"Task to perform : %37s\n", strstr.str().c_str() );
2484 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->inputFiles.size() ); iter++ )
2486 strstr.str(std::string());
2487 strstr << this->inputFiles.at(iter);
2488 printf (
"File(s) to process : %37s\n", strstr.str().c_str() );
2491 strstr.str(std::string());
2492 if ( this->forceP1 ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2493 printf (
"Force P1 spacegroup : %37s\n", strstr.str().c_str() );
2495 strstr.str(std::string());
2496 if ( this->
removeWaters ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2497 printf (
"Waters removed : %37s\n", strstr.str().c_str() );
2499 strstr.str(std::string());
2500 if ( this->firstModelOnly ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2501 printf (
"Only 1st model : %37s\n", strstr.str().c_str() );
2503 strstr.str(std::string());
2504 if ( this->removeNegativeDensity ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2505 printf (
"Remove neg. dens. : %37s\n", strstr.str().c_str() );
2508 strstr.str(std::string());
2509 strstr << this->requestedResolution;
2510 printf (
"Resolution (comp) : %37s\n", strstr.str().c_str() );
2512 strstr.str(std::string());
2513 if ( this->changeMapResolution ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2514 printf (
"Change map resol : %37s\n", strstr.str().c_str() );
2516 strstr.str(std::string());
2517 if ( this->changeMapResolutionTriLinear ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2518 printf (
"Change map tri-lin : %37s\n", strstr.str().c_str() );
2521 strstr.str(std::string());
2522 strstr << this->pdbBFactorNewVal;
2523 printf (
"PDB B-factor const : %37s\n", strstr.str().c_str() );
2526 strstr.str(std::string());
2527 strstr << this->maxBandwidth;
2528 printf (
"Bandwidth : %37s\n", strstr.str().c_str() );
2530 strstr.str(std::string());
2531 strstr << this->rotationUncertainty;
2532 printf (
"Rotation doubt : %37s\n", strstr.str().c_str() );
2535 strstr.str(std::string());
2536 if ( this->usePhase ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2537 printf (
"Use phase info : %37s\n", strstr.str().c_str() );
2540 strstr.str(std::string());
2541 strstr << this->maxSphereDists;
2542 printf (
"Sphere distances : %37s\n", strstr.str().c_str() );
2545 strstr.str(std::string());
2546 strstr << this->integOrder;
2547 printf (
"Integration order : %37s\n", strstr.str().c_str() );
2549 strstr.str(std::string());
2550 strstr << this->taylorSeriesCap;
2551 printf (
"Taylor series cap : %37s\n", strstr.str().c_str() );
2554 strstr.str(std::string());
2555 if ( this->normaliseMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2556 printf (
"Map normalisation : %37s\n", strstr.str().c_str() );
2559 strstr.str(std::string());
2560 if ( this->invertMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2561 printf (
"Map inversion : %37s\n", strstr.str().c_str() );
2564 strstr.str(std::string());
2565 strstr << this->blurFactor;
2566 printf (
"Map blurring : %37s\n", strstr.str().c_str() );
2568 strstr.str(std::string());
2569 strstr << this->maskingThresholdIQRs;
2570 printf (
"Masking threshold : %37s\n", strstr.str().c_str() );
2572 strstr.str(std::string());
2573 if ( this->maskMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2574 printf (
"Map masking : %37s\n", strstr.str().c_str() );
2576 strstr.str(std::string());
2577 if ( this->useCorrelationMasking ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2578 printf (
"Correlation mask : %37s\n", strstr.str().c_str() );
2580 strstr.str(std::string());
2581 strstr << this->halfMapKernel;
2582 printf (
"Half-map kernel : %37s\n", strstr.str().c_str() );
2584 strstr.str(std::string());
2585 strstr << this->correlationKernel;
2586 printf (
"Correlation kernel : %37s\n", strstr.str().c_str() );
2588 strstr.str(std::string());
2589 if ( this->saveMask ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2590 printf (
"Saving mask : %37s\n", strstr.str().c_str() );
2592 strstr.str(std::string());
2593 strstr << this->maskFileName;
2594 printf (
"Map mask filename : %37s\n", strstr.str().c_str() );
2597 strstr.str(std::string());
2598 if ( this->reBoxMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2599 printf (
"Map re-boxing : %37s\n", strstr.str().c_str() );
2601 strstr.str(std::string());
2602 strstr << this->boundsExtraSpace;
2603 printf (
"Bounds extra space : %37s\n", strstr.str().c_str() );
2605 strstr.str(std::string());
2606 strstr << this->boundsSimilarityThreshold;
2607 printf (
"Bounds similarity : %37s\n", strstr.str().c_str() );
2609 strstr.str(std::string());
2610 if ( this->useSameBounds ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2611 printf (
"Same boundaries : %37s\n", strstr.str().c_str() );
2613 strstr.str(std::string());
2614 if ( this->forceBounds !=
nullptr )
2616 strstr << this->forceBounds[0] <<
" - " << this->forceBounds[1] <<
" | " << this->forceBounds[2] <<
" - " << this->forceBounds[3] <<
" | " << this->forceBounds[4] <<
" - " << this->forceBounds[5];
2617 printf (
"Bounds similarity : %37s\n", strstr.str().c_str() );
2621 strstr <<
"Not allocated";
2622 printf (
"Bounds similarity : %37s\n", strstr.str().c_str() );
2626 strstr.str(std::string());
2627 if ( this->moveToCOM ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2628 printf (
"Map COM centering : %37s\n", strstr.str().c_str() );
2631 strstr.str(std::string());
2632 strstr << this->addExtraSpace;
2633 printf (
"Extra space : %37s\n", strstr.str().c_str() );
2636 strstr.str(std::string());
2637 if ( this->progressiveSphereMapping ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2638 printf (
"Progressive spheres : %37s\n", strstr.str().c_str() );
2641 strstr.str(std::string());
2642 strstr << this->outName;
2643 printf (
"Re-boxed filename : %37s\n", strstr.str().c_str() );
2646 strstr.str(std::string());
2647 if ( this->computeEnergyLevelsDesc ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2648 printf (
"Energy lvl desc : %37s\n", strstr.str().c_str() );
2650 strstr.str(std::string());
2651 strstr << this->enLevMatrixPowerWeight;
2652 printf (
"Energy lvl weight : %37s\n", strstr.str().c_str() );
2654 strstr.str(std::string());
2655 if ( this->computeTraceSigmaDesc ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2656 printf (
"Tr sigma desc : %37s\n", strstr.str().c_str() );
2658 strstr.str(std::string());
2659 if ( this->computeRotationFuncDesc ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2660 printf (
"Full RF desc : %37s\n", strstr.str().c_str() );
2663 strstr.str(std::string());
2664 strstr << this->peakNeighbours;
2665 printf (
"Neightbours to peak : %37s\n", strstr.str().c_str() );
2667 strstr.str(std::string());
2668 strstr << this->noIQRsFromMedianNaivePeak;
2669 printf (
"Peak IQR threshold : %37s\n", strstr.str().c_str() );
2672 strstr.str(std::string());
2673 strstr << this->smoothingFactor;
2674 printf (
"Smoothing factor : %37s\n", strstr.str().c_str() );
2677 strstr.str(std::string());
2678 strstr << this->symMissPeakThres;
2679 printf (
"Missing ax. thres : %37s\n", strstr.str().c_str() );
2681 strstr.str(std::string());
2682 strstr << this->axisErrTolerance;
2683 printf (
"Same ax. threshold : %37s\n", strstr.str().c_str() );
2685 strstr.str(std::string());
2686 if ( this->axisErrToleranceDefault ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2687 printf (
"Same ax. thre. decr.: %37s\n", strstr.str().c_str() );
2689 strstr.str(std::string());
2690 strstr << this->minSymPeak;
2691 printf (
"Min. sym. peak size : %37s\n", strstr.str().c_str() );
2693 strstr.str(std::string());
2694 strstr << this->recommendedSymmetryType <<
"-" << this->recommendedSymmetryFold;
2695 printf (
"Recommended symm. : %37s\n", strstr.str().c_str() );
2697 strstr.str(std::string());
2698 strstr << this->requestedSymmetryType <<
"-" << this->requestedSymmetryFold;
2699 printf (
"Requested symm. : %37s\n", strstr.str().c_str() );
2701 strstr.str(std::string());
2702 if ( this->useBiCubicInterpolationOnPeaks ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2703 printf (
"Use bicubic interp. : %37s\n", strstr.str().c_str() );
2705 strstr.str(std::string());
2706 strstr << this->maxSymmetryFold;
2707 printf (
"Max symmetry fold : %37s\n", strstr.str().c_str() );
2709 strstr.str(std::string());
2710 strstr << this->fscThreshold;
2711 printf (
"FSC Threshold : %37s\n", strstr.str().c_str() );
2713 strstr.str(std::string());
2714 strstr << this->peakThresholdMin;
2715 printf (
"Peak Threshold : %37s\n", strstr.str().c_str() );
2718 strstr.str(std::string());
2719 strstr << this->overlayStructureName;
2720 printf (
"Overlay file : %37s\n", strstr.str().c_str() );
2722 strstr.str(std::string());
2723 strstr << this->rotTrsJSONFile;
2724 printf (
"JSON overlay file : %37s\n", strstr.str().c_str() );
2727 strstr.str(std::string());
2728 strstr << this->verbose;
2729 printf (
"Verbosity : %37s\n", strstr.str().c_str() );
2740 #if defined ( _WIN64 ) || defined ( _WIN32 )
2747 return ( this->enLevs );
2754 #if defined ( _WIN64 ) || defined ( _WIN32 )
2761 return ( this->trSigm );
2768 #if defined ( _WIN64 ) || defined ( _WIN32 )
2775 return ( this->rotFun );
2785 return ( this->noStructures );
2795 return ( this->verbose );
2805 return (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) );
2815 return (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) );
2823 #if defined ( _WIN64 ) || defined ( _WIN32 )
2830 if (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) <= axisNo )
2833 return ( std::vector< std::string > ( ) );
2837 std::vector< std::string > ret;
2840 std::stringstream ssHlp;
2841 ssHlp << this->RecomSymAxes.at(axisNo)[0];
2845 ssHlp << this->RecomSymAxes.at(axisNo)[1];
2849 ssHlp << this->RecomSymAxes.at(axisNo)[2];
2853 ssHlp << this->RecomSymAxes.at(axisNo)[3];
2857 ssHlp << this->RecomSymAxes.at(axisNo)[4];
2861 ssHlp << this->RecomSymAxes.at(axisNo)[5];
2865 ssHlp << this->RecomSymAxes.at(axisNo)[6];
2878 #if defined ( _WIN64 ) || defined ( _WIN32 )
2885 return ( this->allCSymAxes );
2893 #if defined ( _WIN64 ) || defined ( _WIN32 )
2900 return ( this->mapCOMShift );
2908 #if defined ( _WIN64 ) || defined ( _WIN32 )
2915 if ( noStructures <= strNo )
2918 return ( std::vector< proshade_signed > ( ) );
2922 std::vector< proshade_signed > ret;
2940 #if defined ( _WIN64 ) || defined ( _WIN32 )
2947 if ( noStructures <= strNo )
2950 return ( std::vector< proshade_signed > ( ) );
2954 std::vector< proshade_signed > ret;
2974 #if defined ( _WIN64 ) || defined ( _WIN32 )
2981 return ( this->manipulatedMaps.at(strNo)[mapIndex] );
2991 #if defined ( _WIN64 ) || defined ( _WIN32 )
3005 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++)
3007 reboxMap[iter] =
static_cast<double> ( run->
getMapValue ( strNo, iter ) );
3019 #if defined ( _WIN64 ) || defined ( _WIN32 )
3026 if ( this->eulerAngles.size() != 3 )
3028 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" );
3029 return ( std::vector< proshade_double > ( ) );
3033 return ( this->eulerAngles );
3041 #if defined ( _WIN64 ) || defined ( _WIN32 )
3048 if ( this->eulerAngles.size() != 3 )
3050 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" );
3051 return ( std::vector< proshade_double > ( ) );
3055 proshade_double* rotMat =
new proshade_double[9];
3060 std::vector< proshade_double > ret;
3075 #if defined ( _WIN64 ) || defined ( _WIN32 )
3082 if ( this->coordRotationCentre.size() != 3 )
3084 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" );
3085 return ( std::vector< proshade_double > ( ) );
3089 std::vector < proshade_double > ret;
3103 #if defined ( _WIN64 ) || defined ( _WIN32 )
3110 if ( this->overlayTranslation.size() != 3 )
3112 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" );
3113 return ( std::vector< proshade_double > ( ) );
3117 return ( this->overlayTranslation );