This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DiffBind consensus peak set query

I know that in making a consensus peakset you can set a threshold of how many samples the peak has to occur in. However I want to know if you can also set this by group. Say I have 3 groups A, B and C and 4 samples in each. Instead of setting the threshold to occur in say 4 out of 12 samples can I specify that I only want to include peaks that occur in at least 2 out of 4 samples in each each group?

diffbind

1 answer

This is the consensus-of-consensus approach, where you first make a consensus peakset for each sample group, then combine them in an overall consensus you use for counting. This is discussed in Section 8.2 of the DiffBind vignette.

The workflow is as follows (assuming the group designation A, B, and C are stored as the Condition attribute):

myDBA <- dba(sampleSheet = "mysamples.csv")    
myDBA.cons <- dba.peakset(myDBA, consensus = DBA_CONDITION, minOverlap = 2)
myDBA.cons <- dba(myDBA.cons, mask = myDBA.cons$masks$Consensus, minOverlap = 1)
dba.plotVenn(myDBA.cons, mask = 1:3)
consensus.peaks <- dba.peakset(myDBA.cons, bRetrieve = TRUE)
myDBA.counts <- dba.count(myDBA, peaks = consensus.peaks)

Thank you so much Rory, that is really helpful!

Log in to answer this question.