DiffBind 3.2 error
3
0
Entering edit mode
3.5 years ago
  • Hi, I am finding the differential peaks using DiffBind, but my sample has two replicates. And my code is

library("DiffBind")

siDDX5 <-dba(sampleSheet="siDDX5.csv")

siDDX5 <- dba.count(summits=FALSE,siDDX5, bUseSummarizeOverlaps=TRUE)

siDDX5 <- dba.contrast(siDDX5, categories=DBA_TREATMENT,minMembers =2)

siDDX5 <- dba.analyze(siDDX5, method=DBA_ALL_METHODS)

comp1.deseq <- dba.report(siDDX5, method=DBA_DESEQ2, contrast = 1, th=1)

out <- as.data.frame(comp1.deseq) deseq.bed <- out[ which(out$FDR < 0.1), c("seqnames", "start", "end", "strand", "Fold")] write.table(deseq.bed,file="results/siDDX5/siDDX5_vs_control_deseq2_sig.bed", sep="\t", quote=F, row.names=F, col.names=F)

  • But When performing the differential analysis, I got the following failure:

Analyzing...

Adding contrasts(s)...

Analyze error: Error in pv.DBA(DBA, method, bTagwise = bTagwise, minMembers = 3, bParallel = bParallel): Unable to perform analysis: no contrasts specified.

  • But I didn't have the same problem using DiffBind 3.0.15, my samplesheet is :

    siDDX5 <- dba(sampleSheet="siDDX5.csv")

siDDX5

4 Samples, 43921 sites in matrix (87804 total):

ID Treatment Replicate Intervals

1 Control1 Control 1 42372

2 Control2 Control 2 50406

3 siDDX5-1 siDDX5 1 66390

4 siDDX5-2 siDDX5 2 61316

  • I had another problem using DiffBind 3.0.15, but I find an a method a developer provided in biostar, that is a problem about Nomolize with default. I used dba.blacklist() before dba.count(). It works. I saw developers would solve the problem in DiffBind 3.2, so I have a try.Now I have a new problem. I can only use DiffBind 3.0.15 back
DiffBind R ChIP-seq • 5.9k views
ADD COMMENT
0
Entering edit mode
3.5 years ago
Rory Stark ★ 2.1k

In your script, you call dba.contrast() (with minMembers=2) before calling dba.analyze(). However the output you show says:

Analyzing...

Adding contrasts(s)...

