This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error while invoking. dba.analyze() in DiffBind

Hi everyone, I'm getting errors while trying to run DiffBind - I spent hours trying to figure out what's going on to no avail, hoping some of you may help me figure out what I'm missing..

my design table:

SampleID Factor Condition Replicate    bamReads Peaks Tissue PeakCaller
A1 TF  A   1 A_day2_rep1.trim.filt.sort.bam A_day2_rep1.filt.narrowPeak.gz  Spl bed
A2 TF  A   2 A_day2_rep2.trim.filt.sort.bam A_day2_rep2.filt.narrowPeak.gz  Spl bed
A3 TF  A   3 A_day2_rep3.trim.filt.sort.bam A_day2_rep3.filt.narrowPeak.gz  Spl bed
B1 TF  B   1 B_day2.rep1.trim.filt.sort.bam B_day2_rep1.filt.narrowPeak.gz  Spl bed
B2 TF  B   2 B_day2.rep2.trim.filt.sort.bam B_day2_rep2.filt.narrowPeak.gz  Spl bed
B3 TF  B   3 B_day2.rep3.trim.filt.sort.bam B_day2_rep3.filt.narrowPeak.gz  Spl bed

then:

> set <- dba(sampleSheet = new.table)
> counts <- dba.count(set)
> res<- dba.contrast(set, set$masks$A, set$mask$B, "A", "B", minMembers=3,  categories=DBA_CONDITION)
> res<- dba.analyze(res)

And this is the error I'm getting:

Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent

This is first time I'm trying DiffBind and not sure what I'm doing wrong - appreciate any help/suggestions! Thank you

chip-seq software error r

1 answer

The problem is that you are passing in the original peak data set to dba.contrast() instead of the count data counts. The call should be:

res <- dba.contrast(counts, counts$masks$A, counts$mask$B, "A", "B")

Also, by explicitly specifying the A and B masks, you do not need to specify the minMembers or categories parameters (they will be ignored).

Ok awesome, that's so silly I missed that. Thank you!

Log in to answer this question.