diff --git a/R/qmd_template_parts.R b/R/qmd_template_parts.R index 2ca5b00..91ffe00 100644 --- a/R/qmd_template_parts.R +++ b/R/qmd_template_parts.R @@ -3,7 +3,6 @@ #' @param title Title for the report #' @param author Author for the report #' @param email Email of the author for the report -#' @param ... Other parameters to set the yaml header #' #' @return opening_yaml string to be used to construct the report qmd #' @export @@ -15,7 +14,13 @@ template_yaml <- function(title = "RNA-Seq Report", author = "Sameet", email = "sameet.mehta@yale.edu", - ...) { + count_fn = "gene_count_matrix.csv", + sample_fn = "sample-sheet.txt", + contrast_fn = "contrasts.txt", + metrics = NULL, + outputdir = "rnaseq_report_outputs", + thresh = 0.05 + ) { opening_yaml <- stringr::str_glue(" --- title: \"{title}\" @@ -41,7 +46,7 @@ params: contrasts_fn: null metrics: null outputs: \"{outputdir}\" - use_threshold: 0.05 + use_threshold: {thresh} --- ") opening_yaml @@ -74,6 +79,7 @@ We will import packages and functions. library(quartoReport) # use_thresh <- 0.05 # global threshold to use as alpha in the analysis +if(!dir.exists(params$outputs)) dir.create(params$outputs) ``` Please note that this package is currently under active development. @@ -387,16 +393,16 @@ This is a deconstructed Venn Diagram that is much more interpretable. Upset plot for the data in this analysis is given in @fig_upset ```{{r}} -#| label: fig_upset +#| label: fig-upset #| fig-cap: UpSet plot with with significant genes seen across all the comparisons. upset_df <- make_upset_df(dds = dds, meta_df = meta_df, contrasts_df = contrasts_df, thresh = params$use_threshold) upset_plot <- make_upset_plot(upset_df) ofn_upset <- file.path(params$outputs, \"upset-plot.pdf\") -ggplot2::ggsave(filname = ofn_upset, device = \"pdf\", plot = upset_plot) +ggplot2::ggsave(filename = ofn_upset, device = \"pdf\", plot = upset_plot) upset_plot ``` -In @fig_upset the number in the bars denotes number of genes satisfying that condition. +In @fig-upset the number in the bars denotes number of genes satisfying that condition. ") }