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->removePhaseFromMapOverlay ( this->alpha,
1540 this->bFactorChange,
1543 pattStr1->mapPhaselessToSphere ( settings,
1549 pattStr1->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
1552 std::cout <<
">> Structure 1 spherical harmonics computed." << std::endl;
1555 pattStr2->removePhaseFromMapOverlay ( this->alpha,
1556 this->bFactorChange,
1559 pattStr2->mapPhaselessToSphere ( settings,
1565 pattStr2->getSphericalHarmonicsCoeffs ( this->bandwidth.at(1), settings );
1568 std::cout <<
">> Structure 2 spherical harmonics computed." << std::endl;
1573 std::stringstream hlpSS;
1574 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics for Patterson maps computed." <<
"</font>";
1575 rvapi_set_text ( hlpSS.str().c_str(),
1590 std::max ( this->glIntegOrder.at(0),
1591 this->glIntegOrder.at(1) ),
1598 std::cout <<
">>>>> E matrices constructed." << std::endl;
1604 std::cout <<
">>>>> Inverse SO(3) Fourier transform map obtained." << std::endl;
1609 std::stringstream hlpSS;
1610 hlpSS <<
"<font color=\"green\">" <<
"Rotation function map computed." <<
"</font>";
1611 rvapi_set_text ( hlpSS.str().c_str(),
1621 double pattCorrelation = 0.0;
1623 std::array<double,3> euAngs = cmpObj->
getEulerAngles ( settings, &pattCorrelation );
1627 std::cout <<
">> Patterson map based rotation angles obtained ( " << euAngs[0] <<
", " << euAngs[1] <<
" and " << euAngs[2] <<
" )." << std::endl;
1632 std::stringstream hlpSS;
1633 hlpSS <<
"<font color=\"green\">" <<
"Found optimal overlay rotation angles." <<
"</font>";
1634 rvapi_set_text ( hlpSS.str().c_str(),
1647 rvapi_add_section (
"RotationSection",
1648 "Rotation information",
1659 std::stringstream hlpSS;
1660 hlpSS <<
"<pre>" <<
"Rotation in Euler Angles: ";
1661 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1662 for (
int iter = 0; iter < hlpIt; iter++ )
1667 std::stringstream hlpSS2;
1668 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[0] * 1000.0 ) / 1000.0;
1669 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1670 hlpSS <<
" " << hlpSS2.str() <<
" ";
1671 hlpSS2.str( std::string ( ) );
1672 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[1] * 1000.0 ) / 1000.0;
1673 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1674 hlpSS << hlpSS2.str() <<
" ";
1675 hlpSS2.str( std::string ( ) );
1676 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( euAngs[2] * 1000.0 ) / 1000.0;
1677 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1678 hlpSS << hlpSS2.str() <<
"</pre>";
1680 rvapi_set_text ( hlpSS.str().c_str(),
1687 hlpSS.str ( std::string ( ) );
1688 hlpSS <<
"<pre>" <<
"Rotation in Angle-Axis: ";
1689 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1690 for (
int iter = 0; iter < hlpIt; iter++ )
1695 double X, Y, Z, Ang;
1696 ProSHADE_internal_misc::getAxisAngleFromEuler ( euAngs[0], euAngs[1], euAngs[2], &X, &Y, &Z, &Ang,
false );
1698 hlpSS2.str( std::string ( ) );
1699 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( X * 1000.0 ) / 1000.0;
1700 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1701 hlpSS <<
" " << hlpSS2.str() <<
" ";
1702 hlpSS2.str( std::string ( ) );
1703 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Y * 1000.0 ) / 1000.0;
1704 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1705 hlpSS << hlpSS2.str() <<
" ";
1706 hlpSS2.str( std::string ( ) );
1707 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Z * 1000.0 ) / 1000.0;
1708 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1709 hlpSS << hlpSS2.str() <<
" ";
1710 hlpSS2.str( std::string ( ) );
1711 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( Ang * 1000.0 ) / 1000.0;
1712 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1713 hlpSS << hlpSS2.str() <<
"</pre>";
1715 rvapi_set_text ( hlpSS.str().c_str(),
1722 std::array<double,5> arrHlp;
1728 std::vector< std::vector<double> > rMat = ProSHADE_internal_misc::getMatrixFromAxisAngle ( arrHlp );
1730 hlpSS.str ( std::string ( ) );
1731 hlpSS <<
"<pre>" <<
"Rotation as Rotation Matrix: ";
1732 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1733 for (
int iter = 0; iter < hlpIt; iter++ )
1738 hlpSS2.str( std::string ( ) );
1739 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(0) * 1000.0 ) / 1000.0;
1740 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1741 hlpSS <<
" " << hlpSS2.str() <<
" ";
1742 hlpSS2.str( std::string ( ) );
1743 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(1) * 1000.0 ) / 1000.0;
1744 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1745 hlpSS << hlpSS2.str() <<
" ";
1746 hlpSS2.str( std::string ( ) );
1747 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(0).at(2) * 1000.0 ) / 1000.0;
1748 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1749 hlpSS << hlpSS2.str() <<
"</pre>";
1751 rvapi_set_text ( hlpSS.str().c_str(),
1758 hlpSS.str ( std::string ( ) );
1759 hlpSS <<
"<pre>" <<
" ... ";
1760 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1761 for (
int iter = 0; iter < hlpIt; iter++ )
1766 hlpSS2.str( std::string ( ) );
1767 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(0) * 1000.0 ) / 1000.0;
1768 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1769 hlpSS <<
" " << hlpSS2.str() <<
" ";
1770 hlpSS2.str( std::string ( ) );
1771 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(1) * 1000.0 ) / 1000.0;
1772 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1773 hlpSS << hlpSS2.str() <<
" ";
1774 hlpSS2.str( std::string ( ) );
1775 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(1).at(2) * 1000.0 ) / 1000.0;
1776 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1777 hlpSS << hlpSS2.str() <<
"</pre>";
1779 rvapi_set_text ( hlpSS.str().c_str(),
1786 hlpSS.str ( std::string ( ) );
1787 hlpSS <<
"<pre>" <<
" ... ";
1788 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
1789 for (
int iter = 0; iter < hlpIt; iter++ )
1794 hlpSS2.str( std::string ( ) );
1795 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(0) * 1000.0 ) / 1000.0;
1796 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1797 hlpSS <<
" " << hlpSS2.str() <<
" ";
1798 hlpSS2.str( std::string ( ) );
1799 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(1) * 1000.0 ) / 1000.0;
1800 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1801 hlpSS << hlpSS2.str() <<
" ";
1802 hlpSS2.str( std::string ( ) );
1803 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( rMat.at(2).at(2) * 1000.0 ) / 1000.0;
1804 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
1805 hlpSS << hlpSS2.str() <<
"</pre>";
1807 rvapi_set_text ( hlpSS.str().c_str(),
1823 std::array<double,4> translationVec;
1824 double xMapMov = 0.0;
1825 double yMapMov = 0.0;
1826 double zMapMov = 0.0;
1827 double xMapTotMov = 0.0;
1828 double yMapTotMov = 0.0;
1829 double zMapTotMov = 0.0;
1836 if ( fileType == 2 )
1838 pattStr2->getDensityMapFromMAP ( this->structFiles.at(1),
1840 this->mapResolution,
1841 &this->bandwidth.at(1),
1844 &this->glIntegOrder.at(1),
1851 else if ( fileType == 1 )
1853 pattStr2->getDensityMapFromPDB ( this->structFiles.at(1),
1855 this->mapResolution,
1856 &this->bandwidth.at(1),
1859 &this->glIntegOrder.at(1),
1869 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;
1873 std::stringstream hlpSS;
1874 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(1) <<
" ." <<
"</font>";
1875 rvapi_set_text ( hlpSS.str().c_str(),
1889 pattStr2->keepPhaseInMap ( this->alpha,
1890 this->bFactorChange,
1891 &this->bandwidth.at(1),
1894 &this->glIntegOrder.at(1),
1905 pattStr2->mapPhaselessToSphere ( settings,
1913 pattStr2->getSphericalHarmonicsCoeffs ( this->bandwidth.at(1), settings );
1916 std::cout <<
">> Structure 2 spherical harmonics computed with phase." << std::endl;
1923 if ( fileType == 2 )
1925 pattStr1->getDensityMapFromMAP ( this->structFiles.at(0),
1927 this->mapResolution,
1928 &this->bandwidth.at(0),
1931 &this->glIntegOrder.at(0),
1938 else if ( fileType == 1 )
1940 pattStr1->getDensityMapFromPDB ( this->structFiles.at(0),
1942 this->mapResolution,
1943 &this->bandwidth.at(0),
1946 &this->glIntegOrder.at(0),
1956 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;
1960 std::stringstream hlpSS;
1961 hlpSS <<
"<font color=\"red\">" <<
"Cannot read file " << settings->
structFiles.at(0) <<
" ." <<
"</font>";
1962 rvapi_set_text ( hlpSS.str().c_str(),
1975 pattStr1->keepPhaseInMap ( this->alpha,
1976 this->bFactorChange,
1977 &this->bandwidth.at(0),
1980 &this->glIntegOrder.at(0),
1991 pattStr1->mapPhaselessToSphere ( settings,
1999 pattStr1->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
2002 std::cout <<
">> Structure 1 spherical harmonics computed with phase." << std::endl;
2007 std::stringstream hlpSS;
2008 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics computed for translation computation (with phases)." <<
"</font>";
2009 rvapi_set_text ( hlpSS.str().c_str(),
2021 std::stringstream hlpSS;
2022 hlpSS <<
"<pre>" <<
"Rotation about coordinate location (A): ";
2023 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2024 for (
int iter = 0; iter < hlpIt; iter++ )
2029 std::stringstream hlpSS2;
2030 double pos = ( ( pattStr2->_xFrom * pattStr2->_xSamplingRate ) + pattStr2->_xRange ) / 2.0;
2031 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2032 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2033 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2034 hlpSS <<
" " << hlpSS2.str() <<
" ";
2035 hlpSS2.str( std::string ( ) );
2036 pos = ( ( pattStr2->_yFrom * pattStr2->_ySamplingRate ) + pattStr2->_yRange ) / 2.0;
2037 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2038 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2039 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2040 hlpSS << hlpSS2.str() <<
" ";
2041 hlpSS2.str( std::string ( ) );
2042 pos = ( ( pattStr2->_zFrom * pattStr2->_zSamplingRate ) + pattStr2->_zRange ) / 2.0;
2043 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2044 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2045 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2046 hlpSS << hlpSS2.str() <<
"</pre>";
2048 rvapi_set_text ( hlpSS.str().c_str(),
2062 std::max ( this->glIntegOrder.at(0),
2063 this->glIntegOrder.at(1) ),
2068 double mat22 = cos ( euAngs[1] );
2069 double mat02 = -sin ( euAngs[1] ) * cos ( euAngs[2] );
2070 double mat12 = sin ( euAngs[1] ) * sin ( euAngs[2] );
2071 double mat20 = cos ( euAngs[0] ) * sin ( euAngs[1] );
2072 double mat21 = sin ( euAngs[0] ) * sin ( euAngs[1] );
2075 double rMat02 = mat20;
2076 double rMat20 = mat02;
2077 double rMat21 = mat12;
2078 double rMat12 = mat21;
2081 euAngs[0] = atan2 ( rMat21, rMat20 );
2082 euAngs[1] = acos ( mat22 );
2083 euAngs[2] = atan2 ( rMat12, -rMat02 );
2085 if ( euAngs[0] < 0.0 ) { euAngs[0]= 2.0 * M_PI + euAngs[0]; }
2086 if ( euAngs[1] < 0.0 ) { euAngs[1]= M_PI + euAngs[1]; }
2087 if ( euAngs[2] < 0.0 ) { euAngs[2]= 2.0 * M_PI + euAngs[2]; }
2105 std::stringstream hlpSS;
2106 hlpSS <<
"<font color=\"green\">" <<
"Translation computed." <<
"</font>";
2107 rvapi_set_text ( hlpSS.str().c_str(),
2120 rvapi_add_section (
"TranslationSection",
2121 "Translation information",
2132 std::stringstream hlpSS;
2133 hlpSS <<
"<pre>" <<
"Translation from lowest indices (A): ";
2134 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2135 for (
int iter = 0; iter < hlpIt; iter++ )
2140 std::stringstream hlpSS2;
2141 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[0] * 1000.0 ) / 1000.0;
2142 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2143 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2144 hlpSS <<
" " << hlpSS2.str() <<
" ";
2145 hlpSS2.str( std::string ( ) );
2146 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[1] * 1000.0 ) / 1000.0;
2147 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2148 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2149 hlpSS << hlpSS2.str() <<
" ";
2150 hlpSS2.str( std::string ( ) );
2151 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( -translationVec[2] * 1000.0 ) / 1000.0;
2152 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2153 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2154 hlpSS << hlpSS2.str() <<
"</pre>";
2156 rvapi_set_text ( hlpSS.str().c_str(),
2157 "TranslationSection",
2163 hlpSS.str( std::string () );
2164 hlpSS <<
"<pre>" <<
"Translation from lowest indices (index): ";
2165 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2166 for (
int iter = 0; iter < hlpIt; iter++ )
2171 hlpSS2.str( std::string ( ) );
2172 int pos =
static_cast<int> ( ( -translationVec[0] / pattStr2->_xSamplingRate ) );
2173 hlpSS2 << std::showpos << pos;
2174 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2175 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2176 hlpSS <<
" " << hlpSS2.str() <<
" ";
2177 hlpSS2.str( std::string ( ) );
2178 pos =
static_cast<int> ( ( -translationVec[1] / pattStr2->_ySamplingRate ) );
2179 hlpSS2 << std::showpos << pos;
2180 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2181 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2182 hlpSS << hlpSS2.str() <<
" ";
2183 hlpSS2.str( std::string ( ) );
2184 pos =
static_cast<int> ( ( -translationVec[2] / pattStr2->_zSamplingRate ) );
2185 hlpSS2 << std::showpos << pos;
2186 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2187 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2188 hlpSS << hlpSS2.str() <<
"</pre>";
2190 rvapi_set_text ( hlpSS.str().c_str(),
2191 "TranslationSection",
2197 hlpSS.str ( std::string ( ) );
2198 hlpSS <<
"<pre>" <<
"Shift for visualisation (A): ";
2199 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2200 for (
int iter = 0; iter < hlpIt; iter++ )
2205 hlpSS2.str ( std::string ( ) );
2206 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (xMapTotMov * pattStr2->_xSamplingRate) * 1000.0 ) / 1000.0;
2207 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2208 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2209 hlpSS <<
" " << hlpSS2.str() <<
" ";
2210 hlpSS2.str( std::string ( ) );
2211 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (yMapTotMov * pattStr2->_ySamplingRate) * 1000.0 ) / 1000.0;
2212 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2213 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2214 hlpSS << hlpSS2.str() <<
" ";
2215 hlpSS2.str( std::string ( ) );
2216 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( (zMapTotMov * pattStr2->_zSamplingRate) * 1000.0 ) / 1000.0;
2217 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2218 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2219 hlpSS << hlpSS2.str() <<
"</pre>";
2221 rvapi_set_text ( hlpSS.str().c_str(),
2222 "TranslationSection",
2228 hlpSS.str( std::string () );
2229 hlpSS <<
"<pre>" <<
"Shift for visualisation (index): ";
2230 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2231 for (
int iter = 0; iter < hlpIt; iter++ )
2236 hlpSS2.str( std::string ( ) );
2237 pos =
static_cast<int> ( xMapTotMov );
2238 hlpSS2 << std::showpos << pos;
2239 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2240 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2241 hlpSS <<
" " << hlpSS2.str() <<
" ";
2242 hlpSS2.str( std::string ( ) );
2243 pos =
static_cast<int> ( yMapTotMov );
2244 hlpSS2 << std::showpos << pos;
2245 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2246 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2247 hlpSS << hlpSS2.str() <<
" ";
2248 hlpSS2.str( std::string ( ) );
2249 pos =
static_cast<int> ( zMapTotMov );
2250 hlpSS2 << std::showpos << pos;
2251 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2252 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2253 hlpSS << hlpSS2.str() <<
"</pre>";
2255 rvapi_set_text ( hlpSS.str().c_str(),
2256 "TranslationSection",
2268 std::cout <<
">>>>> Translation vector obtained from translation function ( " << translationVec[0] <<
", " << translationVec[1] <<
" and " << translationVec[2] <<
" )." << std::endl;
2276 pattStr2->translateMap ( -translationVec[0],
2278 -translationVec[2] );
2282 std::cout <<
"Resulting structure translated." << std::endl;
2286 if ( !pattStr2->_fromPDB )
2288 if ( !wasMapNameGiven )
2290 std::stringstream strStr;
2292 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2296 if ( ( settings->
clearMapFile.find (
".map" ) != std::string::npos ) || ( settings->
clearMapFile.find (
".mrc" ) != std::string::npos ) )
2298 pattStr2->writeMap ( settings->
clearMapFile, pattStr2->_densityMapCor );
2302 if ( settings->
clearMapFile.find (
".pdb" ) != std::string::npos )
2304 std::stringstream strStr;
2306 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;
2307 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2311 std::stringstream strStr;
2313 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2320 if ( !wasMapNameGiven )
2322 std::stringstream strStr;
2324 std::cout <<
"!!! here" << std::endl;
2325 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2326 std::cout <<
"!!! here 2" << std::endl;
2327 strStr.str ( std::string ( ) );
2330 std::cout <<
"!!! here 3" << std::endl;
2331 pattStr2->writePDB ( this->structFiles.at(1),
2336 translationVec[0] + xMapMov,
2337 translationVec[1] + yMapMov,
2338 translationVec[2] + zMapMov );
2339 std::cout <<
"!!! still here" << std::endl;
2343 if ( ( settings->
clearMapFile.find (
".map" ) != std::string::npos ) || ( settings->
clearMapFile.find (
".mrc" ) != std::string::npos ) )
2345 pattStr2->writeMap ( settings->
clearMapFile, pattStr2->_densityMapCor );
2349 if ( settings->
clearMapFile.find (
".pdb" ) != std::string::npos )
2351 pattStr2->writePDB ( this->structFiles.at(1),
2356 translationVec[0] + xMapMov,
2357 translationVec[1] + yMapMov,
2358 translationVec[2] + zMapMov );
2362 std::stringstream strStr;
2364 pattStr2->writeMap ( strStr.str(), pattStr2->_densityMapCor );
2365 strStr.str ( std::string ( ) );
2368 pattStr2->writePDB ( this->structFiles.at(1),
2373 translationVec[0] + xMapMov,
2374 translationVec[1] + yMapMov,
2375 translationVec[2] + zMapMov );
2383 std::stringstream hlpSS;
2384 hlpSS <<
"<font color=\"green\">" <<
"Overlay structure saved to " << settings->
clearMapFile <<
" ." <<
"</font>";
2385 rvapi_set_text ( hlpSS.str().c_str(),
2403 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
2404 std::cout <<
"| COMPLETED |" << std::endl;
2405 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2410 std::stringstream hlpSS;
2411 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
2412 rvapi_set_text ( hlpSS.str().c_str(),
2424 std::cout <<
"Rotated structure written to file: " << settings->
clearMapFile <<
" as required." << std::endl << std::endl;
2430 rvapi_add_section (
"ResultsSection",
2440 std::stringstream hlpSS;
2441 hlpSS <<
"<pre><b>" <<
"Patterson maps optimal rotation (Euler angles): ";
2442 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2443 for (
int iter = 0; iter < hlpIt; iter++ )
2448 std::stringstream hlpSS2;
2449 double pos = euAngs[0];
2450 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2451 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2452 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2453 hlpSS <<
" " << hlpSS2.str() <<
" ";
2455 hlpSS2.str( std::string ( ) );
2457 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2458 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2459 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2460 hlpSS << hlpSS2.str() <<
" ";
2462 hlpSS2.str( std::string ( ) );
2464 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2465 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2466 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2467 hlpSS << hlpSS2.str() <<
"</b></pre>";
2469 rvapi_set_text ( hlpSS.str().c_str(),
2476 hlpSS.str ( std::string ( ) );
2477 hlpSS <<
"<pre><b>" <<
"Phased maps optimal translation (A): ";
2478 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2479 for (
int iter = 0; iter < hlpIt; iter++ )
2484 hlpSS2.str( std::string ( ) );
2485 pos = translationVec[0];
2486 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2487 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2488 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2489 hlpSS <<
" " << hlpSS2.str() <<
" ";
2491 hlpSS2.str( std::string ( ) );
2492 pos = translationVec[1];
2493 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2494 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2495 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2496 hlpSS << hlpSS2.str() <<
" ";
2498 hlpSS2.str( std::string ( ) );
2499 pos = translationVec[2];
2500 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2501 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2502 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2503 hlpSS << hlpSS2.str() <<
"</b></pre>";
2505 rvapi_set_text ( hlpSS.str().c_str(),
2512 hlpSS.str ( std::string ( ) );
2513 hlpSS <<
"<pre><b>" <<
"Correlation between rotated Patterson maps: ";
2514 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2515 for (
int iter = 0; iter < hlpIt; iter++ )
2520 hlpSS2.str( std::string ( ) );
2521 pos = pattCorrelation;
2522 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2523 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2524 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2525 hlpSS <<
" " << hlpSS2.str() <<
"</b></pre>";
2527 rvapi_set_text ( hlpSS.str().c_str(),
2534 hlpSS.str ( std::string ( ) );
2535 hlpSS <<
"<pre><b>" <<
"Correlation between translated maps with phases: ";
2536 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2537 for (
int iter = 0; iter < hlpIt; iter++ )
2542 hlpSS2.str( std::string ( ) );
2543 pos = translationVec[3];
2544 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( pos * 1000.0 ) / 1000.0;
2545 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS2 <<
" "; } }
2546 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2547 hlpSS <<
" " << hlpSS2.str() <<
"</b></pre>";
2549 rvapi_set_text ( hlpSS.str().c_str(),
2569 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;
2575 std::cerr <<
"!!! ProSHADE ERROR !!! The input file is corrupted or not a ccp4 MAP file formatted. Terminating..." << std::endl;
2581 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;
2587 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;
2592 std::cout <<
">>>>> Sanity checks passed." << std::endl;
2598 &this->shellSpacing,
2599 this->mapResolution,
2600 &this->bandwidth.at(0),
2603 &this->glIntegOrder.at(0),
2611 std::cout <<
"Structure loaded." << std::endl;
2620 this->bFactorChange,
2621 &this->bandwidth.at(0),
2624 &this->glIntegOrder.at(0),
2648 std::cout <<
">> Structure spherical harmonics computed." << std::endl;
2656 this->glIntegOrder.at(0),
2660 double euAlpha = 0.0;
2661 double euBeta = 0.0;
2662 double euGamma = 0.0;
2664 ProSHADE_internal_misc::getEulerFromAxisAngle ( &euAlpha,
2676 printf (
">>>>> Preparation for rotation complete. Euler angles are %+.3f ; %+.3f ; %+.3f\n", euAlpha, euBeta, euGamma );
2686 this->glIntegOrder.at(0),
2693 printf (
">>>>> Preparation for rotation complete. Euler angles are 0.000 ; 0.000 ; 0.000\n" );
2711 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
2712 std::cout <<
"| COMPLETED |" << std::endl;
2713 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2718 std::cout <<
"Rotated structure written to file: " << settings->
clearMapFile <<
" as required." << std::endl << std::endl;
2728 std::cout <<
"-----------------------------------------------------------" << std::endl;
2729 std::cout <<
"| MODE: Symmetry |" << std::endl;
2730 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
2736 rvapi_set_text (
"<h1>ProSHADE Results: Symmetry</h1>",
2745 rvapi_add_section (
"ProgressSection",
2755 std::stringstream hlpSS;
2756 hlpSS <<
"<font color=\"green\">" <<
"Starting computation of symmetry for the input structure." <<
"</font>";
2757 rvapi_set_text ( hlpSS.str().c_str(),
2771 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;
2774 std::stringstream hlpSS;
2775 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>";
2776 rvapi_set_text ( hlpSS.str().c_str(),
2789 unsigned int fileType =
checkFileType ( structFiles.at(0) );
2791 if ( fileType == 2 )
2793 symStr->getDensityMapFromMAP ( this->structFiles.at(0),
2794 &this->shellSpacing,
2795 this->mapResolution,
2796 &this->bandwidth.at(0),
2799 &this->glIntegOrder.at(0),
2806 else if ( fileType == 1 )
2808 symStr->getDensityMapFromPDB ( this->structFiles.at(0),
2809 &this->shellSpacing,
2810 this->mapResolution,
2811 &this->bandwidth.at(0),
2814 &this->glIntegOrder.at(0),
2819 this->firstLineCOM );
2823 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;
2826 std::stringstream hlpSS;
2827 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>";
2828 rvapi_set_text ( hlpSS.str().c_str(),
2841 std::cout <<
"Structure loaded." << std::endl;
2846 std::stringstream hlpSS;
2847 hlpSS <<
"<font color=\"green\">" <<
"Structure " << settings->
structFiles.at(0) <<
" loaded." <<
"</font>";
2848 rvapi_set_text ( hlpSS.str().c_str(),
2863 std::cout <<
">> Saving the structure into the requested location ( " << settings->
clearMapFile <<
" )." << std::endl;
2866 symStr->writeMap ( settings->
clearMapFile, symStr->_densityMapMap );
2869 symStr->keepPhaseInMap ( this->alpha,
2870 this->bFactorChange,
2871 &this->bandwidth.at(0),
2874 &this->glIntegOrder.at(0),
2885 symStr->mapPhaselessToSphere ( settings,
2890 symStr->getSphericalHarmonicsCoeffs ( this->bandwidth.at(0), settings );
2893 std::cout <<
">> Structure spherical harmonics computed." << std::endl;
2897 std::stringstream hlpSS;
2898 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics decomposition computed." <<
"</font>";
2899 rvapi_set_text ( hlpSS.str().c_str(),
2914 this->glIntegOrder.at(0),
2920 std::cout <<
">>>>> E matrices constructed." << std::endl;
2924 std::stringstream hlpSS;
2925 hlpSS <<
"<font color=\"green\">" <<
"Shell integration complete." <<
"</font>";
2926 rvapi_set_text ( hlpSS.str().c_str(),
2939 std::cout <<
">>>>> Inverse SO(3) Fourier transform map obtained." << std::endl;
2943 std::stringstream hlpSS;
2944 hlpSS <<
"<font color=\"green\">" <<
"SO(3) Fourier Transform computed." <<
"</font>";
2945 rvapi_set_text ( hlpSS.str().c_str(),
2956 this->peakHeightNoIQRs,
2958 this->peakSurroundingPoints,
2959 this->peakDistanceForReal,
2963 std::cout <<
">> Peaks obtained." << std::endl;
2967 std::stringstream hlpSS;
2968 hlpSS <<
"<font color=\"green\">" <<
"Rotation map peaks detection complete." <<
"</font>";
2969 rvapi_set_text ( hlpSS.str().c_str(),
2982 this->aaErrorTolerance,
2989 std::cout <<
"C symmetries detected." << std::endl;
2993 std::stringstream hlpSS;
2994 hlpSS <<
"<font color=\"green\">" <<
"Cyclic symmetries detected." <<
"</font>";
2995 rvapi_set_text ( hlpSS.str().c_str(),
3007 bool foundFold =
false;
3008 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cnSymm.size() ); iter++ )
3010 if ( this->cnSymm.at(iter)[0] == settings->
symmetryFold ) { foundFold =
true; }
3017 std::cout <<
">>>>> The requested fold was not found. Searching for it specifically." << std::endl;
3020 double mapPeakHeight = 0.0;
3021 double mapPeakMax = 0.0;
3022 unsigned int iterMax = 0;
3023 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cnSymm.size() ); iter++ )
3026 this->cnSymm.at(iter)[2],
3027 this->cnSymm.at(iter)[3],
3030 if ( mapPeakMax < mapPeakHeight ) { mapPeakMax = mapPeakHeight; iterMax = iter; }
3033 if ( this->cnSymm.size() > 0 )
3035 if ( mapPeakMax > ( this->cnSymm.at(iterMax)[4] * ( 1.0 - settings->
symGapTolerance ) ) )
3037 std::array<double,5> hlpArr;
3038 hlpArr[0] =
static_cast<double> ( settings->
symmetryFold );
3039 hlpArr[1] = this->cnSymm.at(iterMax)[1];
3040 hlpArr[2] = this->cnSymm.at(iterMax)[2];
3041 hlpArr[3] = this->cnSymm.at(iterMax)[3];
3042 hlpArr[4] = mapPeakMax;
3043 this->cnSymm.emplace_back ( hlpArr );
3050 this->dnSymm = cmpObj->
findDnSymmetry ( this->cnSymm , this->aaErrorTolerance );
3051 if ( this->cnSymm.size() != 0 )
3053 this->cnSymmClear = cmpObj->
findCnSymmetryClear ( this->cnSymm, settings, this->symGapTolerance, &this->printFull );
3055 if ( this->dnSymm.size() != 0 )
3057 this->dnSymmClear = cmpObj->
findDnSymmetryClear ( this->dnSymm, settings, this->symGapTolerance, &this->printFull );
3061 std::cout <<
"D symmetries detected." << std::endl;
3065 std::stringstream hlpSS;
3066 hlpSS <<
"<font color=\"green\">" <<
"Dihedral symmetries detected." <<
"</font>";
3067 rvapi_set_text ( hlpSS.str().c_str(),
3078 this->icosSymm = cmpObj->
findIcosSymmetry ( this->cnSymm, &this->icosSymmPeakAvg, this->aaErrorTolerance );
3079 this->octaSymm = cmpObj->
findOctaSymmetry ( this->cnSymm, &this->octaSymmPeakAvg, this->aaErrorTolerance );
3080 this->tetrSymm = cmpObj->
findTetrSymmetry ( this->cnSymm, &this->tetrSymmPeakAvg, this->aaErrorTolerance );
3083 std::cout <<
"T, O and I symmetries detected." << std::endl;
3087 std::stringstream hlpSS;
3088 hlpSS <<
"<font color=\"green\">" <<
"Tetrahedral, Octahedral and Icosahedral symmetries detected." <<
"</font>";
3089 rvapi_set_text ( hlpSS.str().c_str(),
3099 if ( this->icosSymm.size() > 0 )
3101 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosSymm.size() ); icoIt++ )
3103 this->icosAxes = this->generateIcosAxes ( cmpObj, settings, this->icosSymm.at(icoIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3105 if ( this->icosAxes.size() == 31 )
3110 if ( this->icosAxes.size() != 31 )
3112 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;
3116 this->icosElems = this->generateIcosElements ( this->icosAxes, settings, settings->
verbose );
3120 if ( ( ( this->octaSymm.size() > 0 ) && ( this->icosAxes.size() == 0 ) ) ||
3121 ( ( settings->
symmetryType ==
"O" ) && ( this->octaSymm.size() > 0 ) ) )
3123 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaSymm.size() ); octIt++ )
3125 this->octaAxes = this->generateOctaAxes ( cmpObj, settings, this->octaSymm.at(octIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3127 if ( this->octaAxes.size() == 13 )
3132 if ( this->octaAxes.size() != 13 )
3134 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;
3138 this->octaElems = this->generateOctaElements ( this->octaAxes, settings, settings->
verbose );
3142 if ( ( ( this->tetrSymm.size() > 0 ) && ( this->octaAxes.size() == 0 ) && ( this->icosAxes.size() == 0 ) ) ||
3143 ( ( settings->
symmetryType ==
"T" ) && ( this->tetrSymm.size() > 0 ) ) )
3145 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrSymm.size() ); tetIt++ )
3147 this->tetrAxes = this->generateTetrAxes ( cmpObj, settings, this->tetrSymm.at(tetIt), this->cnSymm, this->aaErrorTolerance, settings->
verbose );
3149 if ( this->tetrAxes.size() == 6 )
3154 if ( this->tetrAxes.size() != 6 )
3156 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;
3160 this->tetrElems = this->generateTetrElements ( this->tetrAxes, settings, settings->
verbose );
3166 std::cout <<
">> Generation of T, O and I symmetry group elements complete." << std::endl;
3171 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
3172 std::cout <<
"| COMPLETED |" << std::endl;
3173 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
3178 std::stringstream hlpSS;
3179 hlpSS <<
"<font color=\"green\">" <<
"Symmetry detection completed." <<
"</font>";
3180 rvapi_set_text ( hlpSS.str().c_str(),
3191 this->inputStructureDataType = symStr->_fromPDB;
3220 printf (
"-----------------------------------------------------------\n" );
3221 printf (
"| RESULTS |\n" );
3222 printf (
"-----------------------------------------------------------\n\n" );
3225 if ( symmetryType ==
"I" )
3227 if ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 )
3229 printf (
"Detected Icosahedral symmetry as requested\n\n" );
3230 printf (
"Symmetry axes table:\n" );
3231 printf (
"-----------------------------------------------------------\n" );
3232 printf (
"Symmetry Fold x y z Angle Peak\n" );
3233 printf (
" Type height\n" );
3234 printf (
"-----------------------------------------------------------\n" );
3236 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3238 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] );
3242 printf (
"Symmetry elements table:\n" );
3243 printf (
"-----------------------------------------------------------\n" );
3244 printf (
"Symmetry x y z Angle \n" );
3245 printf (
" Type (deg) \n" );
3246 printf (
"-----------------------------------------------------------\n" );
3248 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3250 if ( this->icosElems.at(icoIt)[0] != 1.0 )
3252 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] );
3256 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] );
3263 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;
3267 if ( symmetryType ==
"O" )
3269 if ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 )
3271 printf (
"Detected (Cub)octahedral 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 octIt = 0; octIt < static_cast<unsigned int> ( this->octaAxes.size() ); octIt++ )
3280 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] );
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 octIt = 0; octIt < static_cast<unsigned int> ( this->octaElems.size() ); octIt++ )
3292 if ( this->octaElems.at(octIt)[0] != 1.0 )
3294 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] );
3298 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] );
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.\n\n" << std::endl << std::endl;
3309 if ( symmetryType ==
"T" )
3311 if ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 )
3313 printf (
"Detected Tetrahedral 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 tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrAxes.size() ); tetIt++ )
3322 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] );
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 tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrElems.size() ); tetIt++ )
3334 if ( this->tetrElems.at(tetIt)[0] != 1.0 )
3336 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] );
3340 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] );
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 ==
"D" )
3353 if ( static_cast<unsigned int> ( this->dnSymm.size() ) > 0 )
3355 bool reqFound =
false;
3356 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->dnSymm.size() ); dIt++ )
3358 if ( reqFound ) {
break; }
3359 unsigned int howManyTwos = 0;
3360 for (
unsigned int dItt = 0; dItt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); dItt++ )
3362 if ( reqFound ) {
break; }
3363 if ( symmetryFold != 2 )
3365 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold )
3367 printf (
"Detected Dihedral symmetry as requested\n\n" );
3368 printf (
"Symmetry axes table:\n" );
3369 printf (
"-----------------------------------------------------------\n" );
3370 printf (
"Symmetry Fold x y z Angle Peak\n" );
3371 printf (
" Type height\n" );
3372 printf (
"-----------------------------------------------------------\n" );
3373 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
3375 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] );
3380 printf (
"Symmetry elements table:\n" );
3381 printf (
"-----------------------------------------------------------\n" );
3382 printf (
"Symmetry x y z Angle \n" );
3383 printf (
" Type (deg) \n" );
3384 printf (
"-----------------------------------------------------------\n" );
3386 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3387 for (
unsigned int it = 0; it < 2; it++ )
3389 if ( static_cast<int> ( this->dnSymm.at(0).at(it)[0] ) % 2 == 0 )
3391 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++ )
3393 if ( iter == 0 ) {
continue; }
3394 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
3395 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] ) ) );
3400 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++ )
3402 if ( iter == 0 ) {
continue; }
3403 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] ) ) );
3414 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
3424 if ( symmetryFold == 2 )
3426 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
3430 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold && howManyTwos == 2 )
3432 printf (
"Detected Dihedral symmetry as requested\n\n" );
3433 printf (
"Symmetry axes table:\n" );
3434 printf (
"-----------------------------------------------------------\n" );
3435 printf (
"Symmetry Fold x y z Angle Peak\n" );
3436 printf (
" Type height\n" );
3437 printf (
"-----------------------------------------------------------\n" );
3438 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
3440 if ( this->dnSymm.at(dIt).at(it)[0] == 2.0 )
3442 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] );
3448 printf (
"Symmetry elements table:\n" );
3449 printf (
"-----------------------------------------------------------\n" );
3450 printf (
"Symmetry x y z Angle \n" );
3451 printf (
" Type (deg) \n" );
3452 printf (
"-----------------------------------------------------------\n" );
3454 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3455 for (
unsigned int it = 0; it < 2; it++ )
3457 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
3459 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++ )
3461 if ( iter == 0 ) {
continue; }
3462 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
3463 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] ) ) );
3468 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++ )
3470 if ( iter == 0 ) {
continue; }
3471 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] ) ) );
3485 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;
3490 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;
3494 if ( symmetryType ==
"C" )
3496 if ( static_cast<unsigned int> ( this->cnSymm.size() ) > 0 )
3498 bool reqFound =
false;
3499 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->cnSymm.size() ); dIt++ )
3501 if ( this->cnSymm.at(dIt)[0] == symmetryFold )
3503 printf (
"Detected Cyclic symmetry as requested\n\n" );
3504 printf (
"Symmetry axes table:\n" );
3505 printf (
"-----------------------------------------------------------\n" );
3506 printf (
"Symmetry Fold x y z Angle Peak\n" );
3507 printf (
" Type height\n" );
3508 printf (
"-----------------------------------------------------------\n" );
3509 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] ) );
3513 printf (
"Symmetry elements table:\n" );
3514 printf (
"-----------------------------------------------------------\n" );
3515 printf (
"Symmetry x y z Angle \n" );
3516 printf (
" Type (deg) \n" );
3517 printf (
"-----------------------------------------------------------\n" );
3519 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
3520 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
3522 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++ )
3524 if ( iter == 0 ) {
continue; }
3525 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
3526 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] ) ) );
3531 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++ )
3533 if ( iter == 0 ) {
continue; }
3534 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] ) ) );
3544 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;
3549 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;
3554 printf (
"Alternatives:\n" );
3555 printf (
"-----------------------------------------------------------\n" );
3556 printf (
"Symmetry Fold x y z Angle Peak\n" );
3557 printf (
" Type height\n" );
3558 printf (
"-----------------------------------------------------------\n" );
3559 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
3561 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] ) );
3564 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
3566 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] );
3568 for (
unsigned int mem = 1; mem < static_cast<unsigned int> ( this->dnSymm.at(iter).size() ); mem++ )
3570 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] );
3574 if ( this->tetrElems.size() > 0 )
3576 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->tetrSymm.size() ); iter++ )
3578 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] );
3579 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] );
3583 if ( this->octaElems.size() > 0 )
3585 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->octaSymm.size() ); iter++ )
3587 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] );
3588 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] );
3592 if ( this->icosElems.size() > 0 )
3594 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->icosSymm.size() ); iter++ )
3596 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] );
3597 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] );
3600 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
3620 unsigned int symmetryFold,
3627 rvapi_add_section (
"ReviewSection",
3637 std::stringstream hlpSS;
3638 hlpSS <<
"<pre>" <<
"Requested symmetry : ";
3639 if ( symmetryType ==
"I" )
3641 hlpSS <<
"Icosahedral" <<
"</pre>";
3643 if ( symmetryType ==
"O" )
3645 hlpSS <<
"Octahedral" <<
"</pre>";
3647 if ( symmetryType ==
"T" )
3649 hlpSS <<
"Tetrahedral" <<
"</pre>";
3651 if ( symmetryType ==
"D" )
3653 hlpSS <<
"Dihedral with fold " << ProSHADE_internal_misc::to_string_with_precision ( symmetryFold ) <<
"</pre>";
3655 if ( symmetryType ==
"C" )
3657 hlpSS <<
"Cyclic with fold " << ProSHADE_internal_misc::to_string_with_precision ( symmetryFold ) <<
"</pre>";
3661 rvapi_set_text ( hlpSS.str().c_str(),
3668 hlpSS.str ( std::string ( ) );
3669 hlpSS <<
"<pre>" <<
"Input structure : " << this->structFiles.at(0) <<
"</pre>";
3670 rvapi_set_text ( hlpSS.str().c_str(),
3679 rvapi_add_section (
"ResultsSection",
3691 bool foundRequest =
true;
3693 if ( symmetryType ==
"I" )
3695 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
3697 std::stringstream hlpSS;
3698 hlpSS <<
"<b>" <<
"Detected <i>ICOSAHEDRAL<i> symmetry as requested." <<
"</b>";
3699 rvapi_set_text ( hlpSS.str().c_str(),
3708 rvapi_add_table (
"SymmetryTypeTable",
3709 "Detected symmetry axes",
3713 static_cast<unsigned int> ( this->icosAxes.size() ),
3720 hlpSS.str ( std::string ( ) );
3721 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
3722 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
3725 hlpSS.str ( std::string ( ) );
3726 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
3727 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
3730 hlpSS.str ( std::string ( ) );
3731 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
3732 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3735 hlpSS.str ( std::string ( ) );
3736 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
3737 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3740 hlpSS.str ( std::string ( ) );
3741 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
3742 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3745 hlpSS.str ( std::string ( ) );
3746 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
3747 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
3750 hlpSS.str ( std::string ( ) );
3751 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.";
3752 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
3756 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3758 std::stringstream hlpSS2;
3759 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
3760 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
3765 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
3767 std::stringstream hlpSS2;
3769 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
3771 hlpSS2.str ( std::string ( ) );
3772 hlpSS2 << static_cast<int> ( this->icosAxes.at(icoIt)[0] );
3773 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
3775 hlpSS2.str ( std::string ( ) );
3776 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[1], prec );
3777 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
3779 hlpSS2.str ( std::string ( ) );
3780 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[2], prec );
3781 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
3783 hlpSS2.str ( std::string ( ) );
3784 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[3], prec );
3785 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
3787 hlpSS2.str ( std::string ( ) );
3788 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 );
3789 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
3791 hlpSS2.str ( std::string ( ) );
3792 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[4], prec );
3793 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
3797 rvapi_add_table (
"SymmetryElementsTable",
3798 "Detected symmetry elements",
3800 static_cast<unsigned int> ( this->icosAxes.size() ) + 1,
3802 static_cast<unsigned int> ( this->icosElems.size() ),
3805 totTabRows =
static_cast<unsigned int> ( this->icosAxes.size() ) + 1 + static_cast<unsigned int> ( this->icosElems.size() );
3810 hlpSS.str ( std::string ( ) );
3811 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
3812 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
3815 hlpSS.str ( std::string ( ) );
3816 hlpSS <<
"This column states the symmetry element fold.";
3817 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
3820 hlpSS.str ( std::string ( ) );
3821 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
3822 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3825 hlpSS.str ( std::string ( ) );
3826 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
3827 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3830 hlpSS.str ( std::string ( ) );
3831 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
3832 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3835 hlpSS.str ( std::string ( ) );
3836 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
3837 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
3841 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3843 std::stringstream hlpSS2;
3844 hlpSS2 <<
"Symmetry element #" << icoIt+1;
3845 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
3849 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
3851 if ( this->icosElems.at(icoIt)[0] != 1.0 )
3853 std::stringstream hlpSS3;
3855 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
3859 std::stringstream hlpSS3;
3861 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
3864 std::stringstream hlpSS2;
3865 hlpSS2 << static_cast<int> ( this->icosElems.at(icoIt)[0] );
3866 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
3868 hlpSS2.str ( std::string ( ) );
3869 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[1], prec );
3870 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
3872 hlpSS2.str ( std::string ( ) );
3873 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[2], prec );
3874 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
3876 hlpSS2.str ( std::string ( ) );
3877 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[3], prec );
3878 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
3880 hlpSS2.str ( std::string ( ) );
3881 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[4], prec );
3882 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
3889 std::stringstream hlpSS;
3890 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>";
3891 rvapi_set_text ( hlpSS.str().c_str(),
3898 foundRequest =
false;
3902 if ( symmetryType ==
"O" )
3904 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->octaElems.size() ) > 0 ) )
3907 std::stringstream hlpSS;
3908 hlpSS <<
"<b>" <<
"Detected <i>OCTAHEDRAL</i> symmetry as requested." <<
"</b>";
3909 rvapi_set_text ( hlpSS.str().c_str(),
3918 rvapi_add_table (
"SymmetryTypeTable",
3919 "Detected symmetry axes",
3923 static_cast<unsigned int> ( this->octaAxes.size() ),
3930 hlpSS.str ( std::string ( ) );
3931 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
3932 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
3935 hlpSS.str ( std::string ( ) );
3936 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
3937 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
3940 hlpSS.str ( std::string ( ) );
3941 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
3942 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
3945 hlpSS.str ( std::string ( ) );
3946 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
3947 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
3950 hlpSS.str ( std::string ( ) );
3951 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
3952 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
3955 hlpSS.str ( std::string ( ) );
3956 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
3957 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
3960 hlpSS.str ( std::string ( ) );
3961 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.";
3962 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
3966 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
3968 std::stringstream hlpSS2;
3969 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
3970 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
3975 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
3977 std::stringstream hlpSS2;
3979 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
3981 hlpSS2.str ( std::string ( ) );
3982 hlpSS2 << static_cast<int> ( this->octaAxes.at(icoIt)[0] );
3983 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
3985 hlpSS2.str ( std::string ( ) );
3986 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[1], prec );
3987 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
3989 hlpSS2.str ( std::string ( ) );
3990 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[2], prec );
3991 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
3993 hlpSS2.str ( std::string ( ) );
3994 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[3], prec );
3995 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
3997 hlpSS2.str ( std::string ( ) );
3998 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 );
3999 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
4001 hlpSS2.str ( std::string ( ) );
4002 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[4], prec );
4003 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
4007 rvapi_add_table (
"SymmetryElementsTable",
4008 "Detected symmetry elements",
4010 static_cast<unsigned int> ( this->octaAxes.size() ) + 1,
4012 static_cast<unsigned int> ( this->octaElems.size() ),
4015 totTabRows =
static_cast<unsigned int> ( this->octaAxes.size() ) + 1 + static_cast<unsigned int> ( this->octaElems.size() );
4020 hlpSS.str ( std::string ( ) );
4021 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4022 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4025 hlpSS.str ( std::string ( ) );
4026 hlpSS <<
"This column states the symmetry element fold.";
4027 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4030 hlpSS.str ( std::string ( ) );
4031 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4032 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4035 hlpSS.str ( std::string ( ) );
4036 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4037 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4040 hlpSS.str ( std::string ( ) );
4041 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4042 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4045 hlpSS.str ( std::string ( ) );
4046 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4047 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4051 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
4053 std::stringstream hlpSS2;
4054 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4055 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4059 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
4061 if ( this->octaElems.at(icoIt)[0] != 1.0 )
4063 std::stringstream hlpSS3;
4065 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
4069 std::stringstream hlpSS3;
4071 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
4074 std::stringstream hlpSS2;
4075 hlpSS2 << static_cast<int> ( this->octaElems.at(icoIt)[0] );
4076 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
4078 hlpSS2.str ( std::string ( ) );
4079 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[1], prec );
4080 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
4082 hlpSS2.str ( std::string ( ) );
4083 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[2], prec );
4084 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
4086 hlpSS2.str ( std::string ( ) );
4087 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[3], prec );
4088 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
4090 hlpSS2.str ( std::string ( ) );
4091 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[4], prec );
4092 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
4099 std::stringstream hlpSS;
4100 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>";
4101 rvapi_set_text ( hlpSS.str().c_str(),
4108 foundRequest =
false;
4112 if ( symmetryType ==
"T" )
4114 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
4117 std::stringstream hlpSS;
4118 hlpSS <<
"<b>" <<
"Detected <i>TETRAHEDRAL</i> symmetry as requested." <<
"</b>";
4119 rvapi_set_text ( hlpSS.str().c_str(),
4128 rvapi_add_table (
"SymmetryTypeTable",
4129 "Detected symmetry axes",
4133 static_cast<unsigned int> ( this->tetrAxes.size() ),
4140 hlpSS.str ( std::string ( ) );
4141 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4142 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4145 hlpSS.str ( std::string ( ) );
4146 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4147 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4150 hlpSS.str ( std::string ( ) );
4151 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4152 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4155 hlpSS.str ( std::string ( ) );
4156 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4157 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4160 hlpSS.str ( std::string ( ) );
4161 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4162 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4165 hlpSS.str ( std::string ( ) );
4166 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4167 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4170 hlpSS.str ( std::string ( ) );
4171 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.";
4172 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4176 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
4178 std::stringstream hlpSS2;
4179 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
4180 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
4185 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
4187 std::stringstream hlpSS2;
4189 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
4191 hlpSS2.str ( std::string ( ) );
4192 hlpSS2 << static_cast<int> ( this->tetrAxes.at(icoIt)[0] );
4193 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
4195 hlpSS2.str ( std::string ( ) );
4196 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[1], prec );
4197 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
4199 hlpSS2.str ( std::string ( ) );
4200 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[2], prec );
4201 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
4203 hlpSS2.str ( std::string ( ) );
4204 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[3], prec );
4205 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
4207 hlpSS2.str ( std::string ( ) );
4208 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 );
4209 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
4211 hlpSS2.str ( std::string ( ) );
4212 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[4], prec );
4213 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
4217 rvapi_add_table (
"SymmetryElementsTable",
4218 "Detected symmetry elements",
4220 static_cast<unsigned int> ( this->tetrAxes.size() ) + 1,
4222 static_cast<unsigned int> ( this->tetrElems.size() ),
4225 totTabRows =
static_cast<unsigned int> ( this->tetrAxes.size() ) + 1 + static_cast<unsigned int> ( this->tetrElems.size() );
4230 hlpSS.str ( std::string ( ) );
4231 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4232 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4235 hlpSS.str ( std::string ( ) );
4236 hlpSS <<
"This column states the symmetry element fold.";
4237 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4240 hlpSS.str ( std::string ( ) );
4241 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4242 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4245 hlpSS.str ( std::string ( ) );
4246 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4247 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4250 hlpSS.str ( std::string ( ) );
4251 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4252 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4255 hlpSS.str ( std::string ( ) );
4256 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4257 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4261 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
4263 std::stringstream hlpSS2;
4264 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4265 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4269 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
4271 std::stringstream hlpSS3;
4272 if ( this->tetrElems.at(icoIt)[0] != 1.0 )
4274 std::stringstream hlpSS2;
4276 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
4280 std::stringstream hlpSS2;
4282 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
4285 hlpSS3.str ( std::string ( ) );
4286 hlpSS3 << static_cast<int> ( this->tetrElems.at(icoIt)[0] );
4287 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 1 );
4289 hlpSS3.str ( std::string ( ) );
4290 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[1], prec );
4291 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 2 );
4293 hlpSS3.str ( std::string ( ) );
4294 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[2], prec );
4295 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 3 );
4297 hlpSS3.str ( std::string ( ) );
4298 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[3], prec );
4299 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 4 );
4301 hlpSS3.str ( std::string ( ) );
4302 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[4], prec );
4303 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 5 );
4310 std::stringstream hlpSS;
4311 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>";
4312 rvapi_set_text ( hlpSS.str().c_str(),
4319 foundRequest =
false;
4323 if ( symmetryType ==
"D" )
4325 if ( static_cast<unsigned int> ( this->dnSymm.size() ) > 0 )
4327 bool reqFound =
false;
4328 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->dnSymm.size() ); dIt++ )
4330 if ( reqFound ) {
break; }
4331 unsigned int howManyTwos = 0;
4332 for (
unsigned int dItt = 0; dItt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); dItt++ )
4334 if ( reqFound ) {
break; }
4335 if ( symmetryFold != 2 )
4337 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold )
4339 std::stringstream hlpSS;
4340 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry as requested." <<
"</b>";
4341 rvapi_set_text ( hlpSS.str().c_str(),
4350 rvapi_add_table (
"SymmetryTypeTable",
4351 "Detected symmetry axes",
4355 this->dnSymm.at(dIt).size(),
4362 hlpSS.str ( std::string ( ) );
4363 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4364 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4367 hlpSS.str ( std::string ( ) );
4368 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4369 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4372 hlpSS.str ( std::string ( ) );
4373 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4374 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4377 hlpSS.str ( std::string ( ) );
4378 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4379 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4382 hlpSS.str ( std::string ( ) );
4383 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4384 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4387 hlpSS.str ( std::string ( ) );
4388 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4389 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4392 hlpSS.str ( std::string ( ) );
4393 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.";
4394 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4398 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); icoIt++ )
4400 hlpSS.str ( std::string ( ) );
4401 hlpSS <<
"Symmetry axis #" << icoIt+1;
4402 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", icoIt );
4407 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4409 std::stringstream hlpSS2;
4411 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 0 );
4413 hlpSS2.str ( std::string ( ) );
4414 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4415 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 1 );
4417 hlpSS2.str ( std::string ( ) );
4418 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4419 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 2 );
4421 hlpSS2.str ( std::string ( ) );
4422 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4423 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 3 );
4425 hlpSS2.str ( std::string ( ) );
4426 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4427 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 4 );
4429 hlpSS2.str ( std::string ( ) );
4430 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 );
4431 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 5 );
4433 hlpSS2.str ( std::string ( ) );
4434 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[4], prec );
4435 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), it, 6 );
4440 for (
unsigned int it = 0; it < 2; it++ )
4442 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4444 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++ )
4446 if ( iter == 0 ) {
continue; }
4447 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4454 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++ )
4456 if ( iter == 0 ) {
continue; }
4464 rvapi_add_table (
"SymmetryElementsTable",
4465 "Detected symmetry elements",
4467 this->dnSymm.at(dIt).size() + 1,
4472 totTabRows =
static_cast<unsigned int> ( totRows ) + this->dnSymm.at(dIt).size() + 1;
4477 hlpSS.str ( std::string ( ) );
4478 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4479 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4482 hlpSS.str ( std::string ( ) );
4483 hlpSS <<
"This column states the symmetry element fold.";
4484 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4487 hlpSS.str ( std::string ( ) );
4488 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4489 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4492 hlpSS.str ( std::string ( ) );
4493 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4494 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4497 hlpSS.str ( std::string ( ) );
4498 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4499 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4502 hlpSS.str ( std::string ( ) );
4503 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4504 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4508 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
4510 std::stringstream hlpSS2;
4511 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4512 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4518 hlpSS.str ( std::string ( ) );
4520 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
4522 hlpSS.str ( std::string ( ) );
4523 hlpSS << static_cast<int> ( 1 );
4524 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
4526 hlpSS.str ( std::string ( ) );
4527 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
4528 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
4530 hlpSS.str ( std::string ( ) );
4531 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4532 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
4534 hlpSS.str ( std::string ( ) );
4535 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4536 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
4538 hlpSS.str ( std::string ( ) );
4539 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4540 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
4542 for (
unsigned int it = 0; it < 2; it++ )
4544 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4546 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++ )
4548 if ( iter == 0 ) {
continue; }
4549 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4551 std::stringstream hlpSS2;
4553 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4555 hlpSS2.str ( std::string ( ) );
4556 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4557 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4559 hlpSS2.str ( std::string ( ) );
4560 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4561 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4563 hlpSS2.str ( std::string ( ) );
4564 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4565 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4567 hlpSS2.str ( std::string ( ) );
4568 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4569 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4571 hlpSS2.str ( std::string ( ) );
4572 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 );
4573 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4579 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++ )
4581 if ( iter == 0 ) {
continue; }
4583 std::stringstream hlpSS2;
4585 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4587 hlpSS2.str ( std::string ( ) );
4588 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4589 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4591 hlpSS2.str ( std::string ( ) );
4592 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4593 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4595 hlpSS2.str ( std::string ( ) );
4596 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4597 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4599 hlpSS2.str ( std::string ( ) );
4600 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4601 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4603 hlpSS2.str ( std::string ( ) );
4604 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 );
4605 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4617 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
4627 if ( symmetryFold == 2 )
4629 if ( this->dnSymm.at(dIt).at(dItt)[0] == 2 )
4633 if ( this->dnSymm.at(dIt).at(dItt)[0] == symmetryFold && howManyTwos == 2 )
4635 std::stringstream hlpSS;
4636 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry as requested." <<
"</b>";
4637 rvapi_set_text ( hlpSS.str().c_str(),
4646 rvapi_add_table (
"SymmetryTypeTable",
4647 "Detected symmetry axes",
4658 hlpSS.str ( std::string ( ) );
4659 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4660 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4663 hlpSS.str ( std::string ( ) );
4664 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4665 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
4668 hlpSS.str ( std::string ( ) );
4669 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
4670 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4673 hlpSS.str ( std::string ( ) );
4674 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
4675 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4678 hlpSS.str ( std::string ( ) );
4679 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
4680 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4683 hlpSS.str ( std::string ( ) );
4684 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
4685 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4688 hlpSS.str ( std::string ( ) );
4689 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.";
4690 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
4695 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); icoIt++ )
4697 if ( this->dnSymm.at(dIt).at(icoIt)[0] != 2 ) {
continue; }
4698 hlpSS.str ( std::string ( ) );
4699 hlpSS <<
"Symmetry axis #" << rCount;
4700 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", rCount-1 );
4707 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4709 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4711 std::stringstream hlpSS2;
4713 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 0 );
4715 hlpSS2.str ( std::string ( ) );
4716 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4717 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 1 );
4719 hlpSS2.str ( std::string ( ) );
4720 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4721 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 2 );
4723 hlpSS2.str ( std::string ( ) );
4724 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4725 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 3 );
4727 hlpSS2.str ( std::string ( ) );
4728 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4729 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 4 );
4731 hlpSS2.str ( std::string ( ) );
4732 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 );
4733 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 5 );
4735 hlpSS2.str ( std::string ( ) );
4736 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[4], prec );
4737 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), rCount, 6 );
4744 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4746 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4748 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4750 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++ )
4752 if ( iter == 0 ) {
continue; }
4753 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4760 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++ )
4762 if ( iter == 0 ) {
continue; }
4770 rvapi_add_table (
"SymmetryElementsTable",
4771 "Detected symmetry elements",
4773 this->dnSymm.at(dIt).size() + 1,
4778 totTabRows =
static_cast<unsigned int> ( totRows ) + this->dnSymm.at(dIt).size() + 1;
4783 hlpSS.str ( std::string ( ) );
4784 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
4785 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
4788 hlpSS.str ( std::string ( ) );
4789 hlpSS <<
"This column states the symmetry element fold.";
4790 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
4793 hlpSS.str ( std::string ( ) );
4794 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
4795 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
4798 hlpSS.str ( std::string ( ) );
4799 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
4800 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
4803 hlpSS.str ( std::string ( ) );
4804 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
4805 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
4808 hlpSS.str ( std::string ( ) );
4809 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
4810 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
4814 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
4816 std::stringstream hlpSS2;
4817 hlpSS2 <<
"Symmetry element #" << icoIt+1;
4818 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
4824 hlpSS.str ( std::string ( ) );
4826 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
4828 hlpSS.str ( std::string ( ) );
4829 hlpSS << static_cast<int> ( 1 );
4830 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
4832 hlpSS.str ( std::string ( ) );
4833 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
4834 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
4836 hlpSS.str ( std::string ( ) );
4837 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4838 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
4840 hlpSS.str ( std::string ( ) );
4841 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4842 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
4844 hlpSS.str ( std::string ( ) );
4845 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
4846 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
4848 for (
unsigned int it = 0; it < static_cast<unsigned int> ( this->dnSymm.at(dIt).size() ); it++ )
4850 if ( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) % 2 == 0 )
4852 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4854 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++ )
4856 if ( iter == 0 ) {
continue; }
4857 if ( iter == -std::ceil( static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] ) / 2.0 ) ) {
continue; }
4859 std::stringstream hlpSS2;
4861 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4863 hlpSS2.str ( std::string ( ) );
4864 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4865 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4867 hlpSS2.str ( std::string ( ) );
4868 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4869 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4871 hlpSS2.str ( std::string ( ) );
4872 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4873 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
4875 hlpSS2.str ( std::string ( ) );
4876 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[3], prec );
4877 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4879 hlpSS2.str ( std::string ( ) );
4880 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 );
4881 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4887 if ( this->dnSymm.at(dIt).at(it)[0] != 2 ) {
continue; }
4889 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++ )
4891 if ( iter == 0 ) {
continue; }
4893 std::stringstream hlpSS2;
4895 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
4897 hlpSS2.str ( std::string ( ) );
4898 hlpSS2 << static_cast<int> ( this->dnSymm.at(dIt).at(it)[0] );
4899 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
4901 hlpSS2.str ( std::string ( ) );
4902 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[1], prec );
4903 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
4905 hlpSS2.str ( std::string ( ) );
4906 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(dIt).at(it)[2], prec );
4907 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
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)[3], prec );
4911 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
4913 hlpSS2.str ( std::string ( ) );
4914 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 );
4915 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
4930 std::stringstream hlpSS;
4931 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>";
4932 rvapi_set_text ( hlpSS.str().c_str(),
4939 foundRequest =
false;
4944 std::stringstream hlpSS;
4945 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>";
4946 rvapi_set_text ( hlpSS.str().c_str(),
4953 foundRequest =
false;
4957 if ( symmetryType ==
"C" )
4959 if ( static_cast<unsigned int> ( this->cnSymm.size() ) > 0 )
4961 bool reqFound =
false;
4962 for (
unsigned int dIt = 0; dIt < static_cast<unsigned int> ( this->cnSymm.size() ); dIt++ )
4964 if ( this->cnSymm.at(dIt)[0] == symmetryFold )
4967 std::stringstream hlpSS;
4968 hlpSS <<
"<b>" <<
"Detected <i>CYCLIC</i> symmetry as requested." <<
"</b>";
4969 rvapi_set_text ( hlpSS.str().c_str(),
4978 rvapi_add_table (
"SymmetryTypeTable",
4979 "Detected symmetry axes",
4990 hlpSS.str ( std::string ( ) );
4991 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
4992 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
4995 hlpSS.str ( std::string ( ) );
4996 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
4997 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
5000 hlpSS.str ( std::string ( ) );
5001 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5002 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5005 hlpSS.str ( std::string ( ) );
5006 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5007 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5010 hlpSS.str ( std::string ( ) );
5011 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5012 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5015 hlpSS.str ( std::string ( ) );
5016 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5017 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5020 hlpSS.str ( std::string ( ) );
5021 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.";
5022 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
5026 hlpSS.str ( std::string ( ) );
5027 hlpSS <<
"Symmetry axis #" << 1;
5028 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS.str().c_str(),
"", 0 );
5032 hlpSS.str ( std::string ( ) );
5034 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 0 );
5036 hlpSS.str ( std::string ( ) );
5037 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5038 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 1 );
5040 hlpSS.str ( std::string ( ) );
5041 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5042 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 2 );
5044 hlpSS.str ( std::string ( ) );
5045 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5046 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 3 );
5048 hlpSS.str ( std::string ( ) );
5049 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5050 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 4 );
5052 hlpSS.str ( std::string ( ) );
5053 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 );
5054 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 5 );
5056 hlpSS.str ( std::string ( ) );
5057 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[4], prec );
5058 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 6 );
5062 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
5064 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++ )
5066 if ( iter == 0 ) {
continue; }
5067 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
5074 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++ )
5076 if ( iter == 0 ) {
continue; }
5083 rvapi_add_table (
"SymmetryElementsTable",
5084 "Detected symmetry elements",
5091 totTabRows =
static_cast<unsigned int> ( totRows ) + 3;
5096 hlpSS.str ( std::string ( ) );
5097 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
5098 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
5101 hlpSS.str ( std::string ( ) );
5102 hlpSS <<
"This column states the symmetry element fold.";
5103 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
5106 hlpSS.str ( std::string ( ) );
5107 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
5108 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5111 hlpSS.str ( std::string ( ) );
5112 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
5113 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5116 hlpSS.str ( std::string ( ) );
5117 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
5118 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5121 hlpSS.str ( std::string ( ) );
5122 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
5123 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5127 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
5129 std::stringstream hlpSS2;
5130 hlpSS2 <<
"Symmetry element #" << std::to_string ( icoIt+1 );
5131 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
5137 hlpSS.str ( std::string ( ) );
5139 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
5141 hlpSS.str ( std::string ( ) );
5142 hlpSS << static_cast<int> ( 1 );
5143 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
5145 hlpSS.str ( std::string ( ) );
5146 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
5147 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
5149 hlpSS.str ( std::string ( ) );
5150 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5151 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
5153 hlpSS.str ( std::string ( ) );
5154 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5155 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
5157 hlpSS.str ( std::string ( ) );
5158 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
5159 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
5161 if ( static_cast<int> ( this->cnSymm.at(dIt)[0] ) % 2 == 0 )
5163 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++ )
5165 if ( iter == 0 ) {
continue; }
5166 if ( iter == -std::ceil( static_cast<int> ( this->cnSymm.at(dIt)[0] ) / 2.0 ) ) {
continue; }
5168 hlpSS.str ( std::string ( ) );
5170 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
5172 hlpSS.str ( std::string ( ) );
5173 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5174 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
5176 hlpSS.str ( std::string ( ) );
5177 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5178 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
5180 hlpSS.str ( std::string ( ) );
5181 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5182 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
5184 hlpSS.str ( std::string ( ) );
5185 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5186 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
5188 hlpSS.str ( std::string ( ) );
5189 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 );
5190 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
5196 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++ )
5198 if ( iter == 0 ) {
continue; }
5200 hlpSS.str ( std::string ( ) );
5202 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
5204 hlpSS.str ( std::string ( ) );
5205 hlpSS << static_cast<int> ( this->cnSymm.at(dIt)[0] );
5206 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
5208 hlpSS.str ( std::string ( ) );
5209 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[1], prec );
5210 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
5212 hlpSS.str ( std::string ( ) );
5213 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[2], prec );
5214 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
5216 hlpSS.str ( std::string ( ) );
5217 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(dIt)[3], prec );
5218 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
5220 hlpSS.str ( std::string ( ) );
5221 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 );
5222 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
5234 std::stringstream hlpSS;
5235 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>";
5236 rvapi_set_text ( hlpSS.str().c_str(),
5243 foundRequest =
false;
5248 std::stringstream hlpSS;
5249 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>";
5250 rvapi_set_text ( hlpSS.str().c_str(),
5257 foundRequest =
false;
5264 rvapi_add_table (
"AlternativesTable",
5265 "Alternative Symmetries Detected",
5269 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ) +
5270 static_cast<unsigned int> ( this->tetrSymm.size() ) + static_cast<unsigned int> ( this->octaSymm.size() ) +
5271 static_cast<unsigned int> ( this->icosSymm.size() ),
5277 rvapi_add_table (
"AlternativesTable",
5278 "Alternative Symmetries Detected",
5282 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ) +
5283 static_cast<unsigned int> ( this->tetrSymm.size() ) + static_cast<unsigned int> ( this->octaSymm.size() ) +
5284 static_cast<unsigned int> ( this->icosSymm.size() ),
5292 std::stringstream hlpSS;
5293 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D).";
5294 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
5297 hlpSS.str ( std::string ( ) );
5298 hlpSS <<
"This column states the symmetry fold.";
5299 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
5302 hlpSS.str ( std::string ( ) );
5303 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5304 rvapi_put_horz_theader (
"AlternativesTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5307 hlpSS.str ( std::string ( ) );
5308 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5309 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5312 hlpSS.str ( std::string ( ) );
5313 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5314 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5317 hlpSS.str ( std::string ( ) );
5318 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5319 rvapi_put_horz_theader (
"AlternativesTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5322 hlpSS.str ( std::string ( ) );
5323 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.";
5324 rvapi_put_horz_theader (
"AlternativesTable",
"Peak Height", hlpSS.str().c_str(), columnIter );
5330 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5332 std::stringstream hlpSS2;
5333 hlpSS2 <<
"Alternative Symmetry #" << gNo+1;
5334 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", gNo );
5337 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5339 std::stringstream hlpSS2;
5340 hlpSS2 <<
"Alternative Symmetry #" << iter + maxCAlts + 2;
5341 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", iter + maxCAlts + 1 );
5342 maxDAlts = iter + maxCAlts;
5345 if ( static_cast<int> ( this->tetrElems.size() ) > 0 )
5347 std::stringstream hlpSS2;
5348 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5349 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5352 if ( static_cast<int> ( this->octaElems.size() ) > 0 )
5354 std::stringstream hlpSS2;
5355 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5356 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5359 if ( static_cast<int> ( this->icosElems.size() ) > 0 )
5361 std::stringstream hlpSS2;
5362 hlpSS2 <<
"Alternative Symmetry #" << maxDAlts + 2;
5363 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", maxDAlts + 1 );
5369 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5371 std::stringstream hlpSS2;
5373 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5375 hlpSS2.str ( std::string ( ) );
5376 hlpSS2 << static_cast<int> (
static_cast<int> ( this->cnSymm.at(gNo)[0] ) );
5377 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5379 hlpSS2.str ( std::string ( ) );
5380 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[1], prec );
5381 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5383 hlpSS2.str ( std::string ( ) );
5384 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[2], prec );
5385 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5387 hlpSS2.str ( std::string ( ) );
5388 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[3], prec );
5389 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5391 hlpSS2.str ( std::string ( ) );
5392 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 );
5393 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5395 hlpSS2.str ( std::string ( ) );
5396 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->cnSymm.at(gNo)[4] ), prec );
5397 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5401 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5403 std::stringstream hlpSS2;
5405 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5407 hlpSS2.str ( std::string ( ) );
5408 hlpSS2 << static_cast<int> (
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ) );
5409 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5411 hlpSS2.str ( std::string ( ) );
5412 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[1], prec );
5413 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5415 hlpSS2.str ( std::string ( ) );
5416 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[2], prec );
5417 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5419 hlpSS2.str ( std::string ( ) );
5420 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[3], prec );
5421 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5423 hlpSS2.str ( std::string ( ) );
5424 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 );
5425 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5427 hlpSS2.str ( std::string ( ) );
5428 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->dnSymm.at(iter).at(0)[4] ), prec );
5429 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5433 if ( static_cast<int> ( this->tetrElems.size() ) > 0 )
5435 std::stringstream hlpSS2;
5437 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5439 hlpSS2.str ( std::string ( ) );
5441 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5443 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5445 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5447 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5449 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5451 hlpSS2.str ( std::string ( ) );
5452 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->tetrSymm.at(0).at(0)[4] ), prec );
5453 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5457 if ( static_cast<int> ( this->octaElems.size() ) > 0 )
5459 std::stringstream hlpSS2;
5461 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5463 hlpSS2.str ( std::string ( ) );
5465 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5467 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5469 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5471 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5473 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5475 hlpSS2.str ( std::string ( ) );
5476 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->octaSymm.at(0).at(0)[4] ), prec );
5477 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5481 if ( static_cast<int> ( this->icosElems.size() ) > 0 )
5483 std::stringstream hlpSS2;
5485 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
5487 hlpSS2.str ( std::string ( ) );
5489 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
5491 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
5493 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
5495 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
5497 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
5499 hlpSS2.str ( std::string ( ) );
5500 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->icosSymm.at(0).at(0)[4] ), prec );
5501 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
5527 printf (
"-----------------------------------------------------------\n" );
5528 printf (
"| RESULTS |\n" );
5529 printf (
"-----------------------------------------------------------\n\n" );
5532 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->icosElems.size() ) == 0 ) )
5534 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" );
5537 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
5539 printf (
"Detected Icosahedral symmetry\n\n" );
5540 printf (
"Symmetry axes table:\n" );
5541 printf (
"-----------------------------------------------------------\n" );
5542 printf (
"Symmetry Fold x y z Angle Peak\n" );
5543 printf (
" Type height\n" );
5544 printf (
"-----------------------------------------------------------\n" );
5546 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5548 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] );
5552 printf (
"Symmetry elements table:\n" );
5553 printf (
"-----------------------------------------------------------\n" );
5554 printf (
"Symmetry x y z Angle \n" );
5555 printf (
" Type (deg) \n" );
5556 printf (
"-----------------------------------------------------------\n" );
5558 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
5560 if ( this->icosElems.at(icoIt)[0] != 1.0 )
5562 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] );
5566 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] );
5573 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
5575 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" );
5578 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) > 0 ) )
5580 printf (
"Detected (Cub)octahedral symmetry\n\n" );
5581 printf (
"Symmetry axes table:\n" );
5582 printf (
"-----------------------------------------------------------\n" );
5583 printf (
"Symmetry Fold x y z Angle Peak\n" );
5584 printf (
" Type height\n" );
5585 printf (
"-----------------------------------------------------------\n" );
5587 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaAxes.size() ); octIt++ )
5589 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] );
5593 printf (
"Symmetry elements table:\n" );
5594 printf (
"-----------------------------------------------------------\n" );
5595 printf (
"Symmetry x y z Angle \n" );
5596 printf (
" Type (deg) \n" );
5597 printf (
"-----------------------------------------------------------\n" );
5599 for (
unsigned int octIt = 0; octIt < static_cast<unsigned int> ( this->octaElems.size() ); octIt++ )
5601 if ( this->octaElems.at(octIt)[0] != 1.0 )
5603 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] );
5607 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] );
5614 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->tetrElems.size() ) == 0 ) )
5616 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
5618 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" );
5622 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && (
static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
5624 printf (
"Detected Tetrahedral symmetry\n\n" );
5625 printf (
"Symmetry axes table:\n" );
5626 printf (
"-----------------------------------------------------------\n" );
5627 printf (
"Symmetry Fold x y z Angle Peak\n" );
5628 printf (
" Type height\n" );
5629 printf (
"-----------------------------------------------------------\n" );
5631 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrAxes.size() ); tetIt++ )
5633 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] );
5637 printf (
"Symmetry elements table:\n" );
5638 printf (
"-----------------------------------------------------------\n" );
5639 printf (
"Symmetry x y z Angle \n" );
5640 printf (
" Type (deg) \n" );
5641 printf (
"-----------------------------------------------------------\n" );
5643 for (
unsigned int tetIt = 0; tetIt < static_cast<unsigned int> ( this->tetrElems.size() ); tetIt++ )
5645 if ( this->tetrElems.at(tetIt)[0] != 1.0 )
5647 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] );
5651 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] );
5658 if ( static_cast<unsigned int> ( this->dnSymmClear.size() ) > 0 )
5660 printf (
"Detected Dihedral symmetry\n\n" );
5661 printf (
"Symmetry axes table:\n" );
5662 printf (
"-----------------------------------------------------------\n" );
5663 printf (
"Symmetry Fold x y z Angle Peak\n" );
5664 printf (
" Type height\n" );
5665 printf (
"-----------------------------------------------------------\n" );
5666 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] );
5667 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] );
5671 printf (
"Symmetry elements table:\n" );
5672 printf (
"-----------------------------------------------------------\n" );
5673 printf (
"Symmetry x y z Angle \n" );
5674 printf (
" Type (deg) \n" );
5675 printf (
"-----------------------------------------------------------\n" );
5677 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
5678 for (
unsigned int it = 0; it < 2; it++ )
5680 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
5682 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++ )
5684 if ( iter == 0 ) {
continue; }
5685 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
5686 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] ) ) );
5691 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++ )
5693 if ( iter == 0 ) {
continue; }
5694 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] ) ) );
5703 if ( static_cast<unsigned int> ( this->cnSymmClear.size() ) > 0 )
5705 printf (
"Detected Cyclic symmetry\n\n" );
5706 printf (
"Symmetry axes table:\n" );
5707 printf (
"-----------------------------------------------------------\n" );
5708 printf (
"Symmetry Fold x y z Angle Peak\n" );
5709 printf (
" Type height\n" );
5710 printf (
"-----------------------------------------------------------\n" );
5711 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] ) );
5715 printf (
"Symmetry elements table:\n" );
5716 printf (
"-----------------------------------------------------------\n" );
5717 printf (
"Symmetry x y z Angle \n" );
5718 printf (
" Type (deg) \n" );
5719 printf (
"-----------------------------------------------------------\n" );
5721 printf (
" E %+.2f %+.2f %+.2f %+.1f \n", 1.0, 0.0, 0.0, 0.0 );
5722 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
5724 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++ )
5726 if ( iter == 0 ) {
continue; }
5727 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
5728 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] ) ) );
5733 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++ )
5735 if ( iter == 0 ) {
continue; }
5736 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] ) ) );
5743 printf (
"Detected no symmetry.\n\n" );
5751 printf (
"Alternatives:\n" );
5752 printf (
"-----------------------------------------------------------\n" );
5753 printf (
"Symmetry Fold x y z Angle Peak\n" );
5754 printf (
" Type height\n" );
5755 printf (
"-----------------------------------------------------------\n" );
5756 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
5758 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] ) );
5761 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
5763 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] );
5765 for (
unsigned int mem = 1; mem < static_cast<unsigned int> ( this->dnSymm.at(iter).size() ); mem++ )
5767 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] );
5771 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
5794 rvapi_add_section (
"ReviewSection",
5804 std::stringstream hlpSS;
5805 hlpSS <<
"<pre>" <<
"Requested symmetry : " <<
"N/A" <<
"</pre>";
5806 rvapi_set_text ( hlpSS.str().c_str(),
5813 hlpSS.str ( std::string ( ) );
5814 hlpSS <<
"<pre>" <<
"Input structure : " << this->structFiles.at(0) <<
"</pre>";
5815 rvapi_set_text ( hlpSS.str().c_str(),
5824 rvapi_add_section (
"ResultsSection",
5837 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) == 0 ) )
5840 std::stringstream hlpSS;
5841 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>";
5842 rvapi_set_text ( hlpSS.str().c_str(),
5851 if ( ( static_cast<unsigned int> ( this->icosSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->icosElems.size() ) > 0 ) )
5854 std::stringstream hlpSS;
5855 hlpSS <<
"<b>" <<
"Detected <i>ICOSAHEDRAL</i> symmetry." <<
"</b>";
5856 rvapi_set_text ( hlpSS.str().c_str(),
5865 rvapi_add_table (
"SymmetryTypeTable",
5866 "Detected symmetry axes",
5870 static_cast<unsigned int> ( this->icosAxes.size() ),
5877 hlpSS.str ( std::string ( ) );
5878 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
5879 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
5882 hlpSS.str ( std::string ( ) );
5883 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
5884 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
5887 hlpSS.str ( std::string ( ) );
5888 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
5889 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5892 hlpSS.str ( std::string ( ) );
5893 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
5894 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5897 hlpSS.str ( std::string ( ) );
5898 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
5899 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5902 hlpSS.str ( std::string ( ) );
5903 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
5904 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5907 hlpSS.str ( std::string ( ) );
5908 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.";
5909 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
5913 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5915 std::stringstream hlpSS2;
5916 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
5917 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
5922 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosAxes.size() ); icoIt++ )
5924 std::stringstream hlpSS2;
5926 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
5928 hlpSS2.str ( std::string ( ) );
5929 hlpSS2 << static_cast<int> ( this->icosAxes.at(icoIt)[0] );
5930 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
5932 hlpSS2.str ( std::string ( ) );
5933 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[1], prec );
5934 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
5936 hlpSS2.str ( std::string ( ) );
5937 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[2], prec );
5938 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
5940 hlpSS2.str ( std::string ( ) );
5941 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[3], prec );
5942 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
5944 hlpSS2.str ( std::string ( ) );
5945 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 );
5946 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
5948 hlpSS2.str ( std::string ( ) );
5949 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosAxes.at(icoIt)[4], prec );
5950 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
5954 rvapi_add_table (
"SymmetryElementsTable",
5955 "Detected symmetry elements",
5957 static_cast<unsigned int> ( this->icosAxes.size() ) + 2,
5959 static_cast<unsigned int> ( this->icosElems.size() ),
5962 totTabRows =
static_cast<unsigned int> ( this->icosAxes.size() ) + 2 + static_cast<unsigned int> ( this->icosElems.size() );
5967 hlpSS.str ( std::string ( ) );
5968 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
5969 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
5972 hlpSS.str ( std::string ( ) );
5973 hlpSS <<
"This column states the symmetry element fold.";
5974 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
5977 hlpSS.str ( std::string ( ) );
5978 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
5979 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
5982 hlpSS.str ( std::string ( ) );
5983 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
5984 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
5987 hlpSS.str ( std::string ( ) );
5988 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
5989 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
5992 hlpSS.str ( std::string ( ) );
5993 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
5994 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
5998 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
6000 std::stringstream hlpSS2;
6001 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6002 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6006 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->icosElems.size() ); icoIt++ )
6008 if ( this->icosElems.at(icoIt)[0] != 1.0 )
6010 std::stringstream hlpSS3;
6012 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6016 std::stringstream hlpSS3;
6018 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6021 std::stringstream hlpSS2;
6022 hlpSS2 << static_cast<int> ( this->icosElems.at(icoIt)[0] );
6023 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
6025 hlpSS2.str ( std::string ( ) );
6026 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[1], prec );
6027 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
6029 hlpSS2.str ( std::string ( ) );
6030 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[2], prec );
6031 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
6033 hlpSS2.str ( std::string ( ) );
6034 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[3], prec );
6035 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
6037 hlpSS2.str ( std::string ( ) );
6038 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->icosElems.at(icoIt)[4], prec );
6039 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
6046 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->octaElems.size() ) == 0 ) )
6049 std::stringstream hlpSS;
6050 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>";
6051 rvapi_set_text ( hlpSS.str().c_str(),
6060 if ( ( static_cast<unsigned int> ( this->octaSymm.size() ) > 0 ) && ( settings->
htmlReport ) )
6063 std::stringstream hlpSS;
6064 hlpSS <<
"<b>" <<
"Detected <i>OCTAHEDRAL</i> symmetry." <<
"</b>";
6065 rvapi_set_text ( hlpSS.str().c_str(),
6074 rvapi_add_table (
"SymmetryTypeTable",
6075 "Detected symmetry axes",
6079 static_cast<unsigned int> ( this->octaAxes.size() ),
6086 hlpSS.str ( std::string ( ) );
6087 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6088 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6091 hlpSS.str ( std::string ( ) );
6092 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6093 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6096 hlpSS.str ( std::string ( ) );
6097 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6098 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6101 hlpSS.str ( std::string ( ) );
6102 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6103 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6106 hlpSS.str ( std::string ( ) );
6107 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6108 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6111 hlpSS.str ( std::string ( ) );
6112 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6113 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6116 hlpSS.str ( std::string ( ) );
6117 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.";
6118 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6122 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
6124 std::stringstream hlpSS2;
6125 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
6126 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
6131 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaAxes.size() ); icoIt++ )
6133 std::stringstream hlpSS2;
6135 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6137 hlpSS2.str ( std::string ( ) );
6138 hlpSS2 << static_cast<int> ( this->octaAxes.at(icoIt)[0] );
6139 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6141 hlpSS2.str ( std::string ( ) );
6142 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[1], prec );
6143 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6145 hlpSS2.str ( std::string ( ) );
6146 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[2], prec );
6147 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6149 hlpSS2.str ( std::string ( ) );
6150 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[3], prec );
6151 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6153 hlpSS2.str ( std::string ( ) );
6154 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 );
6155 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6157 hlpSS2.str ( std::string ( ) );
6158 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaAxes.at(icoIt)[4], prec );
6159 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6163 rvapi_add_table (
"SymmetryElementsTable",
6164 "Detected symmetry elements",
6166 static_cast<unsigned int> ( this->octaAxes.size() ) + 2,
6168 static_cast<unsigned int> ( this->octaElems.size() ),
6171 totTabRows =
static_cast<unsigned int> ( this->octaAxes.size() ) + 2 + static_cast<unsigned int> ( this->octaElems.size() );
6176 hlpSS.str ( std::string ( ) );
6177 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6178 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6181 hlpSS.str ( std::string ( ) );
6182 hlpSS <<
"This column states the symmetry element fold.";
6183 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6186 hlpSS.str ( std::string ( ) );
6187 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6188 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6191 hlpSS.str ( std::string ( ) );
6192 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6193 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6196 hlpSS.str ( std::string ( ) );
6197 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6198 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6201 hlpSS.str ( std::string ( ) );
6202 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6203 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6207 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
6209 std::stringstream hlpSS2;
6210 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6211 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6215 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->octaElems.size() ); icoIt++ )
6217 if ( this->octaElems.at(icoIt)[0] != 1.0 )
6219 std::stringstream hlpSS3;
6221 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6225 std::stringstream hlpSS3;
6227 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 0 );
6230 std::stringstream hlpSS2;
6231 hlpSS2 << static_cast<int> ( this->octaElems.at(icoIt)[0] );
6232 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 1 );
6234 hlpSS2.str ( std::string ( ) );
6235 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[1], prec );
6236 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 2 );
6238 hlpSS2.str ( std::string ( ) );
6239 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[2], prec );
6240 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 3 );
6242 hlpSS2.str ( std::string ( ) );
6243 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[3], prec );
6244 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 4 );
6246 hlpSS2.str ( std::string ( ) );
6247 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->octaElems.at(icoIt)[4], prec );
6248 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 5 );
6255 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) == 0 ) )
6258 std::stringstream hlpSS;
6259 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>";
6260 rvapi_set_text ( hlpSS.str().c_str(),
6270 if ( ( static_cast<unsigned int> ( this->tetrSymm.size() ) > 0 ) && ( settings->
htmlReport ) && ( static_cast<unsigned int> ( this->tetrElems.size() ) > 0 ) )
6273 std::stringstream hlpSS;
6274 hlpSS <<
"<b>" <<
"Detected <i>TETRAHEDRAL</i> symmetry." <<
"</b>";
6275 rvapi_set_text ( hlpSS.str().c_str(),
6284 rvapi_add_table (
"SymmetryTypeTable",
6285 "Detected symmetry axes",
6289 static_cast<unsigned int> ( this->tetrAxes.size() ),
6296 hlpSS.str ( std::string ( ) );
6297 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6298 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6301 hlpSS.str ( std::string ( ) );
6302 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6303 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6306 hlpSS.str ( std::string ( ) );
6307 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6308 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6311 hlpSS.str ( std::string ( ) );
6312 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6313 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6316 hlpSS.str ( std::string ( ) );
6317 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6318 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6321 hlpSS.str ( std::string ( ) );
6322 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6323 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6326 hlpSS.str ( std::string ( ) );
6327 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.";
6328 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6332 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
6334 std::stringstream hlpSS2;
6335 hlpSS2 <<
"Symmetry axis #" << icoIt+1;
6336 rvapi_put_vert_theader (
"SymmetryTypeTable", hlpSS2.str().c_str(),
"", icoIt );
6341 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrAxes.size() ); icoIt++ )
6343 std::stringstream hlpSS2;
6345 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6347 hlpSS2.str ( std::string ( ) );
6348 hlpSS2 << static_cast<int> ( this->tetrAxes.at(icoIt)[0] );
6349 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6351 hlpSS2.str ( std::string ( ) );
6352 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[1], prec );
6353 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6355 hlpSS2.str ( std::string ( ) );
6356 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[2], prec );
6357 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6359 hlpSS2.str ( std::string ( ) );
6360 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[3], prec );
6361 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6363 hlpSS2.str ( std::string ( ) );
6364 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 );
6365 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6367 hlpSS2.str ( std::string ( ) );
6368 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrAxes.at(icoIt)[4], prec );
6369 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6373 rvapi_add_table (
"SymmetryElementsTable",
6374 "Detected symmetry elements",
6376 static_cast<unsigned int> ( this->tetrAxes.size() ) + 2,
6378 static_cast<unsigned int> ( this->tetrElems.size() ),
6381 totTabRows =
static_cast<unsigned int> ( this->tetrAxes.size() ) + 2 + static_cast<unsigned int> ( this->tetrElems.size() );
6386 hlpSS.str ( std::string ( ) );
6387 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6388 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6391 hlpSS.str ( std::string ( ) );
6392 hlpSS <<
"This column states the symmetry element fold.";
6393 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6396 hlpSS.str ( std::string ( ) );
6397 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6398 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6401 hlpSS.str ( std::string ( ) );
6402 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6403 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6406 hlpSS.str ( std::string ( ) );
6407 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6408 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6411 hlpSS.str ( std::string ( ) );
6412 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6413 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6417 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
6419 std::stringstream hlpSS2;
6420 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6421 rvapi_put_vert_theader (
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6425 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->tetrElems.size() ); icoIt++ )
6427 std::stringstream hlpSS3;
6428 if ( this->tetrElems.at(icoIt)[0] != 1.0 )
6430 std::stringstream hlpSS2;
6432 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
6436 std::stringstream hlpSS2;
6438 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), icoIt, 0 );
6441 hlpSS3.str ( std::string ( ) );
6442 hlpSS3 << static_cast<int> ( this->tetrElems.at(icoIt)[0] );
6443 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 1 );
6445 hlpSS3.str ( std::string ( ) );
6446 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[1], prec );
6447 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 2 );
6449 hlpSS3.str ( std::string ( ) );
6450 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[2], prec );
6451 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 3 );
6453 hlpSS3.str ( std::string ( ) );
6454 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[3], prec );
6455 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 4 );
6457 hlpSS3.str ( std::string ( ) );
6458 hlpSS3 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->tetrElems.at(icoIt)[4], prec );
6459 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS3.str().c_str(), icoIt, 5 );
6466 if ( ( static_cast<unsigned int> ( this->dnSymmClear.size() ) > 0 ) && ( settings->
htmlReport ) )
6469 std::stringstream hlpSS;
6470 hlpSS <<
"<b>" <<
"Detected <i>DIHEDRAL</i> symmetry." <<
"</b>";
6471 rvapi_set_text ( hlpSS.str().c_str(),
6480 rvapi_add_table (
"SymmetryTypeTable",
6481 "Detected symmetry axes",
6492 hlpSS.str ( std::string ( ) );
6493 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6494 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6497 hlpSS.str ( std::string ( ) );
6498 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6499 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6502 hlpSS.str ( std::string ( ) );
6503 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6504 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6507 hlpSS.str ( std::string ( ) );
6508 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6509 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6512 hlpSS.str ( std::string ( ) );
6513 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6514 rvapi_put_horz_theader (
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6517 hlpSS.str ( std::string ( ) );
6518 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6519 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6522 hlpSS.str ( std::string ( ) );
6523 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.";
6524 rvapi_put_horz_theader (
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6528 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymmClear.at(0).size() ); icoIt++ )
6530 hlpSS.str ( std::string ( ) );
6531 hlpSS <<
"Symmetry axis #" << icoIt+1;
6532 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", icoIt );
6537 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( this->dnSymmClear.at(0).size() ); icoIt++ )
6539 std::stringstream hlpSS2;
6541 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 0 );
6543 hlpSS2.str ( std::string ( ) );
6544 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(icoIt)[0] );
6545 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 1 );
6547 hlpSS2.str ( std::string ( ) );
6548 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[1], prec );
6549 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 2 );
6551 hlpSS2.str ( std::string ( ) );
6552 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[2], prec );
6553 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 3 );
6555 hlpSS2.str ( std::string ( ) );
6556 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[3], prec );
6557 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 4 );
6559 hlpSS2.str ( std::string ( ) );
6560 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 );
6561 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 5 );
6563 hlpSS2.str ( std::string ( ) );
6564 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(icoIt)[4], prec );
6565 rvapi_put_table_string(
"SymmetryTypeTable", hlpSS2.str().c_str(), icoIt, 6 );
6570 for (
unsigned int it = 0; it < 2; it++ )
6572 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
6574 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++ )
6576 if ( iter == 0 ) {
continue; }
6577 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
6584 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++ )
6586 if ( iter == 0 ) {
continue; }
6593 totTabRows =
static_cast<unsigned int> ( totRows ) + 6;
6595 rvapi_add_table (
"SymmetryElementsTable",
6596 "Detected symmetry elements",
6607 hlpSS.str ( std::string ( ) );
6608 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6609 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6612 hlpSS.str ( std::string ( ) );
6613 hlpSS <<
"This column states the symmetry element fold.";
6614 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6617 hlpSS.str ( std::string ( ) );
6618 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6619 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6622 hlpSS.str ( std::string ( ) );
6623 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6624 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6627 hlpSS.str ( std::string ( ) );
6628 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6629 rvapi_put_horz_theader (
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6632 hlpSS.str ( std::string ( ) );
6633 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6634 rvapi_put_horz_theader (
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6638 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
6640 std::stringstream hlpSS2;
6641 hlpSS2 <<
"Symmetry element #" << icoIt+1;
6642 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6648 hlpSS.str ( std::string ( ) );
6650 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
6652 hlpSS.str ( std::string ( ) );
6653 hlpSS << static_cast<int> ( 1 );
6654 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
6656 hlpSS.str ( std::string ( ) );
6657 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
6658 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
6660 hlpSS.str ( std::string ( ) );
6661 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6662 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
6664 hlpSS.str ( std::string ( ) );
6665 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6666 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
6668 hlpSS.str ( std::string ( ) );
6669 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6670 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
6672 for (
unsigned int it = 0; it < 2; it++ )
6674 if ( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) % 2 == 0 )
6676 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++ )
6678 if ( iter == 0 ) {
continue; }
6679 if ( iter == -std::ceil( static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] ) / 2.0 ) ) {
continue; }
6681 std::stringstream hlpSS2;
6683 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
6685 hlpSS2.str ( std::string ( ) );
6686 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] );
6687 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
6689 hlpSS2.str ( std::string ( ) );
6690 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[1], prec );
6691 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
6693 hlpSS2.str ( std::string ( ) );
6694 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[2], prec );
6695 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
6697 hlpSS2.str ( std::string ( ) );
6698 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[3], prec );
6699 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
6701 hlpSS2.str ( std::string ( ) );
6702 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 );
6703 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
6709 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++ )
6711 if ( iter == 0 ) {
continue; }
6713 std::stringstream hlpSS2;
6715 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 0 );
6717 hlpSS2.str ( std::string ( ) );
6718 hlpSS2 << static_cast<int> ( this->dnSymmClear.at(0).at(it)[0] );
6719 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 1 );
6721 hlpSS2.str ( std::string ( ) );
6722 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[1], prec );
6723 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 2 );
6725 hlpSS2.str ( std::string ( ) );
6726 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[2], prec );
6727 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 3 );
6729 hlpSS2.str ( std::string ( ) );
6730 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymmClear.at(0).at(it)[3], prec );
6731 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 4 );
6733 hlpSS2.str ( std::string ( ) );
6734 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 );
6735 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS2.str().c_str(), rowCount, 5 );
6745 if ( ( static_cast<unsigned int> ( this->cnSymmClear.size() ) > 0 ) && ( settings->
htmlReport ) )
6748 std::stringstream hlpSS;
6749 hlpSS <<
"<b>" <<
"Detected <i>CYCLIC</i> symmetry." <<
"</b>";
6750 rvapi_set_text ( hlpSS.str().c_str(),
6759 rvapi_add_table (
"SymmetryTypeTable",
6760 "Detected symmetry axes",
6771 hlpSS.str ( std::string ( ) );
6772 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D; Tetrahedral = T; Octahedral = O; Icosahedral = I).";
6773 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Symmetry type", hlpSS.str().c_str(), columnIter );
6776 hlpSS.str ( std::string ( ) );
6777 hlpSS <<
"This column states the symmetry fold; this is only interesting for Cyclic and Dihedral symmetries.";
6778 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Symmetry fold", hlpSS.str().c_str(), columnIter );
6781 hlpSS.str ( std::string ( ) );
6782 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
6783 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6786 hlpSS.str ( std::string ( ) );
6787 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
6788 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6791 hlpSS.str ( std::string ( ) );
6792 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
6793 rvapi_put_horz_theader(
"SymmetryTypeTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6796 hlpSS.str ( std::string ( ) );
6797 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
6798 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6801 hlpSS.str ( std::string ( ) );
6802 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.";
6803 rvapi_put_horz_theader(
"SymmetryTypeTable",
"Peak height", hlpSS.str().c_str(), columnIter );
6807 hlpSS.str ( std::string ( ) );
6808 hlpSS <<
"Symmetry axis #" << 1;
6809 rvapi_put_vert_theader(
"SymmetryTypeTable", hlpSS.str().c_str(),
"", 0 );
6813 hlpSS.str ( std::string ( ) );
6815 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 0 );
6817 hlpSS.str ( std::string ( ) );
6818 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
6819 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 1 );
6821 hlpSS.str ( std::string ( ) );
6822 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
6823 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 2 );
6825 hlpSS.str ( std::string ( ) );
6826 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
6827 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 3 );
6829 hlpSS.str ( std::string ( ) );
6830 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
6831 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 4 );
6833 hlpSS.str ( std::string ( ) );
6834 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 );
6835 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 5 );
6837 hlpSS.str ( std::string ( ) );
6838 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[4], prec );
6839 rvapi_put_table_string (
"SymmetryTypeTable", hlpSS.str().c_str(), 0, 6 );
6843 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
6845 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++ )
6847 if ( iter == 0 ) {
continue; }
6848 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
6855 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++ )
6857 if ( iter == 0 ) {
continue; }
6863 totTabRows =
static_cast<unsigned int> ( totRows ) + 5;
6865 rvapi_add_table (
"SymmetryElementsTable",
6866 "Detected symmetry elements",
6877 hlpSS.str ( std::string ( ) );
6878 hlpSS <<
"This column states the symmetry element type (Cyclic = C; Identity = E).";
6879 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
6882 hlpSS.str ( std::string ( ) );
6883 hlpSS <<
"This column states the symmetry element fold.";
6884 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
6887 hlpSS.str ( std::string ( ) );
6888 hlpSS <<
"This column states the x-axis element of the symmetry element axis.";
6889 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
6892 hlpSS.str ( std::string ( ) );
6893 hlpSS <<
"This column states the y-axis element of the symmetry element axis.";
6894 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
6897 hlpSS.str ( std::string ( ) );
6898 hlpSS <<
"This column states the z-axis element of the symmetry element axis.";
6899 rvapi_put_horz_theader(
"SymmetryElementsTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
6902 hlpSS.str ( std::string ( ) );
6903 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry element axis in degrees.";
6904 rvapi_put_horz_theader(
"SymmetryElementsTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
6908 for (
unsigned int icoIt = 0; icoIt < static_cast<unsigned int> ( totRows ); icoIt++ )
6910 std::stringstream hlpSS2;
6911 hlpSS2 <<
"Symmetry element #" << std::to_string ( icoIt+1 );
6912 rvapi_put_vert_theader(
"SymmetryElementsTable", hlpSS2.str().c_str(),
"", icoIt );
6918 hlpSS.str ( std::string ( ) );
6920 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 0 );
6922 hlpSS.str ( std::string ( ) );
6923 hlpSS << static_cast<int> ( 1 );
6924 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 1 );
6926 hlpSS.str ( std::string ( ) );
6927 hlpSS << std::setprecision ( prec ) << std::showpos << 1;
6928 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 2 );
6930 hlpSS.str ( std::string ( ) );
6931 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6932 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 3 );
6934 hlpSS.str ( std::string ( ) );
6935 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6936 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 4 );
6938 hlpSS.str ( std::string ( ) );
6939 hlpSS << std::setprecision ( prec ) << std::showpos << 0;
6940 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), 0, 5 );
6942 if ( static_cast<int> ( this->cnSymmClear.at(0)[0] ) % 2 == 0 )
6944 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++ )
6946 if ( iter == 0 ) {
continue; }
6947 if ( iter == -std::ceil( static_cast<int> ( this->cnSymmClear.at(0)[0] ) / 2.0 ) ) {
continue; }
6949 hlpSS.str ( std::string ( ) );
6951 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
6953 hlpSS.str ( std::string ( ) );
6954 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
6955 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
6957 hlpSS.str ( std::string ( ) );
6958 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
6959 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
6961 hlpSS.str ( std::string ( ) );
6962 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
6963 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
6965 hlpSS.str ( std::string ( ) );
6966 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
6967 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
6969 hlpSS.str ( std::string ( ) );
6970 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 );
6971 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
6977 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++ )
6979 if ( iter == 0 ) {
continue; }
6981 hlpSS.str ( std::string ( ) );
6983 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 0 );
6985 hlpSS.str ( std::string ( ) );
6986 hlpSS << static_cast<int> ( this->cnSymmClear.at(0)[0] );
6987 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 1 );
6989 hlpSS.str ( std::string ( ) );
6990 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[1], prec );
6991 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 2 );
6993 hlpSS.str ( std::string ( ) );
6994 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[2], prec );
6995 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 3 );
6997 hlpSS.str ( std::string ( ) );
6998 hlpSS << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymmClear.at(0)[3], prec );
6999 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 4 );
7001 hlpSS.str ( std::string ( ) );
7002 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 );
7003 rvapi_put_table_string (
"SymmetryElementsTable", hlpSS.str().c_str(), rowCount, 5 );
7012 printf (
"Detected no symmetry.\n\n" );
7020 rvapi_add_table (
"AlternativesTable",
7021 "Alternative Symmetries Detected",
7025 static_cast<unsigned int> ( this->cnSymm.size() ) + static_cast<unsigned int> ( this->dnSymm.size() ),
7032 std::stringstream hlpSS;
7033 hlpSS <<
"This column states the symmetry type (Cyclic = C; Dihedral = D).";
7034 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element type", hlpSS.str().c_str(), columnIter );
7037 hlpSS.str ( std::string ( ) );
7038 hlpSS <<
"This column states the symmetry fold.";
7039 rvapi_put_horz_theader (
"AlternativesTable",
"Symmetry element fold", hlpSS.str().c_str(), columnIter );
7042 hlpSS.str ( std::string ( ) );
7043 hlpSS <<
"This column states the x-axis element of the symmetry axis.";
7044 rvapi_put_horz_theader (
"AlternativesTable",
"<i>X</i>-axis element", hlpSS.str().c_str(), columnIter );
7047 hlpSS.str ( std::string ( ) );
7048 hlpSS <<
"This column states the y-axis element of the symmetry axis.";
7049 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Y</i>-axis element", hlpSS.str().c_str(), columnIter );
7052 hlpSS.str ( std::string ( ) );
7053 hlpSS <<
"This column states the z-axis element of the symmetry axis.";
7054 rvapi_put_horz_theader (
"AlternativesTable",
"<i>Z</i>-axis element", hlpSS.str().c_str(), columnIter );
7057 hlpSS.str ( std::string ( ) );
7058 hlpSS <<
"This column states the angle (in the sense of the angle-axis representation) of the symmetry axis in degrees.";
7059 rvapi_put_horz_theader (
"AlternativesTable",
"Angle (degrees)", hlpSS.str().c_str(), columnIter );
7062 hlpSS.str ( std::string ( ) );
7063 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.";
7064 rvapi_put_horz_theader (
"AlternativesTable",
"Peak Height", hlpSS.str().c_str(), columnIter );
7069 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
7071 std::stringstream hlpSS2;
7072 hlpSS2 <<
"Alternative Symmetry #" << gNo+1;
7073 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", gNo );
7076 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
7078 std::stringstream hlpSS2;
7079 hlpSS2 <<
"Alternative Symmetry #" << iter + maxCAlts + 2;
7080 rvapi_put_vert_theader (
"AlternativesTable", hlpSS2.str().c_str(),
"Reported symmetry alternative (i.e. also detected, but with lower reliability)", iter + maxCAlts + 1 );
7085 for (
unsigned int gNo = 0; gNo < static_cast<unsigned int> ( this->cnSymm.size() ); gNo++ )
7087 std::stringstream hlpSS2;
7089 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
7091 hlpSS2.str ( std::string ( ) );
7092 hlpSS2 << static_cast<int> (
static_cast<int> ( this->cnSymm.at(gNo)[0] ) );
7093 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
7095 hlpSS2.str ( std::string ( ) );
7096 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[1], prec );
7097 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
7099 hlpSS2.str ( std::string ( ) );
7100 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[2], prec );
7101 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
7103 hlpSS2.str ( std::string ( ) );
7104 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->cnSymm.at(gNo)[3], prec );
7105 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
7107 hlpSS2.str ( std::string ( ) );
7108 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 );
7109 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
7111 hlpSS2.str ( std::string ( ) );
7112 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->cnSymm.at(gNo)[4] ), prec );
7113 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
7117 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->dnSymm.size() ); iter++ )
7119 std::stringstream hlpSS2;
7121 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 0 );
7123 hlpSS2.str ( std::string ( ) );
7124 hlpSS2 << static_cast<int> (
static_cast<int> ( this->dnSymm.at(iter).at(0)[0] ) );
7125 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 1 );
7127 hlpSS2.str ( std::string ( ) );
7128 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[1], prec );
7129 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 2 );
7131 hlpSS2.str ( std::string ( ) );
7132 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[2], prec );
7133 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 3 );
7135 hlpSS2.str ( std::string ( ) );
7136 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( this->dnSymm.at(iter).at(0)[3], prec );
7137 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 4 );
7139 hlpSS2.str ( std::string ( ) );
7140 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 );
7141 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 5 );
7143 hlpSS2.str ( std::string ( ) );
7144 hlpSS2 << std::setprecision ( prec ) << std::showpos << ProSHADE_internal_misc::to_string_with_precision ( static_cast<double> ( this->dnSymm.at(iter).at(0)[4] ), prec );
7145 rvapi_put_table_string (
"AlternativesTable", hlpSS2.str().c_str(), rowCount, 6 );
7179 return ( this->rfPeaks );
7202 return ( this->cnSymm );
7227 return ( this->dnSymm );
7245 this->cmpObj =
nullptr;
7253 std::cout <<
"-----------------------------------------------------------" << std::endl;
7254 std::cout <<
"| MODE: BuildDB |" << std::endl;
7255 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
7258 this->saveDatabase ( settings );
7262 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
7263 std::cout <<
"| COMPLETED |" << std::endl;
7264 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
7266 std::cout <<
"Database saved to: " << settings->
databaseName << std::endl << std::endl;
7270 std::stringstream hlpSS;
7271 hlpSS <<
"<font color=\"green\">" <<
"Database saved to " << settings->
databaseName <<
" ." <<
"</font>";
7272 rvapi_set_text ( hlpSS.str().c_str(),
7290 compareFragAgainstDatabase ( settings, &settings->
structFiles );
7296 this->theta = settings->
theta;
7297 this->phi = settings->
phi;
7303 this->useCOM = settings->
useCOM;
7306 this->alpha = settings->
alpha;
7307 this->mPower = settings->
mPower;
7308 this->ignoreLs = settings->
ignoreLs;
7312 this->usePhase = settings->
usePhase;
7327 compareAgainstDatabase ( settings, &settings->
structFiles );
7335 this->theta = settings->
theta;
7336 this->phi = settings->
phi;
7342 this->useCOM = settings->
useCOM;
7345 this->alpha = settings->
alpha;
7346 this->mPower = settings->
mPower;
7347 this->ignoreLs = settings->
ignoreLs;
7351 this->usePhase = settings->
usePhase;
7364 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;
7369 std::stringstream hlpSS;
7370 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>";
7371 rvapi_set_text ( hlpSS.str().c_str(),
7388 this->theta = settings->
theta;
7389 this->phi = settings->
phi;
7395 this->useCOM = settings->
useCOM;
7398 this->alpha = settings->
alpha;
7399 this->mPower = settings->
mPower;
7400 this->ignoreLs = settings->
ignoreLs;
7404 this->usePhase = settings->
usePhase;
7411 if ( !this->energyLevelDist && !this->traceSigmaDist && !this->fullRotFnDist )
7414 std::cerr <<
"!!! ProSHADE ERROR !!! Initialising ProSHADE_distances object with no distances required! Terminating..." << std::endl;
7419 std::stringstream hlpSS;
7420 hlpSS <<
"<font color=\"red\">" <<
"There are no required distances to be computed and therefore nothing to do..." <<
"</font>";
7421 rvapi_set_text ( hlpSS.str().c_str(),
7434 if ( this->structFiles.size() < 2 )
7437 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;
7442 std::stringstream hlpSS;
7443 hlpSS <<
"<font color=\"red\">" <<
"There are less than two structures submitted to the distance computing functionality." <<
"</font>";
7444 rvapi_set_text ( hlpSS.str().c_str(),
7457 if ( ( this->enLevelsThreshold != -999.9 ) && ( !this->energyLevelDist ) )
7460 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;
7465 std::stringstream hlpSS;
7466 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>";
7467 rvapi_set_text ( hlpSS.str().c_str(),
7480 if ( ( this->trSigmaThreshold != -999.9 ) && ( !this->traceSigmaDist ) )
7483 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;
7488 std::stringstream hlpSS;
7489 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>";
7490 rvapi_set_text ( hlpSS.str().c_str(),
7505 std::cout <<
"Finding distances between the structure " << settings->
structFiles.at(0) <<
" against all other structures." << std::endl;
7510 std::cout <<
">>>>>>>> Sanity checks passed." << std::endl;
7516 std::stringstream hlpSS;
7517 hlpSS <<
"<font color=\"green\">" <<
"Sanity checks passed" <<
"</font>";
7518 rvapi_set_text ( hlpSS.str().c_str(),
7531 rvapi_add_section (
"InputFilesSection",
7532 "List of input structures",
7543 std::stringstream hlpSS;
7544 hlpSS <<
"<b>" << settings->
structFiles.at(0) <<
"</b>";
7545 rvapi_set_text ( hlpSS.str().c_str(),
7546 "InputFilesSection",
7552 for (
unsigned int vecIt = 1; vecIt < static_cast<unsigned int> ( this->structFiles.size() ); vecIt++ )
7554 hlpSS.str ( std::string ( ) );
7556 rvapi_set_text ( hlpSS.str().c_str(),
7557 "InputFilesSection",
7569 this->bandwidthVec = std::vector<unsigned int> ( this->structFiles.size(), this->bandwidth );
7570 this->thetaVec = std::vector<unsigned int> ( this->structFiles.size(), this->theta );
7571 this->phiVec = std::vector<unsigned int> ( this->structFiles.size(), this->phi );
7572 this->glIntegOrderVec = std::vector<unsigned int> ( this->structFiles.size(), this->glIntegOrder );
7573 this->extraSpaceVec = std::vector<double> ( this->structFiles.size(), this->extraSpace );
7579 unsigned int fileType =
checkFileType ( structFiles.at(0) );
7580 if ( fileType == 2 )
7582 one->getDensityMapFromMAP ( this->structFiles.at(0),
7583 &this->shellSpacing,
7584 this->mapResolution,
7585 &this->bandwidthVec.at(0),
7586 &this->thetaVec.at(0),
7587 &this->phiVec.at(0),
7588 &this->glIntegOrderVec.at(0),
7589 &this->extraSpaceVec.at(0),
7595 else if ( fileType == 1 )
7597 one->getDensityMapFromPDB ( this->structFiles.at(0),
7598 &this->shellSpacing,
7599 this->mapResolution,
7600 &this->bandwidthVec.at(0),
7601 &this->thetaVec.at(0),
7602 &this->phiVec.at(0),
7603 &this->glIntegOrderVec.at(0),
7604 &this->extraSpaceVec.at(0),
7608 this->firstLineCOM );
7612 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;
7617 std::cout <<
">> Structure " << this->structFiles.at(0) <<
" loaded." << std::endl;
7623 std::stringstream hlpSS;
7624 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(0) <<
" loaded." <<
"</font>";
7625 rvapi_set_text ( hlpSS.str().c_str(),
7636 one->normaliseMap ( settings );
7637 if ( this->usePhase )
7639 one->keepPhaseInMap ( this->alpha,
7640 this->bFactorChange,
7641 &this->bandwidthVec.at(0),
7642 &this->thetaVec.at(0),
7643 &this->phiVec.at(0),
7644 &this->glIntegOrderVec.at(0),
7657 one->removePhaseFromMap ( this->alpha,
7658 this->bFactorChange,
7663 one->mapPhaselessToSphere ( settings,
7664 this->thetaVec.at(0),
7670 one->getSphericalHarmonicsCoeffs ( this->bandwidthVec.at(0), settings );
7673 if ( this->energyLevelDist )
7675 one->precomputeRotInvDescriptor ( settings );
7680 std::cout <<
">>>>> Structure " << this->structFiles.at(0) <<
" spherical harmonics computed." << std::endl;
7686 std::stringstream hlpSS;
7687 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(0) <<
" spherical harmonics computed." <<
"</font>";
7688 rvapi_set_text ( hlpSS.str().c_str(),
7699 for (
unsigned int vecIt = 1; vecIt < static_cast<unsigned int> ( this->structFiles.size() ); vecIt++ )
7701 this->bandwidthVec.at(vecIt) = this->bandwidthVec.at(0);
7702 this->thetaVec.at(vecIt) = this->thetaVec.at(0);
7703 this->phiVec.at(vecIt) = this->phiVec.at(0);
7704 this->glIntegOrderVec.at(vecIt) = this->glIntegOrderVec.at(0);
7705 this->extraSpaceVec.at(vecIt) = this->extraSpaceVec.at(0);
7709 std::vector<ProSHADE_data*> objs ( this->structFiles.size() - 1 );
7710 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( this->structFiles.size() - 1 ); strIt++ )
7717 if ( fileType == 2 )
7719 objs.at(strIt)->getDensityMapFromMAP ( this->structFiles.at(strIt+1),
7720 &this->shellSpacing,
7721 this->mapResolution,
7722 &this->bandwidthVec.at(strIt+1),
7723 &this->thetaVec.at(strIt+1),
7724 &this->phiVec.at(strIt+1),
7725 &this->glIntegOrderVec.at(strIt+1),
7726 &this->extraSpaceVec.at(strIt+1),
7732 else if ( fileType == 1 )
7734 objs.at(strIt)->getDensityMapFromPDB ( this->structFiles.at(strIt+1),
7735 &this->shellSpacing,
7736 this->mapResolution,
7737 &this->bandwidthVec.at(strIt+1),
7738 &this->thetaVec.at(strIt+1),
7739 &this->phiVec.at(strIt+1),
7740 &this->glIntegOrderVec.at(strIt+1),
7741 &this->extraSpaceVec.at(strIt+1),
7745 this->firstLineCOM );
7749 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;
7755 std::cout <<
">> Structure " << this->structFiles.at(strIt+1) <<
" loaded." << std::endl;
7761 std::stringstream hlpSS;
7762 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(strIt+1) <<
" loaded." <<
"</font>";
7763 rvapi_set_text ( hlpSS.str().c_str(),
7774 objs.at(strIt)->normaliseMap ( settings );
7775 if ( this->usePhase )
7777 objs.at(strIt)->keepPhaseInMap ( this->alpha,
7778 this->bFactorChange,
7779 &this->bandwidthVec.at(strIt+1),
7780 &this->thetaVec.at(strIt+1),
7781 &this->phiVec.at(strIt+1),
7782 &this->glIntegOrderVec.at(strIt+1),
7795 objs.at(strIt)->removePhaseFromMap ( this->alpha,
7796 this->bFactorChange,
7801 objs.at(strIt)->mapPhaselessToSphere ( settings,
7802 this->thetaVec.at(strIt+1),
7803 this->phiVec.at(strIt+1),
7807 objs.at(strIt)->getSphericalHarmonicsCoeffs( this->bandwidthVec.at(strIt+1), settings );
7810 if ( this->energyLevelDist )
7812 objs.at(strIt)->precomputeRotInvDescriptor ( settings );
7817 std::cout <<
">>>>> Structure " << this->structFiles.at(strIt+1) <<
" spherical harmonics computed." << std::endl;
7823 std::stringstream hlpSS;
7824 hlpSS <<
"<font color=\"green\">" <<
"Structure " << this->structFiles.at(strIt+1) <<
" spherical harmonics computed." <<
"</font>";
7825 rvapi_set_text ( hlpSS.str().c_str(),
7840 if ( one->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
7841 else { this->cmpObj->_keepOrRemove =
false; }
7844 if ( this->energyLevelDist )
7848 std::cout <<
"Computing the cross-correlation distances." << std::endl;
7854 std::stringstream hlpSS;
7855 hlpSS <<
"<font color=\"green\">" <<
"Computing the cross-correlation distances." <<
"</font>";
7856 rvapi_set_text ( hlpSS.str().c_str(),
7865 this->energyLevelsDistances = this->cmpObj->getEnergyLevelsDistance ( settings->
verbose, settings );
7868 if ( this->enLevelsThreshold != -999.9 )
7870 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7872 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
7874 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
7878 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7884 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7886 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7892 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7894 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
7899 if ( this->traceSigmaDist || this->fullRotFnDist )
7901 this->cmpObj->precomputeTrSigmaDescriptor ( this->shellSpacing, &this->glIntegOrderVec, settings );
7905 if ( this->traceSigmaDist )
7909 std::cout <<
"Computing the trace sigma distances." << std::endl;
7914 std::stringstream hlpSS;
7915 hlpSS <<
"<font color=\"green\">" <<
"Computing the trace sigma distances." <<
"</font>";
7916 rvapi_set_text ( hlpSS.str().c_str(),
7926 this->traceSigmaDistances = this->cmpObj->getTrSigmaDistance ( settings->
verbose, settings );
7928 if ( this->trSigmaThreshold == -999.9 )
7930 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
7934 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
7936 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
7938 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
7942 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
7949 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
7951 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
7956 if ( this->fullRotFnDist )
7960 std::cout <<
"Computing the rotation function distances." << std::endl;
7965 std::stringstream hlpSS;
7966 hlpSS <<
"<font color=\"green\">" <<
"Computing the rotation function distances." <<
"</font>";
7967 rvapi_set_text ( hlpSS.str().c_str(),
7977 this->cmpObj->getSO3InverseMap ( settings );
7980 std::cout <<
">>>>> Inverse SO(3) Fourier transform maps obtained." << std::endl;
7983 this->cmpObj->getEulerAngles ( settings );
7986 std::cout <<
">>>>>>>> Optimal Euler angles calculated." << std::endl;
7989 this->cmpObj->generateWignerMatrices ( settings );
7992 std::cout <<
">>>>> Wigner matrices computed." << std::endl;
7995 this->fullRotationDistances = this->cmpObj->getRotCoeffDistance ( settings->
verbose, settings );
7999 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( objs.size() ); iter++ )
8001 if ( objs.at(iter) != nullptr )
8003 delete objs.at(iter);
8021 if ( this->cmpObj !=
nullptr ) {
delete this->cmpObj; }
8037 if ( !this->energyLevelDist )
8039 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;
8043 if ( this->cmpObj !=
nullptr )
8045 if ( !this->cmpObj->_energyLevelsComputed )
8047 std::cerr <<
" !!! ProSHADE ERROR !!! Error in structure comparison. !!! The energy level distances were not computed before their values are required." << std::endl;
8053 return ( this->energyLevelsDistances );
8070 if ( !this->energyLevelDist )
8072 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;
8077 return ( this->fragEnergyLevelsDistances );
8096 if ( !this->traceSigmaDist )
8098 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;
8102 if ( this->cmpObj !=
nullptr )
8104 if ( !this->cmpObj->_trSigmaComputed )
8106 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The trace sigma distances were not computed before their values are required." << std::endl;
8112 return ( this->traceSigmaDistances );
8129 if ( !this->cmpObj->_trSigmaComputed )
8131 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The trace sigma distances were not computed before their values are required." << std::endl;
8136 return ( this->fragTraceSigmaDistances );
8155 if ( !this->fullRotFnDist )
8157 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;
8161 if ( this->cmpObj !=
nullptr )
8163 if ( !this->cmpObj->_fullDistComputed )
8165 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The full rotation function distances were not computed before their values are required." << std::endl;
8171 return ( this->fullRotationDistances );
8188 if ( !this->cmpObj->_fullDistComputed )
8190 std::cerr <<
"!!! ProSHADE ERROR !!! Error in structure comparison. !!! The full rotation function distances were not computed before their values are required." << std::endl;
8195 return ( this->fragfullRotationDistances );
8211 this->fragFilesExist =
false;
8212 this->fragFiles.clear ( );
8213 this->one =
nullptr;
8225 std::cout <<
"-----------------------------------------------------------" << std::endl;
8226 std::cout <<
"| MODE: HalfMaps |" << std::endl;
8227 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8233 std::cerr <<
"!!! ProSHADE ERROR !!! Attempted to process half-maps, but did supply ";
8234 if ( settings->
structFiles.size() < 2 ) { std::cerr <<
"less "; }
8235 if ( settings->
structFiles.size() > 2 ) { std::cerr <<
"more "; }
8236 std::cerr <<
"than 2 files. Please use the \'-f\' option to supply only the two half-maps map files. Terminating ..." << std::endl << std::endl;
8240 std::stringstream hlpSS;
8241 hlpSS <<
"<font color=\"red\">" <<
"There are not exactly two input structures. Please supply only two files to the half-maps re-boxing functionality." <<
"</font>";
8242 rvapi_set_text ( hlpSS.str().c_str(),
8257 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;
8262 std::stringstream hlpSS;
8263 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>";
8264 rvapi_set_text ( hlpSS.str().c_str(),
8277 if ( ( fileTy1 != 2 ) || ( fileTy2 != 2 ) )
8279 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;
8283 std::stringstream hlpSS;
8284 hlpSS <<
"<font color=\"red\">" <<
"Cannot recognise the file format of the input file ";
8286 if ( ( fileTy1 != 2 ) && ( fileTy2 = 2 ) )
8288 hlpSS << settings->
structFiles.at(0) <<
"</font>";
8290 if ( ( fileTy1 = 2 ) && ( fileTy2 != 2 ) )
8292 hlpSS << settings->
structFiles.at(1) <<
"</font>";
8294 if ( ( fileTy1 != 2 ) && ( fileTy2 != 2 ) )
8299 rvapi_set_text ( hlpSS.str().c_str(),
8313 double xTrans, yTrans, zTrans;
8314 dealWithHalfMaps ( settings, &xTrans, &yTrans, &zTrans );
8318 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8319 std::cout <<
"| COMPLETED |" << std::endl;
8320 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8325 std::stringstream hlpSS;
8326 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8327 rvapi_set_text ( hlpSS.str().c_str(),
8339 std::cout <<
"-----------------------------------------------------------" << std::endl;
8340 std::cout <<
"| RESULTS |" << std::endl;
8341 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8343 std::cout <<
"Half maps saved into files:" << std::endl <<
" " << settings->
clearMapFile <<
"_half1.map" << std::endl <<
" " << settings->
clearMapFile <<
"_half2.map" << std::endl << std::endl;
8353 if ( fileType != 2 )
8355 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;
8359 std::stringstream hlpSS;
8360 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>";
8361 rvapi_set_text ( hlpSS.str().c_str(),
8376 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;
8381 std::stringstream hlpSS;
8382 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>";
8383 rvapi_set_text ( hlpSS.str().c_str(),
8396 std::cout <<
">>>>>>>> Sanity checks passed." << std::endl;
8401 std::stringstream hlpSS;
8402 hlpSS <<
"<font color=\"green\">" <<
"Sanity checks passed." <<
"</font>";
8403 rvapi_set_text ( hlpSS.str().c_str(),
8419 std::cout <<
"Applying the re-boxing algorithm." << std::endl;
8422 std::array<double,6> dims = one->getDensityMapFromMAPRebox ( settings->
structFiles.at(0),
8434 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8435 std::cout <<
"| COMPLETED |" << std::endl;
8436 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8440 one->writeMap ( settings->
clearMapFile, one->_densityMapCor );
8444 std::cout <<
"The re-boxed map has been saved to the " << settings->
clearMapFile <<
" file." << std::endl << std::endl;
8449 std::stringstream hlpSS;
8450 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8451 rvapi_set_text ( hlpSS.str().c_str(),
8463 rvapi_add_section (
"ResultsSection",
8473 std::stringstream hlpSS;
8474 hlpSS <<
"<pre><b>" <<
"The re-boxed structure is available at: </b>" << settings->
clearMapFile <<
"</pre>";
8475 rvapi_set_text ( hlpSS.str().c_str(),
8482 hlpSS.str ( std::string ( ) );
8483 hlpSS <<
"<pre><b>" <<
"Original structure dims: </b>" << dims[0] <<
" x " << dims[1] <<
" x " << dims[2] <<
"</pre>";
8484 rvapi_set_text ( hlpSS.str().c_str(),
8491 hlpSS.str ( std::string ( ) );
8492 hlpSS <<
"<pre><b>" <<
"Re-boxed structure dims: </b>" << dims[3] <<
" x " << dims[4] <<
" x " << dims[5] <<
"</pre>";
8493 rvapi_set_text ( hlpSS.str().c_str(),
8500 hlpSS.str ( std::string ( ) );
8501 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>";
8502 rvapi_set_text ( hlpSS.str().c_str(),
8509 hlpSS.str ( std::string ( ) );
8510 hlpSS <<
"<pre><b>" <<
"Linear processing speed-up: </b>" << ( ( dims[0] * dims[1] * dims[2] ) / ( dims[3] * dims[4] * dims[5] ) ) - 1.0 <<
" times</pre>";
8511 rvapi_set_text ( hlpSS.str().c_str(),
8526 std::cout <<
"-----------------------------------------------------------" << std::endl;
8527 std::cout <<
"| MODE: Features |" << std::endl;
8528 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8532 this->maxMapU = 0.0;
8533 this->maxMapV = 0.0;
8534 this->maxMapW = 0.0;
8544 if ( fileType == 2 )
8548 std::cout <<
"Computing the map features." << std::endl;
8550 one->getDensityMapFromMAPFeatures ( settings->
structFiles.at(0),
8551 &this->minDensPreNorm,
8552 &this->maxDensPreNorm,
8553 &this->minDensPostNorm,
8554 &this->maxDensPostNorm,
8555 &this->postNormMean,
8556 &this->postNormSdev,
8563 &this->maskDensityRMS,
8564 &this->allDensityRMS,
8576 else if ( fileType == 1 )
8578 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;
8583 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;
8589 std::cout << std::endl <<
"-----------------------------------------------------------" << std::endl;
8590 std::cout <<
"| COMPLETED |" << std::endl;
8591 std::cout <<
"-----------------------------------------------------------" << std::endl << std::endl;
8596 std::stringstream hlpSS;
8597 hlpSS <<
"<font color=\"green\">" <<
"COMPLETED." <<
"</font>";
8598 rvapi_set_text ( hlpSS.str().c_str(),
8611 one->writeMap ( settings->
clearMapFile, one->_densityMapCor );
8616 rvapi_add_section (
"FilenameSection",
8626 std::stringstream hlpSS;
8627 hlpSS <<
"<pre>" <<
"File saved as: " << settings->
clearMapFile <<
"</pre>";
8628 rvapi_set_text ( hlpSS.str().c_str(),
8653 if ( this->one !=
nullptr )
8671 if ( !this->fragFilesExist )
8673 std::cerr <<
"!!! ProSHADE ERROR !!! Attempted to obtain the list of fragment files without doing the fragmentation first. Terminating..." << std::endl;
8678 return ( this->fragFiles );
8702 void ProSHADE_internal::ProSHADE_data::writeMap ( std::string fileName,
8704 std::string axOrder,
8717 CMap_io::CMMFile *mapFile =
nullptr;
8718 mapFile =
reinterpret_cast<CMap_io::CMMFile*
> ( CMap_io::ccp4_cmap_open ( fileName.c_str() , myMapMode ) );
8719 if ( mapFile == NULL )
8721 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open file " << fileName <<
" for writing. Terminating..." << std::endl;
8726 const char* title =
"ProSHADE genrated map ";
8734 for (
unsigned int iter = 0; iter < 3; iter++ )
8736 if ( axOrder[iter] ==
'x' ) { axisOrder[iter] = 1; }
8737 if ( axOrder[iter] ==
'y' ) { axisOrder[iter] = 2; }
8738 if ( axOrder[iter] ==
'z' ) { axisOrder[iter] = 3; }
8742 if ( std::isinf ( xFrom ) )
8744 xFrom = this->_xFrom;
8745 if ( std::isinf ( xFrom ) )
8747 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;
8751 if ( std::isinf ( yFrom ) )
8753 yFrom = this->_yFrom;
8754 if ( std::isinf ( yFrom ) )
8756 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;
8760 if ( std::isinf ( zFrom ) )
8762 zFrom = this->_zFrom;
8763 if ( std::isinf ( zFrom ) )
8765 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;
8769 if ( std::isinf ( xTo ) )
8772 if ( std::isinf ( xTo ) )
8774 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;
8778 if ( std::isinf ( yTo ) )
8781 if ( std::isinf ( yTo ) )
8783 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;
8787 if ( std::isinf ( zTo ) )
8790 if ( std::isinf ( zTo ) )
8792 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;
8798 grid[axisOrder[0]-1] = xTo - xFrom + 1;
8799 grid[axisOrder[1]-1] = yTo - yFrom + 1;
8800 grid[axisOrder[2]-1] = zTo - zFrom + 1;
8802 axFrom[axisOrder[0]-1] = xFrom;
8803 axFrom[axisOrder[1]-1] = yFrom;
8804 axFrom[axisOrder[2]-1] = zFrom;
8806 dims[0] = this->_maxMapU + 1;
8807 dims[1] = this->_maxMapV + 1;
8808 dims[2] = this->_maxMapW + 1;
8811 if ( std::isinf ( xRange ) )
8813 xRange = this->_xRange;
8814 if ( std::isinf ( xRange ) )
8816 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;
8820 if ( std::isinf ( yRange ) )
8822 yRange = this->_yRange;
8823 if ( std::isinf ( yRange ) )
8825 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;
8829 if ( std::isinf ( zRange ) )
8831 zRange = this->_zRange;
8832 if ( std::isinf ( zRange ) )
8834 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;
8842 cell[3] =
static_cast<float> ( 90.0 );
8843 cell[4] =
static_cast<float> ( 90.0 );
8844 cell[5] =
static_cast<float> ( 90.0 );
8847 CMap_io::ccp4_cmap_set_cell ( mapFile, cell );
8848 CMap_io::ccp4_cmap_set_grid ( mapFile, grid );
8849 CMap_io::ccp4_cmap_set_order ( mapFile, axisOrder );
8850 CMap_io::ccp4_cmap_set_dim ( mapFile, dims );
8851 CMap_io::ccp4_cmap_set_origin ( mapFile, axFrom );
8853 CMap_io::ccp4_cmap_set_spacegroup ( mapFile, 1 );
8854 CMap_io::ccp4_cmap_set_title ( mapFile, title );
8855 CMap_io::ccp4_cmap_set_datamode ( mapFile, 2 );
8858 std::vector<float> section( dims[axisOrder[1]-1] * dims[axisOrder[0]-1] );
8863 for ( iters[2] = 0; iters[2] < dims[axisOrder[2]-1]; iters[2]++ )
8867 for ( iters[1] = 0; iters[1] < dims[axisOrder[1]-1]; iters[1]++ )
8869 for ( iters[0] = 0; iters[0] < dims[axisOrder[0]-1]; iters[0]++ )
8871 arrPos = iters[2] + (dims[axisOrder[2]-1]) * ( iters[1] + (dims[axisOrder[1]-1]) * iters[0] );
8873 section[ index++ ] =
static_cast<float> ( map[arrPos] );
8877 CMap_io::ccp4_cmap_write_section( mapFile, §ion[0] );
8880 CMap_io::ccp4_cmap_close ( mapFile );
8908 void ProSHADE_internal::ProSHADE_data::writeMap ( std::string fileName,
8910 std::string axOrder,
8923 CMap_io::CMMFile *mapFile =
nullptr;
8924 mapFile =
reinterpret_cast<CMap_io::CMMFile*
> ( CMap_io::ccp4_cmap_open ( fileName.c_str() , myMapMode ) );
8925 if ( mapFile == NULL )
8927 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open file " << fileName <<
" for writing. Terminating..." << std::endl;
8932 const char* title =
"ProSHADE genrated map ";
8940 for (
unsigned int iter = 0; iter < 3; iter++ )
8942 if ( axOrder[iter] ==
'x' ) { axisOrder[iter] = 1; }
8943 if ( axOrder[iter] ==
'y' ) { axisOrder[iter] = 2; }
8944 if ( axOrder[iter] ==
'z' ) { axisOrder[iter] = 3; }
8948 if ( std::isinf ( xFrom ) )
8950 xFrom = this->_xFrom;
8951 if ( std::isinf ( xFrom ) )
8953 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;
8957 if ( std::isinf ( yFrom ) )
8959 yFrom = this->_yFrom;
8960 if ( std::isinf ( yFrom ) )
8962 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;
8966 if ( std::isinf ( zFrom ) )
8968 zFrom = this->_zFrom;
8969 if ( std::isinf ( zFrom ) )
8971 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;
8975 if ( std::isinf ( xTo ) )
8978 if ( std::isinf ( xTo ) )
8980 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;
8984 if ( std::isinf ( yTo ) )
8987 if ( std::isinf ( yTo ) )
8989 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;
8993 if ( std::isinf ( zTo ) )
8996 if ( std::isinf ( zTo ) )
8998 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;
9004 grid[axisOrder[0]-1] = xTo - xFrom + 1;
9005 grid[axisOrder[1]-1] = yTo - yFrom + 1;
9006 grid[axisOrder[2]-1] = zTo - zFrom + 1;
9008 axFrom[axisOrder[0]-1] = xFrom;
9009 axFrom[axisOrder[1]-1] = yFrom;
9010 axFrom[axisOrder[2]-1] = zFrom;
9012 dims[0] = this->_maxMapU + 1;
9013 dims[1] = this->_maxMapV + 1;
9014 dims[2] = this->_maxMapW + 1;
9017 if ( std::isinf ( xRange ) )
9019 xRange = this->_xRange;
9020 if ( std::isinf ( xRange ) )
9022 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;
9026 if ( std::isinf ( yRange ) )
9028 yRange = this->_yRange;
9029 if ( std::isinf ( yRange ) )
9031 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;
9035 if ( std::isinf ( zRange ) )
9037 zRange = this->_zRange;
9038 if ( std::isinf ( zRange ) )
9040 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;
9048 cell[3] =
static_cast<float> ( 90.0 );
9049 cell[4] =
static_cast<float> ( 90.0 );
9050 cell[5] =
static_cast<float> ( 90.0 );
9053 CMap_io::ccp4_cmap_set_cell ( mapFile, cell );
9054 CMap_io::ccp4_cmap_set_grid ( mapFile, grid );
9055 CMap_io::ccp4_cmap_set_order ( mapFile, axisOrder );
9056 CMap_io::ccp4_cmap_set_dim ( mapFile, dims );
9057 CMap_io::ccp4_cmap_set_origin ( mapFile, axFrom );
9059 CMap_io::ccp4_cmap_set_spacegroup ( mapFile, 1 );
9060 CMap_io::ccp4_cmap_set_title ( mapFile, title );
9061 CMap_io::ccp4_cmap_set_datamode ( mapFile, 2 );
9064 std::vector<float> section( dims[axisOrder[1]-1] * dims[axisOrder[0]-1] );
9069 for ( iters[2] = 0; iters[2] < dims[axisOrder[2]-1]; iters[2]++ )
9073 for ( iters[1] = 0; iters[1] < dims[axisOrder[1]-1]; iters[1]++ )
9075 for ( iters[0] = 0; iters[0] < dims[axisOrder[0]-1]; iters[0]++ )
9077 arrPos = iters[2] + (dims[axisOrder[2]-1]) * ( iters[1] + (dims[axisOrder[1]-1]) * iters[0] );
9079 section[ index++ ] =
static_cast<float> ( map[arrPos] );
9083 CMap_io::ccp4_cmap_write_section( mapFile, §ion[0] );
9086 CMap_io::ccp4_cmap_close ( mapFile );
9115 void ProSHADE_internal::ProSHADE_data::writePDB ( std::string templateName,
9116 std::string outputName,
9125 clipper::mmdb::CMMDBManager *mfile =
new clipper::mmdb::CMMDBManager ( );
9126 if ( mfile->ReadCoorFile ( templateName.c_str() ) )
9128 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read file: " << templateName.c_str() << std::endl;
9139 bool firstAtom =
true;
9146 clipper::mmdb::PPCChain chain;
9147 clipper::mmdb::PPCResidue residue;
9148 clipper::mmdb::PPCAtom atom;
9150 std::vector < std::array<double,3> > atCoords;
9151 std::array<double,3> hlpArr;
9154 mfile->GetChainTable ( 1, chain, noChains );
9156 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9161 chain[nCh]->GetResidueTable ( residue, noResidues );
9163 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9165 if ( residue[nRes] )
9168 residue[nRes]->GetAtomTable ( atom, noAtoms );
9170 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9175 if ( atom[aNo]->Ter ) {
continue; }
9178 hlpArr[0] = atom[aNo]->x;
9179 hlpArr[1] = atom[aNo]->y;
9180 hlpArr[2] = atom[aNo]->z;
9181 atCoords.emplace_back ( hlpArr );
9186 maxX = atom[aNo]->x;
9187 minX = atom[aNo]->x;
9188 maxY = atom[aNo]->y;
9189 minY = atom[aNo]->y;
9190 maxZ = atom[aNo]->z;
9191 minZ = atom[aNo]->z;
9196 if ( atom[aNo]->x > maxX ) { maxX = atom[aNo]->x; }
if ( atom[aNo]->x < minX ) { minX = atom[aNo]->x; }
9197 if ( atom[aNo]->y > maxY ) { maxY = atom[aNo]->y; }
if ( atom[aNo]->y < minY ) { minY = atom[aNo]->y; }
9198 if ( atom[aNo]->z > maxZ ) { maxZ = atom[aNo]->z; }
if ( atom[aNo]->z < minZ ) { minZ = atom[aNo]->z; }
9208 if ( ( rotEulA != 0.0 ) || ( rotEulB != 0.0 ) || ( rotEulG != 0.0 ) )
9211 double xRng = ( maxX - minX ) / 2.0;
9212 double yRng = ( maxY - minY ) / 2.0;
9213 double zRng = ( maxZ - minZ ) / 2.0;
9214 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9216 atCoords.at(iter)[0] = ( atCoords.at(iter)[0] - minX ) - xRng;
9217 atCoords.at(iter)[1] = ( atCoords.at(iter)[1] - minY ) - yRng;
9218 atCoords.at(iter)[2] = ( atCoords.at(iter)[2] - minZ ) - zRng;
9222 std::vector< std::vector < double > > rMat;
9223 std::vector< double > hlpVec;
9224 hlpVec.emplace_back ( cos ( rotEulA ) * cos ( rotEulB ) * cos ( rotEulG ) - sin ( rotEulA ) * sin ( rotEulG ) );
9225 hlpVec.emplace_back ( sin ( rotEulA ) * cos ( rotEulB ) * cos ( rotEulG ) + cos ( rotEulA ) * sin ( rotEulG ) );
9226 hlpVec.emplace_back ( -sin ( rotEulB ) * cos ( rotEulG ) );
9227 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9229 hlpVec.emplace_back ( -cos ( rotEulA ) * cos ( rotEulB ) * sin ( rotEulG ) - sin ( rotEulA ) * cos ( rotEulG ) );
9230 hlpVec.emplace_back ( -sin ( rotEulA ) * cos ( rotEulB ) * sin ( rotEulG ) + cos ( rotEulA ) * cos ( rotEulG ) );
9231 hlpVec.emplace_back ( sin ( rotEulB ) * sin ( rotEulG ) );
9232 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9234 hlpVec.emplace_back ( cos ( rotEulA ) * sin ( rotEulB ) );
9235 hlpVec.emplace_back ( sin ( rotEulA ) * sin ( rotEulB ) );
9236 hlpVec.emplace_back ( cos ( rotEulB ) );
9237 rMat.emplace_back ( hlpVec ); hlpVec.clear();
9240 double hlpXVal = 0.0;
9241 double hlpYVal = 0.0;
9242 double hlpZVal = 0.0;
9243 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9245 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) );
9246 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) );
9247 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) );
9249 atCoords.at(iter)[0] = hlpXVal;
9250 atCoords.at(iter)[1] = hlpYVal;
9251 atCoords.at(iter)[2] = hlpZVal;
9255 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9257 atCoords.at(iter)[0] = ( atCoords.at(iter)[0] + xRng ) + minX;
9258 atCoords.at(iter)[1] = ( atCoords.at(iter)[1] + yRng ) + minY;
9259 atCoords.at(iter)[2] = ( atCoords.at(iter)[2] + zRng ) + minZ;
9264 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( atCoords.size() ); iter++ )
9266 atCoords.at(iter)[0] = atCoords.at(iter)[0] + trsX;
9267 atCoords.at(iter)[1] = atCoords.at(iter)[1] + trsY;
9268 atCoords.at(iter)[2] = atCoords.at(iter)[2] + trsZ;
9272 unsigned int atIt = 0;
9273 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9278 chain[nCh]->GetResidueTable ( residue, noResidues );
9280 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9282 if ( residue[nRes] )
9285 residue[nRes]->GetAtomTable ( atom, noAtoms );
9287 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9292 if ( atom[aNo]->Ter ) {
continue; }
9295 atom[aNo]->SetCoordinates ( atCoords.at(atIt)[0],
9296 atCoords.at(atIt)[1],
9297 atCoords.at(atIt)[2],
9298 atom[aNo]->occupancy,
9299 atom[aNo]->tempFactor );
9310 if ( mfile->WritePDBASCII ( outputName.c_str() ) )
9312 std::cerr <<
"!!! ProSHADE ERROR !!! Failed to write out PDB file " << outputName.c_str() <<
"." << std::endl;
9330 void ProSHADE_internal::ProSHADE_data::deleteModel ( std::string modelPath )
9333 double vanDerWaals = 1.7;
9334 double smoothing = vanDerWaals * 2.0;
9337 clipper::mmdb::CMMDBManager *mfile =
new clipper::mmdb::CMMDBManager ( );
9338 if ( mfile->ReadCoorFile ( modelPath.c_str() ) )
9340 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read model file: " << modelPath.c_str() << std::endl;
9348 std::vector<std::array<double,3>> coords;
9349 std::array<double,3> hlpArr;
9351 clipper::mmdb::PPCChain chain;
9352 clipper::mmdb::PPCResidue residue;
9353 clipper::mmdb::PPCAtom atom;
9356 mfile->GetChainTable ( 1, chain, noChains );
9357 for (
unsigned int nCh = 0; nCh < static_cast<unsigned int> ( noChains ); nCh++ )
9362 chain[nCh]->GetResidueTable ( residue, noResidues );
9364 for (
unsigned int nRes = 0; nRes < static_cast<unsigned int> ( noResidues ); nRes++ )
9366 if ( residue[nRes] )
9369 residue[nRes]->GetAtomTable ( atom, noAtoms );
9371 for (
unsigned int aNo = 0; aNo < static_cast<unsigned int> ( noAtoms ); aNo++ )
9376 if ( atom[aNo]->Ter ) {
continue; }
9379 hlpArr[0] = atom[aNo]->x;
9380 hlpArr[1] = atom[aNo]->y;
9381 hlpArr[2] = atom[aNo]->z;
9384 coords.emplace_back ( hlpArr );
9396 double* remMask =
new double[(this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1)];
9397 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1) ); iter++ )
9399 remMask[iter] = 1.0;
9403 double xFromSM = 0.0;
9405 double yFromSM = 0.0;
9407 double zFromSM = 0.0;
9410 double xRealStart = ( this->_xFrom /
static_cast<double>( this->_maxMapU + 1 ) ) * this->_xRange;
9411 double yRealStart = ( this->_yFrom /
static_cast<double>( this->_maxMapV + 1 ) ) * this->_yRange;
9412 double zRealStart = ( this->_zFrom /
static_cast<double>( this->_maxMapW + 1 ) ) * this->_zRange;
9414 double xRealStep = 1.0 /
static_cast<double>( this->_maxMapU + 1 ) * this->_xRange;
9415 double yRealStep = 1.0 /
static_cast<double>( this->_maxMapV + 1 ) * this->_yRange;
9416 double zRealStep = 1.0 /
static_cast<double>( this->_maxMapW + 1 ) * this->_zRange;
9430 for (
int cIt = 0; cIt < static_cast<int> ( coords.size() ); cIt++ )
9432 xFromSM = coords.at(cIt)[0] - smoothing;
9433 xToSM = coords.at(cIt)[0] + smoothing;
9434 yFromSM = coords.at(cIt)[1] - smoothing;
9435 yToSM = coords.at(cIt)[1] + smoothing;
9436 zFromSM = coords.at(cIt)[2] - smoothing;
9437 zToSM = coords.at(cIt)[2] + smoothing;
9440 for (
double uIt = xRealStart; uIt < static_cast<double> ( ( this->_xTo /
static_cast<double>( this->_maxMapU + 1 ) ) * this->_xRange ); uIt += xRealStep )
9442 if ( ( uIt < xFromSM ) || ( uIt > xToSM ) ) { uIter += 1;
continue; }
9443 xHlp = pow ( uIt - coords.at(cIt)[0], 2.0 );
9446 for (
double vIt = yRealStart; vIt < static_cast<double> ( ( this->_yTo /
static_cast<double>( this->_maxMapV + 1 ) ) * this->_yRange ); vIt += yRealStep )
9448 if ( ( vIt < yFromSM ) || ( vIt > yToSM ) ) { vIter += 1;
continue; }
9449 yHlp = pow ( vIt - coords.at(cIt)[1], 2.0 );
9452 for (
double wIt = zRealStart; wIt < static_cast<double> ( ( this->_zTo /
static_cast<double>( this->_maxMapW + 1 ) ) * this->_zRange ); wIt += zRealStep )
9454 if ( ( wIt < zFromSM ) || ( wIt > zToSM ) ) { wIter += 1;
continue; }
9455 zHlp = pow ( wIt - coords.at(cIt)[2], 2.0 );
9457 arrPos = wIter + (this->_maxMapW + 1) * ( vIter + (this->_maxMapV + 1) * uIter );
9458 dist = sqrt ( xHlp + yHlp + zHlp );
9460 if ( dist < vanDerWaals ) { remMask[arrPos] = 0.0;
continue; }
9461 if ( dist < smoothing )
9463 remMask[arrPos] = ( 1.0 - cos ( ( M_PI * ( dist - vanDerWaals ) ) / ( smoothing - vanDerWaals ) ) ) / 2.0;
9477 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( (this->_maxMapU + 1) * (this->_maxMapV + 1) * (this->_maxMapW + 1) ); iter++ )
9479 this->_densityMapMap[iter] *= remMask[iter];
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.
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.