runLimmaAnalysis {NanoTube}R Documentation

Conduct differential expression analysis

Description

Use Limma to conduct a simple differential expression analysis. All groups are compared against the base.group, and empirical Bayes method is used to identify significantly differentially expressed genes. Alternatively, a design matrix can be supplied, as explained in limma::limmaUsersGuide()

Usage

runLimmaAnalysis(dat, groups = NULL, base.group = NULL, design = NULL)

Arguments

dat

NanoString data ExpressionSet, from processNanostringData

groups

character vector, in same order as the samples in dat. NULL if already included in 'dat'

base.group

the group against which other groups are compared (must be one of the levels in 'groups'). Will use the first group if NULL.

design

a design matrix for Limma analysis (default NULL, will do analysis based on provided 'group' data)

Value

The fit Limma object

Examples

example_data <- system.file("extdata", "GSE117751_RAW", package = "NanoTube")
sample_info <- system.file("extdata", "GSE117751_sample_data.csv", 
                           package = "NanoTube")

dat <- processNanostringData(nsFiles = example_data,
                             sampleTab = sample_info, 
                             groupCol = "Sample_Diagnosis")

# Compare the two diseases against healthy controls ("None")
limmaResults <- runLimmaAnalysis(dat, base.group = "None")


# You can also supply a design matrix
# Generate fake batch labels
batch <- rep(c(0, 1), times = ncol(dat) / 2)

# Reorder groups ("None" first)
group <- factor(dat$groups, levels = c("None", "Autoimmune retinopathy", 
                                       "Retinitis pigmentosa"))

# Design matrix including sample group and batch
design <- model.matrix(~group + batch)

# Analyze data
limmaResults2 <- runLimmaAnalysis(dat, design = design)

[Package NanoTube version 0.99.1 Index]