GabrielHoffman / variancePartition

Quantify and interpret divers of variation in multilevel gene expression experiments
http://gabrielhoffman.github.io/variancePartition/
60 stars 14 forks source link

No testable fixed effect were included in the model #103

Open yasamanrezvani opened 1 month ago

yasamanrezvani commented 1 month ago

Hi,

I have bulk RNA-seq data with one fixed effect (Condiiton) and 2 random effects (patients and batch Info). I am running dream to perform DE analysis.

param <- SnowParam(4, "SOCK", progressbar = TRUE)
formula <- ~ Condition + (1 | patient) + (1 + batch)
voomObj <- voomWithDreamWeights(dgeObject, formula, metadata, BPARAM=param)
fit <- dream(voomObj, formula, metadata)

However, running the dream function returns a warning No testable fixed effects were included in the model. Running topTable() will fail

How can I solve this issue? Any help is much appreciated!

GabrielHoffman commented 1 month ago

Can you show sessionInfo(). But it looks like dream() is using form instead of formula in your code

yasamanrezvani commented 1 month ago

Hi, There was a typo in the code. It is fixed now.

Here is the session info:

R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.8 (Ootpa)

Matrix products: default
BLAS:   /usr/apps/general/spack/sw/linux-rhel8-zen/gcc-11.3.0/r-4.2.0-2liuw4vmic27cmqhyyt6jmvwbezn6mlx/rlib/R/lib/libRblas.so
LAPACK: /usr/apps/general/spack/sw/linux-rhel8-zen/gcc-11.3.0/r-4.2.0-2liuw4vmic27cmqhyyt6jmvwbezn6mlx/rlib/R/lib/libRlapack.so

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

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

other attached packages:
 [1] org.Hs.eg.db_3.16.0         AnnotationDbi_1.60.2        variancePartition_1.28.9   
 [4] sva_3.46.0                  BiocParallel_1.32.6         genefilter_1.80.3          
 [7] mgcv_1.8-42                 nlme_3.1-162                GEOquery_2.66.0            
[10] GGally_2.1.2                ggvenn_0.1.10               venn_1.12                  
[13] DESeq2_1.38.3               SummarizedExperiment_1.28.0 Biobase_2.58.0             
[16] MatrixGenerics_1.10.0       matrixStats_0.63.0          GenomicRanges_1.50.2       
[19] GenomeInfoDb_1.34.9         IRanges_2.32.0              S4Vectors_0.36.2           
[22] BiocGenerics_0.44.0         patchwork_1.1.2             ggpubr_0.6.0               
[25] DOSE_3.24.2                 RColorBrewer_1.1-3          PCAtools_2.10.0            
[28] ggrepel_0.9.3               openxlsx_4.2.5.2            lubridate_1.9.2            
[31] forcats_1.0.0               stringr_1.5.0               dplyr_1.1.2                
[34] purrr_1.0.1                 readr_2.1.4                 tidyr_1.3.0                
[37] tibble_3.2.1                ggplot2_3.5.1               tidyverse_2.0.0            
[40] edgeR_3.40.2                Glimma_2.8.0                limma_3.54.2               

