I need help with a weird error I'm getting from variancePartition::dream()
.
I want to get a list of genes with sex-biased expression from my RNA-Seq data. The count matrix (count_data
) consists of 27,584 samples (columns) and 34,155 genes (rows). The samples are from 10,824 individuals (case_id
), hence ~2.6 samples from each individual on average. I'm trying to model three fixed effects (sex
, tissue_cancer
, batch
) and one random effect (case_id
) using the dream
pipeline as illustrated here. Here is the error-producing part of my code:
dgelist = DGEList(counts = count_data,
samples = sample_metadata,
group = sample_metadata$sex,
genes = gene_metadata)
k = filterByExpr(dgelist)
dgelist = dgelist[k, , keep.lib.sizes = F]
dgelist = calcNormFactors(dgelist, method = "TMM")
form = ~ sex + tissue_cancer + batch + (1|case_id)
v = voomWithDreamWeights(dgelist, form, sample_metadata, BPPARAM = MulticoreParam(12))
# Memory usage to store result: >69.7 Gb
# Dividing work into 100 chunks...
#
# Total:4329 s
dfit = dream(v, form, sample_metadata, computeResiduals = F, BPPARAM = MulticoreParam(4))
# Dividing work into 100 chunks...
# Error in env[[as.character(i)]] <- value :
# wrong args for environment subassignment
# Calls: dream ... bploop -> bploop.iterate -> <Anonymous> -> add_inorder
# In addition: Warning message:
# In seq.default(a = val) : partial argument match of 'a' to 'along.with'
# Execution halted
# Error: unexpected '=' in "="
# Execution halted
I really have no idea what the error means and what I should do to make it work. Any advice would be very much appreciated!
Session Info
> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] RColorBrewer_1.1-2 variancePartition_1.20.0 BiocParallel_1.24.1 forcats_0.5.1 stringr_1.4.0
[6] dplyr_1.0.5 purrr_0.3.4 readr_1.4.0 tidyr_1.1.3 tibble_3.1.1
[11] tidyverse_1.3.1 scales_1.1.1 rstudioapi_0.13 magrittr_2.0.1 ggpubr_0.4.0
[16] ggplot2_3.3.3 fst_0.9.4 edgeR_3.32.1 limma_3.46.0 e1071_1.7-6
[21] dtplyr_1.1.0 DESeq2_1.30.1 SummarizedExperiment_1.20.0 Biobase_2.50.0 MatrixGenerics_1.2.1
[26] matrixStats_0.58.0 GenomicRanges_1.42.0 GenomeInfoDb_1.26.7 IRanges_2.24.1 S4Vectors_0.28.1
[31] BiocGenerics_0.36.1 data.table_1.14.0 cowplot_1.1.1
loaded via a namespace (and not attached):
[1] minqa_1.2.4 colorspace_2.0-0 ggsignif_0.6.1 ellipsis_0.3.1 class_7.3-18 rio_0.5.26
[7] colorRamps_2.3 XVector_0.30.0 fs_1.5.0 proxy_0.4-25 bit64_4.0.5 AnnotationDbi_1.52.0
[13] fansi_0.4.2 lubridate_1.7.10 xml2_1.3.2 codetools_0.2-18 splines_4.0.4 doParallel_1.0.16
[19] cachem_1.0.4 geneplotter_1.68.0 knitr_1.33 jsonlite_1.7.2 nloptr_1.2.2.2 pbkrtest_0.5.1
[25] broom_0.7.6 annotate_1.68.0 dbplyr_2.1.1 compiler_4.0.4 httr_1.4.2 backports_1.2.1
[31] assertthat_0.2.1 Matrix_1.3-2 fastmap_1.1.0 cli_2.4.0 prettyunits_1.1.1 tools_4.0.4
[37] gtable_0.3.0 glue_1.4.2 GenomeInfoDbData_1.2.4 reshape2_1.4.4 Rcpp_1.0.6 carData_3.0-4
[43] cellranger_1.1.0 vctrs_0.3.7 nlme_3.1-152 iterators_1.0.13 xfun_0.22 lme4_1.1-26
[49] openxlsx_4.2.3 rvest_1.0.0 lifecycle_1.0.0 gtools_3.8.2 statmod_1.4.35 rstatix_0.7.0
[55] XML_3.99-0.6 MASS_7.3-53.1 zlibbioc_1.36.0 hms_1.0.0 curl_4.3 memoise_2.0.0
[61] stringi_1.5.3 RSQLite_2.2.7 genefilter_1.72.1 foreach_1.5.1 caTools_1.18.2 boot_1.3-27
[67] zip_2.1.1 rlang_0.4.10 pkgconfig_2.0.3 bitops_1.0-7 lattice_0.20-41 bit_4.0.4
[73] tidyselect_1.1.0 plyr_1.8.6 R6_2.5.0 gplots_3.1.1 generics_0.1.0 DelayedArray_0.16.3
[79] DBI_1.1.1 pillar_1.6.0 haven_2.4.1 foreign_0.8-81 withr_2.4.2 survival_3.2-10
[85] abind_1.4-5 RCurl_1.98-1.3 modelr_0.1.8 crayon_1.4.1 car_3.0-10 KernSmooth_2.23-18
[91] utf8_1.2.1 progress_1.2.2 locfit_1.5-9.4 grid_4.0.4 readxl_1.3.1 blob_1.2.1
[97] reprex_2.0.0 xtable_1.8-4 munsell_0.5.0