Skip to main content

IO hub for Cryo-EM, Cryo-ET and subtomogram averaging data.

Project description

cryohub

cryohub is a library for reading and writing Cryo-ET data based on the cryotypes specification.

Installation

pip install cryohub

Usage

cryohub provides granular I/O functions such as read_star and read_mrc, which will all return objects following the cryotypes specification.

from cryohub.reading import read_star
poseset = read_star('/path/to/file.star')

A higher level function called read adds some magic to the IO procedure, guessing file formats and returning a list of cryotypes.

from cryohub import read
data = read('/path/to/file.star', '/path/to/directotry/', lazy=False, name_regex=r'tomo_\d+')

See the help for each function for more info.

Similarly to the read_* functions, cryohub provides a series of write_* functions, and a magic higher level write funtion.

from cryohub import write
write([poseset1, poseset2], 'particles.tbl')

From the command line

cryohub can be used as a conversion tool between all available formats:

cryohub convert input_file.star output_file.tbl

If instead you just need to quickly inspect your data but want something more powerful than just reading text files or headers, this command will land you in an ipython shell with the loaded data collected in a list called data:

cryohub view path/to/files/* /other/path/to/file.star
print(data[0])

Features

Currently cryohub is capable of reading images in the following formats:

  • .mrc (and the .mrcs, .st, .map variants)
  • Dynamo .em
  • EMAN2 .hdf

and particle data in the following formats:

  • Relion .star
  • Dynamo .tbl
  • Cryolo .cbox and .box

Writer functions currently exist for:

  • .mrc
  • EMAN2 .hdf
  • Dynamo .em
  • Relion .star
  • Dynamo .tbl

Image data

When possible (and unless disabled), cryohub loads images lazily using dask. The resulting objects can be treated as normal numpy array, except one needs to call array.compute() to apply any pending operations and return the result.

Contributing

Contributions are more than welcome! If there is a file format that you wish were supported in reading or writing, simply open an issue about it pointing to the specification. Alternatively, feel free to open a PR with your proposed implementation; you can look at the existing functions for inspiration.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cryohub-0.6.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

cryohub-0.6.0-py2.py3-none-any.whl (27.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cryohub-0.6.0.tar.gz.

File metadata

  • Download URL: cryohub-0.6.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for cryohub-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e51c293aa86c694aa0794175256f2e5d4909af3709c303984536b59b65cf0e43
MD5 7e061306723b407b257612a7b32aad06
BLAKE2b-256 fe9870e74c48dbee0f90219d2c39c6c7ad317d07c6b00d884f1ae7f56534e3e6

See more details on using hashes here.

File details

Details for the file cryohub-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: cryohub-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for cryohub-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d81fd3901d64d78f11d53b32bbc010584da978dc042cd2ed69e951e4cb26e56b
MD5 72800218ca7501ade3c5996847884bca
BLAKE2b-256 1b20c696be99f9ee316a93b59161c110fb67ffd529d3c242c81ef18ecad1b77e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page