Density Map Generation

class StructureBlurrer.StructureBlurrer[source]

A class to generates a density map from a structure instance.

gaussian_blur(prot, resolution, densMap=False, sigma_coeff=0.356, normalise=True, filename='None')[source]

Returns a Map instance based on a Gaussian blurring of a protein. The convolution of atomic structures is done in reciprocal space.

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
densMap
False to build a Map with dimensions based on the protein, or a Map instance to be used as a template.
sigma_coeff

the sigma value (multiplied by the resolution) that controls the width of the Gaussian. Default values is 0.356.

Other values used :

0.187R corresponding with the Gaussian width of the Fourier transform falling to half the maximum at 1/resolution, as used in Situs (Wriggers et al, 1999);

0.225R which makes the Fourier transform of the distribution fall to 1/e of its maximum value at wavenumber 1/resolution, the default in Chimera (Petterson et al, 2004)

0.356R corresponding to the Gaussian width at 1/e maximum height equaling the resolution, an option in Chimera (Petterson et al, 2004);

0.425R the fullwidth half maximum being equal to the resolution, as used by FlexEM (Topf et al, 2008);

0.5R the distance between the two inflection points being the same length as the resolution, an option in Chimera (Petterson et al, 2004);

1R where the sigma value simply equal to the resolution, as used by NMFF (Tama et al, 2004).

filename
output name of the map file.
gaussian_blur_box(prot, resolution, box_size_x, box_size_y, box_size_z, sigma_coeff=0.356, normalise=True, filename='None')[source]

Returns a Map instance based on a Gaussian blurring of a protein. The convolution of atomic structures is done in reciprocal space.

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
box_size_x
x dimension of map box in Angstroms.
box_size_y
y dimension of map box in Angstroms.
box_size_z
z dimension of map box in Angstroms.
sigma_coeff

the sigma value (multiplied by the resolution) that controls the width of the Gaussian. Default values is 0.356.

Other values used :

0.187R corresponding with the Gaussian width of the Fourier transform falling to half the maximum at 1/resolution, as used in Situs (Wriggers et al, 1999);

0.225R which makes the Fourier transform of the distribution fall to 1/e of its maximum value at wavenumber 1/resolution, the default in Chimera (Petterson et al, 2004)

0.356R corresponding to the Gaussian width at 1/e maximum height equaling the resolution, an option in Chimera (Petterson et al, 2004);

0.425R the fullwidth half maximum being equal to the resolution, as used by FlexEM (Topf et al, 2008);

0.5R the distance between the two inflection points being the same length as the resolution, an option in Chimera (Petterson et al, 2004);

1R where the sigma value simply equal to the resolution, as used by NMFF (Tama et al, 2004).

filename
output name of the map file.
gaussian_blur_real_space(prot, resolution, densMap=False, sigma_coeff=0.356, normalise=True, filename='None')[source]

Returns a Map instance based on a Gaussian blurring of a protein. The convolution of atomic structures is done in real space

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
densMap
False to build a Map with dimensions based on the protein, or a Map instance to be used as a template.
sigma_coeff

the sigma value (multiplied by the resolution) that controls the width of the Gaussian. Default values is 0.356.

Other values used :

0.187R corresponding with the Gaussian width of the Fourier transform falling to half the maximum at 1/resolution, as used in Situs (Wriggers et al, 1999);

0.225R which makes the Fourier transform of the distribution fall to 1/e of its maximum value at wavenumber 1/resolution, the default in Chimera (Petterson et al, 2004)

0.356R corresponding to the Gaussian width at 1/e maximum height equaling the resolution, an option in Chimera (Petterson et al, 2004);

0.425R the fullwidth half maximum being equal to the resolution, as used by FlexEM (Topf et al, 2008);

0.5R the distance between the two inflection points being the same length as the resolution, an option in Chimera (Petterson et al, 2004);

1R where the sigma value simply equal to the resolution, as used by NMFF (Tama et al, 2004).

filename
output name of the map file.
gaussian_blur_real_space_box(prot, resolution, box_size_x, box_size_y, box_size_z, sigma_coeff=0.356, normalise=True, filename='None')[source]

Returns a Map instance based on a Gaussian blurring of a protein. The convolution of atomic structures is done in real space

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
box_size_x
x dimension of map box in Angstroms.
box_size_y
y dimension of map box in Angstroms.
box_size_z
z dimension of map box in Angstroms.
sigma_coeff

the sigma value (multiplied by the resolution) that controls the width of the Gaussian. Default values is 0.356.

Other values used :

0.187R corresponding with the Gaussian width of the Fourier transform falling to half the maximum at 1/resolution, as used in Situs (Wriggers et al, 1999);