dba.analyze() should only attempt to add contrasts if none have been added prior to the call. So I suspect that either a) the call to dba.contrast() didn't add any valid contrasts, or b) you are calling dba.analyze() on an object that hasn't had the contrasts added (it wouldn't be able to add the contrasts since you can not specify minMembers=2).

You can check for the first issue by making sure contrasts were added:

siDDX5 <- dba.contrast(siDDX5, categories=DBA_TREATMENT, minMembers =2)
dba.show(siDDX5, bContrasts=TRUE)
siDDX5 <- dba.analyze(siDDX5, method=DBA_ALL_METHODS)

If this doesn't check out, you can send me a link to your siDDX5 object (after the call to dba.count(), before the call to dba.contrast()) and I'll have a look.

ADD COMMENT
0
Entering edit mode

I have added dba.show(siDDX5, bContrasts=TRUE), but I got the same failure. Warning messages:

1: In .Seqinfo.mergexy(x, y) : Each of the 2 combined objects has sequence levels not in the other:

  • in 'x': chr2, chr3, chr5, chr7, chr8, chr9, chr10, chr11, chr16, chr17, chr19, chr20, chr21
  • in 'y': chr4, chr4_GL000008v2_random Make sure to always combine/compare objects based on the same reference genome (use suppressWarnings() to suppress this warning).

2: No contrasts added. There must be at least two sample groups with at least three replicates.
3: No contrasts added. There must be at least two sample groups with at least three replicates. Here is the siDDX5 object (after the call to dba.count(), before the call to dba.contrast()):

siDDX5

4 Samples, 43710 sites in matrix:

ID Treatment Replicate Reads FRiP

1 Control1 Control 1 25177288 0.18

2 Control2 Control 2 34144959 0.26

3 siDDX5-1 siDDX5 1 29878083 0.29

4 siDDX5-2 siDDX5 2 31768685 0.32

enter image description here

ADD REPLY
0
Entering edit mode

The call to dba.show() isn't meant to change anything, only to report if a contrast was added. What was returned from the call? With minMembers=2, a contrast should be added (Control vs siDDX5). If dba.show() returns NULL then there are no valid contrasts, which is why the dba.analyze() call is failing.

I still suspect that a contrast is being added, but the object passed in to dba.analyze() is not the same one as is being returned from dba.contrast().

I'd need to have access to the siDDX5 DBA object itself to see if I can reproduce this. You can save it to a file using dba.save() and either email it to me if it is not too large, or send me a link where I can download it (eg Dropbox).

ADD REPLY
0
Entering edit mode

content contained a link only that has been edited by a moderator.

ADD REPLY
0
Entering edit mode

the content has been classified as spam by an automated moderation system as it contained little more than a link.

I have now reverted that spam classification but also removed the link.

in general, asking people to download Rdata files off the web is not a good idea. the problem should be worked out with a toy example rather than the entire dataset

ADD REPLY
0
Entering edit mode

Alright, I have a link(OneDirve) this is a file using dba.save()

ADD REPLY
0
Entering edit mode
3.5 years ago
Rory Stark ★ 2.1k

I have run your code on your data object and am able to complete the analysis with no problem:

> siDDX5 <- dba.load("DBA")
> siDDX5 <- dba.contrast(siDDX5, categories=DBA_TREATMENT, minMembers=2)
Computing results names...
> siDDX5 <- dba.analyze(siDDX5, method=DBA_ALL_METHODS, 
                        bBlacklist=FALSE, bGreylist=FALSE)
Normalize edgeR with defaults...
Normalize DESeq2 with defaults...
Analyzing...
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
> siDDX5
4 Samples, 43710 sites in matrix:
        ID Treatment Replicate    Reads FRiP
1 Control1   Control         1 25177288 0.18
2 Control2   Control         2 34144959 0.26
3 siDDX5-1    siDDX5         1 29878083 0.29
4 siDDX5-2    siDDX5         2 31768685 0.32

Design: [~Treatment] | 1 Contrast:
     Factor  Group Samples  Group2 Samples2 DB.edgeR DB.DESeq2
1 Treatment siDDX5       2 Control        2        9      1794

There must be something you are not including in your description.

When I make the call to dba.contrast(), it adds one contrast. When the returned object is passed to dba.analyze(), it will not attempt to add more contrasts, so your reported message sequence:

Analyzing...

Adding contrasts(s)...

is not possible. Somehow, you are not passing the object returned from the dba.contrast() call to dba.analyze().

There is a bit of a complication relating to the blacklists and greylists; since I do not have your bam files, I can not create greylists to test, but nothing involved with greylists would make dba.analyze() attempt to add contrasts when a contrast is already present.

ADD COMMENT
0
Entering edit mode

Thank you for your reply. I have rerun the code and met the same error. So I used dba.blacklist()before dba.count(). It works with no problem this time. But in DiffBind 3.0, I can use dba.analyze() to deal with blacklists and greylists, I can't do the same thing in 3.2. I do not know why.

ADD REPLY
0
Entering edit mode

Hi,

I got similar error.

contrast has been added but still i get error in dba.analyze()

dba.show(hESC.contrast, bContrasts=TRUE) Factor Group Samples Group2 Samples2
1 Condition WT 2 KO 2

hESC.DE <- dba.analyze(hESC.contrast) Applying Blacklist/Greylists...

Genome detected: Hsapiens.UCSC.hg38 Applying

blacklist... Removed: 85 of 56365 intervals. Removed 85 (of 56365) consensus peaks. Normalize DESeq2 with defaults... Forming default model design and contrast(s)... Analyzing... Adding contrasts(s)... Analyze error: Error in pv.DBA(DBA, method, bTagwise = bTagwise, minMembers = 3, bParallel = bParallel): Unable to perform analysis: no contrasts specified. Unable to complete analysis. Warning messages: 1: No contrasts added.There must be at least two sample groups with at least three replicates. 2: No contrasts added. There must be at least two sample groups with at least three replicates.

ADD REPLY
0
Entering edit mode

I have received a number of reports of this issue. There appears to be a regression in DiffBind_3.2 (I suspect a bug fix from DiffBind_3.0 that did not get carried over to the new release). I have this on my issues list and will track it down when I get a chance; in the meantime, the workaround is to call dba.blacklist() directly, before calling dba.count(), or, if you need to blacklist after counting/forming the consensus peakset, calling dba.blacklist() followed by dba() prior to calling dba.analyze().

ADD REPLY
0
Entering edit mode

Hi Rory,

Thanks a-lot for the prompt response. calling dba.blacklist() directly, before calling dba.count() worked for me :)

ADD REPLY
0
Entering edit mode
3.4 years ago
Rory Stark ★ 2.1k

This turned out to be a bug that the previous fix did not address, arising when blacklisting was done both after counting and after adding a non-default contrast. I have checked in a fix that will be available as DiffBind_3_2_3 (or DiffBind_3.3.3 in the Development branch).

ADD COMMENT

Login before adding your answer.

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