Skip to content

Commit 17c9e4c

Browse files
committed
fix non-standard significance levels
1 parent 4545cbb commit 17c9e4c

File tree

3 files changed

+49
-14
lines changed

3 files changed

+49
-14
lines changed

R/classification.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,19 @@ combine_novel_and_preclassified <-
10821082
TRUE ~ as.character(NA)
10831083
)
10841084
) |>
1085+
dplyr::mutate(FINAL_CLASSIFICATION = dplyr::if_else(
1086+
FINAL_CLASSIFICATION != "Benign" &
1087+
FINAL_CLASSIFICATION != "Likely_Benign" &
1088+
FINAL_CLASSIFICATION != "VUS" &
1089+
FINAL_CLASSIFICATION != "Likely_Pathogenic" &
1090+
FINAL_CLASSIFICATION != "Pathogenic",
1091+
"VUS",
1092+
as.character(FINAL_CLASSIFICATION)
1093+
)) |>
1094+
dplyr::mutate(FINAL_CLASSIFICATION = dplyr::if_else(
1095+
is.na(FINAL_CLASSIFICATION),"VUS",
1096+
as.character(FINAL_CLASSIFICATION)
1097+
)) |>
10851098
dplyr::mutate(FINAL_CLASSIFICATION = factor(
10861099
.data$FINAL_CLASSIFICATION,
10871100
levels = c("Benign","Likely_Benign","VUS",

inst/templates/quarto/cpsr_classification.qmd

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ for (c in c("class1", "class2", "class3", "class4", "class5")) {
3838
show_class_filters[[c]][[m]] <- F
3939
missing_class_items[[c]][[m]] <- T
4040
if(NROW(callset_cpg) > 0){
41-
if (NROW(callset_cpg[callset_cpg$CPSR_CLASSIFICATION_SOURCE == m &
41+
if (NROW(callset_cpg[callset_cpg$CPSR_CLASSIFICATION_SOURCE == m &
42+
!is.na(callset_cpg$FINAL_CLASSIFICATION) &
4243
callset_cpg$FINAL_CLASSIFICATION == path_level,]) > 0) {
4344
tot_variants[[c]][[m]] <-
44-
NROW(callset_cpg[callset_cpg$CPSR_CLASSIFICATION_SOURCE == m &
45+
NROW(callset_cpg[callset_cpg$CPSR_CLASSIFICATION_SOURCE == m &
46+
!is.na(callset_cpg$FINAL_CLASSIFICATION) &
4547
callset_cpg$FINAL_CLASSIFICATION == path_level,])
4648
}
4749
if (tot_variants[[c]][[m]] > 0) {
@@ -120,7 +122,7 @@ variants_class5_clinvar <-
120122
dplyr::filter(
121123
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
122124
CPSR_CLASSIFICATION_SOURCE == "ClinVar" &
123-
CLINVAR_CLASSIFICATION == "Pathogenic") |>
125+
FINAL_CLASSIFICATION == "Pathogenic") |>
124126
head(dt_max_rows) |>
125127
dplyr::select(
126128
-dplyr::any_of(
@@ -202,7 +204,7 @@ variants_class5_other <-
202204
dplyr::filter(
203205
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
204206
CPSR_CLASSIFICATION_SOURCE == "CPSR_ACMG" &
205-
CPSR_CLASSIFICATION == "Pathogenic") |>
207+
FINAL_CLASSIFICATION == "Pathogenic") |>
206208
head(dt_max_rows) |>
207209
dplyr::select(
208210
-dplyr::any_of(
@@ -309,7 +311,7 @@ variants_class4_clinvar <-
309311
dplyr::filter(
310312
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
311313
CPSR_CLASSIFICATION_SOURCE == "ClinVar" &
312-
CLINVAR_CLASSIFICATION == "Likely_Pathogenic") |>
314+
FINAL_CLASSIFICATION == "Likely_Pathogenic") |>
313315
head(dt_max_rows) |>
314316
dplyr::select(
315317
-dplyr::any_of(
@@ -410,7 +412,7 @@ variants_class4_other <-
410412
dplyr::filter(
411413
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
412414
CPSR_CLASSIFICATION_SOURCE == "CPSR_ACMG" &
413-
CPSR_CLASSIFICATION == "Likely_Pathogenic") |>
415+
FINAL_CLASSIFICATION == "Likely_Pathogenic") |>
414416
head(dt_max_rows) |>
415417
dplyr::select(
416418
-dplyr::any_of(
@@ -495,6 +497,12 @@ In order to maintain responsiveness of client-side data interaction, variants di
495497

496498
:::
497499

500+
::: {.callout-important title="Drug response and risk factor variants" collapse="true"}
501+
502+
A minor proportion of all ClinVar-registered variants (some 0.07%) does not align with the five standard levels of clinical significance (Benign, Likely Benign, VUS, Pathogenic, Likely Pathogenic), specifically _Drug Response_ and _Risk Factor_ variants. These variants are organized in the __VUS__ tab, and <mark style="background-color:#ff7518; font-weight:bold; color:white">&nbsp; highlighted &nbsp;</mark> for convenience in the table below.
503+
504+
:::
505+
498506
<br>
499507

500508
::: {.panel-tabset}
@@ -528,7 +536,7 @@ variants_class3_clinvar <-
528536
dplyr::filter(
529537
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
530538
CPSR_CLASSIFICATION_SOURCE == "ClinVar" &
531-
CLINVAR_CLASSIFICATION == "VUS") |>
539+
FINAL_CLASSIFICATION == "VUS") |>
532540
head(dt_max_rows) |>
533541
dplyr::select(
534542
-dplyr::any_of(
@@ -585,7 +593,20 @@ DT::datatable(variants_class3_1,
585593
"}"
586594
)
587595
)
588-
)
596+
) |>
597+
DT::formatStyle(
598+
#color = "black",
599+
columns = "SYMBOL",
600+
valueColumns = "CLINVAR_CLASSIFICATION",
601+
backgroundColor = DT::styleEqual(
602+
c("Drug_Response","Risk_Factor","No_Classification", "VUS"),
603+
c("#ff7518","#ff7518", "#FFFFFF", "#FFFFFF")
604+
),
605+
color = DT::styleEqual(
606+
c("Drug_Response","Risk_Factor","No_Classification", "VUS"),
607+
c("#ffffff","#ffffff", "#000000", "#000000")
608+
)
609+
)
589610
590611
htmltools::br()
591612
htmltools::br()
@@ -620,7 +641,7 @@ variants_class3_other <-
620641
dplyr::filter(
621642
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
622643
CPSR_CLASSIFICATION_SOURCE == "CPSR_ACMG" &
623-
CPSR_CLASSIFICATION == "VUS") |>
644+
FINAL_CLASSIFICATION == "VUS") |>
624645
head(dt_max_rows) |>
625646
dplyr::select(
626647
-dplyr::any_of(
@@ -740,7 +761,7 @@ variants_class2_clinvar <-
740761
dplyr::filter(
741762
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
742763
CPSR_CLASSIFICATION_SOURCE == "ClinVar" &
743-
CLINVAR_CLASSIFICATION == "Likely_Benign") |>
764+
FINAL_CLASSIFICATION == "Likely_Benign") |>
744765
head(dt_max_rows) |>
745766
dplyr::select(
746767
-dplyr::any_of(
@@ -826,7 +847,7 @@ variants_class2_other <-
826847
dplyr::filter(
827848
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
828849
CPSR_CLASSIFICATION_SOURCE == "CPSR_ACMG" &
829-
CPSR_CLASSIFICATION == "Likely_Benign") |>
850+
FINAL_CLASSIFICATION == "Likely_Benign") |>
830851
head(dt_max_rows) |>
831852
dplyr::select(
832853
-dplyr::any_of(
@@ -932,7 +953,7 @@ variants_class1_clinvar <-
932953
dplyr::filter(
933954
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
934955
CPSR_CLASSIFICATION_SOURCE == "ClinVar" &
935-
CLINVAR_CLASSIFICATION == "Benign") |>
956+
FINAL_CLASSIFICATION == "Benign") |>
936957
head(dt_max_rows) |>
937958
dplyr::select(
938959
-dplyr::any_of(
@@ -1020,7 +1041,7 @@ variants_class1_other <-
10201041
dplyr::filter(
10211042
cps_report[["content"]][["snv_indel"]]$callset$variant_display$cpg_non_sf,
10221043
CPSR_CLASSIFICATION_SOURCE == "CPSR_ACMG" &
1023-
CPSR_CLASSIFICATION == "Benign") |>
1044+
FINAL_CLASSIFICATION == "Benign") |>
10241045
head(dt_max_rows) |>
10251046
dplyr::select(
10261047
-dplyr::any_of(

vignettes/output.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ The following variables are included in the tiered TSV file (VCF tags in the que
398398
| 61. `N_INSILICO_SPLICING_NEUTRAL` | Number of algorithms with splicing neutral prediction from dbscSNV |
399399
| 62. `N_INSILICO_SPLICING_AFFECTED` | Number of algorithms with splicing affected prediction from dbscSNV |
400400
| 63. `gnomADe_AF` | Global MAF in gnomAD (exome samples) |
401-
| 64. `FINAL_CLASSIFICATION` | Final variant classification, using either `CLINVAR_CLASSIFICATION` if variant is ClinVar-classified, or `CPSR_CLASSIFICATION` for novel variants |
401+
| 64. `FINAL_CLASSIFICATION` | Final variant classification, using either `CLINVAR_CLASSIFICATION` if variant is ClinVar-classified, or `CPSR_CLASSIFICATION` for novel variants. _Note_: ClinVar-classified
402+
variants annotated with _Drug Response_ or _Risk Factor_ clinical significance are provided a `VUS` final classification |
402403
| 65. `CPSR_CLASSIFICATION` | Variant clinical significance by CPSR's classification algorithm (P/LP/VUS/LB/B) |
403404
| 66. `CPSR_PATHOGENICITY_SCORE` | Aggregated pathogenicity score by CPSR's algorithm |
404405
| 67. `CPSR_CLASSIFICATION_CODE` | Combination of CPSR classification codes assigned to the variant (ACMG) |

0 commit comments

Comments
 (0)