Simple Peak Alignment for Gas-Chromatography Data

Aligns peak based on peak retention times and matches homologous peaks across samples. The underlying alignment procedure comprises three sequential steps. (1) Full alignment of samples by linear transformation of retention times to maximise similarity among homologous peaks (2) Partial alignment of peaks within a user-defined retention time window to cluster homologous peaks (3) Merging rows that are likely representing homologous substances (i.e. no sample shows peaks in both rows and the rows have similar retention time means). The algorithm is described in detail in Ottensmann et al. submitted .


Build Status CRAN_Status_Badge

GCalignR provides simple functions to align peak lists obtained from Gas Chromatography Flame Ionization Detectors (GC-FID) based on retention times and plots to evaluate the quality of the alignment. The package supports any other one-dimensional chromatograpy technique that enables the user to create a peak list with at least one column specifying retention times as illustrated below.

Installing GCalignR:

  • The current release 1.0.0 is on CRAN.
install.packages("GCalignR", dependencies = T)
  • The beta release 1.0.1-beta is availabe via GitHub.
    if (!("devtools" %in% rownames(installed.packages()))) { 
    } else if (packageVersion("devtools") < 1.6) {
    devtools::install_github("mottensmann/[email protected]", build_vignettes = TRUE)

To get started read the vignettes:


If you encounter bugs or if you have any suggestions for improvement, just contact meinolf.ottensmann[at]


Ottensmann, M., Stoffel, M.A., Nichols, H.J. Hoffman, J.I. GCalignR: An R package for aligning Gas-Chromatography data. under review.



Changes since release 0.1.0


  • Retention times are not rounded to two decimals anymore. Calculations still capture a precision of two decimals for purely computational reasons.
  • Within the aligned results, retention times correspond to the input values. Linear adjustments are only used internally and are documented within the Logfile found in the output.


The bioconductor package (MassSpecWavelet)[] is added as in R solution for picking peaks from GC data.

warning messages

  • Warnings addressing formatting issues are now more explicit and partly rephrased to avoid ambiguity


  • Added horitontal axis to barplots summarising peak numbers in plot.GCalign
  • Changed to more prominent colours in binary heatmaps with gc_heatmap


  • Extended workflow and more comprehensive explainations

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0.1 by Meinolf Ottensmann, 5 months ago

Report a bug at

Browse source code at

Authors: Meinolf Ottensmann [aut, cre], Martin Stoffel [aut], Hazel J. Nichols [aut], Joseph I. Hoffman [aut]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports ggplot2, graphics, stats, readr, reshape2, stringr, utils, pbapply

Suggests knitr, pander, rmarkdown, testthat, vegan

See at CRAN