Skip to content

Commit

Permalink
pull DP from VCF and show
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Mar 13, 2024
1 parent 3be31a6 commit be7664f
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 21 deletions.
2 changes: 1 addition & 1 deletion R/input_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ load_germline_snv_indel <- function(
if (as.logical(
conf$variant_classification$secondary_findings) == TRUE) {
if(as.logical(
conf$sample_properties$genotypes_available) == F){
conf$sample_properties$gt_detected) == F){
pcgrr::log4r_warn(paste0(
"Assessment of secondary variant findings (ACMG SF v3.2) ",
"NOT possible - variant genotype information unavailable"
Expand Down
2 changes: 1 addition & 1 deletion R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ write_cpsr_output <- function(report,
settings[["conf"]][["visual_reporting"]][["visual_theme"]]

if (output_format == "html") {
if(report$content$snv_indel$v_stat_cpg$n < 2000){
if(report$content$snv_indel$v_stat_cpg$n < 3000){
if(file.exists(quarto_input)){

## make temporary directory for quarto report rendering
Expand Down
8 changes: 8 additions & 0 deletions data-raw/data-raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ col_format_output[['html_tier']] <-
"GENOTYPE",
"GENENAME",
"PROTEIN_DOMAIN",
"DP_CONTROL",
"HGVSp",
"HGVSc",
"ENSEMBL_GENE_ID",
Expand Down Expand Up @@ -55,6 +56,7 @@ col_format_output[['html_sf']] <-
"GENOTYPE",
"GENENAME",
"PROTEIN_DOMAIN",
"DP_CONTROL",
"HGVSp",
"HGVSc",
"ENSEMBL_GENE_ID",
Expand Down Expand Up @@ -87,6 +89,7 @@ col_format_output[['html_gwas']] <-
"LOSS_OF_FUNCTION",
"GENENAME",
"PROTEIN_DOMAIN",
"DP_CONTROL",
"GWAS_CITATION",
"HGVSp",
"HGVSc",
Expand Down Expand Up @@ -114,6 +117,7 @@ col_format_output[['tsv']] <-
"VAR_ID",
"GENOME_VERSION",
"GENOTYPE",
"DP_CONTROL",
"CPSR_CLASSIFICATION_SOURCE",
"VARIANT_CLASS",
"CODING_STATUS",
Expand Down Expand Up @@ -178,6 +182,7 @@ col_format_output[['html_bm']] <-
'CONSEQUENCE',
'BM_EVIDENCE_LEVEL',
'GENOTYPE',
"DP_CONTROL",
'BM_CANCER_TYPE',
'BM_DISEASE_ONTOLOGY_ID',
'BM_PRIMARY_SITE',
Expand Down Expand Up @@ -212,6 +217,7 @@ col_format_output[['xlsx_classification']] <-
c("SAMPLE_ID",
"GENOMIC_CHANGE",
"GENOTYPE",
"DP_CONTROL",
"GENOME_VERSION",
"VARIANT_CLASS",
"SYMBOL",
Expand Down Expand Up @@ -253,6 +259,7 @@ col_format_output[['xlsx_secondary']] <-
c("SAMPLE_ID",
"GENOMIC_CHANGE",
"GENOTYPE",
"DP_CONTROL",
"GENOME_VERSION",
"VARIANT_CLASS",
"SYMBOL",
Expand Down Expand Up @@ -292,6 +299,7 @@ col_format_output[['xlsx_biomarker']] <-
c("SAMPLE_ID",
"GENOMIC_CHANGE",
"GENOTYPE",
"DP_CONTROL",
"GENOME_VERSION",
"VARIANT_CLASS",
"SYMBOL",
Expand Down
Binary file modified data/col_format_output.rda
Binary file not shown.
14 changes: 8 additions & 6 deletions inst/templates/quarto/cpsr_biomarkers.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ for (etype in c("Predictive","Diagnostic","Predisposing","Prognostic")) {

- Germline DNA variants (__class 4/5__) in the targeted cancer predisposition genes that match with reported clinical evidence items from [CIViC](https://civicdb.org) and [CGI biomarker database](https://www.cancergenomeinterpreter.org/biomarkers) are listed.

- Total number of _variant-clinical evidence associations_ that have been detected:
* Predisposing: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_predisposing`__
* Predictive: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_predictive`__
* Prognostic: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_prognostic`__
* Diagnostic: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_diagnostic`__
- Total number of _unique variants_ with clinical evidence associations: __N = `r cps_report[['content']][['snv_indel']]$v_stat_bm$n_var_eitems`__

- Total number of detected _variant-clinical evidence associations_:
* Predictive: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_eitems_predictive`__
* Predisposing: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_eitems_predisposing`__
* Prognostic: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_eitems_prognostic`__
* Diagnostic: __`r cps_report[['content']][['snv_indel']]$v_stat_bm$n_eitems_diagnostic`__

::: {.callout-note}
The same genetic variant may match with multiple evidence items, pending on the e.g. _disease context_, _therapeutic context_, _biomarker resolution_, or underlying _evidence source_ (publication)
As indicated from the variant-association numbers above, the same germline mutation may potentially match with multiple evidence items, pending on e.g. the _disease context_, _therapeutic context_, _biomarker resolution_, or underlying _evidence source_ (i.e. publication)
:::

```{r biomarker_note}
Expand Down
60 changes: 50 additions & 10 deletions inst/templates/quarto/cpsr_classification.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ formula_gnomad <- as.formula(paste0("~", rlang::sym(tag_gnomad)))

<br>

* A total of n = __`r tot_variants[['class5']][['ClinVar']]`__ variants are registered with a <i>Pathogenic</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of n = __`r tot_variants[['class5']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Pathogenic</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).
* A total of __N = `r tot_variants[['class5']][['ClinVar']]`__ variants are registered with a <i>Pathogenic</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of __N = `r tot_variants[['class5']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Pathogenic</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).

::: {.callout-note}
Variants displayed here constitute the top 2000 variants for each of the ClinVar and non-ClinVar variant sets (due to display limitations with client-side tables)
Expand Down Expand Up @@ -126,6 +126,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class5_1, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class5_1, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class5_1, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class5_1, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -206,6 +210,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class5_2, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class5_2, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class5_2, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class5_2, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -247,8 +255,8 @@ htmltools::br()

<br>

* A total of n = __`r tot_variants[['class4']][['ClinVar']]`__ variants are recorded with a <i>Likely Pathogenic</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of n = __`r tot_variants[['class4']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Likely Pathogenic</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).
* A total of __N = `r tot_variants[['class4']][['ClinVar']]`__ variants are recorded with a <i>Likely Pathogenic</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of __N = `r tot_variants[['class4']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Likely Pathogenic</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).

::: {.callout-note}
Variants displayed here constitute the top 2000 variants for each of the ClinVar and non-ClinVar variant sets (due to display limitations with client-side tables)
Expand Down Expand Up @@ -303,6 +311,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class4_1, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class4_1, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class4_1, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class4_1, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -384,6 +396,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class4_2, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class4_2, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class4_2, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class4_2, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -424,8 +440,8 @@ htmltools::br()

<br>

* A total of n = __`r tot_variants[['class3']][['ClinVar']]`__ variants are recorded with a <i>VUS</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of n = __`r tot_variants[['class3']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>VUS</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).
* A total of __N = `r tot_variants[['class3']][['ClinVar']]`__ variants are recorded with a <i>VUS</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of __N = `r tot_variants[['class3']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>VUS</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).

::: {.callout-note}
Variants displayed here constitute the top 2000 variants for each of the ClinVar and non-ClinVar variant sets (due to display limitations with client-side tables)
Expand Down Expand Up @@ -478,6 +494,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class3_1, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class3_1, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class3_1, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class3_1, ~SYMBOL),
crosstalk::filter_slider("GERP_SCORE", "Genomic conservation score (GERP)",
variants_class3_1, ~GERP_SCORE,
Expand Down Expand Up @@ -580,6 +600,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class3_2, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class3_2, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class3_2, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class3_2, ~SYMBOL),
crosstalk::filter_slider("GERP_SCORE", "Genomic conservation score (GERP)", variants_class3_2, ~GERP_SCORE,
min = -12.3, max = 6.17, ticks = T
Expand Down Expand Up @@ -634,8 +658,8 @@ htmltools::br()

<br>

* A total of n = __`r tot_variants[['class2']][['ClinVar']]`__ variants are recorded with a <i>Likely Benign</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of n = __`r tot_variants[['class2']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Likely Benign</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).
* A total of __N = `r tot_variants[['class2']][['ClinVar']]`__ variants are recorded with a <i>Likely Benign</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of __N = `r tot_variants[['class2']][['CPSR_ACMG']]`__ <i><b>non-ClinVar</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Likely Benign</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).

::: {.callout-note}
Variants displayed here constitute the top 2000 variants for each of the ClinVar and non-ClinVar variant sets (due to display limitations with client-side tables)
Expand Down Expand Up @@ -691,6 +715,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class2_1, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class2_1, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class2_1, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class2_1, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -773,6 +801,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class2_2, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class2_2, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class2_2, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class2_2, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -812,8 +844,8 @@ htmltools::br()

<br>

* A total of n = __`r tot_variants[['class1']][['ClinVar']]`__ variants are recorded with a <i>Benign</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of n = __`r tot_variants[['class1']][['CPSR_ACMG']]`__ <i><b>Other</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Benign</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).
* A total of __N = `r tot_variants[['class1']][['ClinVar']]`__ variants are recorded with a <i>Benign</i> clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database.
* A total of __N = `r tot_variants[['class1']][['CPSR_ACMG']]`__ <i><b>Other</b></i> variants (i.e. not submitted to/recorded in ClinVar) are classified with a <i>Benign</i> clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect).

::: {.callout-note}
Variants displayed here constitute the top 2000 variants for each of the ClinVar and non-ClinVar variant sets (due to display limitations with client-side tables)
Expand Down Expand Up @@ -867,6 +899,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class1_1, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class1_1, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class1_1, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class1_1, ~SYMBOL)
),
list(
Expand Down Expand Up @@ -950,6 +986,10 @@ crosstalk::bscols(
list(
crosstalk::filter_select("CONSEQUENCE", "Consequence", variants_class1_2, ~CONSEQUENCE),
crosstalk::filter_checkbox("GENOTYPE", "Genotype", variants_class1_2, ~GENOTYPE),
if(cps_report$settings$conf$sample_properties$dp_detected == 1){
crosstalk::filter_slider("DP_CONTROL", "Variant sequencing depth",
variants_class1_2, ~DP_CONTROL)
},
crosstalk::filter_select("SYMBOL", "Gene", variants_class1_2, ~SYMBOL)
),
list(
Expand Down
4 changes: 2 additions & 2 deletions inst/templates/quarto/cpsr_secondary_findings.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ acmg_version <- cps_report$settings$reference_data$source_metadata[
acmg_url <- cps_report$settings$reference_data$source_metadata[
cps_report$settings$reference_data$source_metadata$source_abbreviation == "acmg_sf","source_url"]
genotypes_unavailable <- !(as.logical(
cps_report$settings$conf$sample_properties$genotypes_available))
cps_report$settings$conf$sample_properties$gt_detected))
```

Expand All @@ -26,7 +26,7 @@ cat("::: {.callout-warning}\n\n**Secondary findings not assessed due to lacking
```


* For the sample in question, a total of n = __`r tot_sf_variants`__ variants in [genes recommended for secondary findings reporting (ACMG `r acmg_version`)](`r acmg_url`)
* For the sample in question, a total of __N = `r tot_sf_variants`__ variants in [genes recommended for secondary findings reporting (ACMG `r acmg_version`)](`r acmg_url`)
are registered with a <i>Pathogenic/Likely pathogenic</i> clinical significance in ClinVar.

<br>
Expand Down
2 changes: 1 addition & 1 deletion inst/templates/quarto/cpsr_summary.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ bslib::layout_column_wrap(
showcase_layout = "left center"
),
bslib::value_box(
title = "Cancer predisposition genes affected",
title = "Genes affected by pathogenic variants",
value = genes_value_box,
showcase = bsicons::bs_icon("bullseye"),
theme = bslib::value_box_theme(
Expand Down

0 comments on commit be7664f

Please sign in to comment.