Load the required packages:
library(tidyverse)
library(glue)
library(scales)
library(ggpattern)Prepare plot data:
tools_cpu <- c("Isosceles", "IsoQuant", "Bambu", "Flair", "NanoCount", "LIQA",
"ESPRESSO", "FLAMES", "Sicelore")
total_cpu_df <- data.frame(
tool = rep(tools_cpu, 2),
step = rep(c("run_program", "minimap2_align"), each = length(tools_cpu)),
value = c(c(34, 149, 22, 694, 4, 1621, 3063, 239, 43),
c(1483, 1483, 1483, 1483, 456, 1483, 1483, 1483, 1483))
)
tools_mem <- c("Isosceles", "IsoQuant", "Bambu", "Flair", "NanoCount", "LIQA",
"ESPRESSO", "FLAMES", "Sicelore", "minimap2",
"minimap2_trans")
max_memory_df <- data.frame(
tool = tools_mem,
value = c(6.1, 19.8, 5.7, 6.6, 3.8, 1.7, 29.2, 10, 8.2, 24.6, 5.4)
)
total_cpu_df$tool <- fct_rev(fct_reorder(
total_cpu_df$tool, total_cpu_df$value, .fun = sum
))
total_cpu_df$step <- fct_rev(total_cpu_df$step)
max_memory_df$tool <- fct_rev(fct_reorder(
max_memory_df$tool, max_memory_df$value
))Total CPU time data (min):
pivot_wider(total_cpu_df, names_from = step, values_from = value)Max memory usage data (GB):
max_memory_dfPlot total CPU time by program:
ggplot(total_cpu_df, mapping = aes(x = value,
y = tool,
fill = tool,
pattern = step)) +
geom_col_pattern(
pattern_color = "lightgrey",
pattern_fill = "lightgrey",
pattern_spacing = 0.01, pattern_density = 0.05, pattern_size = 0.25
) +
scale_x_log10(labels = trans_format("log10", math_format(10^.x))) +
coord_cartesian(clip = "off") +
annotation_logticks(outside = TRUE,
sides = "b",
size = 0.3,
short = unit(0.05, "cm"),
mid = unit(0.1, "cm"),
long = unit(0.15, "cm")) +
scale_fill_manual(values = c(Bambu = "mediumseagreen",
ESPRESSO = "lightsalmon",
Flair = "mediumpurple",
Isosceles = "black",
IsoQuant = "gold",
LIQA = "deeppink",
NanoCount = "cornflowerblue",
FLAMES = "tomato",
Sicelore = "royalblue")) +
scale_pattern_manual(values = c(minimap2_align = "stripe",
run_program = "none")) +
labs(
x = "Total CPU time (min)",
y = ""
) +
theme_bw() +
theme(legend.position = "none",
axis.text = element_text(size = 7),
axis.title.y = element_blank(),
axis.title.x = element_text(size = 9),
axis.ticks.x = element_blank())Plot maximum memory usage by program:
ggplot(max_memory_df, mapping = aes(x = value,
y = tool,
fill = tool)) +
geom_col() +
scale_fill_manual(values = c(Bambu = "mediumseagreen",
ESPRESSO = "lightsalmon",
Flair = "mediumpurple",
Isosceles = "black",
IsoQuant = "gold",
LIQA = "deeppink",
NanoCount = "cornflowerblue",
FLAMES = "tomato",
Sicelore = "royalblue",
minimap2 = "darkgrey",
minimap2_trans = "darkgrey")) +
labs(
x = "Max. memory usage (GB)",
y = ""
) +
theme_bw() +
theme(legend.position = "none",
axis.text = element_text(size = 7),
axis.title.y = element_blank(),
axis.title.x = element_text(size = 9))sessionInfo()## R version 4.3.1 (2023-06-16)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.6 LTS
##
## Matrix products: default
## BLAS: /usr/local/lib/R/lib/libRblas.so
## LAPACK: /usr/local/lib/R/lib/libRlapack.so; LAPACK version 3.11.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C
## [4] LC_COLLATE=C LC_MONETARY=C LC_MESSAGES=C
## [7] LC_PAPER=C LC_NAME=C LC_ADDRESS=C
## [10] LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
##
## time zone: Etc/UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] ggpattern_1.0.1 scales_1.3.0 glue_1.7.0 lubridate_1.9.3
## [5] forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
## [9] readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 ggplot2_3.4.4
## [13] tidyverse_2.0.0
##
## loaded via a namespace (and not attached):
## [1] sass_0.4.8 utf8_1.2.4 generics_0.1.3 class_7.3-22
## [5] KernSmooth_2.23-21 stringi_1.8.3 hms_1.1.3 digest_0.6.34
## [9] magrittr_2.0.3 evaluate_0.23 grid_4.3.1 timechange_0.3.0
## [13] fastmap_1.1.1 jsonlite_1.8.8 e1071_1.7-14 DBI_1.2.2
## [17] fansi_1.0.6 jquerylib_0.1.4 cli_3.6.2 rlang_1.1.3
## [21] units_0.8-5 gridpattern_1.1.1 munsell_0.5.0 withr_3.0.0
## [25] cachem_1.0.8 yaml_2.3.8 tools_4.3.1 tzdb_0.4.0
## [29] memoise_2.0.1 colorspace_2.1-0 vctrs_0.6.5 R6_2.5.1
## [33] proxy_0.4-27 lifecycle_1.0.4 classInt_0.4-10 pkgconfig_2.0.3
## [37] pillar_1.9.0 bslib_0.6.1 gtable_0.3.4 Rcpp_1.0.12
## [41] sf_1.0-15 highr_0.10 xfun_0.42 tidyselect_1.2.0
## [45] rstudioapi_0.15.0 knitr_1.45 farver_2.1.1 htmltools_0.5.7
## [49] labeling_0.4.3 rmarkdown_2.25 compiler_4.3.1