Argument is of length zero in variancePartition/Dream
Entering edit mode
Jonathan • 0
Last seen 21 months ago
United States

I'm performing an RNA sequencing project that I'd like to use Dream to analyze. I've been running into an error while using variancePartition/Dream in my own dataset. I decided to perform the analysis example in the Dream vignette ( to figure out if my experiment was the problem. After running the example in the vignette (listed below), I'm still running into the error described below. I'm guessing this is not expected behavior? Any thoughts on what could be going wrong? To be clear, this is the same error I'm running into in my analysis when I try to compare more than one contrast (a single term in coef seems to work just fine).



isexpr = rowSums(cpm(countMatrix)>0.1) >= 5

geneExpr = DGEList( countMatrix[isexpr,] )
geneExpr = calcNormFactors( geneExpr )

geneExpr = geneExpr[1:1000,]

param = SnowParam(4, "SOCK", progressbar=TRUE)

vobjDream = voomWithDreamWeights( geneExpr, form, metadata )

form <- ~ 0 + DiseaseSubtype + Sex + (1|Individual) 

L1 = getContrast( vobjDream, form, metadata, c("DiseaseSubtype2", "DiseaseSubtype1"))
L2 = getContrast( vobjDream, form, metadata, c("DiseaseSubtype1", "DiseaseSubtype0"))
L = cbind(L1, L2)     

fit = dream( vobjDream, form, metadata, L)

topTable( fit, coef=c("DiseaseSubtype2", "DiseaseSubtype1"), number=3 )

Here is the error I'm getting

Error in if (length(fit$coef[1, coef]) < ncol(fit)) { : 
argument is of length zero

Session information below

sessionInfo( )

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.5

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] variancePartition_1.26.0 BiocParallel_1.30.3      ggplot2_3.3.6            edgeR_3.38.4            
[5] limma_3.52.2            

loaded via a namespace (and not attached):
  [1] minqa_1.2.4                 colorspace_2.0-3            rjson_0.2.21                ellipsis_0.3.2             
  [5] XVector_0.36.0              GenomicRanges_1.48.0        rstudioapi_0.13             MatrixModels_0.5-0         
  [9] ggrepel_0.9.1               bit64_4.0.5                 AnnotationDbi_1.58.0        fansi_1.0.3                
 [13] xml2_1.3.3                  codetools_0.2-18            splines_4.2.1               doParallel_1.0.17          
 [17] cachem_1.0.6                knitr_1.39                  geneplotter_1.74.0          jsonlite_1.8.0             
 [21] nloptr_2.0.3                Rsamtools_2.12.0            pbkrtest_0.5.1              RhpcBLASctl_0.21-247.1     
 [25] broom_1.0.0                 annotate_1.74.0             dbplyr_2.2.1                png_0.1-7                  
 [29] aod_1.3.2                   BiocManager_1.30.18         compiler_4.2.1              httr_1.4.3                 
 [33] backports_1.4.1             assertthat_0.2.1            Matrix_1.4-1                fastmap_1.1.0              
 [37] cli_3.3.0                   htmltools_0.5.3             quantreg_5.94               prettyunits_1.1.1          
 [41] tools_4.2.1                 lmerTest_3.1-3              gtable_0.3.0                glue_1.6.2                 
 [45] GenomeInfoDbData_1.2.8      reshape2_1.4.4              dplyr_1.0.9                 rappdirs_0.3.3             
 [49] Rcpp_1.0.9                  Biobase_2.56.0              vctrs_0.4.1                 Biostrings_2.64.0          
 [53] nlme_3.1-159                rtracklayer_1.56.1          iterators_1.0.14            EnhancedVolcano_1.14.0     
 [57] xfun_0.32                   stringr_1.4.0               rbibutils_2.2.8             lme4_1.1-30                
 [61] lifecycle_1.0.1             restfulr_0.0.15             gtools_3.9.3                XML_3.99-0.10              
 [65] zlibbioc_1.42.0             MASS_7.3-58.1               scales_1.2.0                hms_1.1.1                  
 [69] MatrixGenerics_1.8.1        parallel_4.2.1              SummarizedExperiment_1.26.1 SparseM_1.81               
 [73] RColorBrewer_1.1-3          yaml_2.3.5                  curl_4.3.2                  memoise_2.0.1              
 [77] ggpmisc_0.5.0               biomaRt_2.52.0              stringi_1.7.8               RSQLite_2.2.15             
 [81] genefilter_1.78.0           S4Vectors_0.34.0            BiocIO_1.6.0                foreach_1.5.2              
 [85] GenomicFeatures_1.48.3      caTools_1.18.2              BiocGenerics_0.42.0         filelock_1.0.2             
 [89] ggpp_0.4.4                  boot_1.3-28                 GenomeInfoDb_1.32.3         Rdpack_2.4                 
 [93] rlang_1.0.4                 pkgconfig_2.0.3             matrixStats_0.62.0          bitops_1.0-7               
 [97] evaluate_0.16               lattice_0.20-45             purrr_0.3.4                 GenomicAlignments_1.32.1   
[101] bit_4.0.4                   tidyselect_1.1.2            plyr_1.8.7                  magrittr_2.0.3             
[105] DESeq2_1.36.0               R6_2.5.1                    IRanges_2.30.0              gplots_3.1.3               
[109] generics_0.1.3              DelayedArray_0.22.0         DBI_1.1.3                   pillar_1.8.0               
[113] withr_2.5.0                 survival_3.4-0              KEGGREST_1.36.3             RCurl_1.98-1.8             
[117] tibble_3.1.8                crayon_1.5.1                KernSmooth_2.23-20          utf8_1.2.2                 
[121] BiocFileCache_2.4.0         rmarkdown_2.14              progress_1.2.2              locfit_1.5-9.6             
[125] grid_4.2.1                  blob_1.2.3                  digest_0.6.29               xtable_1.8-4               
[129] numDeriv_2016.8-1.1         tidyr_1.2.0                 stats4_4.2.1                munsell_0.5.0
expression variancePartition edgeR • 472 views

Login before adding your answer.

Traffic: 642 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6