diff --git a/docs/feature-discussion/App-behavior-in-case-of-missing-data.md b/docs/feature-discussion/App-behavior-in-case-of-missing-data.md new file mode 100644 index 00000000..90b6dd1d --- /dev/null +++ b/docs/feature-discussion/App-behavior-in-case-of-missing-data.md @@ -0,0 +1,97 @@ +# App Behavior in Case of Missing Data + +Missing data with regards to PharMe can occur when there is a mismatch +between genes or diplotypes in the lab report, in the annotations, +and in CPIC lookups. + +Lookups are fetched from CPIC and matched with users' diplotypes from the lab. +Sometimes, genes or diplotypes might be unknown. + +This page collects the app's current and desired behavoir in such cases for +further discussion, as of August 28, 2023. + +**Baseline: this should not happen, we will test the lab results before, but** +**need to define what happens especially if missing genotype.** + +**TODO (from meeting w/ Aniwaa): gene report should also show genes in** +**annotations but not in report (“not tested”); case that CPIC does not know** +**genotypes should not happen, will handle manually for now (pre-processing** +**script)** + + +## App Behavior + +**Biggest question: should we overwrite (known) lab phenotypes with** +**Indeterminate? We will not be able to map to CPIC guidelines currently** + +**Also test: can we get different annotations for "Indeterminate" vs.** +**"No Result" in app?** + +☑️ TODO: split up cases by examples + +| Page | Case | Desired behavior | Current behavior | TODO | +| ---- | --- | ----------------- | ---------------- | ---- | +| Gene report | Gene in lab results not in lookups (e.g., APOE) | Not shown in gene results | ✅ | – | +| Gene report | Gene in lookups not in lab results | Not shown in gene results | ✅ | – | +| Gene report | Unknown diplotype | Shown in results with "Indeterminate" phenotype | Not shown in gene results | (1) Show known genes with unknown diplotype as Indeterminate; (2) Overwrite lab phenotype as "Indeterminate" if CPIC lookup not present | +| Gene detail | Unknown diplotype | As in report, diplotype shown; drugs with guidelines only for this gene should map to "Indeterminate" status | Not shown in gene results, so not getting here | Fix (1) in report and come back here; will probably need to overwrite lab phenotype with "Indeterminate", might be directly fixed by (2) | +| Drug search | Unknown gene (only guideline gene) | Not sure if it makes sense to publish such guidelines we cannot show; if there, should show "Indeterminate" status | Warning shown in script that maps FDA guidenlines to CPIC lookups; "Amifampridrine" currently staged and shown, showing as "Indeterminate" (but will probably be removed, as NAT2 not inclued in new test) | – | +| Drug search | Unknown or missing diplotype | Should show "Unknown" status | ✅ | – | +| Drug search | Unknown or missing diplotype (multiple guideline genes) | Should show status based on guideline for present gene (or "Unknown", if all are not known) | **Cannot test currently, as no such guidelines; test indeterminate and missing** | ? | +| Drug detail | Unknown or missing gene (only guideline gene) | Guideline should be shown as "Unknown"; if unknown, maybe instead of gene, "no guidelines present" should be shown; if missing, this should be shown | Guideline is "Indeterminate", phenotype is not; need to test for missing | See (2); maybe shown "no guidelines present" | +| Drug detail | Unknown diplotype | Guideline and phenotype should be shown as "Indeterminate" | Guideline is "Indeterminate", phenotype is not | See (2) | +| Drug detail | Unknown or missing gene or diplotype (multiple guideline genes) | See drug search; if unknown gene, hide in "your genome"; if missing, this should be shown | **Cannot test currently, as no such guidelines; test indeterminate and missing** | ?; probably will need to hide unknown gene and overwrite unknown diplotype phenotype | + +## Data Examples + +| Description | Screenshot | +| ----------- | ------------ | +| Diplotypes list | diplotypes_list | +| Lookups list (matched) | matched_lookups | +| Single diplotype | diplotype | +| Single lookup | lookup | + +## Test Data for Cases Above + +See the example below. User is `???`, password `1234`. + +* `CYP2D6`: all good, gene known, diplotype known +* `CYP2C19`: gene known, diplotype unknown (second star allele made up) +* `APOE`: gene not known (also, no guideline in Anni) +* `NAT2`: gene not known (but guideline in Anni; should be no difference to + no guideline in Anni, but for testing) + +```json +{ + "diplotypes": [ + { + "gene": "CYP2D6", + "resultType": "Diplotype", + "genotype": "*1/*17", + "phenotype": "Normal Metabolizer", + "allelesTested": "*xN.*3.*4.*5.*6.*8.*9.*10.*14A.*14B.*17.*41" + }, + { + "gene": "CYP2C19", + "resultType": "Diplotype", + "genotype": "*1/*101", + "phenotype": "Intermediate Metabolizer", + "allelesTested": "*2.*3.*4A.*4B.*5.*6.*8.*9.*10.*17.*101" + }, + { + "gene": "APOE", + "resultType": "Diplotype", + "genotype": "ε3/ε3", + "phenotype": "Normal APOE function", + "allelesTested": "ε4" + }, + { + "gene": "NAT2", + "resultType": "Diplotype", + "genotype": "*6/*6", + "phenotype": "Poor Metabolizer", + "allelesTested": "*6" + }, + ] +} +```