densityGrid |
index |
Three-dimensional density map for use with atomic structures. atomProb
contains a facility to generate such a density map.
DensityGrid class
constructors:
DensityGrid(xnum,
ynum,
znum) - xnum,ynum,znum specify grid size. They default to
zero.
DensityGrid(omap,
zSlice=-1) - a copy constructor. If the optional zSlice argument
is a non-negative integer, a 2D slice will be
generated from the specified z grid number of omap.
toPoint(i,j,k) - return the Cartesian position corresponding to indices
i,j,k as a vec3.Vec3.
readCCP4(filename,
verbose=False,
zeroNegatives=True) - read CCP4- or MRC-formatted map from the
specified file. The verbose argument is optional.
Currently, there are the following restrictions on
parameters of density map files read in:
MAPC = 1
MAPR = 2
MAPS = 3
NX = NC
NY = NR
Also, unit-cell parameters are not supported, so
ISPG must be 1. By default, negative values in the
input map are changed to zero. To prevent this
behavior, set the zeroNegatives argument to False
readCCP4fromBytes(bytes,
verbose=False,
zeroNegatives=True) - same as readCCP4, except input is
in a Python Bytes object, instead of
a file.
writeCCP4(filename,
verbose=False,
isMRC=True ) - write CCP4- or MRC-formatted map to the
specified file. If isMRC is False, CCP4 format is
used.
writeEDM(filename) - write the map to an XPLOR EDM-formatted file.
Members
xnum, ynum, znum - number of grid points in each dimension
xmin, ymin, zmin - minimum values along axes
xdelta, ydelta, zdelta - grid spacing along axes
data - grid data in column-major format. Its use is rather
tricky:
data = dens.data #this is ugly: dens.data is a copy here (not reference)
data[k*dens.ynum*dens.xnum + j*dens.xnum + i] = val
dens.data = data
It is better to use the method interface.
setData(i,j,k,val)
__operator__(i,j,k) - accessors for grid data.
xValues() - accessors each of which returns a list of
yValues() values along each axis.
zValues()
scale(val) - scale the map by constant val.
shift(val) - add val to every grid point of the map.
minVal() - minumum value of the map.
maxVal() - maximum value of the map.
aveVal() - average value of the map.
maxPos() - position of map maximum
centroid() - centroid of probability dist
variance() - covariance matrix of probability dist
rotateTranslate(R,t) - return a new DensityGrid whose grid is the
same as that of the parent, and whose data is
taken from interpolated values of those on the
parent grid positions q transformed as R*(q+t)
where R is a rotation matrix and t is a translation
vector. Data for transformed positions more than
two grid spacings away from the parent grid are
zeroed.
interpolate(q,
rot=I,
trans=0) - return an interpolated data value for coordinate
q'=rot*(q+trans), with rotation R and translation t.
R defaults to the unit matrix and t defaults to the
zero vector.
gridInfo() - return the grid parameters
zero() - zero the density data.
zSlice(sliceNum) - return a cdsMatrix.CDSMatrix_double containing
a 2D slice at the specified z grid number.
and accessors (for accessor set value with syntax setAccessor(val)):
noOffset - control computation of x/y/zmin from grid params:
If True, x/y/zmin are multiples of x/y/zdelta.
The DensityGrid_Params class:
This is used for autogenerating the grid extents
members:
xdelta, ydelta, zdelta
xmin, ymin, zmin
xmax, ymax, zmax - grid parameters
cushion - space around molecule for auto-grid
generation
Function:
correlation(map1,map2) - return the correlation between maps:
\sum_i \rho_1(i) \rho_2(i) / sqrt(S1 * S2)
where S1 = \sum_i \rho_1^2(i)
Se = \sum_i \rho_2^2(i)
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
Classes | ||||||||||||||||||||||||||||||||||
|
Functions | ||
|