Skip to content

Commit

Permalink
Merge pull request #237 from sigven/favicon
Browse files Browse the repository at this point in the history
Use local favicon and remove system calls
  • Loading branch information
sigven authored Jun 14, 2024
2 parents 8da9057 + 1cc57f8 commit ba4f014
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 42 deletions.
2 changes: 2 additions & 0 deletions conda/recipe/pcgrr/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ requirements:
- r-dplyr
- r-dt
- r-formattable
- r-fs
- bioconductor-genomeinfodb
- r-ggplot2
- r-glue
Expand Down Expand Up @@ -61,6 +62,7 @@ requirements:
- r-dplyr
- r-dt
- r-formattable
- r-fs
- bioconductor-genomeinfodb
- r-ggplot2
- r-glue
Expand Down
1 change: 1 addition & 0 deletions pcgrr/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Imports:
dplyr,
DT,
formattable,
fs,
GenomeInfoDb,
ggplot2,
glue,
Expand Down
1 change: 0 additions & 1 deletion pcgrr/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export(log4r_warn)
export(log_var_eitem_stats)
export(make_cnaqc_object)
export(max_af_gnomad)
export(mkdir)
export(msi_indel_fraction_plot)
export(msi_indel_load_plot)
export(order_variants)
Expand Down
17 changes: 7 additions & 10 deletions pcgrr/R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -929,17 +929,17 @@ write_report_quarto_html <- function(report = NULL){
output_dir,
paste0('quarto_', stringi::stri_rand_strings(1, 15))
)
fs::dir_create(tmp_quarto_dir)
quarto_main_template <-
glue::glue("{tmp_quarto_dir}{.Platform$file.sep}pcgr_quarto_report.qmd")
file.path(tmp_quarto_dir, "pcgr_quarto_report.qmd")
quarto_main_template_sample <-
glue::glue("{tmp_quarto_dir}{.Platform$file.sep}pcgr_quarto_report_sample.qmd")
file.path(tmp_quarto_dir, "pcgr_quarto_report_sample.qmd")
quarto_html <-
glue::glue("{tmp_quarto_dir}{.Platform$file.sep}pcgr_quarto_report_sample.html")
file.path(tmp_quarto_dir, "pcgr_quarto_report_sample.html")

## Copy all PCGR quarto reporting templates, bibliography, css etc to
## the temporary directory for quarto report rendering
invisible(pcgrr::mkdir(tmp_quarto_dir))
system(glue::glue("cp -r {pcgr_rep_template_path}{.Platform$file.sep}* {tmp_quarto_dir}"))
fs::dir_copy(pcgr_rep_template_path, tmp_quarto_dir)

## Save sample PCGR report object in temporary quarto rendering directory
rds_report_path <- file.path(
Expand Down Expand Up @@ -977,17 +977,14 @@ write_report_quarto_html <- function(report = NULL){
## Copy output HTML report from temporary rendering directory
## to designated HTML file in output directory
if(file.exists(quarto_html)){
system(
glue::glue(paste0(
"cp -f {quarto_html} ",
"{fnames[['html']]}")))
fs::file_copy(quarto_html, fnames[["html"]])
}else{
cat("WARNING\n")
}

## remove temporary quarto directory (if debugging is switched off)
if(!(settings$conf$debug)){
system(glue::glue("rm -rf {tmp_quarto_dir}"))
fs::dir_delete(tmp_quarto_dir)
}
#pcgrr::log4r_info("------")
}
Expand Down
2 changes: 1 addition & 1 deletion pcgrr/R/mutational_signatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ generate_report_data_signatures <-
}
}

system(glue::glue("rm -f {vcf_name_mutsig_analysis}*"))
fs::file_delete(glue::glue("{vcf_name_mutsig_analysis}.gz"))

return(pcg_report_signatures)
}
Expand Down
16 changes: 1 addition & 15 deletions pcgrr/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ write_processed_vcf <- function(calls,
system(paste0("bgzip -f ", vcf_fname))
system(paste0("tabix -p vcf ", vcf_fname, ".gz"))

system(paste0("rm -f ", sample_vcf_content_fname))
fs::file_delete(sample_vcf_content_fname)
}


Expand Down Expand Up @@ -1023,20 +1023,6 @@ check_file_exists <- function(fname) {
}
}


#' Create directory
#'
#' @param d Directory to create.
#'
#' @export
mkdir <- function(d) {
if (!dir.exists(d)) {
dir.create(d, recursive = TRUE)
}
TRUE
}


#' Strip HTML tags
#'
#' Remove HTML tags and comments from text.
Expand Down
2 changes: 1 addition & 1 deletion pcgrr/inst/templates/pcgr_quarto_report.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ title-block-banner-color: "white"
linkcolor: '#0073C2'
include-in-header:
- text: |
<link rel="shortcut icon" href="https://github.com/sigven/pcgr/raw/master/pcgrr/pkgdown/favicon/favicon-16x16.png" />
<link rel="shortcut icon" href="favicon-16x16.png" />
<style>
.panel-tabset > .tab-content {
border: none;
Expand Down
14 changes: 0 additions & 14 deletions pcgrr/man/mkdir.Rd

This file was deleted.

0 comments on commit ba4f014

Please sign in to comment.