![]() |
ProSHADE
0.7.6.0 (JUL 2021)
Protein Shape Detection
|
This namespace contains the internal input/output functions. None of these should be directly accessed by the user. More...
Enumerations | |
enum | InputType { UNKNOWN, PDB, MAP } |
Functions | |
InputType | figureDataType (std::string fName) |
Function determining input data type. More... | |
bool | isFilePDB (std::string fName) |
Function determining if the input data type is PDB. More... | |
bool | isFileMAP (std::string fName) |
Function determining if the input data type is MAP. More... | |
void | readInMapHeader (gemmi::Ccp4< float > *map, proshade_unsign *xDimInds, proshade_unsign *yDimInds, proshade_unsign *zDimInds, proshade_single *xDim, proshade_single *yDim, proshade_single *zDim, proshade_single *aAng, proshade_single *bAng, proshade_single *cAng, proshade_signed *xFrom, proshade_signed *yFrom, proshade_signed *zFrom, proshade_signed *xAxOrigin, proshade_signed *yAxOrigin, proshade_signed *zAxOrigin, proshade_unsign *xAxOrder, proshade_unsign *yAxOrder, proshade_unsign *zAxOrder, proshade_unsign *xGridInds, proshade_unsign *yGridInds, proshade_unsign *zGridInds) |
This function parses the CCP4 MAP file header as read in by gemmi. More... | |
void | readInMapData (gemmi::Ccp4< float > *gemmiMap, proshade_double *&map, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_unsign xAxOrder, proshade_unsign yAxOrder, proshade_unsign zAxOrder) |
This function converts the gemmi Ccp4 object data to ProSHADE internal map representation. More... | |
void | readInMapData (gemmi::Ccp4< int8_t > *gemmiMap, proshade_double *&map, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_unsign xAxOrder, proshade_unsign yAxOrder, proshade_unsign zAxOrder) |
This function converts the gemmi Ccp4 object data to ProSHADE mask representation. More... | |
void | writeOutMapHeader (gemmi::Ccp4< float > *map, proshade_unsign xDimInds, proshade_unsign yDimInds, proshade_unsign zDimInds, proshade_single xDim, proshade_single yDim, proshade_single zDim, proshade_single aAng, proshade_single bAng, proshade_single cAng, proshade_signed xFrom, proshade_signed yFrom, proshade_signed zFrom, proshade_signed xAxOrigin, proshade_signed yAxOrigin, proshade_signed zAxOrigin, proshade_unsign xAxOrder, proshade_unsign yAxOrder, proshade_unsign zAxOrder, proshade_unsign xGridInds, proshade_unsign yGridInds, proshade_unsign zGridInds, std::string title, int mode) |
This function parses the CCP4 MAP file header as read in by gemmi. More... | |
void | writeRotationTranslationJSON (proshade_double trsX1, proshade_double trsY1, proshade_double trsZ1, proshade_double eulA, proshade_double eulB, proshade_double eulG, proshade_double trsX2, proshade_double trsY2, proshade_double trsZ2, std::string fileName) |
Function for writing out the optimal rotation and translation into a JSON file. More... | |
This namespace contains the internal input/output functions. None of these should be directly accessed by the user.
The ProSHADE_internal_io namespace contains the helper functions for the data input and output. These should never be directly used by the user and these only serve to allow for self-documenting nature of the code. They are called internally by more advanced functions from the higher complexity classes.
ProSHADE_internal_io::InputType ProSHADE_internal_io::figureDataType | ( | std::string | fName | ) |
Function determining input data type.
This function determines the type of the input structure. The possible outputs are MAP for MRC map files, PDB for mmCIF or PDB formatted data, or UNKNOWN if gemmi fail to read the file as co-ordinates as well as map.
[in] | fName | The file name of the file for which the type should be determined. |
[out] | X | ProSHADE InputType variable with values UNKNOWN, MAP or PDB depending on the type of the input file. |
Definition at line 356 of file ProSHADE_io.cpp.
bool ProSHADE_internal_io::isFileMAP | ( | std::string | fName | ) |
Function determining if the input data type is MAP.
This function checks if the input file is a MAP file and can be read by the CMAP library.
[in] | fName | The file name of the file for which the type should be determined. |
[out] | X | Bool value true if the file is a MAP file readable by CMAP and false otherwise. |
Definition at line 60 of file ProSHADE_io.cpp.
bool ProSHADE_internal_io::isFilePDB | ( | std::string | fName | ) |
Function determining if the input data type is PDB.
This function checks if the input file is a PDB file and can be read by the gemmi library.
[in] | fName | The file name of the file for which the type should be determined. |
[out] | X | Bool value true if the file is a PDB file readable by gemmi and false otherwise. |
Definition at line 32 of file ProSHADE_io.cpp.
void ProSHADE_internal_io::readInMapData | ( | gemmi::Ccp4< float > * | gemmiMap, |
proshade_double *& | map, | ||
proshade_unsign | xDimInds, | ||
proshade_unsign | yDimInds, | ||
proshade_unsign | zDimInds, | ||
proshade_unsign | xAxOrder, | ||
proshade_unsign | yAxOrder, | ||
proshade_unsign | zAxOrder | ||
) |
This function converts the gemmi Ccp4 object data to ProSHADE internal map representation.
This function firstly allocates the required memory for the ProSHADE internal map representation variable according to the grid size. Then, it iterates over the axes in such a way, so that the resulting ProSHADE variable would have XYZ axis order independently on the axis order of the Ccp4 gemmi object. This should not be necessary as the gemmi setup function should have been called by now, but one never knows.
[in] | gemmiMap | Pointer to a gemmi Ccp4 object containing the read in MAP file information. |
[in] | map | Pointer reference to a variable to save the map data. |
[in] | xDimInds | The size of x dimension in indices. |
[in] | yDimInds | The size of y dimension in indices. |
[in] | zDimInds | The size of z dimension in indices. |
[in] | xAxOrder | The order of the x-axis. |
[in] | yAxOrder | The order of the y-axis. |
[in] | zAxOrder | The order of the z-axis. |
Definition at line 178 of file ProSHADE_io.cpp.
void ProSHADE_internal_io::readInMapData | ( | gemmi::Ccp4< int8_t > * | gemmiMap, |
proshade_double *& | map, | ||
proshade_unsign | xDimInds, | ||
proshade_unsign | yDimInds, | ||
proshade_unsign | zDimInds, | ||
proshade_unsign | xAxOrder, | ||
proshade_unsign | yAxOrder, | ||
proshade_unsign | zAxOrder | ||
) |
This function converts the gemmi Ccp4 object data to ProSHADE mask representation.
This function firstly allocates the required memory for the ProSHADE mask representation variable according to the grid size. Then, it iterates over the axes in such a way, so that the resulting ProSHADE variable would have XYZ axis order independently on the axis order of the Ccp4 gemmi object. This should not be necessary as the gemmi setup function should have been called by now, but one never knows.
[in] | gemmiMap | Pointer to a gemmi Ccp4 object containing the read in mask file information. |
[in] | map | Pointer reference to a variable to save the map data. |
[in] | xDimInds | The size of x dimension in indices. |
[in] | yDimInds | The size of y dimension in indices. |
[in] | zDimInds | The size of z dimension in indices. |
[in] | xAxOrder | The order of the x-axis. |
[in] | yAxOrder | The order of the y-axis. |
[in] | zAxOrder | The order of the z-axis. |
Definition at line 234 of file ProSHADE_io.cpp.
void ProSHADE_internal_io::readInMapHeader | ( | gemmi::Ccp4< float > * | map, |
proshade_unsign * | xDimInds, | ||
proshade_unsign * | yDimInds, | ||
proshade_unsign * | zDimInds, | ||
proshade_single * | xDim, | ||
proshade_single * | yDim, | ||
proshade_single * | zDim, | ||
proshade_single * | aAng, | ||
proshade_single * | bAng, | ||
proshade_single * | cAng, | ||
proshade_signed * | xFrom, | ||
proshade_signed * | yFrom, | ||
proshade_signed * | zFrom, | ||
proshade_signed * | xAxOrigin, | ||
proshade_signed * | yAxOrigin, | ||
proshade_signed * | zAxOrigin, | ||
proshade_unsign * | xAxOrder, | ||
proshade_unsign * | yAxOrder, | ||
proshade_unsign * | zAxOrder, | ||
proshade_unsign * | xGridInds, | ||
proshade_unsign * | yGridInds, | ||
proshade_unsign * | zGridInds | ||
) |
This function parses the CCP4 MAP file header as read in by gemmi.
This function uses the gemmi Ccp4 object, which contains all the information read in from a MAP file (including the header), to parse out the ProSHADE required information from the header and saving it to the supplied variables.
[in] | map | A gemmi Ccp4 objecct containing all the data read in from a MAP file. |
[in] | xDimInds | Address to a variable to save the x-axis size in indices. |
[in] | yDimInds | Address to a variable to save the y-axis size in indices. |
[in] | zDimInds | Address to a variable to save the z-axis size in indices. |
[in] | xDim | Address to a variable to save the x dimension size in angstroms. |
[in] | yDim | Address to a variable to save the y dimension size in angstroms. |
[in] | zDim | Address to a variable to save the z dimension size in angstroms. |
[in] | aAng | Address to a variable to save the a angle in degrees. |
[in] | bAng | Address to a variable to save the b angle in degrees. |
[in] | cAng | Address to a variable to save the c angle in degrees. |
[in] | xFrom | Address to a variable to save the starting index along the x-axis. |
[in] | yFrom | Address to a variable to save the starting index along the y-axis. |
[in] | zFrom | Address to a variable to save the starting index along the z-axis. |
[in] | xAxOrigin | Address to a variable to save the map origin positon along the x-axis. |
[in] | yAxOrigin | Address to a variable to save the map origin positon along the y-axis. |
[in] | zAxOrigin | Address to a variable to save the map origin positon along the z-axis. |
[in] | xAxOrder | Address to a variable to save the order of x axis. |
[in] | yAxOrder | Address to a variable to save the order of y axis. |
[in] | zAxOrder | Address to a variable to save the order of z axis. |
[in] | xGridInds | Address to a variable to save the grid indices count along the x-axis. |
[in] | yGridInds | Address to a variable to save the grid indices count along the y-axis. |
[in] | zGridInds | Address to a variable to save the grid indices count along the z-axis. |
Definition at line 109 of file ProSHADE_io.cpp.
void ProSHADE_internal_io::writeOutMapHeader | ( | gemmi::Ccp4< float > * | map, |
proshade_unsign | xDimInds, | ||
proshade_unsign | yDimInds, | ||
proshade_unsign | zDimInds, | ||
proshade_single | xDim, | ||
proshade_single | yDim, | ||
proshade_single | zDim, | ||
proshade_single | aAng, | ||
proshade_single | bAng, | ||
proshade_single | cAng, | ||
proshade_signed | xFrom, | ||
proshade_signed | yFrom, | ||
proshade_signed | zFrom, | ||
proshade_signed | xAxOrigin, | ||
proshade_signed | yAxOrigin, | ||
proshade_signed | zAxOrigin, | ||
proshade_unsign | xAxOrder, | ||
proshade_unsign | yAxOrder, | ||
proshade_unsign | zAxOrder, | ||
proshade_unsign | xGridInds, | ||
proshade_unsign | yGridInds, | ||
proshade_unsign | zGridInds, | ||
std::string | title, | ||
int | mode | ||
) |
This function parses the CCP4 MAP file header as read in by gemmi.
This function uses the gemmi Ccp4 object, which contains all the information read in from a MAP file (including the header), to parse out the ProSHADE required information from the header and saving it to the supplied variables.
[in] | map | A gemmi Ccp4 objecct containing all the data read in from a MAP file. |
[in] | xDimInds | Variable holding the x-axis size in indices. |
[in] | yDimInds | Variable holding the y-axis size in indices. |
[in] | zDimInds | Variable holding the z-axis size in indices. |
[in] | xDim | Variable holding the x dimension size in angstroms. |
[in] | yDim | Variable holding the y dimension size in angstroms. |
[in] | zDim | Variable holding the z dimension size in angstroms. |
[in] | aAng | Variable holding the a angle in degrees. |
[in] | bAng | Variable holding the b angle in degrees. |
[in] | cAng | Variable holding the c angle in degrees. |
[in] | xFrom | Variable holding the starting index along the x-axis. |
[in] | yFrom | Variable holding the starting index along the y-axis. |
[in] | zFrom | Variable holding the starting index along the z-axis. |
[in] | xAxOrigin | Variable holding the map origin positon along the x-axis. |
[in] | yAxOrigin | Variable holding the map origin positon along the y-axis. |
[in] | zAxOrigin | Variable holding the map origin positon along the z-axis. |
[in] | xAxOrder | Variable holding the order of x axis. |
[in] | yAxOrder | Variable holding the order of y axis. |
[in] | zAxOrder | Variable holding the order of z axis. |
[in] | xGridInds | Variable holding the grid indices count along the x-axis. |
[in] | yGridInds | Variable holding the grid indices count along the y-axis. |
[in] | zGridInds | Variable holding the grid indices count along the z-axis. |
[in] | title | The title to be written into the MAP file. |
[in] | mode | The variable type of the data, please leave two (float) unless you require any specific other mode. |
Definition at line 306 of file ProSHADE_io.cpp.
void ProSHADE_internal_io::writeRotationTranslationJSON | ( | proshade_double | trsX1, |
proshade_double | trsY1, | ||
proshade_double | trsZ1, | ||
proshade_double | eulA, | ||
proshade_double | eulB, | ||
proshade_double | eulG, | ||
proshade_double | trsX2, | ||
proshade_double | trsY2, | ||
proshade_double | trsZ2, | ||
std::string | fileName | ||
) |
Function for writing out the optimal rotation and translation into a JSON file.
This function takes the initial translation (assuming that the centre of rotation is not at the centre of indices), the rotation (in terms of the Euler angles) and the translation detected by the overlay task and proceeds to write a JSON file containing all of these information in the order in which they should be applied with the exception that depending on around which point the rotation should be done, either the translation to origin or to the map centre should be applied.
This function assumes that the second translation includes the reverse of the first translation already.
[in] | trsX1 | The translation required to get the rotation centre to origin along the x-axis. |
[in] | trsY1 | The translation required to get the rotation centre to origin along the y-axis. |
[in] | trsZ1 | The translation required to get the rotation centre to origin along the z-axis. |
[in] | eulA | The optimal rotation Euler angle alpha. |
[in] | eulB | The optimal rotation Euler angle beta. |
[in] | eulG | The optimal rotation Euler angle gamma. |
[in] | trsX2 | The optimal translation along the x-axis + reverse of the trsX1. |
[in] | trsY2 | The optimal translation along the y-axis + reverse of the trsY1. |
[in] | trsZ2 | The optimal translation along the z-axis + reverse of the trsZ1. |
[in] | fileName | The file name of the file for which the information should be written into. |
Definition at line 398 of file ProSHADE_io.cpp.