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++ )
79 &shSpacing.at ( strIt ),
81 &bandVec.at ( strIt ),
82 &thetaVec.at ( strIt ),
84 &glIntegVec.at ( strIt ),
85 &extraVec.at ( strIt ),
95 &shSpacing.at ( strIt ),
97 &bandVec.at ( strIt ),
98 &thetaVec.at ( strIt ),
100 &glIntegVec.at ( strIt ),
101 &extraVec.at ( strIt ),
113 strRadii.emplace_back ( hlpArr );
117 maxRange = std::max ( str->getMapXRange ( ), std::max ( str->getMapYRange ( ), str->getMapZRange ( ) ) );
118 if ( maxRange == str->getMapXRange ( ) )
120 secRange = std::max ( str->getMapYRange ( ), str->getMapZRange ( ) );
122 else if ( maxRange == str->getMapYRange ( ) )
124 secRange = std::max ( str->getMapXRange ( ), str->getMapZRange ( ) );
128 secRange = std::max ( str->getMapXRange ( ), str->getMapYRange ( ) );
132 hlpArr[1] = sqrt ( pow ( maxRange, 2.0 ) + pow ( secRange, 2.0 ) );
133 strRadii.emplace_back ( hlpArr );
141 std::sort ( strRadii.begin (), strRadii.end(), [](
const std::array<double,2>& a,
const std::array<double,2>& b) {
return a[1] > b[1]; } );
144 double minSpacing = std::numeric_limits<double>::infinity ( );
145 unsigned int maxBand = 0;
146 unsigned int maxTheta = 0;
147 unsigned int maxPhi = 0;
148 unsigned int maxGlInt = 0;
149 double maxExtraSpace = 0.0;
150 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( setUp->
structFiles.size ( ) ); iter++ )
152 if ( shSpacing.at ( iter ) < minSpacing ) { minSpacing = shSpacing.at ( iter ); }
153 if ( bandVec.at ( iter ) > maxBand ) { maxBand = bandVec.at ( iter ); }
154 if ( thetaVec.at ( iter ) > maxTheta ) { maxTheta = thetaVec.at ( iter ); }
155 if ( phiVec.at ( iter ) > maxPhi ) { maxPhi = phiVec.at ( iter ); }
156 if ( glIntegVec.at ( iter ) > maxGlInt ) { maxGlInt = glIntegVec.at ( iter ); }
157 if ( extraVec.at ( iter ) > maxExtraSpace) { maxExtraSpace = extraVec.at ( iter ); }
160 double minSpacingCopy = minSpacing;
161 unsigned int maxBandCopy = maxBand;
162 unsigned int maxThetaCopy = maxTheta;
163 unsigned int maxPhiCopy = maxPhi;
164 unsigned int maxGlIntCopy = maxGlInt;
165 double maxExtraSpaceCopy = maxExtraSpace;
173 setUp->
theta = maxTheta;
250 for (
unsigned int strIt = 0; strIt < static_cast<unsigned int> ( strRadii.size ( ) ); strIt++ )
256 std::vector<ProSHADE_internal::ProSHADE_data*> frags = inMap->
fragmentMap ( setUp,
false );
259 for (
unsigned int frIt = 0; frIt < static_cast<unsigned int> ( frags.size() ); frIt++ )
262 std::stringstream frgName;
263 frgName <<
"proshade_tmp_frag" << strIt <<
"_" << frIt <<
".map";
265 dbCompSetUp->
structFiles.emplace_back ( frgName.str() );
268 frags.at(frIt)->writeMap ( frgName.str(), frags.at(frIt)->getMap ( ) );
281 for (
int i = 0; i < static_cast<int> ( crossCorrDists.size() ); i++ )
285 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() );
290 std::cout <<
" ... " << std::endl; exit (0);
293 for (
unsigned int iter = 0; iter < static_cast<unsigned int> ( frags.size ( ) ); iter++ )
295 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 modelRadius(std::string modelPath)
Miscellanous function for obtaining the maximum distance between atoms in a model file...
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.