localrec.utils module

class localrec.utils.Vector3[source]

Bases: object

compute_length()[source]
compute_matrix()[source]

Compute rotation matrix to align Z axis to this vector.

compute_unit_vector()[source]
get_length()[source]
get_matrix()[source]
print_vector()[source]
set_length(d)[source]
set_vector(v)[source]
localrec.utils.create_subparticles(particle, symmetry_matrices, subparticle_vector_list, part_image_size, randomize, subparticles_total, align_subparticles, handness, angpix)[source]

Obtain all subparticles from a given particle and set the properties of each such subparticle.

localrec.utils.filter_distorigin(subparticles, subpart, distorigin)[source]

return True is particle must be kept

localrec.utils.filter_mindist(subparticles, subpart, mindist, keepRedundant)[source]

Return True if subpart is not close to any other subparticle by mindist. That is returns True is particle must ne kept

localrec.utils.filter_side(subpart, side)[source]
localrec.utils.filter_subparticles(subparticles, filters)[source]
localrec.utils.filter_top(subpart, top)[source]
localrec.utils.filter_unique(subparticles, subpart, unique)[source]

Return True if subpart is not close to any other subparticle by unique (angular distance). For this function we assume that subpart is not contained inside.

localrec.utils.geometryFromMatrix(matrix)[source]
localrec.utils.load_vectors(cmm_file, vectors_str, distances_str, angpix)[source]

Load subparticle vectors either from Chimera CMM file or from a vectors string. Distances can also be specified for each vector in the distances_str.

localrec.utils.matrixFromGeometry(shifts, angles, inverseTransform)[source]

Create the transformation matrix from a given 2D shifts in X and Y…and the 3 euler angles.

localrec.utils.vector_from_two_eulers(rot, tilt)[source]

function that obtains a vector from the first two Euler angles

localrec.utils.vectors_from_cmm(input_cmm, angpix)[source]

function that obtains the input vector from a cmm file

localrec.utils.vectors_from_string(input_str)[source]

Function to parse vectors from an string. Our (arbitrary) convention is: x1,y1,z1; x2,y2,z2 … etc

localrec.utils.within_mindist(p1, p2, mindist, keepRedundant)[source]

Returns True if two particles are closer to each other than the given distance in the projection.

localrec.utils.within_unique(p1, p2, unique)[source]

Returns True if two particles are closer to each other than the given angular distance.