DiffBind error: No contrasts added. There must be at least two sample groups with at least three replicates.
1
0
Entering edit mode
16 months ago
hdu2 • 0

Hi, I am doing the differential peaks analysis using DiffBind. My sample has two replicates. And my code is the following:

samples <- read.csv("H101.csv")

dbObj <- dba(sampleSheet=samples)
H101C_H1  H3K27ac Responsive Full-media 1 bed
H101C_H2  H3K27ac Responsive Full-media 2 bed
H101RP_H1  H3K27ac Resistant Full-media 1 bed
H101RP_H2  H3K27ac Resistant Full-media 2 bed

 dbObj

4 Samples, 10143 sites in matrix:
         ID  Factor  Condition  Treatment Replicate Intervals
1  H101C_H1 H3K27ac Responsive Full-media         1      5348
2  H101C_H2 H3K27ac Responsive Full-media         2      5348
3 H101RP_H1 H3K27ac  Resistant Full-media         1      4808
4 H101RP_H2 H3K27ac  Resistant Full-media         2      4808

 dbObj <- dba.blacklist(dbObj, blacklist=DBA_BLACKLIST_HG38)

Genome detected: Hsapiens.UCSC.hg38
Applying blacklist...
Removed: 120 of 20312 intervals.
Counting control reads for greylist...
Building greylist: reads/H101C_Input_chr1_sorted.bam
coverage: 2437116 bp (0.98%)
Building greylist: reads/H101RP_Input_chr1_sorted.bam
coverage: 5649399 bp (2.27%)
H101RP_C: 1003 ranges, 5649399 bases
Master greylist: 1013 ranges, 5724151 bases
Removed: 4054 of 20192 intervals.
Removed: 2084 merged (of 10143) and 2084 (of 10143) consensus.

 dbObj <- dba.count(dbObj, bUseSummarizeOverlaps=TRUE)
Computing summits...
Re-centering peaks...

 dbObj <- dba.contrast(dbObj, reorderMeta=list(Condition="Responsive"))
Warning message:
No contrasts added. There must be at least two sample groups with at least three replicates. 

I also tried the following code and got the same warning message.

dbObj <- dba.contrast(dbObj, categories=DBA_TISSUE, minMembers = 2)

Besides, as some people suggested before, I also tried to do dba.blacklist first before dba.count. But it still didn't work. Then I also extracted all the reads and peaks only from Chr 1, it still didn't work.

Further, I copied all the files and codes to another computer and tried again. Then I got some other random error messages...

The only things worked were those demo files from this package...

Can anyone help me to figure it out? Thank you.

ChIP-seq DiffBind • 1.7k views
ADD COMMENT
0
Entering edit mode
16 months ago
Rory Stark ★ 2.0k

With your sample sheet, the following should work:

dbObj <- dba.contrast(dbObj, minMembers=2, 
                      reorderMeta=list(Condition="Responsive"))

This can be done in a more explicit way in two steps, using the design parameter (not categories) to indicate which metadata values you want to use to set up the contrast:

dbObj <- dba.contrast(dbObj, design="~Condition",
                      reorderMeta=list(Condition="Responsive"))
dbObj <- dba.contrast(minMembers=2)
ADD COMMENT

Login before adding your answer.

Traffic: 1331 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