This function generates a HTML report with exploratory data analysis plots
for edgeR results created. Other output formats are possible such as PDF
reports but they lose the interactivity. Users can easily append
to the report by providing a R Markdown file to customCode
, or can
customize the entire template by providing an R Markdown file to
template
.
edgeReport(
dge,
object,
project = "",
intgroup,
colors = NULL,
pAdjustMethod = "BH",
alpha = 0.1,
independentFiltering = FALSE,
filter,
theta,
filterFun,
nBest = 500,
nBestFeatures = 20,
customCode = NULL,
outdir = "edgeRexploration",
output = "edgeRexploration",
browse = interactive(),
device = "png",
template = NULL,
searchURL = "http://www.ncbi.nlm.nih.gov/gene/?term=",
theme = NULL,
digits = 2,
...
)
A DGEList object.
A DGEExact or
DGELRT object that contains p-values stored in
object$table$PValue
.
The title of the project.
interesting groups: a character vector of names in
colData(x)
to use for grouping. This parameter is passed to functions
such as plotPCA.
vector of colors used in heatmap. If NULL
, then a
a default set of colors will be used. This argument is passed to
pheatmap.
the method to use for adjusting p-values, see p.adjust. This argument will be passed to results.
the significance cutoff used for optimizing the independent filtering (by default 0.1). If the adjusted p-value cutoff (FDR) will be a value other than 0.1, alpha should be set to that value. This argument will be passed to results.
logical, whether independent filtering should be
applied automatically. By default it's set to FALSE
in contrast with
the default used in results to match edgeR
's behavior.
the vector of filter statistics over which the independent filtering
will be optimized. By default the logCPM will be used if
independentFiltering
is set to TRUE
. It can also be a length
1 character vector specifying one of the column names of object$table
.
the quantiles at which to assess the number of rejections from independent filtering. This argument is passed results.
an optional custom function as described in results.
The number of features to include in the interactive table. Features are ordered by their adjusted p-values.
The number of best features to make plots of their counts. We recommend a small number, say 20.
An absolute path to a child R Markdown file with code to be evaluated before the reproducibility section. Its useful for users who want to customize the report by adding conclusions derived from the data and/or further quality checks and plots.
The name of output directory.
The name of output HTML file (without the html extension).
If TRUE
the HTML report is opened in your browser once
it's completed.
The graphical device used when knitting. See more at
http://yihui.name/knitr/options (dev
argument).
Template file to use for the report. If not provided, will use the default file found in DESeq2Exploration/DESeq2Exploration.Rmd within the package source.
A url used for searching the name of the features in
the web. By default http://www.ncbi.nlm.nih.gov/gene/?term=
is used
which is the recommended option when features are genes. It's only used
when the output is a HTML file.
A ggplot2 theme to use for the plots made with ggplot2.
The number of digits to round to in the interactive table of
the top nBestFeatures
. Note that p-values and adjusted p-values won't
be rounded.
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
The name of the package used for performing the
differential expression analysis. Either DESeq2
or edgeR
.
A DGEList object. NULL
by default and only
used by edgeReport.
The function call. NULL
by default and only used by
edgeReport.
Either html_document
, pdf_document
or
knitrBootstrap::bootstrap_document
unless you modify the YAML
template.
Logical, whether to clean the results or not. Passed to render.
An HTML report with a basic exploration for the given set of edgeR results. See the example report at http://leekgroup.github.io/regionReport/reference/edgeReport-example/edgeRexploration.html.
Set output_format
to 'knitrBootstrap::bootstrap_document'
or
'pdf_document'
if you want a HTML report styled by knitrBootstrap or
a PDF report respectively. If using knitrBootstrap, we recommend the version
available only via GitHub at https://github.com/jimhester/knitrBootstrap
which has nicer features than the current version available via CRAN.
If you modify the YAML front matter of template
, you can use other
values for output_format
.
This report is similar to the one created by DESeq2Report with two additional plots exclusive for edgeR results. We designed the reports to be very similar intentionally and use the Bioconductor package DEFormats to achieve this goal.
## Create example data using DEFormats
library("DEFormats")
set.seed(20160407)
counts <- simulateRnaSeqData()
group <- rep(c("A", "B"), each = 3)
## Create DGEList object
library("edgeR")
#> Loading required package: limma
#>
#> Attaching package: 'limma'
#> The following object is masked from 'package:DEXSeq':
#>
#> plotMA
#> The following object is masked from 'package:DESeq2':
#>
#> plotMA
#> The following object is masked from 'package:BiocGenerics':
#>
#> plotMA
#>
#> Attaching package: 'edgeR'
#> The following object is masked from 'package:DEFormats':
#>
#> DGEList
dge <- DGEList(counts, group = group)
## Perform DE analysis with edgeR
design <- model.matrix(~group)
dge <- estimateDisp(dge, design)
fit <- glmFit(dge, design)
lrt <- glmLRT(fit, coef = 2)
## The output will be saved in the 'edgeReport-example' directory
dir.create("edgeReport-example", showWarnings = FALSE, recursive = TRUE)
## Generate the HTML report
report <- edgeReport(dge, lrt,
project = "edgeR-example", intgroup = "group",
outdir = "edgeReport-example"
)
#> Writing 12 Bibtex entries ...
#> OK
#> Results written to file 'edgeReport-example/edgeRexploration.bib'
#>
#>
#> processing file: edgeRexploration.Rmd
#>
|
| | 0%
|
|.. | 2%
|
|.... | 4% (docSetup)
|
|...... | 6%
|
|........ | 9% (setup)
|
|.......... | 11%
|
|........... | 13% (PCA)
|
|............. | 15%
|
|............... | 17% (sampleDist)
|
|................. | 19%
|
|................... | 21% (MAplotalpha)
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#>
|
|..................... | 23%
|
|....................... | 26% (MAplotalphaHalf)
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#>
|
|......................... | 28%
|
|........................... | 30% (MAplotalpha-nBest)
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#> Warning: "alpha" is not a graphical parameter
#>
|
|............................. | 32%
|
|............................... | 34% (pvalueHistogram)
|
|................................. | 36%
|
|.................................. | 38% (pvalueSumm)
|
|.................................... | 40%
|
|...................................... | 43% (pvalueTable)
|
|........................................ | 45%
|
|.......................................... | 47% (padjHistogram)
|
|............................................ | 49%
|
|.............................................. | 51% (padjSumm)
|
|................................................ | 53%
|
|.................................................. | 55% (padjTable)
|
|.................................................... | 57%
|
|...................................................... | 60% (topFeatures)
|
|........................................................ | 62%
|
|......................................................... | 64% (plotCounts)
|
|........................................................... | 66%
|
|............................................................. | 68% (edgeR-BCV)
|
|............................................................... | 70%
|
|................................................................. | 72% (edgeR-MDS)
|
|................................................................... | 74%
|
|..................................................................... | 77% (unnamed-chunk-1)
|
|....................................................................... | 79%
|
|......................................................................... | 81% (thecall)
|
|........................................................................... | 83%
|
|............................................................................. | 85% (reproducibility1)
|
|............................................................................... | 87%
|
|................................................................................ | 89% (reproducibility2)
|
|.................................................................................. | 91%
|
|.................................................................................... | 94% (reproducibility3)
|
|...................................................................................... | 96%
|
|........................................................................................ | 98% (bibliography)
|
|..........................................................................................| 100%
#> output file: edgeRexploration.knit.md
#> /usr/local/bin/pandoc +RTS -K512m -RTS edgeRexploration.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output edgeRexploration.html --lua-filter /__w/_temp/Library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /usr/local/lib/R/site-library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --wrap preserve --variable bs3=TRUE --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /tmp/RtmpoLEapv/BiocStyle/template.html --no-highlight --variable highlightjs=1 --number-sections --variable theme=bootstrap --css /__w/_temp/Library/BiocStyle/resources/html/bioconductor.css --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/RtmpoLEapv/rmarkdown-str8481ee49380.html --variable code_folding=hide --variable code_menu=1
#>
#> Output created: edgeRexploration.html
if (interactive()) {
## Browse the report
browseURL(report)
}
## See the example report at
## http://leekgroup.github.io/regionReport/reference/edgeReport-example/edgeRexploration.html
if (FALSE) {
## Note that you can run the example using:
example("edgeReport", "regionReport", ask = FALSE)
}