dba.plotVenn {DiffBind} | R Documentation |
Draws 2-way, 3-way, or 4-way Venn diagrams of overlaps
dba.plotVenn(DBA, mask, overlaps, label1, label2, label3, label4, main, sub, contrast, method=DBA$config$AnalysisMethod, th=DBA$config$th, bUsePval=DBA$config$bUsePval, bDB=TRUE, bNotDB, bAll=TRUE, bGain=FALSE, bLoss=FALSE, labelAttributes, DataType=DBA$config$DataType)
DBA |
DBA object; if present, only the mask parameter will apply. |
mask |
mask or vector of peakset numbers indicating which peaksets to include in Venn diagram.
Only 2 or 3 peaksets should be included.
See |
overlaps |
overlap record, as computed by |
label1 |
label for first peakset in diagram |
label2 |
label for second peakset in diagram |
label3 |
label for third peakset in diagram |
label4 |
label for fourth peakset in diagram |
main |
main title for plot |
sub |
subtitle for plot |
contrast |
contrast number(s) to use for results-based plots.
This can be a vector of contrast numbers.
See |
method |
if |
th |
if |
bUsePval |
if |
bDB |
if |
bNotDB |
if |
bAll |
if |
bGain |
if |
bLoss |
if |
labelAttributes |
if Only specified attributes that differ between peaksets will be used for labels; the ones that have the same value for all peaksets will be used as the default subtitle. |
DataType |
if Can be set as default behavior by setting Alternatively, this can be set to: to return a results-based DBA object, if a |
Either a list of peaksets is returned invisibly (as described in dba.overlap
), or, if DataType=DBA_DATA_DBAOBJECT
, a results-based DBA object.
When working with results overlaps (a least one contrast
is specified), and results-oriented DBA object is generated internally (as described in dba.report
). In some cases, it may be better to generate the DBA object explicitly (using dba.report
or setting bReturnPeaksets=TRUE
and DataType=DBA_DATA_DBAOBJECT
). This include the case where several plots are being made of the same results set, and it takes a long time to generate the results-based DBA object, as well as the case where there are more than four results peaksets and a mask needs to be specified. I
This function relies on vennPlot
in the systemPipeR
package, written by Thomas Girke.
Rory Stark
dba.analyze
, dba.overlap
,
dba.report
, dba.plotPCA
,
vennPlot
data(tamoxifen_peaks) par(mfrow=c(2,2)) # 2-way Venn dba.plotVenn(tamoxifen,6:7) dba.plotVenn(tamoxifen,tamoxifen$masks$ZR75) # 3-way Venn (done two different ways) dba.plotVenn(tamoxifen,tamoxifen$masks$MCF7&tamoxifen$masks$Responsive) olaps <- dba.overlap(tamoxifen,tamoxifen$masks$MCF7&tamoxifen$masks$Responsive) dba.plotVenn(tamoxifen,overlaps=olaps, label1="Rep 1",label2="Rep 2",label3="Rep 3", main="MCF7 (Responsive) Replicates") #Venn of overlaps Responsive=dba(tamoxifen,tamoxifen$masks$Responsive) Responsive Responsive <- dba.peakset(Responsive,1:3,sampID="MCF7") Responsive <- dba.peakset(Responsive,4:5,sampID="T47D") Responsive <- dba.peakset(Responsive,6:7,sampID="ZR75") par(mfrow=c(1,1)) dba.plotVenn(Responsive,Responsive$masks$Consensus) #4-way overlap data(tamoxifen_peaks) tamoxifen <- dba.peakset(tamoxifen, consensus=DBA_TISSUE) par(mfrow=c(1,1)) dba.plotVenn(tamoxifen,tamoxifen$masks$Consensus, main="Tissue consensus overlaps") #Venns of differentially bound sites data(tamoxifen_counts) tamoxifen <- dba.contrast(tamoxifen,design="~Tissue+Condition") tamoxifen <- dba.analyze(tamoxifen,method=c(DBA_EDGER,DBA_DESEQ2)) dba.plotVenn(tamoxifen,contrast=1,method=DBA_ALL_METHODS, bAll=FALSE,bGain=TRUE,bLoss=TRUE) par(mfrow=c(2,1)) dba.plotVenn(tamoxifen,contrast=1,method=DBA_ALL_METHODS, bAll=FALSE,bGain=TRUE,bLoss=FALSE) dba.plotVenn(tamoxifen,contrast=1,method=DBA_ALL_METHODS, bAll=FALSE,bGain=FALSE,bLoss=TRUE) data(tamoxifen_counts) tamoxifen <- dba.contrast(tamoxifen,design=FALSE,block=DBA_TISSUE) tamoxifen <- dba.contrast(tamoxifen,design="~Tissue + Condition", contrast=c("Condition","Responsive","Resistant")) tamoxifen <- dba.analyze(tamoxifen,method=DBA_ALL_METHODS) dba.plotVenn(tamoxifen,contrast=1:2,method=c(DBA_DESEQ2,DBA_DESEQ2_BLOCK)) tamoxifen.db <- dba.report(tamoxifen,contrast=1:2,method=DBA_ALL_METHODS_BLOCK, bDB=TRUE) dba.plotVenn(tamoxifen.db,mask=1:2) dba.plotVenn(tamoxifen.db,mask=3:6)