hplc-py

12.3. hplc-py#

import numpy as np
import matplotlib.pyplot as plt
from molass_data import SAMPLE1
from molass.DataObjects import SecSaxsData as SSD
ssd = SSD(SAMPLE1)
x, y = ssd.xr.get_icurve().get_xy()
fig, ax = plt.subplots()
ax.plot(x, y)
plt.show()
../../_images/7eddd8d4d9060ea469b2f023c28e6ac8c60fa13915a2929e4463065cab090865.png
csv_path = "hplc-py-example.csv"
np.savetxt(csv_path, np.column_stack((x/20, y)), delimiter=",", header="time,signal", comments='')
from hplc.io import load_chromatogram
from hplc.quant import Chromatogram
example = load_chromatogram(csv_path, cols=['time', 'signal'])
chrom = Chromatogram(example)
chrom.show()
[<Figure size 640x480 with 1 Axes>, <Axes: xlabel='time', ylabel='signal'>]
../../_images/b221ea0166728089c25d2377f2d51b86635005e3e1f111683c2ccbae61abde24.png
peaks = chrom.fit_peaks(prominence=0.05)
peaks.head()
Performing baseline correction: 100%|██████████| 49/49 [00:00<00:00, 5891.21it/s]
Deconvolving mixture: 100%|██████████| 1/1 [00:02<00:00,  2.08s/it]
retention_time scale skew amplitude area signal_maximum peak_id
0 0.4 0.011160 0.143289 0.001278 0.007779 0.005471 1
0 0.7 0.012835 0.413577 0.000458 0.004088 0.003025 2
0 0.8 2.944615 9.217561 0.012458 0.249099 0.003237 3
0 4.6 0.407060 -2.034294 0.067984 1.359681 0.099460 4
0 4.6 0.784367 5.773530 0.054106 1.082119 0.050649 5
chrom.show([2, 12])
[<Figure size 640x480 with 1 Axes>,
 <Axes: xlabel='time', ylabel='signal (baseline corrected)'>]
../../_images/dff673e6aa663add9e4de71bb83aa05092e00cc4ee9cf7cff0d2084756d46390.png