Skip to main content

Write Chimera Map (CMAP) files

Cmapfile is a Python library and console script to write Chimera Map (CMAP) files, HDF5 files containing series of 3D XYZ datasets.

CMAP files can be created from numpy arrays and various file formats containing volume data, e.g. BIN, TIFF, LSM, OIF, and OIB.

CMAP files can be visualized using UCSF Chimera [2], a highly extensible program for interactive visualization and analysis of molecular structures and related data.

For command line usage run python -m cmapfile --help

Author:

Christoph Gohlke

Organization:

Laboratory for Fluorescence Dynamics. University of California, Irvine

License:

BSD 3-Clause

Version:

2021.2.26

Requirements

References

  1. Thomas Goddard. [Chimera-users] reading in hdf5 files in chimera. https://www.cgl.ucsf.edu/pipermail/chimera-users/2008-September/003052.html

  2. UCSF Chimera, an extensible molecular modeling system. https://www.cgl.ucsf.edu/chimera/

  3. Globals for Images - SimFCS. https://www.lfd.uci.edu/globals/

Examples

Convert a 5D LSM file to CMAP file:

python -m cmapfile "/my data directory/large.lsm"

Convert all BIN files in the current directory to test.cmap. The BIN files are known to contain 128x128x64 samples of 16 bit integers. The CMAP file will store float32 maps using subsampling up to 16:

python -m cmapfile --shape 128,128,64 --step 1,1,2 --dtype i2
                   --cmap test.cmap --subsample 16 --astype float32 *.bin

Change the step size in the CMAP file:

python -m cmapfile --step 1,1,1.5 test.cmap

Notes

The CMAP file format according to [1]:

Example of HDF format written by Chimera (Chimera map format) follows.
The Chimera map file reader will allow all fields to be missing (except
the 3D data).

/image (group, any name allowed)
 name "centriole" (attribute)
 step (1.2, 1.2, 1.2) (attribute)
 origin (-123.4, -522, 34.5) (attribute)
 cell_angles (90.0, 90.0, 90.0) (attribute)
 rotation_axis (0.0, 0.0, 1.0) (attribute)
 rotation_angle 45.0 (attribute, degrees)
 /data (3d array of uint8 (123,542,82)) (dataset, any name allowed)
 /data_x (3d array of uint8 (123,542,82), alternate chunk shape) (dataset)
 /data_2 (3d array of uint8 (61,271,41)) (dataset, any name allowed)
    subsample_spacing (2, 2, 2) (attribute)
 (more subsampled or alternate chunkshape versions of same data)

Revisions

2021.2.26

Fix LSM conversion with tifffile >= 2021.2.26. Remove support for Python 3.6 (NEP 29).

2020.1.1

Do not write name attribute. Remove support for Python 2.7 and 3.5. Update copyright.

2018.8.30

Move cmapfile.py into cmapfile package.

2014.10.10

Initial release.

Metadata

Release files for cmapfile 2021.2.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmapfile 2021.2.26
File Size Uploaded Provenance Actions
cmapfile-2021.2.26.tar.gz 10.9 kB Without provenance Details for cmapfile-2021.2.26.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmapfile 2021.2.26
File Interpreter ABI Platform Actions
cmapfile-2021.2.26-py3-none-any.whl Python 3 none any Details for cmapfile-2021.2.26-py3-none-any.whl

Total release size: 23.1 kB

Release files / cmapfile-2021.2.26.tar.gz

Download URL cmapfile-2021.2.26.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
00e4d06e8a40eb792a141bc2c3e069e0235b3a414598f6fabc337a9f32268018
BLAKE2b-256 checksum
How to use checksums
4a3b1287e52cbe26885fd35bf59407b527d59d8bcd1372afb2809a76b246ee50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.8

Release files / cmapfile-2021.2.26-py3-none-any.whl

Download URL cmapfile-2021.2.26-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8707eb5b1da093d682c5ae2f569f22a476278d44f7cf758c00e6cd37aedebd9
BLAKE2b-256 checksum
How to use checksums
91183e35136ecf6f11ef439bcae3c10f993e3cf71e3ba92b60e300278e177af5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.8

Security for cmapfile 2021.2.26

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page