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() ), settings->
extraSpace );
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 )
999 std::cout <<
">>>>> Spherical harmonics computed." << std::endl;
1006 dbFile.write ( reinterpret_cast<char*> ( &one->_fromPDB ),
sizeof(
bool ) );
1007 dbFile.write ( reinterpret_cast<char*> ( &one->_shellSpacing ),
sizeof(
double ) );
1008 dbFile.write ( reinterpret_cast<char*> ( &one->_maxExtraCellularSpace ),
sizeof(
double ) );
1009 dbFile.write ( reinterpret_cast<char*> ( &one->_xRange ),
sizeof(
double ) );
1010 dbFile.write ( reinterpret_cast<char*> ( &one->_yRange ),
sizeof(
double ) );
1011 dbFile.write ( reinterpret_cast<char*> ( &one->_zRange ),
sizeof(
double ) );
1013 hlpUInt = one->_shellPlacement.size();
1014 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
1015 for (
unsigned int it = 0; it < hlpUInt; it++ )
1017 dbFile.write ( reinterpret_cast<char*> ( &one->_shellPlacement.at(it) ),
sizeof(
double ) );
1020 dbFile.write ( reinterpret_cast<char*> ( &one->_mapResolution ),
sizeof(
double ) );
1021 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapU ),
sizeof(
unsigned int ) );
1022 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapV ),
sizeof(
unsigned int ) );
1023 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapW ),
sizeof(
unsigned int ) );
1024 dbFile.write ( reinterpret_cast<char*> ( &one->_densityMapComputed ),
sizeof(
bool ) );
1025 dbFile.write ( reinterpret_cast<char*> ( &one->_mapMean ),
sizeof(
double ) );
1026 dbFile.write ( reinterpret_cast<char*> ( &one->_mapSdev ),
sizeof(
double ) );
1027 dbFile.write ( reinterpret_cast<char*> ( &one->_fourierCoeffPower ),
sizeof(
double ) );
1028 dbFile.write ( reinterpret_cast<char*> ( &one->_bFactorChange ),
sizeof(
double ) );
1029 dbFile.write ( reinterpret_cast<char*> ( &one->_maxMapRange ),
sizeof(
double ) );
1030 dbFile.write ( reinterpret_cast<char*> ( &one->_phaseRemoved ),
sizeof(
bool ) );
1031 dbFile.write ( reinterpret_cast<char*> ( &one->_usePhase ),
sizeof(
bool ) );
1032 dbFile.write ( reinterpret_cast<char*> ( &one->_keepOrRemove ),
sizeof(
bool ) );
1033 dbFile.write ( reinterpret_cast<char*> ( &one->_thetaAngle ),
sizeof(
double ) );
1034 dbFile.write ( reinterpret_cast<char*> ( &one->_phiAngle ),
sizeof(
double ) );
1035 dbFile.write ( reinterpret_cast<char*> ( &one->_noShellsWithData ),
sizeof(
unsigned int ) );
1036 dbFile.write ( reinterpret_cast<char*> ( &one->_xCorrection ),
sizeof(
unsigned int ) );
1037 dbFile.write ( reinterpret_cast<char*> ( &one->_yCorrection ),
sizeof(
unsigned int ) );
1038 dbFile.write ( reinterpret_cast<char*> ( &one->_zCorrection ),
sizeof(
unsigned int ) );
1039 dbFile.write ( reinterpret_cast<char*> ( &one->_xCorrErr ),
sizeof(
double ) );
1040 dbFile.write ( reinterpret_cast<char*> ( &one->_yCorrErr ),
sizeof(
double ) );
1041 dbFile.write ( reinterpret_cast<char*> ( &one->_zCorrErr ),
sizeof(
double ) );
1042 dbFile.write ( reinterpret_cast<char*> ( &one->_sphereMapped ),
sizeof(
bool ) );
1043 dbFile.write ( reinterpret_cast<char*> ( &one->_firstLineCOM ),
sizeof(
bool ) );
1044 dbFile.write ( reinterpret_cast<char*> ( &one->_bandwidthLimit ),
sizeof(
unsigned int ) );
1045 dbFile.write ( reinterpret_cast<char*> ( &one->_oneDimmension ),
sizeof(
unsigned int ) );
1046 dbFile.write ( reinterpret_cast<char*> ( &one->_sphericalCoefficientsComputed ),
sizeof(
bool ) );
1047 dbFile.write ( reinterpret_cast<char*> ( &one->_rrpMatricesPrecomputed ),
sizeof(
bool ) );
1050 for (
unsigned int sh = 0; sh < one->_noShellsWithData; sh++ )
1052 for (
unsigned int arrIt = 0; arrIt < ( one->_oneDimmension * one->_oneDimmension ); arrIt++ )
1054 dbFile.write ( reinterpret_cast<char*> ( &one->_realSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1055 dbFile.write ( reinterpret_cast<char*> ( &one->_imagSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1060 for (
unsigned int bnIt = 0; bnIt < one->_bandwidthLimit; bnIt++ )
1062 if ( !one->_keepOrRemove ) {
if ( ( bnIt % 2 ) != 0 ) {
continue; } }
1064 for (
unsigned int sh1 = 0; sh1 < one->_noShellsWithData; sh1++ )
1066 for (
unsigned int sh2 = 0; sh2 < one->_noShellsWithData; sh2++ )
1068 dbFile.write ( reinterpret_cast<char*> ( &one->_rrpMatrices[bnIt][sh1][sh2] ),
sizeof(
double ) );
1074 if ( saveWithAndWithout )
1077 if ( one->_usePhase )
1079 dbFile.write ( reinterpret_cast<char*> ( &one->_xFrom ),
sizeof(
double ) );
1080 dbFile.write ( reinterpret_cast<char*> ( &one->_xTo ),
sizeof(
double ) );
1081 dbFile.write ( reinterpret_cast<char*> ( &one->_yFrom ),
sizeof(
double ) );
1082 dbFile.write ( reinterpret_cast<char*> ( &one->_yTo ),
sizeof(
double ) );
1083 dbFile.write ( reinterpret_cast<char*> ( &one->_zFrom ),
sizeof(
double ) );
1084 dbFile.write ( reinterpret_cast<char*> ( &one->_zTo ),
sizeof(
double ) );
1086 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( (one->_maxMapU+1) * (one->_maxMapV+1) * (one->_maxMapW+1) ); mIt++ )
1088 dbFile.write ( reinterpret_cast<char*> ( &one->_densityMapCor[mIt] ),
sizeof(
double ) );
1093 settings->
usePhase = !this->usePhase;
1101 this->theta = settings->
theta;
1102 this->phi = settings->
phi;
1107 if ( fileType == 2 )
1110 &this->shellSpacing,
1111 this->mapResolution,
1115 &this->glIntegOrder,
1122 else if ( fileType == 1 )
1125 &this->shellSpacing,
1126 this->mapResolution,
1130 &this->glIntegOrder,
1135 this->firstLineCOM );
1139 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;
1143 std::stringstream hlpSS;
1144 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(iter) <<
"." <<
"</font>";
1145 rvapi_set_text ( hlpSS.str().c_str(),
1160 std::cout <<
">>>>> Structure loaded." << std::endl;
1168 this->bFactorChange,
1172 &this->glIntegOrder,
1186 this->bFactorChange,
1201 std::cout <<
">>>>> Spherical harmonics computed (phase reverse)." << std::endl;
1208 dbFile.write ( reinterpret_cast<char*> ( &two->_fromPDB ),
sizeof(
bool ) );
1209 dbFile.write ( reinterpret_cast<char*> ( &two->_shellSpacing ),
sizeof(
double ) );
1210 dbFile.write ( reinterpret_cast<char*> ( &two->_maxExtraCellularSpace ),
sizeof(
double ) );
1211 dbFile.write ( reinterpret_cast<char*> ( &two->_xRange ),
sizeof(
double ) );
1212 dbFile.write ( reinterpret_cast<char*> ( &two->_yRange ),
sizeof(
double ) );
1213 dbFile.write ( reinterpret_cast<char*> ( &two->_zRange ),
sizeof(
double ) );
1215 hlpUInt = two->_shellPlacement.size();
1216 dbFile.write ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof(
unsigned int ) );
1217 for (
unsigned int it = 0; it < hlpUInt; it++ )
1219 dbFile.write ( reinterpret_cast<char*> ( &two->_shellPlacement.at(it) ),
sizeof(
double ) );
1222 dbFile.write ( reinterpret_cast<char*> ( &two->_mapResolution ),
sizeof(
double ) );
1223 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapU ),
sizeof(
unsigned int ) );
1224 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapV ),
sizeof(
unsigned int ) );
1225 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapW ),
sizeof(
unsigned int ) );
1226 dbFile.write ( reinterpret_cast<char*> ( &two->_densityMapComputed ),
sizeof(
bool ) );
1227 dbFile.write ( reinterpret_cast<char*> ( &two->_mapMean ),
sizeof(
double ) );
1228 dbFile.write ( reinterpret_cast<char*> ( &two->_mapSdev ),
sizeof(
double ) );
1229 dbFile.write ( reinterpret_cast<char*> ( &two->_fourierCoeffPower ),
sizeof(
double ) );
1230 dbFile.write ( reinterpret_cast<char*> ( &two->_bFactorChange ),
sizeof(
double ) );
1231 dbFile.write ( reinterpret_cast<char*> ( &two->_maxMapRange ),
sizeof(
double ) );
1232 dbFile.write ( reinterpret_cast<char*> ( &two->_phaseRemoved ),
sizeof(
bool ) );
1233 dbFile.write ( reinterpret_cast<char*> ( &two->_usePhase ),
sizeof(
bool ) );
1234 dbFile.write ( reinterpret_cast<char*> ( &two->_keepOrRemove ),
sizeof(
bool ) );
1235 dbFile.write ( reinterpret_cast<char*> ( &two->_thetaAngle ),
sizeof(
double ) );
1236 dbFile.write ( reinterpret_cast<char*> ( &two->_phiAngle ),
sizeof(
double ) );
1237 dbFile.write ( reinterpret_cast<char*> ( &two->_noShellsWithData ),
sizeof(
unsigned int ) );
1238 dbFile.write ( reinterpret_cast<char*> ( &two->_xCorrection ),
sizeof(
unsigned int ) );
1239 dbFile.write ( reinterpret_cast<char*> ( &two->_yCorrection ),
sizeof(
unsigned int ) );
1240 dbFile.write ( reinterpret_cast<char*> ( &two->_zCorrection ),
sizeof(
unsigned int ) );
1241 dbFile.write ( reinterpret_cast<char*> ( &two->_xCorrErr ),
sizeof(
double ) );
1242 dbFile.write ( reinterpret_cast<char*> ( &two->_yCorrErr ),
sizeof(
double ) );
1243 dbFile.write ( reinterpret_cast<char*> ( &two->_zCorrErr ),
sizeof(
double ) );
1244 dbFile.write ( reinterpret_cast<char*> ( &two->_sphereMapped ),
sizeof(
bool ) );
1245 dbFile.write ( reinterpret_cast<char*> ( &two->_firstLineCOM ),
sizeof(
bool ) );
1246 dbFile.write ( reinterpret_cast<char*> ( &two->_bandwidthLimit ),
sizeof(
unsigned int ) );
1247 dbFile.write ( reinterpret_cast<char*> ( &two->_oneDimmension ),
sizeof(
unsigned int ) );
1248 dbFile.write ( reinterpret_cast<char*> ( &two->_sphericalCoefficientsComputed ),
sizeof(
bool ) );
1249 dbFile.write ( reinterpret_cast<char*> ( &two->_rrpMatricesPrecomputed ),
sizeof(
bool ) );
1252 for (
unsigned int sh = 0; sh < two->_noShellsWithData; sh++ )
1254 for (
unsigned int arrIt = 0; arrIt < ( two->_oneDimmension * two->_oneDimmension ); arrIt++ )
1256 dbFile.write ( reinterpret_cast<char*> ( &two->_realSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1257 dbFile.write ( reinterpret_cast<char*> ( &two->_imagSHCoeffs[sh][arrIt] ),
sizeof(
double ) );
1262 for (
unsigned int bnIt = 0; bnIt < two->_bandwidthLimit; bnIt++ )
1264 if ( !two->_keepOrRemove ) {
if ( ( bnIt % 2 ) != 0 ) {
continue; } }
1266 for (
unsigned int sh1 = 0; sh1 < two->_noShellsWithData; sh1++ )
1268 for (
unsigned int sh2 = 0; sh2 < two->_noShellsWithData; sh2++ )
1270 dbFile.write ( reinterpret_cast<char*> ( &two->_rrpMatrices[bnIt][sh1][sh2] ),
sizeof(
double ) );
1276 if ( two->_usePhase )
1278 dbFile.write ( reinterpret_cast<char*> ( &two->_xFrom ),
sizeof(
double ) );
1279 dbFile.write ( reinterpret_cast<char*> ( &two->_xTo ),
sizeof(
double ) );
1280 dbFile.write ( reinterpret_cast<char*> ( &two->_yFrom ),
sizeof(
double ) );
1281 dbFile.write ( reinterpret_cast<char*> ( &two->_yTo ),
sizeof(
double ) );
1282 dbFile.write ( reinterpret_cast<char*> ( &two->_zFrom ),
sizeof(
double ) );
1283 dbFile.write ( reinterpret_cast<char*> ( &two->_zTo ),
sizeof(
double ) );
1285 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( two->_maxMapU * two->_maxMapV * two->_maxMapW ); mIt++ )
1287 dbFile.write ( reinterpret_cast<char*> ( &two->_densityMapCor[mIt] ),
sizeof(
double ) );
1297 std::cout <<
">>>>> Structure saved." << std::endl;
1302 std::stringstream hlpSS;
1303 hlpSS <<
"<font color=\"green\">" <<
"File " << this->structFiles.at(iter) <<
" successfully saved to the database file." <<
"</font>";
1304 rvapi_set_text ( hlpSS.str().c_str(),
1310 filesSectionIter += 1;
1321 std::stringstream hlpSS;
1322 hlpSS <<
"<font color=\"green\">" <<
"File processing complete." <<
"</font>";
1323 rvapi_set_text ( hlpSS.str().c_str(),
1361 std::vector<std::string>* matchedStrNames )
1364 unsigned int hlpUInt, hlpUInt2;
1366 std::vector<std::string> dbStrNames;
1367 double minVol = 0.0;
1370 std::ifstream dbFile ( settings->
databaseName, std::ios::in | std::ios::binary);
1373 if ( dbFile.fail() )
1375 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open the database file for reading " << settings->
databaseName <<
" . Terminating..." << std::endl;
1379 std::stringstream hlpSS;
1380 hlpSS <<
"<font color=\"red\">" <<
"Cannot open database with name " << settings->
databaseName <<
". Could you have no permissions to write to the requested database location?" <<
"</font>";
1381 rvapi_set_text ( hlpSS.str().c_str(),
1396 std::cout <<
">>>>>>>> Database file opened." << std::endl;
1402 std::stringstream hlpSS;
1403 hlpSS <<
"<font color=\"green\">" <<
"Database reading initiated." <<
"</font>";
1404 rvapi_set_text ( hlpSS.str().c_str(),
1419 dbFile.read ( reinterpret_cast<char*> ( &minVol ),
sizeof (
double ) );
1420 if ( minVol == 0.0 )
1422 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;
1426 std::stringstream hlpSS;
1427 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>";
1428 rvapi_set_text ( hlpSS.str().c_str(),
1441 dbFile.read ( reinterpret_cast<char*> ( &settings->
mapResolution ), sizeof (
double ) );
1442 dbFile.read ( reinterpret_cast<char*> ( &settings->
bandwidth ), sizeof (
unsigned int ) );
1443 dbFile.read ( reinterpret_cast<char*> ( &settings->
glIntegOrder ), sizeof (
unsigned int ) );
1444 dbFile.read ( reinterpret_cast<char*> ( &settings->
theta ), sizeof (
unsigned int ) );
1445 dbFile.read ( reinterpret_cast<char*> ( &settings->
phi ), sizeof (
unsigned int ) );
1446 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorValue ), sizeof (
double ) );
1447 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorChange ), sizeof (
double ) );
1448 dbFile.read ( reinterpret_cast<char*> ( &settings->
noIQRsFromMap ), sizeof (
double ) );
1449 dbFile.read ( reinterpret_cast<char*> ( &settings->
maskBlurFactor ), sizeof (
double ) );
1450 dbFile.read ( reinterpret_cast<char*> ( &settings->
shellSpacing ), sizeof (
double ) );
1451 dbFile.read ( reinterpret_cast<char*> ( &settings->
manualShells ), sizeof (
unsigned int ) );
1452 dbFile.read ( reinterpret_cast<char*> ( &settings->
usePhase ), sizeof (
bool ) );
1453 dbFile.read ( reinterpret_cast<char*> ( &settings->
saveWithAndWithout ), sizeof (
bool ) );
1454 dbFile.read ( reinterpret_cast<char*> ( &settings->
useCOM ), sizeof (
bool ) );
1455 dbFile.read ( reinterpret_cast<char*> ( &settings->
firstLineCOM ), sizeof (
bool ) );
1456 dbFile.read ( reinterpret_cast<char*> ( &settings->
alpha ), sizeof (
double ) );
1457 dbFile.read ( reinterpret_cast<char*> ( &settings->
mPower ), sizeof (
double ) );
1459 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1460 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
1462 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
1463 settings->
ignoreLs.emplace_back ( hlpUInt2 );
1466 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1467 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
1469 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
1470 hlpChar =
new char[hlpUInt2+1];
1471 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt2 );
1472 hlpChar[hlpUInt2] =
'\0';
1473 dbStrNames.emplace_back ( hlpChar );
1475 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakHeightNoIQRs ), sizeof (
double ) );
1476 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakDistanceForReal ), sizeof (
double ) );
1478 dbFile.read ( reinterpret_cast<char*> ( &settings->
aaErrorTolerance ), sizeof (
double ) );
1479 dbFile.read ( reinterpret_cast<char*> ( &settings->
symGapTolerance ), sizeof (
double ) );
1480 dbFile.read ( reinterpret_cast<char*> ( &settings->
energyLevelDist ), sizeof (
bool ) );
1481 dbFile.read ( reinterpret_cast<char*> ( &settings->
traceSigmaDist ), sizeof (
bool ) );
1482 dbFile.read ( reinterpret_cast<char*> ( &settings->
fullRotFnDist ), sizeof (
bool ) );
1483 dbFile.read ( reinterpret_cast<char*> ( &settings->
enLevelsThreshold ), sizeof (
double ) );
1484 dbFile.read ( reinterpret_cast<char*> ( &settings->
trSigmaThreshold ), sizeof (
double ) );
1485 dbFile.read ( reinterpret_cast<char*> ( &settings->
taskToPerform ), sizeof ( ProSHADE::Task ) );
1487 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1488 hlpChar =
new char[hlpUInt+1];
1489 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
1490 hlpChar[hlpUInt] =
'\0';
1493 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
1494 hlpChar =
new char[hlpUInt+1];
1495 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
1496 hlpChar[hlpUInt] =
'\0';
1503 this->theta = settings->
theta;
1504 this->phi = settings->
phi;
1510 this->useCOM = settings->
useCOM;
1513 this->alpha = settings->
alpha;
1514 this->mPower = settings->
mPower;
1515 this->ignoreLs = settings->
ignoreLs;
1519 this->usePhase = settings->
usePhase;
1525 std::cout <<
">>>>>>>> Database settings loaded." << std::endl;
1532 std::stringstream hlpSS;
1533 hlpSS <<
"<font color=\"green\">" <<
"Database settings read." <<
"</font>";
1534 rvapi_set_text ( hlpSS.str().c_str(),
1548 matchedStrNames->clear ( );
1549 matchedStrNames->emplace_back ( structFiles.at(0) );
1550 unsigned int fileType =
checkFileType ( structFiles.at(0) );
1551 if ( fileType == 2 )
1554 &this->shellSpacing,
1555 this->mapResolution,
1559 &this->glIntegOrder,
1566 else if ( fileType == 1 )
1569 &this->shellSpacing,
1570 this->mapResolution,
1574 &this->glIntegOrder,
1579 this->firstLineCOM );
1583 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;
1587 std::stringstream hlpSS;
1588 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file named " << this->structFiles.at(0) <<
" ." <<
"</font>";
1589 rvapi_set_text ( hlpSS.str().c_str(),
1603 std::cout <<
"Structure 0 loaded." << std::endl;
1609 std::stringstream hlpSS;
1610 hlpSS <<
"<font color=\"green\">" <<
"Sought structure loaded." <<
"</font>";
1611 rvapi_set_text ( hlpSS.str().c_str(),
1623 if ( this->usePhase )
1626 this->bFactorChange,
1630 &this->glIntegOrder,
1644 this->bFactorChange,
1659 if ( this->energyLevelDist )
1665 std::cout <<
">>>>>>>> Structure 0 spherical harmonics computed." << std::endl;
1668 int structIterHTML = 0;
1672 rvapi_add_section (
"FilesSection",
1673 "List of structures",
1682 std::stringstream hlpSS;
1683 hlpSS <<
"<font color=\"green\">" <<
"Structure to compare against the rest: " << this->structFiles.at(0) <<
"</font>";
1684 rvapi_set_text ( hlpSS.str().c_str(),
1690 structIterHTML += 1;
1697 double volMin = ( (
static_cast<double> ( (one->_xRange-this->extraSpace) ) * volTolerance ) *
1698 ( static_cast<double> ( (one->_yRange-this->extraSpace) ) * volTolerance ) *
1699 (
static_cast<double> ( (one->_zRange-this->extraSpace) ) * volTolerance ) );
1701 double volMax = ( (
static_cast<double> ( (one->_xRange-this->extraSpace) ) * volTolerance ) *
1702 ( static_cast<double> ( (one->_yRange-this->extraSpace) ) * volTolerance ) *
1703 (
static_cast<double> ( (one->_zRange-this->extraSpace) ) * volTolerance ) );
1704 std::vector<ProSHADE_data*> dbData;
1705 bool foundAlready =
false;
1706 bool tooFarAlready =
false;
1707 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbStrNames.size() ); strIt++ )
1709 if ( tooFarAlready ) {
break; }
1713 std::cout <<
">>>>> Starting to load structure " << strIt+1 <<
" from the database." << std::endl;
1716 if ( !this->saveWithAndWithout )
1718 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings ) );
1720 if ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 )
1722 if ( foundAlready ) { tooFarAlready =
true; }
1724 dbData.pop_back ( );
1727 std::cout <<
"Structure " << strIt+1 <<
" read from the database, but will not be used - too different dimmensions - see the \'--dbSizeLim\' option." << std::endl;
1731 std::stringstream hlpSS;
1732 hlpSS <<
"<font color=\"orange\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be ignored." <<
"</font>";
1733 rvapi_set_text ( hlpSS.str().c_str(),
1739 structIterHTML += 1;
1745 foundAlready =
true;
1746 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
1749 std::cout <<
"Structure " << strIt+1 <<
" read from the database." << std::endl;
1754 std::stringstream hlpSS;
1755 hlpSS <<
"<font color=\"green\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be used." <<
"</font>";
1756 rvapi_set_text ( hlpSS.str().c_str(),
1762 structIterHTML += 1;
1768 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings, this->saveWithAndWithout ) );
1769 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), volMin, volMax, settings->
verbose, settings, this->saveWithAndWithout ) );
1771 if ( ( dbData.at(dbData.size()-2)->_mapResolution == -999.9 ) || ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 ) )
1773 if ( foundAlready ) { tooFarAlready =
true; }
1775 dbData.pop_back ( );
1776 dbData.pop_back ( );
1779 std::cout <<
"Structure " << strIt+1 <<
" read from the database, but will not be used - too different dimmensions - see the \'--dbSizeLim\' option." << std::endl;
1783 std::stringstream hlpSS;
1784 hlpSS <<
"<font color=\"orange\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be ignored." <<
"</font>";
1785 rvapi_set_text ( hlpSS.str().c_str(),
1791 structIterHTML += 1;
1797 foundAlready =
true;
1798 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
1801 std::cout <<
"Structure " << strIt+1 <<
" read from the database." << std::endl;
1806 std::stringstream hlpSS;
1807 hlpSS <<
"<font color=\"green\">" <<
" ... database entry " << strIt+1 <<
": " << dbStrNames.at(strIt) <<
" will be used." <<
"</font>";
1808 rvapi_set_text ( hlpSS.str().c_str(),
1814 structIterHTML += 1;
1823 std::stringstream hlpSS;
1824 hlpSS <<
"<font color=\"green\">" <<
"Database imported." <<
"</font>";
1825 rvapi_set_text ( hlpSS.str().c_str(),
1836 if ( dbData.size() == 0 )
1838 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;
1842 std::stringstream hlpSS;
1843 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>";
1844 rvapi_set_text ( hlpSS.str().c_str(),
1861 if ( !this->saveWithAndWithout )
1869 if ( fileType == 2 )
1872 &this->shellSpacing,
1873 this->mapResolution,
1877 &this->glIntegOrder,
1884 else if ( fileType == 1 )
1887 &this->shellSpacing,
1888 this->mapResolution,
1892 &this->glIntegOrder,
1897 this->firstLineCOM );
1901 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;
1907 if ( !this->usePhase )
1910 this->bFactorChange,
1914 &this->glIntegOrder,
1928 this->bFactorChange,
1944 if ( this->energyLevelDist )
1950 std::cout <<
">>>>>>>> Structure 0 spherical harmonics computed (reverse phase)." << std::endl;
1957 if ( one->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
1958 else { this->cmpObj->_keepOrRemove =
false; }
1961 if ( this->saveWithAndWithout )
1967 if ( this->energyLevelDist )
1971 std::cout <<
"Computing the cross-correlation distances." << std::endl;
1976 std::stringstream hlpSS;
1977 hlpSS <<
"<font color=\"green\">" <<
"Computing the Energy Level distances." <<
"</font>";
1978 rvapi_set_text ( hlpSS.str().c_str(),
1991 if ( this->enLevelsThreshold != -999.9 )
1993 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
1995 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
1997 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
2001 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2007 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
2009 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2015 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
2017 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
2022 this->glIntegOrderVec = std::vector<unsigned int> ( dbData.size() + 1 );
2023 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbData.size() + 1 ); strIt++ )
2025 this->glIntegOrderVec.at(strIt) = this->glIntegOrder;
2029 if ( this->traceSigmaDist || this->fullRotFnDist )
2035 if ( this->traceSigmaDist )
2039 std::cout <<
"Computing the trace sigma distances." << std::endl;
2044 std::stringstream hlpSS;
2045 hlpSS <<
"<font color=\"green\">" <<
"Computing Trace Sigma distances." <<
"</font>";
2046 rvapi_set_text ( hlpSS.str().c_str(),
2058 if ( this->trSigmaThreshold == -999.9 )
2060 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
2064 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
2066 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
2068 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
2072 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
2079 if ( this->fullRotFnDist )
2084 std::cout <<
">> Inverse SO(3) Fourier transform map computed." << std::endl;
2090 std::cout <<
">>>>> Optimal Euler angles obtained." << std::endl;
2096 std::cout <<
">> Wigner matrices calculated." << std::endl;
2101 std::cout <<
"Computing the rotation function distances." << std::endl;
2106 std::stringstream hlpSS;
2107 hlpSS <<
"<font color=\"green\">" <<
"Computing Rotation Function distances." <<
"</font>";
2108 rvapi_set_text ( hlpSS.str().c_str(),
2122 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( iter ); iter++ )
2124 if ( dbData.at(iter) != nullptr )
2126 delete dbData.at(iter);
2127 dbData.at(iter) =
nullptr;
2147 std::vector<std::string>* matchedStrNames )
2150 unsigned int hlpUInt, hlpUInt2;
2152 std::vector<std::string> dbStrNames;
2153 double minVol = 0.0;
2157 std::cout <<
"Computing distances between map fragments and the structure database." << std::endl;
2161 std::ifstream dbFile ( settings->
databaseName, std::ios::in | std::ios::binary);
2164 if ( dbFile.fail() )
2166 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot open the database file for reading " << settings->
databaseName <<
" . Terminating..." << std::endl;
2170 std::stringstream hlpSS;
2171 hlpSS <<
"<font color=\"red\">" <<
"Cannot open database with name " << settings->
databaseName <<
". Could you have no permissions to write to the requested database location?" <<
"</font>";
2172 rvapi_set_text ( hlpSS.str().c_str(),
2188 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;
2192 std::stringstream hlpSS;
2193 hlpSS <<
"<font color=\"red\">" <<
"Missing the mandatory argument determining the fragmentation box size. Please supply it using the --mFrag command line option." <<
"</font>";
2194 rvapi_set_text ( hlpSS.str().c_str(),
2208 std::cerr <<
"!!! ProSHADE ERROR !!! Requested map fragmentation without using phases - this does not make sense. Terminating..." << std::endl;
2212 std::stringstream hlpSS;
2213 hlpSS <<
"<font color=\"red\">" <<
"Requested map fragmentation without using phases. This is not allowed." <<
"</font>";
2214 rvapi_set_text ( hlpSS.str().c_str(),
2229 std::cout <<
">>>>>>>> Database file opened for reading." << std::endl;
2234 std::stringstream hlpSS;
2235 hlpSS <<
"<font color=\"green\">" <<
"Database reading intialisation complete." <<
"</font>";
2236 rvapi_set_text ( hlpSS.str().c_str(),
2252 bool userCOM =
false;
2253 if ( settings->
useCOM ==
true ) { userCOM =
true; }
2256 dbFile.read ( reinterpret_cast<char*> ( &minVol ),
sizeof (
double ) );
2257 if ( minVol == 0.0 )
2259 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;
2263 std::stringstream hlpSS;
2264 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>";
2265 rvapi_set_text ( hlpSS.str().c_str(),
2278 dbFile.read ( reinterpret_cast<char*> ( &settings->
mapResolution ), sizeof (
double ) );
2279 dbFile.read ( reinterpret_cast<char*> ( &settings->
bandwidth ), sizeof (
unsigned int ) );
2280 dbFile.read ( reinterpret_cast<char*> ( &settings->
glIntegOrder ), sizeof (
unsigned int ) );
2281 dbFile.read ( reinterpret_cast<char*> ( &settings->
theta ), sizeof (
unsigned int ) );
2282 dbFile.read ( reinterpret_cast<char*> ( &settings->
phi ), sizeof (
unsigned int ) );
2283 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorValue ), sizeof (
double ) );
2284 dbFile.read ( reinterpret_cast<char*> ( &settings->
bFactorChange ), sizeof (
double ) );
2285 dbFile.read ( reinterpret_cast<char*> ( &settings->
noIQRsFromMap ), sizeof (
double ) );
2286 dbFile.read ( reinterpret_cast<char*> ( &settings->
maskBlurFactor ), sizeof (
double ) );
2287 dbFile.read ( reinterpret_cast<char*> ( &settings->
shellSpacing ), sizeof (
double ) );
2288 dbFile.read ( reinterpret_cast<char*> ( &settings->
manualShells ), sizeof (
unsigned int ) );
2289 dbFile.read ( reinterpret_cast<char*> ( &settings->
usePhase ), sizeof (
bool ) );
2290 dbFile.read ( reinterpret_cast<char*> ( &settings->
saveWithAndWithout ), sizeof (
bool ) );
2291 dbFile.read ( reinterpret_cast<char*> ( &settings->
useCOM ), sizeof (
bool ) );
2292 dbFile.read ( reinterpret_cast<char*> ( &settings->
firstLineCOM ), sizeof (
bool ) );
2293 dbFile.read ( reinterpret_cast<char*> ( &settings->
alpha ), sizeof (
double ) );
2294 dbFile.read ( reinterpret_cast<char*> ( &settings->
mPower ), sizeof (
double ) );
2296 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2297 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
2299 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
2300 settings->
ignoreLs.emplace_back ( hlpUInt2 );
2303 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2304 for (
unsigned int iter = 0; iter < hlpUInt; iter++ )
2306 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt2 ),
sizeof (
unsigned int ) );
2307 hlpChar =
new char[hlpUInt2+1];
2308 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt2 );
2309 hlpChar[hlpUInt2] =
'\0';
2310 dbStrNames.emplace_back ( hlpChar );
2312 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakHeightNoIQRs ), sizeof (
double ) );
2313 dbFile.read ( reinterpret_cast<char*> ( &settings->
peakDistanceForReal ), sizeof (
double ) );
2315 dbFile.read ( reinterpret_cast<char*> ( &settings->
aaErrorTolerance ), sizeof (
double ) );
2316 dbFile.read ( reinterpret_cast<char*> ( &settings->
symGapTolerance ), sizeof (
double ) );
2317 dbFile.read ( reinterpret_cast<char*> ( &settings->
energyLevelDist ), sizeof (
bool ) );
2318 dbFile.read ( reinterpret_cast<char*> ( &settings->
traceSigmaDist ), sizeof (
bool ) );
2319 dbFile.read ( reinterpret_cast<char*> ( &settings->
fullRotFnDist ), sizeof (
bool ) );
2320 dbFile.read ( reinterpret_cast<char*> ( &settings->
enLevelsThreshold ), sizeof (
double ) );
2321 dbFile.read ( reinterpret_cast<char*> ( &settings->
trSigmaThreshold ), sizeof (
double ) );
2322 dbFile.read ( reinterpret_cast<char*> ( &settings->
taskToPerform ), sizeof ( ProSHADE::Task ) );
2324 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2325 hlpChar =
new char[hlpUInt+1];
2326 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
2327 hlpChar[hlpUInt] =
'\0';
2330 dbFile.read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
2331 hlpChar =
new char[hlpUInt+1];
2332 dbFile.read ( hlpChar,
sizeof (
char ) * hlpUInt );
2333 hlpChar[hlpUInt] =
'\0';
2338 std::cout <<
">> Database settings loaded." << std::endl;
2343 std::stringstream hlpSS;
2344 hlpSS <<
"<font color=\"green\">" <<
"Database settings loaded." <<
"</font>";
2345 rvapi_set_text ( hlpSS.str().c_str(),
2360 this->theta = settings->
theta;
2361 this->phi = settings->
phi;
2367 this->useCOM = settings->
useCOM;
2370 this->alpha = settings->
alpha;
2371 this->mPower = settings->
mPower;
2372 this->ignoreLs = settings->
ignoreLs;
2376 this->usePhase = settings->
usePhase;
2383 rvapi_add_section (
"DBSettingsSection",
2384 "Database Settings",
2393 std::stringstream hlpSS;
2394 hlpSS <<
"<pre>" <<
"Map resolution: ";
2395 int hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2396 for (
int iter = 0; iter < hlpIt; iter++ )
2401 std::stringstream hlpSS2;
2402 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mapResolution * 1000.0 ) / 1000.0;
2403 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2404 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2405 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2407 rvapi_set_text ( hlpSS.str().c_str(),
2408 "DBSettingsSection",
2414 hlpSS.str ( std::string ( ) );
2415 hlpSS <<
"<pre>" <<
"Bandwidth: ";
2416 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2417 for (
int iter = 0; iter < hlpIt; iter++ )
2422 hlpSS2.str ( std::string ( ) );
2423 if ( this->bandwidth == 0 ) { hlpSS2 <<
" AUTO"; }
2424 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bandwidth * 1000.0 ) / 1000.0; }
2425 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2426 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2427 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2429 rvapi_set_text ( hlpSS.str().c_str(),
2430 "DBSettingsSection",
2436 hlpSS.str ( std::string ( ) );
2437 hlpSS <<
"<pre>" <<
"Gauss-Legendre Integration order: ";
2438 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2439 for (
int iter = 0; iter < hlpIt; iter++ )
2444 hlpSS2.str ( std::string ( ) );
2445 if ( this->glIntegOrder == 0 ) { hlpSS2 <<
" AUTO"; }
2446 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->glIntegOrder * 1000.0 ) / 1000.0; }
2447 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2448 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2449 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2451 rvapi_set_text ( hlpSS.str().c_str(),
2452 "DBSettingsSection",
2458 hlpSS.str ( std::string ( ) );
2459 hlpSS <<
"<pre>" <<
"Theta angle sampling: ";
2460 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2461 for (
int iter = 0; iter < hlpIt; iter++ )
2466 hlpSS2.str ( std::string ( ) );
2467 if ( this->theta == 0 ) { hlpSS2 <<
" AUTO"; }
2468 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->theta * 1000.0 ) / 1000.0; }
2469 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2470 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2471 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2473 rvapi_set_text ( hlpSS.str().c_str(),
2474 "DBSettingsSection",
2480 hlpSS.str ( std::string ( ) );
2481 hlpSS <<
"<pre>" <<
"Phi angle sampling: ";
2482 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2483 for (
int iter = 0; iter < hlpIt; iter++ )
2488 hlpSS2.str ( std::string ( ) );
2489 if ( this->phi == 0 ) { hlpSS2 <<
" AUTO"; }
2490 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->phi * 1000.0 ) / 1000.0; }
2491 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2492 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2493 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2495 rvapi_set_text ( hlpSS.str().c_str(),
2496 "DBSettingsSection",
2502 hlpSS.str ( std::string ( ) );
2503 hlpSS <<
"<pre>" <<
"Set all PDB file B-factors to: ";
2504 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2505 for (
int iter = 0; iter < hlpIt; iter++ )
2510 hlpSS2.str ( std::string ( ) );
2511 if ( this->bFactorValue == 0 ) { hlpSS2 <<
" AUTO"; }
2512 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorValue * 1000.0 ) / 1000.0; }
2513 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2514 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2515 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2517 rvapi_set_text ( hlpSS.str().c_str(),
2518 "DBSettingsSection",
2524 hlpSS.str ( std::string ( ) );
2525 hlpSS <<
"<pre>" <<
"Change B-factors after map computation by: ";
2526 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2527 for (
int iter = 0; iter < hlpIt; iter++ )
2532 hlpSS2.str ( std::string ( ) );
2533 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->bFactorChange * 1000.0 ) / 1000.0;
2534 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2535 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2536 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2538 rvapi_set_text ( hlpSS.str().c_str(),
2539 "DBSettingsSection",
2545 hlpSS.str ( std::string ( ) );
2546 hlpSS <<
"<pre>" <<
"Map IQR from median threshold: ";
2547 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2548 for (
int iter = 0; iter < hlpIt; iter++ )
2553 hlpSS2.str ( std::string ( ) );
2554 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->noIQRsFromMap * 1000.0 ) / 1000.0;
2555 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2556 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2557 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2559 rvapi_set_text ( hlpSS.str().c_str(),
2560 "DBSettingsSection",
2566 hlpSS.str ( std::string ( ) );
2567 hlpSS <<
"<pre>" <<
"Distance between shells: ";
2568 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2569 for (
int iter = 0; iter < hlpIt; iter++ )
2574 hlpSS2.str ( std::string ( ) );
2575 if ( this->shellSpacing == 0 ) { hlpSS2 <<
" AUTO"; }
2576 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->shellSpacing * 1000.0 ) / 1000.0; }
2577 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2578 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2579 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2581 rvapi_set_text ( hlpSS.str().c_str(),
2582 "DBSettingsSection",
2588 hlpSS.str ( std::string ( ) );
2589 hlpSS <<
"<pre>" <<
"Number of shells: ";
2590 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2591 for (
int iter = 0; iter < hlpIt; iter++ )
2596 hlpSS2.str ( std::string ( ) );
2597 if ( this->manualShells == 0 ) { hlpSS2 <<
" AUTO"; }
2598 else { hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->manualShells * 1000.0 ) / 1000.0; }
2599 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2600 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2601 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2603 rvapi_set_text ( hlpSS.str().c_str(),
2604 "DBSettingsSection",
2610 hlpSS.str ( std::string ( ) );
2611 hlpSS <<
"<pre>" <<
"Use Centre of Mass for centering: ";
2612 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2613 for (
int iter = 0; iter < hlpIt; iter++ )
2618 hlpSS2.str ( std::string ( ) );
2619 if ( this->useCOM == 0 ) { hlpSS2 <<
" FALSE"; }
2620 else { hlpSS2 <<
" TRUE"; }
2621 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2622 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2623 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2625 rvapi_set_text ( hlpSS.str().c_str(),
2626 "DBSettingsSection",
2632 hlpSS.str ( std::string ( ) );
2633 hlpSS <<
"<pre>" <<
"Add extra space to cell: ";
2634 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2635 for (
int iter = 0; iter < hlpIt; iter++ )
2640 hlpSS2.str ( std::string ( ) );
2641 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->extraSpace * 1000.0 ) / 1000.0;
2642 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2643 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2644 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2646 rvapi_set_text ( hlpSS.str().c_str(),
2647 "DBSettingsSection",
2653 hlpSS.str ( std::string ( ) );
2654 hlpSS <<
"<pre>" <<
"Raise Fourier coefficients to power: ";
2655 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2656 for (
int iter = 0; iter < hlpIt; iter++ )
2661 hlpSS2.str ( std::string ( ) );
2662 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->alpha * 1000.0 ) / 1000.0;
2663 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2664 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2665 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2667 rvapi_set_text ( hlpSS.str().c_str(),
2668 "DBSettingsSection",
2674 hlpSS.str ( std::string ( ) );
2675 hlpSS <<
"<pre>" <<
"Weight Energy Level matrix position by: ";
2676 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2677 for (
int iter = 0; iter < hlpIt; iter++ )
2682 hlpSS2.str ( std::string ( ) );
2683 hlpSS2 << std::showpos << ProSHADE_internal_misc::roundDouble ( this->mPower * 1000.0 ) / 1000.0;
2684 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2685 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2686 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2688 rvapi_set_text ( hlpSS.str().c_str(),
2689 "DBSettingsSection",
2695 hlpSS.str ( std::string ( ) );
2696 hlpSS <<
"<pre>" <<
"Ignore the following bands: ";
2697 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2698 for (
int iter = 0; iter < hlpIt; iter++ )
2703 hlpSS2.str ( std::string ( ) );
2704 for (
int iter = 0; iter < static_cast<int> ( this->ignoreLs.size() ); iter++ )
2706 hlpSS2 << std::showpos << this->ignoreLs.at(iter) <<
" ";
2708 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2710 rvapi_set_text ( hlpSS.str().c_str(),
2711 "DBSettingsSection",
2717 hlpSS.str ( std::string ( ) );
2718 hlpSS <<
"<pre>" <<
"Compute Energy Level distances: ";
2719 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2720 for (
int iter = 0; iter < hlpIt; iter++ )
2725 hlpSS2.str ( std::string ( ) );
2726 if ( this->energyLevelDist == 0 ) { hlpSS2 <<
" FALSE"; }
2727 else { hlpSS2 <<
" TRUE"; }
2728 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2729 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2730 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2732 rvapi_set_text ( hlpSS.str().c_str(),
2733 "DBSettingsSection",
2739 hlpSS.str ( std::string ( ) );
2740 hlpSS <<
"<pre>" <<
"Compute Trace Sigma distances: ";
2741 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2742 for (
int iter = 0; iter < hlpIt; iter++ )
2747 hlpSS2.str ( std::string ( ) );
2748 if ( this->traceSigmaDist == 0 ) { hlpSS2 <<
" FALSE"; }
2749 else { hlpSS2 <<
" TRUE"; }
2750 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2751 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2752 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2754 rvapi_set_text ( hlpSS.str().c_str(),
2755 "DBSettingsSection",
2761 hlpSS.str ( std::string ( ) );
2762 hlpSS <<
"<pre>" <<
"Compute Rotation Function distances: ";
2763 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2764 for (
int iter = 0; iter < hlpIt; iter++ )
2769 hlpSS2.str ( std::string ( ) );
2770 if ( this->fullRotFnDist == 0 ) { hlpSS2 <<
" FALSE"; }
2771 else { hlpSS2 <<
" TRUE"; }
2772 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2773 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2774 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2776 rvapi_set_text ( hlpSS.str().c_str(),
2777 "DBSettingsSection",
2783 hlpSS.str ( std::string ( ) );
2784 hlpSS <<
"<pre>" <<
"Use phase information: ";
2785 hlpIt =
static_cast<int> ( 70 - hlpSS.str().length() );
2786 for (
int iter = 0; iter < hlpIt; iter++ )
2791 hlpSS2.str ( std::string ( ) );
2792 if ( this->usePhase == 0 ) { hlpSS2 <<
" FALSE"; }
2793 else { hlpSS2 <<
" TRUE"; }
2794 if ( hlpSS2.str().length() != 6 ) {
int hlp = 6 - hlpSS2.str().length();
for (
int i = 0; i < hlp; i++ ) { hlpSS <<
" "; } }
2795 if ( hlpSS2.str().length() > 6 ) { hlpSS2.str( hlpSS2.str().substr( 0, 6 ) ); }
2796 hlpSS <<
" " << hlpSS2.str() <<
"</pre>";
2798 rvapi_set_text ( hlpSS.str().c_str(),
2799 "DBSettingsSection",
2811 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;
2815 std::stringstream hlpSS;
2816 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>";
2817 rvapi_set_text ( hlpSS.str().c_str(),
2834 matchedStrNames->clear ( );
2835 matchedStrNames->emplace_back ( structFiles.at(0) );
2837 unsigned int fileType =
checkFileType ( structFiles.at(0) );
2838 if ( fileType == 2 )
2841 &this->shellSpacing,
2842 this->mapResolution,
2846 &this->glIntegOrder,
2853 else if ( fileType == 1 )
2856 &this->shellSpacing,
2857 this->mapResolution,
2861 &this->glIntegOrder,
2866 this->firstLineCOM );
2870 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;
2874 std::stringstream hlpSS;
2875 hlpSS <<
"<font color=\"red\">" <<
"Cannot open file " << this->structFiles.at(0) <<
" .</font>";
2876 rvapi_set_text ( hlpSS.str().c_str(),
2890 std::cout <<
">>>>> Structure 0 read from file." << std::endl;
2895 std::stringstream hlpSS;
2896 hlpSS <<
"<font color=\"green\">" <<
"The structure for fragmenting loaded." <<
"</font>";
2897 rvapi_set_text ( hlpSS.str().c_str(),
2910 this->bFactorChange,
2914 &this->glIntegOrder,
2926 std::vector<ProSHADE_data*> frags = one->
fragmentMap ( settings, userCOM );
2930 std::cout <<
"Structure 0 fragmented." << std::endl;
2935 std::stringstream hlpSS;
2936 hlpSS <<
"<font color=\"green\">" <<
"Fragments obtained." <<
"</font>";
2937 rvapi_set_text ( hlpSS.str().c_str(),
2949 if ( frags.size() == 0 )
2951 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;
2955 std::stringstream hlpSS;
2956 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>";
2957 rvapi_set_text ( hlpSS.str().c_str(),
2972 double totMinVol = ( (
static_cast<double> ( frags.at(0)->_maxMapU ) * volTolerance ) *
2973 (
static_cast<double> ( frags.at(0)->_maxMapV ) * volTolerance ) *
2974 (
static_cast<double> ( frags.at(0)->_maxMapW ) * volTolerance ) );
2975 double volMin = totMinVol;
2976 for (
unsigned int iter = 1; iter < static_cast<unsigned int> ( frags.size() ); iter++ )
2978 volMin = ( (
static_cast<double> ( frags.at(iter)->_maxMapU ) * volTolerance ) *
2979 (
static_cast<double> ( frags.at(iter)->_maxMapV ) * volTolerance ) *
2980 (
static_cast<double> ( frags.at(iter)->_maxMapW ) * volTolerance ) );
2981 totMinVol = std::min ( volMin, totMinVol );
2985 double totMaxVol = ( (
static_cast<double> ( frags.at(0)->_maxMapU ) * volTolerance ) *
2986 (
static_cast<double> ( frags.at(0)->_maxMapV ) * volTolerance ) *
2987 (
static_cast<double> ( frags.at(0)->_maxMapW ) * volTolerance ) );
2988 double volMax = totMaxVol;
2989 for (
unsigned int iter = 1; iter < static_cast<unsigned int> ( frags.size() ); iter++ )
2991 volMax = ( (
static_cast<double> ( frags.at(iter)->_maxMapU ) * volTolerance ) *
2992 (
static_cast<double> ( frags.at(iter)->_maxMapV ) * volTolerance ) *
2993 (
static_cast<double> ( frags.at(iter)->_maxMapW ) * volTolerance ) );
2994 totMaxVol = std::max ( volMax, totMaxVol );
3000 rvapi_add_section (
"FragmentSection",
3001 "Fragment processing",
3014 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
3018 std::cout <<
">>>>>>>> Computing spherical harmonics for fragment " << frIt <<
" out of " << frags.size() <<
"." << std::endl;
3022 frags.at(frIt)->mapPhaselessToSphere ( settings,
3023 frags.at(frIt)->_thetaAngle,
3024 frags.at(frIt)->_phiAngle,
3029 frags.at(frIt)->getSphericalHarmonicsCoeffs ( frags.at(frIt)->_bandwidthLimit, settings );
3032 if ( this->energyLevelDist )
3034 frags.at(frIt)->precomputeRotInvDescriptor ( settings );
3039 std::stringstream hlpSS;
3040 hlpSS <<
"Fragment " << frIt <<
" spherical harmonics computation done.";
3041 rvapi_set_text ( hlpSS.str().c_str(),
3054 std::cout <<
">> Spherical harmonics computed for " <<
static_cast<unsigned int> ( frags.size() ) <<
" fragments." << std::endl;
3059 std::stringstream hlpSS;
3060 hlpSS <<
"<font color=\"green\">" <<
"Spherical harmonics computed for " <<
static_cast<unsigned int> ( frags.size() ) <<
" fragments." <<
"</font>";
3061 rvapi_set_text ( hlpSS.str().c_str(),
3073 std::vector<ProSHADE_data*> dbData;
3074 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbStrNames.size() ); strIt++ )
3078 std::cout <<
">>>>> Loading structure " << strIt <<
" from the database." << std::endl;
3081 dbData.emplace_back (
new ProSHADE_data ( &dbFile, dbStrNames.at(strIt), totMinVol, totMaxVol, settings->
verbose, settings ) );
3082 if ( dbData.at(dbData.size()-1)->_mapResolution == -999.9 )
3084 dbData.pop_back ( );
3088 matchedStrNames->emplace_back ( dbStrNames.at(strIt) );
3093 if ( dbData.size() == 0 )
3095 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;
3099 std::stringstream hlpSS;
3100 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>";
3101 rvapi_set_text ( hlpSS.str().c_str(),
3117 rvapi_add_section (
"FragmentDistancesSection",
3118 "Fragment distances computation",
3130 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
3134 std::cout <<
"Computing distances for fragment " << frIt <<
" ." << std::endl;
3141 if ( frags.at(frIt)->_keepOrRemove ) { this->cmpObj->_keepOrRemove =
true; }
3142 else { this->cmpObj->_keepOrRemove =
false; }
3145 if ( this->energyLevelDist )
3148 this->fragEnergyLevelsDistances.emplace_back ( this->energyLevelsDistances );
3151 if ( this->enLevelsThreshold != -999.9 )
3153 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
3155 if ( this->enLevelsThreshold > this->energyLevelsDistances.at(iter) )
3157 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 1 );
3161 this->cmpObj->_enLevelsDoNotFollow.emplace_back ( 0 );
3167 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->cmpObj->all->size() ); iter++ )
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 std::cout <<
">> Cross-correlation distances computed ." << std::endl;
3188 std::stringstream hlpSS;
3189 hlpSS <<
"<font color=\"green\">" <<
"Energy Level distances computed for fragment " << frIt <<
"</font>";
3190 rvapi_set_text ( hlpSS.str().c_str(),
3191 "FragmentDistancesSection",
3201 this->glIntegOrderVec = std::vector<unsigned int> ( dbData.size() + 1 );
3202 this->glIntegOrderVec.at(0) = this->glIntegOrder;
3203 double distPerPointFraction = 0.0;
3204 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( dbData.size() ); strIt++ )
3206 distPerPointFraction =
static_cast<double> ( dbData.at(strIt)->_shellSpacing ) / ( dbData.at(strIt)->_maxMapRange / 2.0 );
3208 for (
unsigned int iter = 2; iter < static_cast<unsigned int> ( ProSHADE_internal_misc::glIntMaxDists.size() ); iter++ )
3210 if ( ProSHADE_internal_misc::glIntMaxDists.at(iter) >= distPerPointFraction )
3212 this->glIntegOrderVec.at(strIt+1) = iter;
3218 if ( this->traceSigmaDist || this->fullRotFnDist )
3224 if ( this->traceSigmaDist )
3227 this->fragTraceSigmaDistances.emplace_back ( this->traceSigmaDistances );
3229 if ( this->trSigmaThreshold == -999.9 )
3231 this->cmpObj->_trSigmaDoNotFollow = this->cmpObj->_enLevelsDoNotFollow;
3235 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
3237 if ( this->trSigmaThreshold > this->traceSigmaDistances.at(iter) )
3239 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 1 );
3243 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
3250 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( this->traceSigmaDistances.size() ); iter++ )
3252 this->cmpObj->_trSigmaDoNotFollow.emplace_back ( 0 );
3258 std::cout <<
">> Trace sigma distances computed ." << std::endl;
3262 std::stringstream hlpSS;
3263 hlpSS <<
"<font color=\"green\">" <<
"Trace Sigma distances computed for fragment " << frIt <<
"</font>";
3264 rvapi_set_text ( hlpSS.str().c_str(),
3265 "FragmentDistancesSection",
3275 if ( this->fullRotFnDist )
3281 this->fragfullRotationDistances.emplace_back ( this->fullRotationDistances );
3285 std::cout <<
">> Rotation function distances computed ." << std::endl;
3289 std::stringstream hlpSS;
3290 hlpSS <<
"<font color=\"green\">" <<
"Rotation Function distances computed for fragment " << frIt <<
"</font>";
3291 rvapi_set_text ( hlpSS.str().c_str(),
3292 "FragmentDistancesSection",
3304 std::stringstream hlpSS;
3305 hlpSS <<
"<font color=\"green\">" <<
"Fragment distances computed." <<
"</font>";
3306 rvapi_set_text ( hlpSS.str().c_str(),
3344 bool saveWithAndWithout )
3347 if ( dbFile->fail() )
3349 std::cerr <<
"!!! ProSHADE ERROR !!! Cannot read from input database file. Terminating..." << std::endl;
3353 std::stringstream hlpSS;
3354 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>";
3355 rvapi_set_text ( hlpSS.str().c_str(),
3369 this->_inputFileName = fName;
3370 this->_densityMapMap =
nullptr;
3371 this->_densityMapCor =
nullptr;
3372 this->_densityMapCorCoords =
nullptr;
3373 this->_shellMappedData =
nullptr;
3374 this->_realSHCoeffs =
nullptr;
3375 this->_imagSHCoeffs =
nullptr;
3376 this->_sphericalHarmonicsWeights =
nullptr;
3377 this->_semiNaiveTable =
nullptr;
3378 this->_semiNaiveTableSpace =
nullptr;
3379 this->_shWorkspace =
nullptr;
3380 this->_rrpMatrices =
nullptr;
3381 this->_invRealData =
nullptr;
3382 this->_invImagData =
nullptr;
3384 this->_densityMapComputed =
false;
3385 this->_phaseRemoved =
false;
3386 this->_usePhase =
false;
3387 this->_firstLineCOM =
false;
3388 this->_sphereMapped =
false;
3389 this->_sphericalCoefficientsComputed =
false;
3390 this->_rrpMatricesPrecomputed =
false;
3391 this->_wasBandwithGiven =
true;
3392 this->_wasThetaGiven =
true;
3393 this->_wasPhiGiven =
true;
3394 this->_wasGlInterGiven =
true;
3396 this->_xCorrection = 0;
3397 this->_yCorrection = 0;
3398 this->_zCorrection = 0;
3400 this->_mapMean = 0.0;
3401 this->_mapSdev = 1.0;
3404 unsigned int hlpUInt;
3408 dbFile->read ( reinterpret_cast<char*> ( &this->_fromPDB ),
sizeof (
bool ) );
3409 dbFile->read ( reinterpret_cast<char*> ( &this->_shellSpacing ),
sizeof (
double ) );
3410 dbFile->read ( reinterpret_cast<char*> ( &this->_maxExtraCellularSpace ),
sizeof (
double ) );
3411 dbFile->read ( reinterpret_cast<char*> ( &this->_xRange ),
sizeof (
double ) );
3412 dbFile->read ( reinterpret_cast<char*> ( &this->_yRange ),
sizeof (
double ) );
3413 dbFile->read ( reinterpret_cast<char*> ( &this->_zRange ),
sizeof (
double ) );
3415 dbFile->read ( reinterpret_cast<char*> ( &hlpUInt ),
sizeof (
unsigned int ) );
3416 for (
unsigned int it = 0; it < hlpUInt; it++ )
3418 dbFile->read ( reinterpret_cast<char*> ( &hlpD ),
sizeof (
double ) );
3419 this->_shellPlacement.emplace_back ( hlpD );
3422 dbFile->read ( reinterpret_cast<char*> ( &this->_mapResolution ),
sizeof (
double ) );
3423 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapU ),
sizeof (
unsigned int ) );
3424 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapV ),
sizeof (
unsigned int ) );
3425 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapW ),
sizeof (
unsigned int ) );
3426 dbFile->read ( reinterpret_cast<char*> ( &this->_densityMapComputed ),
sizeof (
bool ) );
3427 dbFile->read ( reinterpret_cast<char*> ( &this->_mapMean ),
sizeof (
double ) );
3428 dbFile->read ( reinterpret_cast<char*> ( &this->_mapSdev ),
sizeof (
double ) );
3429 dbFile->read ( reinterpret_cast<char*> ( &this->_fourierCoeffPower ),
sizeof (
double ) );
3430 dbFile->read ( reinterpret_cast<char*> ( &this->_bFactorChange ),
sizeof (
double ) );
3431 dbFile->read ( reinterpret_cast<char*> ( &this->_maxMapRange ),
sizeof (
double ) );
3432 dbFile->read ( reinterpret_cast<char*> ( &this->_phaseRemoved ),
sizeof (
bool ) );
3433 dbFile->read ( reinterpret_cast<char*> ( &this->_usePhase ),
sizeof (
bool ) );
3434 dbFile->read ( reinterpret_cast<char*> ( &this->_keepOrRemove ),
sizeof (
bool ) );
3435 dbFile->read ( reinterpret_cast<char*> ( &this->_thetaAngle ),
sizeof (
double ) );
3436 dbFile->read ( reinterpret_cast<char*> ( &this->_phiAngle ),
sizeof (
double ) );
3437 dbFile->read ( reinterpret_cast<char*> ( &this->_noShellsWithData ),
sizeof (
unsigned int ) );
3438 dbFile->read ( reinterpret_cast<char*> ( &this->_xCorrection ),
sizeof (
unsigned int ) );
3439 dbFile->read ( reinterpret_cast<char*> ( &this->_yCorrection ),
sizeof (
unsigned int ) );
3440 dbFile->read ( reinterpret_cast<char*> ( &this->_zCorrection ),
sizeof (
unsigned int ) );
3441 dbFile->read ( reinterpret_cast<char*> ( &this->_xCorrErr ),
sizeof (
double ) );
3442 dbFile->read ( reinterpret_cast<char*> ( &this->_yCorrErr ),
sizeof (
double ) );
3443 dbFile->read ( reinterpret_cast<char*> ( &this->_zCorrErr ),
sizeof (
double ) );
3444 dbFile->read ( reinterpret_cast<char*> ( &this->_sphereMapped ),
sizeof (
bool ) );
3445 dbFile->read ( reinterpret_cast<char*> ( &this->_firstLineCOM ),
sizeof (
bool ) );
3446 dbFile->read ( reinterpret_cast<char*> ( &this->_bandwidthLimit ),
sizeof (
unsigned int ) );
3447 dbFile->read ( reinterpret_cast<char*> ( &this->_oneDimmension ),
sizeof (
unsigned int ) );
3448 dbFile->read ( reinterpret_cast<char*> ( &this->_sphericalCoefficientsComputed ),
sizeof (
bool ) );
3449 dbFile->read ( reinterpret_cast<char*> ( &this->_rrpMatricesPrecomputed ),
sizeof (
bool ) );
3453 std::cout <<
">>>>>>>> Settings loaded." << std::endl;
3457 if ( !( ( ( (this->_xRange-this->_maxExtraCellularSpace) * (this->_yRange-this->_maxExtraCellularSpace) * (this->_zRange-this->_maxExtraCellularSpace) ) > volThreMin ) &&
3458 ( ( (this->_xRange-this->_maxExtraCellularSpace) * (this->_yRange-this->_maxExtraCellularSpace) * (this->_zRange-this->_maxExtraCellularSpace) ) < volThreMax ) ) )
3461 this->_mapResolution = -999.9;
3465 this->_realSHCoeffs =
new double* [this->_noShellsWithData];
3466 for (
unsigned int i = 0; i < this->_noShellsWithData; i++ ) { this->_realSHCoeffs[i] =
new double [this->_oneDimmension * this->_oneDimmension]; }
3467 this->_imagSHCoeffs =
new double* [this->_noShellsWithData];
3468 for (
unsigned int i = 0; i < this->_noShellsWithData; i++ ) { this->_imagSHCoeffs[i] =
new double [this->_oneDimmension * this->_oneDimmension]; }
3471 for (
unsigned int sh = 0; sh < this->_noShellsWithData; sh++ )
3473 for (
unsigned int arrIt = 0; arrIt < ( this->_oneDimmension * this->_oneDimmension ); arrIt++ )
3475 dbFile->read ( reinterpret_cast<char*> ( &this->_realSHCoeffs[sh][arrIt] ),
sizeof (
double ) );
3476 dbFile->read ( reinterpret_cast<char*> ( &this->_imagSHCoeffs[sh][arrIt] ),
sizeof (
double ) );
3481 std::cout <<
">>>>>>>> Spherical harmonics loaded." << std::endl;
3485 this->_rrpMatrices =
new double** [this->_bandwidthLimit];
3486 for (
unsigned int bwIt = 0; bwIt < this->_bandwidthLimit; bwIt++ )
3489 if ( !this->_keepOrRemove ) {
if ( ( bwIt % 2 ) != 0 ) {
continue; } }
3491 this->_rrpMatrices[bwIt] =
new double* [this->_noShellsWithData];
3492 for (
unsigned int shIt = 0; shIt < this->_noShellsWithData; shIt++ )
3494 this->_rrpMatrices[bwIt][shIt] =
new double [this->_noShellsWithData];
3499 for (
unsigned int bwIt = 0; bwIt < this->_bandwidthLimit; bwIt++ )
3502 if ( !this->_keepOrRemove ) {
if ( ( bwIt % 2 ) != 0 ) {
continue; } }
3504 for (
unsigned int sh1 = 0; sh1 < this->_noShellsWithData; sh1++ )
3506 for (
unsigned int sh2 = 0; sh2 < this->_noShellsWithData; sh2++ )
3508 dbFile->read ( reinterpret_cast<char*> ( &this->_rrpMatrices[bwIt][sh1][sh2] ),
sizeof (
double ) );
3514 std::cout <<
">>>>>>>> RRP Matrices loaded." << std::endl;
3518 if ( saveWithAndWithout )
3520 if ( this->_usePhase )
3522 dbFile->read ( reinterpret_cast<char*> ( &this->_xFrom ),
sizeof (
double ) );
3523 dbFile->read ( reinterpret_cast<char*> ( &this->_xTo ),
sizeof (
double ) );
3524 dbFile->read ( reinterpret_cast<char*> ( &this->_yFrom ),
sizeof (
double ) );
3525 dbFile->read ( reinterpret_cast<char*> ( &this->_yTo ),
sizeof (
double ) );
3526 dbFile->read ( reinterpret_cast<char*> ( &this->_zFrom ),
sizeof (
double ) );
3527 dbFile->read ( reinterpret_cast<char*> ( &this->_zTo ),
sizeof (
double ) );
3529 this->_densityMapCor =
new double [(this->_maxMapU+1) * (this->_maxMapV+1) * (this->_maxMapW+1)];
3530 for (
unsigned int mIt = 0; mIt < static_cast<unsigned int> ( (this->_maxMapU+1) * (this->_maxMapV+1) * (this->_maxMapW+1) ); mIt++ )
3532 dbFile->read ( reinterpret_cast<char*> ( &this->_densityMapCor[mIt] ),
sizeof (
double ) );
3537 this->_xSamplingRate = this->_xRange /
static_cast<double> ( this->_maxMapU );
3538 this->_ySamplingRate = this->_yRange /
static_cast<double> ( this->_maxMapV );
3539 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.