MyNixOS website logo
Description

Lipid Set Enrichment Analysis with Dual KS and 'fgsea' Engines.

Provides biology-aware lipid set enrichment analysis (LSEA) for lipidomics data using dual engines: the Kolmogorov-Smirnov test and the fast gene set enrichment algorithm from the 'fgsea' package. Annotates lipids into biological groups at three levels (lipid class, LIPID MAPS category, functional category) and tests for coordinated directional shifts between conditions. Includes fatty acid chain analysis with trend plots weighted by lipid abundance (Spearman rank correlation, configurable smoothing), wide-format chain position output (sn-1, sn-2, sn-3, sn-4), annotation confidence filtering, and export utilities for reproducible reporting in CSV, 'Excel', and PDF formats. Vignettes are available in English and Spanish. Methods are based on Subramanian et al. (2005) <doi:10.1073/pnas.0506580102> and Korotkevich et al. (2021) <doi:10.1101/060012>.

easyLSEA

easyLSEA logo

R-CMD-check License: MIT

DOI

GitHub Downloads

easyLSEA is an R package for biology-aware Lipid Set Enrichment Analysis (LSEA) designed for untargeted lipidomics data. It provides a dual-engine framework (Kolmogorov-Smirnov + fgsea) for testing whether lipid classes, LIPID MAPS categories, and functional categories are coordinately shifted between experimental groups, alongside a dedicated fatty acid chain analysis module.


Key features

  • Dual-engine enrichment -- KS-based LSEA and fgsea run in parallel; a Convergence column flags sets significant in both.
  • Biology-aware annotation -- hierarchical prefix matching covering all major lipid classes (GPL, SL, GL, FA, ST, acylcarnitines, oxylipins, bile acids), validated against real VLDL lipidomics data.
  • Chain analysis -- class-aware parsing of sn-2 (PC, PE, PE O), N-acyl (SM, Cer, HexCer, GlcCer, Hex2Cer, Hex3Cer), long-format (TG, DG, PI, PS, PG, PA, CL), and single-chain (LPC, LPE, LPI, LPG, LPA, LPS, CAR, FFA, CE) species with tile and trend plots. Classes without resolved chain annotations fall back to class-level LSEA automatically.
  • Transparent parsing -- a per-lipid summary table reports the parsing status of every species, making it easy to audit which lipids entered chain analysis and why others were excluded.
  • Three analysis levels -- LipidClass, LipidCategory_LMAPS, and LipidCategory_functional tested simultaneously.
  • Flexible export -- CSV tables, multi-sheet Excel workbook, PDF/PNG plots, and a standalone HTML report via a single export_lsea() call.
  • Reproducible -- withr::with_seed() for RNG isolation; all parameters exposed as arguments with documented defaults.

Installation

# Install from GitHub
# install.packages("remotes")
remotes::install_github("DavidGO464/easyLSEA")

For the fgsea engine (optional but recommended):

# install.packages("BiocManager")
BiocManager::install("fgsea")

Quick start

library(easyLSEA)

# Load the built-in example dataset
data("lipid_example")

# Run the full pipeline in one call
result <- easyLSEA(
  data      = lipid_example,
  lipid_col = "LipidName",
  fc_col    = "logFC",
  case_lbl  = "NASH",
  ref_lbl   = "Control",
  engine    = "ks"          # or "fgsea" or "both"
)

# Inspect results
print(result)
summary(result)

# Access individual tables
head(result$lsea$ks)         # KS enrichment table
head(result$chains$parsed)   # parsed chain observations

# Export everything
export_lsea(result, dir = "results/", format = c("csv", "excel", "pdf"))

Workflow

Raw lipidomics data (data.frame)
        |
        v
annotate_lipids()          -- assign LipidClass, LipidCategory
        |
        +--------> run_lsea()            -- KS + fgsea enrichment
        |                |
        |                +--> plot_lsea()
        |
        +--------> parse_lipid_chains()  -- chain length & unsaturation
                         |
                         +--> plot_chains()
        |
        v
