inst/doc/limma_edger.R

## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## pre-load to avoid load messages in report
library(Glimma)
library(limma)
library(edgeR)

## -----------------------------------------------------------------------------
library(Glimma)
library(limma)
library(edgeR)

dge <- readRDS(system.file("RNAseq123/dge.rds", package = "Glimma"))

## -----------------------------------------------------------------------------
glimmaMDS(dge)

## -----------------------------------------------------------------------------
design <- readRDS(
  system.file("RNAseq123/design.rds", package = "Glimma"))
contr.matrix <- readRDS(
  system.file("RNAseq123/contr.matrix.rds", package = "Glimma"))

## -----------------------------------------------------------------------------
v <- voom(dge, design)
vfit <- lmFit(v, design)
vfit <- contrasts.fit(vfit, contrasts = contr.matrix)
efit <- eBayes(vfit)

## -----------------------------------------------------------------------------
dge <- estimateDisp(dge, design)
gfit <- glmFit(dge, design)
glrt <- glmLRT(gfit, design, contrast = contr.matrix)

## -----------------------------------------------------------------------------
glimmaMA(efit, dge = dge) # swap efit for glrt to use edgeR results

## ---- eval = FALSE------------------------------------------------------------
#  # creates ma-plot.html in working directory
#  # link to it in Rmarkdown using [MA-plot](ma-plot.html)
#  htmlwidgets::saveWidget(glimmaMA(efit, dge = dge), "ma-plot.html")

## -----------------------------------------------------------------------------
sessionInfo()

Try the Glimma package in your browser

Any scripts or data that you put into this service are public.

Glimma documentation built on Nov. 8, 2020, 6:13 p.m.