Skip to main content

MassCube

PyPI Downloads

masscube is an integrated Python package for liquid chromatography-mass spectrometry (LC-MS) data processing.

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!

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)

Source distribution for masscube 1.2.22
File Size Uploaded
masscube-1.2.22.tar.gz 92.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for masscube 1.2.22
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.22 This release

2 release files

1.2.21

2 release files

1.2.20

2 release files

1.2.19

2 release files

1.2.18

2 release files

1.2.17

2 release files

1.2.16

2 release files

1.2.15

2 release files

1.2.14

2 release files

1.2.13

2 release files

1.2.12

2 release files

1.2.11

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.16

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.22

2 release files

1.0.21

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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