export_lsea()              -- CSV / Excel / PDF / HTML

Or use the one-call wrapper:

result <- easyLSEA(data, ...)   # runs all of the above

Modular use

Each step can be run independently:

# Step 1 -- annotate
annotated <- annotate_lipids(data, lipid_col = "LipidName")

# Step 2 -- enrichment only
lsea_out <- run_lsea(
  data       = annotated,
  fc_col     = "logFC",
  engine     = "both",
  case_lbl   = "NASH",
  ref_lbl    = "Control"
)

# Step 3 -- chain analysis
chains_out <- parse_lipid_chains(annotated)

# Inspect parsed chains (one row per acyl chain observation)
head(chains_out$parsed)

# Audit parsing: see which lipids were parsed and which were excluded
table(chains_out$summary$status)
#> excluded_class                             parsed
#>            142                                389
#> excluded_total_notation_unresolved_PI          23
#>             23

chain_plots <- plot_chains(chains_out, case_lbl = "NASH", ref_lbl = "Control")

# Step 4 -- export
export_lsea(lsea_out, format = c("csv", "excel"))

Lipid class coverage

Classes follow LIPID MAPS shorthand nomenclature.

CategoryClasses
GlycerophospholipidsPC, PE, PI, PS, PG, PA, CL, LPC, LPE, LPI, LPG, LPA, LPS
Ether-GPLPC O, PE O, PS O, PG O, TG O, DG O
SphingolipidsSM, Cer, HexCer, GlcCer, Hex2Cer, Hex3Cer, SHexCer, CerPE, PE-Cer
GlycerolipidsTG, DG, MG
Fatty AcylsFFA, FA, FAHFA
AcylcarnitinesCAR
Sterol LipidsCE, FC, ST
Bile AcidsCA, CDCA, DCA, LCA, GCA, TCA, GCDCA, TCDCA
GlycolipidsDGDG, MGDG
OtherCoQ, Unknown (fallback)

Oxylipins are not a formal LIPID MAPS category; oxidized fatty acid species (e.g. HETE, HODE, PGE2) are classified as Fatty Acyls and handled at class-level LSEA only.


Chain analysis framework

The strategy applied to each lipid class depends on its biological structure and the annotation resolution available in the dataset. When individual chains are not resolved, all classes fall back to class-level LSEA automatically.

StrategyClassesRationale
sn-2 chainPC, PE, PE Osn-1 position is typically conserved; biological variability resides in sn-2
N-acyl chainSM, Cer, HexCer, GlcCer, Hex2Cer, Hex3Cersphingoid base (d18:1) is conserved; the N-acyl chain drives class diversity
Long formatTG, DG, PI, PS, PG, PA, CLall acyl chains are biologically variable; each resolved chain is analysed as an independent observation
Single chainLPC, LPE, LPI, LPG, LPA, LPS, CAR, FFA, CEone acyl chain per species by definition
Class-level LSEA onlyFC, ST, CoQ, BA, FAHFA, Oxylipinno acyl chain or structure too complex for chain-level inference

Citation

If you use easyLSEA in your research, please cite:

Guardamino Ojeda D, et al. (2026). easyLSEA: biology-aware lipid set enrichment analysis with dual KS and fgsea engines. GitHub: https://github.com/DavidGO464/easyLSEA. DOI: https://doi.org/10.5281/zenodo.20341372


Optional dependencies

PackagePurposeInstall
fgseafgsea engineBiocManager::install("fgsea")
lipidAnnotatorEnhanced annotationremotes::install_github(...)
openxlsxExcel exportinstall.packages("openxlsx")
rmarkdownHTML reportinstall.packages("rmarkdown")

License

MIT -- see LICENSE for details.

Metadata

Version

0.2.1

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows