21 #include "../proshade/ProSHADE.h" 22 #include "../proshade/ProSHADE_internal.h" 25 int main (
int argc,
char **argv )
34 std::string mapName =
"../xx_searchMap_data/02/emd_7780.map";
35 setUp->
structFiles.emplace_back (
"../xx_searchMap_data/02/ChainA.pdb" );
56 std::vector<std::array<double,2> > strRadii;
59 std::vector<unsigned int> thetaVec ( setUp->
structFiles.size(), setUp->
theta );
60 std::vector<unsigned int> phiVec ( setUp->
structFiles.size(), setUp->
phi );
63 std::array<double,2> hlpArr;
65 double maxRange = 0.0;
66 double secRange = 0.0;
69 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( setUp->
structFiles.size ( ) ); strIt++ )
78 &shSpacing.at ( strIt ),
80 &bandVec.at ( strIt ),
81 &thetaVec.at ( strIt ),
83 &glIntegVec.at ( strIt ),
84 &extraVec.at ( strIt ),
94 &shSpacing.at ( strIt ),
96 &bandVec.at ( strIt ),
97 &thetaVec.at ( strIt ),
99 &glIntegVec.at ( strIt ),
100 &extraVec.at ( strIt ),
108 maxRange = std::max ( str->getMapXRange ( ), std::max ( str->getMapYRange ( ), str->getMapZRange ( ) ) );
109 if ( maxRange == str->getMapXRange ( ) )
111 secRange = std::max ( str->getMapYRange ( ), str->getMapZRange ( ) );
113 else if ( maxRange == str->getMapYRange ( ) )
115 secRange = std::max ( str->getMapXRange ( ), str->getMapZRange ( ) );
119 secRange = std::max ( str->getMapXRange ( ), str->getMapYRange ( ) );
123 hlpArr[1] = sqrt ( pow ( maxRange, 2.0 ) + pow ( secRange, 2.0 ) );
124 strRadii.emplace_back ( hlpArr );
131 std::sort ( strRadii.begin (), strRadii.end(), [](
const std::array<double,2>& a,
const std::array<double,2>& b) {
return a[1] > b[1]; } );
134 double minSpacing = std::numeric_limits<double>::infinity ( );
135 unsigned int maxBand = 0;
136 unsigned int maxTheta = 0;
137 unsigned int maxPhi = 0;
138 unsigned int maxGlInt = 0;
139 double maxExtraSpace = 0.0;
140 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( setUp->
structFiles.size ( ) ); iter++ )
142 if ( shSpacing.at ( iter ) < minSpacing ) { minSpacing = shSpacing.at ( iter ); }
143 if ( bandVec.at ( iter ) > maxBand ) { maxBand = bandVec.at ( iter ); }
144 if ( thetaVec.at ( iter ) > maxTheta ) { maxTheta = thetaVec.at ( iter ); }
145 if ( phiVec.at ( iter ) > maxPhi ) { maxPhi = phiVec.at ( iter ); }
146 if ( glIntegVec.at ( iter ) > maxGlInt ) { maxGlInt = glIntegVec.at ( iter ); }
147 if ( extraVec.at ( iter ) > maxExtraSpace) { maxExtraSpace = extraVec.at ( iter ); }
150 double minSpacingCopy = minSpacing;
151 unsigned int maxBandCopy = maxBand;
152 unsigned int maxThetaCopy = maxTheta;
153 unsigned int maxPhiCopy = maxPhi;
154 unsigned int maxGlIntCopy = maxGlInt;
155 double maxExtraSpaceCopy = maxExtraSpace;
163 setUp->
theta = maxTheta;
240 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( strRadii.size ( ) ); strIt++ )
246 std::vector<ProSHADE_internal::ProSHADE_data*> frags = inMap->
fragmentMap ( setUp,
false );
249 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
252 std::stringstream frgName;
253 frgName <<
"proshade_tmp_frag" << strIt <<
"_" << frIt <<
".map";
255 dbCompSetUp->
structFiles.emplace_back ( frgName.str() );
258 frags.at(frIt)->writeMap ( frgName.str(), frags.at(frIt)->getMap ( ) );
271 for (
int i = 0; i < static_cast<int> ( crossCorrDists.size() ); i++ )
275 printf (
"%i\t%i\t||\t%+.3f\t\t%+.3f\t\t%+.3f\t\t%s\n", strIt, frIt, crossCorrDists.at(i), traceSigmaDists.at(i), rotFunDists.at(i), dbCompSetUp->
structFiles.at(i+1).c_str() );
280 std::cout <<
" ... " << std::endl; exit (0);
283 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( frags.size ( ) ); iter++ )
285 delete frags.at(iter);
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...
std::vector< double > getRotFunctionDists(void)
Accessor function for the rotation function based distances vector.
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.
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...
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) ...
bool saveWithAndWithout
This option decides whether both with and without phase spherical harmonics should be saved...
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 fullRotFnDist
Should the full rotation function distances descriptor be computed.
bool maskBlurFactorGiven
Was a specific value of the blurring factor requested by the user?
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 volumeTolerance
The percentage tolerance on each dimmension when comparing one structure to entire database...
std::vector< double > getTraceSigmaDists(void)
Accessor function for the trace sigma distances vector.
bool mapResDefault
This variable states if default resolution should be used, or whether the user has supplied a differe...
bool traceSigmaDist
Should the trace sigma distances descriptor be computed.
std::vector< 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...
unsigned int phi
This parameter is the latitudd of the spherical grid mapping. It should be 2 * bandwidth unless there...
bool energyLevelDist
Should the energy level distances descriptor be computed.
double bFactorChange
This value will be used to change the B-factors if required by the user.
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.
double mapFragBoxSize
Should the clear map be fragmented into boxes? If so, put box size here, otherwise leave 0...
This class stores all the settings and is passed to the executive classes instead of multitude of par...
unsigned int manualShells
Should the user require so, the maximum number of radial shells can be set.
std::vector< double > getCrossCorrDists(void)
Accessor function for the cross-correlation distances vector.
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).
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.