MassCube
masscube is an integrated Python package for liquid chromatography-mass spectrometry (LC-MS) data processing.
- Documentation: https://huaxuyu.github.io/masscubedocs/
- Source code: https://github.com/huaxuyu/masscube/
- Bug reports: https://github.com/huaxuyu/masscube/issues/
It provides:
- Highly accurate nontargeted peak detection and segmentation.
- Comprehensive feature quality evaluation.
- Confident annotation of feature groups including isotopes, adducts and in-source fragments.
- Annotation of MS/MS spectra via identity search and fuzzy search (i.e. analog search).
Installation
To install masscube, open a terminal and run:
pip install masscube
To upgrade masscube to the latest version, run:
pip install masscube --upgrade
Quick start
Start your nontargeted metabolomics data processing from here
Bruker timsTOF .d input
MassCube can read DDA-PASEF TDF2 directories directly, including calibrated
m/z and inverse reduced ion mobility (1/K0):
from masscube import read_raw_file_to_obj
data = read_raw_file_to_obj("sample.d")
scan = data.scans[data.ms1_idx_arr[0]]
print(scan.signals) # columns: m/z, intensity
print(scan.inv_mobility) # aligned intensity-weighted 1/K0
print(scan.inv_mobility_range) # aligned observed [min, max] 1/K0
The reader does not use OpenTIMS, AlphaTims, or Bruker's TDF-SDK. Its binary
decoder uses the Python standard library and loads the system libzstd
runtime through ctypes; on macOS it can be installed with brew install zstd. Set MASSCUBE_ZSTD_LIBRARY when the library is in a nonstandard
location.
Currently supported Bruker data are TDF2 (TimsCompressionType=2), DDA-PASEF
(MsMsType=8), m/z calibration model 1 with dC2=0 and C3=C4=0, and static
TIMS calibration model 2. The complete model-1 quadratic (C0, C1, and
C2) m/z calibration stored in each frame is applied.
The reported 1/K0 applies the stored static mobility calibration but not the
vendor's proprietary per-frame pressure compensation; this is recorded as
data.metadata.mobility_pressure_compensated == False.
For development-time verification against an installed official TDF-SDK, run:
python tools/validate_tdf_sdk.py sample.d /path/to/libtimsdata.so \
--output tdf_sdk_validation.json
The validation tool compares exact scan/TOF/intensity coordinates before mobility collapse, calibrated m/z, and all three SDK pressure-compensation strategies. It is not imported by MassCube and does not make TDF-SDK a runtime dependency.
Contribute to masscube
The masscube project is excited to have your expertise and passion on board!
We value all enhancements or corrections. For those thinking about making significant contributions to the codebase, we encourage you to get in touch with us!
- Huaxu Yu, huaxuyu@zju.edu.cn; yhxchem@outlook.com
Metadata
Release files for masscube 1.2.22
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| masscube-1.2.22.tar.gz | 92.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| masscube-1.2.22-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 190.8 kB
Release files / masscube-1.2.22.tar.gz
| Download URL | masscube-1.2.22.tar.gz |
|---|---|
| Size | 92.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ada670e6747c214919443185ee34c2d8d3f2ab50a10c98d41cf33f81cafe78e
|
|
BLAKE2b-256 checksum How to use checksums |
9c59d3a6182d698b21d9893517a49043e83f29d163c614ea5d563209e1c00198
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|
Release files / masscube-1.2.22-py3-none-any.whl
| Download URL | masscube-1.2.22-py3-none-any.whl |
|---|---|
| Size | 98.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddb23d3b83d8b20da496cf3bb4ce3b5be94da39e1fcba51e2c928c60338a0ce6
|
|
BLAKE2b-256 checksum How to use checksums |
b7e33307ab91818e468ead3158a2f7346cdbafe61f596c41dfd302e2edb155f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.7
|