diff_expr: Differential expression analysis of esets.

View source: R/diff_expr.R

diff_exprR Documentation

Differential expression analysis of esets.

Description

After selecting control and test samples for each contrast, surrogate variable analysis (sva) and differential expression analysis is performed.

Usage

diff_expr(
  esets,
  data_dir = getwd(),
  annot = "SYMBOL",
  prev_anals = list(NULL),
  svanal = TRUE,
  recheck = FALSE,
  postfix = NULL,
  port = 3838
)

Arguments

esets

List of annotated esets. Created by load_raw.

data_dir

String specifying directory of GSE folders.

annot

String, column name in fData common to all esets. For duplicated values in this column, the row with the highest interquartile range across selected samples will be kept. If meta-analysis will follow, appropriate values are "SYMBOL" (default - for gene level analysis) or, if all esets are from the same platform, "PROBE" (for probe level analysis).

prev_anals

Previous result of diff_expr, which can be reloaded using load_diff. If present, previous selections, names, and pairs will be reused.

svanal

Use surrogate variable analysis? Default is TRUE.

recheck

Would you like to recheck previous group/contrast annotations? Requires prev_anals. Default is FALSE.

postfix

Optional string to append to saved results. Useful if need to run multiple meta-analyses on the same series but with different contrasts.

port

See runApp().

Details

Click the Download icon and fill in the Group name column and optionally the Pairs column. Then save and upload the filled in metadata csv. After doing so, select a test and control group to compare and click the + icon to add the contrast. Repeat previous step to add additional contrasts. After control and test samples have been added for all contrasts that you wish to include, click the Done button. Repeat for all GSEs.

Paired samples (e.g. the same subject before and after treatment) can be specified by filling out the Pairs column before uploading the metadata.

For each GSE, analysis results are saved in the corresponding GSE folder in data_dir that was created by get_raw. If analyses needs to be repeated, previous results can be reloaded with load_diff and supplied to the prev_anals parameter. In this case, previous selections, names, and pairs will be reused.

Value

List of named lists, one for each GSE. Each named list contains:

pdata

data.frame with phenotype data for selected samples. Columns treatment ('ctrl' or 'test'), group, and pair are added based on user selections.

top_tables

List with results of topTable call (one per contrast). These results account for the effects of nuissance variables discovered by surrogate variable analysis.

ebayes_sv

Results of call to eBayes with surrogate variables included in the model matrix.

annot

Value of annot variable.

Examples

library(lydata)

# location of raw data
data_dir <- system.file("extdata", package = "lydata")

# gather GSE names
gse_names  <- c("GSE9601", "GSE15069", "GSE50841", "GSE34817", "GSE29689")

# load first eset
esets <- load_raw(gse_names[1], data_dir)

# run analysis (opens GUI)
# anals_old <- diff_expr(esets, data_dir)

# re-run analysis on first eset
prev <- load_diff(gse_names[1], data_dir)
anals <- diff_expr(esets[1], data_dir, prev_anals = prev)


alexvpickering/crossmeta documentation built on May 23, 2024, 5:06 a.m.