Last updated: 2023-07-28
Checks: 7 0
Knit directory: SuperCellCyto-analysis/
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(42)
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 402358b. 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: .Rproj.user/
Ignored: code/.DS_Store
Ignored: data/.DS_Store
Ignored: data/bodenmiller_cytof/
Ignored: data/explore_supercell_purity_clustering/
Ignored: data/haas_bm/
Ignored: data/oetjen_bm_dataset/
Ignored: data/trussart_cytofruv/
Ignored: output/.DS_Store
Ignored: output/bodenmiller_cytof/
Ignored: output/explore_supercell_purity_clustering/
Ignored: output/label_transfer/
Ignored: output/oetjen_b_cell_panel/
Ignored: output/trussart_cytofruv/
Untracked files:
Untracked: README.html
Untracked: analysis/ref.bib
Untracked: code/README.html
Untracked: code/b_cell_identification/
Untracked: code/batch_correction/
Untracked: code/bodenmiller_data/
Untracked: code/explore_supercell_purity_clustering/
Untracked: code/label_transfer/
Untracked: data/README.html
Untracked: output/README.html
Unstaged changes:
Modified: .gitignore
Modified: README.md
Modified: _workflowr.yml
Modified: analysis/_site.yml
Modified: code/README.md
Modified: data/README.md
Modified: output/README.md
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/run_time.Rmd
) and HTML
(docs/run_time.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 | 402358b | Givanna Putri | 2023-07-28 | wflow_publish(c("analysis/*Rmd")) |
In this analysis, we examine the time required to create the supercells, as well as the run time improvement obtained by analysing supercells vs single cells.
library(here)
library(data.table)
library(stringr)
library(ggplot2)
library(scales)
run_time_clust_benchmark <- lapply(c("samusik_all", "levine_32dim"), function(dt_source) {
dt <- fread(here("output", "explore_supercell_purity_clustering", "20230511",
dt_source, "supercell_runs", "supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
dt$gamma <- str_split_i(dt$dataset, "_", 2)
dt$dataset <- str_to_title(dt_source)
dt$duration_seconds <- gsub(" sec elapsed", "", dt$duration_seconds)
return(dt)
})
run_time_clust_benchmark <- rbindlist(run_time_clust_benchmark)
run_time_bcells <- fread(here("output", "oetjen_b_cell_panel", "20230511", "supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
run_time_bcells$dataset <- "Oetjen_bcells"
run_time_bcells$duration_seconds <- gsub(" sec elapsed", "", run_time_bcells$duration_seconds)
run_time_bcells$gamma <- "gamma20"
run_time_trussart <- fread(here("output", "trussart_cytofruv", "20230515_supercell_out", "supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
run_time_trussart$dataset <- "Trussart_cytofruv"
run_time_trussart$duration_seconds <- gsub(" sec elapsed", "", run_time_trussart$duration_seconds)
run_time_trussart$gamma <- "gamma20"
run_time <- rbindlist(list(run_time_clust_benchmark, run_time_bcells, run_time_trussart))
run_time$gamma <- gsub("gamma", "", run_time$gamma)
run_time$duration_seconds <- as.numeric(run_time$duration_seconds)
run_time$duration_minutes <- run_time$duration_seconds / 60
run_time$duration_hours <- run_time$duration_seconds / 3600
ggplot(run_time[dataset %in% c("Samusik_all", "Levine_32dim")],
aes(x = gamma, y = duration_minutes, colour = dataset)) +
geom_point(size = 2) +
scale_color_manual(values = c("Levine_32dim" = "purple", "Samusik_all" = "#FFC000")) +
theme_classic() +
scale_y_continuous(breaks = pretty_breaks(n=5), limits = c(2,3)) +
labs(y = "Duration (minutes)", x = "Gamma", color = "Dataset", title = "Time Taken to Generate Supercells")
ggplot(run_time[dataset %in% c("Oetjen_bcells", "Trussart_cytofruv")],
aes(x = dataset, y = duration_minutes, colour = dataset)) +
geom_point() +
scale_color_manual(values = c("Oetjen_bcells" = "#FF5733", "Trussart_cytofruv" = "turquoise")) +
theme_classic() +
scale_y_continuous(breaks = pretty_breaks(n=5)) +
labs(y = "Duration (minutes)", x = "Dataset", color = "Dataset", title = "Time Taken to Generate Supercells")
louvain_runtime_supercell <- lapply(c("samusik_all", "levine_32dim"), function(dt_source) {
dt <- lapply(seq(5, 50, by=5), function(gam) {
dt <- fread(here("output", "explore_supercell_purity_clustering", "20230511",
dt_source, "louvain_supercell_runs", paste0("gamma_", gam),
"louvain_supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
dt$duration_seconds <- as.numeric(gsub(" sec elapsed", "", dt$duration_seconds))
dt$gamma <- gam
dt$dataset <- str_to_title(dt_source)
return(dt)
})
return(rbindlist(dt))
})
louvain_runtime_supercell <- rbindlist(louvain_runtime_supercell)
louvain_runtime_supercell$type <- "Supercells"
louvain_runtime_allcell <- lapply(c("samusik_all", "levine_32dim"), function(dt_source) {
dt <- lapply(seq(10, 30, by=5), function(k) {
dt <- fread(here("output", "explore_supercell_purity_clustering", "20230511",
dt_source, "louvain_allcells", paste0("k", k),
"louvain_supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
dt$duration_seconds <- as.numeric(gsub(" sec elapsed", "", dt$duration_seconds))
dt$dataset <- str_to_title(dt_source)
return(dt)
})
return(rbindlist(dt))
})
louvain_runtime_allcell <- rbindlist(louvain_runtime_allcell)
louvain_runtime_allcell$type <- "Single cells"
louvain_runtime <- rbind(
louvain_runtime_allcell,
louvain_runtime_supercell[, c("dataset", "duration_seconds", "type")]
)
louvain_runtime[, duration_minutes := duration_seconds / 60]
ggplot(louvain_runtime, aes(x = type, y = duration_minutes, colour = dataset)) +
geom_boxplot() +
scale_color_manual(values = c("Levine_32dim" = "purple", "Samusik_all" = "#FFC000")) +
theme_classic() +
scale_y_continuous(breaks = pretty_breaks(n=20)) +
labs(y = "Duration (minutes)", x = "Gamma", color = "Dataset", title = "Louvain clustering run time")
Median run time?
louvain_runtime[, .(median_duration_sec = median(duration_seconds), median_duration_min = median(duration_minutes)), by = c("type", "dataset")]
type dataset median_duration_sec median_duration_min
1: Single cells Samusik_all 5319.1040 88.6517333
2: Single cells Levine_32dim 590.3805 9.8396750
3: Supercells Samusik_all 8.2705 0.1378417
4: Supercells Levine_32dim 1.9170 0.0319500
fsom_runtime_supercell <- lapply(c("samusik_all", "levine_32dim"), function(dt_source) {
dt <- lapply(seq(5, 50, by=5), function(gam) {
dt <- fread(here("output", "explore_supercell_purity_clustering", "20230511",
dt_source, "flowsom_supercell_runs", paste0("gamma_", gam),
"flowsom_supercell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
dt$duration_seconds <- as.numeric(gsub(" sec elapsed", "", dt$duration_seconds))
dt$gamma <- gam
dt$dataset <- str_to_title(dt_source)
return(dt)
})
return(rbindlist(dt))
})
fsom_runtime_supercell <- rbindlist(fsom_runtime_supercell)
fsom_runtime_supercell$type <- "Supercells"
fsom_runtime_allcell <- lapply(c("samusik_all", "levine_32dim"), function(dt_source) {
dt <- fread(here("output", "explore_supercell_purity_clustering", "20230509",
dt_source, "flowsom_allcells", "flowsom_allcell_runtime.txt"),
sep = ":", header = FALSE, col.names = c("dataset", "duration_seconds"))
dt$duration_seconds <- as.numeric(gsub(" sec elapsed", "", dt$duration_seconds))
dt$dataset <- str_to_title(dt_source)
return(dt)
return(rbindlist(dt))
})
fsom_runtime_allcell <- rbindlist(fsom_runtime_allcell)
fsom_runtime_allcell$type <- "Single Cells"
fsom_runtime <- rbind(
fsom_runtime_allcell,
fsom_runtime_supercell[, c("dataset", "duration_seconds", "type")]
)
ggplot(fsom_runtime, aes(x = type, y = duration_seconds, colour = dataset)) +
geom_boxplot() +
scale_color_manual(values = c("Levine_32dim" = "purple", "Samusik_all" = "#FFC000")) +
theme_classic() +
scale_y_continuous(breaks = pretty_breaks(n=20)) +
labs(y = "Duration (seconds)", x = "Gamma", color = "Dataset", title = "FlowSOM clustering run time")
Median run time?
fsom_runtime[, .(median_duration_sec = median(duration_seconds)), by = c("type", "dataset")]
type dataset median_duration_sec
1: Single Cells Samusik_all 52.7870
2: Single Cells Levine_32dim 15.8945
3: Supercells Samusik_all 8.0185
4: Supercells Levine_32dim 4.1705
sessionInfo()
R version 4.2.3 (2023-03-15)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/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] scales_1.2.1 ggplot2_3.4.1 stringr_1.5.0 data.table_1.14.8
[5] here_1.0.1 workflowr_1.7.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.10 highr_0.10 compiler_4.2.3 pillar_1.8.1
[5] bslib_0.4.2 later_1.3.0 git2r_0.31.0 jquerylib_0.1.4
[9] tools_4.2.3 getPass_0.2-2 digest_0.6.31 gtable_0.3.1
[13] jsonlite_1.8.4 evaluate_0.20 lifecycle_1.0.3 tibble_3.1.8
[17] pkgconfig_2.0.3 rlang_1.0.6 cli_3.6.0 rstudioapi_0.14
[21] yaml_2.3.7 xfun_0.39 fastmap_1.1.0 withr_2.5.0
[25] dplyr_1.1.0 httr_1.4.4 knitr_1.42 generics_0.1.3
[29] fs_1.6.1 vctrs_0.5.2 sass_0.4.5 tidyselect_1.2.0
[33] grid_4.2.3 rprojroot_2.0.3 glue_1.6.2 R6_2.5.1
[37] processx_3.8.0 fansi_1.0.4 rmarkdown_2.20 farver_2.1.1
[41] callr_3.7.3 magrittr_2.0.3 whisker_0.4.1 ps_1.7.2
[45] promises_1.2.0.1 htmltools_0.5.4 colorspace_2.1-0 httpuv_1.6.9
[49] utf8_1.2.3 stringi_1.7.12 munsell_0.5.0 cachem_1.0.6