DESeqWrapper: A wrapper for DESeq

Description Usage Arguments Value Author(s) Examples

Description

This function provides a useful wrapper for the DESeq package, automating several of the manual steps to provide a basic DE analysis. Users should use this as a guide, not necessarily as a final analysis. The functions plotDE and plotDispEsts are only called from within this function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
DESeqWrapper(countData,
             conditions,
             whichGeneNames = 0,
             outNamePrefix = "DESeqOutputs",
             comps = "allPairwise",
             conds = NULL,
             colorSet = NULL,
             makePDFs = TRUE,
             writeScaled = FALSE,
             writeDE = TRUE,
             pCut = 0.05,
             dispMethod = "pooled",
             dispSharingMode = "maximum")

Arguments

countData

A data.frame or matrix with raw count data for each gene (row) and sample (column).

conditions

Character vector with the groups to be analyzed.

whichGeneNames

Numeric or character, which column has the gene names. Defaults to 0, which is rownames (preferred).

outNamePrefix

A string to prepend to written files; can included path specification.

comps

character vector of which contrasts to run in the format 1vs2 with numbers matching order of conditions above

conds

A character vector of the conditions for each column, matching the order of the columns in countData. If "NULL" (default) the function will use grep on conditions against column names to automatically generate the groups

colorSet

Vector of colors, specified in any valid R format, to use as labels for the conditions. If "NULL" (default), default colors will be used.

makePDFs

Logical, should figures be output as pdfs. If false, no figures will be generated.

writeScaled

Logical, should the scaled countData be written as a .txt file.

writeDE

Logical, should the DE results be written as .txt files.

pCut

What (FDR-corrected) q-value should be used as a cut-off.

dispMethod

Which method should be used for estimating dispersion by DESeq? See estimateDispersions for details and available options.

dispSharingMode

Which sharing mode should be used for estimating dispersion by DESeq? See estimateDispersions for details and available options.

Value

Writes txt and pdf files as run, and returns a list with:

deOutputs

A list with one data.frame for each contrast analyzed

normalizedReads

The normalized read data

isSignificant

A data.frame telling whether each gene is sig for each contrast

Author(s)

Mark Peterson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Only run if DESeq is available
if(require(DESeq)){

## Create an example count data set
exampleCounts <- counts(makeExampleCountDataSet())[1:500,]

## Note, from your data, this might look like:
# exampleCounts <- myInputData[,grep("READS",names(myInputData))]
# row.names(exampleCounts) <- myInputData$geneNameColumn

## Note, outputs save to disk are turned off
## Set each to TRUE to save to your working directory
test <- DESeqWrapper(exampleCounts,
                     conditions=c("A","B"),
                     writeScaled=FALSE,
                     writeDE=FALSE,
                     makePDFs=FALSE)

## Look at the outputs
head(test$deOutputs$AvsB)
head(test$normalizedReads)
head(test$isSignificant)

}

Example output

Loading required package: ecodist
Loading required package: gplots

Attaching package: 'gplots'

The following object is masked from 'package:stats':

    lowess

Loading required package: gtools
Loading required package: DESeq
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following object is masked from 'package:rnaseqWrapper':

    plotDispEsts

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22
Loading required package: lattice
    Welcome to 'DESeq'. For improved performance, usability and
    functionality, please consider migrating to 'DESeq2'.
preparing count table



Running Differential Expression Tests


	Testing:  A vs B 

         AvsB_isSig
gene_1_T      FALSE
gene_2_F      FALSE
gene_3_F      FALSE
gene_4_T      FALSE
gene_5_F      FALSE
gene_6_F      FALSE

rnaseqWrapper documentation built on May 2, 2019, 5:58 a.m.