Hi Jared,
Thanks for taking the time to respond!
Below is the code I am using to generate differential peaks. It is basically just what is outlined in the DiffBind vignette. You were correct to assume I was not providing anything to the peaks argument of the dba.count function and this does seem to be a sensible explanation for the error I am experiencing. I went ahead and read through the portion of the DiffBind Vignette that focuses on the generation of a consensus peakset and how to use the dba.peakset to generate consensus peaksets for each condition as opposed to a single consensus set. I followed those instructions and introduced the changes into my code below as well. This seems to have essentially fixed my problem. The results are not identical to if I would have run the code for each contrast on its own but, but all of the differential peaks that have been identified by DESEQ2 are at least sensible in that they seem to be supported by the at least two replicates Interestingly, the number of differential peaks identified by EDGER for every contrast far outnumber those identified by DESEQ, although many do overlap. EDGER did still identify some peaks that do not appear sensible and there was some mismatch in the differential peaks identified by DESEQ2 for the individual contrast vs. the entire set of contrasts with provide peak files.
(linking and .img did not seem to work)
It seems that the consensus set is generated from all peaks that appears in more than two of the provided samples. The use of this consensus peakset seemed to introduce some issues into the differential peaks identified when providing DiffBind with more than two conditions. (This is just my interpretation of the problem and may not be totally or even partially correct). Specifying consensus peaksets with the dba.peakset functions seemed to fix these problems, but still lead to different identification than if the individual contrast was run with no consensus peak set specified.
This brings about the question of is there a best method or most appropriate method for designating a consensus peakset? The goal obviously being to get the most reliable set of differential peaks. I am happy in that when I now visualize the peaks they seem appropriate, but how can I be sure that I am not missing peaks that could be classified as significantly differential based on the method used to establish a consensus peakset? This last question is likely more of discussion than a correct or incorrect answer, but I may be wrong about that.
Again, thanks for the assistance Jared, it is greatly appreciated!
suppressMessages(library(tidyverse))
suppressMessages(library(DiffBind))
suppressMessages(library(ChIPQC))
suppressMessages(library(BiocParallel))
setwd("~/H3K27ac Analysis")
samples <- read.csv('H3K27ac_datasheet.csv')
samples
dbObj <- dba(sampleSheet=samples)
dbObj_consensus <- dba.peakset(dbObj, consensus = DBA_CONDITION, minOverlap=0.66)
dbObj_consensus <- dba(dbObj_consensus, mask = dbObj_consensus$masks$Consensus, minOverlap=1)
consensus_peaks <- dba.peakset(dbObj_consensus, bRetrieve=TRUE)
dbObj_dba.count <- dba.count(dbObj, bParallel = FALSE)
dbObj_dba.count
dbObj_dba.contrast <- dba.contrast(dbObj_dba.count, categories=DBA_CONDITION, minMembers = 2)
dbObj_dba.contrast
dbObj_dba.analyze <- dba.analyze(dbObj_dba.contrast, method = DBA_ALL_METHODS)
dbObj_dba.analyze