loaded via a namespace (and not attached):
  [1] utf8_1.2.4                RUnit_0.4.32              lme4_1.1-33              
  [4] tidyselect_1.2.0          RSQLite_2.3.1             htmlwidgets_1.6.2        
  [7] scatterpie_0.1.9          munsell_0.5.1             ScaledMatrix_1.6.0       
 [10] ragg_1.2.5                codetools_0.2-19          statmod_1.5.0            
 [13] withr_3.0.1               colorspace_2.1-0          GOSemSim_2.24.0          
 [16] knitr_1.48                rstudioapi_0.14           ggsignif_0.6.4           
 [19] labeling_0.4.3            Rdpack_2.4                GenomeInfoDbData_1.2.9   
 [22] polyclip_1.10-4           bit64_4.0.5               farver_2.1.2             
 [25] downloader_0.4            vctrs_0.6.2               treeio_1.22.0            
 [28] generics_0.1.3            clusterGeneration_1.3.7   gson_0.1.0               
 [31] xfun_0.47                 timechange_0.2.0          R6_2.5.1                 
 [34] doParallel_1.0.17         graphlayouts_1.0.0        rsvd_1.0.5               
 [37] locfit_1.5-9.7            bitops_1.0-7              cachem_1.0.8             
 [40] reshape_0.8.9             fgsea_1.24.0              gridGraphics_0.5-1       
 [43] DelayedArray_0.24.0       scales_1.3.0              ggraph_2.1.0             
 [46] enrichplot_1.18.4         gtable_0.3.3              beachmat_2.14.2          
 [49] tidygraph_1.2.3           rlang_1.1.4               systemfonts_1.0.4        
 [52] splines_4.2.0             rstatix_0.7.2             lazyeval_0.2.2           
 [55] broom_1.0.4               yaml_2.3.7                reshape2_1.4.4           
 [58] abind_1.4-5               backports_1.4.1           qvalue_2.30.0            
 [61] clusterProfiler_4.6.2     tools_4.2.0               ggplotify_0.1.0          
 [64] gplots_3.1.3              Rcpp_1.0.12               plyr_1.8.8               
 [67] progress_1.2.2            sparseMatrixStats_1.10.0  zlibbioc_1.44.0          
 [70] RCurl_1.98-1.12           prettyunits_1.1.1         remaCor_0.0.11           
 [73] viridis_0.6.3             cowplot_1.1.1             magrittr_2.0.3           
 [76] data.table_1.16.0         lmerTest_3.1-3            mvtnorm_1.1-3            
 [79] hms_1.1.3                 evaluate_0.20             xtable_1.8-4             
 [82] pbkrtest_0.5.2            RhpcBLASctl_0.23-42       HDO.db_0.99.1            
 [85] XML_3.99-0.14             gridExtra_2.3             compiler_4.2.0           
 [88] KernSmooth_2.23-21        crayon_1.5.2              shadowtext_0.1.2         
 [91] minqa_1.2.5               htmltools_0.5.5           ggfun_0.0.9              
 [94] tzdb_0.3.0                snow_0.4-4                geneplotter_1.76.0       
 [97] aplot_0.1.10              DBI_1.1.3                 tweenr_2.0.2             
[100] MASS_7.3-60               boot_1.3-28.1             Matrix_1.5-4             
[103] car_3.1-2                 cli_3.6.3                 rbibutils_2.2.16         
[106] parallel_4.2.0            igraph_1.4.2              pkgconfig_2.0.3          
[109] numDeriv_2016.8-1.1       xml2_1.3.4                foreach_1.5.2            
[112] ggtree_3.6.2              annotate_1.76.0           admisc_0.36              
[115] dqrng_0.3.0               XVector_0.38.0            yulab.utils_0.0.6        
[118] digest_0.6.31             Biostrings_2.66.0         rmarkdown_2.28           
[121] fastmatch_1.1-3           tidytree_0.4.2            DelayedMatrixStats_1.20.0
[124] gtools_3.9.4              nloptr_2.0.3              lifecycle_1.0.3          
[127] jsonlite_1.8.4            aod_1.3.2                 carData_3.0-5            
[130] viridisLite_0.4.2         fansi_1.0.6               pillar_1.9.0             
[133] lattice_0.21-8            KEGGREST_1.38.0           fastmap_1.1.1            
[136] httr_1.4.5                survival_3.5-5            GO.db_3.16.0             
[139] glue_1.7.0                zip_2.3.0                 png_0.1-8                
[142] iterators_1.0.14          bit_4.0.5                 ggforce_0.4.1            
[145] stringi_1.7.12            blob_1.2.4                textshaping_0.3.6        
[148] BiocSingular_1.14.0       caTools_1.18.2            memoise_2.0.1            
[151] irlba_2.3.5.1             ape_5.7-1
yasamanrezvani commented 1 month ago

@GabrielHoffman, I would appreciate it if you could help me with this issue.

GabrielHoffman commented 1 month ago

It’s a version issue. Can you get a more recent version of variancePartition