suppressPackageStartupMessages(library(magrittr))
if (rlang::is_true(getOption("knitr.in.progress"))) {
  params_ <- scdrake::scdrake_list(params)
}
drake_cache_dir <- params_$drake_cache_dir

drake::loadd(config_main, config_contrasts, contrasts_for_tables, path = params_$drake_cache_dir)
##-- Just mark these files as dependencies for drake.
drake::loadd(contrasts_plots_files, contrasts_dimred_plots_files, contrasts_table_files, path = params_$drake_cache_dir)


DT::datatable(matrix())

{.tabset}

groups <- dplyr::group_by(contrasts_for_tables, name)
group_list <- dplyr::group_split(groups) %>%
  magrittr::set_names(dplyr::group_keys(groups) %>% dplyr::pull(name))

x <- lapply(names(group_list), function(group_name) {
  df_group <- group_list[[group_name]]
  scdrake::md_header(group_name, 2, extra = "{.tabset}")

  scdrake::md_header("Dimred plots", 3, extra = "{.tabset}")
  dimred_plots <- dplyr::distinct(df_group, name, .keep_all = TRUE)$dimred_plots[[1]]
  y <- scdrake::lapply_rows(dimred_plots, FUN = function(par) {
    scdrake::md_header(stringr::str_to_upper(par$plot_dimreds), 4)
    print(par$plot)
  })

  scdrake::md_header("Results by contrasts", 3, extra = "{.tabset}")
  scdrake::generate_markers_results_section(
    df_group, group_var = "contrast_name", dt_order_by = "test_type",
    base_out_dir = config_contrasts$CONTRASTS_BASE_OUT_DIR
  )
})

{-}

r scdrake::format_used_functions(c("scran::findMarkers()", "scran::pairwiseWilcox()", "scran::pairwiseTTests()", "scran::pairwiseBinom()", "scran::combineMarkers()"))


Show input parameters

Main config

print(config_main)


Contrasts config

print(config_contrasts)





bioinfocz/scdrake documentation built on Sept. 19, 2024, 4:43 p.m.