Learn R Programming

regionReport (version 1.2.1)

derfinderReport: Generate a HTML report exploring the basic results from derfinder

Description

This function generates a HTML report exploring the basic results from derfinder (https://github.com/lcolladotor/derfinder). The HTML report itself is generated using knitrBoostrap which uses knitr (http://yihui.name/knitr/) behind the scenes. It works best after using mergeResults.

Usage

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 = "CairoPNG", ...)

Arguments

prefix
The main data directory path where mergeResults was run. It should be the same as mergeResults(prefix).
outdir
The name of output directory relative to prefix.
output
The name of output HTML file (without the html extension).
project
The title of the project.
browse
If TRUE the HTML report is opened in your browser once it's completed.
nBestRegions
The number of region plots to make, ordered by area.
makeBestClusters
If TRUE, plotCluster is used on the nBestClusters regions by area. Note that these plots take some time to make.
nBestClusters
The number of region cluster plots to make by taking the nBestClusters regions ranked by area of the cluster.
fullCov
A list where each element is the result from loadCoverage used with cutoff=NULL. Can be generated using fullCoverage.
hg19
If TRUE then the reference is assumed to be hg19 and chromosome lengths as well as the default transcription database (TxDb.Hsapiens.UCSC.hg19.knownGene) will be used.
p.ideos
A list where each element is the result of plotIdeogram. If it's NULL and hg19=TRUE then they are created for the hg19 human reference.
txdb
Specify the transcription database to use for making the plots for the top regions by area. If NULL and hg19=TRUE then TxDb.Hsapiens.UCSC.hg19.knownGene is used.
device
The graphical device used when knitting. See more at http://yihui.name/knitr/options (dev argument).
...
Arguments passed to other methods and/or advanced arguments.

Value

An HTML report with a basic exploration of the derfinder results.

See Also

mergeResults, analyzeChr, fullCoverage

Examples

Run this code
## 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=1, makeBestClusters=FALSE,
    fullCov=list('21'=genomeDataRaw$coverage), optionsStats=optionsStats)


if(interactive()) {
    ## Browse the report
    browseURL(report)
}

## Not run: 
# ## Note that you can run the example using:
# example('derfinderReport', 'regionReport', ask=FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab