ProSHADE  0.6.5 (NOV 2018)
Protein Shape Descriptors and Symmetry Detection
All Classes Namespaces Files Functions Variables Pages
getDatabaseDistances.cpp
1 
15 //============================================ ProSHADE
16 #include "../proshade/ProSHADE.h"
17 
18 //============================================ Main
19 int main ( int argc,
20  char **argv )
21 {
22  //======================================== Default settings
24 
25  // Settings regarding which distances to compute
26  setUp->energyLevelDist = true;
27  setUp->traceSigmaDist = true;
28  setUp->fullRotFnDist = true;
29 
30  // Settings regarding hierarchical distance computation
31  setUp->enLevelsThreshold = -999.9;
32  setUp->trSigmaThreshold = -999.9;
33 
34  // ... Settings regarding the task
35  setUp->taskToPerform = ProSHADE::Distances;
36 
37  // Settings regarding the database
38  setUp->databaseName = "";
39  setUp->volumeTolerance = 0.4;
40  setUp->clearMapData = false;
41 
42  // ... Settings regarding loudness
43  setUp->verbose = -1;
44  setUp->htmlReport = false;
45 
46  //======================================== Get files
47  if ( argc != 3 )
48  {
49  std::cout << std::endl << "Usage: useDatabase [dbName] [filename1] to get distances from [filename1] to all files in the database." << std::endl << std::endl;
50  exit ( 0 );
51  }
52  else
53  {
54  setUp->databaseName = std::string ( argv[1] );
55  setUp->structFiles.emplace_back ( std::string ( argv[2] ) );
56  }
57 
58  //======================================== Run ProSHADE
59  ProSHADE::ProSHADE *run = new ProSHADE::ProSHADE ( setUp );
60 
61  //======================================== Get results
62  std::vector<double> crossCorrDists = run->getCrossCorrDists ( );
63  std::vector<double> traceSigmaDists = run->getTraceSigmaDists ( );
64  std::vector<double> rotFunDists = run->getRotFunctionDists ( );
65 
66  //======================================== Print results
67  printf ( "ProSHADE library version: %s\n\n", run->getProSHADEVersion().c_str() );
68 
69  if ( crossCorrDists.size() > 0 )
70  {
71  printf ( "Energy Level Descriptor distances : %+.5f", crossCorrDists.at(0) );
72  for ( unsigned int iter = 1; iter < static_cast<unsigned int> ( crossCorrDists.size() ); iter++ )
73  {
74  printf ( "\t%+.4f", crossCorrDists.at(iter) );
75  }
76  printf ( "\n" );
77  }
78  else
79  {
80  std::cerr << "!!! Error !!! ProSHADE failed to obtain distances, please see the standard error stream for details. Did you set the energyLevelDist settings to false? Terminating..." << std::endl;
81  exit ( -1 );
82  }
83 
84  if ( traceSigmaDists.size() > 0 )
85  {
86  printf ( "Trace Sigma Descriptor distances : %+.5f", traceSigmaDists.at(0) );
87  for ( unsigned int iter = 1; iter < static_cast<unsigned int> ( traceSigmaDists.size() ); iter++ )
88  {
89  printf ( "\t%+.4f", traceSigmaDists.at(iter) );
90  }
91  printf ( "\n" );
92  }
93  else
94  {
95  std::cerr << "!!! Error !!! ProSHADE failed to obtain distances, please see the standard error stream for details. Did you set the traceSigmaDist settings to false? Terminating..." << std::endl;
96  exit ( -1 );
97  }
98 
99  if ( rotFunDists.size() > 0 )
100  {
101  printf ( "Rotation Function Descriptor distances : %+.5f", rotFunDists.at(0) );
102  for ( unsigned int iter = 1; iter < static_cast<unsigned int> ( rotFunDists.size() ); iter++ )
103  {
104  printf ( "\t%+.4f", rotFunDists.at(iter) );
105  }
106  printf ( "\n" );
107  }
108  else
109  {
110  std::cerr << "!!! Error !!! ProSHADE failed to obtain distances, please see the standard error stream for details. Did you set the fullRotFnDist settings to false? Terminating..." << std::endl;
111  exit ( -1 );
112  }
113 
114  for ( unsigned int iter = 1; iter < static_cast<unsigned int> ( setUp->structFiles.size() ); iter++ )
115  {
116  printf ( "Matching structure names : %40s vs. %-40s\n", setUp->structFiles.at(0).c_str(), setUp->structFiles.at(iter).c_str() );
117  }
118  std::cout << std::endl;
119 
120  //======================================== Free memory
121  delete setUp;
122  delete run;
123 
124  //======================================== Done
125  return 0;
126 }
127 
std::vector< double > getRotFunctionDists(void)
Accessor function for the rotation function based distances vector.
Definition: ProSHADE.cpp:3011
bool clearMapData
This value is used to decide whether the input maps should be cleared again, or not.
Definition: ProSHADE.h:146
std::string databaseName
The name of the bin file to which the database should be saved.
Definition: ProSHADE.h:156
bool htmlReport
Should HTML report for the run be created?
Definition: ProSHADE.h:186
int verbose
Should the software report on the progress, or just be quiet? Value between 0 (quiet) and 4 (loud) ...
Definition: ProSHADE.h:189
std::string getProSHADEVersion(void)
Miscellanous function allowing the user to get the ProSHADE version.
Definition: ProSHADE.cpp:2910
double trSigmaThreshold
All structure pairs with trace sigma descriptor value less than this will not be subjected to any fur...
Definition: ProSHADE.h:138
bool fullRotFnDist
Should the full rotation function distances descriptor be computed.
Definition: ProSHADE.h:134
double volumeTolerance
The percentage tolerance on each dimmension when comparing one structure to entire database...
Definition: ProSHADE.h:159
std::vector< double > getTraceSigmaDists(void)
Accessor function for the trace sigma distances vector.
Definition: ProSHADE.cpp:2985
bool traceSigmaDist
Should the trace sigma distances descriptor be computed.
Definition: ProSHADE.h:133
bool energyLevelDist
Should the energy level distances descriptor be computed.
Definition: ProSHADE.h:132
This class stores all the settings and is passed to the executive classes instead of multitude of par...
Definition: ProSHADE.h:74
std::vector< double > getCrossCorrDists(void)
Accessor function for the cross-correlation distances vector.
Definition: ProSHADE.cpp:2959
std::vector< std::string > structFiles
This vector should contain all the structures that are being dealt with, but this does not yet work! ...
Definition: ProSHADE.h:120
double enLevelsThreshold
All structure pairs with energy level descriptor value less than this will not be subjected to any fu...
Definition: ProSHADE.h:137
Task taskToPerform
This custom type variable determines which task to perfom (i.e. symmetry detection, distances computation or map features extraction).
Definition: ProSHADE.h:141