Library to analyze chromatograms
Project description
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 peakschromatograpy.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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chromatograpy-0.1.0.tar.gz
(14.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chromatograpy-0.1.0.tar.gz.
File metadata
- Download URL: chromatograpy-0.1.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.2 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8949e64735c3315e7573a9c67e015d5c7131b246ff022438a9962f636860d4b
|
|
| MD5 |
1828349f81340350076cbe18d81e7783
|
|
| BLAKE2b-256 |
eb8717f8be5dfb290cb1fceb425db77fe504a7353b8811d2b12c8558e25010c0
|
File details
Details for the file chromatograpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chromatograpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.2 Darwin/24.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3f7babcb1aeaee2630f1b354ac2c5b3933a2024f15394dfdcb6970e0bf0d5ec
|
|
| MD5 |
63534c475712f682637cbb85ebabc7f2
|
|
| BLAKE2b-256 |
132c81591260b0b016a3ce78a4657228491cdc03181b036b990d124db6987612
|