GabrielHoffman / variancePartition

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

Warning message: In .standard_transform(ret): No testable fixed effects were included in the model. #98

Closed JEJKarppinen closed 4 months ago

JEJKarppinen commented 5 months ago

Hi,

I have been using the dream analysis for dge. I now started getting this warning message, even though I have included the fixed effects correctly in the model. This happens also when using the sample code here https://bioconductor.org/packages/release/bioc/vignettes/variancePartition/inst/doc/dream.html

library("variancePartition")
library("edgeR")
library("BiocParallel")
data(varPartDEdata)

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

dge <- DGEList(countMatrix[isexpr, ])
dge <- calcNormFactors(dge)

dge <- dge[1:1000, ]

param <- SnowParam(4, "SOCK", progressbar = TRUE, exportglobals = FALSE)

form <- ~ Disease + (1 | Individual)

vobjDream <- voomWithDreamWeights(dge, form, metadata, BPPARAM = param)

fitmm <- dream(vobjDream, form, metadata)
Warning message:
In .standard_transform(ret) :
No testable fixed effects were included in the model.
Running topTable() will fail.

I wonder, do you have an experience with this kind of issue? Edit: These issues started last week, likely after updating the latest R version. Could that be the cause?


> sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.4.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

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

time zone: Europe/Helsinki
tzcode source: internal

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

other attached packages:
[1] variancePartition_1.33.11 BiocParallel_1.37.1       ggplot2_3.5.1             edgeR_4.1.26              limma_3.59.10            

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1    dplyr_1.1.4         bitops_1.0-7        fastmap_1.1.1       digest_0.6.35       lifecycle_1.0.4     statmod_1.5.0      
 [8] magrittr_2.0.3      compiler_4.4.0      rlang_1.1.3         tools_4.4.0         utf8_1.2.4          yaml_2.3.8          knitr_1.46         
[15] plyr_1.8.9          KernSmooth_2.23-22  withr_3.0.0         purrr_1.0.2         numDeriv_2016.8-1.1 BiocGenerics_0.49.1 grid_4.4.0         
[22] aod_1.3.3           fansi_1.0.6         caTools_1.18.2      colorspace_2.1-0    scales_1.3.0        gtools_3.9.5        iterators_1.0.14   
[29] MASS_7.3-60.2       cli_3.6.2           mvtnorm_1.2-4       rmarkdown_2.26      generics_0.1.3      rstudioapi_0.16.0   reshape2_1.4.4     
[36] minqa_1.2.6         stringr_1.5.1       splines_4.4.0       parallel_4.4.0      matrixStats_1.3.0   vctrs_0.6.5         boot_1.3-30        
[43] Matrix_1.7-0        pbkrtest_0.5.2      locfit_1.5-9.9      tidyr_1.3.1         snow_0.4-4          glue_1.7.0          nloptr_2.0.3       
[50] codetools_0.2-20    stringi_1.8.3       gtable_0.3.5        EnvStats_2.8.1      lme4_1.1-35.3       lmerTest_3.1-3      munsell_0.5.1      
[57] tibble_3.2.1        remaCor_0.0.18      pillar_1.9.0        htmltools_0.5.8.1   gplots_3.1.3.1      R6_2.5.1            Rdpack_2.6         
[64] evaluate_0.23       lattice_0.22-6      Biobase_2.63.1      rbibutils_2.2.16    backports_1.4.1     RhpcBLASctl_0.23-42 broom_1.0.5        
[71] fANCOVA_0.6-1       corpcor_1.6.10      Rcpp_1.0.12         nlme_3.1-164        xfun_0.43           pkgconfig_2.0.3 ```
GabrielHoffman commented 5 months ago

Thanks for the bug report, I want to resolve this. I have seen this error before, but I can't reproduce it in this case. Can you reproduce the error: 1) with a new install from https://diseaseneurogenomics.github.io/variancePartition 2) in a new R session, without using BPPARAM 3) in R 4.3.x

See sessionInfo()

> sessionInfo() R version 4.4.0 (2024-04-24) Platform: x86_64-apple-darwin23.4.0 Running under: macOS Sonoma 14.4.1 Matrix products: default BLAS: /Users/gabrielhoffman/Downloads/R-4.4.0/lib/libRblas.dylib LAPACK: /usr/local/Cellar/r/4.3.3/lib/R/lib/libRlapack.dylib; LAPACK version 3.11.0 locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 time zone: America/New_York tzcode source: internal attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] edgeR_4.1.26 variancePartition_1.33.11 [3] BiocParallel_1.37.1 limma_3.59.10 [5] ggplot2_3.5.1 loaded via a namespace (and not attached): [1] gtable_0.3.5 caTools_1.18.2 Biobase_2.63.1 [4] lattice_0.22-6 numDeriv_2016.8-1.1 vctrs_0.6.5 [7] tools_4.4.0 Rdpack_2.6 bitops_1.0-7 [10] generics_0.1.3 parallel_4.4.0 pbkrtest_0.5.2 [13] tibble_3.2.1 fansi_1.0.6 pkgconfig_2.0.3 [16] Matrix_1.7-0 KernSmooth_2.23-22 lifecycle_1.0.4 [19] compiler_4.4.0 stringr_1.5.1 gplots_3.1.3.1 [22] statmod_1.5.0 munsell_0.5.1 RhpcBLASctl_0.23-42 [25] codetools_0.2-20 lmerTest_3.1-3 snow_0.4-4 [28] pillar_1.9.0 nloptr_2.0.3 tidyr_1.3.1 [31] MASS_7.3-60.2 aod_1.3.3 iterators_1.0.14 [34] boot_1.3-30 nlme_3.1-164 gtools_3.9.5 [37] locfit_1.5-9.9 tidyselect_1.2.1 stringi_1.8.3 [40] fANCOVA_0.6-1 mvtnorm_1.2-4 dplyr_1.1.4 [43] reshape2_1.4.4 purrr_1.0.2 splines_4.4.0 [46] grid_4.4.0 colorspace_2.1-0 cli_3.6.2 [49] magrittr_2.0.3 utf8_1.2.4 broom_1.0.5 [52] corpcor_1.6.10 withr_3.0.0 scales_1.3.0 [55] backports_1.4.1 remaCor_0.0.18 matrixStats_1.3.0 [58] lme4_1.1-35.3 rbibutils_2.2.16 EnvStats_2.8.1 [61] rlang_1.1.3 Rcpp_1.0.12 glue_1.7.0 [64] BiocGenerics_0.49.1 minqa_1.2.6 R6_2.5.1 [67] plyr_1.8.9

Gabriel

JEJKarppinen commented 5 months ago

Thank you, Gabriel! I have been trying to wrap my head around what causes dream to produce the warning message. When I did what you instructed, I did not get the warning message anymore. I have had no issues with the error message when I open my projects and load all packages, download variancePartition, and load it as the last one. For example:

library(readxl)
library(tidyverse)
library(limma)
library(edgeR)
library(openxlsx)
library(promor)
library(DEP)
devtools::install_github("DiseaseNeuroGenomics/variancePartition")
library(variancePartition)

However, if I open my project and don't load the packages first but e.g. modify my data, the warning message starts to pop up again. If I restart R and again load the packages first, the error message disappears.

GabrielHoffman commented 5 months ago

Are you doing this in R Studio? Can you open a session and report commandArgs() and sessionInfo() before you do anything else