Skip to main content

PyPI pytest Docs Pages Example Data

Welcome to MOCCA2

MOCCA2 is a Python package for automatic processing of HPLC chromatograms.

To automate your workflow and get accurate results, MOCCA2 features:

  • support for raw data files from Agilent, Shimadzu and Waters
  • automatic baseline correction
  • adaptive peak picking
  • automatic purity checking and peak deconvolution
  • compound tracking across chromatograms
  • fully automatic processing of any number of chromatograms

Documentation

Examples and detailed documentation are documented at https://bayer-group.github.io/MOCCA.

Getting Started

The latest version of MOCCA2 can be installed simply using pip:

pip install mocca2

Example data can be then downloaded using the following command:

python -m mocca2 --download-data

Now you are ready to process your first chromatogram!

from mocca2 import example_data
from matplotlib import pyplot as plt

# Load example data
chromatogram = example_data.example_1()

# Correct the baseline
chromatogram.correct_baseline()

# Crop the chromatogram to the region of interest, 1.4 to 1.8 minutes
chromatogram.extract_time(1.4, 1.8, inplace=True)

# Exclude low wavelengths that tend to be noisy - ignore everything below 220 nm
chromatogram.extract_wavelength(220, None, inplace=True)

# Find peaks in the chromatogram
chromatogram.find_peaks(min_height=2)

# Deconvolve the peaks
print("Deconvolving peaks, this migth take a minute...")

chromatogram.deconvolve_peaks(
    model="FraserSuzuki", min_r2=0.999, relaxe_concs=False, max_comps=5
)

print("Deconvolved!")

# Plot the chromatogram
chromatogram.plot()
plt.show()

Publications and MOCCA

This package is based on MOCCA package by HaasCP. This work has been published by Christian Haas et al. in 2023.

Inspired by MOCCA, MOCCA2 features more Pythonic interface as well as adaptive and more accurate algorithms.

Publication featuring MOCCA2 is coming soon!

Repository Details

This repository automates numerous workflows:

Automatic testing

On push to main, all tests in the tests directory are automatically run. Currently, MOCCA2 is tested on Ubuntu with Python 3.10, 3.11 and 3.12.

Docs

On push to main, the Sphinx docs are automatically compiled and published to GitHub pages.

Example data

The repository contains various example datasets:

Since these datasets don't fit into the PyPI package size limit, they are automatically compressed and published onto example-data branch on push to main.

The data can be automatically downloaded using python -m mocca2 --download-data.

Publishing to PyPI and GitHub

On push to main, the MOCCA2 package is automatically published to PyPI and GitHub Releases.

Contributing

The process for contributing is outlined in CONTRIBUTING.md.

Metadata

Release files for mocca2 0.1.18

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

Source distribution (sdist)

Source distribution for mocca2 0.1.18
File Size Uploaded
mocca2-0.1.18.tar.gz 42.8 kB Details

Built distribution (wheel)

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

Total release size: 98.1 kB

Release files / mocca2-0.1.18.tar.gz

Download URL mocca2-0.1.18.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6235da3cfc2aff3ee85dc15ec7c6aac4f8a70d624364a86f76c054cb4469816a
BLAKE2b-256 checksum
How to use checksums
daf0dcdc08cf5a96cbad4758b508aa565e62732ea5d901a4c2cc529c841ef29b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2025.

Transparency log

Release files / mocca2-0.1.18-py3-none-any.whl

Download URL mocca2-0.1.18-py3-none-any.whl
Size 55.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2bcec81132b5e93774564f3444efa12c346622b9ee8325cac9a289a4ca492d70
BLAKE2b-256 checksum
How to use checksums
0be7d555f775cedf57eafdb1a952924eedca6290fab559a8ee90ac2b1413f01a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 9, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.18 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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