0.225R which makes the Fourier transform of the distribution fall to 1/e of its maximum value at wavenumber 1/resolution, the default in Chimera (Petterson et al, 2004)

0.356R corresponding to the Gaussian width at 1/e maximum height equaling the resolution, an option in Chimera (Petterson et al, 2004);

0.425R the fullwidth half maximum being equal to the resolution, as used by FlexEM (Topf et al, 2008);

0.5R the distance between the two inflection points being the same length as the resolution, an option in Chimera (Petterson et al, 2004);

1R where the sigma value simply equal to the resolution, as used by NMFF (Tama et al, 2004).

filename
output name of the map file.
get_coordinates(structure_instance)[source]

Returns flat indices of the pixels occupied by each residue in a chain.

Arguments:

structure_instance
Structure instance of the model.
get_indices(structure_instance, emmap, res_map, sim_sigma_coeff=0.187)[source]

Returns flat indices of the pixels occupied by each residue in a chain.

Arguments:

structure_instance
Structure instance of the model.
emmap
Map instance the model is to be placed on.
res_map
Resolution of the map
sim_sigma_coeff
Sigma factor used for blurring
hard_sphere(prot, resolution, densMap=False, normalise=True, filename='None')[source]

Returns a Map instance based on a Hard Sphere model of a protein. Usefull for rigid fitting (Topf et al, 2008)

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
densMap
False to build a Map with dimensions based on the protein, or a Map instance to be used as a template.
filename
output name of the map file.
hard_sphere_box(prot, resolution, box_size_x, box_size_y, box_size_z, normalise=True, filename='None')[source]

Returns a Map instance based on a Hard Sphere model of a protein. Usefull for rigid fitting (Topf et al, 2008)

Arguments:

prot
the Structure instance to be blurred.
resolution
the resolution, in Angstroms, to blur the protein to.
box_size_x
x dimension of map box in Angstroms.
box_size_y
y dimension of map box in Angstroms.
box_size_z
z dimension of map box in Angstroms.
filename
output name of the map file.
make_atom_overlay_map(densMap, prot)[source]

Returns a Map instance with atom masses superposed on it.

Arguments:

densMap
an empty (all densities zero) Map instance to superpose the atoms onto.
prot
a Structure instance.
make_atom_overlay_map1(densMap, prot)[source]

Returns a Map instance with atom locations recorded on the nearest voxel with a value of 1.

Arguments:

densMap
an empty (all densities zero) Map instance to superpose the atoms onto.
prot
a Structure instance.
make_atom_overlay_mapB(densMap, prot)[source]

Returns a Map instance with atom masses superposed on it.

Arguments:

densMap
an empty (all densities zero) Map instance to superpose the atoms onto.
prot
a Structure instance.
make_model_grid(prot, spacing, ca_only=False, densMap=False)[source]
mapGridPosition(densMap, atom)[source]

Returns the index of the nearest pixel to an atom, and atom mass (4 values in list form).

Arguments:

densMap
Map instance the atom is to be placed on.
atom
Atom instance.
mapGridPositions(densMap, atom, gridtree, res_map, sim_sigma_coeff=0.187)[source]

Returns the indices of the nearest pixels to an atom as a list.

Arguments:

densMap
Map instance the atom is to be placed on.
atom
Atom instance.
gridtree
KDTree of the map coordinates (absolute cartesian)
res_map
Map resolution
mapGridPositions_vdw(densMap, atom, gridtree)[source]

Returns the index of the nearest pixel to an atom, and atom mass (4 values in list form).

Arguments:

densMap
Map instance the atom is to be placed on.
atom
Atom instance.
maptree(densMap, strmap=None)[source]

Returns the KDTree of coordinates from a map grid.

Arguments:

densMap
Map instance the atom is to be placed on.
model_tree(list_coord1, distpot=6.0, list_coord2=None)[source]

Returns

protMap(struct, apix, resolution=None, filename='None')[source]

Returns an Map instance sized and centred based on the atomic structure.

Arguments:

apix
Angstroms per pixel for the Map to be outputted.
resolution
Target resolution of the outputted map.
sigma_coeff
Sigma width of the Gaussian used to blur the atomic structure.
filename
output name of the map file.
protMapBox(struct, apix, resolution, box_size_x, box_size_y, box_size_z, filename)[source]

Create a Map instance sized and centered based on the atomic structure.

Arguments:

struct
the Structure instance.
apix
Angstroms per pixel for the output Map.
resolution
the resolution, in Angstroms, to blur the protein to.
box_size_x
x dimension of output map box in Angstroms.
box_size_y
y dimension of output map box in Angstroms.
box_size_z
z dimension of output map box in Angstroms.
filename
output name of the map file.
Return:
A Map instance