Skip to contents
require(sigrap)
require(gpgr)
require(MutationalPatterns)
ref_genome <- "BSgenome.Hsapiens.UCSC.hg38"
require(ref_genome, character.only = TRUE)
require(devtools)
require(dplyr)
require(patchwork)

Data Preparation

params <- list(
  vcf = system.file("extdata/umccrise/snv/somatic-ensemble-PASS.vcf.gz", package = "gpgr"),
  nm = "sampleA",
  outdir = "outputs"
)

gr <- MutationalPatterns::read_vcfs_as_granges(
  vcf_files = params$vcf,
  sample_names = params$nm,
  genome = ref_genome,
  group = "auto+sex",
  type = "all"
)

SNVs (SBS)

Plots

snv_counts <- sigrap::sig_count_snv(vcf_gr = gr, ref_genome = ref_genome)
#> Any neighbouring SNVs will be merged into DBS/MBS variants.
#> Set the 'predefined_dbs_mbs' to 'TRUE' if you don't want this.
p_snvs <- sigrap::sig_plot_snv(
  gr_snv = snv_counts$gr_snv, snv_counts = snv_counts$snv_counts,
  ref_genome = ref_genome
)
p_snvs$p_river + p_snvs$p_heatmap + p_snvs$p_spectrum + p_snvs$p_96_profile + patchwork::plot_layout(ncol = 1)

Signature Contributions

sigs_snv_2015 <-
  sigrap::cosmic_signatures_2015 |>
  {
    \(sigs) sigrap::sig_contribution(mut_mat = snv_counts$snv_counts, signatures = sigs)
  }()

sigs_snv_2020 <-
  MutationalPatterns::get_known_signatures(
    muttype = "snv",
    incl_poss_artifacts = TRUE
  ) |>
  {
    \(sigs) sigrap::sig_contribution(mut_mat = snv_counts$snv_counts, signatures = sigs)
  }()

sigs_snv_2015 |>
  sigrap::sig_contribution_table(type = "Sig", outdir = params$outdir) |>
  knitr::kable(format = "html") |>
  kableExtra::kable_styling(c("hover", "striped"), font_size = 12) |>
  kableExtra::scroll_box(height = "400px")
Rank Signature Contribution RelFreq Description Plot
1 Sig3 2045 0.35 Breast, ovarian, pancreatic; germline + somatic BRCA1/BRCA2 mut; failure of DNA ds break-repair; many large indels.
2 Sig8 1441 0.25 Breast cancer, medulloblastoma; many CC>AA subs; weak strand bias for C>A subs.
3 Sig1 749 0.13 All cancers; correlates with age of diagnosis; few small indels
4 Sig13 402 0.07 In 22 cancers; mostly cervical, bladder, breast; AID/APOBEC; C>G mut; similar to sig2; maybe viral infection, retrotransposon jumping or tissue inflammation; kataegis.
5 Sig2 223 0.04 In 22 cancers; mostly cervical + bladder; AID/APOBEC; similar to sig13; maybe viral infection, retrotransposon jumping or tissue inflammation; exon TSB.
6 Sig6 196 0.03 In 17 cancers; mostly colorectal + uterine; associated with defective DNA mismatch repair; found in microsatellite unstable tumors; many small indels.
7 Sig7 174 0.03 Skin, lip, head, neck or oral squamous cancers; ultraviolet light exposure; many CC>TT subs; strong TSB with many C>T mut.
8 Sig9 161 0.03 Chronic lymphocytic leukaemias, malignant B-cell lymphomas; mut pattern associated with polymerase H (implicated with AID during som hypermutation).
9 Sig26 124 0.02 Breast, cervical, stomach cancer, uterine carcinoma; defective DNA mismatch repair.
10 Sig16 74 0.01 Liver; strong TSB for T>C at ATN context.
11 Sig22 72 0.01 Urothelial (renal pelvis) carcinoma and liver cancers (very high and lower TMB, respectively); exposure to aristolochic acid; strong TSB for T>A.
12 Sig25 65 0.01 Hodgkin lymphoma cell lines (not primary); TSB for T>A.
13 Sig15 55 0.01 Stomach cancers and a single small cell lung carcinoma; defective DNA mismatch repair; many small indels;
14 Sig17 51 0.01 Oesophagus, breast, liver, lung adenocarcinoma, B-cell lymphoma, stomach and melanoma.
15 Sig27 3 0.00 Subset of kidney clear cell carcinomas; strong TSB for T>A; many small indels.

sigs_snv_2020 |>
  sigrap::sig_contribution_table(type = "SBS", outdir = params$outdir) |>
  knitr::kable(format = "html") |>
  kableExtra::kable_styling(c("hover", "striped"), font_size = 12) |>
  kableExtra::scroll_box(height = "400px")
