The pdb_eda API Reference¶
Electron Density Analysis¶
PDB Electron Density Analysis (pdb_eda.densityAnalysis)¶
This module provides methods for the creation of the pdb_eda.densityAnalysis
class given a PDB id,
along with methods to analyze its 2Fo-Fc and Fo-Fc electron density maps.
-
pdb_eda.densityAnalysis.
setGlobals
(params)[source]¶ Sets global parameters. Typically used for optimizing parameters.
Parameters: params ( dict
) – dictionary of parameters needed for pdb_eda calculations.
-
pdb_eda.densityAnalysis.
loadF000Parameters
()[source]¶ Loads and assigns global parameters needed for F000 estimation.
-
pdb_eda.densityAnalysis.
fromPDBid
(pdbid, ccp4density=True, ccp4diff=True, pdbbio=True, pdbi=True, downloadFile=True, mmcif=False)[source]¶ Creates
pdb_eda.densityAnalysis.DensityAnalysis
object given the PDB id if the id is valid and the structure has electron density file available.Parameters: - pdbid (
str
) – PDB entry ID. - ccp4density (
bool
) – Whether to generate ccp4 density object, defaults toTrue
. - ccp4diff (
bool
) – Whether to generate in default of ccp4 difference density object, defaults toTrue
. - pdbbio (
bool
) – Whether to generate in default of bio.PDB object, defaults toTrue
. - pdbi (
bool
) – Whether to generate in default of PDB object, defaults toTrue
. - downloadFile (
bool
) – Whether to save the downloaded ccp4 density, ccp4 difference density, and PDB file, defaults toTrue
. - mmcif (
bool
) – Whether to download the mmCif file, defaults toFalse
.
Returns: densityAnalysis object
Return type: - pdbid (
-
pdb_eda.densityAnalysis.
fromFile
(pdbFile, ccp4DensityFile=None, ccp4DiffDensityFile=None)[source]¶ Creates
pdb_eda.densityAnalysis.DensityAnalysis
object given the appropriate PDB and CCP4 files.Parameters: Returns: densityAnalysis object
Return type:
-
pdb_eda.densityAnalysis.
cleanPDBid
(pdbid)[source]¶ Removes PDB entry, ccp4, and mmcif files associated with a PDB id.
Parameters: pdbid ( str
) – PDB entry ID.Returns: bool whether the operation was successful. Return type: bool
-
pdb_eda.densityAnalysis.
testCCP4URL
(pdbid)[source]¶ Test whether the pdbid has electron density maps by querying if the PDBe API has electron density statistics. :param pdbid: PDB entry ID. :type pdbid:
str
Returns: bool on test success. Return type: bool
-
class
pdb_eda.densityAnalysis.
DensityAnalysis
(pdbid, densityObj=None, diffDensityObj=None, biopdbObj=None, pdbObj=None)[source]¶ DensityAnalysis class that stores the density, difference density, bio.PDB, and PDB objects.
-
__init__
(pdbid, densityObj=None, diffDensityObj=None, biopdbObj=None, pdbObj=None)[source]¶ densityAnalysis initializer. Leave densityObj, diffDensityObj, biopdbObj and pdbObj as
None
to be created. They are not required for initialization but could be required for some methods.Parameters: - pdbid (
str
) – PDB entry ID. - densityObj (
pdb_eda.ccp4.DensityMatrix
, optional) – DensityMatrix object. - diffDensityObj (
pdb_eda.ccp4.DensityMatrix
, optional) – optional DensityMatrix object. - biopdbObj (
Bio.PDB.Structure.Structure
, optional) – optional Bio.PDB Structure object. - pdbObj (
pdb_eda.pdbParser.PDBentry
, optional) – optional PDBentry object.
- pdbid (
-
symmetryOnlyAtoms
¶ Returns list of non-[0,0,0,0] symmetry atoms.
Returns: symmetryAtoms Return type: list
-
symmetryAtomCoords
¶ Returns list of symmetry atom xyz coordinates.
Returns: symmetryAtomCoords Return type: list
-
symmetryOnlyAtomCoords
¶ Returns list of non-[0,0,0,0] symmetry atom xyz coordinates.
Returns: symmetryAtomCoords Return type: list
-
asymmetryAtomCoords
¶ Returns list of [0,0,0,0] symmetry atom xyz coordinates.
Returns: symmetryAtomCoords Return type: list
-
greenBlobList
¶ Returns list of all positive significant difference density blobs.
Returns: greenBlobList Return type: list
-
redBlobList
¶ Returns list of all negative significant difference density blobs.
Returns: redBlobList Return type: list
-
blueBlobList
¶ Returns list of all positive significant density blobs.
Returns: blueBlobList Return type: list
-
fc
¶ Returns the Fc map = 2Fo-Fc - Fo-Fc.
Returns: fc Return type: pdb_eda.ccp4.DensityMatrix
-
fo
¶ Returns the Fo map = 2Fo-Fc.
Returns: fo Return type: pdb_eda.ccp4.DensityMatrix
-
F000
¶ Returns estimated F000. This estimate may not be that accurate.
Returns: F000 Return type: float
-
medians
¶ Returns median field values calculated per atom type.
Returns: medians Return type: numpy.array
-
atomCloudDescriptions
¶ Returns aggregated atom cloud descriptions.
Returns: atomCloudDescriptions Return type: numpy.array
-
residueCloudDescriptions
¶ Returns aggregated residue cloud descriptions.
Returns: residueCloudDescriptions Return type: list
-
domainCloudDescriptions
¶ Returns aggregated domain cloud descriptions.
Returns: domainCloudDescriptions Return type: list
-
numVoxelsAggregated
¶ Returns number of aggregated voxels in cloud analysis.
Returns: numVoxelsAggregated Return type: int
-
totalAggregatedElectrons
¶ Returns total amount of aggregated electrons in cloud analysis.
Returns: totalAggregatedElectrons Return type: float
-
totalAggregatedDensity
¶ Returns total amount of aggregated density in cloud analysis.
Returns: totalAggregatedDensity Return type: float
-
densityElectronRatio
¶ Returns the density-electron ratio estimated from cloud analysis.
Returns: densityElectronRatio Return type: float
-
atomTypeOverlapCompleteness
¶ Returns atom-type overlap completeness counts.
Returns: atomTypeOverlapCompleteness Return type: dict
-
atomTypeOverlapIncompleteness
¶ Returns atom-type overlap incompleteness counts.
Returns: atomTypeOverlapIncompleteness Return type: dict
-
aggregateCloud
(minCloudElectrons=25.0, minTotalElectrons=400.0)[source]¶ Aggregate the electron density map clouds by atom, residue, and domain. Calculate and populate densityAnalysis.densityElectronRatio and densityAnalysis.medians data members.
Parameters:
-
medianAbsFoFc
()[source]¶ Calculates median absolute values for the Fo and Fc maps less than 1 sigma. These values should be comparable, i.e. low relative difference, for RSCC and RSR metric calculations.
Returns: tuple of median abs values from fo and fc maps respectively. Return type: tuple
-
residueMetrics
(residueList=None)[source]¶ RETURNS rscc and rsr statistics for each residue using the Fo and Fc density maps.
Parameters: residueList ( list
, optional) –Returns: results Return type: list
-
atomMetrics
(atomList=None)[source]¶ RETURNS rscc and rsr statistics for each residue using the Fo and Fc density maps.
Parameters: atomList ( list
, optional) –Returns: results Return type: list
-
calculateRsccRsrMetrics
(crsList)[source]¶ Calculates and returns RSCC and RSR metrics. This method of calculating RSCC and RSR assumes that the Fo and Fc maps are appropriately scaled. Comparison of median absolute values below one sigma should be quite similar between Fo and Fc maps.
Parameters: crsList ( list
,set
) –Returns: rscc_rsr_arrays_tuple Return type: tuple
-
_calculateSymmetryAtoms
()[source]¶ Calculate all the symmetry and nearby cells and keep those have at least on atom within 5 grid points of the non-repeating crs boundary. Ref: Biomolecular Crystallography: Principles, Practice, and Application to Structural Biology by Bernhard Rupp. Orthogonalization matrix O and deororthogonalization matrix O’ are from
pdb_eda.ccp4
object. Rotation matrix R and Translation matrix T is frompdb_eda.pdbParser
object. The neighbouring cells can be calculated using formula, X’ = O(O’(RX + T) + T’) = OO’(RX+T) + OT’ = RX + T + O[-1/0/1,-1/0/1,-1/0/1]. Assign the list ofpdb_eda.densityAnalysis.symAtom
instances to densityAnalysis.symmetryAtoms data member
-
calculateAtomSpecificBlobStatistics
(blobList)[source]¶ Calculate atom-specific blob statistics.
Parameters: blobList ( list
) – list of blobs to calculate statistics for.Return blobStats: Difference density map statistics. Return type: list
-
calculateAtomRegionDensity
(radius, numSD=1.5, type='', useOptimizedRadii=False)[source]¶ Calculates significant region density in a given radius of each atom.
Parameters: Return diffMapRegionStats: density map region statistics per atom.
Return type:
-
calculateSymmetryAtomRegionDensity
(radius, numSD=1.5, type='', useOptimizedRadii=False)[source]¶ Calculates significant region density in a given radius of each symmetry atom.
Parameters: Return diffMapRegionStats: density map region statistics per atom.
Return type:
-
calculateResidueRegionDensity
(radius, numSD=1.5, type='', atomMask=None, useOptimizedRadii=False)[source]¶ Calculates significant region density in a given radius of each residue.
Parameters: Return diffMapRegionStats: density map region statistics per residue.
Return type:
-
calculateRegionDensity
(xyzCoordList, radius, numSD=1.5, testValidCrs=False)[source]¶ Calculate region-specific density from the electron density matrix.
Parameters: - xyzCoordLists – single xyz coordinate or a list of xyz coordinates.
- radius (
float
orlist
) – the search radius or list of search radii. - numSD (
float
) – number of standard deviations of significance., defaults to 1.5 - testValidCrs (
bool
) – whether to test crs are valid and return the results., defaults toFalse
Return diffMapRegionStats: density map region statistics and optional validCrs result.
Return type:
-
calculateAtomRegionDiscrepancies
(radius, numSD=3.0, type='')[source]¶ Calculates significant region discrepancies in a given radius of each atom.
Parameters: Return diffMapRegionStats: Difference density map region statistics per atom.
Return type:
-
calculateSymmetryAtomRegionDiscrepancies
(radius, numSD=3.0, type='')[source]¶ Calculates significant region discrepancies in a given radius of each symmetry atom.
Parameters: Return diffMapRegionStats: Difference density map region statistics per atom.
Return type:
-
calculateResidueRegionDiscrepancies
(radius, numSD=3.0, type='', atomMask=None)[source]¶ Calculates significant region discrepancies in a given radius of each residue.
Parameters: Return diffMapRegionStats: Difference density map region statistics per residue.
Return type:
-
CCP4 Parser¶
CCP4 Parser (pdb_eda.ccp4)¶
This module provides methods to read and parse the CCP4 format files, returning ccp4 objects. Format details of ccp4 can be found in http://www.ccp4.ac.uk/html/maplib.html.
-
pdb_eda.ccp4.
readFromPDBID
(pdbid, verbose=False)[source]¶ Creates
pdb_eda.ccp4.DensityMatrix
object.Parameters: Returns: densityMatrix
Return type:
-
pdb_eda.ccp4.
readFromURL
(url, pdbid=None, verbose=False)[source]¶ Creates
pdb_eda.ccp4.DensityMatrix
object.Parameters: Returns: densityMatrix
Return type:
-
pdb_eda.ccp4.
read
(ccp4Filename, pdbid=None, verbose=False)[source]¶ Creates
pdb_eda.ccp4.DensityMatrix
object.Parameters: Returns: densityMatrix
Return type:
-
pdb_eda.ccp4.
parse
(handle, pdbid, verbose=False)[source]¶ Creates
pdb_eda.ccp4.DensityMatrix
object.Parameters: Returns: densityMatrix
Return type:
-
class
pdb_eda.ccp4.
DensityHeader
(headerTuple, labels, endian)[source]¶ pdb_eda.ccp4.DensityHeader
that stores information about ccp4 header.-
classmethod
fromFileHeader
(fileHeader)[source]¶ RETURNS
pdb_eda.ccp4.DensityHeader
object given the fileHeader.Parameters: fileHeader ( bytes
) – ccp4 file header.Returns: densityHeader Return type: pdb_eda.ccp4.DensityHeader
-
__init__
(headerTuple, labels, endian)[source]¶ Initialize the DensityHeader object, assign values to data members accordingly, and calculate some metrics that will be used frequently.
Parameters:
-
_calculateOrigin
()[source]¶ Calculate the xyz coordinates from the header information.
Returns: xyz coordinates. Return type: list
offloat
.
-
classmethod
-
class
pdb_eda.ccp4.
DensityMatrix
(header, origin, density, pdbid)[source]¶ pdb_eda.ccp4.DensityMatrix
that stores data and methods of a ccp4 file.-
__init__
(header, origin, density, pdbid)[source]¶ Initialize the
pdb_eda.ccp4.DensityMatrix
object.Parameters: - header (
pdb_eda.ccp4.DensityHeader
) – - origin (
list
) – the xyz coordinates of the origin of the first number of the density data. - density (
tuple
) – the density data as a 1-d list. - pdbid (
str
) – PDB entry ID
- header (
-
getTotalAbsDensity
(densityCutoff)[source]¶ Returns total absolute Density above a densityCutoff
Parameters: densityCutoff ( float
) –Returns: totalAbsDensity Return type: float
-
getPointDensityFromCrs
(crsCoord)[source]¶ Get the density of a point.
Parameters: crsCoord (A list
ofint
) – crs coordinates.Returns: pointDensity Return type: float
-
getPointDensityFromXyz
(xyzCoord)[source]¶ Get the density of a point.
Parameters: xyzCoord (A list
offloat
) – xyz coordinates.Returns: pointDensity Return type: float
-
getSphereCrsFromXyz
(xyzCoord, radius, densityCutoff=0)[source]¶ Calculate a list of crs coordinates that within a given distance of a point.
Parameters: - xyzCoord (A
list
offloat
) – xyz coordinates. - radius (
float
) – - densityCutoff (
float
) – a density cutoff for all the points wants to be included, defaults to 0 Default 0 means include every point within the radius. If cutoff < 0, include only points with density < cutoff. If cutoff > 0, include only points with density > cutoff.
Returns: crsList
Return type: - xyzCoord (A
-
getTotalDensityFromXyz
(xyzCoord, radius, densityCutoff=0)[source]¶ Calculate the total density of a sphere.
Parameters: - xyzCoord (
list
offloat
) – xyz coordinates. - radius (
float
) – - densityCutoff (
float
) – a density cutoff for all the points to include, defaults to 0 Default 0 means include every point within the radius. If cutoff < 0, include only points with density < cutoff. If cutoff > 0, include only points with density > cutoff.
Returns: density
Return type: - xyzCoord (
-
findAberrantBlobs
(xyzCoords, radius, densityCutoff=0)[source]¶ Within a given radius, find and aggregate all neighbouring aberrant points into blobs (red/green meshes).
Parameters: - xyzCoords (
list
) – single xyz coordinate or a list of xyz coordinates. - radius (
float
orlist
) – search radius or list of search radii - densityCutoff (
float
) – A density cutoff for all the points wants to be included, defaults to 0 Default 0 means include every point within the radius. If cutoff < 0, include only points with density < cutoff. If cutoff > 0, include only points with density > cutoff.
Returns: blobList of aberrant blobs described by their xyz centroid, total density, and volume.
Return type: list
ofpdb_eda.ccp4.DensityBlob
objects.- xyzCoords (
-
createFullBlobList
(cutoff)[source]¶ Aggregate the density map into positive (green or blue) or negative (red) blobs.
Parameters: cutoff ( float
) – density cutoff to use to filter voxels.Return blobList: list of DensityBlobs Return type: list
ofpdb_eda.ccp4.DensityBlob
objects.
-
-
class
pdb_eda.ccp4.
DensityBlob
(centroid, coordCenter, totalDensity, volume, crsList, densityMatrix, atoms=None)[source]¶ pdb_eda.ccp4.DensityBlob
that stores data and methods of a electron density blob.-
__init__
(centroid, coordCenter, totalDensity, volume, crsList, densityMatrix, atoms=None)[source]¶ Initialize a
pdb_eda.ccp4.DensityBlob
object.Parameters: - centroid (
list
) – the centroid of the blob. - totalDensity (
float
) – the totalDensity of the blob. - volume (
float
) – the volume of the blob = number of density units * unit volumes. - crsList (
list
) – the crs list of the blob. - densityMatrix (pdb_eda.ccp4.DensityMatrix) – the entire density map that the blob belongs to.
- atoms (
list
, optional) – list of atoms for the blob.
Returns: densityBlob
Return type: - centroid (
-
static
fromCrsList
(crsList, densityMatrix)[source]¶ The creator of a A
pdb_eda.ccp4.DensityBlob
object.Parameters: - crsList (
list
) – the crs list of the blob. - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – the 3-d density matrix to use for calculating centroid etc, so the object does not have to have a density list data member.
Returns: densityBlob
Return type: - crsList (
-
__eq__
(otherBlob)[source]¶ Check if two blobs are the same, and overwrite the ‘==’ operator for the
pdb_eda.ccp4.DensityBlob
object.Parameters: otherBlob ( pdb_eda.ccp4.DensityBlob
) –Returns: bool Return type: :py:class`bool`
-
testOverlap
(otherBlob)[source]¶ Check if two blobs overlaps or right next to each other.
Parameters: otherBlob ( pdb_eda.ccp4.DensityBlob
) –Returns: bool Return type: :py:class`bool`
-
merge
(otherBlob)[source]¶ Merge the given blob into the original blob.
Parameters: otherBlob ( pdb_eda.ccp4.DensityBlob
) –
-
clone
()[source]¶ Returns a copy of the density blob.
Returns: densityBlob Return type: pdb_eda.ccp4.DensityBlob
-
PDB Parser¶
PDB Parser (pdb_eda.pdbParser)¶
This module provides methods to read and parse the PDB format files and returns PDB objects. Format details of PDB can be found in ftp://ftp.wwpdb.org/pub/pdb/doc/format_descriptions/Format_v33_Letter.pdf.
-
pdb_eda.pdbParser.
readPDBfile
(file)[source]¶ Creates
pdb_eda.pdbParser.PDBentry
object from file name.Parameters: file ( str
,io.IOBase
) – The name of a PDB formated file or a file handle.
-
pdb_eda.pdbParser.
parse
(handle, mode='lite')[source]¶ Creates
pdb_eda.pdbParser.PDBentry
object from file handle object.Parameters: Returns: pdbEntry
Return type:
-
class
pdb_eda.pdbParser.
PDBentry
(header, atoms)[source]¶ pdb_eda.pdbParser.PDBentry
class that stores thepdb_eda.pdbParser.PDBheader
and/orpdb_eda.pdbParser.Atom
class.-
__init__
(header, atoms)[source]¶ pdb_eda.pdbParser.PDBentry
initializer.Parameters: - header (
pdb_eda.pdbParser.PDBheader
) – - atoms (
list
) – list ofpdb_eda.pdbParser.Atom
objects
- header (
-
-
class
pdb_eda.pdbParser.
PDBheader
(PDBid, date, method, resolution, rValue, rFree, program, spaceGroup, rotationMats)[source]¶ pdb_eda.pdbParser.PDBheader
that stores information about PDB header.-
__init__
(PDBid, date, method, resolution, rValue, rFree, program, spaceGroup, rotationMats)[source]¶ pdb_eda.pdbParser.PDBheader
initializer.Parameters: - PDBid (
str
) – PDB entry ID. - date (
str
) – PDB structure publish date. - method (
str
) – Experiment method, i.e. X-ray, NMR, etc. - resolution (
float
) – Structure resolution if applicable. - rValue (
float
) – Structure’s R value. - rFree (
float
) – Structure’s R free value. - program (
str
) – Software for acquiring the structure. - spaceGroup (
str
) – Structure’s space group if applicable. - rotationMats (
list
) – Structure’s rotation matrix and translation matrix if applicable.
- PDBid (
-
-
class
pdb_eda.pdbParser.
Atom
(keyValues)[source]¶ pdb_eda.pdbParser.Atom
that stores information about PDB atoms.-
__init__
(keyValues)[source]¶ pdb_eda.pdbParser.Atom
initializer.Parameters: keyValues ( dict
) – key-value pairs for atom information.
-
Crystal Contacts Analysis¶
- pdb_eda (crystal) contacts analysis mode command-line interface
- Analyzes atoms in a PDB entry for the closest crystal contacts. This mode requires the pymol package and associated python library to be installed.
- Usage:
- pdb_eda contacts -h | –help pdb_eda contacts <pdbid> <out-file> [–distance=<cutoff>] [–symmetry-atoms] [–include-pdbid] [–out-format=<format>]
- Options:
-h, --help Show this screen. <pdbid> The PDB ID to download and analyze. <out-file> Output filename. “-” will write to standard output. –distance=<cutoff> Distance cutoff in angstroms for detecting crystal contacts [default: 5.0]. –symmetry-atoms Calculate crystal contacts to symmetry atoms too. –include-pdbid Include PDB ID at the beginning of each result. –out-format=<format> Output file format, available formats: csv, json [default: json].
-
pdb_eda.crystalContacts.
findCoordContacts
(coordList1, coordList2, distanceCutoff=5.0)[source]¶ Find contacts in coordList1 to coordList2 at the given distance cutoff.
Parameters: Returns: contactList of index,minDistance tuples.
Return type:
-
pdb_eda.crystalContacts.
simulateCrystalNeighborCoordinates
(filename, distanceCutoff=5.0)[source]¶ RETURN a list of atom coordinates of the simulated crystal environment surrounding the X-Ray Diffraction asymmetric unit (excluding heteroatoms). Requires a file path instead of a structure because the bulk of this is handled by Pymol. NOTE: This will only work with PDB structures resolved with X-RAY DIFFRACTION.
Parameters: Returns: coordList
Return type:
Utilities¶
Utilities (pdb_eda.utils)¶
Contains low-level functions used in pdb_eda.ccp4 and pdb_eda.densityAnalysis. Should not be used, but is a fallback if cutils.pyx cannot be cythonized. The cythonized version provide a 3- to 4-fold improvement in execution performance.
-
pdb_eda.utils.
testOverlap
(selfBlob, otherBlob)[source]¶ Check if two blobs overlaps or right next to each other.
Parameters: - selfBlob (
pdb_eda.ccp4.DensityBlob
) – - otherBlob (
pdb_eda.ccp4.DensityBlob
) –
Returns: bool
Return type: - selfBlob (
-
pdb_eda.utils.
sumOfAbs
(array, cutoff)[source]¶ Return sum of absolute values above a cutoff.
Parameters: - array (
collections.abc.Iterable
) – - cutoff (
float
) –
Returns: value
Return type: - array (
-
pdb_eda.utils.
createCrsLists
(crsList)[source]¶ Calculates a list of crsLists from a given crsList. This is a preparation step for creating blobs.
Parameters: crsList ( list
) – a crs list.Returns: crsLists is a list of disjoint crsLists. Return type: list
-
pdb_eda.utils.
createSymmetryAtoms
(atomList, rotationMats, orthoMat, xs, ys, zs)[source]¶ Creates and returns a list of all symmetry atoms.
Parameters: Returns: allAtoms
Return type:
-
class
pdb_eda.utils.
SymAtom
(atom, coord, symmetry)[source]¶ A wrapper class to the BioPDB.atom class, delegating all BioPDB atom class methods and data members except having its own symmetry and coordination.
-
pdb_eda.utils.
getPointDensityFromCrs
(densityMatrix, crsCoord)[source]¶ Returns the density of a point.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - crsCoord – crs coordinates.
Type: Returns: density
Return type: - densityMatrix (
-
pdb_eda.utils.
testValidCrs
(densityMatrix, crsCoord)[source]¶ Tests whether the crs coordinate is valid.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - crsCoord (
list
) – crs coordinates.
Returns: bool
Return type: - densityMatrix (
-
pdb_eda.utils.
testValidCrsList
(densityMatrix, crsList)[source]¶ Tests whether all of the crs coordinates in the list are valid.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - crsList – list of crs coordinates.
Type: Returns: bool
Return type: - densityMatrix (
-
pdb_eda.utils.
createFullCrsList
(densityMatrix, cutoff)[source]¶ Returns full crs list for the density matrix.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - cutoff (
float
) –
Returns: crsList
Return type: - densityMatrix (
-
pdb_eda.utils.
_testXyzWithinDistance
(xyzCoord1, xyzCoord2, distance)[source]¶ Tests whether two xyzCoords are within a certain distance.
Parameters: Returns: bool
Return type:
-
pdb_eda.utils.
getSphereCrsFromXyz
(densityMatrix, xyzCoord, radius, densityCutoff=0)[source]¶ Calculate a list of crs coordinates that within a given distance of a xyz point.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - xyzCoord (
list
) – xyz coordinates. - radius (
float
) – - densityCutoff (
float
) – a density cutoff for all the points wants to be included, defaults to 0 Default 0 means include every point within the radius. If cutoff < 0, include only points with density < cutoff. If cutoff > 0, include only points with density > cutoff.
Returns: crsCoordList of crs coordinates
Return type: - densityMatrix (
-
pdb_eda.utils.
getSphereCrsFromXyzList
(densityMatrix, xyzCoordList, radius, densityCutoff=0)[source]¶ Calculates a list of crs coordinates that within a given distance from a list of xyz points.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - xyzCoordList (
list
) – xyz coordinates. - radius (
float
orlist
) – search radius or list of search radii - densityCutoff (
float
) – a density cutoff for all the points wants to be included., defaults to 0 Default 0 means include every point within the radius. If cutoff < 0, include only points with density < cutoff. If cutoff > 0, include only points with density > cutoff.
Returns: crsCoordList of crs coordinates
Return type: - densityMatrix (
-
pdb_eda.utils.
testValidXyz
(densityMatrix, xyzCoord, radius)[source]¶ Tests whether all crs coordinates within a given distance of a xyzCoord is within the densityMatrix.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - xyzCoord (
list
) – xyz coordinates. - radius (
float
) –
Returns: bool
Return type: - densityMatrix (
-
pdb_eda.utils.
testValidXyzList
(densityMatrix, xyzCoordList, radius)[source]¶ Tests whether all crs coordinates within a given distance of a set of xyzCoords is within the densityMatrix.
Parameters: - densityMatrix (
pdb_eda.ccp4.DensityMatrix
) – - xyzCoordList (
list
) – list of xyz coordinates. - radius (
float
) –
Returns: bool
Return type: - densityMatrix (