Skip to main content

Write Chimera Map (CMAP) files

Project description

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:

2020.1.1

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

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.

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

cmapfile-2020.1.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmapfile-2020.1.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file cmapfile-2020.1.1.tar.gz.

File metadata

  • Download URL: cmapfile-2020.1.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for cmapfile-2020.1.1.tar.gz
Algorithm Hash digest
SHA256 60b3979dc192ca63ffc3621fd55ab24fcfd492dbcd33228aab4e31e503596553
MD5 c0a305588e746daf4c0f9887a7c75e81
BLAKE2b-256 4e930cc065c3f3bd8926c8cad1dea083f8edf5d9f650098b5f816212648ef8c4

See more details on using hashes here.

File details

Details for the file cmapfile-2020.1.1-py3-none-any.whl.

File metadata

  • Download URL: cmapfile-2020.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.6

File hashes

Hashes for cmapfile-2020.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc246e7a7a945c3d5bfc0fd959e804e1bbee76cbb3952a8c82cde1d24465b5ab
MD5 5875fa8ee034b168262815b9b71d3a55
BLAKE2b-256 f545ee4aa413e2a2d3464c5e440947a81766837ae4885e879b52b146f9a0a3c2

See more details on using hashes here.

Supported by

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