How long does it usually take to complete dream() from start to finish?
2
0
Entering edit mode
hayleyw • 0
@43494c06
Last seen 11 weeks ago
Canada

Hi All!

I have been trying to run variancePartition for the last couple of days and was struggling to even get it to run. After including parallel processing I finally got it running. It looks like it is done, but obviously isn't since the data object hasn't been added to the environment and the stop button is still visible in the console. I just want to know if it is stuck or if it will eventually finish, as it has indicated that the iterations are complete and it says it took 8632 s (it has said this for at least 45 minutes now). Please see initial code and output below.

Code:

fit <- dream(adj.m_matrix, formula = model, data = pheno, BPPARAM = param)

Output:

Dividing work into 102 chunks...

iteration: 102

Total:8632 s

Thanks!

variancePartition mixedmodel dream • 824 views
ADD COMMENT
0
Entering edit mode
@gabrielhoffman-8391
Last seen 9 days ago
United States

Can you show sessionInfo() and the formula

ADD COMMENT
0
Entering edit mode

The model formula is:

model= ~ as.factor(condition) + as.factor(Sex) + as.factor(smoke) + Age.at.collection + EUR + AFR + (1|pairing)

The parallel processing formula is:

param = SnowParam(workers = 6, type = "SOCK", progressbar = TRUE)

The session info isn't loading since I am still waiting for dream() to finish.

ADD REPLY
0
Entering edit mode

Can you show packageVesion("variancePartition") from another R session, and also dim(adj.m_matrix).

This issue is likely fixed in an updated version available at https://diseaseneurogenomics.github.io/variancePartition/

ADD REPLY
0
Entering edit mode

So, it did fully finish and the fit object is in the environment (took ~1.5 hours after iteration finished) and I was also able to run the ebayes() function (~2 hours).

I am now trying to run the topTable(), but I keep receiving this error message: Error in fit$coefficients[, coef] : subscript out of bounds

I am confused why this keeps happening as I have seen code run that looks similar to mine. I have included the code and session info below.

Code:

results_table_bin <- variancePartition::topTable(fit_ebayes, coef = "condition2", number = Inf)

Output for head(fit_ebayes$design, 3) (sorry if it looks weird I couldn't get it to format properly):

                      (Intercept) as.factor(condition)2 as.factor(Sex)2 as.factor(smoke)1

P1_BI100126_1 1 0 1 0 P1_BI100141_1 1 0 0 0 P1_BI100202_1 1 0 0 0 Age.at.collection EUR AFR P1_BI100126_1 72.92 0.764659 0.047533 P1_BI100141_1 78.59 0.719458 0.239972 P1_BI100202_1 73.45 0.735434 0.140322

Output for sessionInfo():

R version 4.3.1 (2023-06-16) Platform: x86_64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.5.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.3-x86_64/Resources/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/Toronto tzcode source: internal

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

other attached packages: [1] doParallel_1.0.17 iterators_1.0.14 foreach_1.5.2 plyr_1.8.8
[5] tibble_3.2.1 dplyr_1.1.2 data.table_1.14.8 variancePartition_1.30.2 [9] BiocParallel_1.34.2 ggplot2_3.4.3 limma_3.56.2

loaded via a namespace (and not attached): [1] gtable_0.3.4 caTools_1.18.2 Biobase_2.60.0 lattice_0.21-8 numDeriv_2016.8-1.1 [6] vctrs_0.6.3 tools_4.3.1 Rdpack_2.5 bitops_1.0-7 generics_0.1.3
[11] pbkrtest_0.5.2 fansi_1.0.4 pkgconfig_2.0.3 Matrix_1.6-1 KernSmooth_2.23-22 [16] lifecycle_1.0.3 stringr_1.5.0 compiler_4.3.1 progress_1.2.2 gplots_3.1.3
[21] munsell_0.5.0 RhpcBLASctl_0.23-42 codetools_0.2-19 lmerTest_3.1-3 pillar_1.9.0
[26] nloptr_2.0.3 crayon_1.5.2 tidyr_1.3.0 MASS_7.3-60 aod_1.3.2
[31] boot_1.3-28.1 nlme_3.1-163 gtools_3.9.4 tidyselect_1.2.0 stringi_1.7.12
[36] mvtnorm_1.2-2 reshape2_1.4.4 purrr_1.0.2 splines_4.3.1 grid_4.3.1
[41] colorspace_2.1-0 cli_3.6.1 magrittr_2.0.3 utf8_1.2.3 broom_1.0.5
[46] withr_2.5.0 prettyunits_1.1.1 scales_1.2.1 backports_1.4.1 remaCor_0.0.16
[51] lme4_1.1-34 hms_1.1.3 rbibutils_2.2.15 EnvStats_2.8.0 rlang_1.1.1
[56] Rcpp_1.0.11 glue_1.6.2 BiocManager_1.30.22 BiocGenerics_0.46.0 rstudioapi_0.15.0
[61] minqa_1.2.5 R6_2.5.1

ADD REPLY
0
Entering edit mode

Thats surprising. Can you try with the latest version? Also, can you share a minimal reproducible example?

ADD REPLY
0
Entering edit mode

Sorry, I thought 1.30.2 was the lastest version of variancePartition? Also, what do you need for a minimal reproductible example? I am still relatively new to R and Bioconductor so I am unsure what that all entails.

Thank you for going through all of this with me by the way! I really appreciate it.

ADD REPLY
0
Entering edit mode
@gordon-smyth
Last seen 5 hours ago
WEHI, Melbourne, Australia

You seem to have only one random effect, so you could considering running limma directly, which would presumably be fast, and would also give you access to things like quality weights that are frequently useful for human studies.

You don't describe your experimental design but the random effect is called pairing. If you have a paired comparison study, then it is more usual to treat the pairing as a fixed rather than a random effect.

ADD COMMENT
0
Entering edit mode

I agree with Gordon

ADD REPLY
0
Entering edit mode

This is a longitudinal study looking at changes in methylation with age, with samples taken at two timepoints. The pairing is referring to individual ID. We did originally use limma for these analyses. However, my PI isn't comfortable using the random effects with limma because of the way it forces the magnitude of the random effect to be the same across all genes. We ran the data using a fixed effects model in limma as well, but I would prefer to have within and between individual comparisons, which is why I switched to variancePartition.

ADD REPLY

Login before adding your answer.

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