Previous topic

6. Density Map Generation

Next topic

8. Generation an Ensemble of Structure Instance

This Page

7. Density Map Instance Informations

class EMMap.Map(fullMap, origin, apix, filename, header=[])[source]

A class representing all information from a density map file. NOTE: Currently it can only read the CCP4/MRC format.

box_size()[source]

Return the size of the map array, in ZYX format.

centre()[source]

Return Vector instance of the centre of the map in Angstroms.

change_origin(x_origin, y_origin, z_origin)[source]

Return a new Map instance with changed origin.

Arguments:

x_origin, y_origin, z_origin
new co-ordinates of origin.
copy()[source]

Return a copy of this Map.

fourier_filter(resolution)[source]

NOTE: UNDER CONSTRUCTION

Return a Map instance of the density map filtered to specific resolution.

Arguments:

resolution
highest frequency value to allow into filtered map
fourier_transform()[source]

Return a Map instance of the Fourier transform of the density map.

getMap()[source]

Return the array containing the map data.

get_com()[source]

Return Vector instance of the centre of mass of the map.

get_line_between_points(p1, p2)[source]

Return an array of float values representing a line of density values between two points on the map.

Arguments:

p1, p2
Vector instances of the end points co-ordinates of the line.
get_max_threshold(min_thr, noOfPoints, low, high, err_percent=1)[source]

Return maximum density value.

Given minimum threshold value, will calculate upper bound density value which gives specified number of points with density values between the two. Uses recursive algorithm.

Arguments:

