Skip to content

Commit ec2c617

Browse files
authored
Merge pull request #79 from /issues/77-data_update
Update test data
2 parents c1cda25 + 3dab6c8 commit ec2c617

14 files changed

+78
-54
lines changed

R/oncokb.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#' @return Vector of genes.
66
#' @export
77
read_oncokb <- function(x) {
8-
readr::read_tsv(x) |>
8+
readr::read_tsv(x, col_types = readr::cols(.default = "c")) |>
99
dplyr::filter(
1010
.data$`OncoKB Annotated` == "Yes"
1111
) |>

R/umccrise.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bcftools_stats_plot <- function(x = NULL) {
3030
tot <- nrow(d)
3131
p <- d |>
3232
ggplot2::ggplot(ggplot2::aes(x = .data$qual)) +
33-
ggplot2::geom_histogram(ggplot2::aes(y = ggplot2::after_stat(stats::density)), binwidth = 4, fill = "lightblue") +
33+
ggplot2::geom_histogram(ggplot2::aes(y = ggplot2::after_stat(.data$density)), binwidth = 4, fill = "lightblue") +
3434
ggplot2::geom_density(alpha = 0.6) +
3535
ggplot2::geom_vline(xintercept = med, colour = "blue", linetype = "dashed") +
3636
ggplot2::scale_x_continuous(n.breaks = 10) +
@@ -39,7 +39,7 @@ bcftools_stats_plot <- function(x = NULL) {
3939
label = paste0("Median: ", med),
4040
) +
4141
ggplot2::theme_bw() +
42-
ggplot2::ggtitle(glue::glue("SNV quality score distribution (total SNVs: {tot})"))
42+
ggplot2::ggtitle(glue::glue("Small variant quality score distribution (total variants: {tot})"))
4343
p
4444
}
4545

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
outs:
2-
- md5: b9ad0a338ab1cfbcf5f77f2923f5a923
3-
size: 30990
2+
- md5: da76078daae06437450548aae81bc20e
3+
size: 28325
44
path: purple.cnv.gene.tsv
5+
hash: md5
+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
outs:
2-
- md5: 63c8fc94da99b388021904993ce16c4a
3-
size: 451
2+
- md5: b7e6e168bb07e3dc3bcab9934cda9094
3+
size: 482
44
path: purple.purity.tsv
5+
hash: md5

inst/extdata/purple/purple.qc.dvc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
outs:
2-
- md5: afaa81edd722f89f32df3439dc24979e
3-
size: 208
2+
- md5: c10f44c2a7dc2b29cd2971efc94e0b0d
3+
size: 228
44
path: purple.qc
5+
hash: md5

inst/extdata/ref/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/umccr_cancer_genes_v24.03.0.tsv
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 28424e4e24fa8da80a431c832b3dd011
3+
size: 13441
4+
hash: md5
5+
path: umccr_cancer_genes_v24.03.0.tsv

inst/extdata/sash/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/sv.prioritised.tsv
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 4f5c6f721a2d4edb7dc3d30d0ce9054a
3+
size: 476080
4+
hash: md5
5+
path: sv.prioritised.tsv

inst/extdata/virusbreakend/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/virusbreakend.vcf
2+
/virusbreakend.vcf.summary.tsv
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: d965ed90d5b1757549ed4b5682b586b3
3+
size: 189585
4+
hash: md5
5+
path: virusbreakend.vcf
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 01057e3ee3a1cd0f0a162d221cb0afb3
3+
size: 573
4+
hash: md5
5+
path: virusbreakend.vcf.summary.tsv

inst/rmd/umccrise/cancer_report.Rmd

+38-40
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ knitr::opts_chunk$set(
4848

4949
```{r load_pkgs}
5050
# Bioconductor
51-
library(BSgenome)
52-
library(MutationalPatterns)
51+
library(BSgenome, include.only = "BSgenome")
52+
library(MutationalPatterns, include.only = "read_vcfs_as_granges")
5353
ref_genome <- "BSgenome.Hsapiens.UCSC.hg38"
54-
library(ref_genome, character.only = TRUE)
54+
library(ref_genome, character.only = TRUE, include.only = ref_genome)
5555
tx_ref_genome <- "TxDb.Hsapiens.UCSC.hg38.knownGene"
56-
library(tx_ref_genome, character.only = TRUE)
56+
library(tx_ref_genome, character.only = TRUE, include.only = tx_ref_genome)
5757
# CRAN
58-
library(devtools)
59-
library(details)
60-
library(DT)
58+
library(details, include.only = "details")
59+
library(DT, include.only = "datatable")
6160
library(dplyr)
62-
library(glue)
63-
library(gt)
64-
library(ggplot2)
65-
library(htmltools)
66-
library(jsonlite)
61+
library(GenomeInfoDb, include.only = "seqlevelsStyle")
62+
library(GenomicFeatures, include.only = "genes")
63+
library(GenomicRanges, include.only = "GRanges")
64+
library(glue, include.only = "glue")
65+
library(gt, include.only = "gt")
66+
library(ggplot2, include.only = "ggtitle")
67+
library(IRanges, include.only = "IRanges")
6768
library(knitr)
68-
library(kableExtra)
69+
library(kableExtra, include.only = "kable_styling")
6970
library(patchwork)
70-
library(purrr)
71-
library(readr)
72-
library(rmarkdown)
73-
library(stringr)
74-
library(tidyr)
71+
library(purrr, include.only = "map")
72+
library(readr, include.only = "read_tsv")
73+
library(rmarkdown, include.only = "render")
74+
library(tidyr, include.only = "pivot_longer")
7575
# umccr
7676
library(gpgr)
7777
library(sigrap)
@@ -388,50 +388,50 @@ qc_summary_all %>%
388388
gt::gt(rowname_col = "variable") %>%
389389
gt::tab_style(
390390
style = list(
391-
cell_fill(color = red),
392-
cell_text(weight = "bold")
391+
gt::cell_fill(color = red),
392+
gt::cell_text(weight = "bold")
393393
),
394-
locations = cells_body(
394+
locations = gt::cells_body(
395395
columns = value,
396396
rows = grepl("FAIL", value) & variable == "QC_Status"
397397
)
398398
) %>%
399399
gt::tab_style(
400400
style = list(
401-
cell_fill(color = orange),
402-
cell_text(weight = "bold")
401+
gt::cell_fill(color = orange),
402+
gt::cell_text(weight = "bold")
403403
),
404-
locations = cells_body(
404+
locations = gt::cells_body(
405405
columns = value,
406406
rows = grepl("WARN_", value) & variable == "QC_Status"
407407
)
408408
) %>%
409409
gt::tab_style(
410410
style = list(
411-
cell_fill(color = orange),
412-
cell_text(weight = "bold")
411+
gt::cell_fill(color = orange),
412+
gt::cell_text(weight = "bold")
413413
),
414-
locations = cells_body(
414+
locations = gt::cells_body(
415415
columns = value,
416416
rows = grepl("TRUE", value) & variable == "Hypermutated"
417417
)
418418
) %>%
419419
gt::tab_style(
420420
style = list(
421-
cell_text(weight = "bold")
421+
gt::cell_text(weight = "bold")
422422
),
423423
locations = list(
424-
cells_stub(rows = TRUE),
425-
cells_body(columns = value)
424+
gt::cells_stub(rows = TRUE),
425+
gt::cells_body(columns = value)
426426
)
427427
) %>%
428428
gt::cols_align("left") %>%
429429
# align rowname_col
430430
gt::tab_style(
431431
style = list(
432-
cell_text(align = "left")
432+
gt::cell_text(align = "left")
433433
),
434-
locations = cells_stub(rows = TRUE)
434+
locations = gt::cells_stub(rows = TRUE)
435435
) %>%
436436
gt::opt_row_striping() %>%
437437
gt::tab_options(table.align = "left")
@@ -560,7 +560,6 @@ mp_plot_bias2 <- MutationalPatterns::plot_strand_bias(strand_bias)
560560
561561
562562
## ---- Replicative ---- ##
563-
564563
repli_file <- system.file("extdata/ReplicationDirectionRegions.bed",
565564
package = "MutationalPatterns"
566565
)
@@ -1012,9 +1011,9 @@ d %>%
10121011
gt::sub_missing(columns = dplyr::everything()) %>%
10131012
gt::tab_style(
10141013
style = list(
1015-
cell_text(weight = "bold")
1014+
gt::cell_text(weight = "bold")
10161015
),
1017-
locations = cells_stub(rows = TRUE)
1016+
locations = gt::cells_stub(rows = TRUE)
10181017
) %>%
10191018
gt::cols_align("right") %>%
10201019
gt::tab_options(table.align = "left")
@@ -1135,7 +1134,7 @@ purple_cnv_som_gene$descr %>%
11351134
dplyr::mutate(
11361135
Column = kableExtra::cell_spec(Column, bold = TRUE)
11371136
) %>%
1138-
knitr::kable(escape = FALSE) %>%
1137+
kableExtra::kbl(escape = FALSE) %>%
11391138
kableExtra::kable_paper(c("hover", "striped"), full_width = FALSE, position = "left") %>%
11401139
kableExtra::scroll_box(height = "200px")
11411140
```
@@ -1178,7 +1177,7 @@ purple_cnv_som$descr %>%
11781177
dplyr::mutate(
11791178
Column = kableExtra::cell_spec(Column, bold = TRUE)
11801179
) %>%
1181-
knitr::kable(escape = FALSE) %>%
1180+
kableExtra::kbl(escape = FALSE) %>%
11821181
kableExtra::kable_paper(c("hover", "striped"), full_width = FALSE, position = "left") %>%
11831182
kableExtra::scroll_box(height = "200px")
11841183
```
@@ -1371,7 +1370,7 @@ if (is.null(params$conda_list)) {
13711370
)
13721371
) %>%
13731372
dplyr::left_join(conda_pkgs, by = "name") %>%
1374-
knitr::kable(format = "html") %>%
1373+
kableExtra::kbl() %>%
13751374
kableExtra::kable_paper(c("hover", "striped"), full_width = TRUE, position = "left") %>%
13761375
kableExtra::column_spec(1, bold = TRUE) %>%
13771376
kableExtra::scroll_box(height = "300px")
@@ -1383,9 +1382,8 @@ if (is.null(params$conda_list)) {
13831382
```{r report_inputs}
13841383
report_inputs <- dplyr::tibble(key = names(params), value = params)
13851384
gpgr::write_tsvjsongz(report_inputs, glue("{bnm}-report_inputs"), result_outdir)
1386-
13871385
report_inputs %>%
1388-
knitr::kable(format = "html") %>%
1386+
kableExtra::kbl() %>%
13891387
kableExtra::kable_paper(c("hover", "striped"), full_width = FALSE, position = "left") %>%
13901388
kableExtra::column_spec(1, bold = TRUE) %>%
13911389
kableExtra::scroll_box(height = "200px")

inst/rmd/umccrise/render.R

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ require(purrr)
77

88
batch_name <- "SBJ00480_PTC_HCC1395t100pc"
99
tumor_name <- "PTC_HCC1395t100pc"
10-
umccrised_dir <- here("nogit/umccrised_data/seqc_inputs.20231115")
11-
10+
umccrised_dir <- here::here("nogit/umccrised_data/seqc_inputs.20231115")
1211
params <- list(
1312
af_global = glue("{umccrised_dir}/sample_data/af_tumor.txt"),
1413
af_keygenes = glue("{umccrised_dir}/sample_data/af_tumor_keygenes.txt"),
@@ -17,7 +16,7 @@ params <- list(
1716
conda_list = NULL,
1817
dragen_hrd = glue("{umccrised_dir}/sample_data/{tumor_name}.hrdscore.csv"),
1918
img_dir = glue("{umccrised_dir}/output/img"),
20-
key_genes = glue("{umccrised_dir}/reference_data/umccr_cancer_genes.latest.tsv"),
19+
key_genes = normalizePath("./inst/extdata/ref/umccr_cancer_genes_v24.03.0.tsv"),
2120
oncokb_genes = glue("{umccrised_dir}/reference_data/oncokb_genes.20231113.tsv"),
2221
virusbreakend_tsv = glue("{umccrised_dir}/sample_data/virusbreakend/{batch_name}.virusbreakend.vcf.summary.tsv"),
2322
virusbreakend_vcf = glue("{umccrised_dir}/sample_data/virusbreakend/{batch_name}.virusbreakend.vcf"),
@@ -30,8 +29,8 @@ params <- list(
3029
result_outdir = glue("{umccrised_dir}/output/cancer_report_tables"),
3130
somatic_snv_vcf = glue("{umccrised_dir}/sample_data/{tumor_name}.pass.vcf.gz"),
3231
somatic_snv_summary = glue("{umccrised_dir}/sample_data/{tumor_name}.somatic.variant_counts_process.json"),
33-
somatic_sv_tsv = glue("{umccrised_dir}/sample_data/{tumor_name}.sv.prioritised.tsv"),
34-
somatic_sv_vcf = glue("{umccrised_dir}/sample_data/{tumor_name}.sv.prioritised.vcf.gz"),
32+
somatic_sv_tsv = here::here("inst/extdata/sash/sv.prioritised.tsv"),
33+
somatic_sv_vcf = here::here("inst/extdata/sash/sv.prioritised.vcf.gz"),
3534
tumor_name = tumor_name
3635
)
3736

0 commit comments

Comments
 (0)