Page 1 of 1

Text to chromatogram for peak integration

Posted: Fri Sep 10, 2021 9:34 am
by holm
Hello
I'm looking for a way to convert an HPLC trace as text file into something I can integrate.
The data originates from a synthesis module that is controlled with Labview, and the syntesis log is saved as a text file. Like this:

Time Trap Reactor HPLC loop Out of Column UV Temperature 1 Set point 1
13:36:00 -0.123 -0.242 -0.026 -0.748 -0.088
13:36:01 -0.116 -0.234 -0.030 -0.730 -0.088
13:36:02 -0.119 -0.238 -0.033 -0.739 -0.089
13:36:03 -0.129 -0.248 -0.031 -0.739 -0.088
13:36:04 -0.125 -0.254 -0.031 -0.746 -0.088
13:36:05 -0.121 -0.243 -0.032 -0.751 -0.088
13:36:06 -0.129 -0.256 -0.033 -0.744 -0.088

-So I need to be able to integrate in order to determine the crude purity.
I have searched a lot but I haven't been able to find a way do this.

In advance thanks
Erik

Re: Text to chromatogram for peak integration

Posted: Fri Sep 10, 2021 5:38 pm
by tom jupille
Impossible to say anything without knowing what all those numbers stand for.

Re: Text to chromatogram for peak integration

Posted: Fri Sep 10, 2021 6:08 pm
by holm
Sorry for not being clearer
Far left column is time and would be values for the x-axis and the column "out of column" would be values for the y-axis.

Thanks
Erik

Re: Text to chromatogram for peak integration

Posted: Fri Sep 10, 2021 7:14 pm
by sbashkyrtsev
I'm looking for a way to convert an HPLC trace as text file into something I can integrate.
Could you be a little more specific - what output do you need? Is it some kind of CSV file that you'll feed into your integrator? Or do you expect a fully-built integrator which will both - parse the input and integrate the area?

An example of the expected output will be the best way to explain your requirements.

Re: Text to chromatogram for peak integration

Posted: Sat Sep 11, 2021 2:48 pm
by antonk
In our UniChrom
File / Open ... / ASCII Text file (*.txt)
in import dialog select appropriate field delimiters and decimal point

Here is how to convert your timestamp to seconds

<?php
while(!feof(STDIN)) {
$s = fgets(STDIN);
$r = explode(' ',$s);
for ($i=0;$i<count($r);$i++) {
if ($i==0)
echo strtotime($r[$i]); // convert timestamp to seconds here
else
echo $r[$i];
echo chr(9);
}
echo "\r";
}
?>

run on your text file
php a.php <a.txt > processed.txt

Result will look like
1631356560 -0.123 -0.242 -0.026 -0.748 -0.088
1631356561 -0.116 -0.234 -0.030 -0.730 -0.088
1631356562 -0.119 -0.238 -0.033 -0.739 -0.089
1631356563 -0.129 -0.248 -0.031 -0.739 -0.088
1631356564 -0.125 -0.254 -0.031 -0.746 -0.088
1631356565 -0.121 -0.243 -0.032 -0.751 -0.088
1631356566 -0.129 -0.256 -0.033 -0.744 -0.088

Or open your text file in Excel/LO Calc and convert the first column into numbers

Re: Text to chromatogram for peak integration

Posted: Wed Sep 22, 2021 6:12 am
by holmerz
Yes I need both - parsing of the input and integration of the area.
Here's an example of how it looks online (during synthesis) in Labview, however I'm only able to print it as a pdf.
https://imgur.com/gallery/VFHtdwj
I'll have look at uniChrom, thanks.

\Erik

Re: Text to chromatogram for peak integration

Posted: Mon Sep 27, 2021 10:05 am
by lmh

Re: Text to chromatogram for peak integration

Posted: Tue Mar 29, 2022 9:48 am
by holmerz
Thank you all for the suggestions

Re: Text to chromatogram for peak integration

Posted: Sun Apr 03, 2022 5:39 pm
by ethanbass
You could also try my R package, chromatographR (available at https://github.com/ethanbass/chromatographR). After importing the files you should be able to easily find and integrate your peaks using the fit_peaks function or do a whole list of chromatograms with get_peaks. You can check out the vignette for more details.