Last updated: 2022-07-21

Checks: 7 0

Knit directory: logistic-susie-gsea/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). 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(20220105) 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 4872e81. 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:    .DS_Store
    Ignored:    .RData
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    _targets.R
    Ignored:    _targets.html
    Ignored:    _targets.md
    Ignored:    _targets/objects/
    Ignored:    _targets/user/
    Ignored:    _targets/workspaces/
    Ignored:    _targets_r/
    Ignored:    cache/
    Ignored:    data/.DS_Store
    Ignored:    data/adipose_2yr_topsnp.txt
    Ignored:    data/anthony/
    Ignored:    data/de-droplet/
    Ignored:    data/de-microplastics/
    Ignored:    data/deng/
    Ignored:    data/fetal_reference_cellid_gene_sets.RData
    Ignored:    data/human_chimp_eb/
    Ignored:    data/pbmc-purified/
    Ignored:    data/wenhe_baboon_diet/
    Ignored:    data/yusha_sc_tumor/
    Ignored:    library/
    Ignored:    renv/
    Ignored:    staging/

Untracked files:
    Untracked:  .ipynb_checkpoints/
    Untracked:  Master's Paper.pdf
    Untracked:  Project_1652928411/
    Untracked:  Project_1653228324/
    Untracked:  Project_1653228355/
    Untracked:  VEB_Boost_Proposal_Write_Up (1).pdf
    Untracked:  _targets/meta/
    Untracked:  additive.l5.gonr.aggregate.scores
    Untracked:  analysis/alpha_ash_v_point_normal.Rmd
    Untracked:  analysis/compare_w_post_hoc_clustering.Rmd
    Untracked:  analysis/de_droplet_noshrink.Rmd
    Untracked:  analysis/de_droplet_noshrink_logistic_susie.Rmd
    Untracked:  analysis/fetal_reference_cellid_gsea.Rmd
    Untracked:  analysis/fixed_intercept.Rmd
    Untracked:  analysis/gsea_made_simple.Rmd
    Untracked:  analysis/iDEA_examples.Rmd
    Untracked:  analysis/latent_gene_list.Rmd
    Untracked:  analysis/linear_method_failure_modes.Rmd
    Untracked:  analysis/linear_regression_failure_regime.Rmd
    Untracked:  analysis/linear_v_logistic_pbmc.Rmd
    Untracked:  analysis/logistic_susie_veb_boost_vs_vb.Rmd
    Untracked:  analysis/logistic_susie_vis.Rmd
    Untracked:  analysis/logistic_variational_bound.Rmd
    Untracked:  analysis/logsitic_susie_template.Rmd
    Untracked:  analysis/pcb_scratch.Rmd
    Untracked:  analysis/references.bib
    Untracked:  analysis/roadmap.Rmd
    Untracked:  analysis/simulations.Rmd
    Untracked:  analysis/simulations_l1.Rmd
    Untracked:  analysis/tccm_vs_logistic_susie.Rmd
    Untracked:  analysis/template.Rmd
    Untracked:  analysis/test.Rmd
    Untracked:  build_site.R
    Untracked:  code/html_tables.R
    Untracked:  code/latent_logistic_susie.R
    Untracked:  code/logistic_susie_data_driver.R
    Untracked:  code/marginal_sumstat_gsea_collapsed.R
    Untracked:  code/point_normal.R
    Untracked:  code/sumstat_gsea.py
    Untracked:  code/susie_gsea_queries.R
    Untracked:  docs.zip
    Untracked:  export/
    Untracked:  l1.sim.aggregate.scores
    Untracked:  pbmc_cd19_symbol.txt
    Untracked:  pbmc_cd19b_0.1_background.csv
    Untracked:  pbmc_cd19b_0.1_david_annotation_clusters.txt
    Untracked:  pbmc_cd19b_0.1_david_results.txt
    Untracked:  pbmc_cd19b_0.1_list.csv
    Untracked:  presentations/
    Untracked:  references.bib

