21 #include <clipper/clipper.h> 22 #include <clipper/clipper-contrib.h> 23 #include <clipper/clipper-ccp4.h> 24 #include <clipper/clipper-mmdb.h> 25 #include <clipper/clipper-minimol.h> 32 #include <wrap_fftw.h> 33 #include <makeweights.h> 34 #include <s2_primitive.h> 35 #include <s2_cospmls.h> 36 #include <s2_legendreTransforms.h> 37 #include <s2_semi_fly.h> 38 #include <rotate_so3_utils.h> 39 #include <utils_so3.h> 40 #include <soft_fftw.h> 41 #include <rotate_so3_fftw.h> 57 #include <rvapi_interface.h> 73 clipper::mmdb::CMMDBManager *mfile =
new clipper::mmdb::CMMDBManager ( );
74 if ( mfile->ReadCoorFile ( fileName.c_str() ) )
77 clipper::CCP4MAPfile mapFile;
81 mapFile.open_read( fileName );
83 catch (
const clipper::Message_base &exc)
114 this->_densityMapMap =
nullptr;
115 this->_densityMapCor =
nullptr;
116 this->_densityMapCorCoords =
nullptr;
117 this->_realSHCoeffs =
nullptr;
118 this->_imagSHCoeffs =
nullptr;
119 this->_sphericalHarmonicsWeights =
nullptr;
120 this->_semiNaiveTable =
nullptr;
121 this->_semiNaiveTableSpace =
nullptr;
122 this->_shWorkspace =
nullptr;
123 this->_rrpMatrices =
nullptr;
124 this->_invRealData =
nullptr;
125 this->_invImagData =
nullptr;
126 this->_shellMappedData =
nullptr;
129 this->_densityMapComputed =
false;
130 this->_phaseRemoved =
false;
131 this->_firstLineCOM =
false;
132 this->_sphereMapped =
false;
133 this->_sphericalCoefficientsComputed =
false;
134 this->_rrpMatricesPrecomputed =
false;
135 this->_wasBandwithGiven =
true;
136 this->_wasThetaGiven =
true;
137 this->_wasPhiGiven =
true;
138 this->_wasGlInterGiven =
true;
141 this->_xCorrection = 0;
142 this->_yCorrection = 0;
143 this->_zCorrection = 0;
146 this->_xFrom = std::numeric_limits<float>::infinity();
147 this->_yFrom = std::numeric_limits<float>::infinity();
148 this->_zFrom = std::numeric_limits<float>::infinity();
149 this->_xTo = std::numeric_limits<float>::infinity();
150 this->_yTo = std::numeric_limits<float>::infinity();
151 this->_zTo = std::numeric_limits<float>::infinity();
152 this->_xRange = std::numeric_limits<float>::infinity();
153 this->_yRange = std::numeric_limits<float>::infinity();
154 this->_zRange = std::numeric_limits<float>::infinity();
157 this->_mapMean = 0.0;
158 this->_mapSdev = 1.0;
159 this->_noShellsWithData = 0;
177 this->_inputFileName = copyFrom->_inputFileName;
178 this->_fromPDB = copyFrom->_fromPDB;
181 this->_shellSpacing = copyFrom->_shellSpacing;
182 this->_maxExtraCellularSpace = copyFrom->_maxExtraCellularSpace;
183 this->_xRange = copyFrom->_xRange;
184 this->_yRange = copyFrom->_yRange;
185 this->_zRange = copyFrom->_zRange;
186 this->_xSamplingRate = copyFrom->_xSamplingRate;
187 this->_ySamplingRate = copyFrom->_ySamplingRate;
188 this->_zSamplingRate = copyFrom->_zSamplingRate;
189 this->_xFrom = copyFrom->_xFrom;
190 this->_yFrom = copyFrom->_yFrom;
191 this->_zFrom = copyFrom->_zFrom;
192 this->_xTo = copyFrom->_xTo;
193 this->_yTo = copyFrom->_yTo;
194 this->_zTo = copyFrom->_zTo;
195 this->_shellPlacement = std::vector<double> ( copyFrom->_shellPlacement.size() );
197 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( copyFrom->_shellPlacement.size() ); iter++ )
199 this->_shellPlacement.at(iter) = copyFrom->_shellPlacement.at(iter);
203 this->_mapResolution = copyFrom->_mapResolution;
204 this->_maxMapU = copyFrom->_maxMapU;
205 this->_maxMapV = copyFrom->_maxMapV;
206 this->_maxMapW = copyFrom->_maxMapW;
207 this->_densityMapComputed = copyFrom->_densityMapComputed;
208 this->_mapMean = copyFrom->_mapMean;
209 this->_mapSdev = copyFrom->_mapSdev;
211 if ( copyFrom->_densityMapMap !=
nullptr )
213 this->_densityMapMap =
new float[(copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1)];
214 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1) ); iter++)
216 this->_densityMapMap[iter] = copyFrom->_densityMapMap[iter];
221 this->_densityMapMap =
nullptr;
225 this->_fourierCoeffPower = copyFrom->_fourierCoeffPower;
226 this->_bFactorChange = copyFrom->_bFactorChange;
227 this->_maxMapRange = copyFrom->_maxMapRange;
228 this->_phaseRemoved = copyFrom->_phaseRemoved;
229 this->_keepOrRemove = copyFrom->_keepOrRemove;
231 if ( copyFrom->_densityMapCor !=
nullptr )
233 this->_densityMapCor =
new double[(copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1)];
234 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1) ); iter++)
236 this->_densityMapCor[iter] = copyFrom->_densityMapCor[iter];
241 this->_densityMapCor =
nullptr;
244 if ( copyFrom->_densityMapCorCoords !=
nullptr )
246 this->_densityMapCorCoords =
new std::array<double,3>[(copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1)];
247 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (copyFrom->_maxMapU+1) * (copyFrom->_maxMapV+1) * (copyFrom->_maxMapW+1) ); iter++)
249 this->_densityMapCorCoords[iter][0] = copyFrom->_densityMapCorCoords[iter][0];
250 this->_densityMapCorCoords[iter][1] = copyFrom->_densityMapCorCoords[iter][1];
251 this->_densityMapCorCoords[iter][2] = copyFrom->_densityMapCorCoords[iter][2];
256 this->_densityMapCorCoords =
nullptr;
260 this->_thetaAngle = copyFrom->_thetaAngle;
261 this->_phiAngle = copyFrom->_phiAngle;
262 this->_noShellsWithData = copyFrom->_noShellsWithData;
263 this->_xCorrection = copyFrom->_xCorrection;
264 this->_yCorrection = copyFrom->_yCorrection;
265 this->_zCorrection = copyFrom->_zCorrection;
266 this->_xCorrErr = copyFrom->_xCorrErr;
267 this->_yCorrErr = copyFrom->_yCorrErr;
268 this->_zCorrErr = copyFrom->_zCorrErr;
269 this->_sphereMapped = copyFrom->_sphereMapped;
270 this->_firstLineCOM = copyFrom->_firstLineCOM;
272 if ( copyFrom->_shellMappedData !=
nullptr )
274 this->_shellMappedData =
new double*[this->_noShellsWithData];
275 for (
unsigned int sh = 0; sh < this->_noShellsWithData; sh++ )
277 this->_shellMappedData[sh] =
new double[
static_cast<unsigned int> ( this->_thetaAngle * this->_phiAngle )];
278 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->_thetaAngle * this->_phiAngle ); iter++ )
280 this->_shellMappedData[sh][iter] = copyFrom->_shellMappedData[sh][iter];
286 this->_shellMappedData =
nullptr;
290 this->_bandwidthLimit = copyFrom->_bandwidthLimit;
291 this->_oneDimmension = copyFrom->_oneDimmension;
292 this->_sphericalCoefficientsComputed = copyFrom->_sphericalCoefficientsComputed;
293 this->_wasBandwithGiven = copyFrom->_wasBandwithGiven;
294 this->_wasThetaGiven = copyFrom->_wasThetaGiven;
295 this->_wasPhiGiven = copyFrom->_wasPhiGiven;
296 this->_wasGlInterGiven = copyFrom->_wasGlInterGiven;
298 if ( copyFrom->_realSHCoeffs !=
nullptr )
300 this->_realSHCoeffs =
new double*[
static_cast<unsigned int> ( this->_noShellsWithData )];
301 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
303 this->_realSHCoeffs[shIt] =
new double [
static_cast<unsigned int> ( this->_oneDimmension * this->_oneDimmension )];
304 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->_oneDimmension * this->_oneDimmension ); iter++ )
306 this->_realSHCoeffs[shIt][iter] = copyFrom->_realSHCoeffs[shIt][iter];
312 this->_realSHCoeffs =
nullptr;
315 if ( copyFrom->_imagSHCoeffs !=
nullptr )
317 this->_imagSHCoeffs =
new double*[
static_cast<unsigned int> ( this->_noShellsWithData )];
318 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
320 this->_imagSHCoeffs[shIt] =
new double [
static_cast<unsigned int> ( this->_oneDimmension * this->_oneDimmension )];
321 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->_oneDimmension * this->_oneDimmension ); iter++ )
323 this->_imagSHCoeffs[shIt][iter] = copyFrom->_imagSHCoeffs[shIt][iter];
329 this->_imagSHCoeffs =
nullptr;
332 if ( copyFrom->_sphericalHarmonicsWeights !=
nullptr )
334 this->_sphericalHarmonicsWeights =
new double [
static_cast<unsigned int> ( this->_bandwidthLimit * 4 )];
335 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->_bandwidthLimit * 4 ); iter++ )
337 this->_sphericalHarmonicsWeights[iter] = copyFrom->_sphericalHarmonicsWeights[iter];
342 this->_sphericalHarmonicsWeights =
nullptr;
345 if ( copyFrom->_shWorkspace !=
nullptr )
347 this->_shWorkspace = (fftw_complex *) fftw_malloc (
sizeof(fftw_complex) * ( ( 8 * this->_bandwidthLimit * this->_bandwidthLimit ) +
348 ( 10 * this->_bandwidthLimit ) ) );
349 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( ( 8 * this->_bandwidthLimit * this->_bandwidthLimit ) + ( 10 * this->_bandwidthLimit ) ); iter++ )
351 this->_shWorkspace[iter][0] = copyFrom->_shWorkspace[iter][0];
352 this->_shWorkspace[iter][1] = copyFrom->_shWorkspace[iter][1];
357 this->_shWorkspace =
nullptr;
360 if ( copyFrom->_semiNaiveTableSpace !=
nullptr )
362 this->_semiNaiveTableSpace =
new double [
static_cast<unsigned int> ( Reduced_Naive_TableSize ( this->_bandwidthLimit, this->_bandwidthLimit ) +
363 Reduced_SpharmonicTableSize ( this->_bandwidthLimit, this->_bandwidthLimit ) )];
364 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( Reduced_Naive_TableSize ( this->_bandwidthLimit, this->_bandwidthLimit ) + Reduced_SpharmonicTableSize ( this->_bandwidthLimit, this->_bandwidthLimit ) ); iter++ )
366 this->_semiNaiveTableSpace[iter] = copyFrom->_semiNaiveTableSpace[iter];
371 this->_semiNaiveTableSpace =
nullptr;
374 if ( copyFrom->_semiNaiveTable !=
nullptr )
376 this->_semiNaiveTable =
nullptr;
377 this->_semiNaiveTable = SemiNaive_Naive_Pml_Table ( this->_bandwidthLimit,
378 this->_bandwidthLimit,
379 this->_semiNaiveTableSpace,
380 reinterpret_cast<double*> ( this->_shWorkspace ) );
384 this->_semiNaiveTable =
nullptr;
388 if ( copyFrom->_invRealData !=
nullptr )
390 std::cerr <<
"!!! ProSHADE ERROR !!! Error copying the ProSHADE_data object. This should not happen, please report this case." << std::endl;
395 this->_invRealData =
nullptr;
398 if ( copyFrom->_invImagData !=
nullptr )
400 std::cerr <<
"!!! ProSHADE ERROR !!! Error copying the ProSHADE_data object. This should not happen, please report this case." << std::endl;
405 this->_invImagData =
nullptr;
409 if ( copyFrom->_rrpMatrices !=
nullptr )
411 this->_rrpMatrices =
new double** [this->_bandwidthLimit];
412 for (
unsigned int bwIt = 0; bwIt < this->_bandwidthLimit; bwIt++ )
415 if ( !this->_keepOrRemove ) {
if ( ( bwIt % 2 ) != 0 ) {
continue; } }
417 this->_rrpMatrices[bwIt] =
new double* [this->_noShellsWithData];
418 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
420 this->_rrpMatrices[bwIt][shIt]=
new double [this->_noShellsWithData];
421 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->_noShellsWithData ); iter++ )
423 this->_rrpMatrices[bwIt][shIt][iter] = copyFrom->_rrpMatrices[bwIt][shIt][iter];
430 this->_rrpMatrices =
nullptr;
433 this->_rrpMatricesPrecomputed = copyFrom->_rrpMatricesPrecomputed;
449 if ( this->_densityMapMap !=
nullptr ) {
delete[] this->_densityMapMap ; }
450 if ( this->_densityMapCor !=
nullptr ) {
delete[] this->_densityMapCor ; }
451 if ( this->_densityMapCorCoords !=
nullptr ) {
delete[] this->_densityMapCorCoords ; }
452 if ( this->_shellMappedData !=
nullptr ) {
delete[] this->_shellMappedData ; }
453 if ( this->_sphericalHarmonicsWeights !=
nullptr ) {
delete[] this->_sphericalHarmonicsWeights; }
454 if ( this->_semiNaiveTableSpace !=
nullptr ) {
delete[] this->_semiNaiveTableSpace ; }
457 if ( this->_shWorkspace !=
nullptr ) { fftw_free ( this->_shWorkspace ) ; }
459 if ( this->_rrpMatrices !=
nullptr ) {
for (
unsigned int i = 0; i < this->_bandwidthLimit; i++ ) {
if ( i % 2 == 1 ) {
continue; }
delete[] this->_rrpMatrices[i]; } }
461 if ( this->_realSHCoeffs !=
nullptr && this->_imagSHCoeffs !=
nullptr )
463 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
465 delete[] this->_realSHCoeffs[shIt];
466 delete[] this->_imagSHCoeffs[shIt];
468 delete[] this->_realSHCoeffs;
469 delete[] this->_imagSHCoeffs;
472 if ( this->_invRealData !=
nullptr && this->_invImagData !=
nullptr )
474 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
476 delete[] this->_invRealData[shIt];
477 delete[] this->_invImagData[shIt];
479 delete[] this->_invRealData;
480 delete[] this->_invImagData;
505 std::vector<int> ignoreL,
510 this->_bothRRPsPreComputed =
false;
513 if ( cmpObj1->_bandwidthLimit != cmpObj2->_bandwidthLimit )
515 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << cmpObj1->_inputFileName <<
" AND " << cmpObj2->_inputFileName <<
" !!! The bandwidths are different, use the same bandwidth to make the strucutres comparable." << std::endl;
519 if ( ( cmpObj1->_thetaAngle != cmpObj2->_thetaAngle ) || ( cmpObj1->_phiAngle != cmpObj2->_phiAngle ) )
521 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << cmpObj1->_inputFileName <<
" AND " << cmpObj2->_inputFileName <<
" !!! The theta or phi angles are different, use the same theta and phi angles to make the strucutres comparable." << std::endl;
525 if ( ( cmpObj1->_rrpMatricesPrecomputed ) && ( cmpObj2->_rrpMatricesPrecomputed ) )
527 this->_bothRRPsPreComputed =
true;
530 if ( cmpObj1->_shellSpacing != cmpObj2->_shellSpacing )
532 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << cmpObj1->_inputFileName <<
" AND " << cmpObj2->_inputFileName <<
" !!! The shell spacing distances are different, use the same shell spacing distance to make the strucutres comparable." << std::endl;
536 if ( cmpObj1->_keepOrRemove != cmpObj2->_keepOrRemove )
538 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << cmpObj1->_inputFileName <<
" AND " << cmpObj2->_inputFileName <<
" !!! The phase treatment is different (i.e. one structure has phases removed, the other does not), use the same phase treatment to make the strucutres comparable." << std::endl;
544 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << cmpObj1->_inputFileName <<
" AND " << cmpObj2->_inputFileName <<
" !!! The Gauss-Legendre integration order is too low, select a higher value than 1!" << std::endl;
549 this->_bandwidthLimit = cmpObj1->_bandwidthLimit;
550 this->_thetaAngle = cmpObj1->_thetaAngle;
551 this->_phiAngle = cmpObj1->_phiAngle;
552 this->_matrixPowerWeight = mPower;
553 this->_lsToIgnore = ignoreL;
554 this->_minShellsToUse = std::min ( cmpObj1->_noShellsWithData, cmpObj2->_noShellsWithData );
555 this->_obj1RRPs = cmpObj1->_rrpMatrices;
556 this->_obj2RRPs = cmpObj2->_rrpMatrices;
557 this->_shellSpacing = cmpObj1->_shellSpacing;
558 this->_obj1RealCoeffs = cmpObj1->_realSHCoeffs;
559 this->_obj1ImagCoeffs = cmpObj1->_imagSHCoeffs;
560 this->_obj2RealCoeffs = cmpObj2->_realSHCoeffs;
561 this->_obj2ImagCoeffs = cmpObj2->_imagSHCoeffs;
562 this->_noShellsObj1 = cmpObj1->_noShellsWithData;
563 this->_noShellsObj2 = cmpObj2->_noShellsWithData;
564 this->_maxShellsToUse = std::max ( cmpObj1->_noShellsWithData, cmpObj2->_noShellsWithData );
565 this->_keepOrRemove = cmpObj1->_keepOrRemove;
566 this->_glIntegrationOrder = order;
568 this->_trSigmaEMatrix =
nullptr;
569 this->_so3Coeffs =
nullptr;
570 this->_so3InvCoeffs =
nullptr;
571 this->_so3Workspace1 =
nullptr;
572 this->_so3Workspace2 =
nullptr;
573 this->_so3Workspace3 =
nullptr;
575 this->_distanceRotInv = 0.0;
576 this->_distanceTrSigma = 0.0;
577 this->_peakHeightThr = 0.0;
579 this->_rotInvComputed =
false;
580 this->_trSigmaPreComputed =
false;
581 this->_trSigmaComputed =
false;
582 this->_so3InvMapComputed =
false;
583 this->_eulerAnglesFound =
false;
584 this->_wignerMatricesComputed =
false;
585 this->_CSymmsFound =
false;
586 this->_DSymmsFound =
false;
589 this->_glAbscissas = std::vector<double> ( this->_glIntegrationOrder );
590 this->_glWeights = std::vector<double> ( this->_glIntegrationOrder );
591 ProSHADE_internal_legendre::getLegendreAbscAndWeights ( this->_glIntegrationOrder, &(this->_glAbscissas), &(this->_glWeights), settings );
607 if ( this->_trSigmaEMatrix !=
nullptr ) {
delete[] this->_trSigmaEMatrix ; }
608 if ( this->_so3Workspace3 !=
nullptr ) {
delete[] this->_so3Workspace3 ; }
609 if ( this->_so3Coeffs !=
nullptr ) { fftw_free ( this->_so3Coeffs ); }
610 if ( this->_so3InvCoeffs !=
nullptr ) { fftw_free ( this->_so3InvCoeffs ); }
611 if ( this->_so3Workspace1 !=
nullptr ) { fftw_free ( this->_so3Workspace1 ); }
612 if ( this->_so3Workspace2 !=
nullptr ) { fftw_free ( this->_so3Workspace2 ); }
613 if ( this->_so3InvCoeffs !=
nullptr ) { fftw_free ( this->_so3InvCoeffs ); }
631 double ProSHADE_internal::ProSHADE_comparePairwise::gl20IntRR ( std::vector<double>* vals )
637 std::vector< std::array<double,2> > intData ( static_cast<unsigned int> ( this->_glAbscissas.size() ) );
638 std::array<double,2> posVals;
639 unsigned int lesserPos = 0;
640 unsigned int upperPos = 0;
641 double lesserWeight = 0.0;
642 double upperWeight = 0.0;
643 for (
unsigned int absIter = 0; absIter < static_cast<unsigned int> ( this->_glAbscissas.size() ); absIter++ )
650 posVals[0] = ( ( this->_glAbscissas.at(absIter) + 1.0 ) / 2.0 ) * ( this->_shellSpacing *
static_cast<double> ( vals->size() ) );
653 for (
unsigned int valIt = 0; valIt < static_cast<unsigned int> ( vals->size() ); valIt++ )
655 if ( ( (valIt*this->_shellSpacing) <= posVals[0] ) && ( ( (valIt+1)*this->_shellSpacing) > posVals[0] ) )
657 lesserPos =
static_cast<unsigned int> ( valIt );
658 upperPos =
static_cast<unsigned int> ( valIt + 1 );
666 if ( lesserPos != 0 )
669 lesserWeight = upperPos - ( posVals[0] / this->_shellSpacing );
670 upperWeight = 1.0 - lesserWeight;
672 posVals[1] = ( lesserWeight * vals->at(lesserPos-1) ) + ( upperWeight * vals->at(upperPos-1) );
677 upperWeight = 1.0 - ( upperPos - ( posVals[0] / this->_shellSpacing ) );
679 posVals[1] = ( upperWeight * vals->at(upperPos-1) );
682 intData.at(absIter) = posVals;
688 for (
unsigned int absPoint = 0; absPoint < static_cast<unsigned int> ( intData.size() ); absPoint++ )
690 ret += ( this->_glWeights.at(absPoint) * intData.at(absPoint)[1] );
694 ret *= ( (
static_cast<double> ( vals->size() ) * this->_shellSpacing ) / 2.0 );
713 std::array<double,2> ProSHADE_internal::ProSHADE_comparePairwise::gl20IntCR ( std::vector< std::array<double,2> >* vals )
716 std::array<double,2> ret;
719 std::vector< std::array<double,3> > intData;
720 std::array<double,3> posVals;
721 unsigned int lesserPos = 0;
722 unsigned int upperPos = 0;
723 double lesserWeight = 0.0;
724 double upperWeight = 0.0;
725 for (
unsigned int absIter = 0; absIter < static_cast<unsigned int> ( this->_glAbscissas.size() ); absIter++ )
728 posVals[0] = 0.0; posVals[1] = 0.0; posVals[2] = 0.0;
731 posVals[0] = ( ( this->_glAbscissas.at(absIter) + 1.0 ) / 2.0 ) * ( this->_shellSpacing *
static_cast<double> ( vals->size() ) );
734 for (
unsigned int valIt = 0; valIt < static_cast<unsigned int> ( vals->size() ); valIt++ )
736 if ( ( (valIt*this->_shellSpacing) <= posVals[0] ) && ( ( (valIt+1)*this->_shellSpacing) > posVals[0] ) )
738 lesserPos =
static_cast<unsigned int> ( valIt );
739 upperPos =
static_cast<unsigned int> ( valIt + 1 );
747 if ( lesserPos != 0 )
750 lesserWeight = upperPos - ( posVals[0] / this->_shellSpacing );
751 upperWeight = 1.0 - lesserWeight;
753 posVals[1] = ( lesserWeight * vals->at(lesserPos-1)[0] ) + ( upperWeight * vals->at(upperPos-1)[0] );
754 posVals[2] = ( lesserWeight * vals->at(lesserPos-1)[1] ) + ( upperWeight * vals->at(upperPos-1)[1] );
759 upperWeight = 1.0 - ( upperPos - ( posVals[0] / this->_shellSpacing ) );
761 posVals[1] = ( upperWeight * vals->at(upperPos-1)[0] );
762 posVals[2] = ( upperWeight * vals->at(upperPos-1)[1] );
765 intData.emplace_back ( posVals );
772 for (
unsigned int absPoint = 0; absPoint < static_cast<unsigned int> ( intData.size() ); absPoint++ )
774 ret[0] += ( this->_glWeights.at(absPoint) * intData.at(absPoint)[1] );
775 ret[1] += ( this->_glWeights.at(absPoint) * intData.at(absPoint)[2] );
779 ret[0] *= ( (
static_cast<double> ( vals->size() ) * this->_shellSpacing ) / 2.0 );
780 ret[1] *= ( (
static_cast<double> ( vals->size() ) * this->_shellSpacing ) / 2.0 );
802 std::vector<ProSHADE_data*> *allStrs,
803 std::vector<int> ignoreL,
804 double matrixPowerWeight,
811 std::array<double,3> emptyAngs;
812 double checkValue = 0.0;
813 emptyAngs[0] = -999.0;
814 emptyAngs[1] = -999.0;
815 emptyAngs[2] = -999.0;
818 if ( all->size() < 1 )
820 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison !!! The compare against part has not enough entries." << std::endl;
824 checkValue =
static_cast<double> ( this->one->_keepOrRemove );
825 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( this->all->size() ); strIt++ )
827 if ( checkValue != static_cast<double> ( this->all->at(strIt)->_keepOrRemove ) )
829 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << this->one->_inputFileName <<
" AND " << this->all->at(strIt)->_inputFileName <<
" !!! The phase treatment is different, use the same phase treatment (i.e. remove all, or keep all) to make the strucutres comparable." << std::endl;
835 this->_lsToIgnore = ignoreL;
836 this->_matrixPowerWeight = matrixPowerWeight;
838 this->_energyLevelsComputed =
false;
839 this->_trSigmaPreComputed =
false;
840 this->_trSigmaComputed =
false;
841 this->_so3InvMapComputed =
false;
842 this->_eulerAnglesFound =
false;
843 this->_wignerMatricesComputed =
false;
844 this->_fullDistComputed =
false;
867 std::vector<ProSHADE_data*> *allStrs,
868 std::vector<int> ignoreL,
869 double matrixPowerWeight,
876 std::array<double,3> emptyAngs;
877 double checkValue = 0.0;
878 emptyAngs[0] = -999.0;
879 emptyAngs[1] = -999.0;
880 emptyAngs[2] = -999.0;
883 if ( all->size() < 1 )
885 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison !!! The compare against part has not enough entries." << std::endl;
889 checkValue =
static_cast<double> ( this->one->_keepOrRemove );
890 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( this->all->size() ); strIt += 2 )
892 if ( checkValue != static_cast<double> ( this->all->at(strIt)->_keepOrRemove ) )
894 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << this->one->_inputFileName <<
" AND " << this->all->at(strIt)->_inputFileName <<
" !!! The phase treatment is different, use the same phase treatment (i.e. remove all, or keep all) to make the strucutres comparable." << std::endl;
899 checkValue =
static_cast<double> ( this->two->_keepOrRemove );
900 for (
unsigned int strIt = 1; strIt < static_cast<unsigned int> ( this->all->size() ); strIt += 2 )
902 if ( checkValue != static_cast<double> ( this->all->at(strIt)->_keepOrRemove ) )
904 std::cerr <<
"!!! ProSHADE ERROR !!! Error in file comparison between " << this->one->_inputFileName <<
" AND " << this->all->at(strIt)->_inputFileName <<
" !!! The phase treatment is different, use the same phase treatment (i.e. remove all, or keep all) to make the strucutres comparable." << std::endl;
910 this->_lsToIgnore = ignoreL;
911 this->_matrixPowerWeight = matrixPowerWeight;
913 this->_energyLevelsComputed =
false;
914 this->_trSigmaPreComputed =
false;
915 this->_trSigmaComputed =
false;
916 this->_so3InvMapComputed =
false;
917 this->_eulerAnglesFound =
false;
918 this->_wignerMatricesComputed =
false;
919 this->_fullDistComputed =
false;
935 if ( this->one !=
nullptr ) {
delete this->one; }
936 if ( this->two !=
nullptr ) {
delete this->two; }
938 this->all->clear ( );
956 double ProSHADE_internal::ProSHADE_compareOneAgainstAll::glIntRR ( std::vector<double>* vals,
958 std::vector<double>* glAbscissas,
959 std::vector<double>* glWeights )
965 std::vector< std::array<double,2> > intData;
966 std::array<double,2> posVals;
967 unsigned int lesserPos = 0;
968 unsigned int upperPos = 0;
969 double lesserWeight = 0.0;
970 double upperWeight = 0.0;
972 for (
unsigned int absIter = 0; absIter < static_cast<unsigned int> ( glAbscissas->size() ); absIter++ )
979 posVals[0] = ( ( glAbscissas->at(absIter) + 1.0 ) / 2.0 ) * ( shellSep *
static_cast<double> ( vals->size() ) );
982 for (
unsigned int valIt = 0; valIt < static_cast<unsigned int> ( vals->size() ); valIt++ )
984 if ( ( (valIt*shellSep) <= posVals[0] ) && ( ( (valIt+1)*shellSep) > posVals[0] ) )
986 lesserPos =
static_cast<unsigned int> ( valIt );
987 upperPos =
static_cast<unsigned int> ( valIt + 1 );
995 if ( lesserPos != 0 )
998 lesserWeight = upperPos - ( posVals[0] / shellSep );
999 upperWeight = 1.0 - lesserWeight;
1001 posVals[1] = ( lesserWeight * vals->at(lesserPos-1) ) + ( upperWeight * vals->at(upperPos-1) );
1006 upperWeight = 1.0 - ( upperPos - ( posVals[0] / shellSep ) );
1008 posVals[1] = ( upperWeight * vals->at(upperPos-1) );
1011 intData.emplace_back ( posVals );
1017 for (
unsigned int absPoint = 0; absPoint < static_cast<unsigned int> ( intData.size() ); absPoint++ )
1019 ret += ( glWeights->at(absPoint) * intData.at(absPoint)[1] );
1023 ret *= ( (
static_cast<double> ( vals->size() ) * shellSep ) / 2.0 );
1045 std::array<double,2> ProSHADE_internal::ProSHADE_compareOneAgainstAll::glIntCR ( std::vector< std::array<double,2> >* vals,
1047 std::vector<double> *glAbscissas,
1048 std::vector<double> *glWeights )
1051 std::array<double,2> ret;
1054 std::vector< std::array<double,3> > intData;
1055 std::array<double,3> posVals;
1056 unsigned int lesserPos = 0;
1057 unsigned int upperPos = 0;
1058 double lesserWeight = 0.0;
1059 double upperWeight = 0.0;
1061 for (
unsigned int absIter = 0; absIter < static_cast<unsigned int> ( glAbscissas->size() ); absIter++ )
1069 posVals[0] = ( ( glAbscissas->at(absIter) + 1.0 ) / 2.0 ) * ( shellSep *
static_cast<double> ( vals->size() ) );
1072 for (
unsigned int valIt = 0; valIt < static_cast<unsigned int> ( vals->size() ); valIt++ )
1074 if ( ( (valIt*shellSep) <= posVals[0] ) && ( ( (valIt+1)*shellSep) > posVals[0] ) )
1076 lesserPos =
static_cast<unsigned int> ( valIt );
1077 upperPos =
static_cast<unsigned int> ( valIt + 1 );
1085 if ( lesserPos != 0 )
1088 lesserWeight = upperPos - ( posVals[0] / shellSep );
1089 upperWeight = 1.0 - lesserWeight;
1091 posVals[1] = ( lesserWeight * vals->at(lesserPos-1)[0] ) + ( upperWeight * vals->at(upperPos-1)[0] );
1092 posVals[2] = ( lesserWeight * vals->at(lesserPos-1)[1] ) + ( upperWeight * vals->at(upperPos-1)[1] );
1097 upperWeight = 1.0 - ( upperPos - ( posVals[0] / shellSep ) );
1099 posVals[1] = ( upperWeight * vals->at(upperPos-1)[0] );
1100 posVals[2] = ( upperWeight * vals->at(upperPos-1)[1] );
1103 intData.emplace_back ( posVals );
1110 for (
unsigned int absPoint = 0; absPoint < static_cast<unsigned int> ( intData.size() ); absPoint++ )
1112 ret[0] += ( glWeights->at(absPoint) * intData.at(absPoint)[1] );
1113 ret[1] += ( glWeights->at(absPoint) * intData.at(absPoint)[2] );
1117 ret[0] *= ( (
static_cast<double> ( vals->size() ) * shellSep ) / 2.0 );
1118 ret[1] *= ( (
static_cast<double> ( vals->size() ) * shellSep ) / 2.0 );
1154 this->bandwidth = std::vector<unsigned int> { { settings->
bandwidth , settings->
bandwidth } };
1156 this->theta = std::vector<unsigned int> { { settings->
theta , settings->
theta } };
1157 this->phi = std::vector<unsigned int> { { settings->
phi , settings->
phi } };
1163 this->useCOM = settings->
useCOM;
1166 this->alpha = settings->
alpha;
1167 this->mPower = settings->
mPower;
1168 this->ignoreLs = settings->
ignoreLs;
1174 this->printFull =
false;
1186 std::cerr <<
"!!! ProSHADE ERROR !!! Not enough files/too many files detected for map overlay mode. Please supply a two structures using the -f or -i command line options. Terminating..." << std::endl;
1190 std::stringstream hlpSS;
1191 hlpSS <<
"<font color=\"red\">" <<
"The number of input structures is not two. Do not know how to proceed." <<
"</font>";
1192 rvapi_set_text ( hlpSS.str().c_str(),
1205 bool wasMapNameGiven =
true;
1208 std::cout <<
"!!! ProSHADE WARNING !!! The output file name was not set. You may want to use the \'--clearMap\' option to set it. Using the default name \'rotStr\'." << std::endl;
1212 std::stringstream hlpSS;
1213 hlpSS <<
"<font color=\"orange\">" <<
"There is no filename to which the output matching structure should be saved. Will use defaul name 'rotStr'." <<
"</font>";
1214 rvapi_set_text ( hlpSS.str().c_str(),
1232 wasMapNameGiven =
false;
1237 std::cout <<
">>>>> Sanity checks passed." << std::endl;
1242 std::stringstream hlpSS;
1243 hlpSS <<
"<font color=\"green\">" <<
"Will move structure " << settings->
structFiles.at(1) <<
" to match into structure " << settings->
structFiles.at(0) <<
" .</font>";
1244 rvapi_set_text ( hlpSS.str().c_str(),
1255 unsigned int fileType =
checkFileType ( structFiles.at(0) );
1259 if ( fileType == 2 )
1261 pattStr1->getDensityMapFromMAP ( this->structFiles.at(0),
1263 this->mapResolution,
1264 &this->bandwidth.at(0),
1267 &this->glIntegOrder.at(0),
1274 else if ( fileType == 1 )
1276 pattStr1->getDensityMapFromPDB ( this->structFiles.at(0),
1278 this->mapResolution,
1279 &this->bandwidth.at(0),
1282 &this->glIntegOrder.at(0),
1292 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1296 std::stringstream hlpSS;
1297 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(0) <<
" ." <<
"</font>";
1298 rvapi_set_text ( hlpSS.str().c_str(),
1313 std::cout <<
"Structure 1 loaded." << std::endl;
1319 if ( fileType == 2 )
1321 pattStr2->getDensityMapFromMAP ( this->structFiles.at(1),
1323 this->mapResolution,
1324 &this->bandwidth.at(1),
1327 &this->glIntegOrder.at(1),
1334 else if ( fileType == 1 )
1336 pattStr2->getDensityMapFromPDB ( this->structFiles.at(1),
1338 this->mapResolution,
1339 &this->bandwidth.at(1),
1342 &this->glIntegOrder.at(1),
1352 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(1) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1356 std::stringstream hlpSS;
1357 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(1) <<
" ." <<
"</font>";
1358 rvapi_set_text ( hlpSS.str().c_str(),
1373 std::cout <<
"Structure 2 loaded." << std::endl;
1377 unsigned int maxBand = std::max ( this->bandwidth.at(0) , this->bandwidth.at(1) );
1378 unsigned int maxTheta = std::max ( this->theta.at(0) , this->theta.at(1) );
1379 unsigned int maxPhi = std::max ( this->phi.at(0) , this->phi.at(1) );
1380 unsigned int maxGlInteg = std::max ( this->glIntegOrder.at(0), this->glIntegOrder.at(1) );
1381 double maxSpacing = std::max ( shSpacingObj1, shSpacingObj2 );
1383 if ( ( shSpacingObj1 != shSpacingObj2 ) || ( this->bandwidth.at(0) != this->bandwidth.at(1) ) ||
1384 ( this->theta.at(0) != this->theta.at(1) ) || ( this->phi.at(0) != this->phi.at(1) ) ||
1385 ( this->glIntegOrder.at(0) != this->glIntegOrder.at(1) ) )
1387 this->bandwidth.at(0) = maxBand;
1388 this->bandwidth.at(1) = maxBand;
1389 this->theta.at(0) = maxTheta;
1390 this->theta.at(1) = maxTheta;
1391 this->phi.at(0) = maxPhi;
1392 this->phi.at(1) = maxPhi;
1393 this->glIntegOrder.at(0) = maxGlInteg;
1394 this->glIntegOrder.at(1) = maxGlInteg;
1395 shSpacingObj1 = maxSpacing;
1396 shSpacingObj2 = maxSpacing;
1400 shSpacingObj1 = shSpacingObj2;
1404 if ( fileType == 2 )
1406 pattStr1->getDensityMapFromMAP ( this->structFiles.at(0),
1408 this->mapResolution,
1409 &this->bandwidth.at(0),
1412 &this->glIntegOrder.at(0),
1419 else if ( fileType == 1 )
1421 pattStr1->getDensityMapFromPDB ( this->structFiles.at(0),
1423 this->mapResolution,
1424 &this->bandwidth.at(0),
1427 &this->glIntegOrder.at(0),
1437 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1441 std::stringstream hlpSS;
1442 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(0) <<
" ." <<
"</font>";
1443 rvapi_set_text ( hlpSS.str().c_str(),
1458 shSpacingObj2 = shSpacingObj1;
1462 if ( fileType == 2 )
1464 pattStr2->getDensityMapFromMAP ( this->structFiles.at(1),
1466 this->mapResolution,
1467 &this->bandwidth.at(1),
1470 &this->glIntegOrder.at(1),
1477 else if ( fileType == 1 )
1479 pattStr2->getDensityMapFromPDB ( this->structFiles.at(1),
1481 this->mapResolution,
1482 &this->bandwidth.at(1),
1485 &this->glIntegOrder.at(1),
1495 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(1) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1499 std::stringstream hlpSS;
1500 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(1) <<
" ." <<
"</font>";
1501 rvapi_set_text ( hlpSS.str().c_str(),
1517 std::stringstream hlpSS;
1518 hlpSS <<
"<font color=\"green\">" <<
"Loaded structures in Patterson mode for rotation computation." <<
"</font>";
1519 rvapi_set_text ( hlpSS.str().c_str(),
1532 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
deleteModels.size() ); iter++ )
1534 pattStr1->deleteModel ( settings->
deleteModels.at(iter) );
1539 pattStr1->normaliseMap ( settings );
1540 pattStr1->removePhaseFromMapOverlay ( this->alpha,
1541 this->bFactorChange,
1544 pattStr1->mapPhaselessToSphere ( settings,
1548 this->manualShells );
1550 pattStr1->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
1553 std::cout <<
">> Structure 1 spherical harmonics computed." << std::endl;
1556 pattStr2->normaliseMap ( settings );
1557 pattStr2->removePhaseFromMapOverlay ( this->alpha,
1558 this->bFactorChange,
1561 pattStr2->mapPhaselessToSphere ( settings,
1565 this->manualShells );
1567 pattStr2->getSphericalHarmonicsCoeffs ( this->bandwidth.at(1), settings );
1570 std::cout <<
">> Structure 2 spherical harmonics computed." << std::endl;
1575 std::stringstream hlpSS;
1576 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics for Patterson maps computed." <<
"</font>";
1577 rvapi_set_text ( hlpSS.str().c_str(),
1592 std::max ( this->glIntegOrder.at(0),
1593 this->glIntegOrder.at(1) ),
1600 std::cout <<
">>>>> E matrices constructed." << std::endl;
1606 std::cout <<
">>>>> Inverse SO(3) Fourier transform map obtained." << std::endl;
1611 std::stringstream hlpSS;
1612 hlpSS <<
"<font color=\"green\">" <<
"Rotation function map computed." <<
"</font>";
1613 rvapi_set_text ( hlpSS.str().c_str(),
1623 double pattCorrelation = 0.0;
1625 std::array<double,3> euAngs = cmpObj->
getEulerAngles ( settings, &pattCorrelation );
1629 std::cout <<
">> Patterson map based rotation angles obtained ( " << euAngs[0] <<
", " << euAngs[1] <<
" and " << euAngs[2] <<
" )." << std::endl;
1634 std::stringstream hlpSS;
1635 hlpSS <<
"<font color=\"green\">" <<
"Found optimal overlay rotation angles." <<
"</font>";
1636 rvapi_set_text ( hlpSS.str().c_str(),
1649 rvapi_add_section (
"RotationSection",
1650 "Rotation information",
1661 std::stringstream hlpSS;
1662 hlpSS <<
"<pre>" <<
"Rotation in Euler Angles: ";
1663 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1664 for (
int iter = 0; iter < hlpIt; iter++ )
1669 std::stringstream hlpSS2;
1670 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[0] * 1000.0 ) / 1000.0;
1671 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1672 hlpSS <<
" " << hlpSS2.str() <<
" ";
1673 hlpSS2.str( std::string ( ) );
1674 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[1] * 1000.0 ) / 1000.0;
1675 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1676 hlpSS << hlpSS2.str() <<
" ";
1677 hlpSS2.str( std::string ( ) );
1678 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[2] * 1000.0 ) / 1000.0;
1679 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1680 hlpSS << hlpSS2.str() <<
"</pre>";
1682 rvapi_set_text ( hlpSS.str().c_str(),
1689 hlpSS.str ( std::string ( ) );
1690 hlpSS <<
"<pre>" <<
"Rotation in Angle-Axis: ";
1691 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1692 for (
int iter = 0; iter < hlpIt; iter++ )
1697 double X, Y, Z, Ang;
1698 ProSHADE_internal_misc::getAxisAngleFromEuler ( euAngs[0], euAngs[1], euAngs[2], &X, &Y, &Z, &Ang,
false );
1700 hlpSS2.str( std::string ( ) );
1701 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( X * 1000.0 ) / 1000.0;
1702 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1703 hlpSS <<
" " << hlpSS2.str() <<
" ";
1704 hlpSS2.str( std::string ( ) );
1705 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Y * 1000.0 ) / 1000.0;
1706 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1707 hlpSS << hlpSS2.str() <<
" ";
1708 hlpSS2.str( std::string ( ) );
1709 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Z * 1000.0 ) / 1000.0;
1710 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1711 hlpSS << hlpSS2.str() <<
" ";
1712 hlpSS2.str( std::string ( ) );
1713 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Ang * 1000.0 ) / 1000.0;
1714 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1715 hlpSS << hlpSS2.str() <<
"</pre>";
1717 rvapi_set_text ( hlpSS.str().c_str(),
1724 std::array<double,5> arrHlp;
1730 std::vector< std::vector<double> > rMat = ProSHADE_internal_misc::getMatrixFromAxisAngle ( arrHlp );
1732 hlpSS.str ( std::string ( ) );
1733 hlpSS <<
"<pre>" <<
"Rotation as Rotation Matrix: ";
1734 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1735 for (
int iter = 0; iter < hlpIt; iter++ )
1740 hlpSS2.str( std::string ( ) );
1741 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(0) * 1000.0 ) / 1000.0;
1742 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1743 hlpSS <<
" " << hlpSS2.str() <<
" ";
1744 hlpSS2.str( std::string ( ) );
1745 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(1) * 1000.0 ) / 1000.0;
1746 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1747 hlpSS << hlpSS2.str() <<
" ";
1748 hlpSS2.str( std::string ( ) );
1749 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(2) * 1000.0 ) / 1000.0;
1750 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1751 hlpSS << hlpSS2.str() <<
"</pre>";
1753 rvapi_set_text ( hlpSS.str().c_str(),
1760 hlpSS.str ( std::string ( ) );
1761 hlpSS <<
"<pre>" <<
" ... ";
1762 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1763 for (
int iter = 0; iter < hlpIt; iter++ )
1768 hlpSS2.str( std::string ( ) );
1769 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(0) * 1000.0 ) / 1000.0;
1770 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1771 hlpSS <<
" " << hlpSS2.str() <<
" ";
1772 hlpSS2.str( std::string ( ) );
1773 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(1) * 1000.0 ) / 1000.0;
1774 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1775 hlpSS << hlpSS2.str() <<
" ";
1776 hlpSS2.str( std::string ( ) );
1777 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(2) * 1000.0 ) / 1000.0;
1778 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1779 hlpSS << hlpSS2.str() <<
"</pre>";
1781 rvapi_set_text ( hlpSS.str().c_str(),
1788 hlpSS.str ( std::string ( ) );
1789 hlpSS <<
"<pre>" <<
" ... ";
1790 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1791 for (
int iter = 0; iter < hlpIt; iter++ )
1796 hlpSS2.str( std::string ( ) );
1797 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(0) * 1000.0 ) / 1000.0;
1798 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1799 hlpSS <<
" " << hlpSS2.str() <<
" ";
1800 hlpSS2.str( std::string ( ) );
1801 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(1) * 1000.0 ) / 1000.0;
1802 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1803 hlpSS << hlpSS2.str() <<
" ";
1804 hlpSS2.str( std::string ( ) );
1805 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(2) * 1000.0 ) / 1000.0;
1806 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1807 hlpSS << hlpSS2.str() <<
"</pre>";
1809 rvapi_set_text ( hlpSS.str().c_str(),
1825 std::array<double,4> translationVec;
1826 double xMapMov = 0.0;
1827 double yMapMov = 0.0;
1828 double zMapMov = 0.0;
1829 double xMapTotMov = 0.0;
1830 double yMapTotMov = 0.0;
1831 double zMapTotMov = 0.0;
1838 if ( fileType == 2 )
1840 pattStr2->getDensityMapFromMAP ( this->structFiles.at(1),
1842 this->mapResolution,
1843 &this->bandwidth.at(1),
1846 &this->glIntegOrder.at(1),
1853 else if ( fileType == 1 )
1855 pattStr2->getDensityMapFromPDB ( this->structFiles.at(1),
1857 this->mapResolution,
1858 &this->bandwidth.at(1),
1861 &this->glIntegOrder.at(1),
1871 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(1) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1875 std::stringstream hlpSS;
1876 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(1) <<
" ." <<
"</font>";
1877 rvapi_set_text ( hlpSS.str().c_str(),
1890 pattStr2->normaliseMap ( settings );
1891 std::array<double,4> str2CandD = pattStr2->getCOMandDist ( settings );
1892 pattStr2->keepPhaseInMap ( this->alpha,
1893 this->bFactorChange,
1894 &this->bandwidth.at(1),
1897 &this->glIntegOrder.at(1),
1908 pattStr2->mapPhaselessToSphere ( settings,
1916 pattStr2->getSphericalHarmonicsCoeffs ( this->bandwidth.at(1), settings );
1919 std::cout <<
">> Structure 2 spherical harmonics computed with phase." << std::endl;
1926 if ( fileType == 2 )
1928 pattStr1->getDensityMapFromMAP ( this->structFiles.at(0),
1930 this->mapResolution,
1931 &this->bandwidth.at(0),
1934 &this->glIntegOrder.at(0),
1941 else if ( fileType == 1 )
1943 pattStr1->getDensityMapFromPDB ( this->structFiles.at(0),
1945 this->mapResolution,
1946 &this->bandwidth.at(0),
1949 &this->glIntegOrder.at(0),
1959 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
1963 std::stringstream hlpSS;
1964 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(0) <<
" ." <<
"</font>";
1965 rvapi_set_text ( hlpSS.str().c_str(),
1978 pattStr1->normaliseMap ( settings );
1979 pattStr1->keepPhaseInMap ( this->alpha,
1980 this->bFactorChange,
1981 &this->bandwidth.at(0),
1984 &this->glIntegOrder.at(0),
1995 pattStr1->mapPhaselessToSphere ( settings,
2003 pattStr1->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
2006 std::cout <<
">> Structure 1 spherical harmonics computed with phase." << std::endl;
2011 std::stringstream hlpSS;
2012 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics computed for translation computation (with phases)." <<
"</font>";
2013 rvapi_set_text ( hlpSS.str().c_str(),
2025 std::stringstream hlpSS;
2026 hlpSS <<
"<pre>" <<
"Rotation about coordinate location (A): ";
2027 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2028 for (
int iter = 0; iter < hlpIt; iter++ )
2033 std::stringstream hlpSS2;
2034 double pos = ( ( pattStr2->_xFrom * pattStr2->_xSamplingRate ) + pattStr2->_xRange ) / 2.0;
2035 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2036 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2037 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2038 hlpSS <<
" " << hlpSS2.str() <<
" ";
2039 hlpSS2.str( std::string ( ) );
2040 pos = ( ( pattStr2->_yFrom * pattStr2->_ySamplingRate ) + pattStr2->_yRange ) / 2.0;
2041 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2042 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2043 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2044 hlpSS << hlpSS2.str() <<
" ";
2045 hlpSS2.str( std::string ( ) );
2046 pos = ( ( pattStr2->_zFrom * pattStr2->_zSamplingRate ) + pattStr2->_zRange ) / 2.0;
2047 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2048 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2049 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2050 hlpSS << hlpSS2.str() <<
"</pre>";
2052 rvapi_set_text ( hlpSS.str().c_str(),
2066 std::max ( this->glIntegOrder.at(0),
2067 this->glIntegOrder.at(1) ),
2072 double mat22 = cos ( euAngs[1] );
2073 double mat02 = -sin ( euAngs[1] ) * cos ( euAngs[2] );
2074 double mat12 = sin ( euAngs[1] ) * sin ( euAngs[2] );
2075 double mat20 = cos ( euAngs[0] ) * sin ( euAngs[1] );
2076 double mat21 = sin ( euAngs[0] ) * sin ( euAngs[1] );
2079 double rMat02 = mat20;
2080 double rMat20 = mat02;
2081 double rMat21 = mat12;
2082 double rMat12 = mat21;
2085 euAngs[0] = atan2 ( rMat21, rMat20 );
2086 euAngs[1] = acos ( mat22 );
2087 euAngs[2] = atan2 ( rMat12, -rMat02 );
2089 if ( euAngs[0] < 0.0 ) { euAngs[0]= 2.0 * M_PI + euAngs[0]; }
2090 if ( euAngs[1] < 0.0 ) { euAngs[1]= M_PI + euAngs[1]; }
2091 if ( euAngs[2] < 0.0 ) { euAngs[2]= 2.0 * M_PI + euAngs[2]; }
2109 std::stringstream hlpSS;
2110 hlpSS <<
"<font color=\"green\">" <<
"Translation computed." <<
"</font>";
2111 rvapi_set_text ( hlpSS.str().c_str(),
2124 rvapi_add_section (
"TranslationSection",
2125 "Translation information",
2136 std::stringstream hlpSS;
2137 hlpSS <<
"<pre>" <<
"Translation from lowest indices (A): ";
2138 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2139 for (
int iter = 0; iter < hlpIt; iter++ )
2144 std::stringstream hlpSS2;
2145 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[0] * 1000.0 ) / 1000.0;
2146 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2147 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2148 hlpSS <<
" " << hlpSS2.str() <<
" ";
2149 hlpSS2.str( std::string ( ) );
2150 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[1] * 1000.0 ) / 1000.0;
2151 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2152 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2153 hlpSS << hlpSS2.str() <<
" ";
2154 hlpSS2.str( std::string ( ) );
2155 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[2] * 1000.0 ) / 1000.0;
2156 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2157 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2158 hlpSS << hlpSS2.str() <<
"</pre>";
2160 rvapi_set_text ( hlpSS.str().c_str(),
2161 "TranslationSection",
2167 hlpSS.str( std::string () );
2168 hlpSS <<
"<pre>" <<
"Translation from lowest indices (index): ";
2169 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2170 for (
int iter = 0; iter < hlpIt; iter++ )
2175 hlpSS2.str( std::string ( ) );
2176 int pos =
static_cast<int> ( ( -translationVec[0] / pattStr2->_xSamplingRate ) );
2177 hlpSS2 << std::showpos << pos;
2178 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2179 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2180 hlpSS <<
" " << hlpSS2.str() <<
" ";
2181 hlpSS2.str( std::string ( ) );
2182 pos =
static_cast<int> ( ( -translationVec[1] / pattStr2->_ySamplingRate ) );
2183 hlpSS2 << std::showpos << pos;
2184 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2185 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2186 hlpSS << hlpSS2.str() <<
" ";
2187 hlpSS2.str( std::string ( ) );
2188 pos =
static_cast<int> ( ( -translationVec[2] / pattStr2->_zSamplingRate ) );
2189 hlpSS2 << std::showpos << pos;
2190 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2191 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2192 hlpSS << hlpSS2.str() <<
"</pre>";
2194 rvapi_set_text ( hlpSS.str().c_str(),
2195 "TranslationSection",
2201 hlpSS.str ( std::string ( ) );
2202 hlpSS <<
"<pre>" <<
"Shift for visualisation (A): ";
2203 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2204 for (
int iter = 0; iter < hlpIt; iter++ )
2209 hlpSS2.str ( std::string ( ) );
2210 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (xMapTotMov * pattStr2->_xSamplingRate) * 1000.0 ) / 1000.0;
2211 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2212 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2213 hlpSS <<
" " << hlpSS2.str() <<
" ";
2214 hlpSS2.str( std::string ( ) );
2215 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (yMapTotMov * pattStr2->_ySamplingRate) * 1000.0 ) / 1000.0;
2216 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2217 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2218 hlpSS << hlpSS2.str() <<
" ";
2219 hlpSS2.str( std::string ( ) );
2220 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (zMapTotMov * pattStr2->_zSamplingRate) * 1000.0 ) / 1000.0;
2221 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2222 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2223 hlpSS << hlpSS2.str() <<
"</pre>";
2225 rvapi_set_text ( hlpSS.str().c_str(),
2226 "TranslationSection",
2232 hlpSS.str( std::string () );
2233 hlpSS <<
"<pre>" <<
"Shift for visualisation (index): ";
2234 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2235 for (
int iter = 0; iter < hlpIt; iter++ )
2240 hlpSS2.str( std::string ( ) );
2241 pos =
static_cast<int> ( xMapTotMov );
2242 hlpSS2 << std::showpos << pos;
2243 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2244 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2245 hlpSS <<
" " << hlpSS2.str() <<
" ";
2246 hlpSS2.str( std::string ( ) );
2247 pos =
static_cast<int> ( yMapTotMov );
2248 hlpSS2 << std::showpos << pos;
2249 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2250 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2251 hlpSS << hlpSS2.str() <<
" ";
2252 hlpSS2.str( std::string ( ) );
2253 pos =
static_cast<int> ( zMapTotMov );
2254 hlpSS2 << std::showpos << pos;
2255 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2256 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2257 hlpSS << hlpSS2.str() <<
"</pre>";
2259 rvapi_set_text ( hlpSS.str().c_str(),
2260 "TranslationSection",
2272 std::cout <<
">>>>> Translation vector obtained from translation function ( " << translationVec[0] <<
", " << translationVec[1] <<
" and " << translationVec[2] <<
" )." << std::endl;
2286 this->extraSpace = 0.0;
2289 double transVecLen = sqrt ( pow ( translationVec[0], 2.0 ) + pow ( translationVec[1], 2.0 ) + pow ( translationVec[2], 2.0 ) );
2290 double str2COMVecLen = str2CandD[3] + settings->
extraSpace;
2293 if ( transVecLen > ( 0.2 * str2COMVecLen ) )
2295 std::cout <<
"!!! ProSHADE WARNING !!! The required translation vector is larger than 20% of the static structure cell size. This is likely to result in translation artefacts - increasing the cell size and trying again." << std::endl;
2298 this->extraSpace += 20.0;
2315 pattStr2->translateMap ( -translationVec[0],
2317 -translationVec[2] );
2321 std::cout <<
"Resulting structure translated." << std::endl;
2325 if ( settings->resizeMovingStructure )
2327 pattStr2->matchMap ( pattStr1 );
2331 if ( !pattStr2->_fromPDB )
2333 if ( !wasMapNameGiven )
2335 std::stringstream strStr;
2337 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2341 if ( ( settings->
clearMapFile.find (
".map" ) != std::string::npos ) || ( settings->
clearMapFile.find (
".mrc" ) != std::string::npos ) )
2343 pattStr2->writeMap ( settings->
clearMapFile, pattStr2->_densityMapCor );
2347 if ( settings->
clearMapFile.find (
".pdb" ) != std::string::npos )
2349 std::stringstream strStr;
2351 std::cerr <<
"!!! ProSHADE ERROR !!! Requested to output PDB file for MAP output. ProSHADE cannot convert MAP to PDB - outputting map into file " << strStr.str() <<
" ." << std::endl;
2352 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2356 std::stringstream strStr;
2358 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2365 if ( !wasMapNameGiven )
2367 std::stringstream strStr;
2369 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2371 strStr.str ( std::string ( ) );
2374 pattStr2->writePDB ( this->structFiles.at(1),
2379 translationVec[0] + xMapMov,
2380 translationVec[1] + yMapMov,
2381 translationVec[2] + zMapMov );
2385 if ( ( settings->
clearMapFile.find (
".map" ) != std::string::npos ) || ( settings->
clearMapFile.find (
".mrc" ) != std::string::npos ) )
2387 pattStr2->writeMap ( settings->
clearMapFile, pattStr2->_densityMapCor );
2391 if ( settings->
clearMapFile.find (
".pdb" ) != std::string::npos )
2393 pattStr2->writePDB ( this->structFiles.at(1),
2398 translationVec[0] + xMapMov,
2399 translationVec[1] + yMapMov,
2400 translationVec[2] + zMapMov );
2404 std::stringstream strStr;
2406 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2407 strStr.str ( std::string ( ) );
2410 pattStr2->writePDB ( this->structFiles.at(1),
2415 translationVec[0] + xMapMov,
2416 translationVec[1] + yMapMov,
2417 translationVec[2] + zMapMov );
2425 std::stringstream hlpSS;
2426 hlpSS <<
"<font color=\"green\">" <<
"Overlay structure saved to " << settings->
clearMapFile <<
" ." <<
"</font>";
2427 rvapi_set_text ( hlpSS.str().c_str(),
2445 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
2446 std::cout <<
"| COMPLETED |" << std::endl;
2447 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2452 std::stringstream hlpSS;
2453 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
2454 rvapi_set_text ( hlpSS.str().c_str(),
2466 std::cout <<
"Rotated structure written to file: " << settings->
clearMapFile <<
" as required." << std::endl << std::endl;
2472 rvapi_add_section (
"ResultsSection",
2482 std::stringstream hlpSS;
2483 hlpSS <<
"<pre><b>" <<
"Patterson maps optimal rotation (Euler angles): ";
2484 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2485 for (
int iter = 0; iter < hlpIt; iter++ )
2490 std::stringstream hlpSS2;
2491 double pos = euAngs[0];
2492 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2493 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2494 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2495 hlpSS <<
" " << hlpSS2.str() <<
" ";
2497 hlpSS2.str( std::string ( ) );
2499 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2500 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2501 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2502 hlpSS << hlpSS2.str() <<
" ";
2504 hlpSS2.str( std::string ( ) );
2506 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2507 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2508 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2509 hlpSS << hlpSS2.str() <<
"</b></pre>";
2511 rvapi_set_text ( hlpSS.str().c_str(),
2518 hlpSS.str ( std::string ( ) );
2519 hlpSS <<
"<pre><b>" <<
"Phased maps optimal translation (A): ";
2520 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2521 for (
int iter = 0; iter < hlpIt; iter++ )
2526 hlpSS2.str( std::string ( ) );
2527 pos = translationVec[0];
2528 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2529 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2530 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2531 hlpSS <<
" " << hlpSS2.str() <<
" ";
2533 hlpSS2.str( std::string ( ) );
2534 pos = translationVec[1];
2535 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2536 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2537 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2538 hlpSS << hlpSS2.str() <<
" ";
2540 hlpSS2.str( std::string ( ) );
2541 pos = translationVec[2];
2542 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2543 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2544 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2545 hlpSS << hlpSS2.str() <<
"</b></pre>";
2547 rvapi_set_text ( hlpSS.str().c_str(),
2554 hlpSS.str ( std::string ( ) );
2555 hlpSS <<
"<pre><b>" <<
"Correlation between rotated Patterson maps: ";
2556 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2557 for (
int iter = 0; iter < hlpIt; iter++ )
2562 hlpSS2.str( std::string ( ) );
2563 pos = pattCorrelation;
2564 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2565 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2566 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2567 hlpSS <<
" " << hlpSS2.str() <<
"</b></pre>";
2569 rvapi_set_text ( hlpSS.str().c_str(),
2576 hlpSS.str ( std::string ( ) );
2577 hlpSS <<
"<pre><b>" <<
"Correlation between translated maps with phases: ";
2578 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2579 for (
int iter = 0; iter < hlpIt; iter++ )
2584 hlpSS2.str( std::string ( ) );
2585 pos = translationVec[3];
2586 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2587 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2588 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2589 hlpSS <<
" " << hlpSS2.str() <<
"</b></pre>";
2591 rvapi_set_text ( hlpSS.str().c_str(),
2611 std::cerr <<
"!!! ProSHADE ERROR !!! No files/too many files detected for map rotation mode. Please supply a single map file using the -f or -i command line options. Terminating..." << std::endl;
2617 std::cerr <<
"!!! ProSHADE ERROR !!! The input file is corrupted or not a ccp4 MAP file formatted. Terminating..." << std::endl;
2623 std::cout <<
"!!! ProSHADE WARNING !!! The output file name was not set. You may want to use the \'--clearMap\' option to set it. Using the default name \'rotMap.map\'." << std::endl;
2629 std::cout <<
"!!! ProSHADE WARNING !!! There is no rotation to be done, but will progress as if there were. It would be faster just to copy the input..." << std::endl;
2634 std::cout <<
">>>>> Sanity checks passed." << std::endl;
2640 &this->shellSpacing,
2641 this->mapResolution,
2642 &this->bandwidth.at(0),
2645 &this->glIntegOrder.at(0),
2653 std::cout <<
"Structure loaded." << std::endl;
2662 this->bFactorChange,
2663 &this->bandwidth.at(0),
2666 &this->glIntegOrder.at(0),
2690 std::cout <<
">> Structure spherical harmonics computed." << std::endl;
2698 this->glIntegOrder.at(0),
2702 double euAlpha = 0.0;
2703 double euBeta = 0.0;
2704 double euGamma = 0.0;
2706 ProSHADE_internal_misc::getEulerFromAxisAngle ( &euAlpha,
2718 printf (
">>>>> Preparation for rotation complete. Euler angles are %+.3f ; %+.3f ; %+.3f\n", euAlpha, euBeta, euGamma );
2728 this->glIntegOrder.at(0),
2735 printf (
">>>>> Preparation for rotation complete. Euler angles are 0.000 ; 0.000 ; 0.000\n" );
2753 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
2754 std::cout <<
"| COMPLETED |" << std::endl;
2755 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2760 std::cout <<
"Rotated structure written to file: " << settings->
clearMapFile <<
" as required." << std::endl << std::endl;
2770 std::cout <<
"-----------------------------------------------------------" << std::endl;
2771 std::cout <<
"| MODE: Symmetry |" << std::endl;
2772 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2778 rvapi_set_text (
"<h1>ProSHADE Results: Symmetry</h1>",
2787 rvapi_add_section (
"ProgressSection",
2797 std::stringstream hlpSS;
2798 hlpSS <<
"<font color=\"green\">" <<
"Starting computation of symmetry for the input structure." <<
"</font>";
2799 rvapi_set_text ( hlpSS.str().c_str(),
2813 std::cerr <<
"!!! ProSHADE ERROR !!! No files/too many files detected for map symmetry mode. Please supply a single map file using the -f or -i command line options. Terminating..." << std::endl;
2816 std::stringstream hlpSS;
2817 hlpSS <<
"<font color=\"red\"><b>" <<
"Incorrect number of input files detected. The symmetry mode can process only a single structure at a time." <<
"<b></font>";
2818 rvapi_set_text ( hlpSS.str().c_str(),
2831 unsigned int fileType =
checkFileType ( structFiles.at(0) );
2833 if ( fileType == 2 )
2835 symStr->getDensityMapFromMAP ( this->structFiles.at(0),
2836 &this->shellSpacing,
2837 this->mapResolution,
2838 &this->bandwidth.at(0),
2841 &this->glIntegOrder.at(0),
2848 else if ( fileType == 1 )
2850 symStr->getDensityMapFromPDB ( this->structFiles.at(0),
2851 &this->shellSpacing,
2852 this->mapResolution,
2853 &this->bandwidth.at(0),
2856 &this->glIntegOrder.at(0),
2861 this->firstLineCOM );
2865 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file. Terminating ..." << std::endl;
2868 std::stringstream hlpSS;
2869 hlpSS <<
"<font color=\"red\"><b>" <<
"Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." <<
"<b></font>";
2870 rvapi_set_text ( hlpSS.str().c_str(),
2883 std::cout <<
"Structure loaded." << std::endl;
2888 std::stringstream hlpSS;
2889 hlpSS <<
"<font color=\"green\">" <<
"Structure " << settings->
structFiles.at(0) <<
" loaded." <<
"</font>";
2890 rvapi_set_text ( hlpSS.str().c_str(),
2905 std::cout <<
">> Saving the structure into the requested location ( " << settings->
clearMapFile <<
" )." << std::endl;
2908 symStr->writeMap ( settings->
clearMapFile, symStr->_densityMapMap );
2911 symStr->keepPhaseInMap ( this->alpha,
2912 this->bFactorChange,
2913 &this->bandwidth.at(0),
2916 &this->glIntegOrder.at(0),
2927 symStr->mapPhaselessToSphere ( settings,
2931 this->manualShells );
2932 symStr->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
2935 std::cout <<
">> Structure spherical harmonics computed." << std::endl;
2939 std::stringstream hlpSS;
2940 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics decomposition computed." <<
"</font>";
2941 rvapi_set_text ( hlpSS.str().c_str(),
2956 this->glIntegOrder.at(0),
2962 std::cout <<
">>>>> E matrices constructed." << std::endl;
2966 std::stringstream hlpSS;
2967 hlpSS <<
"<font color=\"green\">" <<
"Shell integration complete." <<
"</font>";
2968 rvapi_set_text ( hlpSS.str().c_str(),
2981 std::cout <<
">>>>> Inverse SO(3) Fourier transform map obtained." << std::endl;
2985 std::stringstream hlpSS;
2986 hlpSS <<
"<font color=\"green\">" <<
"SO(3) Fourier Transform computed." <<
"</font>";
2987 rvapi_set_text ( hlpSS.str().c_str(),
2998 this->peakHeightNoIQRs,
3000 this->peakSurroundingPoints,
3001 this->peakDistanceForReal,
3005 std::cout <<
">> Peaks obtained." << std::endl;
3009 std::stringstream hlpSS;
3010 hlpSS <<
"<font color=\"green\">" <<
"Rotation map peaks detection complete." <<
"</font>";
3011 rvapi_set_text ( hlpSS.str().c_str(),
3024 this->aaErrorTolerance,
3031 std::cout <<
"C symmetries detected." << std::endl;
3035 std::stringstream hlpSS;
3036 hlpSS <<
"<font color=\"green\">" <<
"Cyclic symmetries detected." <<
"</font>";
3037 rvapi_set_text ( hlpSS.str().c_str(),
3049 bool foundFold =
false;
3050 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cnSymm.size() ); iter++ )
3052 if ( this->cnSymm.at(iter)[0] == settings->
symmetryFold ) { foundFold =
true; }
3059 std::cout <<
">>>>> The requested fold was not found. Searching for it specifically." << std::endl;
3062 double mapPeakHeight = 0.0;
3063 double mapPeakMax = 0.0;
3064 unsigned int iterMax = 0;
3065 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cnSymm.size() ); iter++ )
3068 this->cnSymm.at(iter)[2],
3069 this->cnSymm.at(iter)[3],
3072 if ( mapPeakMax < mapPeakHeight ) { mapPeakMax = mapPeakHeight; iterMax = iter; }
3075 if ( this->cnSymm.size() > 0 )
3077 if ( mapPeakMax > ( this->cnSymm.at(iterMax)[4] * ( 1.0 - settings->
symGapTolerance ) ) )
3079 std::array<double,5> hlpArr;
3080 hlpArr[0] =
static_cast<double> ( settings->
symmetryFold );
3081 hlpArr[1] = this->cnSymm.at(iterMax)[1];
3082 hlpArr[2] = this->cnSymm.at(iterMax)[2];
3083 hlpArr[3] = this->cnSymm.at(iterMax)[3];
3084 hlpArr[4] = mapPeakMax;
3085 this->cnSymm.emplace_back ( hlpArr );
3092 this->dnSymm = cmpObj->
findDnSymmetry ( this->cnSymm , this->aaErrorTolerance );
3093 if ( this->cnSymm.size() != 0 )
3095 this->cnSymmClear = cmpObj->
findCnSymmetryClear ( this->cnSymm, settings, this->symGapTolerance, &this->printFull );
3097 if ( this->dnSymm.size() != 0 )
3099 this->dnSymmClear = cmpObj->
findDnSymmetryClear ( this->dnSymm, settings, this->symGapTolerance, &this->printFull );
3103 std::cout <<
"D symmetries detected." << std::endl;
3107 std::stringstream hlpSS;
3108 hlpSS <<
"<font color=\"green\">" <<
"Dihedral symmetries detected." <<
"</font>";
3109 rvapi_set_text ( hlpSS.str().c_str(),
3120 this->icosSymm = cmpObj->
findIcosSymmetry ( this->cnSymm, &this->icosSymmPeakAvg, this->aaErrorTolerance );
3121 this->octaSymm = cmpObj->
findOctaSymmetry ( this->cnSymm, &this->octaSymmPeakAvg, this->aaErrorTolerance );
3122 this->tetrSymm = cmpObj->
findTetrSymmetry ( this->cnSymm, &this->tetrSymmPeakAvg, this->aaErrorTolerance );
3125 std::cout <<
"T, O and I symmetries detected." << std::endl;
3129 std::stringstream hlpSS;
3130 hlpSS <<
"<font color=\"green\">" <<
"Tetrahedral, Octahedral and Icosahedral symmetries detected." <<
"</font>";
3131 rvapi_set_text ( hlpSS.str().c_str(),
3141 if ( this->icosSymm.size() > 0 )
3143 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosSymm.size() ); icoIt++ )
3145 this->icosAxes = this->generateIcosAxes ( cmpObj, settings, this->icosSymm.at(icoIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3147 if ( this->icosAxes.size() == 31 )
3152 if ( this->icosAxes.size() != 31 )
3154 std::cout <<
"!!! ProSHADE WARNING !!! It looks like icosahedral symmetry, but cannot find all the elements. Please report this case. Sorry for the inconvenience." << std::endl;
3158 this->icosElems = this->generateIcosElements ( this->icosAxes, settings, settings->
verbose );
3162 if ( ( ( this->octaSymm.size() > 0 ) && ( this->icosAxes.size() == 0 ) ) ||
3163 ( ( settings->
symmetryType ==
"O" ) && ( this->octaSymm.size() > 0 ) ) )
3165 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaSymm.size() ); octIt++ )
3167 this->octaAxes = this->generateOctaAxes ( cmpObj, settings, this->octaSymm.at(octIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3169 if ( this->octaAxes.size() == 13 )
3174 if ( this->octaAxes.size() != 13 )
3176 std::cout <<
"!!! ProSHADE WARNING !!! It looks like (cub)octahedral symmetry, but cannot find all the elements. Please report this case. Sorry for the inconvenience." << std::endl;
3180 this->octaElems = this->generateOctaElements ( this->octaAxes, settings, settings->
verbose );
3184 if ( ( ( this->tetrSymm.size() > 0 ) && ( this->octaAxes.size() == 0 ) && ( this->icosAxes.size() == 0 ) ) ||
3185 ( ( settings->
symmetryType ==
"T" ) && ( this->tetrSymm.size() > 0 ) ) )
3187 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrSymm.size() ); tetIt++ )
3189 this->tetrAxes = this->generateTetrAxes ( cmpObj, settings, this->tetrSymm.at(tetIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3191 if ( this->tetrAxes.size() == 6 )
3196 if ( this->tetrAxes.size() != 6 )
3198 std::cout <<
"!!! ProSHADE WARNING !!! It looks like tetrahedral symmetry, but cannot find all the elements. Please report this case. Sorry for the inconvenience." << std::endl;
3202 this->tetrElems = this->generateTetrElements ( this->tetrAxes, settings, settings->
verbose );
3208 std::cout <<
">> Generation of T, O and I symmetry group elements complete." << std::endl;
3213 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
3214 std::cout <<
"| COMPLETED |" << std::endl;
3215 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
3220 std::stringstream hlpSS;
3221 hlpSS <<
"<font color=\"green\">" <<
"Symmetry detection completed." <<
"</font>";
3222 rvapi_set_text ( hlpSS.str().c_str(),
3233 this->inputStructureDataType = symStr->_fromPDB;
3262 printf (
"-----------------------------------------------------------\n" );
3263 printf (
"| RESULTS |\n" );
3264 printf (
"-----------------------------------------------------------\n\n" );
3267 if ( symmetryType ==
"I" )
3269 if ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 )
3271 printf (
"Detected Icosahedral symmetry as requested\n\n" );
3272 printf (
"Symmetry axes table:\n" );
3273 printf (
"-----------------------------------------------------------\n" );
3274 printf (
"Symmetry Fold x y z Angle Peak\n" );
3275 printf (
" Type height\n" );
3276 printf (
"-----------------------------------------------------------\n" );
3278 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3280 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->icosAxes.at(icoIt)[0] ), this->icosAxes.at(icoIt)[1], this->icosAxes.at(icoIt)[2], this->icosAxes.at(icoIt)[3],
static_cast<int> ( this->icosAxes.at(icoIt)[0] ), this->icosAxes.at(icoIt)[4] );
3284 printf (
"Symmetry elements table:\n" );
3285 printf (
"-----------------------------------------------------------\n" );
3286 printf (
"Symmetry x y z Angle \n" );
3287 printf (
" Type (deg) \n" );
3288 printf (
"-----------------------------------------------------------\n" );
3290 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3292 if ( this->icosElems.at(icoIt)[0] != 1.0 )
3294 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->icosElems.at(icoIt)[0] ), this->icosElems.at(icoIt)[1], this->icosElems.at(icoIt)[2], this->icosElems.at(icoIt)[3], this->icosElems.at(icoIt)[4] );
3298 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->icosElems.at(icoIt)[1], this->icosElems.at(icoIt)[2], this->icosElems.at(icoIt)[3], this->icosElems.at(icoIt)[4] );
3305 std::cout <<
"!!! ProSHADE WARNING !!! Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." << std::endl << std::endl;
3309 if ( symmetryType ==
"O" )
3311 if ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 )
3313 printf (
"Detected (Cub)octahedral symmetry as requested\n\n" );
3314 printf (
"Symmetry axes table:\n" );
3315 printf (
"-----------------------------------------------------------\n" );
3316 printf (
"Symmetry Fold x y z Angle Peak\n" );
3317 printf (
" Type height\n" );
3318 printf (
"-----------------------------------------------------------\n" );
3320 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaAxes.size() ); octIt++ )
3322 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->octaAxes.at(octIt)[0] ), this->octaAxes.at(octIt)[1], this->octaAxes.at(octIt)[2], this->octaAxes.at(octIt)[3],
static_cast<int> ( this->octaAxes.at(octIt)[0] ), this->octaAxes.at(octIt)[4] );
3326 printf (
"Symmetry elements table:\n" );
3327 printf (
"-----------------------------------------------------------\n" );
3328 printf (
"Symmetry x y z Angle \n" );
3329 printf (
" Type (deg) \n" );
3330 printf (
"-----------------------------------------------------------\n" );
3332 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaElems.size() ); octIt++ )
3334 if ( this->octaElems.at(octIt)[0] != 1.0 )
3336 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->octaElems.at(octIt)[0] ), this->octaElems.at(octIt)[1], this->octaElems.at(octIt)[2], this->octaElems.at(octIt)[3], this->octaElems.at(octIt)[4] );
3340 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->octaElems.at(octIt)[1], this->octaElems.at(octIt)[2], this->octaElems.at(octIt)[3], this->octaElems.at(octIt)[4] );
3347 std::cout <<
"!!! ProSHADE WARNING !!! Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below.\n\n" << std::endl << std::endl;
3351 if ( symmetryType ==
"T" )
3353 if ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 )
3355 printf (
"Detected Tetrahedral symmetry as requested\n\n" );
3356 printf (
"Symmetry axes table:\n" );
3357 printf (
"-----------------------------------------------------------\n" );
3358 printf (
"Symmetry Fold x y z Angle Peak\n" );
3359 printf (
" Type height\n" );
3360 printf (
"-----------------------------------------------------------\n" );
3362 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrAxes.size() ); tetIt++ )
3364 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->tetrAxes.at(tetIt)[0] ), this->tetrAxes.at(tetIt)[1], this->tetrAxes.at(tetIt)[2], this->tetrAxes.at(tetIt)[3],
static_cast<int> ( this->tetrAxes.at(tetIt)[0] ), this->tetrAxes.at(tetIt)[4] );
3368 printf (
"Symmetry elements table:\n" );
3369 printf (
"-----------------------------------------------------------\n" );
3370 printf (
"Symmetry x y z Angle \n" );
3371 printf (
" Type (deg) \n" );
3372 printf (
"-----------------------------------------------------------\n" );
3374 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrElems.size() ); tetIt++ )
3376 if ( this->tetrElems.at(tetIt)[0] != 1.0 )
3378 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->tetrElems.at(tetIt)[0] ), this->tetrElems.at(tetIt)[1], this->tetrElems.at(tetIt)[2], this->tetrElems.at(tetIt)[3], this->tetrElems.at(tetIt)[4] );
3382 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->tetrElems.at(tetIt)[1], this->tetrElems.at(tetIt)[2], this->tetrElems.at(tetIt)[3], this->tetrElems.at(tetIt)[4] );
3389 std::cout <<
"!!! ProSHADE WARNING !!! Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below.\n\n" << std::endl << std::endl;
3393 if ( symmetryType ==
"D" )
3395 if ( static_cast<unsigned int> ( this->dnSymm.size() ) > 0 )
3397 bool reqFound =
false;
3398 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->dnSymm.size() ); dIt++ )
3400 if ( reqFound ) {
break; }
3401 unsigned int howManyTwos = 0;
3402 for (
unsigned int dItt = 0; dItt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); dItt++ )
3404 if ( reqFound ) {
break; }
3405 if ( symmetryFold != 2 )
3407 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold )
3409 printf (
"Detected Dihedral symmetry as requested\n\n" );
3410 printf (
"Symmetry axes table:\n" );
3411 printf (
"-----------------------------------------------------------\n" );
3412 printf (
"Symmetry Fold x y z Angle Peak\n" );
3413 printf (
" Type height\n" );
3414 printf (
"-----------------------------------------------------------\n" );
3415 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
3417 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3],
static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[4] );
3422 printf (
"Symmetry elements table:\n" );
3423 printf (
"-----------------------------------------------------------\n" );
3424 printf (
"Symmetry x y z Angle \n" );
3425 printf (
" Type (deg) \n" );
3426 printf (
"-----------------------------------------------------------\n" );
3428 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3429 for (
unsigned int it = 0; it < 2; it++ )
3431 if ( static_cast<int> ( this->dnSymm.at(0).at(it)[0] ) % 2 == 0 )
3433 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
3435 if ( iter == 0 ) {
continue; }
3436 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
3437 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) );
3442 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
3444 if ( iter == 0 ) {
continue; }
3445 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) );
3456 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
3466 if ( symmetryFold == 2 )
3468 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
3472 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold && howManyTwos == 2 )
3474 printf (
"Detected Dihedral symmetry as requested\n\n" );
3475 printf (
"Symmetry axes table:\n" );
3476 printf (
"-----------------------------------------------------------\n" );
3477 printf (
"Symmetry Fold x y z Angle Peak\n" );
3478 printf (
" Type height\n" );
3479 printf (
"-----------------------------------------------------------\n" );
3480 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
3482 if ( this->dnSymm.at(dIt).at(it)[0] == 2.0 )
3484 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3],
static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[4] );
3490 printf (
"Symmetry elements table:\n" );
3491 printf (
"-----------------------------------------------------------\n" );
3492 printf (
"Symmetry x y z Angle \n" );
3493 printf (
" Type (deg) \n" );
3494 printf (
"-----------------------------------------------------------\n" );
3496 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3497 for (
unsigned int it = 0; it < 2; it++ )
3499 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
3501 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
3503 if ( iter == 0 ) {
continue; }
3504 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
3505 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) );
3510 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
3512 if ( iter == 0 ) {
continue; }
3513 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ), this->dnSymm.at(dIt).at(it)[1], this->dnSymm.at(dIt).at(it)[2], this->dnSymm.at(dIt).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) );
3527 std::cout <<
"!!! ProSHADE WARNING !!! Could not detect the requested dihedral symmetry, but detected dihedral symmetries with different fold. You can try changing the resolution or selecting one of the alternative symmetries printed below.\n\n" << std::endl << std::endl;
3532 std::cerr <<
"!!! Warning !!! Could not detect the requested dihedral symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below.\n\n" << std::endl << std::endl;
3536 if ( symmetryType ==
"C" )
3538 if ( static_cast<unsigned int> ( this->cnSymm.size() ) > 0 )
3540 bool reqFound =
false;
3541 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->cnSymm.size() ); dIt++ )
3543 if ( this->cnSymm.at(dIt)[0] == symmetryFold )
3545 printf (
"Detected Cyclic symmetry as requested\n\n" );
3546 printf (
"Symmetry axes table:\n" );
3547 printf (
"-----------------------------------------------------------\n" );
3548 printf (
"Symmetry Fold x y z Angle Peak\n" );
3549 printf (
" Type height\n" );
3550 printf (
"-----------------------------------------------------------\n" );
3551 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n\n", static_cast<int> ( this->cnSymm.at(dIt)[0] ), this->cnSymm.at(dIt)[1], this->cnSymm.at(dIt)[2], this->cnSymm.at(dIt)[3],
static_cast<int> ( this->cnSymm.at(dIt)[0] ), static_cast<double> ( this->cnSymm.at(dIt)[4] ) );
3555 printf (
"Symmetry elements table:\n" );
3556 printf (
"-----------------------------------------------------------\n" );
3557 printf (
"Symmetry x y z Angle \n" );
3558 printf (
" Type (deg) \n" );
3559 printf (
"-----------------------------------------------------------\n" );
3561 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3562 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
3564 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
3566 if ( iter == 0 ) {
continue; }
3567 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
3568 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->cnSymm.at(dIt)[0] ), this->cnSymm.at(dIt)[1], this->cnSymm.at(dIt)[2], this->cnSymm.at(dIt)[3], iter * ( 360.0 /
static_cast<double> ( this->cnSymm.at(dIt)[0] ) ) );
3573 for (
int iter = -std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
3575 if ( iter == 0 ) {
continue; }
3576 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->cnSymm.at(dIt)[0] ), this->cnSymm.at(dIt)[1], this->cnSymm.at(dIt)[2], this->cnSymm.at(dIt)[3], iter * ( 360.0 /
static_cast<double> ( this->cnSymm.at(dIt)[0] ) ) );
3586 std::cout <<
"!!! ProSHADE WARNING !!! Could not detect the requested cyclic symmetry, but detected cyclic symmetries with different folds. You can try changing the resolution or selecting one of the alternative symmetries printed below.\n\n" << std::endl << std::endl;
3591 std::cerr <<
"!!! Warning !!! Could not detect the requested cyclic symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below.\n\n" << std::endl << std::endl;
3596 printf (
"Alternatives:\n" );
3597 printf (
"-----------------------------------------------------------\n" );
3598 printf (
"Symmetry Fold x y z Angle Peak\n" );
3599 printf (
" Type height\n" );
3600 printf (
"-----------------------------------------------------------\n" );
3601 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
3603 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->cnSymm.at(gNo)[0] ), this->cnSymm.at(gNo)[1], this->cnSymm.at(gNo)[2], this->cnSymm.at(gNo)[3],
static_cast<int> ( this->cnSymm.at(gNo)[0] ), static_cast<double> ( this->cnSymm.at(gNo)[4] ) );
3606 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
3608 printf (
" D %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ), this->dnSymm.at(iter).at(0)[1], this->dnSymm.at(iter).at(0)[2], this->dnSymm.at(iter).at(0)[3],
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ), this->dnSymm.at(iter).at(0)[5] );
3610 for (
unsigned int mem = 1; mem < static_cast<unsigned int> ( this->dnSymm.at(iter).size() ); mem++ )
3612 printf (
" %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(iter).at(mem)[0] ), this->dnSymm.at(iter).at(mem)[1], this->dnSymm.at(iter).at(mem)[2], this->dnSymm.at(iter).at(mem)[3],
static_cast<int> ( this->dnSymm.at(iter).at(mem)[0] ), this->dnSymm.at(iter).at(mem)[5] );
3616 if ( this->tetrElems.size() > 0 )
3618 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->tetrSymm.size() ); iter++ )
3620 printf (
" T %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->tetrSymm.at(iter).at(0)[0] ), this->tetrSymm.at(iter).at(0)[1], this->tetrSymm.at(iter).at(0)[2], this->tetrSymm.at(iter).at(0)[3],
static_cast<int> ( this->tetrSymm.at(iter).at(0)[0] ), this->tetrSymm.at(iter).at(0)[4] );
3621 printf (
" %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->tetrSymm.at(iter).at(1)[0] ), this->tetrSymm.at(iter).at(1)[1], this->tetrSymm.at(iter).at(1)[2], this->tetrSymm.at(iter).at(1)[3],
static_cast<int> ( this->tetrSymm.at(iter).at(1)[0] ), this->tetrSymm.at(iter).at(1)[4] );
3625 if ( this->octaElems.size() > 0 )
3627 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->octaSymm.size() ); iter++ )
3629 printf (
" O %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->octaSymm.at(iter).at(0)[0] ), this->octaSymm.at(iter).at(0)[1], this->octaSymm.at(iter).at(0)[2], this->octaSymm.at(iter).at(0)[3],
static_cast<int> ( this->octaSymm.at(iter).at(0)[0] ), this->octaSymm.at(iter).at(0)[4] );
3630 printf (
" %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->octaSymm.at(iter).at(1)[0] ), this->octaSymm.at(iter).at(1)[1], this->octaSymm.at(iter).at(1)[2], this->octaSymm.at(iter).at(1)[3],
static_cast<int> ( this->octaSymm.at(iter).at(1)[0] ), this->octaSymm.at(iter).at(1)[4] );
3634 if ( this->icosElems.size() > 0 )
3636 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->icosSymm.size() ); iter++ )
3638 printf (
" I %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->icosSymm.at(iter).at(0)[0] ), this->icosSymm.at(iter).at(0)[1], this->icosSymm.at(iter).at(0)[2], this->icosSymm.at(iter).at(0)[3],
static_cast<int> ( this->icosSymm.at(iter).at(0)[0] ), this->icosSymm.at(iter).at(0)[4] );
3639 printf (
" %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->icosSymm.at(iter).at(1)[0] ), this->icosSymm.at(iter).at(1)[1], this->icosSymm.at(iter).at(1)[2], this->icosSymm.at(iter).at(1)[3],
static_cast<int> ( this->icosSymm.at(iter).at(1)[0] ), this->icosSymm.at(iter).at(1)[4] );
3642 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
3662 unsigned int symmetryFold,
3669 rvapi_add_section (
"ReviewSection",
3679 std::stringstream hlpSS;
3680 hlpSS <<
"<pre>" <<
"Requested symmetry : ";
3681 if ( symmetryType ==
"I" )
3683 hlpSS <<
"Icosahedral" <<
"</pre>";
3685 if ( symmetryType ==
"O" )
3687 hlpSS <<
"Octahedral" <<
"</pre>";
3689 if ( symmetryType ==
"T" )
3691 hlpSS <<
"Tetrahedral" <<
"</pre>";
3693 if ( symmetryType ==
"D" )
3695 hlpSS <<
"Dihedral with fold " << ProSHADE_internal_misc::to_string_with_precision ( symmetryFold ) <<
"</pre>";
3697 if ( symmetryType ==
"C" )
3699 hlpSS <<
"Cyclic with fold " << ProSHADE_internal_misc::to_string_with_precision ( symmetryFold ) <<
"</pre>";
3703 rvapi_set_text ( hlpSS.str().c_str(),
3710 hlpSS.str ( std::string ( ) );
3711 hlpSS <<
"<pre>" <<
"Input structure : " << this->structFiles.at(0) <<
"</pre>";
3712 rvapi_set_text ( hlpSS.str().c_str(),
3721 rvapi_add_section (
"ResultsSection",
3733 bool foundRequest =
true;
3735 if ( symmetryType ==
"I" )
3737 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
3739 std::stringstream hlpSS;
3740 hlpSS <<
"<b>" <<
"Detected <i>ICOSAHEDRAL<i> symmetry as requested." <<
"</b>";
3741 rvapi_set_text ( hlpSS.str().c_str(),
3750 rvapi_add_table (
"SymmetryTypeTable",
3751 "Detected symmetry axes",
3755 static_cast<unsigned int> ( this->icosAxes.size() ),
3762 hlpSS.str ( std::string ( ) );
3763 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
3764 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
3767 hlpSS.str ( std::string ( ) );
3768 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
3769 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
3772 hlpSS.str ( std::string ( ) );
3773 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
3774 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3777 hlpSS.str ( std::string ( ) );
3778 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
3779 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3782 hlpSS.str ( std::string ( ) );
3783 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
3784 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3787 hlpSS.str ( std::string ( ) );
3788 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
3789 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
3792 hlpSS.str ( std::string ( ) );
3793 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
3794 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
3798 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3800 std::stringstream hlpSS2;
3801 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
3802 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
3807 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3809 std::stringstream hlpSS2;
3811 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
3813 hlpSS2.str ( std::string ( ) );
3814 hlpSS2 << static_cast<int> ( this->icosAxes.at(icoIt)[0] );
3815 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
3817 hlpSS2.str ( std::string ( ) );
3818 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[1], prec );
3819 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
3821 hlpSS2.str ( std::string ( ) );
3822 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[2], prec );
3823 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
3825 hlpSS2.str ( std::string ( ) );
3826 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[3], prec );
3827 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
3829 hlpSS2.str ( std::string ( ) );
3830 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->icosAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
3831 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
3833 hlpSS2.str ( std::string ( ) );
3834 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[4], prec );
3835 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
3839 rvapi_add_table (
"SymmetryElementsTable",
3840 "Detected symmetry elements",
3842 static_cast<unsigned int> ( this->icosAxes.size() ) + 1,
3844 static_cast<unsigned int> ( this->icosElems.size() ),
3847 totTabRows =
static_cast<unsigned int> ( this->icosAxes.size() ) + 1 + static_cast<unsigned int> ( this->icosElems.size() );
3852 hlpSS.str ( std::string ( ) );
3853 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
3854 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
3857 hlpSS.str ( std::string ( ) );
3858 hlpSS <<
"This column states the symmetry element fold.";
3859 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
3862 hlpSS.str ( std::string ( ) );
3863 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
3864 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3867 hlpSS.str ( std::string ( ) );
3868 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
3869 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3872 hlpSS.str ( std::string ( ) );
3873 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
3874 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3877 hlpSS.str ( std::string ( ) );
3878 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
3879 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
3883 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3885 std::stringstream hlpSS2;
3886 hlpSS2 <<
"Symmetry element #" << icoIt+1;
3887 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
3891 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3893 if ( this->icosElems.at(icoIt)[0] != 1.0 )
3895 std::stringstream hlpSS3;
3897 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
3901 std::stringstream hlpSS3;
3903 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
3906 std::stringstream hlpSS2;
3907 hlpSS2 << static_cast<int> ( this->icosElems.at(icoIt)[0] );
3908 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
3910 hlpSS2.str ( std::string ( ) );
3911 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[1], prec );
3912 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
3914 hlpSS2.str ( std::string ( ) );
3915 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[2], prec );
3916 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
3918 hlpSS2.str ( std::string ( ) );
3919 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[3], prec );
3920 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
3922 hlpSS2.str ( std::string ( ) );
3923 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[4], prec );
3924 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
3931 std::stringstream hlpSS;
3932 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." <<
"</font></b>";
3933 rvapi_set_text ( hlpSS.str().c_str(),
3940 foundRequest =
false;
3944 if ( symmetryType ==
"O" )
3946 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->octaElems.size() ) > 0 ) )
3949 std::stringstream hlpSS;
3950 hlpSS <<
"<b>" <<
"Detected <i>OCTAHEDRAL</i> symmetry as requested." <<
"</b>";
3951 rvapi_set_text ( hlpSS.str().c_str(),
3960 rvapi_add_table (
"SymmetryTypeTable",
3961 "Detected symmetry axes",
3965 static_cast<unsigned int> ( this->octaAxes.size() ),
3972 hlpSS.str ( std::string ( ) );
3973 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
3974 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
3977 hlpSS.str ( std::string ( ) );
3978 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
3979 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
3982 hlpSS.str ( std::string ( ) );
3983 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
3984 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3987 hlpSS.str ( std::string ( ) );
3988 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
3989 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3992 hlpSS.str ( std::string ( ) );
3993 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
3994 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3997 hlpSS.str ( std::string ( ) );
3998 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
3999 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4002 hlpSS.str ( std::string ( ) );
4003 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
4004 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4008 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
4010 std::stringstream hlpSS2;
4011 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
4012 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
4017 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
4019 std::stringstream hlpSS2;
4021 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
4023 hlpSS2.str ( std::string ( ) );
4024 hlpSS2 << static_cast<int> ( this->octaAxes.at(icoIt)[0] );
4025 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
4027 hlpSS2.str ( std::string ( ) );
4028 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[1], prec );
4029 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
4031 hlpSS2.str ( std::string ( ) );
4032 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[2], prec );
4033 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
4035 hlpSS2.str ( std::string ( ) );
4036 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[3], prec );
4037 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
4039 hlpSS2.str ( std::string ( ) );
4040 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->octaAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
4041 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
4043 hlpSS2.str ( std::string ( ) );
4044 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[4], prec );
4045 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
4049 rvapi_add_table (
"SymmetryElementsTable",
4050 "Detected symmetry elements",
4052 static_cast<unsigned int> ( this->octaAxes.size() ) + 1,
4054 static_cast<unsigned int> ( this->octaElems.size() ),
4057 totTabRows =
static_cast<unsigned int> ( this->octaAxes.size() ) + 1 + static_cast<unsigned int> ( this->octaElems.size() );
4062 hlpSS.str ( std::string ( ) );
4063 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4064 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4067 hlpSS.str ( std::string ( ) );
4068 hlpSS <<
"This column states the symmetry element fold.";
4069 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4072 hlpSS.str ( std::string ( ) );
4073 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4074 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4077 hlpSS.str ( std::string ( ) );
4078 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4079 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4082 hlpSS.str ( std::string ( ) );
4083 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4084 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4087 hlpSS.str ( std::string ( ) );
4088 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4089 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4093 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
4095 std::stringstream hlpSS2;
4096 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4097 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4101 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
4103 if ( this->octaElems.at(icoIt)[0] != 1.0 )
4105 std::stringstream hlpSS3;
4107 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
4111 std::stringstream hlpSS3;
4113 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
4116 std::stringstream hlpSS2;
4117 hlpSS2 << static_cast<int> ( this->octaElems.at(icoIt)[0] );
4118 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
4120 hlpSS2.str ( std::string ( ) );
4121 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[1], prec );
4122 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
4124 hlpSS2.str ( std::string ( ) );
4125 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[2], prec );
4126 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
4128 hlpSS2.str ( std::string ( ) );
4129 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[3], prec );
4130 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
4132 hlpSS2.str ( std::string ( ) );
4133 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[4], prec );
4134 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
4141 std::stringstream hlpSS;
4142 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." <<
"</font></b>";
4143 rvapi_set_text ( hlpSS.str().c_str(),
4150 foundRequest =
false;
4154 if ( symmetryType ==
"T" )
4156 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
4159 std::stringstream hlpSS;
4160 hlpSS <<
"<b>" <<
"Detected <i>TETRAHEDRAL</i> symmetry as requested." <<
"</b>";
4161 rvapi_set_text ( hlpSS.str().c_str(),
4170 rvapi_add_table (
"SymmetryTypeTable",
4171 "Detected symmetry axes",
4175 static_cast<unsigned int> ( this->tetrAxes.size() ),
4182 hlpSS.str ( std::string ( ) );
4183 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4184 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4187 hlpSS.str ( std::string ( ) );
4188 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4189 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4192 hlpSS.str ( std::string ( ) );
4193 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4194 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4197 hlpSS.str ( std::string ( ) );
4198 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4199 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4202 hlpSS.str ( std::string ( ) );
4203 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4204 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4207 hlpSS.str ( std::string ( ) );
4208 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4209 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4212 hlpSS.str ( std::string ( ) );
4213 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
4214 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4218 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
4220 std::stringstream hlpSS2;
4221 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
4222 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
4227 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
4229 std::stringstream hlpSS2;
4231 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
4233 hlpSS2.str ( std::string ( ) );
4234 hlpSS2 << static_cast<int> ( this->tetrAxes.at(icoIt)[0] );
4235 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
4237 hlpSS2.str ( std::string ( ) );
4238 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[1], prec );
4239 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
4241 hlpSS2.str ( std::string ( ) );
4242 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[2], prec );
4243 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
4245 hlpSS2.str ( std::string ( ) );
4246 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[3], prec );
4247 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
4249 hlpSS2.str ( std::string ( ) );
4250 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->tetrAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
4251 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
4253 hlpSS2.str ( std::string ( ) );
4254 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[4], prec );
4255 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
4259 rvapi_add_table (
"SymmetryElementsTable",
4260 "Detected symmetry elements",
4262 static_cast<unsigned int> ( this->tetrAxes.size() ) + 1,
4264 static_cast<unsigned int> ( this->tetrElems.size() ),
4267 totTabRows =
static_cast<unsigned int> ( this->tetrAxes.size() ) + 1 + static_cast<unsigned int> ( this->tetrElems.size() );
4272 hlpSS.str ( std::string ( ) );
4273 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4274 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4277 hlpSS.str ( std::string ( ) );
4278 hlpSS <<
"This column states the symmetry element fold.";
4279 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4282 hlpSS.str ( std::string ( ) );
4283 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4284 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4287 hlpSS.str ( std::string ( ) );
4288 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4289 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4292 hlpSS.str ( std::string ( ) );
4293 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4294 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4297 hlpSS.str ( std::string ( ) );
4298 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4299 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4303 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
4305 std::stringstream hlpSS2;
4306 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4307 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4311 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
4313 std::stringstream hlpSS3;
4314 if ( this->tetrElems.at(icoIt)[0] != 1.0 )
4316 std::stringstream hlpSS2;
4318 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
4322 std::stringstream hlpSS2;
4324 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
4327 hlpSS3.str ( std::string ( ) );
4328 hlpSS3 << static_cast<int> ( this->tetrElems.at(icoIt)[0] );
4329 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 1 );
4331 hlpSS3.str ( std::string ( ) );
4332 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[1], prec );
4333 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 2 );
4335 hlpSS3.str ( std::string ( ) );
4336 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[2], prec );
4337 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 3 );
4339 hlpSS3.str ( std::string ( ) );
4340 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[3], prec );
4341 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 4 );
4343 hlpSS3.str ( std::string ( ) );
4344 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[4], prec );
4345 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 5 );
4352 std::stringstream hlpSS;
4353 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." <<
"</font></b>";
4354 rvapi_set_text ( hlpSS.str().c_str(),
4361 foundRequest =
false;
4365 if ( symmetryType ==
"D" )
4367 if ( static_cast<unsigned int> ( this->dnSymm.size() ) > 0 )
4369 bool reqFound =
false;
4370 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->dnSymm.size() ); dIt++ )
4372 if ( reqFound ) {
break; }
4373 unsigned int howManyTwos = 0;
4374 for (
unsigned int dItt = 0; dItt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); dItt++ )
4376 if ( reqFound ) {
break; }
4377 if ( symmetryFold != 2 )
4379 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold )
4381 std::stringstream hlpSS;
4382 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry as requested." <<
"</b>";
4383 rvapi_set_text ( hlpSS.str().c_str(),
4392 rvapi_add_table (
"SymmetryTypeTable",
4393 "Detected symmetry axes",
4397 this->dnSymm.at(dIt).size(),
4404 hlpSS.str ( std::string ( ) );
4405 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4406 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4409 hlpSS.str ( std::string ( ) );
4410 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4411 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4414 hlpSS.str ( std::string ( ) );
4415 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4416 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4419 hlpSS.str ( std::string ( ) );
4420 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4421 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4424 hlpSS.str ( std::string ( ) );
4425 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4426 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4429 hlpSS.str ( std::string ( ) );
4430 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4431 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4434 hlpSS.str ( std::string ( ) );
4435 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
4436 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4440 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); icoIt++ )
4442 hlpSS.str ( std::string ( ) );
4443 hlpSS <<
"Symmetry axis #" << icoIt+1;
4444 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", icoIt );
4449 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4451 std::stringstream hlpSS2;
4453 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 0 );
4455 hlpSS2.str ( std::string ( ) );
4456 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4457 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 1 );
4459 hlpSS2.str ( std::string ( ) );
4460 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4461 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 2 );
4463 hlpSS2.str ( std::string ( ) );
4464 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4465 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 3 );
4467 hlpSS2.str ( std::string ( ) );
4468 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4469 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 4 );
4471 hlpSS2.str ( std::string ( ) );
4472 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) * ( 180.0 / M_PI ), prec );
4473 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 5 );
4475 hlpSS2.str ( std::string ( ) );
4476 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[4], prec );
4477 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 6 );
4482 for (
unsigned int it = 0; it < 2; it++ )
4484 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4486 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4488 if ( iter == 0 ) {
continue; }
4489 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4496 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4498 if ( iter == 0 ) {
continue; }
4506 rvapi_add_table (
"SymmetryElementsTable",
4507 "Detected symmetry elements",
4509 this->dnSymm.at(dIt).size() + 1,
4514 totTabRows =
static_cast<unsigned int> ( totRows ) + this->dnSymm.at(dIt).size() + 1;
4519 hlpSS.str ( std::string ( ) );
4520 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4521 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4524 hlpSS.str ( std::string ( ) );
4525 hlpSS <<
"This column states the symmetry element fold.";
4526 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4529 hlpSS.str ( std::string ( ) );
4530 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4531 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4534 hlpSS.str ( std::string ( ) );
4535 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4536 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4539 hlpSS.str ( std::string ( ) );
4540 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4541 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4544 hlpSS.str ( std::string ( ) );
4545 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4546 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4550 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
4552 std::stringstream hlpSS2;
4553 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4554 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4560 hlpSS.str ( std::string ( ) );
4562 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
4564 hlpSS.str ( std::string ( ) );
4565 hlpSS << static_cast<int> ( 1 );
4566 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
4568 hlpSS.str ( std::string ( ) );
4569 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
4570 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
4572 hlpSS.str ( std::string ( ) );
4573 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4574 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
4576 hlpSS.str ( std::string ( ) );
4577 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4578 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
4580 hlpSS.str ( std::string ( ) );
4581 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4582 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
4584 for (
unsigned int it = 0; it < 2; it++ )
4586 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4588 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4590 if ( iter == 0 ) {
continue; }
4591 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4593 std::stringstream hlpSS2;
4595 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4597 hlpSS2.str ( std::string ( ) );
4598 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4599 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4601 hlpSS2.str ( std::string ( ) );
4602 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4603 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4605 hlpSS2.str ( std::string ( ) );
4606 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4607 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4609 hlpSS2.str ( std::string ( ) );
4610 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4611 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4613 hlpSS2.str ( std::string ( ) );
4614 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ), prec );
4615 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4621 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4623 if ( iter == 0 ) {
continue; }
4625 std::stringstream hlpSS2;
4627 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4629 hlpSS2.str ( std::string ( ) );
4630 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4631 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4633 hlpSS2.str ( std::string ( ) );
4634 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4635 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4637 hlpSS2.str ( std::string ( ) );
4638 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4639 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4641 hlpSS2.str ( std::string ( ) );
4642 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4643 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4645 hlpSS2.str ( std::string ( ) );
4646 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ), prec );
4647 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4659 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
4669 if ( symmetryFold == 2 )
4671 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
4675 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold && howManyTwos == 2 )
4677 std::stringstream hlpSS;
4678 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry as requested." <<
"</b>";
4679 rvapi_set_text ( hlpSS.str().c_str(),
4688 rvapi_add_table (
"SymmetryTypeTable",
4689 "Detected symmetry axes",
4700 hlpSS.str ( std::string ( ) );
4701 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4702 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4705 hlpSS.str ( std::string ( ) );
4706 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4707 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4710 hlpSS.str ( std::string ( ) );
4711 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4712 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4715 hlpSS.str ( std::string ( ) );
4716 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4717 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4720 hlpSS.str ( std::string ( ) );
4721 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4722 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4725 hlpSS.str ( std::string ( ) );
4726 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4727 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4730 hlpSS.str ( std::string ( ) );
4731 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
4732 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4737 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); icoIt++ )
4739 if ( this->dnSymm.at(dIt).at(icoIt)[0] != 2 ) {
continue; }
4740 hlpSS.str ( std::string ( ) );
4741 hlpSS <<
"Symmetry axis #" << rCount;
4742 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", rCount-1 );
4749 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4751 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4753 std::stringstream hlpSS2;
4755 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 0 );
4757 hlpSS2.str ( std::string ( ) );
4758 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4759 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 1 );
4761 hlpSS2.str ( std::string ( ) );
4762 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4763 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 2 );
4765 hlpSS2.str ( std::string ( ) );
4766 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4767 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 3 );
4769 hlpSS2.str ( std::string ( ) );
4770 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4771 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 4 );
4773 hlpSS2.str ( std::string ( ) );
4774 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ) * ( 180.0 / M_PI ), prec );
4775 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 5 );
4777 hlpSS2.str ( std::string ( ) );
4778 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[4], prec );
4779 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 6 );
4786 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4788 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4790 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4792 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4794 if ( iter == 0 ) {
continue; }
4795 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4802 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4804 if ( iter == 0 ) {
continue; }
4812 rvapi_add_table (
"SymmetryElementsTable",
4813 "Detected symmetry elements",
4815 this->dnSymm.at(dIt).size() + 1,
4820 totTabRows =
static_cast<unsigned int> ( totRows ) + this->dnSymm.at(dIt).size() + 1;
4825 hlpSS.str ( std::string ( ) );
4826 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4827 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4830 hlpSS.str ( std::string ( ) );
4831 hlpSS <<
"This column states the symmetry element fold.";
4832 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4835 hlpSS.str ( std::string ( ) );
4836 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4837 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4840 hlpSS.str ( std::string ( ) );
4841 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4842 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4845 hlpSS.str ( std::string ( ) );
4846 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4847 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4850 hlpSS.str ( std::string ( ) );
4851 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4852 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4856 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
4858 std::stringstream hlpSS2;
4859 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4860 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4866 hlpSS.str ( std::string ( ) );
4868 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
4870 hlpSS.str ( std::string ( ) );
4871 hlpSS << static_cast<int> ( 1 );
4872 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
4874 hlpSS.str ( std::string ( ) );
4875 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
4876 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
4878 hlpSS.str ( std::string ( ) );
4879 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4880 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
4882 hlpSS.str ( std::string ( ) );
4883 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4884 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
4886 hlpSS.str ( std::string ( ) );
4887 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4888 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
4890 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4892 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4894 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4896 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4898 if ( iter == 0 ) {
continue; }
4899 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4901 std::stringstream hlpSS2;
4903 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4905 hlpSS2.str ( std::string ( ) );
4906 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4907 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4909 hlpSS2.str ( std::string ( ) );
4910 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4911 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4913 hlpSS2.str ( std::string ( ) );
4914 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4915 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4917 hlpSS2.str ( std::string ( ) );
4918 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4919 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4921 hlpSS2.str ( std::string ( ) );
4922 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ), prec );
4923 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4929 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4931 for (
int iter = -std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ); iter++ )
4933 if ( iter == 0 ) {
continue; }
4935 std::stringstream hlpSS2;
4937 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4939 hlpSS2.str ( std::string ( ) );
4940 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4941 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4943 hlpSS2.str ( std::string ( ) );
4944 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4945 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4947 hlpSS2.str ( std::string ( ) );
4948 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4949 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4951 hlpSS2.str ( std::string ( ) );
4952 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4953 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4955 hlpSS2.str ( std::string ( ) );
4956 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymm.at(dIt).at(it)[0] ) ), prec );
4957 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4972 std::stringstream hlpSS;
4973 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested dihedral symmetry, but detected dihedral symmetries with different fold. You can try changing the resolution or selecting one of the alternative symmetries printed below." <<
"</font></b>";
4974 rvapi_set_text ( hlpSS.str().c_str(),
4981 foundRequest =
false;
4986 std::stringstream hlpSS;
4987 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." <<
"</font></b>";
4988 rvapi_set_text ( hlpSS.str().c_str(),
4995 foundRequest =
false;
4999 if ( symmetryType ==
"C" )
5001 if ( static_cast<unsigned int> ( this->cnSymm.size() ) > 0 )
5003 bool reqFound =
false;
5004 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->cnSymm.size() ); dIt++ )
5006 if ( this->cnSymm.at(dIt)[0] == symmetryFold )
5009 std::stringstream hlpSS;
5010 hlpSS <<
"<b>" <<
"Detected <i>CYCLIC</i> symmetry as requested." <<
"</b>";
5011 rvapi_set_text ( hlpSS.str().c_str(),
5020 rvapi_add_table (
"SymmetryTypeTable",
5021 "Detected symmetry axes",
5032 hlpSS.str ( std::string ( ) );
5033 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
5034 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
5037 hlpSS.str ( std::string ( ) );
5038 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
5039 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
5042 hlpSS.str ( std::string ( ) );
5043 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5044 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5047 hlpSS.str ( std::string ( ) );
5048 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5049 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5052 hlpSS.str ( std::string ( ) );
5053 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5054 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5057 hlpSS.str ( std::string ( ) );
5058 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5059 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5062 hlpSS.str ( std::string ( ) );
5063 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
5064 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
5068 hlpSS.str ( std::string ( ) );
5069 hlpSS <<
"Symmetry axis #" << 1;
5070 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS.str().c_str(),
"", 0 );
5074 hlpSS.str ( std::string ( ) );
5076 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 0 );
5078 hlpSS.str ( std::string ( ) );
5079 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5080 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 1 );
5082 hlpSS.str ( std::string ( ) );
5083 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5084 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 2 );
5086 hlpSS.str ( std::string ( ) );
5087 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5088 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 3 );
5090 hlpSS.str ( std::string ( ) );
5091 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5092 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 4 );
5094 hlpSS.str ( std::string ( ) );
5095 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->cnSymm.at(dIt)[0] ) ) * ( 180.0 / M_PI ), prec );
5096 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 5 );
5098 hlpSS.str ( std::string ( ) );
5099 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[4], prec );
5100 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 6 );
5104 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
5106 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
5108 if ( iter == 0 ) {
continue; }
5109 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
5116 for (
int iter = -std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
5118 if ( iter == 0 ) {
continue; }
5125 rvapi_add_table (
"SymmetryElementsTable",
5126 "Detected symmetry elements",
5133 totTabRows =
static_cast<unsigned int> ( totRows ) + 3;
5138 hlpSS.str ( std::string ( ) );
5139 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
5140 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
5143 hlpSS.str ( std::string ( ) );
5144 hlpSS <<
"This column states the symmetry element fold.";
5145 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
5148 hlpSS.str ( std::string ( ) );
5149 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
5150 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5153 hlpSS.str ( std::string ( ) );
5154 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
5155 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5158 hlpSS.str ( std::string ( ) );
5159 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
5160 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5163 hlpSS.str ( std::string ( ) );
5164 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
5165 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5169 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
5171 std::stringstream hlpSS2;
5172 hlpSS2 <<
"Symmetry element #" << std::to_string ( icoIt+1 );
5173 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
5179 hlpSS.str ( std::string ( ) );
5181 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
5183 hlpSS.str ( std::string ( ) );
5184 hlpSS << static_cast<int> ( 1 );
5185 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
5187 hlpSS.str ( std::string ( ) );
5188 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
5189 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
5191 hlpSS.str ( std::string ( ) );
5192 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5193 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
5195 hlpSS.str ( std::string ( ) );
5196 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5197 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
5199 hlpSS.str ( std::string ( ) );
5200 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5201 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
5203 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
5205 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
5207 if ( iter == 0 ) {
continue; }
5208 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
5210 hlpSS.str ( std::string ( ) );
5212 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
5214 hlpSS.str ( std::string ( ) );
5215 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5216 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
5218 hlpSS.str ( std::string ( ) );
5219 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5220 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
5222 hlpSS.str ( std::string ( ) );
5223 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5224 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
5226 hlpSS.str ( std::string ( ) );
5227 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5228 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
5230 hlpSS.str ( std::string ( ) );
5231 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->cnSymm.at(dIt)[0] ) ), prec );
5232 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
5238 for (
int iter = -std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ); iter++ )
5240 if ( iter == 0 ) {
continue; }
5242 hlpSS.str ( std::string ( ) );
5244 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
5246 hlpSS.str ( std::string ( ) );
5247 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5248 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
5250 hlpSS.str ( std::string ( ) );
5251 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5252 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
5254 hlpSS.str ( std::string ( ) );
5255 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5256 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
5258 hlpSS.str ( std::string ( ) );
5259 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5260 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
5262 hlpSS.str ( std::string ( ) );
5263 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->cnSymm.at(dIt)[0] ) ), prec );
5264 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
5276 std::stringstream hlpSS;
5277 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested cyclic symmetry, but detected other cyclic symmetries with different fold. You can try changing the resolution or selecting one of the alternative symmetries printed below." <<
"</font></b>";
5278 rvapi_set_text ( hlpSS.str().c_str(),
5285 foundRequest =
false;
5290 std::stringstream hlpSS;
5291 hlpSS <<
"<b><font color=\"orange\">" <<
"Could not detect the requested symmetry. You can try changing the resolution or searching for different symmetry from the alternatives list printed below." <<
"</font></b>";
5292 rvapi_set_text ( hlpSS.str().c_str(),
5299 foundRequest =
false;
5306 rvapi_add_table (
"AlternativesTable",
5307 "Alternative Symmetries Detected",
5311 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ) +
5312 static_cast<unsigned int> ( this->tetrSymm.size() ) + static_cast<unsigned int> ( this->octaSymm.size() ) +
5313 static_cast<unsigned int> ( this->icosSymm.size() ),
5319 rvapi_add_table (
"AlternativesTable",
5320 "Alternative Symmetries Detected",
5324 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ) +
5325 static_cast<unsigned int> ( this->tetrSymm.size() ) + static_cast<unsigned int> ( this->octaSymm.size() ) +
5326 static_cast<unsigned int> ( this->icosSymm.size() ),
5334 std::stringstream hlpSS;
5335 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D).";
5336 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
5339 hlpSS.str ( std::string ( ) );
5340 hlpSS <<
"This column states the symmetry fold.";
5341 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
5344 hlpSS.str ( std::string ( ) );
5345 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5346 rvapi_put_horz_theader (
"AlternativesTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5349 hlpSS.str ( std::string ( ) );
5350 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5351 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5354 hlpSS.str ( std::string ( ) );
5355 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5356 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5359 hlpSS.str ( std::string ( ) );
5360 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5361 rvapi_put_horz_theader (
"AlternativesTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5364 hlpSS.str ( std::string ( ) );
5365 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
5366 rvapi_put_horz_theader (
"AlternativesTable",
"Peak Height", hlpSS.str().c_str(), columnIter );
5372 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5374 std::stringstream hlpSS2;
5375 hlpSS2 <<
"Alternative Symmetry #" << gNo+1;
5376 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", gNo );
5379 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5381 std::stringstream hlpSS2;
5382 hlpSS2 <<
"Alternative Symmetry #" << iter + maxCAlts + 2;
5383 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", iter + maxCAlts + 1 );
5384 maxDAlts = iter + maxCAlts;
5387 if ( static_cast<int> ( this->tetrElems.size() ) > 0 )
5389 std::stringstream hlpSS2;
5390 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5391 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5394 if ( static_cast<int> ( this->octaElems.size() ) > 0 )
5396 std::stringstream hlpSS2;
5397 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5398 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5401 if ( static_cast<int> ( this->icosElems.size() ) > 0 )
5403 std::stringstream hlpSS2;
5404 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5405 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5411 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5413 std::stringstream hlpSS2;
5415 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5417 hlpSS2.str ( std::string ( ) );
5418 hlpSS2 << static_cast<int> (
static_cast<int> ( this->cnSymm.at(gNo)[0] ) );
5419 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5421 hlpSS2.str ( std::string ( ) );
5422 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[1], prec );
5423 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5425 hlpSS2.str ( std::string ( ) );
5426 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[2], prec );
5427 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5429 hlpSS2.str ( std::string ( ) );
5430 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[3], prec );
5431 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5433 hlpSS2.str ( std::string ( ) );
5434 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->cnSymm.at(gNo)[0] ) ) * ( 180.0 / M_PI ), prec );
5435 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5437 hlpSS2.str ( std::string ( ) );
5438 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->cnSymm.at(gNo)[4] ), prec );
5439 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5443 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5445 std::stringstream hlpSS2;
5447 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5449 hlpSS2.str ( std::string ( ) );
5450 hlpSS2 << static_cast<int> (
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ) );
5451 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5453 hlpSS2.str ( std::string ( ) );
5454 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[1], prec );
5455 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5457 hlpSS2.str ( std::string ( ) );
5458 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[2], prec );
5459 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5461 hlpSS2.str ( std::string ( ) );
5462 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[3], prec );
5463 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5465 hlpSS2.str ( std::string ( ) );
5466 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->dnSymm.at(iter).at(0)[0] ) ) * ( 180.0 / M_PI ), prec );
5467 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5469 hlpSS2.str ( std::string ( ) );
5470 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->dnSymm.at(iter).at(0)[4] ), prec );
5471 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5475 if ( static_cast<int> ( this->tetrElems.size() ) > 0 )
5477 std::stringstream hlpSS2;
5479 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5481 hlpSS2.str ( std::string ( ) );
5483 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5485 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5487 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5489 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5491 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5493 hlpSS2.str ( std::string ( ) );
5494 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->tetrSymm.at(0).at(0)[4] ), prec );
5495 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5499 if ( static_cast<int> ( this->octaElems.size() ) > 0 )
5501 std::stringstream hlpSS2;
5503 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5505 hlpSS2.str ( std::string ( ) );
5507 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5509 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5511 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5513 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5515 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5517 hlpSS2.str ( std::string ( ) );
5518 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->octaSymm.at(0).at(0)[4] ), prec );
5519 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5523 if ( static_cast<int> ( this->icosElems.size() ) > 0 )
5525 std::stringstream hlpSS2;
5527 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5529 hlpSS2.str ( std::string ( ) );
5531 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5533 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5535 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5537 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5539 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5541 hlpSS2.str ( std::string ( ) );
5542 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->icosSymm.at(0).at(0)[4] ), prec );
5543 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5569 printf (
"-----------------------------------------------------------\n" );
5570 printf (
"| RESULTS |\n" );
5571 printf (
"-----------------------------------------------------------\n\n" );
5574 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->icosElems.size() ) == 0 ) )
5576 printf (
"This appears like icosahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely.\n\n" );
5579 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
5581 printf (
"Detected Icosahedral symmetry\n\n" );
5582 printf (
"Symmetry axes table:\n" );
5583 printf (
"-----------------------------------------------------------\n" );
5584 printf (
"Symmetry Fold x y z Angle Peak\n" );
5585 printf (
" Type height\n" );
5586 printf (
"-----------------------------------------------------------\n" );
5588 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5590 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->icosAxes.at(icoIt)[0] ), this->icosAxes.at(icoIt)[1], this->icosAxes.at(icoIt)[2], this->icosAxes.at(icoIt)[3],
static_cast<int> ( this->icosAxes.at(icoIt)[0] ), this->icosAxes.at(icoIt)[4] );
5594 printf (
"Symmetry elements table:\n" );
5595 printf (
"-----------------------------------------------------------\n" );
5596 printf (
"Symmetry x y z Angle \n" );
5597 printf (
" Type (deg) \n" );
5598 printf (
"-----------------------------------------------------------\n" );
5600 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
5602 if ( this->icosElems.at(icoIt)[0] != 1.0 )
5604 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->icosElems.at(icoIt)[0] ), this->icosElems.at(icoIt)[1], this->icosElems.at(icoIt)[2], this->icosElems.at(icoIt)[3], this->icosElems.at(icoIt)[4] );
5608 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->icosElems.at(icoIt)[1], this->icosElems.at(icoIt)[2], this->icosElems.at(icoIt)[3], this->icosElems.at(icoIt)[4] );
5615 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
5617 printf (
"This appears like octahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely.\n\n" );
5620 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) > 0 ) )
5622 printf (
"Detected (Cub)octahedral symmetry\n\n" );
5623 printf (
"Symmetry axes table:\n" );
5624 printf (
"-----------------------------------------------------------\n" );
5625 printf (
"Symmetry Fold x y z Angle Peak\n" );
5626 printf (
" Type height\n" );
5627 printf (
"-----------------------------------------------------------\n" );
5629 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaAxes.size() ); octIt++ )
5631 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->octaAxes.at(octIt)[0] ), this->octaAxes.at(octIt)[1], this->octaAxes.at(octIt)[2], this->octaAxes.at(octIt)[3],
static_cast<int> ( this->octaAxes.at(octIt)[0] ), this->octaAxes.at(octIt)[4] );
5635 printf (
"Symmetry elements table:\n" );
5636 printf (
"-----------------------------------------------------------\n" );
5637 printf (
"Symmetry x y z Angle \n" );
5638 printf (
" Type (deg) \n" );
5639 printf (
"-----------------------------------------------------------\n" );
5641 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaElems.size() ); octIt++ )
5643 if ( this->octaElems.at(octIt)[0] != 1.0 )
5645 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->octaElems.at(octIt)[0] ), this->octaElems.at(octIt)[1], this->octaElems.at(octIt)[2], this->octaElems.at(octIt)[3], this->octaElems.at(octIt)[4] );
5649 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->octaElems.at(octIt)[1], this->octaElems.at(octIt)[2], this->octaElems.at(octIt)[3], this->octaElems.at(octIt)[4] );
5656 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->tetrElems.size() ) == 0 ) )
5658 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
5660 printf (
"This appears like tetrahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely.\n\n" );
5664 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
5666 printf (
"Detected Tetrahedral symmetry\n\n" );
5667 printf (
"Symmetry axes table:\n" );
5668 printf (
"-----------------------------------------------------------\n" );
5669 printf (
"Symmetry Fold x y z Angle Peak\n" );
5670 printf (
" Type height\n" );
5671 printf (
"-----------------------------------------------------------\n" );
5673 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrAxes.size() ); tetIt++ )
5675 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->tetrAxes.at(tetIt)[0] ), this->tetrAxes.at(tetIt)[1], this->tetrAxes.at(tetIt)[2], this->tetrAxes.at(tetIt)[3],
static_cast<int> ( this->tetrAxes.at(tetIt)[0] ), this->tetrAxes.at(tetIt)[4] );
5679 printf (
"Symmetry elements table:\n" );
5680 printf (
"-----------------------------------------------------------\n" );
5681 printf (
"Symmetry x y z Angle \n" );
5682 printf (
" Type (deg) \n" );
5683 printf (
"-----------------------------------------------------------\n" );
5685 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrElems.size() ); tetIt++ )
5687 if ( this->tetrElems.at(tetIt)[0] != 1.0 )
5689 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->tetrElems.at(tetIt)[0] ), this->tetrElems.at(tetIt)[1], this->tetrElems.at(tetIt)[2], this->tetrElems.at(tetIt)[3], this->tetrElems.at(tetIt)[4] );
5693 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", this->tetrElems.at(tetIt)[1], this->tetrElems.at(tetIt)[2], this->tetrElems.at(tetIt)[3], this->tetrElems.at(tetIt)[4] );
5700 if ( static_cast<unsigned int> ( this->dnSymmClear.size() ) > 0 )
5702 printf (
"Detected Dihedral symmetry\n\n" );
5703 printf (
"Symmetry axes table:\n" );
5704 printf (
"-----------------------------------------------------------\n" );
5705 printf (
"Symmetry Fold x y z Angle Peak\n" );
5706 printf (
" Type height\n" );
5707 printf (
"-----------------------------------------------------------\n" );
5708 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymmClear.at(0).at(0)[0] ), this->dnSymmClear.at(0).at(0)[1], this->dnSymmClear.at(0).at(0)[2], this->dnSymmClear.at(0).at(0)[3],
static_cast<int> ( this->dnSymmClear.at(0).at(0)[0] ), this->dnSymmClear.at(0).at(0)[4] );
5709 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n\n", static_cast<int> ( this->dnSymmClear.at(0).at(1)[0] ), this->dnSymmClear.at(0).at(1)[1], this->dnSymmClear.at(0).at(1)[2], this->dnSymmClear.at(0).at(1)[3],
static_cast<int> ( this->dnSymmClear.at(0).at(1)[0] ), this->dnSymmClear.at(0).at(1)[4] );
5713 printf (
"Symmetry elements table:\n" );
5714 printf (
"-----------------------------------------------------------\n" );
5715 printf (
"Symmetry x y z Angle \n" );
5716 printf (
" Type (deg) \n" );
5717 printf (
"-----------------------------------------------------------\n" );
5719 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
5720 for (
unsigned int it = 0; it < 2; it++ )
5722 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
5724 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
5726 if ( iter == 0 ) {
continue; }
5727 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
5728 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ), this->dnSymmClear.at(0).at(it)[1], this->dnSymmClear.at(0).at(it)[2], this->dnSymmClear.at(0).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymmClear.at(0).at(it)[0] ) ) );
5733 for (
int iter = -std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
5735 if ( iter == 0 ) {
continue; }
5736 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ), this->dnSymmClear.at(0).at(it)[1], this->dnSymmClear.at(0).at(it)[2], this->dnSymmClear.at(0).at(it)[3], iter * ( 360.0 /
static_cast<double> ( this->dnSymmClear.at(0).at(it)[0] ) ) );
5745 if ( static_cast<unsigned int> ( this->cnSymmClear.size() ) > 0 )
5747 printf (
"Detected Cyclic symmetry\n\n" );
5748 printf (
"Symmetry axes table:\n" );
5749 printf (
"-----------------------------------------------------------\n" );
5750 printf (
"Symmetry Fold x y z Angle Peak\n" );
5751 printf (
" Type height\n" );
5752 printf (
"-----------------------------------------------------------\n" );
5753 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n\n", static_cast<int> ( this->cnSymmClear.at(0)[0] ), this->cnSymmClear.at(0)[1], this->cnSymmClear.at(0)[2], this->cnSymmClear.at(0)[3],
static_cast<int> ( this->cnSymmClear.at(0)[0] ), static_cast<double> ( this->cnSymmClear.at(0)[4] ) );
5757 printf (
"Symmetry elements table:\n" );
5758 printf (
"-----------------------------------------------------------\n" );
5759 printf (
"Symmetry x y z Angle \n" );
5760 printf (
" Type (deg) \n" );
5761 printf (
"-----------------------------------------------------------\n" );
5763 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
5764 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
5766 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
5768 if ( iter == 0 ) {
continue; }
5769 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
5770 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->cnSymmClear.at(0)[0] ), this->cnSymmClear.at(0)[1], this->cnSymmClear.at(0)[2], this->cnSymmClear.at(0)[3], iter * ( 360.0 /
static_cast<double> ( this->cnSymmClear.at(0)[0] ) ) );
5775 for (
int iter = -std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
5777 if ( iter == 0 ) {
continue; }
5778 printf (
" C%d %+.2f %+.2f %+.2f %+.1f \n", static_cast<int> ( this->cnSymmClear.at(0)[0] ), this->cnSymmClear.at(0)[1], this->cnSymmClear.at(0)[2], this->cnSymmClear.at(0)[3], iter * ( 360.0 /
static_cast<double> ( this->cnSymmClear.at(0)[0] ) ) );
5785 printf (
"Detected no symmetry.\n\n" );
5793 printf (
"Alternatives:\n" );
5794 printf (
"-----------------------------------------------------------\n" );
5795 printf (
"Symmetry Fold x y z Angle Peak\n" );
5796 printf (
" Type height\n" );
5797 printf (
"-----------------------------------------------------------\n" );
5798 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5800 printf (
" C %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->cnSymm.at(gNo)[0] ), this->cnSymm.at(gNo)[1], this->cnSymm.at(gNo)[2], this->cnSymm.at(gNo)[3],
static_cast<int> ( this->cnSymm.at(gNo)[0] ), static_cast<double> ( this->cnSymm.at(gNo)[4] ) );
5803 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5805 printf (
" D %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ), this->dnSymm.at(iter).at(0)[1], this->dnSymm.at(iter).at(0)[2], this->dnSymm.at(iter).at(0)[3],
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ), this->dnSymm.at(iter).at(0)[5] );
5807 for (
unsigned int mem = 1; mem < static_cast<unsigned int> ( this->dnSymm.at(iter).size() ); mem++ )
5809 printf (
" %d %+.2f %+.2f %+.2f 2pi / %d %+.3f\n", static_cast<int> ( this->dnSymm.at(iter).at(mem)[0] ), this->dnSymm.at(iter).at(mem)[1], this->dnSymm.at(iter).at(mem)[2], this->dnSymm.at(iter).at(mem)[3],
static_cast<int> ( this->dnSymm.at(iter).at(mem)[0] ), this->dnSymm.at(iter).at(mem)[5] );
5813 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
5836 rvapi_add_section (
"ReviewSection",
5846 std::stringstream hlpSS;
5847 hlpSS <<
"<pre>" <<
"Requested symmetry : " <<
"N/A" <<
"</pre>";
5848 rvapi_set_text ( hlpSS.str().c_str(),
5855 hlpSS.str ( std::string ( ) );
5856 hlpSS <<
"<pre>" <<
"Input structure : " << this->structFiles.at(0) <<
"</pre>";
5857 rvapi_set_text ( hlpSS.str().c_str(),
5866 rvapi_add_section (
"ResultsSection",
5879 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) == 0 ) )
5882 std::stringstream hlpSS;
5883 hlpSS <<
"<b><font color=\"orange\">" <<
"This appears like icosahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely." <<
"</font></b>";
5884 rvapi_set_text ( hlpSS.str().c_str(),
5893 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
5896 std::stringstream hlpSS;
5897 hlpSS <<
"<b>" <<
"Detected <i>ICOSAHEDRAL</i> symmetry." <<
"</b>";
5898 rvapi_set_text ( hlpSS.str().c_str(),
5907 rvapi_add_table (
"SymmetryTypeTable",
5908 "Detected symmetry axes",
5912 static_cast<unsigned int> ( this->icosAxes.size() ),
5919 hlpSS.str ( std::string ( ) );
5920 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
5921 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
5924 hlpSS.str ( std::string ( ) );
5925 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
5926 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
5929 hlpSS.str ( std::string ( ) );
5930 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5931 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5934 hlpSS.str ( std::string ( ) );
5935 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5936 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5939 hlpSS.str ( std::string ( ) );
5940 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5941 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5944 hlpSS.str ( std::string ( ) );
5945 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5946 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5949 hlpSS.str ( std::string ( ) );
5950 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
5951 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
5955 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5957 std::stringstream hlpSS2;
5958 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
5959 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
5964 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5966 std::stringstream hlpSS2;
5968 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
5970 hlpSS2.str ( std::string ( ) );
5971 hlpSS2 << static_cast<int> ( this->icosAxes.at(icoIt)[0] );
5972 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
5974 hlpSS2.str ( std::string ( ) );
5975 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[1], prec );
5976 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
5978 hlpSS2.str ( std::string ( ) );
5979 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[2], prec );
5980 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
5982 hlpSS2.str ( std::string ( ) );
5983 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[3], prec );
5984 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
5986 hlpSS2.str ( std::string ( ) );
5987 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->icosAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
5988 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
5990 hlpSS2.str ( std::string ( ) );
5991 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[4], prec );
5992 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
5996 rvapi_add_table (
"SymmetryElementsTable",
5997 "Detected symmetry elements",
5999 static_cast<unsigned int> ( this->icosAxes.size() ) + 2,
6001 static_cast<unsigned int> ( this->icosElems.size() ),
6004 totTabRows =
static_cast<unsigned int> ( this->icosAxes.size() ) + 2 + static_cast<unsigned int> ( this->icosElems.size() );
6009 hlpSS.str ( std::string ( ) );
6010 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6011 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6014 hlpSS.str ( std::string ( ) );
6015 hlpSS <<
"This column states the symmetry element fold.";
6016 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6019 hlpSS.str ( std::string ( ) );
6020 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6021 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6024 hlpSS.str ( std::string ( ) );
6025 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6026 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6029 hlpSS.str ( std::string ( ) );
6030 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6031 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6034 hlpSS.str ( std::string ( ) );
6035 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6036 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6040 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
6042 std::stringstream hlpSS2;
6043 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6044 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6048 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
6050 if ( this->icosElems.at(icoIt)[0] != 1.0 )
6052 std::stringstream hlpSS3;
6054 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6058 std::stringstream hlpSS3;
6060 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6063 std::stringstream hlpSS2;
6064 hlpSS2 << static_cast<int> ( this->icosElems.at(icoIt)[0] );
6065 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
6067 hlpSS2.str ( std::string ( ) );
6068 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[1], prec );
6069 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
6071 hlpSS2.str ( std::string ( ) );
6072 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[2], prec );
6073 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
6075 hlpSS2.str ( std::string ( ) );
6076 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[3], prec );
6077 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
6079 hlpSS2.str ( std::string ( ) );
6080 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[4], prec );
6081 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
6088 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
6091 std::stringstream hlpSS;
6092 hlpSS <<
"<b><font color=\"orange\">" <<
"This appears like octahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely." <<
"</font></b>";
6093 rvapi_set_text ( hlpSS.str().c_str(),
6102 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) )
6105 std::stringstream hlpSS;
6106 hlpSS <<
"<b>" <<
"Detected <i>OCTAHEDRAL</i> symmetry." <<
"</b>";
6107 rvapi_set_text ( hlpSS.str().c_str(),
6116 rvapi_add_table (
"SymmetryTypeTable",
6117 "Detected symmetry axes",
6121 static_cast<unsigned int> ( this->octaAxes.size() ),
6128 hlpSS.str ( std::string ( ) );
6129 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6130 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6133 hlpSS.str ( std::string ( ) );
6134 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6135 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6138 hlpSS.str ( std::string ( ) );
6139 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6140 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6143 hlpSS.str ( std::string ( ) );
6144 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6145 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6148 hlpSS.str ( std::string ( ) );
6149 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6150 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6153 hlpSS.str ( std::string ( ) );
6154 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6155 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6158 hlpSS.str ( std::string ( ) );
6159 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
6160 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6164 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
6166 std::stringstream hlpSS2;
6167 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
6168 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
6173 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
6175 std::stringstream hlpSS2;
6177 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6179 hlpSS2.str ( std::string ( ) );
6180 hlpSS2 << static_cast<int> ( this->octaAxes.at(icoIt)[0] );
6181 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6183 hlpSS2.str ( std::string ( ) );
6184 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[1], prec );
6185 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6187 hlpSS2.str ( std::string ( ) );
6188 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[2], prec );
6189 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6191 hlpSS2.str ( std::string ( ) );
6192 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[3], prec );
6193 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6195 hlpSS2.str ( std::string ( ) );
6196 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->octaAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
6197 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6199 hlpSS2.str ( std::string ( ) );
6200 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[4], prec );
6201 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6205 rvapi_add_table (
"SymmetryElementsTable",
6206 "Detected symmetry elements",
6208 static_cast<unsigned int> ( this->octaAxes.size() ) + 2,
6210 static_cast<unsigned int> ( this->octaElems.size() ),
6213 totTabRows =
static_cast<unsigned int> ( this->octaAxes.size() ) + 2 + static_cast<unsigned int> ( this->octaElems.size() );
6218 hlpSS.str ( std::string ( ) );
6219 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6220 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6223 hlpSS.str ( std::string ( ) );
6224 hlpSS <<
"This column states the symmetry element fold.";
6225 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6228 hlpSS.str ( std::string ( ) );
6229 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6230 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6233 hlpSS.str ( std::string ( ) );
6234 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6235 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6238 hlpSS.str ( std::string ( ) );
6239 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6240 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6243 hlpSS.str ( std::string ( ) );
6244 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6245 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6249 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
6251 std::stringstream hlpSS2;
6252 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6253 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6257 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
6259 if ( this->octaElems.at(icoIt)[0] != 1.0 )
6261 std::stringstream hlpSS3;
6263 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6267 std::stringstream hlpSS3;
6269 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6272 std::stringstream hlpSS2;
6273 hlpSS2 << static_cast<int> ( this->octaElems.at(icoIt)[0] );
6274 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
6276 hlpSS2.str ( std::string ( ) );
6277 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[1], prec );
6278 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
6280 hlpSS2.str ( std::string ( ) );
6281 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[2], prec );
6282 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
6284 hlpSS2.str ( std::string ( ) );
6285 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[3], prec );
6286 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
6288 hlpSS2.str ( std::string ( ) );
6289 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[4], prec );
6290 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
6297 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) == 0 ) )
6300 std::stringstream hlpSS;
6301 hlpSS <<
"<b><font color=\"orange\">" <<
"This appears like tetrahedral symmetry, but not all axes could be detected. Maybe decreasing resolution or relaxing the peak similarity requirement would improve the detection. Proceeding this what was detected completely." <<
"</font></b>";
6302 rvapi_set_text ( hlpSS.str().c_str(),
6312 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
6315 std::stringstream hlpSS;
6316 hlpSS <<
"<b>" <<
"Detected <i>TETRAHEDRAL</i> symmetry." <<
"</b>";
6317 rvapi_set_text ( hlpSS.str().c_str(),
6326 rvapi_add_table (
"SymmetryTypeTable",
6327 "Detected symmetry axes",
6331 static_cast<unsigned int> ( this->tetrAxes.size() ),
6338 hlpSS.str ( std::string ( ) );
6339 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6340 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6343 hlpSS.str ( std::string ( ) );
6344 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6345 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6348 hlpSS.str ( std::string ( ) );
6349 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6350 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6353 hlpSS.str ( std::string ( ) );
6354 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6355 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6358 hlpSS.str ( std::string ( ) );
6359 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6360 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6363 hlpSS.str ( std::string ( ) );
6364 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6365 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6368 hlpSS.str ( std::string ( ) );
6369 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
6370 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6374 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
6376 std::stringstream hlpSS2;
6377 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
6378 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
6383 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
6385 std::stringstream hlpSS2;
6387 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6389 hlpSS2.str ( std::string ( ) );
6390 hlpSS2 << static_cast<int> ( this->tetrAxes.at(icoIt)[0] );
6391 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6393 hlpSS2.str ( std::string ( ) );
6394 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[1], prec );
6395 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6397 hlpSS2.str ( std::string ( ) );
6398 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[2], prec );
6399 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6401 hlpSS2.str ( std::string ( ) );
6402 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[3], prec );
6403 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6405 hlpSS2.str ( std::string ( ) );
6406 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->tetrAxes.at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
6407 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6409 hlpSS2.str ( std::string ( ) );
6410 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[4], prec );
6411 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6415 rvapi_add_table (
"SymmetryElementsTable",
6416 "Detected symmetry elements",
6418 static_cast<unsigned int> ( this->tetrAxes.size() ) + 2,
6420 static_cast<unsigned int> ( this->tetrElems.size() ),
6423 totTabRows =
static_cast<unsigned int> ( this->tetrAxes.size() ) + 2 + static_cast<unsigned int> ( this->tetrElems.size() );
6428 hlpSS.str ( std::string ( ) );
6429 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6430 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6433 hlpSS.str ( std::string ( ) );
6434 hlpSS <<
"This column states the symmetry element fold.";
6435 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6438 hlpSS.str ( std::string ( ) );
6439 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6440 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6443 hlpSS.str ( std::string ( ) );
6444 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6445 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6448 hlpSS.str ( std::string ( ) );
6449 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6450 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6453 hlpSS.str ( std::string ( ) );
6454 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6455 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6459 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
6461 std::stringstream hlpSS2;
6462 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6463 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6467 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
6469 std::stringstream hlpSS3;
6470 if ( this->tetrElems.at(icoIt)[0] != 1.0 )
6472 std::stringstream hlpSS2;
6474 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
6478 std::stringstream hlpSS2;
6480 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
6483 hlpSS3.str ( std::string ( ) );
6484 hlpSS3 << static_cast<int> ( this->tetrElems.at(icoIt)[0] );
6485 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 1 );
6487 hlpSS3.str ( std::string ( ) );
6488 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[1], prec );
6489 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 2 );
6491 hlpSS3.str ( std::string ( ) );
6492 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[2], prec );
6493 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 3 );
6495 hlpSS3.str ( std::string ( ) );
6496 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[3], prec );
6497 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 4 );
6499 hlpSS3.str ( std::string ( ) );
6500 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[4], prec );
6501 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 5 );
6508 if ( ( static_cast<unsigned int> ( this->dnSymmClear.size() ) > 0 ) && ( settings->
htmlReport ) )
6511 std::stringstream hlpSS;
6512 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry." <<
"</b>";
6513 rvapi_set_text ( hlpSS.str().c_str(),
6522 rvapi_add_table (
"SymmetryTypeTable",
6523 "Detected symmetry axes",
6534 hlpSS.str ( std::string ( ) );
6535 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6536 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6539 hlpSS.str ( std::string ( ) );
6540 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6541 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6544 hlpSS.str ( std::string ( ) );
6545 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6546 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6549 hlpSS.str ( std::string ( ) );
6550 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6551 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6554 hlpSS.str ( std::string ( ) );
6555 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6556 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6559 hlpSS.str ( std::string ( ) );
6560 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6561 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6564 hlpSS.str ( std::string ( ) );
6565 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
6566 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6570 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymmClear.at(0).size() ); icoIt++ )
6572 hlpSS.str ( std::string ( ) );
6573 hlpSS <<
"Symmetry axis #" << icoIt+1;
6574 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", icoIt );
6579 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymmClear.at(0).size() ); icoIt++ )
6581 std::stringstream hlpSS2;
6583 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6585 hlpSS2.str ( std::string ( ) );
6586 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(icoIt)[0] );
6587 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6589 hlpSS2.str ( std::string ( ) );
6590 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[1], prec );
6591 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6593 hlpSS2.str ( std::string ( ) );
6594 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[2], prec );
6595 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6597 hlpSS2.str ( std::string ( ) );
6598 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[3], prec );
6599 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6601 hlpSS2.str ( std::string ( ) );
6602 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->dnSymmClear.at(0).at(icoIt)[0] ) ) * ( 180.0 / M_PI ), prec );
6603 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6605 hlpSS2.str ( std::string ( ) );
6606 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[4], prec );
6607 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6612 for (
unsigned int it = 0; it < 2; it++ )
6614 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
6616 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
6618 if ( iter == 0 ) {
continue; }
6619 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
6626 for (
int iter = -std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
6628 if ( iter == 0 ) {
continue; }
6635 totTabRows =
static_cast<unsigned int> ( totRows ) + 6;
6637 rvapi_add_table (
"SymmetryElementsTable",
6638 "Detected symmetry elements",
6649 hlpSS.str ( std::string ( ) );
6650 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6651 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6654 hlpSS.str ( std::string ( ) );
6655 hlpSS <<
"This column states the symmetry element fold.";
6656 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6659 hlpSS.str ( std::string ( ) );
6660 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6661 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6664 hlpSS.str ( std::string ( ) );
6665 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6666 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6669 hlpSS.str ( std::string ( ) );
6670 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6671 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6674 hlpSS.str ( std::string ( ) );
6675 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6676 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6680 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
6682 std::stringstream hlpSS2;
6683 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6684 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6690 hlpSS.str ( std::string ( ) );
6692 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
6694 hlpSS.str ( std::string ( ) );
6695 hlpSS << static_cast<int> ( 1 );
6696 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
6698 hlpSS.str ( std::string ( ) );
6699 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
6700 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
6702 hlpSS.str ( std::string ( ) );
6703 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6704 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
6706 hlpSS.str ( std::string ( ) );
6707 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6708 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
6710 hlpSS.str ( std::string ( ) );
6711 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6712 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
6714 for (
unsigned int it = 0; it < 2; it++ )
6716 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
6718 for (
int iter = -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
6720 if ( iter == 0 ) {
continue; }
6721 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
6723 std::stringstream hlpSS2;
6725 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
6727 hlpSS2.str ( std::string ( ) );
6728 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] );
6729 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
6731 hlpSS2.str ( std::string ( ) );
6732 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[1], prec );
6733 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
6735 hlpSS2.str ( std::string ( ) );
6736 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[2], prec );
6737 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
6739 hlpSS2.str ( std::string ( ) );
6740 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[3], prec );
6741 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
6743 hlpSS2.str ( std::string ( ) );
6744 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymmClear.at(0).at(it)[0] ) ), prec );
6745 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
6751 for (
int iter = -std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ); iter++ )
6753 if ( iter == 0 ) {
continue; }
6755 std::stringstream hlpSS2;
6757 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
6759 hlpSS2.str ( std::string ( ) );
6760 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] );
6761 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
6763 hlpSS2.str ( std::string ( ) );
6764 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[1], prec );
6765 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
6767 hlpSS2.str ( std::string ( ) );
6768 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[2], prec );
6769 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
6771 hlpSS2.str ( std::string ( ) );
6772 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[3], prec );
6773 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
6775 hlpSS2.str ( std::string ( ) );
6776 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->dnSymmClear.at(0).at(it)[0] ) ), prec );
6777 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
6787 if ( ( static_cast<unsigned int> ( this->cnSymmClear.size() ) > 0 ) && ( settings->
htmlReport ) )
6790 std::stringstream hlpSS;
6791 hlpSS <<
"<b>" <<
"Detected <i>CYCLIC</i> symmetry." <<
"</b>";
6792 rvapi_set_text ( hlpSS.str().c_str(),
6801 rvapi_add_table (
"SymmetryTypeTable",
6802 "Detected symmetry axes",
6813 hlpSS.str ( std::string ( ) );
6814 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6815 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6818 hlpSS.str ( std::string ( ) );
6819 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6820 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6823 hlpSS.str ( std::string ( ) );
6824 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6825 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6828 hlpSS.str ( std::string ( ) );
6829 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6830 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6833 hlpSS.str ( std::string ( ) );
6834 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6835 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6838 hlpSS.str ( std::string ( ) );
6839 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6840 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6843 hlpSS.str ( std::string ( ) );
6844 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
6845 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6849 hlpSS.str ( std::string ( ) );
6850 hlpSS <<
"Symmetry axis #" << 1;
6851 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", 0 );
6855 hlpSS.str ( std::string ( ) );
6857 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 0 );
6859 hlpSS.str ( std::string ( ) );
6860 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
6861 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 1 );
6863 hlpSS.str ( std::string ( ) );
6864 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
6865 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 2 );
6867 hlpSS.str ( std::string ( ) );
6868 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
6869 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 3 );
6871 hlpSS.str ( std::string ( ) );
6872 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
6873 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 4 );
6875 hlpSS.str ( std::string ( ) );
6876 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->cnSymmClear.at(0)[0] ) ) * ( 180.0 / M_PI ), prec );
6877 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 5 );
6879 hlpSS.str ( std::string ( ) );
6880 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[4], prec );
6881 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 6 );
6885 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
6887 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
6889 if ( iter == 0 ) {
continue; }
6890 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
6897 for (
int iter = -std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
6899 if ( iter == 0 ) {
continue; }
6905 totTabRows =
static_cast<unsigned int> ( totRows ) + 5;
6907 rvapi_add_table (
"SymmetryElementsTable",
6908 "Detected symmetry elements",
6919 hlpSS.str ( std::string ( ) );
6920 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6921 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6924 hlpSS.str ( std::string ( ) );
6925 hlpSS <<
"This column states the symmetry element fold.";
6926 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6929 hlpSS.str ( std::string ( ) );
6930 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6931 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6934 hlpSS.str ( std::string ( ) );
6935 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6936 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6939 hlpSS.str ( std::string ( ) );
6940 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6941 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6944 hlpSS.str ( std::string ( ) );
6945 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6946 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6950 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
6952 std::stringstream hlpSS2;
6953 hlpSS2 <<
"Symmetry element #" << std::to_string ( icoIt+1 );
6954 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6960 hlpSS.str ( std::string ( ) );
6962 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
6964 hlpSS.str ( std::string ( ) );
6965 hlpSS << static_cast<int> ( 1 );
6966 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
6968 hlpSS.str ( std::string ( ) );
6969 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
6970 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
6972 hlpSS.str ( std::string ( ) );
6973 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6974 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
6976 hlpSS.str ( std::string ( ) );
6977 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6978 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
6980 hlpSS.str ( std::string ( ) );
6981 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6982 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
6984 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
6986 for (
int iter = -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
6988 if ( iter == 0 ) {
continue; }
6989 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
6991 hlpSS.str ( std::string ( ) );
6993 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
6995 hlpSS.str ( std::string ( ) );
6996 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
6997 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
6999 hlpSS.str ( std::string ( ) );
7000 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
7001 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
7003 hlpSS.str ( std::string ( ) );
7004 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
7005 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
7007 hlpSS.str ( std::string ( ) );
7008 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
7009 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
7011 hlpSS.str ( std::string ( ) );
7012 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->cnSymmClear.at(0)[0] ) ), prec );
7013 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
7019 for (
int iter = -std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter <= std::floor( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ); iter++ )
7021 if ( iter == 0 ) {
continue; }
7023 hlpSS.str ( std::string ( ) );
7025 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
7027 hlpSS.str ( std::string ( ) );
7028 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
7029 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
7031 hlpSS.str ( std::string ( ) );
7032 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
7033 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
7035 hlpSS.str ( std::string ( ) );
7036 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
7037 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
7039 hlpSS.str ( std::string ( ) );
7040 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
7041 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
7043 hlpSS.str ( std::string ( ) );
7044 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( iter * ( 360.0 / static_cast<double> ( this->cnSymmClear.at(0)[0] ) ), prec );
7045 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
7054 printf (
"Detected no symmetry.\n\n" );
7062 rvapi_add_table (
"AlternativesTable",
7063 "Alternative Symmetries Detected",
7067 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ),
7074 std::stringstream hlpSS;
7075 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D).";
7076 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
7079 hlpSS.str ( std::string ( ) );
7080 hlpSS <<
"This column states the symmetry fold.";
7081 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
7084 hlpSS.str ( std::string ( ) );
7085 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
7086 rvapi_put_horz_theader (
"AlternativesTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
7089 hlpSS.str ( std::string ( ) );
7090 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
7091 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
7094 hlpSS.str ( std::string ( ) );
7095 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
7096 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
7099 hlpSS.str ( std::string ( ) );
7100 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
7101 rvapi_put_horz_theader (
"AlternativesTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
7104 hlpSS.str ( std::string ( ) );
7105 hlpSS <<
"This column states the average peak height (correlation after rotation) for all the symmetry rotations. The closer this number is to 1.0, the more reliable the symmetry existence is.";
7106 rvapi_put_horz_theader (
"AlternativesTable",
"Peak Height", hlpSS.str().c_str(), columnIter );
7111 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
7113 std::stringstream hlpSS2;
7114 hlpSS2 <<
"Alternative Symmetry #" << gNo+1;
7115 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", gNo );
7118 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
7120 std::stringstream hlpSS2;
7121 hlpSS2 <<
"Alternative Symmetry #" << iter + maxCAlts + 2;
7122 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", iter + maxCAlts + 1 );
7127 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
7129 std::stringstream hlpSS2;
7131 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
7133 hlpSS2.str ( std::string ( ) );
7134 hlpSS2 << static_cast<int> (
static_cast<int> ( this->cnSymm.at(gNo)[0] ) );
7135 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
7137 hlpSS2.str ( std::string ( ) );
7138 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[1], prec );
7139 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
7141 hlpSS2.str ( std::string ( ) );
7142 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[2], prec );
7143 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
7145 hlpSS2.str ( std::string ( ) );
7146 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[3], prec );
7147 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
7149 hlpSS2.str ( std::string ( ) );
7150 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->cnSymm.at(gNo)[0] ) ) * ( 180.0 / M_PI ), prec );
7151 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
7153 hlpSS2.str ( std::string ( ) );
7154 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->cnSymm.at(gNo)[4] ), prec );
7155 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
7159 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
7161 std::stringstream hlpSS2;
7163 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
7165 hlpSS2.str ( std::string ( ) );
7166 hlpSS2 << static_cast<int> (
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ) );
7167 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
7169 hlpSS2.str ( std::string ( ) );
7170 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[1], prec );
7171 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
7173 hlpSS2.str ( std::string ( ) );
7174 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[2], prec );
7175 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
7177 hlpSS2.str ( std::string ( ) );
7178 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[3], prec );
7179 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
7181 hlpSS2.str ( std::string ( ) );
7182 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( ( ( 2.0 * M_PI ) / static_cast<double> ( this->dnSymm.at(iter).at(0)[0] ) ) * ( 180.0 / M_PI ), prec );
7183 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
7185 hlpSS2.str ( std::string ( ) );
7186 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->dnSymm.at(iter).at(0)[4] ), prec );
7187 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
7221 return ( this->rfPeaks );
7244 return ( this->cnSymm );
7269 return ( this->dnSymm );
7287 this->cmpObj =
nullptr;
7295 std::cout <<
"-----------------------------------------------------------" << std::endl;
7296 std::cout <<
"| MODE: BuildDB |" << std::endl;
7297 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
7300 saveDatabase ( settings );
7304 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
7305 std::cout <<
"| COMPLETED |" << std::endl;
7306 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
7308 std::cout <<
"Database saved to: " << settings->
databaseName << std::endl << std::endl;
7312 std::stringstream hlpSS;
7313 hlpSS <<
"<font color=\"green\">" <<
"Database saved to " << settings->
databaseName <<
" ." <<
"</font>";
7314 rvapi_set_text ( hlpSS.str().c_str(),
7332 compareFragAgainstDatabase ( settings, &settings->
structFiles );
7338 this->theta = settings->
theta;
7339 this->phi = settings->
phi;
7345 this->useCOM = settings->
useCOM;
7348 this->alpha = settings->
alpha;
7349 this->mPower = settings->
mPower;
7350 this->ignoreLs = settings->
ignoreLs;
7354 this->usePhase = settings->
usePhase;
7369 compareAgainstDatabase ( settings, &settings->
structFiles );
7377 this->theta = settings->
theta;
7378 this->phi = settings->
phi;
7384 this->useCOM = settings->
useCOM;
7387 this->alpha = settings->
alpha;
7388 this->mPower = settings->
mPower;
7389 this->ignoreLs = settings->
ignoreLs;
7393 this->usePhase = settings->
usePhase;
7406 std::cerr <<
"!!! ProSHADE ERROR !!! Ambiguity detected. There is a database name supplied, suggesting that you want to compare something against it. However, there is also multiple files supplied, suggesting you want to compare them against each other. Note, that to compare to databse, only a single file can be supplied - this is to remove this ambiguity. Terminating..." << std::endl;
7411 std::stringstream hlpSS;
7412 hlpSS <<
"<font color=\"red\">" <<
"Ambiguity detected. There is a database name supplied, suggesting that you want to compare something against it. However, there is also multiple files supplied, suggesting you want to compare them against each other. Please note that to compare to databse, only a single file can be supplied - this is to remove this ambiguity." <<
"</font>";
7413 rvapi_set_text ( hlpSS.str().c_str(),
7430 this->theta = settings->
theta;
7431 this->phi = settings->
phi;
7437 this->useCOM = settings->
useCOM;
7440 this->alpha = settings->
alpha;
7441 this->mPower = settings->
mPower;
7442 this->ignoreLs = settings->
ignoreLs;
7446 this->usePhase = settings->
usePhase;
7453 if ( !this->energyLevelDist && !this->traceSigmaDist && !this->fullRotFnDist )
7456 std::cerr <<
"!!! ProSHADE ERROR !!! Initialising ProSHADE_distances object with no distances required! Terminating..." << std::endl;
7461 std::stringstream hlpSS;
7462 hlpSS <<
"<font color=\"red\">" <<
"There are no required distances to be computed and therefore nothing to do..." <<
"</font>";
7463 rvapi_set_text ( hlpSS.str().c_str(),
7476 if ( this->structFiles.size() < 2 )
7479 std::cerr <<
"!!! ProSHADE ERROR !!! There are less than two structures submitted to the ProSHADE_distances class, cannot compute distances! Did you forget to supply the database file name? Terminating..." << std::endl;
7484 std::stringstream hlpSS;
7485 hlpSS <<
"<font color=\"red\">" <<
"There are less than two structures submitted to the distance computing functionality." <<
"</font>";
7486 rvapi_set_text ( hlpSS.str().c_str(),
7499 if ( ( this->enLevelsThreshold != -999.9 ) && ( !this->energyLevelDist ) )
7502 std::cerr <<
"!!! ProSHADE ERROR!!! Energy levels descriptor is not required, but its threshold for hierarchical distance computation was set. This makes no sense! Terminating..." << std::endl;
7507 std::stringstream hlpSS;
7508 hlpSS <<
"<font color=\"red\">" <<
"Energy levels descriptor is not required, but its threshold for hierarchical distance computation was set. Either you set these values, in which case please decide what should be done, or you did not, in which case this is an internal bug and in this case please report this case." <<
"</font>";
7509 rvapi_set_text ( hlpSS.str().c_str(),
7522 if ( ( this->trSigmaThreshold != -999.9 ) && ( !this->traceSigmaDist ) )
7525 std::cerr <<
"!!! ProSHADE ERROR !!! Trace sigma descriptor is not required, but its threshold for hierarchical distance computation was set. This makes no sense! Terminating..." << std::endl;
7530 std::stringstream hlpSS;
7531 hlpSS <<
"<font color=\"red\">" <<
"Trace sigma descriptor is not required, but its threshold for hierarchical distance computation was set. Either you set these values, in which case please decide what should be done, or you did not, in which case this is an internal bug and in this case please report this case." <<
"</font>";
7532 rvapi_set_text ( hlpSS.str().c_str(),
7547 std::cout <<
"Finding distances between the structure " << settings->
structFiles.at(0) <<
" against all other structures." << std::endl;
7552 std::cout <<
">>>>>>>> Sanity checks passed." << std::endl;
7558 std::stringstream hlpSS;
7559 hlpSS <<
"<font color=\"green\">" <<
"Sanity checks passed" <<
"</font>";
7560 rvapi_set_text ( hlpSS.str().c_str(),
7573 rvapi_add_section (
"InputFilesSection",
7574 "List of input structures",
7585 std::stringstream hlpSS;
7586 hlpSS <<
"<b>" << settings->
structFiles.at(0) <<
"</b>";
7587 rvapi_set_text ( hlpSS.str().c_str(),
7588 "InputFilesSection",
7594 for (
unsigned int vecIt = 1; vecIt < static_cast<unsigned int> ( this->structFiles.size() ); vecIt++ )
7596 hlpSS.str ( std::string ( ) );
7598 rvapi_set_text ( hlpSS.str().c_str(),
7599 "InputFilesSection",
7611 this->bandwidthVec = std::vector<unsigned int> ( this->structFiles.size(), this->bandwidth );
7612 this->thetaVec = std::vector<unsigned int> ( this->structFiles.size(), this->theta );
7613 this->phiVec = std::vector<unsigned int> ( this->structFiles.size(), this->phi );
7614 this->glIntegOrderVec = std::vector<unsigned int> ( this->structFiles.size(), this->glIntegOrder );
7615 this->extraSpaceVec = std::vector<double> ( this->structFiles.size(), this->extraSpace );
7621 unsigned int fileType =
checkFileType ( structFiles.at(0) );
7622 if ( fileType == 2 )
7624 one->getDensityMapFromMAP ( this->structFiles.at(0),
7625 &this->shellSpacing,
7626 this->mapResolution,
7627 &this->bandwidthVec.at(0),
7628 &this->thetaVec.at(0),
7629 &this->phiVec.at(0),
7630 &this->glIntegOrderVec.at(0),
7631 &this->extraSpaceVec.at(0),
7637 else if ( fileType == 1 )
7639 one->getDensityMapFromPDB ( this->structFiles.at(0),
7640 &this->shellSpacing,
7641 this->mapResolution,
7642 &this->bandwidthVec.at(0),
7643 &this->thetaVec.at(0),
7644 &this->phiVec.at(0),
7645 &this->glIntegOrderVec.at(0),
7646 &this->extraSpaceVec.at(0),
7650 this->firstLineCOM );
7654 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
7659 std::cout <<
">> Structure " << this->structFiles.at(0) <<
" loaded." << std::endl;
7665 std::stringstream hlpSS;
7666 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(0) <<
" loaded." <<
"</font>";
7667 rvapi_set_text ( hlpSS.str().c_str(),
7678 one->normaliseMap ( settings );
7679 if ( this->usePhase )
7681 one->keepPhaseInMap ( this->alpha,
7682 this->bFactorChange,
7683 &this->bandwidthVec.at(0),
7684 &this->thetaVec.at(0),
7685 &this->phiVec.at(0),
7686 &this->glIntegOrderVec.at(0),
7699 one->removePhaseFromMap ( this->alpha,
7700 this->bFactorChange,
7705 one->mapPhaselessToSphere ( settings,
7706 this->thetaVec.at(0),
7709 this->manualShells );
7712 one->getSphericalHarmonicsCoeffs ( this->bandwidthVec.at(0), settings );
7715 if ( this->energyLevelDist )
7717 one->precomputeRotInvDescriptor ( settings );
7722 std::cout <<
">>>>> Structure " << this->structFiles.at(0) <<
" spherical harmonics computed." << std::endl;
7728 std::stringstream hlpSS;
7729 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(0) <<
" spherical harmonics computed." <<
"</font>";
7730 rvapi_set_text ( hlpSS.str().c_str(),
7741 for (
unsigned int vecIt = 1; vecIt < static_cast<unsigned int> ( this->structFiles.size() ); vecIt++ )
7743 this->bandwidthVec.at(vecIt) = this->bandwidthVec.at(0);
7744 this->thetaVec.at(vecIt) = this->thetaVec.at(0);
7745 this->phiVec.at(vecIt) = this->phiVec.at(0);
7746 this->glIntegOrderVec.at(vecIt) = this->glIntegOrderVec.at(0);
7747 this->extraSpaceVec.at(vecIt) = this->extraSpaceVec.at(0);
7751 std::vector<ProSHADE_data*> objs ( this->structFiles.size() - 1 );
7752 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( this->structFiles.size() - 1 ); strIt++ )
7759 if ( fileType == 2 )
7761 objs.at(strIt)->getDensityMapFromMAP ( this->structFiles.at(strIt+1),
7762 &this->shellSpacing,
7763 this->mapResolution,
7764 &this->bandwidthVec.at(strIt+1),
7765 &this->thetaVec.at(strIt+1),
7766 &this->phiVec.at(strIt+1),
7767 &this->glIntegOrderVec.at(strIt+1),
7768 &this->extraSpaceVec.at(strIt+1),
7774 else if ( fileType == 1 )
7776 objs.at(strIt)->getDensityMapFromPDB ( this->structFiles.at(strIt+1),
7777 &this->shellSpacing,
7778 this->mapResolution,
7779 &this->bandwidthVec.at(strIt+1),
7780 &this->thetaVec.at(strIt+1),
7781 &this->phiVec.at(strIt+1),
7782 &this->glIntegOrderVec.at(strIt+1),
7783 &this->extraSpaceVec.at(strIt+1),
7787 this->firstLineCOM );
7791 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(strIt+1) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
7797 std::cout <<
">> Structure " << this->structFiles.at(strIt+1) <<
" loaded." << std::endl;
7803 std::stringstream hlpSS;
7804 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(strIt+1) <<
" loaded." <<
"</font>";
7805 rvapi_set_text ( hlpSS.str().c_str(),
7816 objs.at(strIt)->normaliseMap ( settings );
7817 if ( this->usePhase )
7819 objs.at(strIt)->keepPhaseInMap ( this->alpha,
7820 this->bFactorChange,
7821 &this->bandwidthVec.at(strIt+1),
7822 &this->thetaVec.at(strIt+1),
7823 &this->phiVec.at(strIt+1),
7824 &this->glIntegOrderVec.at(strIt+1),
7837 objs.at(strIt)->removePhaseFromMap ( this->alpha,
7838 this->bFactorChange,
7843 objs.at(strIt)->mapPhaselessToSphere ( settings,
7844 this->thetaVec.at(strIt+1),
7845 this->phiVec.at(strIt+1),
7847 this->manualShells );
7850 objs.at(strIt)->getSphericalHarmonicsCoeffs( this->bandwidthVec.at(strIt+1), settings );
7853 if ( this->energyLevelDist )
7855 objs.at(strIt)->precomputeRotInvDescriptor ( settings );
7860 std::cout <<
">>>>> Structure " << this->structFiles.at(strIt+1) <<
" spherical harmonics computed." << std::endl;
7866 std::stringstream hlpSS;
7867 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(strIt+1) <<
" spherical harmonics computed." <<
"</font>";
7868 rvapi_set_text ( hlpSS.str().c_str(),
7883 if ( one->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
7884 else { this->cmpObj->_keepOrRemove =
false; }
7887 if ( this->energyLevelDist )
7891 std::cout <<
"Computing the cross-correlation distances." << std::endl;
7897 std::stringstream hlpSS;
7898 hlpSS <<
"<font color=\"green\">" <<
"Computing the cross-correlation distances." <<
"</font>";
7899 rvapi_set_text ( hlpSS.str().c_str(),
7908 this->energyLevelsDistances = this->cmpObj->getEnergyLevelsDistance ( settings->
verbose, settings );
7911 if ( this->enLevelsThreshold != -999.9 )
7913 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7915 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
7917 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
7921 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7927 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7929 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7935 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7937 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7942 if ( this->traceSigmaDist || this->fullRotFnDist )
7944 this->cmpObj->precomputeTrSigmaDescriptor ( this->shellSpacing, &this->glIntegOrderVec, settings );
7948 if ( this->traceSigmaDist )
7952 std::cout <<
"Computing the trace sigma distances." << std::endl;
7957 std::stringstream hlpSS;
7958 hlpSS <<
"<font color=\"green\">" <<
"Computing the trace sigma distances." <<
"</font>";
7959 rvapi_set_text ( hlpSS.str().c_str(),
7969 this->traceSigmaDistances = this->cmpObj->getTrSigmaDistance ( settings->
verbose, settings );
7971 if ( this->trSigmaThreshold == -999.9 )
7973 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
7977 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
7979 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
7981 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
7985 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
7992 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7994 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
7999 if ( this->fullRotFnDist )
8003 std::cout <<
"Computing the rotation function distances." << std::endl;
8008 std::stringstream hlpSS;
8009 hlpSS <<
"<font color=\"green\">" <<
"Computing the rotation function distances." <<
"</font>";
8010 rvapi_set_text ( hlpSS.str().c_str(),
8020 this->cmpObj->getSO3InverseMap ( settings );
8023 std::cout <<
">>>>> Inverse SO(3) Fourier transform maps obtained." << std::endl;
8026 this->cmpObj->getEulerAngles ( settings );
8029 std::cout <<
">>>>>>>> Optimal Euler angles calculated." << std::endl;
8032 this->cmpObj->generateWignerMatrices ( settings );
8035 std::cout <<
">>>>> Wigner matrices computed." << std::endl;
8038 this->fullRotationDistances = this->cmpObj->getRotCoeffDistance ( settings->
verbose, settings );
8042 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( objs.size() ); iter++ )
8044 if ( objs.at(iter) != nullptr )
8046 delete objs.at(iter);
8064 if ( this->cmpObj !=
nullptr ) {
delete this->cmpObj; }
8080 if ( !this->energyLevelDist )
8082 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The energy level distances were not required when the ProSHADE_distances object was initialised (the setUp structure parameter) and therefore they cannot now be obtained." << std::endl;
8086 if ( this->cmpObj !=
nullptr )
8088 if ( !this->cmpObj->_energyLevelsComputed )
8090 std::cerr <<
" !!! ProSHADE ERROR !!! Error in structure comparison. !!! The energy level distances were not computed before their values are required." << std::endl;
8096 return ( this->energyLevelsDistances );
8113 if ( !this->energyLevelDist )
8115 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The energy level distances were not required when the ProSHADE_distances object was initialised (the setUp structure parameter) and therefore they cannot now be obtained." << std::endl;
8120 return ( this->fragEnergyLevelsDistances );
8139 if ( !this->traceSigmaDist )
8141 std::cerr <<
"!!! ProSHADE ERROR!!! Error in structure comparison. !!! The trace sigma distances were not required when the ProSHADE_distances object was initialised (the setUp structure parameter) and therefore they cannot now be obtained." << std::endl;
8145 if ( this->cmpObj !=
nullptr )
8147 if ( !this->cmpObj->_trSigmaComputed )
8149 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The trace sigma distances were not computed before their values are required." << std::endl;
8155 return ( this->traceSigmaDistances );
8172 if ( !this->cmpObj->_trSigmaComputed )
8174 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The trace sigma distances were not computed before their values are required." << std::endl;
8179 return ( this->fragTraceSigmaDistances );
8198 if ( !this->fullRotFnDist )
8200 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The full rotation function distances were not required when the ProSHADE_distances object was initialised (the setUp structure parameter) and therefore they cannot now be obtained." << std::endl;
8204 if ( this->cmpObj !=
nullptr )
8206 if ( !this->cmpObj->_fullDistComputed )
8208 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The full rotation function distances were not computed before their values are required." << std::endl;
8214 return ( this->fullRotationDistances );
8231 if ( !this->cmpObj->_fullDistComputed )
8233 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The full rotation function distances were not computed before their values are required." << std::endl;
8238 return ( this->fragfullRotationDistances );
8254 this->fragFilesExist =
false;
8255 this->fragFiles.clear ( );
8256 this->one =
nullptr;
8268 std::cout <<
"-----------------------------------------------------------" << std::endl;
8269 std::cout <<
"| MODE: HalfMaps |" << std::endl;
8270 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8276 std::cerr <<
"!!! ProSHADE ERROR !!! Attempted to process half-maps, but did supply ";
8277 if ( settings->
structFiles.size() < 2 ) { std::cerr <<
"less "; }
8278 if ( settings->
structFiles.size() > 2 ) { std::cerr <<
"more "; }
8279 std::cerr <<
"than 2 files. Please use the \'-f\' option to supply only the two half-maps map files. Terminating ..." << std::endl << std::endl;
8283 std::stringstream hlpSS;
8284 hlpSS <<
"<font color=\"red\">" <<
"There are not exactly two input structures. Please supply only two files to the half-maps re-boxing functionality." <<
"</font>";
8285 rvapi_set_text ( hlpSS.str().c_str(),
8300 std::cout <<
"!!! ProSHADE WARNING !!! Missing the file name as to where the new half-maps are to be saved. Will use \"proshade_reboxed_half1.map\" and \"proshade_reboxed_half2.map\", however, if these files already exist, they will be over-written." << std::endl << std::endl;
8305 std::stringstream hlpSS;
8306 hlpSS <<
"<font color=\"orange\">" <<
"Missing the file name as to where the new half-maps are to be saved. Will use 'proshade_reboxed_half1.map' and 'proshade_reboxed_half2.map', however, if these files already exist, they will be over-written." <<
"</font>";
8307 rvapi_set_text ( hlpSS.str().c_str(),
8320 if ( ( fileTy1 != 2 ) || ( fileTy2 != 2 ) )
8322 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot recognise one or both of the half-maps format - are you sure these are in the CCP4 MAP format? Terminating..." << std::endl << std::endl;
8326 std::stringstream hlpSS;
8327 hlpSS <<
"<font color=\"red\">" <<
"Cannot recognise the file format of the input file ";
8329 if ( ( fileTy1 != 2 ) && ( fileTy2 = 2 ) )
8331 hlpSS << settings->
structFiles.at(0) <<
"</font>";
8333 if ( ( fileTy1 = 2 ) && ( fileTy2 != 2 ) )
8335 hlpSS << settings->
structFiles.at(1) <<
"</font>";
8337 if ( ( fileTy1 != 2 ) && ( fileTy2 != 2 ) )
8342 rvapi_set_text ( hlpSS.str().c_str(),
8356 double xTrans, yTrans, zTrans;
8357 dealWithHalfMaps ( settings, &xTrans, &yTrans, &zTrans );
8361 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8362 std::cout <<
"| COMPLETED |" << std::endl;
8363 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8368 std::stringstream hlpSS;
8369 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8370 rvapi_set_text ( hlpSS.str().c_str(),
8382 std::cout <<
"-----------------------------------------------------------" << std::endl;
8383 std::cout <<
"| RESULTS |" << std::endl;
8384 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8386 std::cout <<
"Half maps saved into files:" << std::endl <<
" " << settings->
clearMapFile <<
"_half1.map" << std::endl <<
" " << settings->
clearMapFile <<
"_half2.map" << std::endl << std::endl;
8396 if ( fileType != 2 )
8398 std::cerr <<
"!!! ProSHADE ERROR !!! The file supplied ( " << settings->
structFiles.at(0) <<
" ) is not recognised as a map formatted file. Please check for file corruption and make sure that it is a MAP formatted file. Terminating ..." << std::endl << std::endl;
8402 std::stringstream hlpSS;
8403 hlpSS <<
"<font color=\"red\">" <<
"The file supplied ( " << settings->
structFiles.at(0) <<
" ) is not recognised as a map formatted file. Please check for file corruption and make sure that it is a MAP formatted file." <<
"</font>";
8404 rvapi_set_text ( hlpSS.str().c_str(),
8419 std::cout <<
"!!! ProSHADE WARNING !!! Missing the file name as to where the new re-boxed map is to be saved. Will use \"proshade_reboxed.map\", however, if this file already exists, it will be over-written. To supply the file name, please use the \"--clearMap\" command line option." << std::endl << std::endl;
8424 std::stringstream hlpSS;
8425 hlpSS <<
"<font color=\"orange\">" <<
"Missing the file name as to where the new re-boxed map is to be saved. Will use 'proshade_reboxed.map', however, if this file already exists, it will be over-written." <<
"</font>";
8426 rvapi_set_text ( hlpSS.str().c_str(),
8439 std::cout <<
">>>>>>>> Sanity checks passed." << std::endl;
8444 std::stringstream hlpSS;
8445 hlpSS <<
"<font color=\"green\">" <<
"Sanity checks passed." <<
"</font>";
8446 rvapi_set_text ( hlpSS.str().c_str(),
8462 std::cout <<
"Applying the re-boxing algorithm." << std::endl;
8465 std::array<double,6> dims = one->getDensityMapFromMAPRebox ( settings->
structFiles.at(0),
8477 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8478 std::cout <<
"| COMPLETED |" << std::endl;
8479 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8483 one->writeMap ( settings->
clearMapFile, one->_densityMapCor );
8487 std::cout <<
"The re-boxed map has been saved to the " << settings->
clearMapFile <<
" file." << std::endl << std::endl;
8492 std::stringstream hlpSS;
8493 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8494 rvapi_set_text ( hlpSS.str().c_str(),
8506 rvapi_add_section (
"ResultsSection",
8516 std::stringstream hlpSS;
8517 hlpSS <<
"<pre><b>" <<
"The re-boxed structure is available at: </b>" << settings->
clearMapFile <<
"</pre>";
8518 rvapi_set_text ( hlpSS.str().c_str(),
8525 hlpSS.str ( std::string ( ) );
8526 hlpSS <<
"<pre><b>" <<
"Original structure dims: </b>" << dims[0] <<
" x " << dims[1] <<
" x " << dims[2] <<
"</pre>";
8527 rvapi_set_text ( hlpSS.str().c_str(),
8534 hlpSS.str ( std::string ( ) );
8535 hlpSS <<
"<pre><b>" <<
"Re-boxed structure dims: </b>" << dims[3] <<
" x " << dims[4] <<
" x " << dims[5] <<
"</pre>";
8536 rvapi_set_text ( hlpSS.str().c_str(),
8543 hlpSS.str ( std::string ( ) );
8544 hlpSS <<
"<pre><b>" <<
"New volume as percentage of old volume: </b>" << ( ( dims[3] * dims[4] * dims[5] ) / ( dims[0] * dims[1] * dims[2] ) ) * 100 <<
" %</pre>";
8545 rvapi_set_text ( hlpSS.str().c_str(),
8552 hlpSS.str ( std::string ( ) );
8553 hlpSS <<
"<pre><b>" <<
"Linear processing speed-up: </b>" << ( ( dims[0] * dims[1] * dims[2] ) / ( dims[3] * dims[4] * dims[5] ) ) - 1.0 <<
" times</pre>";
8554 rvapi_set_text ( hlpSS.str().c_str(),
8569 std::cout <<
"-----------------------------------------------------------" << std::endl;
8570 std::cout <<
"| MODE: Features |" << std::endl;
8571 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8575 this->maxMapU = 0.0;
8576 this->maxMapV = 0.0;
8577 this->maxMapW = 0.0;
8587 if ( fileType == 2 )
8591 std::cout <<
"Computing the map features." << std::endl;
8593 one->getDensityMapFromMAPFeatures ( settings->
structFiles.at(0),
8594 &this->minDensPreNorm,
8595 &this->maxDensPreNorm,
8596 &this->minDensPostNorm,
8597 &this->maxDensPostNorm,
8598 &this->postNormMean,
8599 &this->postNormSdev,
8606 &this->maskDensityRMS,
8607 &this->allDensityRMS,
8619 else if ( fileType == 1 )
8621 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << settings->
structFiles.at(0) <<
" !!! Attempted to obtain map features on PDB file. This is not possible - MAP file is required." << std::endl;
8626 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << settings->
structFiles.at(0) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
8632 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8633 std::cout <<
"| COMPLETED |" << std::endl;
8634 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8639 std::stringstream hlpSS;
8640 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8641 rvapi_set_text ( hlpSS.str().c_str(),
8654 one->writeMap ( settings->
clearMapFile, one->_densityMapCor );
8659 rvapi_add_section (
"FilenameSection",
8669 std::stringstream hlpSS;
8670 hlpSS <<
"<pre>" <<
"File saved as: " << settings->
clearMapFile <<
"</pre>";
8671 rvapi_set_text ( hlpSS.str().c_str(),
8696 if ( this->one !=
nullptr )
8714 if ( !this->fragFilesExist )
8716 std::cerr <<
"!!! ProSHADE ERROR !!! Attempted to obtain the list of fragment files without doing the fragmentation first. Terminating..." << std::endl;
8721 return ( this->fragFiles );
8745 void ProSHADE_internal::ProSHADE_data::writeMap ( std::string fileName,
8747 std::string axOrder,
8760 CMap_io::CMMFile *mapFile =
nullptr;
8761 mapFile =
reinterpret_cast<CMap_io::CMMFile*
> ( CMap_io::ccp4_cmap_open ( fileName.c_str() , myMapMode ) );
8762 if ( mapFile == NULL )
8764 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open file " << fileName <<
" for writing. Terminating..." << std::endl;
8769 const char* title =
"ProSHADE genrated map ";
8778 for (
unsigned int iter = 0; iter < 3; iter++ )
8780 if ( axOrder[iter] ==
'x' ) { axisOrder[iter] = 1; }
8781 if ( axOrder[iter] ==
'y' ) { axisOrder[iter] = 2; }
8782 if ( axOrder[iter] ==
'z' ) { axisOrder[iter] = 3; }
8786 if ( std::isinf ( xFrom ) )
8788 xFrom = this->_xFrom;
8789 if ( std::isinf ( xFrom ) )
8791 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8795 if ( std::isinf ( yFrom ) )
8797 yFrom = this->_yFrom;
8798 if ( std::isinf ( yFrom ) )
8800 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8804 if ( std::isinf ( zFrom ) )
8806 zFrom = this->_zFrom;
8807 if ( std::isinf ( zFrom ) )
8809 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8813 if ( std::isinf ( xTo ) )
8816 if ( std::isinf ( xTo ) )
8818 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8822 if ( std::isinf ( yTo ) )
8825 if ( std::isinf ( yTo ) )
8827 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8831 if ( std::isinf ( zTo ) )
8834 if ( std::isinf ( zTo ) )
8836 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8842 grid[axisOrder[0]-1] = xTo - xFrom + 1;
8843 grid[axisOrder[1]-1] = yTo - yFrom + 1;
8844 grid[axisOrder[2]-1] = zTo - zFrom + 1;
8846 axFrom[axisOrder[0]-1] = xFrom;
8847 axFrom[axisOrder[1]-1] = yFrom;
8848 axFrom[axisOrder[2]-1] = zFrom;
8850 axTo[axisOrder[0]-1] = xTo;
8851 axTo[axisOrder[1]-1] = yTo;
8852 axTo[axisOrder[2]-1] = zTo;
8854 dims[0] = axTo[0] - axFrom[0] + 1;
8855 dims[1] = axTo[1] - axFrom[1] + 1;
8856 dims[2] = axTo[2] - axFrom[2] + 1;
8859 if ( std::isinf ( xRange ) )
8861 xRange = this->_xRange;
8862 if ( std::isinf ( xRange ) )
8864 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8868 if ( std::isinf ( yRange ) )
8870 yRange = this->_yRange;
8871 if ( std::isinf ( yRange ) )
8873 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8877 if ( std::isinf ( zRange ) )
8879 zRange = this->_zRange;
8880 if ( std::isinf ( zRange ) )
8882 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
8890 cell[3] =
static_cast<float> ( 90.0 );
8891 cell[4] =
static_cast<float> ( 90.0 );
8892 cell[5] =
static_cast<float> ( 90.0 );
8895 CMap_io::ccp4_cmap_set_cell ( mapFile, cell );
8896 CMap_io::ccp4_cmap_set_grid ( mapFile, grid );
8897 CMap_io::ccp4_cmap_set_order ( mapFile, axisOrder );
8898 CMap_io::ccp4_cmap_set_dim ( mapFile, dims );
8899 CMap_io::ccp4_cmap_set_origin ( mapFile, axFrom );
8901 CMap_io::ccp4_cmap_set_spacegroup ( mapFile, 1 );
8902 CMap_io::ccp4_cmap_set_title ( mapFile, title );
8903 CMap_io::ccp4_cmap_set_datamode ( mapFile, 2 );
8906 int fastestDim = ( axTo[0] - axFrom[0] + 1 );
8907 int middleDim = ( axTo[1] - axFrom[1] + 1 ) * fastestDim;
8908 int newU, newV, newW;
8909 std::vector<float> section( middleDim );
8914 for ( iters[2] = axFrom[2]; iters[2] <= axTo[2]; iters[2]++ )
8918 for ( iters[1] = axFrom[1]; iters[1] <= axTo[1]; iters[1]++ )
8920 for ( iters[0] = axFrom[0]; iters[0] <= axTo[0]; iters[0]++ )
8922 newU = iters[axisOrder[0]-1] - axFrom[axisOrder[0]-1];
8923 newV = iters[axisOrder[1]-1] - axFrom[axisOrder[1]-1];
8924 newW = iters[axisOrder[2]-1] - axFrom[axisOrder[2]-1];
8925 arrPos = newW + grid[axisOrder[2]-1] * ( newV + grid[axisOrder[1]-1] * newU );
8927 section[ index++ ] =
static_cast<float> ( map[arrPos] );
8931 CMap_io::ccp4_cmap_write_section( mapFile, §ion[0] );
8934 CMap_io::ccp4_cmap_close ( mapFile );
8962 void ProSHADE_internal::ProSHADE_data::writeMap ( std::string fileName,
8964 std::string axOrder,
8977 CMap_io::CMMFile *mapFile =
nullptr;
8978 mapFile =
reinterpret_cast<CMap_io::CMMFile*
> ( CMap_io::ccp4_cmap_open ( fileName.c_str() , myMapMode ) );
8979 if ( mapFile == NULL )
8981 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open file " << fileName <<
" for writing. Terminating..." << std::endl;
8986 const char* title =
"ProSHADE genrated map ";
8995 for (
unsigned int iter = 0; iter < 3; iter++ )
8997 if ( axOrder[iter] ==
'x' ) { axisOrder[iter] = 1; }
8998 if ( axOrder[iter] ==
'y' ) { axisOrder[iter] = 2; }
8999 if ( axOrder[iter] ==
'z' ) { axisOrder[iter] = 3; }
9003 if ( std::isinf ( xFrom ) )
9005 xFrom = this->_xFrom;
9006 if ( std::isinf ( xFrom ) )
9008 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9012 if ( std::isinf ( yFrom ) )
9014 yFrom = this->_yFrom;
9015 if ( std::isinf ( yFrom ) )
9017 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9021 if ( std::isinf ( zFrom ) )
9023 zFrom = this->_zFrom;
9024 if ( std::isinf ( zFrom ) )
9026 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zFrom parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9030 if ( std::isinf ( xTo ) )
9033 if ( std::isinf ( xTo ) )
9035 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9039 if ( std::isinf ( yTo ) )
9042 if ( std::isinf ( yTo ) )
9044 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9048 if ( std::isinf ( zTo ) )
9051 if ( std::isinf ( zTo ) )
9053 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zTo parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9059 grid[axisOrder[0]-1] = xTo - xFrom + 1;
9060 grid[axisOrder[1]-1] = yTo - yFrom + 1;
9061 grid[axisOrder[2]-1] = zTo - zFrom + 1;
9063 axFrom[axisOrder[0]-1] = xFrom;
9064 axFrom[axisOrder[1]-1] = yFrom;
9065 axFrom[axisOrder[2]-1] = zFrom;
9067 axTo[axisOrder[0]-1] = xTo;
9068 axTo[axisOrder[1]-1] = yTo;
9069 axTo[axisOrder[2]-1] = zTo;
9071 dims[0] = axTo[0] - axFrom[0] + 1;
9072 dims[1] = axTo[1] - axFrom[1] + 1;
9073 dims[2] = axTo[2] - axFrom[2] + 1;
9076 if ( std::isinf ( xRange ) )
9078 xRange = this->_xRange;
9079 if ( std::isinf ( xRange ) )
9081 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the xRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9085 if ( std::isinf ( yRange ) )
9087 yRange = this->_yRange;
9088 if ( std::isinf ( yRange ) )
9090 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the yRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9094 if ( std::isinf ( zRange ) )
9096 zRange = this->_zRange;
9097 if ( std::isinf ( zRange ) )
9099 std::cerr <<
"!!! ProSHADE ERROR !!! Did not supply the zRange parameter to the writeMap function and there is no suitable default in the object. Terminating ..." << std::endl;
9107 cell[3] =
static_cast<float> ( 90.0 );
9108 cell[4] =
static_cast<float> ( 90.0 );
9109 cell[5] =
static_cast<float> ( 90.0 );
9112 CMap_io::ccp4_cmap_set_cell ( mapFile, cell );
9113 CMap_io::ccp4_cmap_set_grid ( mapFile, grid );
9114 CMap_io::ccp4_cmap_set_order ( mapFile, axisOrder );
9115 CMap_io::ccp4_cmap_set_dim ( mapFile, dims );
9116 CMap_io::ccp4_cmap_set_origin ( mapFile, axFrom );
9118 CMap_io::ccp4_cmap_set_spacegroup ( mapFile, 1 );
9119 CMap_io::ccp4_cmap_set_title ( mapFile, title );
9120 CMap_io::ccp4_cmap_set_datamode ( mapFile, 2 );
9123 int fastestDim = ( axTo[0] - axFrom[0] + 1 );
9124 int middleDim = ( axTo[1] - axFrom[1] + 1 ) * fastestDim;
9125 int newU, newV, newW;
9126 std::vector<float> section ( middleDim );
9132 for ( iters[2] = axFrom[2]; iters[2] <= axTo[2]; iters[2]++ )
9136 for ( iters[1] = axFrom[1]; iters[1] <= axTo[1]; iters[1]++ )
9138 for ( iters[0] = axFrom[0]; iters[0] <= axTo[0]; iters[0]++ )
9140 newU = iters[axisOrder[0]-1] - axFrom[axisOrder[0]-1];
9141 newV = iters[axisOrder[1]-1] - axFrom[axisOrder[1]-1];
9142 newW = iters[axisOrder[2]-1] - axFrom[axisOrder[2]-1];
9143 arrPos = newW + grid[axisOrder[2]-1] * ( newV + grid[axisOrder[1]-1] * newU );
9145 section[ index++ ] =
static_cast<float> ( map[arrPos] );
9149 CMap_io::ccp4_cmap_write_section( mapFile, §ion[0] );
9152 CMap_io::ccp4_cmap_close ( mapFile );
9181 void ProSHADE_internal::ProSHADE_data::writePDB ( std::string templateName,
9182 std::string outputName,
9191 clipper::mmdb::CMMDBManager *mfile =
new clipper::mmdb::CMMDBManager ( );
9192 if ( mfile->ReadCoorFile ( templateName.c_str() ) )
9194 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read file: " << templateName.c_str() << std::endl;
9205 bool firstAtom =
true;
9212 clipper::mmdb::PPCChain chain;
9213 clipper::mmdb::PPCResidue residue;
9214 clipper::mmdb::PPCAtom atom;
9216 std::vector < std::array<double,3> > atCoords;
9217 std::array<double,3> hlpArr;
9220 mfile->GetChainTable ( 1, chain, noChains );
9222 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9227 chain[nCh]->GetResidueTable ( residue, noResidues );
9229 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9231 if ( residue[nRes] )
9234 residue[nRes]->GetAtomTable ( atom, noAtoms );
9236 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9241 if ( atom[aNo]->Ter ) {
continue; }
9244 hlpArr[0] = atom[aNo]->x;
9245 hlpArr[1] = atom[aNo]->y;
9246 hlpArr[2] = atom[aNo]->z;
9247 atCoords.emplace_back ( hlpArr );
9252 maxX = atom[aNo]->x;
9253 minX = atom[aNo]->x;
9254 maxY = atom[aNo]->y;
9255 minY = atom[aNo]->y;
9256 maxZ = atom[aNo]->z;
9257 minZ = atom[aNo]->z;
9262 if ( atom[aNo]->x > maxX ) { maxX = atom[aNo]->x; }
if ( atom[aNo]->x < minX ) { minX = atom[aNo]->x; }
9263 if ( atom[aNo]->y > maxY ) { maxY = atom[aNo]->y; }
if ( atom[aNo]->y < minY ) { minY = atom[aNo]->y; }
9264 if ( atom[aNo]->z > maxZ ) { maxZ = atom[aNo]->z; }
if ( atom[aNo]->z < minZ ) { minZ = atom[aNo]->z; }
9274 if ( ( rotEulA != 0.0 ) || ( rotEulB != 0.0 ) || ( rotEulG != 0.0 ) )
9277 double xRng = ( maxX - minX ) / 2.0;
9278 double yRng = ( maxY - minY ) / 2.0;
9279 double zRng = ( maxZ - minZ ) / 2.0;
9280 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9282 atCoords.at(iter)[0] = ( atCoords.at(iter)[0] - minX ) - xRng;
9283 atCoords.at(iter)[1] = ( atCoords.at(iter)[1] - minY ) - yRng;
9284 atCoords.at(iter)[2] = ( atCoords.at(iter)[2] - minZ ) - zRng;
9288 std::vector< std::vector < double > > rMat;
9289 std::vector< double > hlpVec;
9290 hlpVec.emplace_back ( cos ( rotEulA ) * cos ( rotEulB ) * cos ( rotEulG ) - sin ( rotEulA ) * sin ( rotEulG ) );
9291 hlpVec.emplace_back ( sin ( rotEulA ) * cos ( rotEulB ) * cos ( rotEulG ) + cos ( rotEulA ) * sin ( rotEulG ) );
9292 hlpVec.emplace_back ( -sin ( rotEulB ) * cos ( rotEulG ) );
9293 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9295 hlpVec.emplace_back ( -cos ( rotEulA ) * cos ( rotEulB ) * sin ( rotEulG ) - sin ( rotEulA ) * cos ( rotEulG ) );
9296 hlpVec.emplace_back ( -sin ( rotEulA ) * cos ( rotEulB ) * sin ( rotEulG ) + cos ( rotEulA ) * cos ( rotEulG ) );
9297 hlpVec.emplace_back ( sin ( rotEulB ) * sin ( rotEulG ) );
9298 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9300 hlpVec.emplace_back ( cos ( rotEulA ) * sin ( rotEulB ) );
9301 hlpVec.emplace_back ( sin ( rotEulA ) * sin ( rotEulB ) );
9302 hlpVec.emplace_back ( cos ( rotEulB ) );
9303 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9306 double hlpXVal = 0.0;
9307 double hlpYVal = 0.0;
9308 double hlpZVal = 0.0;
9309 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9311 hlpXVal = ( atCoords.at(iter)[0] * rMat.at(0).at(0) ) + ( atCoords.at(iter)[1] * rMat.at(1).at(0) ) + ( atCoords.at(iter)[2] * rMat.at(2).at(0) );
9312 hlpYVal = ( atCoords.at(iter)[0] * rMat.at(0).at(1) ) + ( atCoords.at(iter)[1] * rMat.at(1).at(1) ) + ( atCoords.at(iter)[2] * rMat.at(2).at(1) );
9313 hlpZVal = ( atCoords.at(iter)[0] * rMat.at(0).at(2) ) + ( atCoords.at(iter)[1] * rMat.at(1).at(2) ) + ( atCoords.at(iter)[2] * rMat.at(2).at(2) );
9315 atCoords.at(iter)[0] = hlpXVal;
9316 atCoords.at(iter)[1] = hlpYVal;
9317 atCoords.at(iter)[2] = hlpZVal;
9321 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9323 atCoords.at(iter)[0] = ( atCoords.at(iter)[0] + xRng ) + minX;
9324 atCoords.at(iter)[1] = ( atCoords.at(iter)[1] + yRng ) + minY;
9325 atCoords.at(iter)[2] = ( atCoords.at(iter)[2] + zRng ) + minZ;
9330 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9332 atCoords.at(iter)[0] = atCoords.at(iter)[0] + trsX;
9333 atCoords.at(iter)[1] = atCoords.at(iter)[1] + trsY;
9334 atCoords.at(iter)[2] = atCoords.at(iter)[2] + trsZ;
9338 unsigned int atIt = 0;
9339 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9344 chain[nCh]->GetResidueTable ( residue, noResidues );
9346 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9348 if ( residue[nRes] )
9351 residue[nRes]->GetAtomTable ( atom, noAtoms );
9353 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9358 if ( atom[aNo]->Ter ) {
continue; }
9361 atom[aNo]->SetCoordinates ( atCoords.at(atIt)[0],
9362 atCoords.at(atIt)[1],
9363 atCoords.at(atIt)[2],
9364 atom[aNo]->occupancy,
9365 atom[aNo]->tempFactor );
9376 if ( mfile->WritePDBASCII ( outputName.c_str() ) )
9378 std::cerr <<
"!!! ProSHADE ERROR !!! Failed to write out PDB file " << outputName.c_str() <<
"." << std::endl;
9396 void ProSHADE_internal::ProSHADE_data::deleteModel ( std::string modelPath )
9399 double atDistMax = 3.0;
9402 clipper::mmdb::CMMDBManager *mfile =
new clipper::mmdb::CMMDBManager ( );
9403 if ( mfile->ReadCoorFile ( modelPath.c_str() ) )
9405 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read model file: " << modelPath.c_str() << std::endl;
9413 std::vector<std::array<double,3>> coords;
9414 std::array<double,3> hlpArr;
9416 clipper::mmdb::PPCChain chain;
9417 clipper::mmdb::PPCResidue residue;
9418 clipper::mmdb::PPCAtom atom;
9421 mfile->GetChainTable ( 1, chain, noChains );
9422 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9427 chain[nCh]->GetResidueTable ( residue, noResidues );
9429 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9431 if ( residue[nRes] )
9434 residue[nRes]->GetAtomTable ( atom, noAtoms );
9436 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9441 if ( atom[aNo]->Ter ) {
continue; }
9444 hlpArr[0] = atom[aNo]->x;
9445 hlpArr[1] = atom[aNo]->y;
9446 hlpArr[2] = atom[aNo]->z;
9449 coords.emplace_back ( hlpArr );
9461 double* remMask =
new double[(this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1)];
9462 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1) ); iter++ )
9464 remMask[iter] = HUGE_VAL;
9468 double xRealStart = ( this->_xFrom /
static_cast<double>( this->_maxMapU + 1 ) ) * this->_xRange;
9469 double yRealStart = ( this->_yFrom /
static_cast<double>( this->_maxMapV + 1 ) ) * this->_yRange;
9470 double zRealStart = ( this->_zFrom /
static_cast<double>( this->_maxMapW + 1 ) ) * this->_zRange;
9472 double xRealStep = 1.0 /
static_cast<double>( this->_maxMapU + 1 ) * this->_xRange;
9473 double yRealStep = 1.0 /
static_cast<double>( this->_maxMapV + 1 ) * this->_yRange;
9474 double zRealStep = 1.0 /
static_cast<double>( this->_maxMapW + 1 ) * this->_zRange;
9486 for (
int cIt = 0; cIt < static_cast<int> ( coords.size() ); cIt++ )
9489 for (
double uIt = xRealStart; uIt < static_cast<double> ( ( this->_xTo /
static_cast<double>( this->_maxMapU + 1 ) ) * this->_xRange ); uIt += xRealStep )
9491 if ( std::abs ( uIt - coords.at(cIt)[0] ) > atDistMax ) { uIter += 1;
continue; }
9492 xHlp = pow ( uIt - coords.at(cIt)[0], 2.0 );
9495 for (
double vIt = yRealStart; vIt < static_cast<double> ( ( this->_yTo /
static_cast<double>( this->_maxMapV + 1 ) ) * this->_yRange ); vIt += yRealStep )
9497 if ( std::abs ( vIt - coords.at(cIt)[1] ) > atDistMax ) { vIter += 1;
continue; }
9498 yHlp = pow ( vIt - coords.at(cIt)[1], 2.0 );
9501 for (
double wIt = zRealStart; wIt < static_cast<double> ( ( this->_zTo /
static_cast<double>( this->_maxMapW + 1 ) ) * this->_zRange ); wIt += zRealStep )
9503 if ( std::abs ( wIt - coords.at(cIt)[2] ) > atDistMax ) { wIter += 1;
continue; }
9504 zHlp = pow ( wIt - coords.at(cIt)[2], 2.0 );
9506 arrPos = wIter + (this->_maxMapW + 1) * ( vIter + (this->_maxMapV + 1) * uIter );
9507 dist = sqrt ( xHlp + yHlp + zHlp );
9509 if ( remMask[arrPos] == HUGE_VAL ) { remMask[arrPos] = dist; }
9510 else {
if ( dist < remMask[arrPos] ) { remMask[arrPos] = dist; } }
9523 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1) ); iter++ )
9525 if ( remMask[iter] != HUGE_VAL )
9527 this->_densityMapMap[iter] = 0.0;
double aaErrorTolerance
The tolerance parameter on matching axes for the angle-axis representation of rotations.
This class deals with reading in the data and computing structure specific information including the ...
std::vector< std::vector< double > > getFragFullRotationDistances()
This function returns a vector of vectors of full rotation function distances between each fragment a...
std::string symmetryType
The required symmetry type. If no symmetry is required, leave empty. Possible values are: C...
double mapResolution
This is the internal resolution at which the calculations are done, not necessarily the resolution of...
double noIQRsFromMap
This is the number of interquartile distances from mean that is used to threshold the map masking...
std::vector< std::array< double, 8 > > getSO3Peaks(ProSHADE::ProSHADE_settings *settings, double noIQRs=1.5, bool freeMem=true, int peakSize=1, double realDist=0.4, int verbose=1)
This function detects 'true' peaks from the background of the SO3 inverse transform map...
bool clearMapData
This value is used to decide whether the input maps should be cleared again, or not.
unsigned int theta
This parameter is the longitude of the spherical grid mapping. It should be 2 * bandwidth unless ther...
std::vector< std::vector< std::array< double, 5 > > > findTetrSymmetry(std::vector< std::array< double, 5 > > CnSymm, double *tetrSymmPeakAvg, double axisErrorTolerance=0.1)
This function detects the tetrahedral symmetries in the structure.
unsigned int checkFileType(std::string fileName)
This function checks the input file for being either PDB or MAP formatted.
bool dbDistOverlay
This value is false in all conditions, unless programatically changed. If changed, distance computations will use the phaseless database to compute overlay before distances computation. This is computationally expensive and requires phaseless as well as phased database.
void rotateStructure(ProSHADE_data *cmpObj1, ProSHADE::ProSHADE_settings *settings, std::string saveName, int verbose=0, std::string axOrd="xyz", bool internalUse=false)
Rotates the density map be given Angle-Axis rotation using the Wigner matrices and inverse spharical ...
double bFactorValue
This is the value to which all B-factors of PDB files will be changed to.
std::string clearMapFile
If map features are to be extracted, should the clear map be saved (then give file name here)...
void translateMap(double xShift, double yShift, double zShift)
This function translates the data along the three coordinate axis by the amount given by the three pa...
std::vector< std::vector< std::array< double, 5 > > > findIcosSymmetry(std::vector< std::array< double, 5 > > CnSymm, double *icosSymmPeakAvg, double axisErrorTolerance=0.1)
This function detects the icosahedral symmetries in the structure.
std::string databaseName
The name of the bin file to which the database should be saved.
void mapPhaselessToSphere(ProSHADE::ProSHADE_settings *settings, double theta, double phi, double shellSz, unsigned int manualShells=0, bool keepInMemory=false, bool rotDefaults=false)
This function assumes the data have been processed and maps them onto a set of concentric spheres wit...
double zTranslation
The number of angstroms by which the structure should be translated along the Z axis.
bool overlayDefaults
If true, the shell spacing and distances will be doube to their typical values. This is to speed up m...
bool usePhase
Here the user can decide whether to use phase information or whether to ignore it completely...
double mapFragBoxFraction
Fraction of box that needs to have density in order to be passed on.
std::vector< std::string > deleteModels
The filenames listed here consist of models which should have their density deleted from the map befo...
unsigned int bandwidth
This parameter determines the angular resolution of the spherical harmonics decomposition.
void keepPhaseInMap(double alpha, double bFac, unsigned int *bandwidth, unsigned int *theta, unsigned int *phi, unsigned int *glIntegOrder, ProSHADE::ProSHADE_settings *settings, bool useCom=true, double maxMapIQR=10.0, int verbose=0, bool clearMapData=true, bool rotDefaults=false, bool overlapDefaults=false, double blurFactor=500.0, bool maskBlurFactorGiven=false)
This function keeps the phase information from the density map and prepares the data for SH coefficie...
std::vector< std::vector< double > > getFragTraceSigmaDistances()
This function returns a vector of vectors of trace sigma distances between each fragment and the whol...
bool htmlReport
Should HTML report for the run be created?
std::vector< std::array< double, 5 > > findCnSymmetry(std::vector< std::array< double, 8 > > peaks, ProSHADE::ProSHADE_settings *settings, double axisErrorTolerance=0.0, bool freeMem=true, double percAllowedToMiss=0.33, int verbose=1)
This function attempts to detect the C-symmetries present in the list of overlay peaks.
void setEulerAngles(double alpha, double beta, double gamma)
This function is used to set the Euler angles for further processing.
int verbose
Should the software report on the progress, or just be quiet? Value between 0 (quiet) and 4 (loud) ...
double rotAngle
The angle of the rotation to be done to the map structure in the map rotation mode.
void printResultsClear(int verbose)
This function prints the cleared results to the screen.
bool saveWithAndWithout
This option decides whether both with and without phase spherical harmonics should be saved...
The main header file containing all declarations the user of the library needs.
double trSigmaThreshold
All structure pairs with trace sigma descriptor value less than this will not be subjected to any fur...
double alpha
This parameter determines the power to which the |F|'s should be raised.
bool firstLineCOM
This is a special option for metal detection, please leave false.
void precomputeTrSigmaDescriptor()
This function computes the E matrices required for the trace sigma descriptor, the rotation function ...
bool fullRotFnDist
Should the full rotation function distances descriptor be computed.
bool useCubicMaps
When saving clear maps, should the rectangular or cubic (older versions of refmac need this) maps be ...
bool maskBlurFactorGiven
Was a specific value of the blurring factor requested by the user?
std::vector< std::vector< std::array< double, 5 > > > findOctaSymmetry(std::vector< std::array< double, 5 > > CnSymm, double *octaSymmPeakAvg, double axisErrorTolerance=0.1)
This function detects the octahedral symmetries in the structure.
std::vector< double > getFullRotationDistances()
This function returns a vector of full rotation function distances between the first and all other st...
double maxAvgPeakForSymmetry(double X, double Y, double Z, double Angle, ProSHADE::ProSHADE_settings *settings)
This function takes angle and axis and checks the SO(3) map for this specific symmetry only...
std::vector< int > ignoreLs
This vector lists all the bandwidth values which should be ignored and not part of the computations...
int peakSurroundingPoints
For a peak to exist, how many points in every direction need to be smalled than the middle value...
double rotXAxis
The X-axis element of the rotation axis along which the rotation is to be done in the map rotation mo...
double shellSpacing
This parameter determines how far the radial shells should be from each other.
This file contains all the functions related to computing the Gauss-Legendre integration variables...
double rotYAxis
The Y-axis element of the rotation axis along which the rotation is to be done in the map rotation mo...
ProSHADE_compareOneAgainstAll(ProSHADE_data *oneStr, std::vector< ProSHADE_data *> *allStrs, std::vector< int > ignoreL, double matrixPowerWeight, int verbose)
Contructor for the ProSHADE_compareOneAgainstAll class.
std::vector< std::vector< std::array< double, 6 > > > findDnSymmetry(std::vector< std::array< double, 5 > > CnSymm, double axisErrorTolerance=0.1)
This function detects dihedral (D) symmetries from the list of already detected C symmetries...
double rotZAxis
The Z-axis element of the rotation axis along which the rotation is to be done in the map rotation mo...
double peakDistanceForReal
Threshold for determining 'missing peaks' existence.
bool mapResDefault
This variable states if default resolution should be used, or whether the user has supplied a differe...
bool traceSigmaDist
Should the trace sigma distances descriptor be computed.
std::vector< std::vector< double > > getFragEnergyLevelsDistances()
This function returns a vector of vectors of energy level distances between each fragment and the who...
This is the executive class responsible for comparing strictly two structures.
std::vector< std::string > getFragmentsList(void)
This function returns the paths to all fragment files saved by fragmentation functionality.
bool rotChangeDefault
If map rotation is selected, the default automatic parameter decision is changed. This variable state...
std::vector< std::array< double, 5 > > findCnSymmetryClear(std::vector< std::array< double, 5 > > CnSymm, ProSHADE::ProSHADE_settings *settings, double maxGap=0.2, bool *pf=nullptr)
This function takes the detected C-symmetries list, removes low probability symmetries and sorts as t...
~ProSHADE_compareOneAgainstAll()
Destructor for the ProSHADE_compareOneAgainstAll class.
void getSphericalHarmonicsCoeffs(unsigned int bandwidth, ProSHADE::ProSHADE_settings *settings)
This function takes the sphere mapped data and computes spherical harmoncis decomposition for each sh...
unsigned int phi
This parameter is the latitudd of the spherical grid mapping. It should be 2 * bandwidth unless there...
void getSO3InverseMap(ProSHADE::ProSHADE_settings *settings)
This function is responsible for computing the SO3 inverse transform.
~ProSHADE_distances()
This is the destructor for the ProSHADE_distances class.
void printResultsClearHTML(ProSHADE::ProSHADE_settings *settings)
This function prints the cleared results to the HTML file.
unsigned int symmetryFold
The required fold of the sought symmetry. Applicable to C and D symmetries, otherwise leave 0...
std::string axisOrder
A string specifying the order of the axis. Must have three characters and any permutation of 'x'...
The main header file containing all declarations for the innter workings of the library.
int htmlReportLine
Iterator for current HTML line.
bool energyLevelDist
Should the energy level distances descriptor be computed.
~ProSHADE_data()
Destructor for the ProSHADE_data class.
std::vector< std::array< double, 5 > > getCSymmetries()
This function gives the user programmatical access to the detected C-symmetries.
double xTranslation
The number of angstroms by which the structure should be translated along the X axis.
int htmlReportLineProgress
Iterator for current HTML line in the progress bar.
This header file contains function and globals required for platform-independent file detection...
double bFactorChange
This value will be used to change the B-factors if required by the user.
ProSHADE_comparePairwise(ProSHADE_data *cmpObj1, ProSHADE_data *cmpObj2, double mPower, std::vector< int > ignoreL, unsigned int order, ProSHADE::ProSHADE_settings *settings)
Contructor for the ProSHADE_comparePairwise class.
std::vector< std::array< double, 8 > > getRotFnPeaks()
This function gives the user programmatical access to the symmetry peaks of the symmetry detection pr...
double peakHeightNoIQRs
How many interquartile ranges should be used to distinguish 'false' peaks from the true ones...
std::vector< double > getTraceSigmaDistances()
This function returns a vector of trace sigma distances between the first and all other structures...
std::vector< double > getEnergyLevelsDistances()
This function returns a vector of energy level distances between the first and all other structures...
std::vector< std::vector< std::array< double, 6 > > > findDnSymmetryClear(std::vector< std::vector< std::array< double, 6 > > > DnSymm, ProSHADE::ProSHADE_settings *settings, double maxGap=0.2, bool *pf=nullptr)
This function sorts the D symmetries and removed low probability ones.
void printResultsRequestHTML(std::string symmetryType, unsigned int symmetryFold, ProSHADE::ProSHADE_settings *settings)
This function prints the cleared results to the HTML report file.
ProSHADE_symmetry()
Contructor for the ProSHADE_symmetry class.
void getDensityMapFromMAP(std::string fileName, double *shellDistance, double resolution, unsigned int *bandwidth, unsigned int *theta, unsigned int *phi, unsigned int *glIntegOrder, double *extraSpace, bool mapResDefault, bool rotDefaults, ProSHADE::ProSHADE_settings *settings, bool overlayDefaults=false)
Function to read in the MAP file and provide the basic processing.
~ProSHADE_comparePairwise()
Destructor for the ProSHADE_comparePairwise class.
This is the executive class responsible for comparing two or more structures.
~ProSHADE_mapFeatures()
This is the ProSHADE_mapFeatures class destructor responsible for releasing memory.
double yTranslation
The number of angstroms by which the structure should be translated along the Y axis.
double mapFragBoxSize
Should the clear map be fragmented into boxes? If so, put box size here, otherwise leave 0...
ProSHADE_data()
Contructor for the ProSHADE_data class.
double symGapTolerance
For C-symmetries - if there are many, only those with average peak height - parameter * top symmetry ...
This class stores all the settings and is passed to the executive classes instead of multitude of par...
void freeInvMap()
This function frees the SOFT inverse map.
double mPower
This parameter determines the scaling for trace sigma descriptor.
unsigned int manualShells
Should the user require so, the maximum number of radial shells can be set.
ProSHADE_distances(ProSHADE::ProSHADE_settings *settings)
This is the constructor for the ProSHADE_distances executive class the user should use to compute and...
std::vector< std::vector< std::array< double, 6 > > > getDSymmetries()
This function gives the user programmatical access to the detected D-symmetries.
bool useCOM
Should the Centre of Mass (COM) be used to center the structure in the cell?
void printResultsRequest(std::string symmetryType, unsigned int symmetryFold, int verbose)
This function prints the cleared results to the screen.
double maskBlurFactor
The is the amount of blurring to be used to create masks for maps.
ProSHADE_mapFeatures(ProSHADE::ProSHADE_settings *settings)
This is the constructor for the ProSHADE_mapFeatures executive class the user should use to compute a...
std::vector< std::string > structFiles
This vector should contain all the structures that are being dealt with, but this does not yet work! ...
double enLevelsThreshold
All structure pairs with energy level descriptor value less than this will not be subjected to any fu...
Task taskToPerform
This custom type variable determines which task to perfom (i.e. symmetry detection, distances computation or map features extraction).
std::array< double, 4 > getTranslationFunctionMap(ProSHADE_data *obj1, ProSHADE_data *obj2, double *ob2XMov=nullptr, double *ob2YMov=nullptr, double *ob2ZMov=nullptr)
Computes the translation function for the two objects and returns the position of the highest peak...
This file contains the ProSHADE_internal_misc namespace and its miscellaneous functions.
std::array< double, 3 > getEulerAngles(ProSHADE::ProSHADE_settings *settings, double *correlation=nullptr)
This function finds the highest peak in the SO3 inverse transform map and sets it as the optimal over...
std::string mapFragName
The prefix of the files with the cut out boxes.
double extraSpace
What should be the distance added on both sides to the structure, so that the next cell density would...
unsigned int glIntegOrder
This parameter controls the Gauss-Legendre integration order and so the radial resolution.