Last data update: 2014.03.03

R: Boxplots
dba.plotBoxR Documentation

Boxplots

Description

Boxplots for read count distributions within differentially bound sites

Usage

dba.plotBox(DBA, contrast=1, method=DBA$config$AnalysisMethod, 
            th=DBA$config$th, bUsePval=DBA$config$bUsePval, 
            bNormalized=TRUE, attribute=DBA_GROUP, 
            bAll=FALSE, bAllIncreased=FALSE, bAllDecreased=FALSE, 
            bDB=TRUE, bDBIncreased=TRUE, bDBDecreased=TRUE,
            pvalMethod=wilcox.test,  bReversePos=FALSE, attribOrder, 
            vColors, varwidth=TRUE, notch=TRUE, ...) 

Arguments

DBA

DBA object.

contrast

number of contrast to use for boxplot.

method

method used for analysis (used in conjunction with contrast):

  • DBA_DESEQ2

  • DBA_DESEQ2_BLOCK

  • DBA_EDGER

  • DBA_EDGER_BLOCK

th

significance threshold; all sites with FDR (or p-values, see bUsePval) less than or equal to this value will be included in the boxplot.

bUsePval

logical indicating whether to use FDR (FALSE) or p-value (TRUE) for thresholding.

bNormalized

logical indicating that normalized data (using normalization factors computed by differential analysis method) should be plotted. FALSE uses raw count data.

attribute

attribute to use for determining groups of samples. Default (DBA_GROUP) plots the two groups used in the contrast. Possible values:

  • DBA_GROUP

  • DBA_ID

  • DBA_TISSUE

  • DBA_FACTOR

  • DBA_CONDITION

  • DBA_TREATMENT

  • DBA_REPLICATE

  • DBA_CONSENSUS

  • DBA_CALLER

bAll

logical indicating if plot should include a set of boxplots using all counts, regardless of whether or not they pass the significance threshold.

bAllIncreased

logical indicating if plot should include a set of boxplots using all counts that increase in affinity, regardless of whether or not they pass the significance threshold.

bAllDecreased

logical indicating if plot should include a set of boxplots using all counts that decrease in affinity, regardless of whether or not they pass the significance threshold.

bDB

logical indicating if plot should include a set of boxplots using all counts in significantly differentially bound sites (i.e. those that pass the significance threshold), regardless of whether they increase or decrease in affinity.

bDBIncreased

logical indicating if plot should include a set of boxplots using all counts in significantly differentially bound sites that increase in affinity.

bDBDecreased

logical indicating if plot should include a set of boxplots using all counts in significantly differentially bound sites that decrease in affinity.

pvalMethod

method to use when computing matrix of p-values. If NULL, no matrix is computed, and NULL is returned; this may speed up processing if there are many boxplots.

bReversePos

logical indicating if the default definition of positive affinity (higher affinity in the second group of the contrast) should be reversed (i.e. positive affinity is defined as being higher in the first group of the contrast).

attribOrder

vector of group numbers used to change the order that groups are plotted. If NULL, default order is used (group order for DBA_GROUP, and the order the attribute values appear for other values of attribute).

vColors

vector of custom colors; if absent, default colors will be used.

varwidth

passed to boxplot

notch

passed to boxplot

...

other arguments passed to boxplot

Details

Draws a boxplot showing distributions of read counts for various groups of samples under various conditions. In default mode, draws six boxes: one pair of boxes showing the distribution of read counts within all significantly differentially bound sites (one box for each sample group), one pair of boxes showing the distribution of read counts for significantly differentially bound sites that increase affinity in the second group, and a second pair of boxes showing the distribution of read counts for significantly differentially bound sites that have higher mean affinity in the first group.

Value

if pvalMethod is not NULL, returns a matrix of p-values indicating the significance of the difference between each pair of distributions.

Author(s)

Rory Stark

Examples

data(tamoxifen_analysis)

#default boxplot includes all DB sites, then divided into those increasing 
# affinity in each group
dba.plotBox(tamoxifen)

# plot non-normalized data for DB sites by tissue
# (changing order to place Resistant samples last)
dba.plotBox(tamoxifen, attribute=DBA_CONDITION, bDBIncreased=FALSE,
            bDBDecreased=FALSE, attribOrder=c(2,1), bNormalized=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DiffBind)
Loading required package: GenomicRanges
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 objects are masked from 'package:stats':

    IQR, mad, xtabs

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

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, 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, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

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

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
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")'.


> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/DiffBind/dba.plotBox.Rd_%03d_medium.png", width=480, height=480)
> ### Name: dba.plotBox
> ### Title: Boxplots
> ### Aliases: dba.plotBox
> 
> ### ** Examples
> 
> data(tamoxifen_analysis)
> 
> #default boxplot includes all DB sites, then divided into those increasing 
> # affinity in each group
> dba.plotBox(tamoxifen)
> 
> # plot non-normalized data for DB sites by tissue
> # (changing order to place Resistant samples last)
> dba.plotBox(tamoxifen, attribute=DBA_CONDITION, bDBIncreased=FALSE,
+             bDBDecreased=FALSE, attribOrder=c(2,1), bNormalized=FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>