diff --git a/R/classification.R b/R/classification.R index f716c23..a70e47a 100644 --- a/R/classification.R +++ b/R/classification.R @@ -13,7 +13,7 @@ assign_classification <- function(var_calls) { pcgrr::log4r_info(paste0( "Assigning five-tier classifications (P, LP, VUS, LB, B) based on ", - "aggregated scores from ACMG criteria")) + "aggregated ACMG points")) path_cols <- c( "CPSR_CLASSIFICATION", @@ -203,7 +203,7 @@ assign_pathogenicity_evidence <- function(var_calls, settings, ref_data) { #pcgrr::validate_settings(settings) pcgrr::log4r_info( - "Assigning pathogenicity codes according to enhanced ACMG criteria/guidelines") + "Assigning variant classification codes according to refined ACMG criteria") classification_settings <- settings$conf$variant_classification diff --git a/R/main.R b/R/main.R index b0a6fbb..212ec83 100644 --- a/R/main.R +++ b/R/main.R @@ -116,53 +116,61 @@ generate_cpsr_report <- function(yaml_fname = NULL) { callset_all <- list() callset_all[['variant']] <- cps_report$content$snv_indel[['callset']]$variant$all - cps_report$content$snv_indel$v_stat <- - pcgrr::variant_stats_report( - callset = callset_all, - name = "v_stat")$v_stat + if(NROW(callset_all[['variant']]) > 0){ + cps_report$content$snv_indel$v_stat <- + pcgrr::variant_stats_report( + callset = callset_all, + name = "v_stat")$v_stat + } ## get overall call statistics (cpg targets only) callset_cpg <- list() callset_cpg[['variant']] <- cps_report$content$snv_indel[['callset']]$variant$cpg_non_sf - cps_report$content$snv_indel$v_stat_cpg <- - pcgrr::variant_stats_report( - callset = callset_cpg, - name = "v_stat_cpg")$v_stat_cpg + if(NROW(callset_cpg[['variant']]) > 0){ + cps_report$content$snv_indel$v_stat_cpg <- + pcgrr::variant_stats_report( + callset = callset_cpg, + name = "v_stat_cpg")$v_stat_cpg + } ## get overall call statistics (sf targets only) callset_sf <- list() callset_sf[['variant']] <- cps_report$content$snv_indel[['callset']]$variant$sf - cps_report$content$snv_indel$v_stat_sf <- - pcgrr::variant_stats_report( - callset = callset_sf, - name = "v_stat_sf")$v_stat_sf + if(NROW(callset_sf[['variant']]) > 0){ + cps_report$content$snv_indel$v_stat_sf <- + pcgrr::variant_stats_report( + callset = callset_sf, + name = "v_stat_sf")$v_stat_sf + } callset_bm <- list() callset_bm[['variant']] <- cps_report$content$snv_indel[['callset']]$variant$bm - cps_report$content$snv_indel$v_stat_bm <- - pcgrr::variant_stats_report( - callset = callset_bm, - name = "v_stat_bm")$v_stat_bm + if(NROW(callset_bm[['variant']]) > 0){ + cps_report$content$snv_indel$v_stat_bm <- + pcgrr::variant_stats_report( + callset = callset_bm, + name = "v_stat_bm")$v_stat_bm + } pcgrr::log4r_info( paste0( "Total number of variants in target cancer predisposition genes: ", - cps_report$content$snv_indel[["v_stat_cpg"]][["n"]] + "N = ", cps_report$content$snv_indel[["v_stat_cpg"]][["n"]] ) ) pcgrr::log4r_info( paste0( "Number of coding variants in target cancer predisposition genes: ", - cps_report$content$snv_indel[["v_stat_cpg"]][["n_coding"]] + "N = ", cps_report$content$snv_indel[["v_stat_cpg"]][["n_coding"]] ) ) pcgrr::log4r_info( paste0( "Number of non-coding variants in cancer predisposition genes: ", - cps_report$content$snv_indel[["v_stat_cpg"]][["n_noncoding"]] + "N = ", cps_report$content$snv_indel[["v_stat_cpg"]][["n_noncoding"]] ) ) diff --git a/inst/templates/quarto/cpsr_biomarkers.qmd b/inst/templates/quarto/cpsr_biomarkers.qmd index 25c6f0a..d44980a 100644 --- a/inst/templates/quarto/cpsr_biomarkers.qmd +++ b/inst/templates/quarto/cpsr_biomarkers.qmd @@ -15,6 +15,10 @@ for (etype in c("Predictive","Diagnostic","Predisposing","Prognostic")) { show_germline_filters[[tolower(etype)]] <- F missing_germline_items[[tolower(etype)]] <- T + if(NROW(cps_report[["content"]][["snv_indel"]]$callset$variant_display$bm) == 0){ + next + } + etype_set[[tolower(etype)]] <- cps_report[["content"]][["snv_indel"]]$callset$variant_display$bm |> dplyr::filter(.data$BM_EVIDENCE_TYPE == etype) @@ -49,7 +53,7 @@ The same genetic variant may match with multiple evidence items, pending on the ```{r biomarker_note} #| echo: false #| output: asis -#| include: !expr biomarker_present +#| include: true cat("\n::: {.callout-note}\n Biomarkers registered in CIViC/CGI are provided at different _resolutions_ (i.e. filter Biomarker resolution). The accuracy of a match between a variant in the sample and a clinical evidence item (biomarker) will vary accordingly (highlighted by gene symbols with different color backgrounds):\n\n") diff --git a/inst/templates/quarto/cpsr_classification.qmd b/inst/templates/quarto/cpsr_classification.qmd index b9e08cc..54461c0 100644 --- a/inst/templates/quarto/cpsr_classification.qmd +++ b/inst/templates/quarto/cpsr_classification.qmd @@ -635,7 +635,7 @@ htmltools::br()
* A total of n = __`r tot_variants[['class2']][['ClinVar']]`__ variants are recorded with a Likely Benign clinical significance in the [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) database. -* A total of n = __`r tot_variants[['class2']][['CPSR_ACMG']]`__ Other variants (i.e. not submitted to/recorded in ClinVar) are classified with a Likely Benign clinical significance by CPSR (refined ACMG criteria - based on population frequency and variant effect). +* A total of n = __`r tot_variants[['class2']][['CPSR_ACMG']]`__ non-ClinVar variants (i.e. not submitted to/recorded in ClinVar) are classified with a Likely Benign 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) diff --git a/inst/templates/quarto/cpsr_summary.qmd b/inst/templates/quarto/cpsr_summary.qmd index 329a210..7799af4 100644 --- a/inst/templates/quarto/cpsr_summary.qmd +++ b/inst/templates/quarto/cpsr_summary.qmd @@ -82,7 +82,7 @@ bslib::layout_column_wrap( value = paste0( "N = ", cps_report$content$snv_indel$v_stat_cpg$n_p + - cps_report$content$snv_indel$v_stat_cpg$n_p), + cps_report$content$snv_indel$v_stat_cpg$n_lp), showcase = bsicons::bs_icon("bullseye"), theme = bslib::value_box_theme( bg = color_lp, fg = "#fff"), diff --git a/inst/templates/quarto/cpsr_virtual_panel.qmd b/inst/templates/quarto/cpsr_virtual_panel.qmd index b4a98da..08020f7 100644 --- a/inst/templates/quarto/cpsr_virtual_panel.qmd +++ b/inst/templates/quarto/cpsr_virtual_panel.qmd @@ -18,9 +18,7 @@ tiles_html <- cpsr::plot_virtual_panels(
::: {.callout-note} -CPSR does not perform any interrogation of _which genes -that were subject to sequencing_, it merely checks potential overlap of input variants -within the user-defined __virtual__ gene panel. +For the sample in question, `r cps_report$settings$sample_id`, CPSR does **not** perform any interrogation of _which genes that were subject to sequencing_. CPSR classifies only input variants (i.e. as found in the query VCF) within the user-defined __virtual__ gene panel. :::