Skip to main content

Chromatograpy

A Python library to analyze chromatograms with support for multiple instrument formats and comprehensive analysis tools.

Features

  • File I/O: Read chromatograms from multiple instrument formats
    • Thermo Chromeleon CSV exports
    • Waters MassLynx RAW files
  • Peak Detection: Detect peaks using prominence-based algorithms
  • Baseline Correction: Apply airPLS baseline correction algorithm
  • Peak Identification: Identify peaks by retention time matching
  • Quantification: Quantify analytes using calibration curves
  • Visualization: Plot chromatograms with peak annotations

Installation

pip install chromatograpy

Requirements

  • Python >= 3.13
  • pandas
  • numpy
  • scipy
  • matplotlib
  • rainbow-api

Quick Start

import chromatograpy as chm

# Read a chromatogram file
chrom = chm.open("path/to/chromatogram.csv")

# Detect peaks
peaks = chm.peaks.by_prominence(chrom, prominence=0.1)

# Identify peaks using a retention time database
ids = chm.identify.by_retention_time(peaks, db)

# Quantify peaks
quantities = chm.quantify_peaks(peaks, ids, calibration_db)

# Plot the chromatogram with peaks
chm.plot(chrom, peaks=peaks, identification=ids, quantification=quantities)

Supported File Formats

Thermo Chromeleon

Read CSV exports from Chromeleon:

chrom = chm.open("sample.csv")

Waters MassLynx

Read MassLynx RAW files:

# Read all detectors
chroms = chm.open("sample.raw")

# Read specific detector
chrom = chm.open("sample.raw", detector="UV")

# Read with metadata filtering
chrom = chm.open("sample.raw", metadata={"polarity": "+"})

Core Classes

  • Chromatogram1D: Single channel chromatogram (pandas Series subclass)
  • Chromatogram2D: Multi-channel chromatogram (pandas DataFrame subclass)
  • Peak1D: A detected peak with properties like area, height, and retention time

API Overview

Reading Files

  • chromatograpy.open(path, *args, **kwargs): Universal file reader that auto-detects format

Peak Detection

  • chromatograpy.peaks.by_prominence(chromatogram, prominence=0.1): Detect peaks based on prominence

Baseline Correction

  • chromatograpy.baseline.airPLS(x, lambda_=100, porder=1, itermax=15): Apply airPLS baseline correction

Peak Identification

  • chromatograpy.identify.by_retention_time(peaks, db): Identify peaks using retention time database

Quantification

  • chromatograpy.quantify_peaks(peaks, ids, db): Quantify individual peaks
  • chromatograpy.quantify_analytes(peaks, ids, db): Quantify all analytes in database

Visualization

  • chromatograpy.plot(chrom, peaks=None, identification=None, quantification=None, ...): Plot chromatogram with optional annotations

License

MIT

Author

c.moevus@gmail.com

Metadata

Release files for chromatograpy 0.1.1

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

Source distribution (sdist)

Source distribution for chromatograpy 0.1.1
File Size Uploaded
chromatograpy-0.1.1.tar.gz 14.6 kB Details

Built distribution (wheel)

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

Total release size: 33.5 kB

Release files / chromatograpy-0.1.1.tar.gz

Download URL chromatograpy-0.1.1.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2c8d5fb4561c100c0fa82f5df67ef9f4d4f441cccb5971eb3c782adb51f2f5b2
BLAKE2b-256 checksum
How to use checksums
3b2f64b930a7c46a2f1172117b83ddb5d0fd66af3a5bdc99ace7c9a571ea0aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.13.2 Darwin/24.6.0

Release files / chromatograpy-0.1.1-py3-none-any.whl

Download URL chromatograpy-0.1.1-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f54bb6c8cabd8be939970951fc2e0b90ccb2570d2a739aeb67b97d238e66a14
BLAKE2b-256 checksum
How to use checksums
9a6dfec613e6b2018c61cd833985a1e6ea17b5ae40f668c9b9b2ac53edf58f08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.2 CPython/3.13.2 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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