Last updated: 2023-01-27
Checks: 7 0
Knit directory: gsmash/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20220606)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version b2e28ce. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Untracked files:
Untracked: analysis/compare_vga_iterations_pbmc_full.Rmd
Untracked: output/pbmc3k_k1.rds
Untracked: output/pbmc3k_k1_S1.rds
Unstaged changes:
Modified: analysis/overdispersed_splitting.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/pbmc3k_glmpca_init_for_ebpmf.Rmd
) and HTML (docs/pbmc3k_glmpca_init_for_ebpmf.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | b2e28ce | DongyueXie | 2023-01-27 | wflow_publish(“analysis/pbmc3k_glmpca_init_for_ebpmf.Rmd”) |
Rmd | 3e7d1f6 | DongyueXie | 2023-01-27 | add glmpca init for flash |
I wanted to see whether use GLMPCA as init for splitting method makes any difference.
The default init for splitting PMF is as follows: Let L=0, F=0, then solve for latent M and variances \(\sigma^2\) using Poisson VGA.
Now use GLMPCA for init, I get the latent representation from GLMPCA, i.e. \(\hat L\hat F\). Then treat this as latent M, then run flash on M to init \(\sigma^2\).
I have to point out that the GLMPCA use rowMeans as the scaling factor, but the splitting PMF default is to use rowSums outer colSums. So I probably should have use the rowMeans as scaling factor when using GLMPCA as init. Nonetheless let’s see the results below.
source('code/poisson_STM/plot_factors_general.R')
source('code/poisson_STM/plot_factors.R')
library(fastTopics)
library(Matrix)
data(pbmc_facs)
fit = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/ebpmf_pbmc3k_vga3_glmpca_init.rds')
plot.factors(fit$fit_flash,pbmc_facs$samples$subpop,title='glmpca as init for splitting')
plot(fit$fit_flash$pve)
I put the glmpca fit, flash on glmpca, flash fit, and splitting default init fit here as comparison.
flash_pbmc3k = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/flash_pbmc3k.rds')
ebpmf_pbmc3k = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/ebpmf_pbmc3k_vga3.rds')
ebpmf_pbmc3k_multinom = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/ebpmf_pbmc3k_multinom_vga3.rds')
glmpca_pbmc3k_poi = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/glmpca_pbmc3k_poi.rds')
Warning: namespace 'glmpca' is not available and has been replaced
by .GlobalEnv when processing object ''
flash_glmpca = readRDS('/project2/mstephens/dongyue/poisson_mf/pbmc3k/flash_glmpca.rds')
plot.factors(flash_pbmc3k,pbmc_facs$samples$subpop,title='flash')
plot.factors(ebpmf_pbmc3k$fit_flash,pbmc_facs$samples$subpop,title='splitting')
plot.factors(ebpmf_pbmc3k_multinom$fit_flash,pbmc_facs$samples$subpop,title='splitting multinom')
plot.factors.general(as.matrix(glmpca_pbmc3k_poi$loadings),pbmc_facs$samples$subpop,title='glmpca poi')
plot.factors(flash_glmpca,pbmc_facs$samples$subpop,title='flash on glmpca fit')
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Matrix_1.5-3 fastTopics_0.6-142 ggplot2_3.3.5
[4] workflowr_1.6.2
loaded via a namespace (and not attached):
[1] httr_1.4.1 tidyr_1.1.0 jsonlite_1.6
[4] viridisLite_0.3.0 splines_3.6.1 RcppParallel_4.4.3
[7] assertthat_0.2.1 horseshoe_0.2.0 mixsqp_0.3-17
[10] deconvolveR_1.2-1 yaml_2.2.0 progress_1.2.2
[13] ggrepel_0.9.1 ebnm_1.0-9 pillar_1.4.2
[16] lattice_0.20-38 quantreg_5.41 glue_1.3.1
[19] quadprog_1.5-7 digest_0.6.20 promises_1.0.1
[22] colorspace_1.4-1 plyr_1.8.4 cowplot_1.1.1
[25] htmltools_0.3.6 httpuv_1.5.1 pkgconfig_2.0.2
[28] invgamma_1.1 SparseM_1.77 purrr_0.3.4
[31] scales_1.1.0 whisker_0.3-2 later_0.8.0
[34] Rtsne_0.15 MatrixModels_0.4-1 git2r_0.26.1
[37] tibble_2.1.3 farver_2.1.0 withr_2.4.1
[40] ashr_2.2-50 pbapply_1.4-0 lazyeval_0.2.2
[43] magrittr_1.5 crayon_1.3.4 mcmc_0.9-6
[46] evaluate_0.14 fs_1.3.1 MASS_7.3-51.4
[49] truncnorm_1.0-8 tools_3.6.1 data.table_1.14.2
[52] prettyunits_1.0.2 softImpute_1.4 hms_0.5.3
[55] lifecycle_0.1.0 stringr_1.4.0 MCMCpack_1.4-5
[58] plotly_4.9.0 trust_0.1-7 munsell_0.5.0
[61] flashier_0.2.32 irlba_2.3.3 compiler_3.6.1
[64] rlang_0.4.10 grid_3.6.1 htmlwidgets_1.3
[67] labeling_0.3 rmarkdown_1.13 gtable_0.3.0
[70] reshape2_1.4.3 R6_2.4.0 knitr_1.23
[73] dplyr_0.8.3 uwot_0.1.11 rprojroot_2.0.2
[76] stringi_1.4.3 parallel_3.6.1 SQUAREM_2017.10-1
[79] Rcpp_1.0.5 vctrs_0.3.1 tidyselect_1.1.0
[82] xfun_0.8 coda_0.19-3