编写Chimera Map (CMAP)文件
项目描述
Cmapfile是一个Python库和控制台脚本,用于编写Chimera Map (CMAP)文件,包含一系列3D XYZ数据集的HDF5文件。
CMAP文件可以从numpy数组以及包含体积数据的各种文件格式(例如,BIN、TIFF、LSM、OIF和OIB)中创建。
可以使用UCSF Chimera [2](一个用于交互式可视化和分析分子结构及相关数据的程序)来可视化CMAP文件。
- 作者::
- 许可证::
BSD 3-Clause
- 版本::
2024.8.28
快速入门
从Python包索引安装cmapfile软件包及其所有依赖项
python -m pip install -U cmapfile[all]
打印命令行用法
python -m cmapfile --help
请参阅示例以了解使用案例。
源代码和支持可在GitHub上获得。
要求
此版本已测试以下要求和依赖项(其他版本可能也适用)
修订版
2024.8.28
修复lsm2cmap对tifffile > 2024.8.24的支持。
放弃对Python 3.9和numpy < 1.24(NEP29)的支持。
2023.8.30
放弃对Python 3.8和numpy < 1.22(NEP29)的支持。
2022.9.29
使子采样与ChimeraX兼容(破坏性更改)。
修复了已过时的scipy.ndimage.interpolation.zoom导入。
切换到Google样式docstrings。
2022.2.2
添加类型提示。
停止支持Python 3.7和numpy < 1.19(NEP29)。
2021.2.26
修复了使用tifffile >= 2021.2.26的LSM转换。
移除对Python 3.6的支持(NEP 29)。
2020.1.1
不要写入name属性。
移除对Python 2.7和3.5的支持。
更新版权。
2018.8.30
将cmapfile.py移动到cmapfile包中。
2014.10.10
初始发布。
注意
根据[1]的CMAP文件格式
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) color (1.0, 1.0, 0, 1.0) (attribute, rgba 0-1 float) time 5 (attribute, time series frame number) channel 0 (attribute, integer for multichannel data) /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)
参考文献
托马斯·戈达德。[Chimera-users]在Chimera中读取hdf5文件。https://www.cgl.ucsf.edu/pipermail/chimera-users/2008-September/003052.html
UCSF Chimera,一个可扩展的分子建模系统。https://www.cgl.ucsf.edu/chimera/
图像的全局变量 - SimFCS。https://www.lfd.uci.edu/globals/
示例
将5D LSM文件转换为CMAP文件
$ python -m cmapfile "/my data directory/large.lsm"
将当前目录中的所有BIN文件转换为test.cmap。已知的BIN文件包含128x128x64个16位整数样本。CMAP文件将使用最多16次的子采样存储float32映射。
$ python -m cmapfile --shape 128,128,64 --step 1,1,2 --dtype i2 \ --cmap test.cmap --subsample 16 --astype float32 *.bin
更改CMAP文件中的步长
$ python -m cmapfile --step 1,1,1.5 test.cmap
打印cmapfile脚本的用法
$ python -m cmapfile --help Usage: cmapfile [options] files Convert volume data files to Chimera MAP files. Options: --version show program's version number and exit -h, --help show this help message and exit -q, --quiet --filetype=FILETYPE type of input file(s). For example, BIN, LSM, OIF, TIF --dtype=DTYPE type of data in BIN files. For example, uint16 --shape=SHAPE shape of data in BIN files in F order. For example, 256,256,32 --offset=OFFSET number of bytes to skip at beginning of BIN files --step=STEP stepsize of data in files in F order. For example, 1.0,1.0,8.0 --cmap=CMAP name of output CMAP file --astype=ASTYPE type of data in CMAP file. For example, float32 --subsample=SUBSAMPLE write subsampled datasets to CMAP file
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
构建分布
cmapfile-2024.8.28.tar.gz的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 763f9a21bdb4f047aba388ac4171c77a3243632fb38b8689c316a28d9614ed3d |
|
MD5 | 231b15da321da4afc2646cb40e388f33 |
|
BLAKE2b-256 | ff214a08087aa54cbaca81ec338b505bef060c5fc375f7256bfb7c1029c9d40e |
cmapfile-2024.8.28-py3-none-any.whl的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e4761f12dec980c0bc47dab0c7cad30d9a7227b927be849f5b1ed8c0fe47e10a |
|
MD5 | 21c84858584ed88069ac78ba8d140bba |
|
BLAKE2b-256 | aa88b957083c672754b1ed112d36afdad8fe9eba513f5821957ce41ac7a93f0a |