Last updated: 2022-02-09
Checks: 6 1
Knit directory: mage_2020_marker-gene-benchmarking/
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.
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
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(20190102)
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 fcdd2eb. 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/
Ignored: .snakemake/
Ignored: NSForest/.Rhistory
Ignored: NSForest/NS-Forest_v3_Extended_Binary_Markers_Supplmental.csv
Ignored: NSForest/NS-Forest_v3_Full_Results.csv
Ignored: NSForest/NSForest3_medianValues.csv
Ignored: NSForest/NSForest_v3_Final_Result.csv
Ignored: NSForest/__pycache__/
Ignored: NSForest/data/
Ignored: RankCorr/picturedRocks/__pycache__/
Ignored: benchmarks/
Ignored: config/
Ignored: data/cellmarker/
Ignored: data/downloaded_data/
Ignored: data/expert_annotations/
Ignored: data/raw_data/
Ignored: data/real_data/
Ignored: data/sim_data/
Ignored: data/sim_mgs/
Ignored: logs/
Ignored: results/
Ignored: weights/
Untracked files:
Untracked: analysis/figure/
Unstaged changes:
Modified: analysis/cellmarker.Rmd
Modified: analysis/classical-robustness-case-study.Rmd
Modified: analysis/concordance.Rmd
Modified: analysis/direction-selected-analysis.Rmd
Modified: analysis/endothelial-data.Rmd
Modified: analysis/endothelial-expert-analysis.Rmd
Modified: analysis/lawlor-data.Rmd
Modified: analysis/log-fc-values-analysis.Rmd
Modified: analysis/memory.Rmd
Modified: analysis/nk-case-study.Rmd
Modified: analysis/p-value-analysis.Rmd
Modified: analysis/pbmc3k-data.Rmd
Modified: analysis/pbmc3k-expert-analysis.Rmd
Modified: analysis/scanpy-seurat-concordance.Rmd
Modified: analysis/scran-any-case-study.Rmd
Modified: analysis/seurat-method-analysi.Rmd
Modified: analysis/sim-data-analysis.Rmd
Modified: analysis/simulated-marker-genes.Rmd
Modified: analysis/simulation-validation-analysis.Rmd
Modified: analysis/single-cell-database-analysis.Rmd
Modified: analysis/t-test-only-zero-case-study.Rmd
Modified: analysis/time.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/time.Rmd
) and HTML (public/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 | aca9ad2 | Jeffrey Pullin | 2021-11-29 | Various changes made in the last days before thesis submission |
Rmd | ddb1eeb | Jeffrey Pullin | 2021-09-28 | Update time analyses |
Rmd | 16c471e | Jeffrey Pullin | 2021-09-22 | Polish time plots |
Rmd | e552e95 | Jeffrey Pullin | 2021-09-21 | Extend time analysis |
Rmd | 17f2a0f | Jeffrey Pullin | 2021-08-07 | Add new plots and analysis for lab meeting 5/8/2021 |
Rmd | ef9f1c7 | Jeffrey Pullin | 2021-08-02 | Add code to plot time of methods on real data |
Rmd | 864677c | Jeffrey Pullin | 2021-07-21 | Add mini wilcoxon speed analysis |
html | 61ee246 | Jeffrey Pullin | 2021-04-13 | Build site. |
Rmd | b5b2a88 | Jeffrey Pullin | 2021-04-13 | Add new results |
Rmd | 3a4cb2e | Jeffrey Pullin | 2021-03-16 | Update 16/3/2021 |
html | ca82ce0 | Jeffrey Pullin | 2021-02-16 | Build site. |
html | 2863555 | Jeffrey Pullin | 2021-02-10 | Build site. |
Rmd | ffe660c | Jeffrey Pullin | 2021-02-09 | Update 9/2/2021 |
library(tibble)
library(dplyr)
library(ggplot2)
library(tidyr)
library(purrr)
library(forcats)
library(khroma)
library(pals)
library(patchwork)
source(here::here("code", "analysis-utils.R"))
source(here::here("code", "plot-utils.R"))
Measure the time the different methods take to run.
<- retrive_simulation_parameters() %>%
time_sim_data rowwise() %>%
mutate(time = readRDS(full_filename)$time) %>%
ungroup()
%>%
time_sim_data filter(sim_label == "num_cells") %>%
# Remove methods we implemented.
filter(!(method %in% c("lm", "difference", "random"))) %>%
group_by(pars, method, batchCells) %>%
summarise(time = mean(time), .groups = "drop") %>%
mutate(method = method_lookup[method]) %>%
ggplot(aes(x = batchCells, y = time, colour = method)) +
geom_point() +
scale_x_continuous(
breaks = c(1000, 5000, 10000, 30000, 50000)
+
) scale_y_log10(
breaks = c(1, 10, 60, 600, 3600, 10800),
labels = c("1s", "10s", "1m", "10min", "1hr", "3hr")
+
) labs(
title = "Runtime vs total number of cells",
x = "Number of cells",
y = "Time (s)",
colour = "Method"
+
) theme_bw()
%>%
time_sim_data filter(sim_label == "num_cells") %>%
filter(method == "seurat") %>%
group_by(pars, test.use, batchCells) %>%
summarise(time = mean(time), .groups = "drop") %>%
mutate(test.use = test.use_lookup[test.use]) %>%
ggplot(aes(x = batchCells, y = time, colour = test.use)) +
geom_jitter(width = 200) +
scale_x_continuous(
breaks = c(1000, 5000, 10000, 30000, 50000)
+
) scale_y_log10(
breaks = c(1, 10, 60, 600, 3600, 10800),
labels = c("1s", "10s", "1m", "10min", "1hr", "3hr")
+
) labs(
title = "Runtime vs total number of cells",
x = "Number of cells",
y = "Time (s)",
colour = "Method"
+
) theme_bw()
Linear time scale
# time_sim_data %>%
# rowwise() %>%
# mutate(num_clusters = if_else(is.na(n_clus), length(group.prob), n_clus)) %>%
# filter(sim_label == "num_clusters") %>%
# ggplot(aes(x = num_clusters, y = time, col = pars)) +
# geom_point() +
# geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
# scale_colour_manual(values = unname(polychrome(20))) +
# labs(
# title = "Runtime vs number of clusters - all methods",
# x = "Number of clusters",
# y = "Time (s)",
# colour = "Method") +
# theme_bw()
# time_sim_data %>%
# rowwise() %>%
# mutate(num_clusters = if_else(is.na(n_clus), length(group.prob), n_clus)) %>%
# filter(sim_label == "num_clusters") %>%
# ggplot(aes(x = num_clusters, y = time, col = pars)) +
# geom_point() +
# geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
# scale_y_log10() +
# scale_colour_manual(values = unname(polychrome(20))) +
# labs(
# title = "Runtime vs number of clusters - all methods",
# x = "Number of clusters",
# y = "Time (s)",
# colour = "Method") +
# theme_bw()
%>%
time_sim_data filter(sim_label == "num_cells") %>%
filter(method == "scran") %>%
mutate(scran_pars = paste0(test.type, "_", pval.type)) %>%
ggplot(aes(x = batchCells, y = time, colour = scran_pars)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
scale_x_continuous(breaks = c(100, 500, 1000, 2000, 3000)) +
labs(
title = "Runtime vs total number of cells - scran",
x = "Total number of cells",
y = "Time (s)",
colour = "scran options") +
theme_bw()
# time_sim_data %>%
# rowwise() %>%
# mutate(num_clusters = if_else(is.na(n_clus), length(group.prob), n_clus)) %>%
# filter(sim_label == "num_clusters") %>%
# filter(method == "scran") %>%
# ggplot(aes(x = num_clusters, y = time, col = pars)) +
# geom_point() +
# geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
# labs(
# title = "Runtime vs number of clusters - scran",
# x = "Number of clusters",
# y = "Time (s)",
# colour = "scran options"
# ) +
# theme_bw()
%>%
time_sim_data filter(sim_label == "num_cells") %>%
filter(method == "seurat") %>%
ggplot(aes(x = batchCells, y = time, col = test.use)) +
geom_point() +
geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
labs(
y = "Time (s)",
x = "Test method",
col = "Test used"
+
) theme_bw() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# time_sim_data %>%
# filter(sim_label == "num_clusters") %>%
# filter(method == "seurat") %>%
# ggplot(aes(x = num_clusters, y = time, col = test.use)) +
# geom_point() +
# geom_smooth(method = "lm", se = FALSE, formula = y ~ x) +
# labs(
# y = "Time (s)",
# x = "Number of clusters",
# col = "Test used"
# ) +
# theme_bw()
<- retrieve_real_data_parameters() %>%
real_data_data rowwise() %>%
mutate(time = readRDS(full_filename)$time) %>%
ungroup()
<- real_data_data %>%
pbmc3k_time filter(data_id == "pbmc3k") %>%
filter(!(pars %in% c("lm_two_sample", "random"))) %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
mutate(ms = 1000 * time) %>%
ggplot(aes(x = pars, y = ms)) +
geom_point(colour = "seagreen", alpha = 0.8, size = 3) +
scale_y_log10(
breaks = c(500, 1000, 10000, 60000, 600000),
labels = c("0.5s", "1s", "10s", "1m", "10min")
+
) coord_flip() +
labs(
y = "Time (log scale)",
x = "Method",
title = "pbmc3k data"
+
) theme_bw()
pbmc3k_time
%>%
real_data_data filter(data_id == "lawlor") %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
ggplot(aes(x = pars, y = time)) +
geom_col(fill = "seagreen", alpha = 0.8) +
coord_flip() +
labs(
y = "Time (s)",
x = "Method"
+
) theme_bw()
%>%
real_data_data filter(data_id == "zeisel") %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
mutate(ms = 1000 * time) %>%
ggplot(aes(x = pars, y = ms)) +
geom_point(colour = "seagreen", alpha = 0.8) +
scale_y_log10(
breaks = c(500, 1000, 10000, 60000, 600000),
labels = c("0.5s", "1s", "10s", "1m", "10min")
+
) coord_flip() +
labs(
y = "Time",
x = "Method",
title = "Method time (Zeisel data)"
+
) theme_bw()
<- real_data_data %>%
endothelial_time filter(data_id == "endothelial") %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
mutate(ms = 1000 * time) %>%
ggplot(aes(x = pars, y = ms)) +
geom_point(colour = "seagreen", size = 3) +
scale_y_log10(
breaks = c(1000, 10000, 60000, 600000, 3600000, 18000000),
labels = c("1s", "10s", "1m", "10min", "1hr", "5hr")
+
) coord_flip() +
labs(
y = "Time (log scale)",
x = "Method",
title = "Endothelial data"
+
) theme_bw()
endothelial_time
<- real_data_data %>%
endothelial_time_talk filter(data_id == "endothelial") %>%
filter(method != "rankcorr") %>%
filter(pars != "lm_two_sample") %>%
filter(method != "random") %>%
filter(pars != "difference_log_fc") %>%
mutate(method = method_lookup[method]) %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
mutate(ms = 1000 * time) %>%
ggplot(aes(x = pars, y = ms, colour = method)) +
geom_point(size = 3) +
scale_y_log10(
breaks = c(1000, 10000, 60000, 600000, 3600000, 18000000),
labels = c("1s", "10s", "1m", "10m", "1hr", "5hr")
+
) coord_flip() +
labs(
y = "Time (log scale)",
x = "Method",
title = "Endothelial data",
colour = "Method"
+
) theme_bw()
endothelial_time_talk
+ endothelial_time +
pbmc3k_time plot_annotation(tag_levels = "A")
%>%
real_data_data filter(data_id == "endothelial") %>%
mutate(plot_pars = pars_lookup[pars]) %>%
mutate(plot_pars = fct_reorder(factor(plot_pars), time)) %>%
mutate(highlight_pars = pars %in%
c("scran_t_any", "seurat_wilcox", "scanpy_t")) %>%
mutate(ms = 1000 * time) %>%
ggplot(aes(x = plot_pars, y = ms, colour = highlight_pars)) +
geom_segment(aes(x = plot_pars, xend = plot_pars, y = 400, yend = ms),
lineend = "round", colour = "darkgrey") +
geom_point(size = 3) +
scale_colour_manual(values = c("#228833", "#EE6677")) +
scale_y_log10(
breaks = c(1000, 10000, 60000, 600000, 3600000, 18000000),
labels = c("1s", "10s", "1m", "10min", "1hr", "5hr")
+
) coord_flip() +
labs(
y = "Time (log scale)",
x = "Method",
title = "Method time (Endothelial data)"
+
) theme_bw() +
theme(legend.position = "none")
%>%
real_data_data filter(data_id == "endothelial") %>%
filter(pars %in% c("scran_t_any", "seurat_wilcox", "scanpy_t")) %>%
mutate(min = time / 60) %>%
select(pars, sec = time, min)
# A tibble: 2 × 3
pars sec min
<chr> <dbl> <dbl>
1 scran_t_any 2.54 0.0424
2 seurat_wilcox 729. 12.2
%>%
real_data_data filter(data_id == "endothelial") %>%
mutate(pars = pars_lookup[pars]) %>%
mutate(pars = fct_reorder(factor(pars), time)) %>%
mutate(min = time / 60) %>%
ggplot(aes(x = pars, y = min)) +
geom_segment(aes(x = pars, xend = pars, y = 0, yend = min),
lineend = "round", colour = "darkgrey") +
geom_point(colour = "seagreen") +
coord_flip() +
labs(
y = "Time (min)",
x = "Method",
title = "Method time (Endothelial data)"
+
) theme_bw()
For slurm optimization
%>%
time_sim_data ggplot(aes(x = time)) +
geom_histogram(binwidth = 200) +
geom_vline(xintercept = 60 * 20, col = "blue") +
geom_vline(xintercept = 60 * 30, col = "red") +
geom_vline(xintercept = 60 * 60, col = "green") +
geom_vline(xintercept = 120 * 60, col = "yellow") +
labs(x = "Time (s)", y = "Count") +
theme_bw()
::session_info() devtools
─ Session info ───────────────────────────────────────────────────────────────
setting value
version R version 4.1.0 (2021-05-18)
os Red Hat Enterprise Linux
system x86_64, linux-gnu
ui X11
language (EN)
collate en_AU.UTF-8
ctype en_AU.UTF-8
tz Australia/Melbourne
date 2022-02-09
─ Packages ───────────────────────────────────────────────────────────────────
package * version date lib source
assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.1.0)
bslib 0.2.5.1 2021-05-18 [2] CRAN (R 4.1.0)
cachem 1.0.6 2021-08-19 [1] CRAN (R 4.1.0)
callr 3.7.0 2021-04-20 [2] CRAN (R 4.1.0)
cli 3.1.0 2021-10-27 [1] CRAN (R 4.1.0)
colorspace 2.0-2 2021-06-24 [1] CRAN (R 4.1.0)
crayon 1.4.2 2021-10-29 [1] CRAN (R 4.1.0)
DBI 1.1.2 2021-12-20 [1] CRAN (R 4.1.0)
desc 1.3.0 2021-03-05 [2] CRAN (R 4.1.0)
devtools 2.4.1 2021-05-05 [2] CRAN (R 4.1.0)
dichromat 2.0-0 2013-01-24 [2] CRAN (R 4.1.0)
digest 0.6.29 2021-12-01 [1] CRAN (R 4.1.0)
dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.0)
ellipsis 0.3.2 2021-04-29 [2] CRAN (R 4.1.0)
evaluate 0.14 2019-05-28 [2] CRAN (R 4.1.0)
fansi 0.5.0 2021-05-25 [2] CRAN (R 4.1.0)
farver 2.1.0 2021-02-28 [2] CRAN (R 4.1.0)
fastmap 1.1.0 2021-01-25 [2] CRAN (R 4.1.0)
forcats * 0.5.1 2021-01-27 [2] CRAN (R 4.1.0)
fs 1.5.0 2020-07-31 [2] CRAN (R 4.1.0)
generics 0.1.1 2021-10-25 [1] CRAN (R 4.1.0)
ggplot2 * 3.3.5 2021-06-25 [1] CRAN (R 4.1.0)
git2r 0.28.0 2021-01-10 [2] CRAN (R 4.1.0)
glue 1.6.0 2021-12-17 [1] CRAN (R 4.1.0)
gtable 0.3.0 2019-03-25 [2] CRAN (R 4.1.0)
here 1.0.1 2020-12-13 [1] CRAN (R 4.1.0)
highr 0.9 2021-04-16 [2] CRAN (R 4.1.0)
htmltools 0.5.1.1 2021-01-22 [2] CRAN (R 4.1.0)
httpuv 1.6.1 2021-05-07 [2] CRAN (R 4.1.0)
jquerylib 0.1.4 2021-04-26 [2] CRAN (R 4.1.0)
jsonlite 1.7.2 2020-12-09 [2] CRAN (R 4.1.0)
khroma * 1.7.0 2021-09-02 [1] CRAN (R 4.1.0)
knitr 1.36 2021-09-29 [1] CRAN (R 4.1.0)
labeling 0.4.2 2020-10-20 [2] CRAN (R 4.1.0)
later 1.2.0 2021-04-23 [2] CRAN (R 4.1.0)
lattice 0.20-44 2021-05-02 [2] CRAN (R 4.1.0)
lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.0)
magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.1.0)
mapproj 1.2.7 2020-02-03 [1] CRAN (R 4.1.0)
maps 3.3.0 2018-04-03 [2] CRAN (R 4.1.0)
Matrix 1.3-4 2021-06-01 [2] CRAN (R 4.1.0)
memoise 2.0.1 2021-11-26 [1] CRAN (R 4.1.0)
mgcv 1.8-36 2021-06-01 [2] CRAN (R 4.1.0)
munsell 0.5.0 2018-06-12 [2] CRAN (R 4.1.0)
nlme 3.1-152 2021-02-04 [2] CRAN (R 4.1.0)
pals * 1.7 2021-04-17 [1] CRAN (R 4.1.0)
patchwork * 1.1.1 2020-12-17 [2] CRAN (R 4.1.0)
pillar 1.6.4 2021-10-18 [1] CRAN (R 4.1.0)
pkgbuild 1.2.0 2020-12-15 [2] CRAN (R 4.1.0)
pkgconfig 2.0.3 2019-09-22 [2] CRAN (R 4.1.0)
pkgload 1.2.1 2021-04-06 [2] CRAN (R 4.1.0)
prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.1.0)
processx 3.5.2 2021-04-30 [2] CRAN (R 4.1.0)
promises 1.2.0.1 2021-02-11 [2] CRAN (R 4.1.0)
ps 1.6.0 2021-02-28 [2] CRAN (R 4.1.0)
purrr * 0.3.4 2020-04-17 [2] CRAN (R 4.1.0)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.0)
Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.1.0)
remotes 2.4.2 2021-11-30 [1] CRAN (R 4.1.0)
rlang 0.4.12 2021-10-18 [1] CRAN (R 4.1.0)
rmarkdown 2.11 2021-09-14 [1] CRAN (R 4.1.0)
rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.1.0)
rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.1.0)
sass 0.4.0 2021-05-12 [2] CRAN (R 4.1.0)
scales 1.1.1 2020-05-11 [2] CRAN (R 4.1.0)
sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.1.0)
stringi 1.7.6 2021-11-29 [1] CRAN (R 4.1.0)
stringr 1.4.0 2019-02-10 [2] CRAN (R 4.1.0)
testthat 3.0.2 2021-02-14 [2] CRAN (R 4.1.0)
tibble * 3.1.6 2021-11-07 [1] CRAN (R 4.1.0)
tidyr * 1.1.4 2021-09-27 [1] CRAN (R 4.1.0)
tidyselect 1.1.1 2021-04-30 [2] CRAN (R 4.1.0)
usethis 2.0.1 2021-02-10 [2] CRAN (R 4.1.0)
utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.0)
vctrs 0.3.8 2021-04-29 [2] CRAN (R 4.1.0)
whisker 0.4 2019-08-28 [2] CRAN (R 4.1.0)
withr 2.4.3 2021-11-30 [1] CRAN (R 4.1.0)
workflowr 1.6.2 2020-04-30 [1] CRAN (R 4.1.0)
xfun 0.23 2021-05-15 [2] CRAN (R 4.1.0)
yaml 2.2.1 2020-02-01 [2] CRAN (R 4.1.0)
[1] /home/jpullin/R/x86_64-pc-linux-gnu-library/4.1
[2] /usr/local/easybuild-2019/easybuild/software/mpi/gcc/10.2.0/openmpi/4.0.5/r/4.1.0/lib64/R/library