pwem.convert.symmetry module
This module returns the matrices related with the different point symmetries. Code based on chimera file sym.py
- class pwem.convert.symmetry.Cyclic(n, circumscribed_radius=1, center=(0, 0, 0), offset=None)[source]
Bases:
object
cyclic class. Allow to compute symmetry matrices, vertices, symmetry axis and unit cell planes
- Parameters
n: int order of symmetry circumscribed_radius: float radius of the circumscribed sphere center: tuple of 3 floats, center of the circumscribed sphere offset: float, angle in degrees to rotate the symmetry axis
it modifies the unit cell but not the symmetry matrices
- class pwem.convert.symmetry.Dihedral(n, circumscribed_radius=1, center=(0, 0, 0), offset=None, sym=1)[source]
Bases:
Cyclic
dihedral class. Allow to compute symmetry matrices, vertices, symmetry axis and unit cell planes
- Parameters
n: int order of symmetry circumscribed_radius: float radius of the circumscribed sphere center: tuple of 3 floats, center of the circumscribed sphere offset: float, angle in degrees to rotate the symmetry axis
it modifies the unit cell but not the symmetry matrices
- class pwem.convert.symmetry.Icosahedron(circumscribed_radius=1, orientation='222', center=(0, 0, 0))[source]
Bases:
object
Icosahedron class. Allow to compute symmetry matrices, icosahedron vertices,
symmetry axis and unit cell planes
point = np.array([0, 1, PHI]
- class pwem.convert.symmetry.Octahedral(circumscribed_radius=1, center=(0, 0, 0), offset=None)[source]
Bases:
object
Octahedral class. Allow to compute symmetry matrices, symmetry axis and unit cell planes of an octahedral symmetry. 4-folds along x, y, z axes.
- Parameters
circumscribed_radius: float radius of the circumscribed sphere center: tuple of 3 floats, center of the circumscribed sphere offset: float, angle in degrees to rotate the symmetry axis
it modifies the unit cell but not the symmetry matrices
- class pwem.convert.symmetry.SymmetryHelper[source]
Bases:
object
This is a static class so there is no need to instantiate it. Given a symmetry the class provides methods to “move” projection directions to the equivalent orientation that lays within the unit cells defined at https://scipion-em.github.io/docs/release-3.0.0/docs/developer/symmetries/symmetries.html?highlight=symmetry.
- classmethod getSymmetryMatricesAndPlanes(sym, n)[source]
Lazy return a tuple of symmetry matrices and unit cell planes for the symmetry and order passed
- Parameters
sym – Symmetry type
n – symmetry order
- classmethod moveParticleInsideUnitCell(particle, symmetry, symmetryOrder)[source]
apply to the projection direction the symmetry matrix that “moves” the projection direction to the equivalent orientation that lays within the “canonical” unit This is useful to move for example Cryosparc angles to a same unit cell and therefore been able to plot angular distribution. This method can be used in the typical “updateParticle” callback when generating any output set.
- Parameters
particle – Particle to move.
symmetry – symmetry type in scipion’s convention.
symmetryOrder – order of the symmetry
- class pwem.convert.symmetry.Tetrahedral(circumscribed_radius=1, center=(0, 0, 0), sym=4)[source]
Bases:
object
Tetrahedral class. Allow to compute symmetry matrices, vertices, symmetry axis and unit cell planes
- Parameters
n: int order of symmetry circumscribed_radius: float radius of the circumscribed sphere center: tuple of 3 floats, center of the circumscribed sphere
- pwem.convert.symmetry.getSymmetryMatrices(sym=0, n=1, circumscribed_radius=1, center=(0, 0, 0), offset=None)[source]
interface between scipion and chimera code chimera code uses tuples of tuples as matrices but scipion uses np.arrays (lists of lists) so let us convert them here. Direct use of the classes return 3x3 arrays which may be OK in many cases, but not in all