DESeq2 error on function results
1
0
Entering edit mode
jrossol • 0
@jrossol-23000
Last seen 5.7 years ago

I am trying to perform differential analysis on gene data but I am struggling to solve the following error. After creating the DESeqDataSet object with DESeq() function I am trying to get the result tables by using the result() function on the DESeqDataSet object ds generated as follows:

results( ds, contrast = c("clinical_group", "Treatment", "Control") )

but I am getting an error

'Error in .wrap_in_length_one_list_like_object(value, name, x) : 
  failed to coerce 'list(value)' to a DESeqResults object of length 1'

Any ideas? I am using DESeq2 version 1.20.0

My sessionInfo()

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=Spanish_Spain.1252  LC_CTYPE=Spanish_Spain.1252    LC_MONETARY=Spanish_Spain.1252
[4] LC_NUMERIC=C                   LC_TIME=Spanish_Spain.1252    

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

other attached packages:
 [1] DESeq2_1.20.0               SummarizedExperiment_1.16.1 DelayedArray_0.12.2        
 [4] BiocParallel_1.20.1         matrixStats_0.55.0          Biobase_2.46.0             
 [7] GenomicRanges_1.38.0        GenomeInfoDb_1.22.0         IRanges_2.20.2             
[10] S4Vectors_0.24.3            BiocGenerics_0.32.0        

loaded via a namespace (and not attached):
 [1] bit64_0.9-7            splines_3.6.2          Formula_1.2-3          assertthat_0.2.1      
 [5] latticeExtra_0.6-29    blob_1.2.1             GenomeInfoDbData_1.2.2 yaml_2.2.1            
 [9] pillar_1.4.3           RSQLite_2.2.0          backports_1.1.5        lattice_0.20-38       
[13] glue_1.3.1             digest_0.6.24          RColorBrewer_1.1-2     XVector_0.26.0        
[17] checkmate_2.0.0        colorspace_1.4-1       htmltools_0.4.0        Matrix_1.2-18         
[21] XML_3.99-0.3           pkgconfig_2.0.3        genefilter_1.68.0      zlibbioc_1.32.0       
[25] purrr_0.3.3            xtable_1.8-4           scales_1.1.0           jpeg_0.1-8.1          
[29] htmlTable_1.13.3       tibble_2.1.3           annotate_1.64.0        ggplot2_3.2.1         
[33] nnet_7.3-12            lazyeval_0.2.2         survival_3.1-8         magrittr_1.5          
[37] crayon_1.3.4           memoise_1.1.0          foreign_0.8-75         tools_3.6.2           
[41] data.table_1.12.8      lifecycle_0.1.0        stringr_1.4.0          locfit_1.5-9.1        
[45] munsell_0.5.0          cluster_2.1.0          AnnotationDbi_1.48.0   compiler_3.6.2        
[49] rlang_0.4.4            grid_3.6.2             RCurl_1.98-1.1         rstudioapi_0.11       
[53] htmlwidgets_1.5.1      bitops_1.0-6           base64enc_0.1-3        gtable_0.3.0          
[57] DBI_1.1.0              R6_2.4.1               gridExtra_2.3          knitr_1.28            
[61] dplyr_0.8.4            bit_1.1-15.2           Hmisc_4.3-1            stringi_1.4.6         
[65] Rcpp_1.0.3             geneplotter_1.64.0     vctrs_0.2.3            rpart_4.1-15          
[69] acepack_1.4.1          png_0.1-7              tidyselect_1.0.0       xfun_0.12

Reproducible example:

> cnts <- matrix(rnbinom(n=1000, mu=100, size=1/0.5), ncol=10)
> cond <- factor(rep(1:2, each=5))
> dds <- DESeqDataSetFromMatrix(cnts, DataFrame(cond), ~ cond)
converting counts to integer mode
> dds <- DESeq(dds)
estimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
-- note: fitType='parametric', but the dispersion trend was not well captured by the
   function: y = a/x + b, and a local regression fit was automatically substituted.
   specify fitType='local' or 'mean' to avoid this message next time.
final dispersion estimates
fitting model and testing
> res <- results(dds)
Error in .wrap_in_length_one_list_like_object(value, name, x) : 
  failed to coerce 'list(value)' to a DESeqResults object of length 1
deseq2 • 732 views
ADD COMMENT
0
Entering edit mode

Can you provide the other code? Maybe also try again in a fresh R session?

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 2 days ago
United States

I don't get an error with your code.

> res <- results(dds)

Looking into your sessionInfo, you have DESeq2_1.20.0 (not a problem per se, but note that this is 3 releases too old, if you are starting a new project it would be recommended to use current software).

However, it is a problem that you have paired DESeq2 1.20 with R version 3.6.2. This version should be paired with R version 3.5.0.

Make sure that you only use BiocManager::install() to install packages. Going off that script will result in problems which are out of our hands as developers. You can consult BiocManager::valid() to diagnose problems on your end.

ADD COMMENT

Login before adding your answer.

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