to call differential peaks among 4 peaksets all together using DiffBind
1
0
Entering edit mode
yiweihe • 0
@yiweihe-9969
Last seen 8.7 years ago

Hi All,

I am trying to call differential peaks in pairs, each of my mutants (3 in total) from the same WT, within one single run.

I firstly created a dba object of my 4 strains in triplicates:

> samples

12 Samples, 419 sites in matrix (553 total):
               ID Tissue Factor    Condition Replicate Caller Intervals
1            WT-1     SC    DNA           WT         1   MACS       312
2            WT-2     SC    DNA           WT         2   MACS       343
3            WT-3     SC    DNA           WT         3   MACS       308
4          rif1-1     SC    DNA         rif1         1   MACS       418
5          rif1-2     SC    DNA         rif1         2   MACS       395
6          rif1-3     SC    DNA         rif1         3   MACS       449
7      fkh1fkh2-1     SC    DNA     fkh1fkh2         1   MACS       314
8      fkh1fkh2-2     SC    DNA     fkh1fkh2         2   MACS       392
9      fkh1fkh2-3     SC    DNA     fkh1fkh2         3   MACS       397
10 fkh1fkh2rif1-1     SC    DNA fkh1fkh2rif1         1   MACS       439
11 fkh1fkh2rif1-2     SC    DNA fkh1fkh2rif1         2   MACS       444
12 fkh1fkh2rif1-3     SC    DNA fkh1fkh2rif1         3   MACS       493

and then added consensus peaksets of each of the strain:

> samples = dba.peakset(samples, consensus = DBA_CONDITION, minOverlap = 3)
Add consensus: WT
Add consensus: rif1
Add consensus: fkh1fkh2
Add consensus: fkh1fkh2rif1

> samples_consensus = dba(samples, mask = samples$masks$`Replicate.1-2-3`, minOverlap = 3)

> samples_consensus
4 Samples, 385 sites in matrix:
            ID Tissue Factor    Condition Replicate Caller Intervals
1           WT     SC    DNA           WT     1-2-3 counts       385
2         rif1     SC    DNA         rif1     1-2-3 counts       385
3     fkh1fkh2     SC    DNA     fkh1fkh2     1-2-3 counts       385
4 fkh1fkh2rif1     SC    DNA fkh1fkh2rif1     1-2-3 counts       385

So I got these erorrs when I tried to add contrast: 
> samples_consensus = dba.contrast(samples_consensus, categories = DBA_CONDITION, minMembers = 3)
Warning message:
No contrasts added. Perhaps try more categories, or lower value for minMembers. 
> samples_consensus = dba.contrast(samples_consensus, categories = DBA_CONDITION, minMembers = 1)
Error in dba.contrast(samples_consensus, categories = DBA_CONDITION, minMembers = 1) : 
  minMembers must be at least 2. Use of replicates strongly advised.

How do I fix the error or is there a better way to do this? Thank you!

 

diffbind without replicate • 1.6k views
ADD COMMENT
0
Entering edit mode
Gord Brown ▴ 670
@gord-brown-5664
Last seen 3.9 years ago
United Kingdom

Hi,

When you create the consensus object, with just 4 peak sets, one for each condition, you're losing information about variability within conditions, which is critical for the statistics to work.  From DiffBind's perspective, when you extract the 4 consensus regions and create the samples_consensus object, you're creating a new object, with 4 samples, each a singleton.  The fact that they were originally consensus peaks has been lost, so DiffBind can't work with them.

The right thing to do is run the analysis on the original samples object.  It might look like this:

> samples_counts = dba.count(samples)

> samples_contrasts = dba.contrast(samples_counts, categories=DBA_CONDITION)

> samples_analysis = dba.analyze(samples_contrasts, ... )

DiffBind will take care of creating the consensus peaks, using all the samples, in the dba.count step, then run the statistical analysis using EdgeR or DESeq2, depending on the "..." parameters to dba.analyze. (DESeq is deprecated in favour of DESeq2.)

Let me know if you need further clarification.

Cheers,

 - Gord

ADD COMMENT
0
Entering edit mode

Hi Gord,

Thank you so much for your help!

I was originally run this analysis on the "samples" object exactly like what you said. However, at the dba.analyze step, I got this error: 

Error in topTags(con$edgeR$db, nrow(counts)) : 
Need to run exactTest or glmLRT first

and I don't know exactly what to do with it and that is the reason why I changed the strategy. Do you have any idea how to fix this error? Thank you!

Yiwei 

 

ADD REPLY
0
Entering edit mode

I haven't seen this error.  Can you share (or email me directly, address on the DiffBind page) the exact script you used, and possibly your sample sheet and dba object (after dba.count)?  It looks as though the EdgeR differential analysis step failed somehow, and DiffBind is going ahead to try to generate results.  But I'll need some data to investigate more closely.

ADD REPLY

Login before adding your answer.

Traffic: 689 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6