Rank Signature Contribution RelFreq Description Plot
1 SBS8 1238 0.21 https://cancer.sanger.ac.uk/signatures/sbs/sbs8/
2 SBS40 686 0.12 https://cancer.sanger.ac.uk/signatures/sbs/sbs40/
3 SBS39 480 0.08 https://cancer.sanger.ac.uk/signatures/sbs/sbs39/
4 SBS1 438 0.07 https://cancer.sanger.ac.uk/signatures/sbs/sbs1/
5 SBS13 369 0.06 https://cancer.sanger.ac.uk/signatures/sbs/sbs13/
6 SBS3 268 0.05 https://cancer.sanger.ac.uk/signatures/sbs/sbs3/
7 SBS5 256 0.04 https://cancer.sanger.ac.uk/signatures/sbs/sbs5/
8 SBS44 251 0.04 https://cancer.sanger.ac.uk/signatures/sbs/sbs44/
9 SBS7a 233 0.04 https://cancer.sanger.ac.uk/signatures/sbs/sbs7a/
10 SBS86 232 0.04 https://cancer.sanger.ac.uk/signatures/sbs/sbs86/
11 SBS89 191 0.03 https://cancer.sanger.ac.uk/signatures/sbs/sbs89/
12 SBS25 164 0.03 https://cancer.sanger.ac.uk/signatures/sbs/sbs25/
13 SBS2 161 0.03 https://cancer.sanger.ac.uk/signatures/sbs/sbs2/
14 SBS46 139 0.02 https://cancer.sanger.ac.uk/signatures/sbs/sbs46/
15 SBS58 110 0.02 https://cancer.sanger.ac.uk/signatures/sbs/sbs58/
16 SBS12 92 0.02 https://cancer.sanger.ac.uk/signatures/sbs/sbs12/
17 SBS15 77 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs15/
18 SBS17b 67 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs17b/
19 SBS93 65 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs93/
20 SBS34 49 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs34/
21 SBS51 48 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs51/
22 SBS7d 47 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs7d/
23 SBS30 38 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs30/
24 SBS84 36 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs84/
25 SBS16 35 0.01 https://cancer.sanger.ac.uk/signatures/sbs/sbs16/
26 SBS10a 25 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs10a/
27 SBS10b 23 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs10b/
28 SBS6 9 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs6/
28 SBS19 9 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs19/
30 SBS49 5 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs49/
31 SBS43 4 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs43/
32 SBS26 3 0.00 https://cancer.sanger.ac.uk/signatures/sbs/sbs26/

DBS

Plots

dbs_counts <- sigrap::sig_count_dbs(vcf_gr = gr)
#> Any neighbouring SNVs will be merged into DBS/MBS variants.
#> Set the 'predefined_dbs_mbs' to 'TRUE' if you don't want this.
p_dbs <- sigrap::sig_plot_dbs(dbs_counts = dbs_counts)
p_dbs$p_dbs_main / p_dbs$p_dbs_cont

Signature Contributions

sigs_dbs <-
  MutationalPatterns::get_known_signatures(muttype = "dbs") |>
  {
    \(sigs) sigrap::sig_contribution(mut_mat = dbs_counts, signatures = sigs)
  }()
sigs_dbs |>
  sigrap::sig_contribution_table(type = "DBS", outdir = params$outdir) |>
  knitr::kable(format = "html") |>
  kableExtra::kable_styling(c("hover", "striped"), font_size = 12) |>
  kableExtra::scroll_box(height = "400px")

INDELs

Plots

indel_counts <- sigrap::sig_count_indel(vcf_gr = gr, ref_genome = ref_genome)
p_indels <- sigrap::sig_plot_indel(indel_counts = indel_counts)
p_indels$p_indel_main / p_indels$p_indel_cont

Signature Contributions

sigs_indel <-
  MutationalPatterns::get_known_signatures(muttype = "indel") |>
  {
    \(sigs) sigrap::sig_contribution(mut_mat = indel_counts, signatures = sigs)
  }()
sigs_indel |>
  sigrap::sig_contribution_table(type = "ID", outdir = params$outdir) |>
  knitr::kable(format = "html") |>
  kableExtra::kable_styling(c("hover", "striped"), font_size = 12) |>
  kableExtra::scroll_box(height = "400px")

Session Info

Main packages used in this vignette.
package version datestamp source
base 4.2.3 2023-07-12 local
gpgr 1.4.4 2023-07-12 local
MutationalPatterns 3.8.0 2022-11-01 Bioconductor
sigrap 0.1.1 2023-07-12 local
Platform information.
name value
version R version 4.2.3 (2023-03-15)
os Ubuntu 22.04.2 LTS
system x86_64, linux-gnu
ui X11
language en
collate C.UTF-8
ctype C.UTF-8
tz Etc/UTC
date 2023-07-12
pandoc 2.19.2 @ /usr/share/miniconda/envs/pkgdownenv/bin/ (via rmarkdown)