You can use the dba.report()
function in a special mode to get what you are interested in.
By setting bDB=TRUE
, dba.report()
will return a new DBA object containing different peaksets based on whether they are differentially bound and represent a gain or loss of binding. You can pass in a vector of contrasts to include differentially bound peaks from different comparisons, and a vector of analysis methods as well to compare sites from different analysis methods: eg. method=c(DBA_DESEQ2,DBA_DESEQ2_BLOCK)
.
The last code snippet on the help page shows an example -- I've highlighted the key line:
#Retrieve report-based DBA object
data(tamoxifen_counts)
tamoxifen <- dba.contrast(tamoxifen, categories=DBA_CONDITION, block=tamoxifen$masks$MCF7)
tamoxifen <- dba.analyze(tamoxifen,bCorPlot=FALSE)
tamoxifen.DB <- dba.report(tamoxifen,method=c(DBA_DESEQ2,DBA_DESEQ2_BLOCK),
bDB=TRUE, bGain=TRUE, bLoss=TRUE, bAll=FALSE)
dba.plotVenn(tamoxifen.DB,1:4,label1="Single Factor GAIN",label2="Single Factor LOSS",
label3="Blocking Factor GAIN",label4="Blocking Factor LOSS")
This feature should enable you to get what you need!
Cheers-
Rory