add_sample_annotation: Add sample annotation to Skyline data frame

Description Usage Arguments Value Examples

View source: R/readfiles.R

Description

Add sample annotation to Skyline data frame

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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, ]

lipidr documentation built on Nov. 8, 2020, 7:50 p.m.