Skip to content

Commit

Permalink
TGx-HDACi reporting module (#252)
Browse files Browse the repository at this point in the history
* add tgx-hdaci report module

* make tgx-hdaci report work in pipeline

* fix gene names for hwt2.0

* fix typo

* use ensembl IDs not gene symbols

* uncomment summarize_across_facet lines

* improve gene mismatch messages

* tgx-hdaci for human datasets only

* move bibtex files to their own folder
  • Loading branch information
LMBradford authored Aug 1, 2024
1 parent f200022 commit d71e97e
Show file tree
Hide file tree
Showing 14 changed files with 737 additions and 9 deletions.
25 changes: 25 additions & 0 deletions R.ODAF.utils/R/write_reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,28 @@ make_tgxddi_reports <- function(pars, paths, facet) {
render_report(tgxddi_report, tgxddi_file, pars)
}
}

#' Generate TGx-HDACi Report
#'
#' Renders the TGx-HDACi report HTML file for a given facet using the specified parameters.
#' The function updates the `reports_filter` in `pars` based on the facet provided.
#'
#' @param pars A list of parameters used for report generation.
#' @param facet A character string specifying the facet for which to generate the report.
#' @param paths A list of paths used throughout the analysis.
#' @return Invisible NULL. The function is called for its side effect of rendering an HTML report.
#' @export
make_hdaci_reports <- function(pars, paths, facet) {
if (is.na(pars$deseq_facet) && is.na(pars$reports_facet)) {
pars$reports_filter <- NULL
} else {
pars$reports_filter <- facet
}
prefix <-get_prefix(prefix_pars = pars, prefix_facet = facet)
if (pars$generate_tgxhdaci_report) {
message("Generating TGX-HDACi report")
tgxhdaci_report <- file.path(paths$projectdir, "Rmd", "tgx-hdaci.Rmd")
tgxhdaci_file <- file.path(paths$reports_dir, paste0("tgxhdaci_", prefix, ".html"))
render_report(tgxhdaci_report, tgxhdaci_file, pars)
}
}
3 changes: 2 additions & 1 deletion Rmd/DESeq2_report_new.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ params:
generate_data_explorer_report: TRUE
generate_go_pathway_report: TRUE
generate_tgxddi_report: TRUE
generate_tgxhdaci_report: TRUE
output_digits: 5
parallel: FALSE
species_data: null
Expand All @@ -74,7 +75,7 @@ output:
code_folding: hide
theme: spacelab # flatly spacelab sandstone cerulean
code_download: true
bibliography: "`r file.path(params$projectdir, 'Rmd/references.bib')`"
bibliography: "`r file.path(params$projectdir, 'references/references.bib')`"

---

Expand Down
2 changes: 1 addition & 1 deletion Rmd/Sample_QC.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ output:
code_folding: hide
theme: spacelab # flatly spacelab sandstone cerulean
code_download: true
bibliography: "`r file.path(params$projectdir, 'Rmd/references.bib')`"
bibliography: "`r file.path(params$projectdir, 'references/references.bib')`"
---

```{r setup, include=FALSE}
Expand Down
1 change: 1 addition & 0 deletions Rmd/data_explorer_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ params:
generate_data_explorer_report: TRUE
generate_go_pathway_report: TRUE
generate_tgxddi_report: TRUE
generate_tgxhdaci_report: TRUE
output_digits: 5
parallel: FALSE
species_data: null
Expand Down
1 change: 1 addition & 0 deletions Rmd/go_pathway_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ params:
generate_data_explorer_report: TRUE
generate_go_pathway_report: TRUE
generate_tgxddi_report: TRUE
generate_tgxhdaci_report: TRUE
output_digits: 5
parallel: FALSE
species_data: null
Expand Down
1 change: 1 addition & 0 deletions Rmd/stats_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ params:
generate_data_explorer_report: TRUE
generate_go_pathway_report: TRUE
generate_tgxddi_report: TRUE
generate_tgxhdaci_report: TRUE
output_digits: 5
parallel: FALSE
species_data: null
Expand Down
Loading

0 comments on commit d71e97e

Please sign in to comment.