min_thr
minimum threshold, normally given by get_min_threshold method.
noOfPoints
Number of points to use in the normal vector score - try first with 10% (maybe 5%better) of the number of points in the map ( round((self.map_size())*0.1)
low, high
minimum and maximum values between which the threshold will be taken. Initial values should be given by min_thr parameter and maximum density values in map.
err_percent
default value of 1. Allowed to find a max threshold that include a 1% error.
get_min_threshold(molWeight, low, high, vol_factor=1.21)[source]

Return minimum density value. Volume of pixels with greater density than output is equivalent to volume given by molecular weight of protein. Uses recursive algorithm.

Arguments:

molWeight
molecular weight of protein; use get_prot_mass_from_atoms() if your structure contains HETATOMS else use get_prot_mass_from_res().
low, high
minimum and maximum values between which the threshold will be taken. Initial values should be given by minimum and maximum density values in map.
vol_factor
in cubic Angstroms per Dalton. This is the approximate value for globular proteins used in Chimera (Petterson et al, 2004) from Harpaz 1994. Other recommended volume factor are 1.5 (1.1-1.9) cubic Angstroms per Dalton
get_normal_vector(x_pos, y_pos, z_pos)[source]

Return normal vector at point specified.

Point calculated using 3SOM algorithm used by Ceulemans H. & Russell R.B. (2004).

Arguments:

x_pos, y_pos, z_pos
pixel in map on which to calculate normal vector.
get_pos(minDens, maxDens)[source]

Returns array of 3-ples of points in the map with values between those chosen.

Arguments:

minDens
minimum density value to include in array.
maxDens
maximum density value to include in array.
get_significant_points()[source]

Return an array of tuples of the map co-ordinates and density values of all points with a density greater than the mean + standard deviation.

get_vectors()[source]

Return an array of all non-zero density points in the form of Vector instances.

header_to_binary()[source]

Returns binary version of header data. For use in writing to MRC file.

laplace_filtered()[source]

Return a Map instance of a Laplace filtered density map.

makeKDTree(minDens, maxDens)[source]

Returns k-dimensional tree of points in the map with values between those chosen.

Arguments:

minDens
minimum density value to include in k-dimensional tree.
maxDens
maximum density value to include in k-dimensional tree.
make_bin_map(cutoff)[source]

Return a new Map instance that has been binarised. All densities above the cutoff take a value of ‘1’, else ‘0’.

Arguments:

cutoff
cutoff density value
make_clash_map(apix=1.0)[source]

NOTE: NEEED TO BE CHECKED.

Return an empty Map instance with set Angstrom per pixel sampling (default is 1)

map_randomise_position(i, max_trans, max_rot, CoM, v_grain=30, rad=False, verbose=False)[source]

Randomise the position of the map instance and return the modified map.

Arguments:

ARUN need to add it
map_rotate_by_axis_angle(x, y, z, angle, CoM, rad=False)[source]

Return a new Map instance rotated around its centre.

Arguments:

angle
angle (in radians if rad == True, else in degrees) to rotate map.
x,y,z
axis to rotate about, ie. x,y,z = 0,0,1 rotates the Map round the xy-plane.
CoM
centre of mass around which map will be rotated.
map_size()[source]

Return the size of the array fullMap.

matrix_transform(mat, x=0, y=0, z=0)[source]

Apply affine transform to the map.

Arguments:

mat
affine transform 3x3 matrix.
x, y, z
translation in angstroms.
max()[source]

Return maximum density value of the map.

mean()[source]

Return mean density value of map.

median()[source]

Return median density value of map.

min()[source]

Return minimum density value of the map.

normalise()[source]

Return a new Map instance with normalised density values using x_new = x - mean / standard_deviation

origin_change_maps(MapRef)[source]

Return a new Map instance with origin changed accordingly to Reference Map (MapRef)

pixel_centre()[source]

Return Vector instance of the centre of the map in pixels.

protMapBox(struct, apix, resolution, box_size_x, box_size_y, box_size_z, filename)[source]

Returns 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 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.
randomise_position(max_trans, max_rot, CoM, v_grain=30, rad=False, verbose=False)[source]

Randomise the position of this Structure instance.

Arguments:
max_trans
translation in angstroms.
max_rot
Euler angles (in radians if rad == True, else in degrees) used to rotate map.
CoM
centre of mass around which map will be rotated.
v_grain
number of point to sample. Default is 30.
represent_normal_vectors(min_threshold, max_threshold)[source]

Return Structure instance representing normal vectors of density points specified.

Arguments:

min_threshold, max_threshold
minimum/maximum values to include in normal vector representation.
resample_by_apix(new_apix)[source]

Return a Map instance instance resampled based on new_apix.

resample_by_box_size(new_box_size)[source]

Return a Map instance instance resampled based on new_box_size.

resize_map(new_size, centre=False)[source]

Return a Map instance resized.

Arguments:

new_size
3-ple (x,y,z) giving the box size.
centre
default False
rotate_by_axis_angle(x, y, z, angle, CoM, rad=False)[source]

Return a new Map instance rotated around its centre.

Arguments:

angle
angle (in radians if rad == True, else in degrees) to rotate map.
x,y,z
axis to rotate about, ie. x,y,z = 0,0,1 rotates the Map round the xy-plane.
CoM
centre of mass around which map will be rotated.
rotate_by_euler(x, y, z, CoM, rad=False)[source]

Return a new Map instance rotated around pivot given by CoM.

Arguments:

x,y,z
Euler angles (in radians if rad == True, else in degrees) used to rotate map.
CoM
centre of mass around which map will be rotated.
x, y, z
translation in angstroms.
rotate_by_matrix(mat, CoM, rad=False)[source]

Return a new Map instance rotated around pivot given by CoM.

Arguments:
mat
3x3 matrix used to rotate map (in radians if rad == True, else in degrees).
CoM
rotation pivot, usually the centre of mass around which map will be rotated.
scale_map(scaling)[source]

Return a new Map instance scaled by scaling factor.

shift_origin(x_shift, y_shift, z_shift)[source]

Return a new Map instance with changed origin.

Arguments:

x_origin, y_origin, z_origin
new co-ordinates of origin.
std()[source]

Return standard deviation of density values in map.

threshold_map(minDens, maxDens)[source]

Return a new Map instance containing only density values between the specified min and max.

Arguments:

minDens
minimum density threshold

maxDens maximum density threshold

translate(x, y, z)[source]

Return a new Map instance shifted by changing origin.

Arguments:
x,y,z
translation in angstroms
update_header()[source]

Update self.header to values currently relevant.

vectorise_point(x, y, z)[source]

Return a tuple of the Angstrom co-ordinates and density value of a particular density point in map.

Arguments:

x, y, z
co-ordinates of the density point to be vectorised.
write_to_MRC_file(mrcfilename)[source]

writing to MRC file

x_origin()[source]

Return the x-coordinate of the origin.

x_size()[source]

Return the x size of the map array.

y_origin()[source]

Return the y-coordinate of the origin.

y_size()[source]

Return the y size of the map array.

z_origin()[source]

Return the z-coordinate of the origin.

z_size()[source]

Return the z size of the map array.