Diffbind dba.analyze Error in d$span : $ operator is invalid for atomic vectors
3
1
Entering edit mode
danishm20 ▴ 10
@danishm20-7518
Last seen 9.7 years ago
United Kingdom

Dear Dr. Stark,

The following question has been asked before regarding error in dba.analyze step of diffBind when the contrast is set up for samples with no replicates. Obviously I should be comparing samples with multiple replicates but while I wait for more data from the sequencer it will be great if I could implement DiffBind for no replicates.

When I run dba.analyze step, I get the following error:

> dba.analyze(tf.chip)

Error in d$span : $ operator is invalid for atomic vectors
In addition: Warning messages:
1: Some groups have no replicates. Results may be unreliable.
2: In estimateCommonDisp(res) :
  There is no replication, setting dispersion to NA.
3: In estimateGLMCommonDisp.default(y = y$counts, design = design,  :
  No residual df: setting dispersion to NA
4: In estimateGLMTagwiseDisp.default(y = y$counts, design = design,  :
  No residual df: setting dispersion to NA
 

The warnings make complete sense but I am unable to figure out why it throws this error. I know you hate to deal with errors on data with no replicates but it will be great if you already know the solution for this one. See below for output of SessionInfo() command. Please let me know if more information is needed. Apologies for the trouble.

Cheers,

Danish.

 

> sessionInfo()

R version 3.1.0 (2014-04-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets
[8] methods   base     

other attached packages:
 [1] DiffBind_1.12.3         GenomicAlignments_1.2.2 Rsamtools_1.18.3       
 [4] Biostrings_2.34.1       XVector_0.6.0           limma_3.22.7           
 [7] GenomicRanges_1.18.4    GenomeInfoDb_1.2.4      IRanges_2.0.1          
[10] S4Vectors_0.4.0         BiocGenerics_0.12.1     BiocInstaller_1.16.2   

loaded via a namespace (and not attached):
 [1] amap_0.8-14        base64enc_0.1-2    BatchJobs_1.6      BBmisc_1.9        
 [5] BiocParallel_1.0.3 bitops_1.0-6       brew_1.0-6         caTools_1.17.1    
 [9] checkmate_1.5.2    codetools_0.2-11   DBI_0.3.1          digest_0.6.8      
[13] edgeR_3.8.6        fail_1.2           foreach_1.4.2      gdata_2.13.3      
[17] gplots_2.16.0      grid_3.1.0         gtools_3.4.1       iterators_1.0.7   
[21] KernSmooth_2.23-14 lattice_0.20-30    RColorBrewer_1.1-2 RSQLite_1.0.0     
[25] sendmailR_1.2-1    stringr_0.6.2      tools_3.1.0        zlibbioc_1.12.0  

diffbind • 2.8k views
ADD COMMENT
3
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

I've had a look, the issue is in edgeR -- it can;t compute a dispersion estimate without replicates and a later call fails.

You can run this with DESeq2 [dba.analyze(th.chip,method=DBA_DESEQ2)] and it computes a result, but the adjusted p-values are all pretty high. You can use this to calculate fold changes and rank the sites if you wish, but without replicates we can't get meaningful confidence statistics.

Cheers-

Rory

ADD COMMENT
0
Entering edit mode

Get it. Thanks a lot for the solution!

ADD REPLY
0
Entering edit mode

I have two replicates for each sample. but still get this error of "Error: $ operator is invalid for atomic vectors" with command dba.analyze(dbObj, method=DBA_ALL_METHODS). Actually, two replicates are acceptable to edgeR or DESEQ2. The version of DiffBind 3.8.4 is used in this analysis.

ADD REPLY
0
Entering edit mode

I'm unable to reproduce this on DiffBind_3.8.4. I created a two replicate per sample example was can run dba.analyze() with method=DBA_ALL_METHODS. Can you supply more information regarding your script up to the dba.analyze() call?

One thing to try as a workaround is to make two calls in succession:

dbObj <-  dba.analyze(dbObj, method=DBA_EDGER)
dbObj <-  dba.analyze(dbObj, method=DBA_DESEQ2)

and see it that works.

ADD REPLY
0
Entering edit mode

Thanks for your reply. This error disappears when I exit R and rerun. But a new error occurred with failed to open the port 11446, trying a new port... in dba.count(dbObj, minOverlap=1, score=DBA_SCORE_RPKM, bUseSummarizeOverlaps=TRUE, bParallel = TRUE).

ADD REPLY
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

Hi Danish-

I agree it shouldn't throw an exception. Could you send me a copy of your DBA object tf.chip so I can debug this?

Cheers-

Rory

ADD COMMENT
0
Entering edit mode
danishm20 ▴ 10
@danishm20-7518
Last seen 9.7 years ago
United Kingdom

Hi Rory,

Many thanks for the reply. I have emailed you .Rdata of tf.chip. Please let me know if more information is needed.

Cheers,

Danish.

ADD COMMENT

Login before adding your answer.

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