Link Search Menu Expand Document

GC-TCD Data Processing


Table of Contents
  1. Create a Lab Notebook (Before Lab)
  2. Import and Inspect Your Data
  3. Remove the Baseline Offset
  4. Fit Chromatographic Peaks
  5. Calculate Figures of Merit for Each Peak
  6. Calculate the Percent Composition for Each Compound
  7. Finish & Turn In Your Notebook
  8. Appendix: Retention Factors for Common Solvents

Step-by-Step Video Tutorial

This video walks you through the data processing step-by-step. The goal is to help you get familiar with Julia and Pluto before you try it on your own in the rotation labs!

Having trouble viewing this video? Click here to view it on Panopto instead.

Create a Lab Notebook (Before Lab)

  1. Complete the steps under the prelab section if you did not already do so.

Import and Inspect Your Data

  1. Paste your data file into your lab 2 folder. If you are using the suggested path this folder is at /Documents/lab-notebooks/lab-2/.

  2. Load the CSV files into Julia.

     gc_data = CSV.read("filename.csv", DataFrame)
     # make sure you replace "filename" with your file name
    
  3. Plot the chromatogram with Time on the $x$ axis and signal level on the $y$ axis to inspect it.

     begin
       plotly() # only need to do this line once in each notebook
       plot(x, y, grid = false, legend = false)
       xlabel!("X axis label"); ylabel!("Y axis label");
       xlims!(min, max); ylims!(min, max);
     end
    

Remove the Baseline Offset

Note that there is a significant baseline offset (also called a DC offset) in the data, meaning the baseline level is significantly higher than 0. In this case, that is a result of how the zero knob was adjusted on the instrument. We can remove the offset in data processing by subtracting the mean baseline value:

\[S_{corrected} = S_{raw} - (\bar{S}_{raw-baseline})\]

We can determine $\bar{S}_{raw-baseline}$ by averaging a portion of the chromatogram where there are no peaks.

  1. Determine the baseline signal, $\bar{S}_{raw-baseline}$.

     S_raw_baseline = mean(gc_data[1:2, "Latest: Potential (mV)"])
     # replace 1:2 with the range you've selected as the baseline
    
  2. Subtract the baseline signal from every other signal value ($S_{raw, i}$).

     gc_data[!, "S_corrected"] = gc_data[!, "Latest: Potential (mV)"] .- S_raw_baseline
    
  3. Plot the corrected chromatogram. Use the same code as you did above, but use the corrected column instead of the raw column.

Fit Chromatographic Peaks

Ideally, chromatographic peaks are Guassian in nature and can be fit with a Gaussian function, as in:

\[f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2} \left( \frac{x-\mu}{\sigma} \right)^2}\]

In practice they usually are asymmetric, typically with a tailing end. The exponentially modified Gaussian (EMG) function provides a good approximation for the shape of tailing peaks in a chromatograph and will be used here to fit the chromatographic peaks. [1] The mathmatical function is:

\[f_{EMG}(t) = \frac{M_0}{2 \tau} \exp \left( \frac{\sigma_g^2}{2\tau^2} - \frac{t-t_g}{\tau} \right) \times \text{erfc} \left( \frac{1}{\sqrt{2}} \left( \frac{\sigma_g}{\tau} - \frac{t-t_r}{\sigma_g} \right) \right)\]

I have provided two Julia functions to help with this: (1) fitPeak, which fits an EMG function to the peak and determines the parameters and (2) plotPeak(), which takes the output of fitPeak() and plots it to help you visualize the process.

  1. Fit each peak in the chromatogram using fitPeak().

     yourFit = fitPeak(DataFrame, tmin = start_time, tmax = stop_time, t_r = retention_time_guess);
    

    You should enter a 2-column data frame as DataFrame, a time on the left side of the peak as tmin, a time on the right side of the peak as tmax, and a best guess at the retention time of the peak as t_r.

  2. Plot the results.

     plotPeak(yourFit)
    

    where yourFit is the output of fitPeak saved as a Julia object.

Calculate Figures of Merit for Each Peak

  1. Calculate the retention factor, \(k_r = \frac{t_r - t_m}{t_m}\).
  2. Calculate the resolution for each pair of peaks, \(R_s = \frac{t_{r_2} - t_{r_1}}{0.5(W_{b_2} + W_{b_1})}\).

Calculate the Percent Composition for Each Compound

  1. Calculate the percent composition: \(C\_n(\%)=\frac{A\_n}{A\_1 + A\_2 + ... A\_n} \times 100\%\). Here, $A_n$ is the area of peak n.

Finish & Turn In Your Notebook

  1. Include a discussion of (1) how many constituents are in your sample and (2) the relative polarity of each component. Compare the retention factors you calculated to the standards to see if you can determine what’s in the mixture.
  2. Save your notebook as both a Julia (.jl) file and static HTML (.html) file.
  3. Upload your files to the Lab 2 assignment on MS Teams.

References

  1. Kevin Lan and James W. Jorgenson (2001). A hybrid of exponential and Gaussian functions as a simple model of asymmetric chromatographic peaks. Journal of Chromatography A 915:1–2, p 1-13. doi: 10.1016/S0021-9673(01)00594-5

Appendix: Retention Factors for Common Solvents

Below are retention factors for compounds used to create the samples. You may use these to indicate which compounds are in your sample.

Compound Ret. Factor
Acetone 0.7668
iso-octane 3.229
Ethanol 0.5300
n-heptane 3.224
2-butanol 1.612
1-propanol 1.201