Generalized python types and validators for cryoEM data.
Project description
cryotypes
cryotypes
defines a set of super-simple, extensible data structures for the fundamental types of cryoEM data and their relative metadata:
PoseSet
: a set of particle poses, compatible with 2D and 3D dataTomogram
: a 3D imageMicrograph
: a 2D image
Each cryotype defines an experiment_id
attribute which is intended as a unique identifier for individual experiments. This can be used, for example, to match particles to the correct tilt series and tomogram.
PoseSet
A PoseSet
is a pandas DataFrame
with specific column headings for particle positions and orientations, experiment identifiers and pixel/voxel spacing. This data-structure can be used for both 2D and 3D particle poses.
DataFrame column headings
Heading | Python name | Semantics |
---|---|---|
x |
POSITION_X | particle position in x-dimension |
y |
POSITION_Y | particle position in y-dimension |
z |
POSITION_Z | particle position in z-dimension |
dx |
SHIFT_X | particle shift in x-dimension |
dy |
SHIFT_Y | particle shift in y-dimension |
dz |
SHIFT_Z | particle shift in z-dimension |
orientation |
ORIENTATION | particle orientation |
experiment_id |
EXPERIMENT_ID | experimental identifier for micrograph/tilt-series |
pixel_spacing |
PIXEL_SPACING | isotropic pixel/voxel spacing for particle positions |
The labels can be conveniently accessed from Python should you need them.
from cryotypes import PoseSetDataLabels as CPDL
pose_dataframe[PSDL.POSITION_X] = xyz[:, 0]
Positions
Particle positions are coordinates in 2D or 3D images. The center of the first pixel is taken to be the origin (0, 0)
or (0, 0, 0)
and the units of particle positions are pixels.
Shifts
Particle shifts are in image pixels and are additive to positions, such that POSITION + SHIFT
is the position of the particle in the tomogram.
Orientations
Particle orientations are stored as
scipy.spatial.transform.Rotation
objects.
These transformations should rotate the basis vectors of a reference such that they are correctly oriented in a tomogram.
Tomogram
A Tomogram
is an object that follows a specific python Protocol
for tomogram data. The protocol specifies the following attributes:
data
: an array-like 3D image (numpy
,dask
, ...)experiment_id
: experimental identifierpixel_spacing
: isotropic pixel/voxel spacing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cryotypes-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a5936c578b93d72b5817ab737a1d6a9c41bfdc6a3fc95cea4182792bd61efd4 |
|
MD5 | edb3e6ab66ffaa173b3a21ed5fcc0eba |
|
BLAKE2b-256 | 5e7a4a04ae0a9a53e96913c735f595f8bb07b207b212658aaf028fde269a04f0 |