Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/derfinderReport.R
This function generates a HTML report exploring the basic results from single base-level approach derfinder analysis results (<www.bioconductor.org/packages/derfinder>). The HTML report itself is generated using rmarkdown (http://rmarkdown.rstudio.com/). It works best after using mergeResults.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  | derfinderReport(
  prefix,
  outdir = "basicExploration",
  output = "basicExploration",
  project = prefix,
  browse = interactive(),
  nBestRegions = 100,
  makeBestClusters = TRUE,
  nBestClusters = 2,
  fullCov = NULL,
  hg19 = TRUE,
  p.ideos = NULL,
  txdb = NULL,
  device = "png",
  significantVar = "qvalue",
  customCode = NULL,
  template = NULL,
  theme = NULL,
  digits = 2,
  ...
)
 | 
prefix | 
 The main data directory path where
mergeResults was run. It should be the same as
  | 
outdir | 
 The name of output directory relative to   | 
output | 
 The name of output HTML file (without the html extension).  | 
project | 
 The title of the project.  | 
browse | 
 If   | 
nBestRegions | 
 The number of region plots to make, ordered by area.  | 
makeBestClusters | 
 If   | 
nBestClusters | 
 The number of region cluster plots to make by taking
the   | 
fullCov | 
 A list where each element is the result from
loadCoverage used with   | 
hg19 | 
 If   | 
p.ideos | 
 A list where each element is the result of
plotIdeogram. If it's   | 
txdb | 
 Specify the transcription database to use for making the plots
for the top regions by area. If   | 
device | 
 The graphical device used when knitting. See more at
http://yihui.name/knitr/options (  | 
significantVar | 
 A character variable specifying whether to use the
p-values, the FDR adjusted p-values or the FWER adjusted p-values to
determine significance. Has to be either   | 
customCode | 
 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.  | 
template | 
 Template file to use for the report. If not provided, will use the default file found in basicExploration/basicExploration.Rmd within the package source.  | 
theme | 
 A ggplot2 theme to use for the plots made with ggplot2.  | 
digits | 
 The number of digits to round to in the interactive table of
the top   | 
... | 
 Arguments passed to other methods and/or advanced arguments. Advanced arguments: 
 Passed to extendedMapSeqlevels.  | 
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. You can
also set the output_format to 'html_document' for a HTML
report styled by rmarkdown. The default is set to
'BiocStyle::html_document'.
If you modify the YAML front matter of template, you can use other
values for output_format.
The HTML report styled with knitrBootstrap can be smaller in size than the
'html_document' report.
An HTML report with a basic exploration of the derfinder results. See the example output at http://leekgroup.github.io/regionReport/reference/derfinderReport-example/basicExploration/basicExploration.html.
Leonardo Collado-Torres
mergeResults, analyzeChr, fullCoverage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74  | ## Load derfinder
library("derfinder")
## The output will be saved in the 'derfinderReport-example' directory
dir.create("derfinderReport-example", showWarnings = FALSE, recursive = TRUE)
## For convenience, the derfinder output has been pre-computed
file.copy(system.file(file.path("extdata", "chr21"),
    package = "derfinder",
    mustWork = TRUE
), "derfinderReport-example", recursive = TRUE)
## Not run: 
## If you prefer, you can generate the output from derfinder
initialPath <- getwd()
setwd(file.path(initialPath, "derfinderReport-example"))
## Collapse the coverage information
collapsedFull <- collapseFullCoverage(list(genomeData$coverage),
    verbose = TRUE
)
## Calculate library size adjustments
sampleDepths <- sampleDepth(collapsedFull,
    probs = c(0.5), nonzero = TRUE,
    verbose = TRUE
)
## Build the models
group <- genomeInfo$pop
adjustvars <- data.frame(genomeInfo$gender)
models <- makeModels(sampleDepths, testvars = group, adjustvars = adjustvars)
## Analyze chromosome 21
analyzeChr(
    chr = "21", coverageInfo = genomeData, models = models,
    cutoffFstat = 1, cutoffType = "manual", seeds = 20140330, groupInfo = group,
    mc.cores = 1, writeOutput = TRUE, returnOutput = FALSE
)
## Change the directory back to the original one
setwd(initialPath)
## End(Not run)
## Merge the results from the different chromosomes. In this case, there's
## only one: chr21
mergeResults(
    chrs = "21", prefix = "derfinderReport-example",
    genomicState = genomicState$fullGenome
)
## Load the options used for calculating the statistics
load(file.path("derfinderReport-example", "chr21", "optionsStats.Rdata"))
## Generate the HTML report
report <- derfinderReport(
    prefix = "derfinderReport-example", browse = FALSE,
    nBestRegions = 15, makeBestClusters = TRUE,
    fullCov = list("21" = genomeDataRaw$coverage), optionsStats = optionsStats
)
if (interactive()) {
    ## Browse the report
    browseURL(report)
}
## See the example output at
## http://leekgroup.github.io/regionReport/reference/derfinderReport-example/basicExploration/basicExploration.html
## Not run: 
## Note that you can run the example using:
example("derfinderReport", "regionReport", ask = FALSE)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.