22 #include <rvapi_interface.h> 45 std::cerr <<
"!!! ProSHADE ERROR !!! Tried to build a database of files, but the filename to which it should be saved is empty. Terminating ..." << std::endl;
49 std::stringstream hlpSS;
50 hlpSS <<
"<font color=\"red\">" <<
"Missing the database name for building database." <<
"</font>";
51 rvapi_set_text ( hlpSS.str().c_str(),
66 std::cerr <<
"!!! ProSHADE ERROR !!! Tried to build a database of files, but the supplied no files. Terminating ..." << std::endl;
70 std::stringstream hlpSS;
71 hlpSS <<
"<font color=\"red\">" <<
"There are no files to be saved into the database." <<
"</font>";
72 rvapi_set_text ( hlpSS.str().c_str(),
87 std::cout <<
">> Sanity check passed." << std::endl;
91 std::ofstream dbFile ( settings->
databaseName, std::ios::out | std::ios::binary);
96 std::cerr <<
"!!! ProSHADE ERROR !!! Canno open the database file " << settings->
databaseName <<
" . Terminating..." << std::endl;
100 std::stringstream hlpSS;
101 hlpSS <<
"<font color=\"red\">" <<
"Cannot open database with name " << settings->
databaseName <<
". Could you have no permissions to write to the requested database location?" <<
"</font>";
102 rvapi_set_text ( hlpSS.str().c_str(),
119 this->theta = settings->
theta;
120 this->phi = settings->
phi;
126 this->useCOM = settings->
useCOM;
129 this->alpha = settings->
alpha;
130 this->mPower = settings->
mPower;
131 this->ignoreLs = settings->
ignoreLs;
135 this->usePhase = settings->
usePhase;
144 rvapi_add_section (
"DBSettingsSection",
154 std::stringstream hlpSS;
155 hlpSS <<
"<pre>" <<
"Map resolution: ";
156 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
157 for (
int iter = 0; iter < hlpIt; iter++ )
162 std::stringstream hlpSS2;
163 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mapResolution * 1000.0 ) / 1000.0;
164 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
165 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
166 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
168 rvapi_set_text ( hlpSS.str().c_str(),
175 hlpSS.str ( std::string ( ) );
176 hlpSS <<
"<pre>" <<
"Bandwidth: ";
177 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
178 for (
int iter = 0; iter < hlpIt; iter++ )
183 hlpSS2.str ( std::string ( ) );
184 if ( this->bandwidth == 0 ) { hlpSS2 <<
" AUTO"; }
185 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bandwidth * 1000.0 ) / 1000.0; }
186 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
187 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
188 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
190 rvapi_set_text ( hlpSS.str().c_str(),
197 hlpSS.str ( std::string ( ) );
198 hlpSS <<
"<pre>" <<
"Gauss-Legendre Integration order: ";
199 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
200 for (
int iter = 0; iter < hlpIt; iter++ )
205 hlpSS2.str ( std::string ( ) );
206 if ( this->glIntegOrder == 0 ) { hlpSS2 <<
" AUTO"; }
207 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->glIntegOrder * 1000.0 ) / 1000.0; }
208 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
209 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
210 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
212 rvapi_set_text ( hlpSS.str().c_str(),
219 hlpSS.str ( std::string ( ) );
220 hlpSS <<
"<pre>" <<
"Theta angle sampling: ";
221 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
222 for (
int iter = 0; iter < hlpIt; iter++ )
227 hlpSS2.str ( std::string ( ) );
228 if ( this->theta == 0 ) { hlpSS2 <<
" AUTO"; }
229 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->theta * 1000.0 ) / 1000.0; }
230 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
231 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
232 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
234 rvapi_set_text ( hlpSS.str().c_str(),
241 hlpSS.str ( std::string ( ) );
242 hlpSS <<
"<pre>" <<
"Phi angle sampling: ";
243 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
244 for (
int iter = 0; iter < hlpIt; iter++ )
249 hlpSS2.str ( std::string ( ) );
250 if ( this->phi == 0 ) { hlpSS2 <<
" AUTO"; }
251 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->phi * 1000.0 ) / 1000.0; }
252 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
253 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
254 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
256 rvapi_set_text ( hlpSS.str().c_str(),
263 hlpSS.str ( std::string ( ) );
264 hlpSS <<
"<pre>" <<
"Set all PDB file B-factors to: ";
265 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
266 for (
int iter = 0; iter < hlpIt; iter++ )
271 hlpSS2.str ( std::string ( ) );
272 if ( this->bFactorValue == 0 ) { hlpSS2 <<
" AUTO"; }
273 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorValue * 1000.0 ) / 1000.0; }
274 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
275 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
276 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
278 rvapi_set_text ( hlpSS.str().c_str(),
285 hlpSS.str ( std::string ( ) );
286 hlpSS <<
"<pre>" <<
"Change B-factors after map computation by: ";
287 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
288 for (
int iter = 0; iter < hlpIt; iter++ )
293 hlpSS2.str ( std::string ( ) );
294 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorChange * 1000.0 ) / 1000.0;
295 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
296 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
297 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
299 rvapi_set_text ( hlpSS.str().c_str(),
306 hlpSS.str ( std::string ( ) );
307 hlpSS <<
"<pre>" <<
"Map IQR from median threshold: ";
308 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
309 for (
int iter = 0; iter < hlpIt; iter++ )
314 hlpSS2.str ( std::string ( ) );
315 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->noIQRsFromMap * 1000.0 ) / 1000.0;
316 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
317 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
318 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
320 rvapi_set_text ( hlpSS.str().c_str(),
327 hlpSS.str ( std::string ( ) );
328 hlpSS <<
"<pre>" <<
"Distance between shells: ";
329 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
330 for (
int iter = 0; iter < hlpIt; iter++ )
335 hlpSS2.str ( std::string ( ) );
336 if ( this->shellSpacing == 0 ) { hlpSS2 <<
" AUTO"; }
337 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->shellSpacing * 1000.0 ) / 1000.0; }
338 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
339 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
340 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
342 rvapi_set_text ( hlpSS.str().c_str(),
349 hlpSS.str ( std::string ( ) );
350 hlpSS <<
"<pre>" <<
"Number of shells: ";
351 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
352 for (
int iter = 0; iter < hlpIt; iter++ )
357 hlpSS2.str ( std::string ( ) );
358 if ( this->manualShells == 0 ) { hlpSS2 <<
" AUTO"; }
359 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->manualShells * 1000.0 ) / 1000.0; }
360 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
361 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
362 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
364 rvapi_set_text ( hlpSS.str().c_str(),
371 hlpSS.str ( std::string ( ) );
372 hlpSS <<
"<pre>" <<
"Use Centre of Mass for centering: ";
373 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
374 for (
int iter = 0; iter < hlpIt; iter++ )
379 hlpSS2.str ( std::string ( ) );
380 if ( this->useCOM == 0 ) { hlpSS2 <<
" FALSE"; }
381 else { hlpSS2 <<
" TRUE"; }
382 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
383 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
384 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
386 rvapi_set_text ( hlpSS.str().c_str(),
393 hlpSS.str ( std::string ( ) );
394 hlpSS <<
"<pre>" <<
"Add extra space to cell: ";
395 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
396 for (
int iter = 0; iter < hlpIt; iter++ )
401 hlpSS2.str ( std::string ( ) );
402 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->extraSpace * 1000.0 ) / 1000.0;
403 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
404 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
405 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
407 rvapi_set_text ( hlpSS.str().c_str(),
414 hlpSS.str ( std::string ( ) );
415 hlpSS <<
"<pre>" <<
"Raise Fourier coefficients to power: ";
416 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
417 for (
int iter = 0; iter < hlpIt; iter++ )
422 hlpSS2.str ( std::string ( ) );
423 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->alpha * 1000.0 ) / 1000.0;
424 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
425 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
426 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
428 rvapi_set_text ( hlpSS.str().c_str(),
435 hlpSS.str ( std::string ( ) );
436 hlpSS <<
"<pre>" <<
"Weight Energy Level matrix position by: ";
437 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
438 for (
int iter = 0; iter < hlpIt; iter++ )
443 hlpSS2.str ( std::string ( ) );
444 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mPower * 1000.0 ) / 1000.0;
445 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
446 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
447 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
449 rvapi_set_text ( hlpSS.str().c_str(),
456 hlpSS.str ( std::string ( ) );
457 hlpSS <<
"<pre>" <<
"Ignore the following bands: ";
458 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
459 for (
int iter = 0; iter < hlpIt; iter++ )
464 hlpSS2.str ( std::string ( ) );
465 for (
int iter = 0; iter < static_cast<int> ( this->ignoreLs.size() ); iter++ )
467 hlpSS2 << std::showpos << this->ignoreLs.at(iter) <<
" ";
469 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
471 rvapi_set_text ( hlpSS.str().c_str(),
478 hlpSS.str ( std::string ( ) );
479 hlpSS <<
"<pre>" <<
"Compute Energy Level distances: ";
480 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
481 for (
int iter = 0; iter < hlpIt; iter++ )
486 hlpSS2.str ( std::string ( ) );
487 if ( this->energyLevelDist == 0 ) { hlpSS2 <<
" FALSE"; }
488 else { hlpSS2 <<
" TRUE"; }
489 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
490 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
491 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
493 rvapi_set_text ( hlpSS.str().c_str(),
500 hlpSS.str ( std::string ( ) );
501 hlpSS <<
"<pre>" <<
"Compute Trace Sigma distances: ";
502 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
503 for (
int iter = 0; iter < hlpIt; iter++ )
508 hlpSS2.str ( std::string ( ) );
509 if ( this->traceSigmaDist == 0 ) { hlpSS2 <<
" FALSE"; }
510 else { hlpSS2 <<
" TRUE"; }
511 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
512 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
513 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
515 rvapi_set_text ( hlpSS.str().c_str(),
522 hlpSS.str ( std::string ( ) );
523 hlpSS <<
"<pre>" <<
"Compute Rotation Function distances: ";
524 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
525 for (
int iter = 0; iter < hlpIt; iter++ )
530 hlpSS2.str ( std::string ( ) );
531 if ( this->fullRotFnDist == 0 ) { hlpSS2 <<
" FALSE"; }
532 else { hlpSS2 <<
" TRUE"; }
533 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
534 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
535 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
537 rvapi_set_text ( hlpSS.str().c_str(),
544 hlpSS.str ( std::string ( ) );
545 hlpSS <<
"<pre>" <<
"Use phase information: ";
546 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
547 for (
int iter = 0; iter < hlpIt; iter++ )
552 hlpSS2.str ( std::string ( ) );
553 if ( this->usePhase == 0 ) { hlpSS2 <<
" FALSE"; }
554 else { hlpSS2 <<
" TRUE"; }
555 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
556 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
557 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
559 rvapi_set_text ( hlpSS.str().c_str(),
572 rvapi_add_section (
"DBFilesSection",
587 std::cout <<
"Now detecting sizes of structures for database sorting." << std::endl;
592 std::stringstream hlpSS;
593 hlpSS <<
"<font color=\"green\">" <<
"Database settings saved ." <<
"</font>";
594 rvapi_set_text ( hlpSS.str().c_str(),
605 std::vector< std::array<double,2> > strSizes;
606 std::array<double,2> hlpArr;
607 std::vector<double> shSpc ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
608 std::vector<unsigned int> bndV ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
609 std::vector<unsigned int> thtV ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
610 std::vector<unsigned int> phV ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
611 std::vector<unsigned int> glIntV ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
612 std::vector<double> exSpV ( static_cast<unsigned int> ( settings->
structFiles.size() ), 0.0 );
613 int filesSectionIter = 0;
614 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
structFiles.size() ); iter++ )
618 std::cout <<
">> Now loading file " << iter+1 <<
" out of " << settings->
structFiles.size() << std::endl;
627 this->theta = settings->
theta;
628 this->phi = settings->
phi;
632 unsigned int fileType =
checkFileType ( structFiles.at(iter) );
648 else if ( fileType == 1 )
661 this->firstLineCOM );
665 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(iter) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
669 std::stringstream hlpSS;
670 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(iter) <<
"." <<
"</font>";
671 rvapi_set_text ( hlpSS.str().c_str(),
685 hlpArr[0] = (one->_xRange-this->extraSpace) * (one->_yRange-this->extraSpace) * (one->_zRange-this->extraSpace);
686 hlpArr[1] =
static_cast<double> ( iter );
690 strSizes.emplace_back ( hlpArr );
696 strSizes.emplace_back ( hlpArr );
702 std::cout <<
">>>>> Excluding file " << this->structFiles.at(iter) <<
" due to large size (databaseMaxVolume smaller than structure volunme)." << std::endl;
707 std::stringstream hlpSS;
708 hlpSS <<
"<font color=\"red\">" <<
"Excluding file " << this->structFiles.at(iter) <<
" from the database due to size constraints." <<
"</font>";
709 rvapi_set_text ( hlpSS.str().c_str(),
715 filesSectionIter += 1;
727 double minSph = 1000000000.0;
729 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
structFiles.size() ); iter++ )
731 if ( shSpc.at(iter) < minSph )
733 minSph = shSpc.at(iter);
734 minSphPos =
static_cast<int> ( iter );
739 settings->
bandwidth = bndV.at ( minSphPos );
740 settings->
theta = thtV.at ( minSphPos );
741 settings->
phi = phV.at ( minSphPos );
743 settings->
extraSpace = exSpV.at ( minSphPos );
746 std::sort ( strSizes.begin(), strSizes.end(), [](
const std::array<double,2>& a,
const std::array<double,2>& b) {
return a[0] < b[0]; });
749 if ( strSizes.size() > 0 )
754 std::vector<std::string> hlpVec ( strSizes.size() );
755 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( strSizes.size() ); iter++ )
757 hlpVec.at(iter) = settings->
structFiles.at(strSizes.at(iter)[1]);
761 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( strSizes.size() ); iter++ )
763 settings->
structFiles.emplace_back ( hlpVec.at(iter) );
770 std::stringstream hlpSS;
771 hlpSS <<
"<font color=\"green\">" <<
"Volume ordering of input structures complete." <<
"</font>";
772 rvapi_set_text ( hlpSS.str().c_str(),
784 unsigned int hlpUInt;
787 dbFile.write ( reinterpret_cast<char*> ( &settings->
databaseMinVolume ),
sizeof(
double ) );
788 dbFile.write ( reinterpret_cast<char*> ( &settings->
mapResolution ),
sizeof(
double ) );
789 dbFile.write ( reinterpret_cast<char*> ( &settings->
bandwidth ),
sizeof(
unsigned int ) );
790 dbFile.write ( reinterpret_cast<char*> ( &settings->
glIntegOrder ),
sizeof(
unsigned int ) );
791 dbFile.write ( reinterpret_cast<char*> ( &settings->
theta ),
sizeof(
unsigned int ) );
792 dbFile.write ( reinterpret_cast<char*> ( &settings->
phi ),
sizeof(
unsigned int ) );
793 dbFile.write ( reinterpret_cast<char*> ( &settings->
bFactorValue ),
sizeof(
double ) );
794 dbFile.write ( reinterpret_cast<char*> ( &settings->
bFactorChange ),
sizeof(
double ) );
795 dbFile.write ( reinterpret_cast<char*> ( &settings->
noIQRsFromMap ),
sizeof(
double ) );
796 dbFile.write ( reinterpret_cast<char*> ( &settings->
maskBlurFactor ),
sizeof(
double ) );
797 dbFile.write ( reinterpret_cast<char*> ( &settings->
shellSpacing ),
sizeof(
double ) );
798 dbFile.write ( reinterpret_cast<char*> ( &settings->
manualShells ),
sizeof(
unsigned int ) );
799 dbFile.write ( reinterpret_cast<char*> ( &settings->
usePhase ),
sizeof(
bool ) );
800 dbFile.write ( reinterpret_cast<char*> ( &settings->
saveWithAndWithout ),
sizeof(
bool ) );
801 dbFile.write ( reinterpret_cast<char*> ( &settings->
useCOM ),
sizeof(
bool ) );
802 dbFile.write ( reinterpret_cast<char*> ( &settings->
firstLineCOM ),
sizeof(
bool ) );
803 dbFile.write ( reinterpret_cast<char*> ( &settings->
alpha ),
sizeof(
double ) );
804 dbFile.write ( reinterpret_cast<char*> ( &settings->
mPower ),
sizeof(
double ) );
806 hlpUInt =
static_cast<unsigned int> ( settings->
ignoreLs.size() );
807 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
808 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
ignoreLs.size() ); iter++ )
810 dbFile.write ( reinterpret_cast<char*> ( &settings->
ignoreLs.at(iter) ),
sizeof(
unsigned int ) );
813 hlpUInt =
static_cast<unsigned int> ( settings->
structFiles.size() );
814 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
815 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
structFiles.size() ); iter++ )
818 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
819 dbFile.write ( settings->
structFiles.at(iter).c_str(),
sizeof( char ) * hlpUInt );
822 dbFile.write ( reinterpret_cast<char*> ( &settings->
peakHeightNoIQRs ),
sizeof(
double ) );
823 dbFile.write ( reinterpret_cast<char*> ( &settings->
peakDistanceForReal ),
sizeof(
double ) );
825 dbFile.write ( reinterpret_cast<char*> ( &settings->
aaErrorTolerance ),
sizeof(
double ) );
826 dbFile.write ( reinterpret_cast<char*> ( &settings->
symGapTolerance ),
sizeof(
double ) );
827 dbFile.write ( reinterpret_cast<char*> ( &settings->
energyLevelDist ),
sizeof(
bool ) );
828 dbFile.write ( reinterpret_cast<char*> ( &settings->
traceSigmaDist ),
sizeof(
bool ) );
829 dbFile.write ( reinterpret_cast<char*> ( &settings->
fullRotFnDist ),
sizeof(
bool ) );
830 dbFile.write ( reinterpret_cast<char*> ( &settings->
enLevelsThreshold ),
sizeof(
double ) );
831 dbFile.write ( reinterpret_cast<char*> ( &settings->
trSigmaThreshold ),
sizeof(
double ) );
832 dbFile.write ( reinterpret_cast<char*> ( &settings->
taskToPerform ),
sizeof( ProSHADE::Task ) );
835 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
836 dbFile.write ( settings->
clearMapFile.c_str(),
sizeof( char ) * hlpUInt );
839 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
840 dbFile.write ( settings->
mapFragName.c_str(),
sizeof( char ) * hlpUInt );
844 std::cout <<
">> Settings written to " << settings->
databaseName <<
"." << std::endl;
849 std::stringstream hlpSS;
850 hlpSS <<
"<font color=\"green\">" <<
"Database settings written into the database file." <<
"</font>";
851 rvapi_set_text ( hlpSS.str().c_str(),
864 std::cout <<
"Saving files in sorted volume order." << std::endl;
868 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( settings->
structFiles.size() ); iter++ )
872 std::cout <<
">> Now saving file " << iter+1 <<
" out of " << settings->
structFiles.size() << std::endl;
874 settings->
usePhase = this->usePhase;
882 this->theta = settings->
theta;
883 this->phi = settings->
phi;
903 else if ( fileType == 1 )
916 this->firstLineCOM );
920 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(iter) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
924 std::stringstream hlpSS;
925 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(iter) <<
"." <<
"</font>";
926 rvapi_set_text ( hlpSS.str().c_str(),
941 std::cout <<
">>>>> Structure loaded." << std::endl;
945 if ( saveWithAndWithout )
949 if ( this->usePhase )
975 if ( saveWithAndWithout )
998 std::cout <<
">>>>> Spherical harmonics computed." << std::endl;
1005 dbFile.write ( reinterpret_cast<char*> ( &one->_fromPDB ),
sizeof(
bool ) );
1006 dbFile.write ( reinterpret_cast<char*> ( &one->_shellSpacing ),
sizeof(
double ) );
1007 dbFile.write ( reinterpret_cast<char*> ( &one->_maxExtraCellularSpace ),
sizeof(
double ) );
1008 dbFile.write ( reinterpret_cast<char*> ( &one->_xRange ),
sizeof(
double ) );
1009 dbFile.write ( reinterpret_cast<char*> ( &one->_yRange ),
sizeof(
double ) );
1010 dbFile.write ( reinterpret_cast<char*> ( &one->_zRange ),
sizeof(
double ) );
1012 hlpUInt = one->_shellPlacement.size();
1013 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
1014 for (
unsigned int it = 0; it < hlpUInt; it++ )
1016 dbFile.write ( reinterpret_cast<char*> ( &one->_shellPlacement.at(it) ),
sizeof(
double ) );
1019 dbFile.write ( reinterpret_cast<char*> ( &one->_mapResolution ),
sizeof(
double ) );
1020 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapU ),
sizeof(
unsigned int ) );
1021 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapV ),
sizeof(
unsigned int ) );
1022 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapW ),
sizeof(
unsigned int ) );
1023 dbFile.write ( reinterpret_cast<char*> ( &one->_densityMapComputed ),
sizeof(
bool ) );
1024 dbFile.write ( reinterpret_cast<char*> ( &one->_mapMean ),
sizeof(
double ) );
1025 dbFile.write ( reinterpret_cast<char*> ( &one->_mapSdev ),
sizeof(
double ) );
1026 dbFile.write ( reinterpret_cast<char*> ( &one->_fourierCoeffPower ),
sizeof(
double ) );
1027 dbFile.write ( reinterpret_cast<char*> ( &one->_bFactorChange ),
sizeof(
double ) );
1028 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapRange ),
sizeof(
double ) );
1029 dbFile.write ( reinterpret_cast<char*> ( &one->_phaseRemoved ),
sizeof(
bool ) );
1030 dbFile.write ( reinterpret_cast<char*> ( &one->_usePhase ),
sizeof(
bool ) );
1031 dbFile.write ( reinterpret_cast<char*> ( &one->_keepOrRemove ),
sizeof(
bool ) );
1032 dbFile.write ( reinterpret_cast<char*> ( &one->_thetaAngle ),
sizeof(
double ) );
1033 dbFile.write ( reinterpret_cast<char*> ( &one->_phiAngle ),
sizeof(
double ) );
1034 dbFile.write ( reinterpret_cast<char*> ( &one->_noShellsWithData ),
sizeof(
unsigned int ) );
1035 dbFile.write ( reinterpret_cast<char*> ( &one->_xCorrection ),
sizeof(
unsigned int ) );
1036 dbFile.write ( reinterpret_cast<char*> ( &one->_yCorrection ),
sizeof(
unsigned int ) );
1037 dbFile.write ( reinterpret_cast<char*> ( &one->_zCorrection ),
sizeof(
unsigned int ) );
1038 dbFile.write ( reinterpret_cast<char*> ( &one->_xCorrErr ),
sizeof(
double ) );
1039 dbFile.write ( reinterpret_cast<char*> ( &one->_yCorrErr ),
sizeof(
double ) );
1040 dbFile.write ( reinterpret_cast<char*> ( &one->_zCorrErr ),
sizeof(
double ) );
1041 dbFile.write ( reinterpret_cast<char*> ( &one->_sphereMapped ),
sizeof(
bool ) );
1042 dbFile.write ( reinterpret_cast<char*> ( &one->_firstLineCOM ),
sizeof(
bool ) );
1043 dbFile.write ( reinterpret_cast<char*> ( &one->_bandwidthLimit ),
sizeof(
unsigned int ) );
1044 dbFile.write ( reinterpret_cast<char*> ( &one->_oneDimmension ),
sizeof(
unsigned int ) );
1045 dbFile.write ( reinterpret_cast<char*> ( &one->_sphericalCoefficientsComputed ),
sizeof(
bool ) );
1046 dbFile.write ( reinterpret_cast<char*> ( &one->_rrpMatricesPrecomputed ),
sizeof(
bool ) );
1049 for (
unsigned int sh = 0; sh < one->_noShellsWithData; sh++ )
1051 for (
unsigned int arrIt = 0; arrIt < ( one->_oneDimmension * one->_oneDimmension ); arrIt++ )
1053 dbFile.write ( reinterpret_cast<char*> ( &one->_realSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1054 dbFile.write ( reinterpret_cast<char*> ( &one->_imagSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1059 for (
unsigned int bnIt = 0; bnIt < one->_bandwidthLimit; bnIt++ )
1061 if ( !one->_keepOrRemove ) {
if ( ( bnIt % 2 ) != 0 ) {
continue; } }
1063 for (
unsigned int sh1 = 0; sh1 < one->_noShellsWithData; sh1++ )
1065 for (
unsigned int sh2 = 0; sh2 < one->_noShellsWithData; sh2++ )
1067 dbFile.write ( reinterpret_cast<char*> ( &one->_rrpMatrices[bnIt][sh1][sh2] ),
sizeof(
double ) );
1073 if ( saveWithAndWithout )
1076 if ( one->_usePhase )
1078 dbFile.write ( reinterpret_cast<char*> ( &one->_xFrom ),
sizeof(
double ) );
1079 dbFile.write ( reinterpret_cast<char*> ( &one->_xTo ),
sizeof(
double ) );
1080 dbFile.write ( reinterpret_cast<char*> ( &one->_yFrom ),
sizeof(
double ) );
1081 dbFile.write ( reinterpret_cast<char*> ( &one->_yTo ),
sizeof(
double ) );
1082 dbFile.write ( reinterpret_cast<char*> ( &one->_zFrom ),
sizeof(
double ) );
1083 dbFile.write ( reinterpret_cast<char*> ( &one->_zTo ),
sizeof(
double ) );
1085 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( (one->_maxMapU+1) * (one->_maxMapV+1) * (one->_maxMapW+1) ); mIt++ )
1087 dbFile.write ( reinterpret_cast<char*> ( &one->_densityMapCor[mIt] ),
sizeof(
double ) );
1092 settings->
usePhase = !this->usePhase;
1100 this->theta = settings->
theta;
1101 this->phi = settings->
phi;
1106 if ( fileType == 2 )
1109 &this->shellSpacing,
1110 this->mapResolution,
1114 &this->glIntegOrder,
1121 else if ( fileType == 1 )
1124 &this->shellSpacing,
1125 this->mapResolution,
1129 &this->glIntegOrder,
1134 this->firstLineCOM );
1138 std::cerr <<
"!!! ProSHADE ERROR !!! Error loading file " << this->structFiles.at(iter) <<
" !!! Cannot detect the extension (currently, only PDB or MAP are allowed) and therefore cannot read the file." << std::endl;
1142 std::stringstream hlpSS;
1143 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(iter) <<
"." <<
"</font>";
1144 rvapi_set_text ( hlpSS.str().c_str(),
1159 std::cout <<
">>>>> Structure loaded." << std::endl;
1167 this->bFactorChange,
1171 &this->glIntegOrder,
1185 this->bFactorChange,
1194 this->manualShells );
1200 std::cout <<
">>>>> Spherical harmonics computed (phase reverse)." << std::endl;
1207 dbFile.write ( reinterpret_cast<char*> ( &two->_fromPDB ),
sizeof(
bool ) );
1208 dbFile.write ( reinterpret_cast<char*> ( &two->_shellSpacing ),
sizeof(
double ) );
1209 dbFile.write ( reinterpret_cast<char*> ( &two->_maxExtraCellularSpace ),
sizeof(
double ) );
1210 dbFile.write ( reinterpret_cast<char*> ( &two->_xRange ),
sizeof(
double ) );
1211 dbFile.write ( reinterpret_cast<char*> ( &two->_yRange ),
sizeof(
double ) );
1212 dbFile.write ( reinterpret_cast<char*> ( &two->_zRange ),
sizeof(
double ) );
1214 hlpUInt = two->_shellPlacement.size();
1215 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
1216 for (
unsigned int it = 0; it < hlpUInt; it++ )
1218 dbFile.write ( reinterpret_cast<char*> ( &two->_shellPlacement.at(it) ),
sizeof(
double ) );
1221 dbFile.write ( reinterpret_cast<char*> ( &two->_mapResolution ),
sizeof(
double ) );
1222 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapU ),
sizeof(
unsigned int ) );
1223 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapV ),
sizeof(
unsigned int ) );
1224 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapW ),
sizeof(
unsigned int ) );
1225 dbFile.write ( reinterpret_cast<char*> ( &two->_densityMapComputed ),
sizeof(
bool ) );
1226 dbFile.write ( reinterpret_cast<char*> ( &two->_mapMean ),
sizeof(
double ) );
1227 dbFile.write ( reinterpret_cast<char*> ( &two->_mapSdev ),
sizeof(
double ) );
1228 dbFile.write ( reinterpret_cast<char*> ( &two->_fourierCoeffPower ),
sizeof(
double ) );
1229 dbFile.write ( reinterpret_cast<char*> ( &two->_bFactorChange ),
sizeof(
double ) );
1230 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapRange ),
sizeof(
double ) );
1231 dbFile.write ( reinterpret_cast<char*> ( &two->_phaseRemoved ),
sizeof(
bool ) );
1232 dbFile.write ( reinterpret_cast<char*> ( &two->_usePhase ),
sizeof(
bool ) );
1233 dbFile.write ( reinterpret_cast<char*> ( &two->_keepOrRemove ),
sizeof(
bool ) );
1234 dbFile.write ( reinterpret_cast<char*> ( &two->_thetaAngle ),
sizeof(
double ) );
1235 dbFile.write ( reinterpret_cast<char*> ( &two->_phiAngle ),
sizeof(
double ) );
1236 dbFile.write ( reinterpret_cast<char*> ( &two->_noShellsWithData ),
sizeof(
unsigned int ) );
1237 dbFile.write ( reinterpret_cast<char*> ( &two->_xCorrection ),
sizeof(
unsigned int ) );
1238 dbFile.write ( reinterpret_cast<char*> ( &two->_yCorrection ),
sizeof(
unsigned int ) );
1239 dbFile.write ( reinterpret_cast<char*> ( &two->_zCorrection ),
sizeof(
unsigned int ) );
1240 dbFile.write ( reinterpret_cast<char*> ( &two->_xCorrErr ),
sizeof(
double ) );
1241 dbFile.write ( reinterpret_cast<char*> ( &two->_yCorrErr ),
sizeof(
double ) );
1242 dbFile.write ( reinterpret_cast<char*> ( &two->_zCorrErr ),
sizeof(
double ) );
1243 dbFile.write ( reinterpret_cast<char*> ( &two->_sphereMapped ),
sizeof(
bool ) );
1244 dbFile.write ( reinterpret_cast<char*> ( &two->_firstLineCOM ),
sizeof(
bool ) );
1245 dbFile.write ( reinterpret_cast<char*> ( &two->_bandwidthLimit ),
sizeof(
unsigned int ) );
1246 dbFile.write ( reinterpret_cast<char*> ( &two->_oneDimmension ),
sizeof(
unsigned int ) );
1247 dbFile.write ( reinterpret_cast<char*> ( &two->_sphericalCoefficientsComputed ),
sizeof(
bool ) );
1248 dbFile.write ( reinterpret_cast<char*> ( &two->_rrpMatricesPrecomputed ),
sizeof(
bool ) );
1251 for (
unsigned int sh = 0; sh < two->_noShellsWithData; sh++ )
1253 for (
unsigned int arrIt = 0; arrIt < ( two->_oneDimmension * two->_oneDimmension ); arrIt++ )
1255 dbFile.write ( reinterpret_cast<char*> ( &two->_realSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1256 dbFile.write ( reinterpret_cast<char*> ( &two->_imagSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1261 for (
unsigned int bnIt = 0; bnIt < two->_bandwidthLimit; bnIt++ )
1263 if ( !two->_keepOrRemove ) {
if ( ( bnIt % 2 ) != 0 ) {
continue; } }
1265 for (
unsigned int sh1 = 0; sh1 < two->_noShellsWithData; sh1++ )
1267 for (
unsigned int sh2 = 0; sh2 < two->_noShellsWithData; sh2++ )
1269 dbFile.write ( reinterpret_cast<char*> ( &two->_rrpMatrices[bnIt][sh1][sh2] ),
sizeof(
double ) );
1275 if ( two->_usePhase )
1277 dbFile.write ( reinterpret_cast<char*> ( &two->_xFrom ),
sizeof(
double ) );
1278 dbFile.write ( reinterpret_cast<char*> ( &two->_xTo ),
sizeof(
double ) );
1279 dbFile.write ( reinterpret_cast<char*> ( &two->_yFrom ),
sizeof(
double ) );
1280 dbFile.write ( reinterpret_cast<char*> ( &two->_yTo ),
sizeof(
double ) );
1281 dbFile.write ( reinterpret_cast<char*> ( &two->_zFrom ),
sizeof(
double ) );
1282 dbFile.write ( reinterpret_cast<char*> ( &two->_zTo ),
sizeof(
double ) );
1284 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( two->_maxMapU * two->_maxMapV * two->_maxMapW ); mIt++ )
1286 dbFile.write ( reinterpret_cast<char*> ( &two->_densityMapCor[mIt] ),
sizeof(
double ) );
1296 std::cout <<
">>>>> Structure saved." << std::endl;
1301 std::stringstream hlpSS;
1302 hlpSS <<
"<font color=\"green\">" <<
"File " << this->structFiles.at(iter) <<
" successfully saved to the database file." <<
"</font>";
1303 rvapi_set_text ( hlpSS.str().c_str(),
1309 filesSectionIter += 1;
1320 std::stringstream hlpSS;
1321 hlpSS <<
"<font color=\"green\">" <<
"File processing complete." <<
"</font>";
1322 rvapi_set_text ( hlpSS.str().c_str(),
1360 std::vector<std::string>* matchedStrNames )
1363 unsigned int hlpUInt, hlpUInt2;
1365 std::vector<std::string> dbStrNames;
1366 double minVol = 0.0;
1369 std::ifstream dbFile ( settings->
databaseName, std::ios::in | std::ios::binary);
1372 if ( dbFile.fail() )
1374 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open the database file for reading " << settings->
databaseName <<
" . Terminating..." << std::endl;
1378 std::stringstream hlpSS;
1379 hlpSS <<
"<font color=\"red\">" <<
"Cannot open database with name " << settings->
databaseName <<
". Could you have no permissions to write to the requested database location?" <<
"</font>";
1380 rvapi_set_text ( hlpSS.str().c_str(),
1395 std::cout <<
">>>>>>>> Database file opened." << std::endl;
1401 std::stringstream hlpSS;
1402 hlpSS <<
"<font color=\"green\">" <<
"Database reading initiated." <<
"</font>";
1403 rvapi_set_text ( hlpSS.str().c_str(),
1418 dbFile.read ( reinterpret_cast<char*> ( &minVol ),
sizeof (
double ) );
1419 if ( minVol == 0.0 )
1421 std::cerr <<
"!!! ProSHADE ERROR !!! The database file seems to be corrupted, or was produced with too small maximum allowed volume, as it is reporting minimal structure volume of 0.0 A. Terminating..." << std::endl;
1425 std::stringstream hlpSS;
1426 hlpSS <<
"<font color=\"red\">" <<
"The database file seems to be corrupted, or was produced with too small maximum allowed volume, as it is reporting minimal structure volume of 0.0 A. If this problem is not solved by decreasing the maximum allowed volume, this could be internal bug, in this case please report it." <<
"</font>";
1427 rvapi_set_text ( hlpSS.str().c_str(),
1440 dbFile.read ( reinterpret_cast<char*> ( &settings->
mapResolution ), sizeof (
double ) );
1441 dbFile.read ( reinterpret_cast<char*> ( &settings->
bandwidth ), sizeof (
unsigned int ) );
1442 dbFile.read ( reinterpret_cast<char*> ( &settings->
glIntegOrder ), sizeof (
unsigned int ) );
1443 dbFile.read ( reinterpret_cast<char*> ( &settings->
theta ), sizeof (
unsigned int ) );
1444 dbFile.read ( reinterpret_cast<char*> ( &settings->
phi ), sizeof (
unsigned int ) );
1445 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorValue ), sizeof (
double ) );
1446 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorChange ), sizeof (
double ) );
1447 dbFile.read ( reinterpret_cast<char*> ( &settings->
noIQRsFromMap ), sizeof (
double ) );
1448 dbFile.read ( reinterpret_cast<char*> ( &settings->
maskBlurFactor ), sizeof (
double ) );
1449 dbFile.read ( reinterpret_cast<char*> ( &settings->
shellSpacing ), sizeof (
double ) );
1450 dbFile.read ( reinterpret_cast<char*> ( &settings->
manualShells ), sizeof (
unsigned int ) );
1451 dbFile.read ( reinterpret_cast<char*> ( &settings->
usePhase ), sizeof (
bool ) );
1452 dbFile.read ( reinterpret_cast<char*> ( &settings->
saveWithAndWithout ), sizeof (
bool ) );
1453 dbFile.read ( reinterpret_cast<char*> ( &settings->
useCOM ), sizeof (
bool ) );
1454 dbFile.read ( reinterpret_cast<char*> ( &settings->
firstLineCOM ), sizeof (
bool ) );
1455 dbFile.read ( reinterpret_cast<char*> ( &settings->
alpha ), sizeof (
double ) );
1456 dbFile.read ( reinterpret_cast<char*> ( &settings->
mPower ), sizeof (
double ) );
1458 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1459 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
1461 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
1462 settings->
ignoreLs.emplace_back ( hlpUInt2 );
1465 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1466 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
1468 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
1469 hlpChar =
new char[hlpUInt2+1];
1470 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt2 );
1471 hlpChar[hlpUInt2] =
'\0';
1472 dbStrNames.emplace_back ( hlpChar );
1474 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakHeightNoIQRs ), sizeof (
double ) );
1475 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakDistanceForReal ), sizeof (
double ) );
1477 dbFile.read ( reinterpret_cast<char*> ( &settings->
aaErrorTolerance ), sizeof (
double ) );
1478 dbFile.read ( reinterpret_cast<char*> ( &settings->
symGapTolerance ), sizeof (
double ) );
1479 dbFile.read ( reinterpret_cast<char*> ( &settings->
energyLevelDist ), sizeof (
bool ) );
1480 dbFile.read ( reinterpret_cast<char*> ( &settings->
traceSigmaDist ), sizeof (
bool ) );
1481 dbFile.read ( reinterpret_cast<char*> ( &settings->
fullRotFnDist ), sizeof (
bool ) );
1482 dbFile.read ( reinterpret_cast<char*> ( &settings->
enLevelsThreshold ), sizeof (
double ) );
1483 dbFile.read ( reinterpret_cast<char*> ( &settings->
trSigmaThreshold ), sizeof (
double ) );
1484 dbFile.read ( reinterpret_cast<char*> ( &settings->
taskToPerform ), sizeof ( ProSHADE::Task ) );
1486 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1487 hlpChar =
new char[hlpUInt+1];
1488 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
1489 hlpChar[hlpUInt] =
'\0';
1492 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1493 hlpChar =
new char[hlpUInt+1];
1494 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
1495 hlpChar[hlpUInt] =
'\0';
1502 this->theta = settings->
theta;
1503 this->phi = settings->
phi;
1509 this->useCOM = settings->
useCOM;
1512 this->alpha = settings->
alpha;
1513 this->mPower = settings->
mPower;
1514 this->ignoreLs = settings->
ignoreLs;
1518 this->usePhase = settings->
usePhase;
1524 std::cout <<
">>>>>>>> Database settings loaded." << std::endl;
1530 std::stringstream hlpSS;
1531 hlpSS <<
"<font color=\"green\">" <<
"Database settings read." <<
"</font>";
1532 rvapi_set_text ( hlpSS.str().c_str(),
1546 matchedStrNames->clear ( );
1547 matchedStrNames->emplace_back ( structFiles.at(0) );
1548 unsigned int fileType =
checkFileType ( structFiles.at(0) );
1549 if ( fileType == 2 )
1552 &this->shellSpacing,
1553 this->mapResolution,
1557 &this->glIntegOrder,
1564 else if ( fileType == 1 )
1567 &this->shellSpacing,
1568 this->mapResolution,
1572 &this->glIntegOrder,
1577 this->firstLineCOM );
1581 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;
1585 std::stringstream hlpSS;
1586 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(0) <<
" ." <<
"</font>";
1587 rvapi_set_text ( hlpSS.str().c_str(),
1601 std::cout <<
"Structure 0 loaded." << std::endl;
1607 std::stringstream hlpSS;
1608 hlpSS <<
"<font color=\"green\">" <<
"Sought structure loaded." <<
"</font>";
1609 rvapi_set_text ( hlpSS.str().c_str(),
1621 if ( this->usePhase )
1624 this->bFactorChange,
1628 &this->glIntegOrder,
1642 this->bFactorChange,
1651 this->manualShells );
1657 if ( this->energyLevelDist )
1663 std::cout <<
">>>>>>>> Structure 0 spherical harmonics computed." << std::endl;
1666 int structIterHTML = 0;
1670 rvapi_add_section (
"FilesSection",
1671 "List of structures",
1680 std::stringstream hlpSS;
1681 hlpSS <<
"<font color=\"green\">" <<
"Structure to compare against the rest: " << this->structFiles.at(0) <<
"</font>";
1682 rvapi_set_text ( hlpSS.str().c_str(),
1688 structIterHTML += 1;
1695 double volMin = ( (
static_cast<double> ( (one->_xRange-this->extraSpace) ) * volTolerance ) *
1696 ( static_cast<double> ( (one->_yRange-this->extraSpace) ) * volTolerance ) *
1697 (
static_cast<double> ( (one->_zRange-this->extraSpace) ) * volTolerance ) );
1699 double volMax = ( (
static_cast<double> ( (one->_xRange-this->extraSpace) ) * volTolerance ) *
1700 ( static_cast<double> ( (one->_yRange-this->extraSpace) ) * volTolerance ) *
1701 (
static_cast<double> ( (one->_zRange-this->extraSpace) ) * volTolerance ) );
1702 std::vector<ProSHADE_data*> dbData;
1703 bool foundAlready =
false;
1704 bool tooFarAlready =
false;
1705 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbStrNames.size() ); strIt++ )
1707 if ( tooFarAlready ) {
break; }
1711 std::cout <<
">>>>> Starting to load structure " << strIt+1 <<
" from the database." << std::endl;
1714 if ( !this->saveWithAndWithout )
1716 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings ) );
1718 if ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 )
1720 if ( foundAlready ) { tooFarAlready =
true; }
1722 dbData.pop_back ( );
1725 std::cout <<
"Structure " << strIt+1 <<
" read from the database, but will not be used - too different dimmensions - see the \'--dbSizeLim\' option." << std::endl;
1729 std::stringstream hlpSS;
1730 hlpSS <<
"<font color=\"orange\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be ignored." <<
"</font>";
1731 rvapi_set_text ( hlpSS.str().c_str(),
1737 structIterHTML += 1;
1743 foundAlready =
true;
1744 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
1747 std::cout <<
"Structure " << strIt+1 <<
" read from the database." << std::endl;
1752 std::stringstream hlpSS;
1753 hlpSS <<
"<font color=\"green\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be used." <<
"</font>";
1754 rvapi_set_text ( hlpSS.str().c_str(),
1760 structIterHTML += 1;
1766 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings, this->saveWithAndWithout ) );
1767 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings, this->saveWithAndWithout ) );
1769 if ( ( dbData.at(dbData.size()-2)->_mapResolution == -999.9 ) || ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 ) )
1771 if ( foundAlready ) { tooFarAlready =
true; }
1773 dbData.pop_back ( );
1774 dbData.pop_back ( );
1777 std::cout <<
"Structure " << strIt+1 <<
" read from the database, but will not be used - too different dimmensions - see the \'--dbSizeLim\' option." << std::endl;
1781 std::stringstream hlpSS;
1782 hlpSS <<
"<font color=\"orange\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be ignored." <<
"</font>";
1783 rvapi_set_text ( hlpSS.str().c_str(),
1789 structIterHTML += 1;
1795 foundAlready =
true;
1796 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
1799 std::cout <<
"Structure " << strIt+1 <<
" read from the database." << std::endl;
1804 std::stringstream hlpSS;
1805 hlpSS <<
"<font color=\"green\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be used." <<
"</font>";
1806 rvapi_set_text ( hlpSS.str().c_str(),
1812 structIterHTML += 1;
1821 std::stringstream hlpSS;
1822 hlpSS <<
"<font color=\"green\">" <<
"Database imported." <<
"</font>";
1823 rvapi_set_text ( hlpSS.str().c_str(),
1834 if ( dbData.size() == 0 )
1836 std::cout <<
"!!! ProSHADE WARNING !!! There was no database entry which would pass the size limitations and therefore cannot compute distances. This could be caused by submitting database file with small number or very narrowly distributed structure sizes. Alternatively, the size limit parameter ( \'--dbSizeLim\' ) could be set to too constricted values (or the default values are sub-optimal for this case). Now terminating..." << std::endl;
1840 std::stringstream hlpSS;
1841 hlpSS <<
"<font color=\"orange\">" <<
"There was no database entry which would pass the size limitations and therefore cannot compute distances. This could be caused by submitting database file with small number or very narrowly distributed structure sizes. Alternatively, the size limit parameter ( \'--dbSizeLim\' ) could be set to too constricted values (or the default values are sub-optimal for this case)." <<
"</font>";
1842 rvapi_set_text ( hlpSS.str().c_str(),
1859 if ( !this->saveWithAndWithout )
1867 if ( fileType == 2 )
1870 &this->shellSpacing,
1871 this->mapResolution,
1875 &this->glIntegOrder,
1882 else if ( fileType == 1 )
1885 &this->shellSpacing,
1886 this->mapResolution,
1890 &this->glIntegOrder,
1895 this->firstLineCOM );
1899 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;
1905 if ( !this->usePhase )
1908 this->bFactorChange,
1912 &this->glIntegOrder,
1926 this->bFactorChange,
1942 if ( this->energyLevelDist )
1948 std::cout <<
">>>>>>>> Structure 0 spherical harmonics computed (reverse phase)." << std::endl;
1955 if ( one->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
1956 else { this->cmpObj->_keepOrRemove =
false; }
1959 if ( this->saveWithAndWithout )
1965 if ( this->energyLevelDist )
1969 std::cout <<
"Computing the cross-correlation distances." << std::endl;
1974 std::stringstream hlpSS;
1975 hlpSS <<
"<font color=\"green\">" <<
"Computing the Energy Level distances." <<
"</font>";
1976 rvapi_set_text ( hlpSS.str().c_str(),
1989 if ( this->enLevelsThreshold != -999.9 )
1991 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
1993 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
1995 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
1999 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2005 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
2007 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2013 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
2015 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2020 this->glIntegOrderVec = std::vector<unsigned int> ( dbData.size() + 1 );
2021 this->glIntegOrderVec.at(0) = this->glIntegOrder;
2022 double distPerPointFraction = 0.0;
2023 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbData.size() ); strIt++ )
2025 distPerPointFraction = ( ( dbData.at(strIt)->_maxMapRange / 2.0 ) / static_cast<double> ( dbData.at(strIt)->_bandwidthLimit / 2 ) ) / ( dbData.at(strIt)->_maxMapRange / 2.0 );
2027 for (
unsigned int iter = 2; iter < static_cast<unsigned int> ( ProSHADE_internal_misc::glIntMaxDists.size() ); iter++ )
2029 if ( ProSHADE_internal_misc::glIntMaxDists.at(iter) >= distPerPointFraction )
2031 this->glIntegOrderVec.at(strIt+1) = iter;
2037 if ( this->traceSigmaDist || this->fullRotFnDist )
2043 if ( this->traceSigmaDist )
2047 std::cout <<
"Computing the trace sigma distances." << std::endl;
2052 std::stringstream hlpSS;
2053 hlpSS <<
"<font color=\"green\">" <<
"Computing Trace Sigma distances." <<
"</font>";
2054 rvapi_set_text ( hlpSS.str().c_str(),
2066 if ( this->trSigmaThreshold == -999.9 )
2068 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
2072 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
2074 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
2076 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
2080 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
2087 if ( this->fullRotFnDist )
2092 std::cout <<
">> Inverse SO(3) Fourier transform map computed." << std::endl;
2098 std::cout <<
">>>>> Optimal Euler angles obtained." << std::endl;
2104 std::cout <<
">> Wigner matrices calculated." << std::endl;
2109 std::cout <<
"Computing the rotation function distances." << std::endl;
2114 std::stringstream hlpSS;
2115 hlpSS <<
"<font color=\"green\">" <<
"Computing Rotation Function distances." <<
"</font>";
2116 rvapi_set_text ( hlpSS.str().c_str(),
2130 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( iter ); iter++ )
2132 if ( dbData.at(iter) != nullptr )
2134 delete dbData.at(iter);
2135 dbData.at(iter) =
nullptr;
2155 std::vector<std::string>* matchedStrNames )
2158 unsigned int hlpUInt, hlpUInt2;
2160 std::vector<std::string> dbStrNames;
2161 double minVol = 0.0;
2165 std::cout <<
"Computing distances between map fragments and the structure database." << std::endl;
2169 std::ifstream dbFile ( settings->
databaseName, std::ios::in | std::ios::binary);
2172 if ( dbFile.fail() )
2174 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open the database file for reading " << settings->
databaseName <<
" . Terminating..." << std::endl;
2178 std::stringstream hlpSS;
2179 hlpSS <<
"<font color=\"red\">" <<
"Cannot open database with name " << settings->
databaseName <<
". Could you have no permissions to write to the requested database location?" <<
"</font>";
2180 rvapi_set_text ( hlpSS.str().c_str(),
2196 std::cerr <<
"!!! ProSHADE ERROR !!! Requested fragmentation database comparison, but you did not supply the fragmentation box size - use the '--mFrag' option to set this. Terminating..." << std::endl;
2200 std::stringstream hlpSS;
2201 hlpSS <<
"<font color=\"red\">" <<
"Missing the mandatory argument determining the fragmentation box size. Please supply it using the --mFrag command line option." <<
"</font>";
2202 rvapi_set_text ( hlpSS.str().c_str(),
2216 std::cerr <<
"!!! ProSHADE ERROR !!! Requested map fragmentation without using phases - this does not make sense. Terminating..." << std::endl;
2220 std::stringstream hlpSS;
2221 hlpSS <<
"<font color=\"red\">" <<
"Requested map fragmentation without using phases. This is not allowed." <<
"</font>";
2222 rvapi_set_text ( hlpSS.str().c_str(),
2237 std::cout <<
">>>>>>>> Database file opened for reading." << std::endl;
2242 std::stringstream hlpSS;
2243 hlpSS <<
"<font color=\"green\">" <<
"Database reading intialisation complete." <<
"</font>";
2244 rvapi_set_text ( hlpSS.str().c_str(),
2260 bool userCOM =
false;
2261 if ( settings->
useCOM ==
true ) { userCOM =
true; }
2264 dbFile.read ( reinterpret_cast<char*> ( &minVol ),
sizeof (
double ) );
2265 if ( minVol == 0.0 )
2267 std::cerr <<
"!!! ProSHADE ERROR !!! The database file seems to be corrupted, or was produced with too small maximum allowed volume, as it is reporting minimal structure volume of 0.0 A. Terminating..." << std::endl;
2271 std::stringstream hlpSS;
2272 hlpSS <<
"<font color=\"red\">" <<
"The database file seems to be corrupted, or was produced with too small maximum allowed volume, as it is reporting minimal structure volume of 0.0 A. If this problem is not solved by decreasing the maximum allowed volume, this could be internal bug, in this case please report it." <<
"</font>";
2273 rvapi_set_text ( hlpSS.str().c_str(),
2286 dbFile.read ( reinterpret_cast<char*> ( &settings->
mapResolution ), sizeof (
double ) );
2287 dbFile.read ( reinterpret_cast<char*> ( &settings->
bandwidth ), sizeof (
unsigned int ) );
2288 dbFile.read ( reinterpret_cast<char*> ( &settings->
glIntegOrder ), sizeof (
unsigned int ) );
2289 dbFile.read ( reinterpret_cast<char*> ( &settings->
theta ), sizeof (
unsigned int ) );
2290 dbFile.read ( reinterpret_cast<char*> ( &settings->
phi ), sizeof (
unsigned int ) );
2291 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorValue ), sizeof (
double ) );
2292 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorChange ), sizeof (
double ) );
2293 dbFile.read ( reinterpret_cast<char*> ( &settings->
noIQRsFromMap ), sizeof (
double ) );
2294 dbFile.read ( reinterpret_cast<char*> ( &settings->
maskBlurFactor ), sizeof (
double ) );
2295 dbFile.read ( reinterpret_cast<char*> ( &settings->
shellSpacing ), sizeof (
double ) );
2296 dbFile.read ( reinterpret_cast<char*> ( &settings->
manualShells ), sizeof (
unsigned int ) );
2297 dbFile.read ( reinterpret_cast<char*> ( &settings->
usePhase ), sizeof (
bool ) );
2298 dbFile.read ( reinterpret_cast<char*> ( &settings->
saveWithAndWithout ), sizeof (
bool ) );
2299 dbFile.read ( reinterpret_cast<char*> ( &settings->
useCOM ), sizeof (
bool ) );
2300 dbFile.read ( reinterpret_cast<char*> ( &settings->
firstLineCOM ), sizeof (
bool ) );
2301 dbFile.read ( reinterpret_cast<char*> ( &settings->
alpha ), sizeof (
double ) );
2302 dbFile.read ( reinterpret_cast<char*> ( &settings->
mPower ), sizeof (
double ) );
2304 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2305 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
2307 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
2308 settings->
ignoreLs.emplace_back ( hlpUInt2 );
2311 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2312 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
2314 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
2315 hlpChar =
new char[hlpUInt2+1];
2316 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt2 );
2317 hlpChar[hlpUInt2] =
'\0';
2318 dbStrNames.emplace_back ( hlpChar );
2320 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakHeightNoIQRs ), sizeof (
double ) );
2321 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakDistanceForReal ), sizeof (
double ) );
2323 dbFile.read ( reinterpret_cast<char*> ( &settings->
aaErrorTolerance ), sizeof (
double ) );
2324 dbFile.read ( reinterpret_cast<char*> ( &settings->
symGapTolerance ), sizeof (
double ) );
2325 dbFile.read ( reinterpret_cast<char*> ( &settings->
energyLevelDist ), sizeof (
bool ) );
2326 dbFile.read ( reinterpret_cast<char*> ( &settings->
traceSigmaDist ), sizeof (
bool ) );
2327 dbFile.read ( reinterpret_cast<char*> ( &settings->
fullRotFnDist ), sizeof (
bool ) );
2328 dbFile.read ( reinterpret_cast<char*> ( &settings->
enLevelsThreshold ), sizeof (
double ) );
2329 dbFile.read ( reinterpret_cast<char*> ( &settings->
trSigmaThreshold ), sizeof (
double ) );
2330 dbFile.read ( reinterpret_cast<char*> ( &settings->
taskToPerform ), sizeof ( ProSHADE::Task ) );
2332 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2333 hlpChar =
new char[hlpUInt+1];
2334 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
2335 hlpChar[hlpUInt] =
'\0';
2338 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2339 hlpChar =
new char[hlpUInt+1];
2340 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
2341 hlpChar[hlpUInt] =
'\0';
2346 std::cout <<
">> Database settings loaded." << std::endl;
2351 std::stringstream hlpSS;
2352 hlpSS <<
"<font color=\"green\">" <<
"Database settings loaded." <<
"</font>";
2353 rvapi_set_text ( hlpSS.str().c_str(),
2368 this->theta = settings->
theta;
2369 this->phi = settings->
phi;
2375 this->useCOM = settings->
useCOM;
2378 this->alpha = settings->
alpha;
2379 this->mPower = settings->
mPower;
2380 this->ignoreLs = settings->
ignoreLs;
2384 this->usePhase = settings->
usePhase;
2391 rvapi_add_section (
"DBSettingsSection",
2392 "Database Settings",
2401 std::stringstream hlpSS;
2402 hlpSS <<
"<pre>" <<
"Map resolution: ";
2403 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2404 for (
int iter = 0; iter < hlpIt; iter++ )
2409 std::stringstream hlpSS2;
2410 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mapResolution * 1000.0 ) / 1000.0;
2411 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2412 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2413 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2415 rvapi_set_text ( hlpSS.str().c_str(),
2416 "DBSettingsSection",
2422 hlpSS.str ( std::string ( ) );
2423 hlpSS <<
"<pre>" <<
"Bandwidth: ";
2424 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2425 for (
int iter = 0; iter < hlpIt; iter++ )
2430 hlpSS2.str ( std::string ( ) );
2431 if ( this->bandwidth == 0 ) { hlpSS2 <<
" AUTO"; }
2432 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bandwidth * 1000.0 ) / 1000.0; }
2433 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2434 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2435 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2437 rvapi_set_text ( hlpSS.str().c_str(),
2438 "DBSettingsSection",
2444 hlpSS.str ( std::string ( ) );
2445 hlpSS <<
"<pre>" <<
"Gauss-Legendre Integration order: ";
2446 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2447 for (
int iter = 0; iter < hlpIt; iter++ )
2452 hlpSS2.str ( std::string ( ) );
2453 if ( this->glIntegOrder == 0 ) { hlpSS2 <<
" AUTO"; }
2454 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->glIntegOrder * 1000.0 ) / 1000.0; }
2455 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2456 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2457 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2459 rvapi_set_text ( hlpSS.str().c_str(),
2460 "DBSettingsSection",
2466 hlpSS.str ( std::string ( ) );
2467 hlpSS <<
"<pre>" <<
"Theta angle sampling: ";
2468 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2469 for (
int iter = 0; iter < hlpIt; iter++ )
2474 hlpSS2.str ( std::string ( ) );
2475 if ( this->theta == 0 ) { hlpSS2 <<
" AUTO"; }
2476 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->theta * 1000.0 ) / 1000.0; }
2477 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2478 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2479 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2481 rvapi_set_text ( hlpSS.str().c_str(),
2482 "DBSettingsSection",
2488 hlpSS.str ( std::string ( ) );
2489 hlpSS <<
"<pre>" <<
"Phi angle sampling: ";
2490 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2491 for (
int iter = 0; iter < hlpIt; iter++ )
2496 hlpSS2.str ( std::string ( ) );
2497 if ( this->phi == 0 ) { hlpSS2 <<
" AUTO"; }
2498 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->phi * 1000.0 ) / 1000.0; }
2499 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2500 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2501 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2503 rvapi_set_text ( hlpSS.str().c_str(),
2504 "DBSettingsSection",
2510 hlpSS.str ( std::string ( ) );
2511 hlpSS <<
"<pre>" <<
"Set all PDB file B-factors to: ";
2512 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2513 for (
int iter = 0; iter < hlpIt; iter++ )
2518 hlpSS2.str ( std::string ( ) );
2519 if ( this->bFactorValue == 0 ) { hlpSS2 <<
" AUTO"; }
2520 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorValue * 1000.0 ) / 1000.0; }
2521 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2522 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2523 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2525 rvapi_set_text ( hlpSS.str().c_str(),
2526 "DBSettingsSection",
2532 hlpSS.str ( std::string ( ) );
2533 hlpSS <<
"<pre>" <<
"Change B-factors after map computation by: ";
2534 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2535 for (
int iter = 0; iter < hlpIt; iter++ )
2540 hlpSS2.str ( std::string ( ) );
2541 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorChange * 1000.0 ) / 1000.0;
2542 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2543 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2544 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2546 rvapi_set_text ( hlpSS.str().c_str(),
2547 "DBSettingsSection",
2553 hlpSS.str ( std::string ( ) );
2554 hlpSS <<
"<pre>" <<
"Map IQR from median threshold: ";
2555 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2556 for (
int iter = 0; iter < hlpIt; iter++ )
2561 hlpSS2.str ( std::string ( ) );
2562 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->noIQRsFromMap * 1000.0 ) / 1000.0;
2563 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2564 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2565 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2567 rvapi_set_text ( hlpSS.str().c_str(),
2568 "DBSettingsSection",
2574 hlpSS.str ( std::string ( ) );
2575 hlpSS <<
"<pre>" <<
"Distance between shells: ";
2576 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2577 for (
int iter = 0; iter < hlpIt; iter++ )
2582 hlpSS2.str ( std::string ( ) );
2583 if ( this->shellSpacing == 0 ) { hlpSS2 <<
" AUTO"; }
2584 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->shellSpacing * 1000.0 ) / 1000.0; }
2585 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2586 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2587 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2589 rvapi_set_text ( hlpSS.str().c_str(),
2590 "DBSettingsSection",
2596 hlpSS.str ( std::string ( ) );
2597 hlpSS <<
"<pre>" <<
"Number of shells: ";
2598 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2599 for (
int iter = 0; iter < hlpIt; iter++ )
2604 hlpSS2.str ( std::string ( ) );
2605 if ( this->manualShells == 0 ) { hlpSS2 <<
" AUTO"; }
2606 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->manualShells * 1000.0 ) / 1000.0; }
2607 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2608 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2609 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2611 rvapi_set_text ( hlpSS.str().c_str(),
2612 "DBSettingsSection",
2618 hlpSS.str ( std::string ( ) );
2619 hlpSS <<
"<pre>" <<
"Use Centre of Mass for centering: ";
2620 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2621 for (
int iter = 0; iter < hlpIt; iter++ )
2626 hlpSS2.str ( std::string ( ) );
2627 if ( this->useCOM == 0 ) { hlpSS2 <<
" FALSE"; }
2628 else { hlpSS2 <<
" TRUE"; }
2629 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2630 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2631 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2633 rvapi_set_text ( hlpSS.str().c_str(),
2634 "DBSettingsSection",
2640 hlpSS.str ( std::string ( ) );
2641 hlpSS <<
"<pre>" <<
"Add extra space to cell: ";
2642 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2643 for (
int iter = 0; iter < hlpIt; iter++ )
2648 hlpSS2.str ( std::string ( ) );
2649 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->extraSpace * 1000.0 ) / 1000.0;
2650 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2651 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2652 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2654 rvapi_set_text ( hlpSS.str().c_str(),
2655 "DBSettingsSection",
2661 hlpSS.str ( std::string ( ) );
2662 hlpSS <<
"<pre>" <<
"Raise Fourier coefficients to power: ";
2663 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2664 for (
int iter = 0; iter < hlpIt; iter++ )
2669 hlpSS2.str ( std::string ( ) );
2670 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->alpha * 1000.0 ) / 1000.0;
2671 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2672 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2673 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2675 rvapi_set_text ( hlpSS.str().c_str(),
2676 "DBSettingsSection",
2682 hlpSS.str ( std::string ( ) );
2683 hlpSS <<
"<pre>" <<
"Weight Energy Level matrix position by: ";
2684 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2685 for (
int iter = 0; iter < hlpIt; iter++ )
2690 hlpSS2.str ( std::string ( ) );
2691 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mPower * 1000.0 ) / 1000.0;
2692 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2693 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2694 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2696 rvapi_set_text ( hlpSS.str().c_str(),
2697 "DBSettingsSection",
2703 hlpSS.str ( std::string ( ) );
2704 hlpSS <<
"<pre>" <<
"Ignore the following bands: ";
2705 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2706 for (
int iter = 0; iter < hlpIt; iter++ )
2711 hlpSS2.str ( std::string ( ) );
2712 for (
int iter = 0; iter < static_cast<int> ( this->ignoreLs.size() ); iter++ )
2714 hlpSS2 << std::showpos << this->ignoreLs.at(iter) <<
" ";
2716 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2718 rvapi_set_text ( hlpSS.str().c_str(),
2719 "DBSettingsSection",
2725 hlpSS.str ( std::string ( ) );
2726 hlpSS <<
"<pre>" <<
"Compute Energy Level distances: ";
2727 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2728 for (
int iter = 0; iter < hlpIt; iter++ )
2733 hlpSS2.str ( std::string ( ) );
2734 if ( this->energyLevelDist == 0 ) { hlpSS2 <<
" FALSE"; }
2735 else { hlpSS2 <<
" TRUE"; }
2736 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2737 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2738 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2740 rvapi_set_text ( hlpSS.str().c_str(),
2741 "DBSettingsSection",
2747 hlpSS.str ( std::string ( ) );
2748 hlpSS <<
"<pre>" <<
"Compute Trace Sigma distances: ";
2749 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2750 for (
int iter = 0; iter < hlpIt; iter++ )
2755 hlpSS2.str ( std::string ( ) );
2756 if ( this->traceSigmaDist == 0 ) { hlpSS2 <<
" FALSE"; }
2757 else { hlpSS2 <<
" TRUE"; }
2758 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2759 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2760 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2762 rvapi_set_text ( hlpSS.str().c_str(),
2763 "DBSettingsSection",
2769 hlpSS.str ( std::string ( ) );
2770 hlpSS <<
"<pre>" <<
"Compute Rotation Function distances: ";
2771 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2772 for (
int iter = 0; iter < hlpIt; iter++ )
2777 hlpSS2.str ( std::string ( ) );
2778 if ( this->fullRotFnDist == 0 ) { hlpSS2 <<
" FALSE"; }
2779 else { hlpSS2 <<
" TRUE"; }
2780 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2781 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2782 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2784 rvapi_set_text ( hlpSS.str().c_str(),
2785 "DBSettingsSection",
2791 hlpSS.str ( std::string ( ) );
2792 hlpSS <<
"<pre>" <<
"Use phase information: ";
2793 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2794 for (
int iter = 0; iter < hlpIt; iter++ )
2799 hlpSS2.str ( std::string ( ) );
2800 if ( this->usePhase == 0 ) { hlpSS2 <<
" FALSE"; }
2801 else { hlpSS2 <<
" TRUE"; }
2802 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2803 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2804 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2806 rvapi_set_text ( hlpSS.str().c_str(),
2807 "DBSettingsSection",
2819 std::cerr <<
"!!! ProSHADE ERROR !!! Tried to compare map fragments to database created without phases. This would mean comparing fragments of Patterson-like maps and this is not something that one should do... Terminating..." << std::endl;
2823 std::stringstream hlpSS;
2824 hlpSS <<
"<font color=\"red\">" <<
"Tried to compare map fragments to database created without phases. This is not allowed and it looks like an internal bug. Please report this case." <<
"</font>";
2825 rvapi_set_text ( hlpSS.str().c_str(),
2842 matchedStrNames->clear ( );
2843 matchedStrNames->emplace_back ( structFiles.at(0) );
2845 unsigned int fileType =
checkFileType ( structFiles.at(0) );
2846 if ( fileType == 2 )
2849 &this->shellSpacing,
2850 this->mapResolution,
2854 &this->glIntegOrder,
2861 else if ( fileType == 1 )
2864 &this->shellSpacing,
2865 this->mapResolution,
2869 &this->glIntegOrder,
2874 this->firstLineCOM );
2878 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;
2882 std::stringstream hlpSS;
2883 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file " << this->structFiles.at(0) <<
" .</font>";
2884 rvapi_set_text ( hlpSS.str().c_str(),
2898 std::cout <<
">>>>> Structure 0 read from file." << std::endl;
2903 std::stringstream hlpSS;
2904 hlpSS <<
"<font color=\"green\">" <<
"The structure for fragmenting loaded." <<
"</font>";
2905 rvapi_set_text ( hlpSS.str().c_str(),
2918 this->bFactorChange,
2922 &this->glIntegOrder,
2934 std::vector<ProSHADE_data*> frags = one->
fragmentMap ( settings, userCOM );
2938 std::cout <<
"Structure 0 fragmented." << std::endl;
2943 std::stringstream hlpSS;
2944 hlpSS <<
"<font color=\"green\">" <<
"Fragments obtained." <<
"</font>";
2945 rvapi_set_text ( hlpSS.str().c_str(),
2957 if ( frags.size() == 0 )
2959 std::cout <<
"!!! ProSHADE WARNING !!! Did not find any fragmentation boxes fitting the requirements. Either decrease the box size (to have more and higher chance of reaching the minimal density fraction) or change the minimal density fraction (the -mFrag parameter) to let more boxes pass." << std::endl;
2963 std::stringstream hlpSS;
2964 hlpSS <<
"<font color=\"orange\">" <<
"Did not find any fragmentation boxes fitting the requirements. Either decrease the box size (to have more and higher chance of reaching the minimal density fraction) or change the minimal density fraction (the -mFrag parameter) to let more boxes pass." <<
"</font>";
2965 rvapi_set_text ( hlpSS.str().c_str(),
2980 double totMinVol = ( (
static_cast<double> ( frags.at(0)->_maxMapU ) * volTolerance ) *
2981 (
static_cast<double> ( frags.at(0)->_maxMapV ) * volTolerance ) *
2982 (
static_cast<double> ( frags.at(0)->_maxMapW ) * volTolerance ) );
2983 double volMin = totMinVol;
2984 for (
unsigned int iter = 1; iter < static_cast<unsigned int> ( frags.size() ); iter++ )
2986 volMin = ( (
static_cast<double> ( frags.at(iter)->_maxMapU ) * volTolerance ) *
2987 (
static_cast<double> ( frags.at(iter)->_maxMapV ) * volTolerance ) *
2988 (
static_cast<double> ( frags.at(iter)->_maxMapW ) * volTolerance ) );
2989 totMinVol = std::min ( volMin, totMinVol );
2993 double totMaxVol = ( (
static_cast<double> ( frags.at(0)->_maxMapU ) * volTolerance ) *
2994 (
static_cast<double> ( frags.at(0)->_maxMapV ) * volTolerance ) *
2995 (
static_cast<double> ( frags.at(0)->_maxMapW ) * volTolerance ) );
2996 double volMax = totMaxVol;
2997 for (
unsigned int iter = 1; iter < static_cast<unsigned int> ( frags.size() ); iter++ )
2999 volMax = ( (
static_cast<double> ( frags.at(iter)->_maxMapU ) * volTolerance ) *
3000 (
static_cast<double> ( frags.at(iter)->_maxMapV ) * volTolerance ) *
3001 (
static_cast<double> ( frags.at(iter)->_maxMapW ) * volTolerance ) );
3002 totMaxVol = std::max ( volMax, totMaxVol );
3008 rvapi_add_section (
"FragmentSection",
3009 "Fragment processing",
3022 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
3026 std::cout <<
">>>>>>>> Computing spherical harmonics for fragment " << frIt <<
" out of " << frags.size() <<
"." << std::endl;
3030 frags.at(frIt)->mapPhaselessToSphere ( settings,
3031 frags.at(frIt)->_thetaAngle,
3032 frags.at(frIt)->_phiAngle,
3037 frags.at(frIt)->getSphericalHarmonicsCoeffs ( frags.at(frIt)->_bandwidthLimit, settings );
3040 if ( this->energyLevelDist )
3042 frags.at(frIt)->precomputeRotInvDescriptor ( settings );
3047 std::stringstream hlpSS;
3048 hlpSS <<
"Fragment " << frIt <<
" spherical harmonics computation done.";
3049 rvapi_set_text ( hlpSS.str().c_str(),
3062 std::cout <<
">> Spherical harmonics computed for " <<
static_cast<unsigned int> ( frags.size() ) <<
" fragments." << std::endl;
3067 std::stringstream hlpSS;
3068 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics computed for " <<
static_cast<unsigned int> ( frags.size() ) <<
" fragments." <<
"</font>";
3069 rvapi_set_text ( hlpSS.str().c_str(),
3081 std::vector<ProSHADE_data*> dbData;
3082 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbStrNames.size() ); strIt++ )
3086 std::cout <<
">>>>> Loading structure " << strIt <<
" from the database." << std::endl;
3089 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), totMinVol, totMaxVol, settings->
verbose, settings ) );
3090 if ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 )
3092 dbData.pop_back ( );
3096 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
3101 if ( dbData.size() == 0 )
3103 std::cout <<
"!!! ProSHADE WARNING !!! There was no database entry which would pass the size limitations and therefore cannot compute distances. This could be caused by submitting database file with small number or very narrowly distributed structure sizes. Alternatively, the size limit parameter ( \'--dbSizeLim\' ) could be set to too constricted values (or the default values are sub-optimal for this case). Now terminating..." << std::endl;
3107 std::stringstream hlpSS;
3108 hlpSS <<
"<font color=\"orange\">" <<
"There was no database entry which would pass the size limitations and therefore cannot compute distances. This could be caused by submitting database file with small number or very narrowly distributed structure sizes. Alternatively, the size limit parameter ( \'--dbSizeLim\' ) could be set to too constricted values (or the default values are sub-optimal for this case)." <<
"</font>";
3109 rvapi_set_text ( hlpSS.str().c_str(),
3125 rvapi_add_section (
"FragmentDistancesSection",
3126 "Fragment distances computation",
3138 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
3142 std::cout <<
"Computing distances for fragment " << frIt <<
" ." << std::endl;
3149 if ( frags.at(frIt)->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
3150 else { this->cmpObj->_keepOrRemove =
false; }
3153 if ( this->energyLevelDist )
3156 this->fragEnergyLevelsDistances.emplace_back ( this->energyLevelsDistances );
3159 if ( this->enLevelsThreshold != -999.9 )
3161 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
3163 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
3165 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
3169 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
3175 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
3177 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
3183 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
3185 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
3191 std::cout <<
">> Cross-correlation distances computed ." << std::endl;
3196 std::stringstream hlpSS;
3197 hlpSS <<
"<font color=\"green\">" <<
"Energy Level distances computed for fragment " << frIt <<
"</font>";
3198 rvapi_set_text ( hlpSS.str().c_str(),
3199 "FragmentDistancesSection",
3209 this->glIntegOrderVec = std::vector<unsigned int> ( dbData.size() + 1 );
3210 this->glIntegOrderVec.at(0) = this->glIntegOrder;
3211 double distPerPointFraction = 0.0;
3212 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbData.size() ); strIt++ )
3214 distPerPointFraction = ( ( dbData.at(strIt)->_maxMapRange / 2.0 ) / static_cast<double> ( dbData.at(strIt)->_bandwidthLimit / 2 ) ) / ( dbData.at(strIt)->_maxMapRange / 2.0 );
3216 for (
unsigned int iter = 2; iter < static_cast<unsigned int> ( ProSHADE_internal_misc::glIntMaxDists.size() ); iter++ )
3218 if ( ProSHADE_internal_misc::glIntMaxDists.at(iter) >= distPerPointFraction )
3220 this->glIntegOrderVec.at(strIt+1) = iter;
3226 if ( this->traceSigmaDist || this->fullRotFnDist )
3232 if ( this->traceSigmaDist )
3235 this->fragTraceSigmaDistances.emplace_back ( this->traceSigmaDistances );
3237 if ( this->trSigmaThreshold == -999.9 )
3239 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
3243 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
3245 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
3247 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
3251 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
3258 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
3260 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
3266 std::cout <<
">> Trace sigma distances computed ." << std::endl;
3270 std::stringstream hlpSS;
3271 hlpSS <<
"<font color=\"green\">" <<
"Trace Sigma distances computed for fragment " << frIt <<
"</font>";
3272 rvapi_set_text ( hlpSS.str().c_str(),
3273 "FragmentDistancesSection",
3283 if ( this->fullRotFnDist )
3289 this->fragfullRotationDistances.emplace_back ( this->fullRotationDistances );
3293 std::cout <<
">> Rotation function distances computed ." << std::endl;
3297 std::stringstream hlpSS;
3298 hlpSS <<
"<font color=\"green\">" <<
"Rotation Function distances computed for fragment " << frIt <<
"</font>";
3299 rvapi_set_text ( hlpSS.str().c_str(),
3300 "FragmentDistancesSection",
3312 std::stringstream hlpSS;
3313 hlpSS <<
"<font color=\"green\">" <<
"Fragment distances computed." <<
"</font>";
3314 rvapi_set_text ( hlpSS.str().c_str(),
3352 bool saveWithAndWithout )
3355 if ( dbFile->fail() )
3357 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read from input database file. Terminating..." << std::endl;
3361 std::stringstream hlpSS;
3362 hlpSS <<
"<font color=\"red\">" <<
"Cannot read from the database file. This looks like file corruption or internal bug, if repeating with a new database file does not help, please report this case." <<
"</font>";
3363 rvapi_set_text ( hlpSS.str().c_str(),
3377 this->_inputFileName = fName;
3378 this->_densityMapMap =
nullptr;
3379 this->_densityMapCor =
nullptr;
3380 this->_densityMapCorCoords =
nullptr;
3381 this->_shellMappedData =
nullptr;
3382 this->_realSHCoeffs =
nullptr;
3383 this->_imagSHCoeffs =
nullptr;
3384 this->_sphericalHarmonicsWeights =
nullptr;
3385 this->_semiNaiveTable =
nullptr;
3386 this->_semiNaiveTableSpace =
nullptr;
3387 this->_shWorkspace =
nullptr;
3388 this->_rrpMatrices =
nullptr;
3389 this->_invRealData =
nullptr;
3390 this->_invImagData =
nullptr;
3392 this->_densityMapComputed =
false;
3393 this->_phaseRemoved =
false;
3394 this->_usePhase =
false;
3395 this->_firstLineCOM =
false;
3396 this->_sphereMapped =
false;
3397 this->_sphericalCoefficientsComputed =
false;
3398 this->_rrpMatricesPrecomputed =
false;
3399 this->_wasBandwithGiven =
true;
3400 this->_wasThetaGiven =
true;
3401 this->_wasPhiGiven =
true;
3402 this->_wasGlInterGiven =
true;
3404 this->_xCorrection = 0;
3405 this->_yCorrection = 0;
3406 this->_zCorrection = 0;
3408 this->_mapMean = 0.0;
3409 this->_mapSdev = 1.0;
3412 unsigned int hlpUInt;
3416 dbFile->read ( reinterpret_cast<char*> ( &this->_fromPDB ),
sizeof (
bool ) );
3417 dbFile->read ( reinterpret_cast<char*> ( &this->_shellSpacing ),
sizeof (
double ) );
3418 dbFile->read ( reinterpret_cast<char*> ( &this->_maxExtraCellularSpace ),
sizeof (
double ) );
3419 dbFile->read ( reinterpret_cast<char*> ( &this->_xRange ),
sizeof (
double ) );
3420 dbFile->read ( reinterpret_cast<char*> ( &this->_yRange ),
sizeof (
double ) );
3421 dbFile->read ( reinterpret_cast<char*> ( &this->_zRange ),
sizeof (
double ) );
3423 dbFile->read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
3424 for (
unsigned int it = 0; it < hlpUInt; it++ )
3426 dbFile->read ( reinterpret_cast<char*> ( &hlpD ),
sizeof (
double ) );
3427 this->_shellPlacement.emplace_back ( hlpD );
3430 dbFile->read ( reinterpret_cast<char*> ( &this->_mapResolution ),
sizeof (
double ) );
3431 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapU ),
sizeof (
unsigned int ) );
3432 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapV ),
sizeof (
unsigned int ) );
3433 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapW ),
sizeof (
unsigned int ) );
3434 dbFile->read ( reinterpret_cast<char*> ( &this->_densityMapComputed ),
sizeof (
bool ) );
3435 dbFile->read ( reinterpret_cast<char*> ( &this->_mapMean ),
sizeof (
double ) );
3436 dbFile->read ( reinterpret_cast<char*> ( &this->_mapSdev ),
sizeof (
double ) );
3437 dbFile->read ( reinterpret_cast<char*> ( &this->_fourierCoeffPower ),
sizeof (
double ) );
3438 dbFile->read ( reinterpret_cast<char*> ( &this->_bFactorChange ),
sizeof (
double ) );
3439 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapRange ),
sizeof (
double ) );
3440 dbFile->read ( reinterpret_cast<char*> ( &this->_phaseRemoved ),
sizeof (
bool ) );
3441 dbFile->read ( reinterpret_cast<char*> ( &this->_usePhase ),
sizeof (
bool ) );
3442 dbFile->read ( reinterpret_cast<char*> ( &this->_keepOrRemove ),
sizeof (
bool ) );
3443 dbFile->read ( reinterpret_cast<char*> ( &this->_thetaAngle ),
sizeof (
double ) );
3444 dbFile->read ( reinterpret_cast<char*> ( &this->_phiAngle ),
sizeof (
double ) );
3445 dbFile->read ( reinterpret_cast<char*> ( &this->_noShellsWithData ),
sizeof (
unsigned int ) );
3446 dbFile->read ( reinterpret_cast<char*> ( &this->_xCorrection ),
sizeof (
unsigned int ) );
3447 dbFile->read ( reinterpret_cast<char*> ( &this->_yCorrection ),
sizeof (
unsigned int ) );
3448 dbFile->read ( reinterpret_cast<char*> ( &this->_zCorrection ),
sizeof (
unsigned int ) );
3449 dbFile->read ( reinterpret_cast<char*> ( &this->_xCorrErr ),
sizeof (
double ) );
3450 dbFile->read ( reinterpret_cast<char*> ( &this->_yCorrErr ),
sizeof (
double ) );
3451 dbFile->read ( reinterpret_cast<char*> ( &this->_zCorrErr ),
sizeof (
double ) );
3452 dbFile->read ( reinterpret_cast<char*> ( &this->_sphereMapped ),
sizeof (
bool ) );
3453 dbFile->read ( reinterpret_cast<char*> ( &this->_firstLineCOM ),
sizeof (
bool ) );
3454 dbFile->read ( reinterpret_cast<char*> ( &this->_bandwidthLimit ),
sizeof (
unsigned int ) );
3455 dbFile->read ( reinterpret_cast<char*> ( &this->_oneDimmension ),
sizeof (
unsigned int ) );
3456 dbFile->read ( reinterpret_cast<char*> ( &this->_sphericalCoefficientsComputed ),
sizeof (
bool ) );
3457 dbFile->read ( reinterpret_cast<char*> ( &this->_rrpMatricesPrecomputed ),
sizeof (
bool ) );
3461 std::cout <<
">>>>>>>> Settings loaded." << std::endl;
3465 if ( !( ( ( (this->_xRange-this->_maxExtraCellularSpace) * (this->_yRange-this->_maxExtraCellularSpace) * (this->_zRange-this->_maxExtraCellularSpace) ) > volThreMin ) &&
3466 ( ( (this->_xRange-this->_maxExtraCellularSpace) * (this->_yRange-this->_maxExtraCellularSpace) * (this->_zRange-this->_maxExtraCellularSpace) ) < volThreMax ) ) )
3469 this->_mapResolution = -999.9;
3473 this->_realSHCoeffs =
new double* [this->_noShellsWithData];
3474 for (
unsigned int i = 0; i < this->_noShellsWithData; i++ ) { this->_realSHCoeffs[i] =
new double [this->_oneDimmension * this->_oneDimmension]; }
3475 this->_imagSHCoeffs =
new double* [this->_noShellsWithData];
3476 for (
unsigned int i = 0; i < this->_noShellsWithData; i++ ) { this->_imagSHCoeffs[i] =
new double [this->_oneDimmension * this->_oneDimmension]; }
3479 for (
unsigned int sh = 0; sh < this->_noShellsWithData; sh++ )
3481 for (
unsigned int arrIt = 0; arrIt < ( this->_oneDimmension * this->_oneDimmension ); arrIt++ )
3483 dbFile->read ( reinterpret_cast<char*> ( &this->_realSHCoeffs[sh][arrIt] ),
sizeof (
double ) );
3484 dbFile->read ( reinterpret_cast<char*> ( &this->_imagSHCoeffs[sh][arrIt] ),
sizeof (
double ) );
3489 std::cout <<
">>>>>>>> Spherical harmonics loaded." << std::endl;
3493 this->_rrpMatrices =
new double** [this->_bandwidthLimit];
3494 for (
unsigned int bwIt = 0; bwIt < this->_bandwidthLimit; bwIt++ )
3497 if ( !this->_keepOrRemove ) {
if ( ( bwIt % 2 ) != 0 ) {
continue; } }
3499 this->_rrpMatrices[bwIt] =
new double* [this->_noShellsWithData];
3500 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
3502 this->_rrpMatrices[bwIt][shIt] =
new double [this->_noShellsWithData];
3507 for (
unsigned int bwIt = 0; bwIt < this->_bandwidthLimit; bwIt++ )
3510 if ( !this->_keepOrRemove ) {
if ( ( bwIt % 2 ) != 0 ) {
continue; } }
3512 for (
unsigned int sh1 = 0; sh1 < this->_noShellsWithData; sh1++ )
3514 for (
unsigned int sh2 = 0; sh2 < this->_noShellsWithData; sh2++ )
3516 dbFile->read ( reinterpret_cast<char*> ( &this->_rrpMatrices[bwIt][sh1][sh2] ),
sizeof (
double ) );
3522 std::cout <<
">>>>>>>> RRP Matrices loaded." << std::endl;
3526 if ( saveWithAndWithout )
3528 if ( this->_usePhase )
3530 dbFile->read ( reinterpret_cast<char*> ( &this->_xFrom ),
sizeof (
double ) );
3531 dbFile->read ( reinterpret_cast<char*> ( &this->_xTo ),
sizeof (
double ) );
3532 dbFile->read ( reinterpret_cast<char*> ( &this->_yFrom ),
sizeof (
double ) );
3533 dbFile->read ( reinterpret_cast<char*> ( &this->_yTo ),
sizeof (
double ) );
3534 dbFile->read ( reinterpret_cast<char*> ( &this->_zFrom ),
sizeof (
double ) );
3535 dbFile->read ( reinterpret_cast<char*> ( &this->_zTo ),
sizeof (
double ) );
3537 this->_densityMapCor =
new double [(this->_maxMapU+1) * (this->_maxMapV+1) * (this->_maxMapW+1)];
3538 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( (this->_maxMapU+1) * (this->_maxMapV+1) * (this->_maxMapW+1) ); mIt++ )
3540 dbFile->read ( reinterpret_cast<char*> ( &this->_densityMapCor[mIt] ),
sizeof (
double ) );
3545 this->_xSamplingRate = this->_xRange /
static_cast<double> ( this->_maxMapU );
3546 this->_ySamplingRate = this->_yRange /
static_cast<double> ( this->_maxMapV );
3547 this->_zSamplingRate = this->_zRange /
static_cast<double> ( this->_maxMapW );
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 ...
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...
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...
unsigned int checkFileType(std::string fileName)
This function checks the input file for being either PDB or MAP formatted.
double bFactorValue
This is the value to which all B-factors of PDB files will be changed to.
void generateWignerMatrices(ProSHADE::ProSHADE_settings *settings)
This function is responsible for computing the Wigner D matrices for full rotation function distance ...
std::string clearMapFile
If map features are to be extracted, should the clear map be saved (then give file name here)...
void normaliseMap(ProSHADE::ProSHADE_settings *settings)
This function does normalises the map data.
std::vector< double > getRotCoeffDistance(int verbose, ProSHADE::ProSHADE_settings *settings)
This function computes the full rotation function descriptor distances.
double databaseMinVolume
The smallest volume of a structure in the database.
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...
bool overlayDefaults
If true, the shell spacing and distances will be doube to their typical values. This is to speed up m...
void alignDensities(ProSHADE::ProSHADE_settings *settings)
Takes the internal objects with and without phases and aligns them to all the other objects...
bool usePhase
Here the user can decide whether to use phase information or whether to ignore it completely...
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...
bool htmlReport
Should HTML report for the run be created?
int verbose
Should the software report on the progress, or just be quiet? Value between 0 (quiet) and 4 (loud) ...
std::vector< double > getTrSigmaDistance(int verbose, ProSHADE::ProSHADE_settings *settings)
This function computes the trace sigma descriptor distances.
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.
bool fullRotFnDist
Should the full rotation function distances descriptor be computed.
void getSO3InverseMap(ProSHADE::ProSHADE_settings *settings)
This function is responsible for computing the SO3 inverse transform.
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...
void getDensityMapFromPDB(std::string fileName, double *shellDistance, double resolution, unsigned int *bandwidth, unsigned int *theta, unsigned int *phi, unsigned int *glIntegOrder, double *extraSpace, bool mapResDefault, ProSHADE::ProSHADE_settings *settings, double Bfactor=80.0, bool hpFirstLineCom=false, bool overlayDefaults=false)
Function to read in the PDB file and compute the theoretical density map.
double shellSpacing
This parameter determines how far the radial shells should be from each other.
double databaseMaxVolume
The largest volume allowed to exist in the database.
double volumeTolerance
The percentage tolerance on each dimmension when comparing one structure to entire database...
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.
void precomputeTrSigmaDescriptor(double shellSpacing, std::vector< unsigned int > *glIntegOrderVec, ProSHADE::ProSHADE_settings *settings)
This function computes the E matrices required for the trace sigma descriptor, the rotation function ...
std::vector< ProSHADE_data * > fragmentMap(ProSHADE::ProSHADE_settings *settings, bool userCOM)
This function takes the map and fragments it into boxes of given size, returning vector of data objec...
bool rotChangeDefault
If map rotation is selected, the default automatic parameter decision is changed. This variable state...
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...
The main header file containing all declarations for the innter workings of the library.
void compareFragAgainstDatabase(ProSHADE::ProSHADE_settings *settings, std::vector< std::string > *matchedStrNames)
This function fragments and compares a single file agaisnt a database of pre-computed structures...
int htmlReportLine
Iterator for current HTML line.
bool energyLevelDist
Should the energy level distances descriptor be computed.
int htmlReportLineProgress
Iterator for current HTML line in the progress bar.
double bFactorChange
This value will be used to change the B-factors if required by the user.
double peakHeightNoIQRs
How many interquartile ranges should be used to distinguish 'false' peaks from the true ones...
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.
std::vector< std::array< double, 3 > > getEulerAngles(ProSHADE::ProSHADE_settings *settings)
This function finds the highest peak in the SO3 inverse transform map and sets it as the optimal over...
This is the executive class responsible for comparing two or more structures.
std::vector< double > getEnergyLevelsDistance(int verbose, ProSHADE::ProSHADE_settings *settings)
This function computes the energy level descriptor value from the first structure to all remaining st...
void precomputeRotInvDescriptor(ProSHADE::ProSHADE_settings *settings)
This function computes the RRP matrices, which are required for the computation of the energy levels ...
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...
double mPower
This parameter determines the scaling for trace sigma descriptor.
void saveDatabase(ProSHADE::ProSHADE_settings *settings)
Function responsible for saving the structure database.
unsigned int manualShells
Should the user require so, the maximum number of radial shells can be set.
bool useCOM
Should the Centre of Mass (COM) be used to center the structure in the cell?
double maskBlurFactor
The is the amount of blurring to be used to create masks for maps.
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).
void removePhaseFromMap(double alpha, double bFac, ProSHADE::ProSHADE_settings *settings)
This function removes the phase information from the density map.
This file contains the ProSHADE_internal_misc namespace and its miscellaneous functions.
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.
void compareAgainstDatabase(ProSHADE::ProSHADE_settings *settings, std::vector< std::string > *matchedStrNames)
This function compares a single file agaisnt a database of pre-computed structures.