Package: hplc-py
AboutHigh-PerformanceLiquidChromatography (HPLC) is an analytical
technique which allows for quantitative characterization of the chemical
components of a mixture. While many of the technical details of HPLC are now
automated, the programmatic cleaning and processing of the resulting data often requires extensive manual labor. This package was
developed to alleviate some of this burden, making the actual running of the
HPLC the most time-consuming part of the quantification.InstallationYou can installhplc-pyon pip:$ pip install --upgrade hplc-pyUsageHplc-pyhasextensive documentation availablewith
aquickstart,example calibration curve,step-by-step description of the algorithm, andAPI documentation.The meat ofhplc-pyis
in itsChromatogramclass which performs all peak detection and fitting
steps. There is an additionalload_chromatogramfunction which makes it easy to
read in chromatograms from a long-form tidy.csvfile.Loading and Viewing ChromatogramsFor example, say you have a chromatogram fileexample.csvwith columns oftimeandsignalthat looks like this:time,signal
0, 0
0.00833, 0
0.01667, -1
...
12.77500,668
12.78333,746
12.79167,830
12.80000,919
12.80833,1015
12.81667,1118
12.82500,1228
12.83333,1345
12.84167,1471
...Usinghplc-py, this can be read from the file and loaded as aChromatogramobject asIn[1]:fromhplc.ioimportload_chromatogramIn[2]:fromhplc.quantimportChromatogramIn[3]:example=load_chromatogram('example.csv',cols=['time','signal'])In[4]:chrom=Chromatogram(example)The chromatogram is now loaded as anhplc-pyChromatogramobject, which has
a variety of methods annotated in thedocumentation.
The chromatogram can be viewed by calling theshow()methodIn[5]:chrom.show()Out[5]:[<Figuresize1280x960with1Axes>,<Axes:xlabel='time',ylabel='signal'>]yielding:Quantifying PeaksPeaks can be automatically detected and fit in a chromatogram by calling thefit_peaksmethod of aChromatogramobject. Doing so on our example chromatogram
yields a pandas DataFrame with the peaks and their propertiesIn[6]:peaks=chrom.fit_peaks()Performingbaselinecorrection:100%|████████|299/299[00:01<00:00,167.06it/s]Deconvolvingmixture:100%|███████████████████████|3/3[00:13<00:00,4.66s/it]In[7]:peaks.head()Out[7]:retention_timescaleskewamplitudeareapeak_id010.900.1574500.67428623250.3493872.790042e+061013.170.5828663.83986042250.7839745.070094e+062014.450.353036-3.01915335229.5835554.227550e+063015.530.3125631.63078714891.0414521.786925e+064016.520.3442661.98416710770.6567321.292479e+065The resulting chromatogram reconstruction can be seen by again calling theshow()method, this time restricting the plotted time region between 10 and 20 minutes.In[8]:chrom.show()Out[8]:[<Figuresize640x480with1Axes>,<Axes:xlabel='time',ylabel='signal (baseline corrected)'>]ContributingDevelopment of hplc-py occurs on various feature branches which are merged and released upon approval by Griffin Chure (@gchure), the primary maintainer of the software.Please submit issues and bug reports using the issue tracker. When filing an
issue, provide a reproducible example that demonstrates the bug or problem.
Feature requests can also be made through the issue tracker, though it is up to
the discretion of the maintainers what is worth implementing.For help with troubleshooting fitting of your chromatograms, please open anissuegiving an explanation of what's giving you trouble and  provide
a minimal working example of the problem. You can also tag your issue with thetroubleshootingflag.LicenseThis software is released under the GNU General Public License version 3 (GPLv3). The complete license is provided asLICENSE.txt, but a brief description is as follows:hplc-py
Copyright (C) 2024, Griffin Chure & Jonas Cremer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.