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->reBoxMap =
false;
90 this->boundsExtraSpace = 3.0;
91 this->boundsSimilarityThreshold = 0;
92 this->useSameBounds =
false;
93 this->forceBounds =
new proshade_signed [6];
96 this->moveToCOM =
false;
99 this->addExtraSpace = 10.0;
102 this->progressiveSphereMapping =
false;
105 this->outName =
"reBoxed";
108 this->computeEnergyLevelsDesc =
true;
109 this->computeTraceSigmaDesc =
true;
110 this->computeRotationFuncDesc =
true;
111 this->enLevMatrixPowerWeight = 1.0;
114 this->peakNeighbours = 1;
115 this->noIQRsFromMedianNaivePeak = -999.9;
118 this->smoothingFactor = 15.0;
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 ( );
137 this->overlayStructureName =
"movedStructure";
138 this->rotTrsJSONFile =
"movedStructureOperations.json";
155 #if defined ( _WIN64 ) || defined ( _WIN32 )
162 this->task = taskToPerform;
165 this->forceP1 =
true;
167 this->firstModelOnly =
true;
168 this->removeNegativeDensity =
true;
171 this->requestedResolution = -1.0;
172 this->changeMapResolution =
false;
173 this->changeMapResolutionTriLinear =
false;
176 this->pdbBFactorNewVal = -1.0;
179 this->maxBandwidth = 0;
180 this->rotationUncertainty = 0;
183 this->usePhase =
true;
186 this->maxSphereDists = 0.0;
189 this->integOrder = 0;
190 this->taylorSeriesCap = 10;
193 this->normaliseMap =
false;
196 this->invertMap =
false;
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 ( );
211 this->reBoxMap =
false;
212 this->boundsExtraSpace = 3.0;
213 this->boundsSimilarityThreshold = 0;
214 this->useSameBounds =
false;
215 this->forceBounds =
new proshade_signed [6];
218 this->addExtraSpace = 10.0;
221 this->progressiveSphereMapping =
false;
224 this->outName =
"reBoxed";
227 this->computeEnergyLevelsDesc =
true;
228 this->computeTraceSigmaDesc =
true;
229 this->computeRotationFuncDesc =
true;
230 this->enLevMatrixPowerWeight = 1.0;
233 this->peakNeighbours = 1;
234 this->noIQRsFromMedianNaivePeak = -999.9;
237 this->smoothingFactor = 15.0;
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;
255 this->overlayStructureName =
"movedStructure";
256 this->rotTrsJSONFile =
"movedStructureOperations.json";
262 switch ( this->task )
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 );
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;
286 this->changeMapResolution =
false;
287 this->maskMap =
false;
288 this->moveToCOM =
true;
289 this->reBoxMap =
false;
293 this->requestedResolution = 8.0;
294 this->changeMapResolution =
true;
295 this->maskMap =
false;
296 this->moveToCOM =
false;
297 this->reBoxMap =
false;
301 this->changeMapResolution =
false;
302 this->maskMap =
true;
303 this->moveToCOM =
false;
315 #if defined ( _WIN64 ) || defined ( _WIN32 )
322 delete[] this->forceBounds;
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); } } }
337 if ( lhs.AlmostEquals( rhs ) )
359 #if defined ( _WIN64 ) || defined ( _WIN32 )
379 #if defined ( _WIN64 ) || defined ( _WIN32 )
386 this->requestedResolution = resolution;
399 #if defined ( _WIN64 ) || defined ( _WIN32 )
406 this->pdbBFactorNewVal = newBF;
419 #if defined ( _WIN64 ) || defined ( _WIN32 )
426 this->normaliseMap = normalise;
439 #if defined ( _WIN64 ) || defined ( _WIN32 )
446 this->invertMap = mInv;
459 #if defined ( _WIN64 ) || defined ( _WIN32 )
466 this->verbose = verbosity;
479 #if defined ( _WIN64 ) || defined ( _WIN32 )
486 this->blurFactor = blurFac;
500 #if defined ( _WIN64 ) || defined ( _WIN32 )
507 this->maskingThresholdIQRs = noIQRs;
520 #if defined ( _WIN64 ) || defined ( _WIN32 )
527 this->maskMap = mask;
541 #if defined ( _WIN64 ) || defined ( _WIN32 )
548 this->useCorrelationMasking = corMask;
563 #if defined ( _WIN64 ) || defined ( _WIN32 )
570 this->halfMapKernel = typNoi;
583 #if defined ( _WIN64 ) || defined ( _WIN32 )
590 this->correlationKernel = minMS;
603 #if defined ( _WIN64 ) || defined ( _WIN32 )
610 this->saveMask = savMsk;
623 #if defined ( _WIN64 ) || defined ( _WIN32 )
630 this->maskFileName = mskFln;
643 #if defined ( _WIN64 ) || defined ( _WIN32 )
650 this->appliedMaskFileName = mskFln;
663 #if defined ( _WIN64 ) || defined ( _WIN32 )
670 this->reBoxMap = reBx;
684 #if defined ( _WIN64 ) || defined ( _WIN32 )
691 this->boundsExtraSpace = boundsExSp;
704 #if defined ( _WIN64 ) || defined ( _WIN32 )
711 this->boundsSimilarityThreshold = boundsThres;
725 #if defined ( _WIN64 ) || defined ( _WIN32 )
732 this->useSameBounds = sameB;
746 #if defined ( _WIN64 ) || defined ( _WIN32 )
753 this->outName = oFileName;
766 #if defined ( _WIN64 ) || defined ( _WIN32 )
773 this->changeMapResolution = mrChange;
786 #if defined ( _WIN64 ) || defined ( _WIN32 )
793 this->changeMapResolutionTriLinear = mrChange;
806 #if defined ( _WIN64 ) || defined ( _WIN32 )
813 this->moveToCOM = com;
826 #if defined ( _WIN64 ) || defined ( _WIN32 )
833 this->addExtraSpace = exSpace;
846 #if defined ( _WIN64 ) || defined ( _WIN32 )
853 this->maxBandwidth = band;
866 #if defined ( _WIN64 ) || defined ( _WIN32 )
873 this->maxSphereDists = sphDist;
886 #if defined ( _WIN64 ) || defined ( _WIN32 )
893 this->integOrder = intOrd;
907 #if defined ( _WIN64 ) || defined ( _WIN32 )
914 this->taylorSeriesCap = tayCap;
927 #if defined ( _WIN64 ) || defined ( _WIN32 )
934 this->progressiveSphereMapping = progSphMap;
948 #if defined ( _WIN64 ) || defined ( _WIN32 )
955 this->computeEnergyLevelsDesc = enLevDesc;
969 #if defined ( _WIN64 ) || defined ( _WIN32 )
976 this->computeTraceSigmaDesc = trSigVal;
990 #if defined ( _WIN64 ) || defined ( _WIN32 )
997 this->computeRotationFuncDesc = rotfVal;
1011 #if defined ( _WIN64 ) || defined ( _WIN32 )
1018 this->peakNeighbours = pkS;
1033 #if defined ( _WIN64 ) || defined ( _WIN32 )
1040 this->noIQRsFromMedianNaivePeak = noIQRs;
1055 #if defined ( _WIN64 ) || defined ( _WIN32 )
1062 this->usePhase = phaseUsage;
1077 #if defined ( _WIN64 ) || defined ( _WIN32 )
1084 this->enLevMatrixPowerWeight = mPower;
1099 #if defined ( _WIN64 ) || defined ( _WIN32 )
1106 this->smoothingFactor = smFact;
1120 #if defined ( _WIN64 ) || defined ( _WIN32 )
1127 this->symMissPeakThres = mpThres;
1141 #if defined ( _WIN64 ) || defined ( _WIN32 )
1148 this->axisErrTolerance = axThres;
1164 #if defined ( _WIN64 ) || defined ( _WIN32 )
1171 this->axisErrToleranceDefault = behav;
1185 #if defined ( _WIN64 ) || defined ( _WIN32 )
1192 this->minSymPeak = minSP;
1207 #if defined ( _WIN64 ) || defined ( _WIN32 )
1214 this->recommendedSymmetryType = val;
1230 #if defined ( _WIN64 ) || defined ( _WIN32 )
1237 this->recommendedSymmetryFold = val;
1250 #if defined ( _WIN64 ) || defined ( _WIN32 )
1257 this->requestedSymmetryType = val;
1270 #if defined ( _WIN64 ) || defined ( _WIN32 )
1277 this->requestedSymmetryFold = val;
1291 #if defined ( _WIN64 ) || defined ( _WIN32 )
1298 proshade_double* hlpAxis =
new proshade_double [7];
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];
1325 #if defined ( _WIN64 ) || defined ( _WIN32 )
1332 this->overlayStructureName = filename;
1343 #if defined ( _WIN64 ) || defined ( _WIN32 )
1350 this->rotTrsJSONFile = filename;
1361 #if defined ( _WIN64 ) || defined ( _WIN32 )
1368 this->usePeakSearchInRotationFunctionSpace = rotFunPeaks;
1379 #if defined ( _WIN64 ) || defined ( _WIN32 )
1386 this->useBiCubicInterpolationOnPeaks = bicubPeaks;
1397 #if defined ( _WIN64 ) || defined ( _WIN32 )
1404 this->maxSymmetryFold = maxFold;
1415 #if defined ( _WIN64 ) || defined ( _WIN32 )
1422 this->fscThreshold = fscThr;
1433 #if defined ( _WIN64 ) || defined ( _WIN32 )
1440 this->peakThresholdMin = peakThr;
1451 #if defined ( _WIN64 ) || defined ( _WIN32 )
1458 this->removeNegativeDensity = nDens;
1478 std::stringstream hlpSS;
1479 hlpSS <<
"The bandwidth was determined as: " << this->
maxBandwidth;
1488 std::stringstream hlpSS;
1489 hlpSS <<
"The bandwidth was determined as: " << this->
maxBandwidth;
1508 if (
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2 ) ) % 2 == 0 )
1510 this->
maxBandwidth =
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) );
1514 this->
maxBandwidth =
static_cast<proshade_unsign
> ( std::ceil ( ( 360.0 / uncertainty ) / 2.0 ) ) + 1;
1518 std::stringstream hlpSS;
1519 hlpSS <<
"The bandwidth was determined from uncertainty " << uncertainty <<
" degrees as: " << this->
maxBandwidth;
1541 std::stringstream hlpSS;
1542 hlpSS <<
"The sphere distances were determined as " << this->
maxSphereDists <<
" Angstroms.";
1551 std::stringstream hlpSS;
1552 hlpSS <<
"The sphere distances were determined as " << this->
maxSphereDists <<
" Angstroms.";
1573 std::stringstream hlpSS;
1574 hlpSS <<
"The integration order was determined as " << this->
integOrder;
1583 std::stringstream hlpSS;
1584 hlpSS <<
"The integration order was determined as " << this->
integOrder;
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 ) ) );
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; }
1630 proshade_unsign circ = ( maxDim ) + ( midDim );
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 ) ) );
1661 #if defined ( _WIN64 ) || defined ( _WIN32 )
1671 this->noStructures =
static_cast<proshade_unsign
> ( settings->
inputFiles.size() );
1672 this->verbose =
static_cast<proshade_signed
> ( settings->
verbose );
1678 switch ( settings->
task )
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." );
1685 this->setSymmetryResults ( settings );
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;
1716 exit ( EXIT_FAILURE );
1722 std::cerr << std::endl <<
"=====================" << std::endl <<
"!! ProSHADE ERROR !!" << std::endl <<
"=====================" << std::endl << std::flush;
1725 #if __cplusplus >= 201103L
1726 std::exception_ptr exc = std::current_exception();
1731 std::rethrow_exception ( exc );
1734 catch (
const std::exception& e )
1736 std::cerr <<
"Caught unknown exception with following information: " << e.what() << std::endl << std::flush;
1739 std::cerr <<
"Unknown error with no further explanation available. Please contact the author for help." << std::endl << std::flush;
1741 std::cerr <<
"Terminating..." << std::endl << std::endl << std::flush;
1745 exit ( EXIT_FAILURE );
1759 #if defined ( _WIN64 ) || defined ( _WIN32 )
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); } }
1771 this->enLevs.clear ( );
1772 this->trSigm.clear ( );
1773 this->rotFun.clear ( );
1776 if ( this->RecomSymAxes.size() > 0 )
1778 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->RecomSymAxes.size() ); iter++ )
1780 delete[] this->RecomSymAxes.at(iter);
1782 this->RecomSymAxes.clear ( );
1793 #if defined ( _WIN64 ) || defined ( _WIN32 )
1801 return ( this->symRecommType );
1808 #if defined ( _WIN64 ) || defined ( _WIN32 )
1815 return ( this->symRecommFold );
1824 void ProSHADE_run::setRecommendedSymmetry ( std::string val )
1827 this->symRecommType = val;
1841 void ProSHADE_run::setRecommendedFold ( proshade_unsign val )
1844 this->symRecommFold = val;
1858 void ProSHADE_run::setRecommendedAxis ( proshade_double* sym )
1891 #if defined ( _WIN64 ) || defined ( _WIN32 )
1901 const struct option_port longopts[] =
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 }
1963 const char*
const shortopts =
"AaB:b:C:cd:DE:e:Ff:G:g:hi:jklmMno:Opqr:Rs:St:uvwxy:z!:@#$%^:&:*:(:):-_:=:+:[:]:{:}:;:";
1969 int opt = getopt_long_port ( argc, argv, shortopts, longopts,
nullptr );
1984 exit ( EXIT_SUCCESS );
1996 this->setVerbosity (
static_cast<proshade_signed
> ( atoi ( optarg ) ) );
2003 this->task = Distances;
2010 this->task = MapManip;
2017 this->task = Symmetry;
2020 const FloatingPoint< proshade_single > lhs1 ( this->requestedResolution ), rhs1 ( -1.0f );
2021 if ( lhs1.AlmostEquals ( rhs1 ) ) { this->requestedResolution = 6.0; }
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;
2026 this->moveToCOM = !this->moveToCOM;
2034 this->task = OverlayMap;
2041 this->addStructure ( std::string ( optarg ) );
2048 this->forceP1 = !this->forceP1;
2062 this->firstModelOnly = !this->firstModelOnly;
2069 this->setResolution (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2076 this->setBandwidth (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2083 this->setExtraSpace (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2090 this->setIntegrationOrder (
static_cast<proshade_unsign
> ( atof ( optarg ) ) );
2097 this->setSphereDistances (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2104 this->setTaylorSeriesCap (
static_cast<proshade_unsign
> ( atof ( optarg ) ) );
2111 this->setMapInversion (
true );
2118 this->setNormalisation (
true );
2125 this->setMasking (
true );
2132 this->setMasking (
true );
2133 this->setMaskSaving (
true );
2140 this->setMaskFilename (
static_cast<std::string
> ( optarg ) );
2147 this->setAppliedMaskFilename (
static_cast<std::string
> ( optarg ) );
2154 this->setMaskBlurFactor (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2161 this->setMaskIQR (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2168 this->setMasking (
true );
2169 this->setMapReboxing (
true );
2176 this->setBoundsSpace (
static_cast<proshade_single
> ( atof ( optarg ) ) );
2183 this->setBoundsThreshold (
static_cast<proshade_signed
> ( atoi ( optarg ) ) );
2190 this->setSameBoundaries (
true );
2197 this->setOutputFilename (
static_cast<std::string
> ( optarg ) );
2204 this->setPDBBFactor (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2211 this->moveToCOM = !this->moveToCOM;
2218 this->changeMapResolution = !this->changeMapResolution;
2225 this->setMapResolutionChangeTriLinear (
true );
2232 this->setPhaseUsage (
false );
2239 this->setProgressiveSphereMapping (
true );
2246 this->setEnergyLevelsComputation (
false );
2253 this->setTraceSigmaComputation (
false );
2260 this->setRotationFunctionComputation (
false );
2267 this->setEnLevShellWeight (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2274 this->setPeakNeighboursNumber (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2281 this->setPeakNaiveNoIQR (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2288 this->setMissingPeakThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2295 setAxisComparisonThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2302 this->setAxisComparisonThresholdBehaviour ( !this->axisErrToleranceDefault );
2309 this->setBicubicInterpolationSearch ( !this->useBiCubicInterpolationOnPeaks );
2316 setMaxSymmetryFold (
static_cast<proshade_unsign
> ( atoi ( optarg ) ) );
2323 this->minSymPeak =
static_cast<proshade_double
> ( atof ( optarg ) );
2330 this->setFSCThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2337 this->setPeakThreshold (
static_cast<proshade_double
> ( atof ( optarg ) ) );
2344 std::string input =
static_cast<std::string
> ( optarg );
2346 if ( input.at(0) ==
'C' )
2348 this->setRequestedSymmetry (
"C" );
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 ); }
2356 if ( input.at(0) ==
'D' )
2358 this->setRequestedSymmetry (
"D" );
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) ==
'T' )
2368 this->setRequestedSymmetry (
"T" );
2372 if ( input.at(0) ==
'O' )
2374 this->setRequestedSymmetry (
"O" );
2378 if ( input.at(0) ==
'I' )
2380 this->setRequestedSymmetry (
"I" );
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 );
2397 this->setOverlaySaveFile (
static_cast<std::string
> ( optarg ) );
2404 this->setOverlayJsonFile (
static_cast<std::string
> ( optarg ) );
2411 this->rotationUncertainty =
static_cast<proshade_double
> ( atof ( optarg ) );
2418 this->setSymmetryRotFunPeaks (
false );
2425 this->setNegativeDensity (
false );
2435 std::cout <<
"!!! ProSHADE ERROR !!! Unrecognised short option -" <<
static_cast<char> ( optopt ) <<
" . Please use -h for help on the command line options." << std::endl;
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;
2443 exit ( EXIT_SUCCESS );
2463 #if defined ( _WIN64 ) || defined ( _WIN32 )
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() );
2481 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( this->inputFiles.size() ); iter++ )
2483 strstr.str(std::string());
2484 strstr << this->inputFiles.at(iter);
2485 printf (
"File(s) to process : %37s\n", strstr.str().c_str() );
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() );
2492 strstr.str(std::string());
2493 if ( this->
removeWaters ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2494 printf (
"Waters removed : %37s\n", strstr.str().c_str() );
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() );
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() );
2505 strstr.str(std::string());
2506 strstr << this->requestedResolution;
2507 printf (
"Resolution (comp) : %37s\n", strstr.str().c_str() );
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() );
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() );
2518 strstr.str(std::string());
2519 strstr << this->pdbBFactorNewVal;
2520 printf (
"PDB B-factor const : %37s\n", strstr.str().c_str() );
2523 strstr.str(std::string());
2524 strstr << this->maxBandwidth;
2525 printf (
"Bandwidth : %37s\n", strstr.str().c_str() );
2527 strstr.str(std::string());
2528 strstr << this->rotationUncertainty;
2529 printf (
"Rotation doubt : %37s\n", strstr.str().c_str() );
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() );
2537 strstr.str(std::string());
2538 strstr << this->maxSphereDists;
2539 printf (
"Sphere distances : %37s\n", strstr.str().c_str() );
2542 strstr.str(std::string());
2543 strstr << this->integOrder;
2544 printf (
"Integration order : %37s\n", strstr.str().c_str() );
2546 strstr.str(std::string());
2547 strstr << this->taylorSeriesCap;
2548 printf (
"Taylor series cap : %37s\n", strstr.str().c_str() );
2551 strstr.str(std::string());
2552 if ( this->normaliseMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2553 printf (
"Map normalisation : %37s\n", strstr.str().c_str() );
2556 strstr.str(std::string());
2557 if ( this->invertMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2558 printf (
"Map inversion : %37s\n", strstr.str().c_str() );
2561 strstr.str(std::string());
2562 strstr << this->blurFactor;
2563 printf (
"Map blurring : %37s\n", strstr.str().c_str() );
2565 strstr.str(std::string());
2566 strstr << this->maskingThresholdIQRs;
2567 printf (
"Masking threshold : %37s\n", strstr.str().c_str() );
2569 strstr.str(std::string());
2570 if ( this->maskMap ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2571 printf (
"Map masking : %37s\n", strstr.str().c_str() );
2573 strstr.str(std::string());
2574 if ( this->useCorrelationMasking ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2575 printf (
"Correlation mask : %37s\n", strstr.str().c_str() );
2577 strstr.str(std::string());
2578 strstr << this->halfMapKernel;
2579 printf (
"Half-map kernel : %37s\n", strstr.str().c_str() );
2581 strstr.str(std::string());
2582 strstr << this->correlationKernel;
2583 printf (
"Correlation kernel : %37s\n", strstr.str().c_str() );
2585 strstr.str(std::string());
2586 if ( this->saveMask ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2587 printf (
"Saving mask : %37s\n", strstr.str().c_str() );
2589 strstr.str(std::string());
2590 strstr << this->maskFileName;
2591 printf (
"Map mask filename : %37s\n", strstr.str().c_str() );
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() );
2598 strstr.str(std::string());
2599 strstr << this->boundsExtraSpace;
2600 printf (
"Bounds extra space : %37s\n", strstr.str().c_str() );
2602 strstr.str(std::string());
2603 strstr << this->boundsSimilarityThreshold;
2604 printf (
"Bounds similarity : %37s\n", strstr.str().c_str() );
2606 strstr.str(std::string());
2607 if ( this->useSameBounds ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2608 printf (
"Same boundaries : %37s\n", strstr.str().c_str() );
2610 strstr.str(std::string());
2611 if ( this->forceBounds !=
nullptr )
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() );
2618 strstr <<
"Not allocated";
2619 printf (
"Bounds similarity : %37s\n", strstr.str().c_str() );
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() );
2628 strstr.str(std::string());
2629 strstr << this->addExtraSpace;
2630 printf (
"Extra space : %37s\n", strstr.str().c_str() );
2633 strstr.str(std::string());
2634 if ( this->progressiveSphereMapping ) { strstr <<
"TRUE"; }
else { strstr <<
"FALSE"; }
2635 printf (
"Progressive spheres : %37s\n", strstr.str().c_str() );
2638 strstr.str(std::string());
2639 strstr << this->outName;
2640 printf (
"Re-boxed filename : %37s\n", strstr.str().c_str() );
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() );
2647 strstr.str(std::string());
2648 strstr << this->enLevMatrixPowerWeight;
2649 printf (
"Energy lvl weight : %37s\n", strstr.str().c_str() );
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() );
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() );
2660 strstr.str(std::string());
2661 strstr << this->peakNeighbours;
2662 printf (
"Neightbours to peak : %37s\n", strstr.str().c_str() );
2664 strstr.str(std::string());
2665 strstr << this->noIQRsFromMedianNaivePeak;
2666 printf (
"Peak IQR threshold : %37s\n", strstr.str().c_str() );
2669 strstr.str(std::string());
2670 strstr << this->smoothingFactor;
2671 printf (
"Smoothing factor : %37s\n", strstr.str().c_str() );
2674 strstr.str(std::string());
2675 strstr << this->symMissPeakThres;
2676 printf (
"Missing ax. thres : %37s\n", strstr.str().c_str() );
2678 strstr.str(std::string());
2679 strstr << this->axisErrTolerance;
2680 printf (
"Same ax. threshold : %37s\n", strstr.str().c_str() );
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() );
2686 strstr.str(std::string());
2687 strstr << this->minSymPeak;
2688 printf (
"Min. sym. peak size : %37s\n", strstr.str().c_str() );
2690 strstr.str(std::string());
2691 strstr << this->recommendedSymmetryType <<
"-" << this->recommendedSymmetryFold;
2692 printf (
"Recommended symm. : %37s\n", strstr.str().c_str() );
2694 strstr.str(std::string());
2695 strstr << this->requestedSymmetryType <<
"-" << this->requestedSymmetryFold;
2696 printf (
"Requested symm. : %37s\n", strstr.str().c_str() );
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() );
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() );
2706 strstr.str(std::string());
2707 strstr << this->maxSymmetryFold;
2708 printf (
"Max symmetry fold : %37s\n", strstr.str().c_str() );
2710 strstr.str(std::string());
2711 strstr << this->fscThreshold;
2712 printf (
"FSC Threshold : %37s\n", strstr.str().c_str() );
2714 strstr.str(std::string());
2715 strstr << this->peakThresholdMin;
2716 printf (
"Peak Threshold : %37s\n", strstr.str().c_str() );
2719 strstr.str(std::string());
2720 strstr << this->overlayStructureName;
2721 printf (
"Overlay file : %37s\n", strstr.str().c_str() );
2723 strstr.str(std::string());
2724 strstr << this->rotTrsJSONFile;
2725 printf (
"JSON overlay file : %37s\n", strstr.str().c_str() );
2728 strstr.str(std::string());
2729 strstr << this->verbose;
2730 printf (
"Verbosity : %37s\n", strstr.str().c_str() );
2741 #if defined ( _WIN64 ) || defined ( _WIN32 )
2748 return ( this->enLevs );
2755 #if defined ( _WIN64 ) || defined ( _WIN32 )
2762 return ( this->trSigm );
2769 #if defined ( _WIN64 ) || defined ( _WIN32 )
2776 return ( this->rotFun );
2786 return ( this->noStructures );
2796 return ( this->verbose );
2806 return (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) );
2816 return (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) );
2824 #if defined ( _WIN64 ) || defined ( _WIN32 )
2831 if (
static_cast<proshade_unsign
> ( this->RecomSymAxes.size() ) <= axisNo )
2834 return ( std::vector< std::string > ( ) );
2838 std::vector< std::string > ret;
2841 std::stringstream ssHlp;
2842 ssHlp << this->RecomSymAxes.at(axisNo)[0];
2846 ssHlp << this->RecomSymAxes.at(axisNo)[1];
2850 ssHlp << this->RecomSymAxes.at(axisNo)[2];
2854 ssHlp << this->RecomSymAxes.at(axisNo)[3];
2858 ssHlp << this->RecomSymAxes.at(axisNo)[4];
2862 ssHlp << this->RecomSymAxes.at(axisNo)[5];
2866 ssHlp << this->RecomSymAxes.at(axisNo)[6];
2879 #if defined ( _WIN64 ) || defined ( _WIN32 )
2886 return ( this->allCSymAxes );
2894 #if defined ( _WIN64 ) || defined ( _WIN32 )
2901 return ( this->mapCOMShift );
2909 #if defined ( _WIN64 ) || defined ( _WIN32 )
2916 if ( noStructures <= strNo )
2919 return ( std::vector< proshade_signed > ( ) );
2923 std::vector< proshade_signed > ret;
2941 #if defined ( _WIN64 ) || defined ( _WIN32 )
2948 if ( noStructures <= strNo )
2951 return ( std::vector< proshade_signed > ( ) );
2955 std::vector< proshade_signed > ret;
2975 #if defined ( _WIN64 ) || defined ( _WIN32 )
2982 return ( this->manipulatedMaps.at(strNo)[mapIndex] );
2992 #if defined ( _WIN64 ) || defined ( _WIN32 )
3006 for ( proshade_unsign iter = 0; iter < static_cast<proshade_unsign> ( len ); iter++)
3008 reboxMap[iter] =
static_cast<double> ( run->
getMapValue ( strNo, iter ) );
3020 #if defined ( _WIN64 ) || defined ( _WIN32 )
3027 if ( this->eulerAngles.size() != 3 )
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 > ( ) );
3034 return ( this->eulerAngles );
3042 #if defined ( _WIN64 ) || defined ( _WIN32 )
3049 if ( this->eulerAngles.size() != 3 )
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 > ( ) );
3056 proshade_double* rotMat =
new proshade_double[9];
3061 std::vector< proshade_double > ret;
3076 #if defined ( _WIN64 ) || defined ( _WIN32 )
3083 if ( this->coordRotationCentre.size() != 3 )
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 > ( ) );
3090 std::vector < proshade_double > ret;
3104 #if defined ( _WIN64 ) || defined ( _WIN32 )
3111 if ( this->overlayTranslation.size() != 3 )
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 > ( ) );
3118 return ( this->overlayTranslation );