add_sample_annotation: Add sample annotation to Skyline data frame

View source: R/readfiles.R

add_sample_annotationR Documentation

Add sample annotation to Skyline data frame

Description

Add sample annotation to Skyline data frame

Usage

add_sample_annotation(data, annot_file)

Arguments

data

LipidomicsExperiment object.

annot_file

CSV file or a data.frame with at least 2 columns, sample names & group(s).

Value

LipidomicsExperiment with sample group information.

Examples

datadir <- system.file("extdata", package = "lipidr")

# all csv files
filelist <- list.files(datadir, "data.csv", full.names = TRUE)
d <- read_skyline(filelist)

# Add clinical info to existing LipidomicsExperiment object
clinical_file <- system.file("extdata", "clin.csv", package = "lipidr")
d <- add_sample_annotation(d, clinical_file)
colData(d)
d$group

# Subset samples using clinical information
# Note we are subsetting columns
d[, d$group == "QC"]

# Subset lipids using lipid annotation
# Note we are subsetting rows
d[rowData(d)$istd, ]

ahmohamed/lipidr documentation built on July 7, 2023, 2:22 a.m.