Unstaged changes:
    Modified:   analysis/example_pbmc.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/example_mellissa_microplastics.Rmd) and HTML (docs/example_mellissa_microplastics.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 4872e81 karltayeb 2022-07-21 wflow_publish("analysis/example_mellissa_microplastics.Rmd")
html 4b8c5d1 karltayeb 2022-07-21 Build site.
Rmd 3e90f1a karltayeb 2022-07-21 wflow_publish("analysis/example_mellissa_microplastics.Rmd")

Load data

source('code/load_data.R')
── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
✔ ggplot2 3.3.6     ✔ purrr   0.3.4
✔ tibble  3.1.7     ✔ dplyr   1.0.9
✔ tidyr   1.2.0     ✔ stringr 1.4.0
✔ readr   2.1.2     ✔ forcats 0.5.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
library(gseasusie)

# save output to a folder... helps for running many factors
cache_rds = purrr::partial(xfun::cache_rds, dir='cache/de_microplastics/')



driver = function(gs, experiment){
  dat <- gseasusie::prep_binary_data(gs, data[[experiment]])
  ora <- gseasusie::fit_ora(dat$X, dat$y)
  # add description
  ora <- ora %>%
    dplyr::left_join(gs$geneSetDes)
  fit <- gseasusie::fit_logistic_susie_veb_boost(dat$X, dat$y)
  return(list(fit=fit, ora=ora))
}

driver_cached = function(prefix, gs, experiment){
  file = paste0(prefix, '_', gs$db, '_', experiment, '.rds')
  print(file)
  cache_rds(driver(gs, experiment), file=file)
}
data <- read_rds('data/de-microplastics/plastics_de.rds')
map2enrtrez <- generate_map2entrez(rownames(data$`0`$fivemg), 'SYMBOL')
'select()' returned 1:many mapping between keys and columns
data <- unlist(data, recursive = F)
data <- purrr::map(data, ~ rownames_to_column(.x, 'SYMBOL') %>% 
                     mutate(beta = 1, threshold.on = (p_val_adj * as.integer(row_number() > 2))) %>% 
                     left_join(map2enrtrez))
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
Joining, by = "SYMBOL"
go <- gseasusie::load_all_go()
loading gene set from webgestaltr: geneontology_Biological_Process
loading gene set from webgestaltr: geneontology_Molecular_Function
loading gene set from webgestaltr: geneontology_Cellular_Component
res <- purrr::map(names(data), ~driver_cached('microplastics', go, .x))
[1] "microplastics_all_go_0.fivemg.rds"
[1] "microplastics_all_go_0.twentymg.rds"
[1] "microplastics_all_go_0.twentymg2x.rds"
[1] "microplastics_all_go_0.hundredmg.rds"
[1] "microplastics_all_go_1.fivemg.rds"
[1] "microplastics_all_go_1.twentymg.rds"
[1] "microplastics_all_go_1.twentymg2x.rds"
[1] "microplastics_all_go_1.hundredmg.rds"
[1] "microplastics_all_go_2.fivemg.rds"
[1] "microplastics_all_go_2.twentymg.rds"
[1] "microplastics_all_go_2.twentymg2x.rds"
[1] "microplastics_all_go_2.hundredmg.rds"
[1] "microplastics_all_go_3.fivemg.rds"
[1] "microplastics_all_go_3.twentymg.rds"
[1] "microplastics_all_go_3.twentymg2x.rds"
[1] "microplastics_all_go_3.hundredmg.rds"
[1] "microplastics_all_go_4.fivemg.rds"
[1] "microplastics_all_go_4.twentymg.rds"
[1] "microplastics_all_go_4.twentymg2x.rds"
[1] "microplastics_all_go_4.hundredmg.rds"
[1] "microplastics_all_go_5.fivemg.rds"
[1] "microplastics_all_go_5.twentymg.rds"
[1] "microplastics_all_go_5.twentymg2x.rds"
[1] "microplastics_all_go_5.hundredmg.rds"
[1] "microplastics_all_go_6.fivemg.rds"
[1] "microplastics_all_go_6.twentymg.rds"
[1] "microplastics_all_go_6.twentymg2x.rds"
[1] "microplastics_all_go_6.hundredmg.rds"
names(res) <- names(data)
results <- res
experiments <- names(results)

safe_static_table <- purrr::safely(
  gseasusie::static_table,
  otherwise = 'nothing to report')

for(this_experiment in experiments){
  sub_res <- results[[this_experiment]]
  volcano <- gseasusie::enrichment_volcano(fit=sub_res$fit, ora=sub_res$ora)
  results[[this_experiment]]$volcano <- volcano
  
  table <- safe_static_table(sub_res$fit, sub_res$ora)$result
  results[[this_experiment]]$table <- table
}
cat('\n')
cat('##', 'Results')

Results

for(this_experiment in experiments){
  cat('\n')
  cat('###', this_experiment)

  #sub_res <- results[[this_experiment]]
  #volcano <- gseasusie::enrichment_volcano(fit=sub_res$fit, ora=sub_res$ora)
  print(results[[this_experiment]]$volcano)
  
  cat("\n\n")
  #table <- safe_static_table(sub_res$fit, sub_res$ora)$result
  print(results[[this_experiment]]$table)
}

0.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21
geneSet description geneSetSize overlap log2OR effect alpha pip nlog10pFishersExact fisherRank
L1
GO:0006614 SRP-dependent cotranslational protein targeting to membrane 94 36 10.1 7.81 0.993 0.993 73.9 1

0.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

0.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21
geneSet description geneSetSize overlap log2OR effect alpha pip nlog10pFishersExact fisherRank
L1
GO:0006614 SRP-dependent cotranslational protein targeting to membrane 94 45 6.41 6.13 0.984 0.984 59.2 1

0.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21
geneSet description geneSetSize overlap log2OR effect alpha pip nlog10pFishersExact fisherRank
L1
GO:0006614 SRP-dependent cotranslational protein targeting to membrane 94 77 6.12 7.06 1 1 74.2 1
L2
GO:0044421 extracellular region part 2600 346 1.48 1.2 1 1 42.6 17
L4
GO:0048468 cell development 1840 222 1.14 1 1 1 19.6 61
L3
GO:0006616 SRP-dependent cotranslational protein targeting to membrane, translocation 11 1 0.5 -5.89 0.999 0.999 0.277 5340

1.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

1.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

1.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

1.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21
geneSet description geneSetSize overlap log2OR effect alpha pip nlog10pFishersExact fisherRank
L1
GO:0006613 cotranslational protein targeting to membrane 98 78 4.64 4.14 0.482 0.482 47.9 1
GO:0006614 SRP-dependent cotranslational protein targeting to membrane 94 76 4.75 4.23 0.513 0.513 47.6 2
L2
GO:0044421 extracellular region part 2520 571 1.07 0.873 1 1 38 7
L6
GO:0070161 anchoring junction 530 168 1.59 0.914 0.516 0.516 25.7 16
GO:0005912 adherens junction 517 165 1.61 0.923 0.479 0.479 25.7 17
L4
GO:0044432 endoplasmic reticulum part 1160 279 1.06 0.949 0.998 0.998 20.9 31
L3
GO:0051301 cell division 540 156 1.39 1.04 1 1 19.4 39
L5
GO:0000779 condensed chromosome, centromeric region 112 49 2.29 1.89 0.716 0.716 13.8 60
GO:0000793 condensed chromosome 206 71 1.73 1.43 0.255 0.256 13 64
L8
GO:0008219 cell death 1820 359 0.697 0.49 0.43 0.43 12.4 71
GO:0012501 programmed cell death 1700 340 0.711 0.5 0.356 0.356 12.2 74
GO:0006915 apoptotic process 1650 328 0.702 0.501 0.212 0.213 11.7 79

2.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

2.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

2.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

2.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21
geneSet description geneSetSize overlap log2OR effect alpha pip nlog10pFishersExact fisherRank
L1
GO:0006614 SRP-dependent cotranslational protein targeting to membrane 94 25 6.62 6.16 0.966 0.966 36.1 1

3.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

3.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

3.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

3.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

4.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

4.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

4.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

4.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

5.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

5.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

5.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

5.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

6.fivemg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

6.twentymg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

6.twentymg2x

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”

6.hundredmg

Version Author Date
4b8c5d1 karltayeb 2022-07-21

[1] “nothing to report”


sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

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

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

other attached packages:
 [1] gseasusie_0.0.0.9000 forcats_0.5.1        stringr_1.4.0       
 [4] dplyr_1.0.9          purrr_0.3.4          readr_2.1.2         
 [7] tidyr_1.2.0          tibble_3.1.7         ggplot2_3.3.6       
[10] tidyverse_1.3.1     

loaded via a namespace (and not attached):
  [1] matrixStats_0.62.0     bitops_1.0-7           fs_1.5.2              
  [4] lubridate_1.8.0        bit64_4.0.5            webshot_0.5.3         
  [7] httr_1.4.3             rprojroot_2.0.3        GenomeInfoDb_1.30.1   
 [10] data.tree_1.0.0        tools_4.1.2            backports_1.4.1       
 [13] bslib_0.3.1            utf8_1.2.2             R6_2.5.1              
 [16] DBI_1.1.2              BiocGenerics_0.40.0    colorspace_2.0-3      
 [19] withr_2.5.0            tidyselect_1.1.2       bit_4.0.4             
 [22] compiler_4.1.2         git2r_0.30.1           VEB.Boost_0.0.0.9037  
 [25] cli_3.3.0              rvest_1.0.2            Biobase_2.54.0        
 [28] xml2_1.3.3             labeling_0.4.2         sass_0.4.1            
 [31] scales_1.2.0           mvtnorm_1.1-3          systemfonts_1.0.4     
 [34] digest_0.6.29          spatstat.utils_2.3-1   svglite_2.1.0         
 [37] rmarkdown_2.14         XVector_0.34.0         pkgconfig_2.0.3       
 [40] htmltools_0.5.2        highr_0.9              dbplyr_2.2.0          
 [43] fastmap_1.1.0          rlang_1.0.2            readxl_1.4.0          
 [46] rstudioapi_0.13        RSQLite_2.2.14         farver_2.1.0          
 [49] jquerylib_0.1.4        generics_0.1.2         jsonlite_1.8.0        
 [52] mr.ash.alpha_0.1-42    RCurl_1.98-1.7         magrittr_2.0.3        
 [55] kableExtra_1.3.4       GenomeInfoDbData_1.2.7 Matrix_1.4-1          
 [58] Rcpp_1.0.8.3           munsell_0.5.0          S4Vectors_0.32.4      
 [61] fansi_1.0.3            lifecycle_1.0.1        stringi_1.7.6         
 [64] whisker_0.4            yaml_2.3.5             zlibbioc_1.40.0       
 [67] org.Hs.eg.db_3.14.0    grid_4.1.2             blob_1.2.3            
 [70] parallel_4.1.2         promises_1.2.0.1       crayon_1.5.1          
 [73] lattice_0.20-45        Biostrings_2.62.0      haven_2.5.0           
 [76] hms_1.1.1              KEGGREST_1.34.0        knitr_1.39            
 [79] pillar_1.7.0           stats4_4.1.2           reprex_2.0.1          
 [82] glue_1.6.2             evaluate_0.15          emulator_1.2-21       
 [85] modelr_0.1.8           vctrs_0.4.1            png_0.1-7             
 [88] tzdb_0.3.0             httpuv_1.6.5           cellranger_1.1.0      
 [91] gtable_0.3.0           assertthat_0.2.1       cachem_1.0.6          
 [94] xfun_0.31              broom_0.8.0            later_1.3.0           
 [97] viridisLite_0.4.0      AnnotationDbi_1.56.2   memoise_2.0.1         
[100] IRanges_2.28.0         workflowr_1.7.0        ellipsis_0.3.2