"""
Virtual Gene Scope v2.0
=======================
Educational genomics tool for nursing students and healthcare professionals.
Powered by Google DeepMind's AlphaGenome.
Part of the CQAI Nursing Education Toolkit.
Built by Clinical Quality Artificial Intelligence β Nurse Citizen Developers.
"""
import io
import os
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import streamlit as st
try:
from docx import Document
from docx.shared import RGBColor
HAS_DOCX = True
except ImportError:
HAS_DOCX = False
try:
from alphagenome.models import dna_client
from alphagenome.data import genome
from alphagenome.visualization import plot_components
HAS_ALPHAGENOME = True
except ImportError:
HAS_ALPHAGENOME = False
# ---------------------------------------------------------------------------
st.set_page_config(page_title="Virtual Gene Scope v2.0", page_icon="π§¬", layout="wide")
st.markdown("""
""", unsafe_allow_html=True)
# ---------------------------------------------------------------------------
# Gene Library β 16 genes (8 disease + 8 PGx)
# ---------------------------------------------------------------------------
GENE_LIBRARY = {
"INS (Diabetes β Insulin)": {
"sym":"INS","chr":"chr11","start":2151808,"end":2168192,"pos":2160000,
"category":"disease","omim":"176730","key_snp":"rs5219",
"inheritance":"Complex / AD (MODY10)","tissue_default":"Pancreas",
"condition":"Type 1 & Type 2 Diabetes, Neonatal Diabetes",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=INS",
"nursing_note":"Variants in INS reduce or abolish insulin secretion. Monitor BM, HbA1c, and signs of DKA. Patients may need insulin therapy from birth (neonatal DM). Educate on hypoglycaemia recognition and sick-day rules.",
"nmc_platforms":["3 β Assessing needs and planning care","4 β Providing and evaluating care"],
"nice_link":"https://www.nice.org.uk/guidance/ng17","nice_label":"NICE NG17 (Type 1 Diabetes)",
},
"SCN9A (Pain Sensitivity)": {
"sym":"SCN9A","chr":"chr2","start":166191808,"end":166208192,"pos":166200000,
"category":"disease","omim":"603415","key_snp":"rs6746030",
"inheritance":"AD / AR","tissue_default":"Brain",
"condition":"Chronic pain syndromes, Congenital Insensitivity to Pain",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=SCN9A",
"nursing_note":"Gain-of-function variants cause severe chronic pain (erythromelalgia). Loss-of-function causes insensitivity to pain β patients cannot feel injury. Assess pain carefully; standard pain scales may be unreliable.",
"nmc_platforms":["3 β Assessing needs and planning care","6 β Improving safety and quality"],
"nice_link":"https://www.nice.org.uk/guidance/ng193","nice_label":"NICE NG193 (Chronic Pain)",
},
"MMP9 (Wound Healing)": {
"sym":"MMP9","chr":"chr20","start":46006808,"end":46023192,"pos":46015000,
"category":"disease","omim":"120361","key_snp":"rs3918242",
"inheritance":"Complex","tissue_default":"Skin",
"condition":"Chronic wound risk, diabetic ulcers, keloid scarring",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=MMP9",
"nursing_note":"MMP9 regulates extracellular matrix remodelling. Over-expression impairs wound healing. Assess using TIME/TIMPE framework. Refer to TVN for wounds not healing within 4 weeks. Apply SSKIN bundle for pressure injury prevention.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety and quality"],
"nice_link":"https://www.nice.org.uk/guidance/cg179","nice_label":"NICE CG179 (Pressure Ulcers)",
},
"HBB (Sickle Cell / Thalassaemia)": {
"sym":"HBB","chr":"chr11","start":5218808,"end":5235192,"pos":5227000,
"category":"disease","omim":"141900","key_snp":"rs334",
"inheritance":"AR","tissue_default":"Blood (General)",
"condition":"Sickle Cell Disease, Ξ²-Thalassaemia",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=HBB",
"nursing_note":"HBB c.20A>T (rs334) causes the GluβVal substitution in sickle cell disease. Monitor for vaso-occlusive crises, acute chest syndrome, and stroke. High pain, Oβ therapy, IV fluids, and hydroxyurea are pillars of care. NHS Newborn Blood Spot Screening detects this.",
"nmc_platforms":["3 β Assessing needs and planning care","4 β Providing and evaluating care"],
"nice_link":"https://www.nice.org.uk/guidance/ng143","nice_label":"NICE NG143 (Sickle Cell)",
},
"BRCA1 (Breast / Ovarian Cancer)": {
"sym":"BRCA1","chr":"chr17","start":43054808,"end":43071192,"pos":43063000,
"category":"disease","omim":"113705","key_snp":"rs28897672",
"inheritance":"AD","tissue_default":"Breast",
"condition":"Hereditary Breast and Ovarian Cancer Syndrome",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=BRCA1",
"nursing_note":"BRCA1 pathogenic variants confer ~70% lifetime breast cancer risk. Refer to Clinical Genetics. Discuss prophylactic options sensitively. Support emotional wellbeing β diagnosis affects the whole family. Signpost to Breast Cancer Now and FORCE charity.",
"nmc_platforms":["2 β Promoting health and preventing ill health","3 β Assessing needs"],
"nice_link":"https://www.nice.org.uk/guidance/dg27","nice_label":"NICE DG27 (BRCA Testing)",
},
"LDLR (Familial Hypercholesterolaemia)": {
"sym":"LDLR","chr":"chr19","start":11104808,"end":11121192,"pos":11113000,
"category":"disease","omim":"606945","key_snp":"rs28942080",
"inheritance":"AD","tissue_default":"Liver",
"condition":"Familial Hypercholesterolaemia (FH)",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=LDLR",
"nursing_note":"FH affects 1 in 250 people in the UK. LDLR variants impair LDL clearance causing premature atherosclerosis. Monitor lipid profile, statins are first-line. Cascade screening of family members is essential.",
"nmc_platforms":["2 β Promoting health and preventing ill health","4 β Providing care"],
"nice_link":"https://www.nice.org.uk/guidance/cg71","nice_label":"NICE CG71 (FH)",
},
"CFTR (Cystic Fibrosis)": {
"sym":"CFTR","chr":"chr7","start":117472808,"end":117489192,"pos":117481000,
"category":"disease","omim":"602421","key_snp":"rs113993960",
"inheritance":"AR","tissue_default":"Lung",
"condition":"Cystic Fibrosis",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=CFTR",
"nursing_note":"CFTR F508del is the most common CF variant. Impaired chloride transport causes thick mucus in lungs, pancreas, and intestine. Daily physiotherapy, enzyme replacement, and CFTR modulators (e.g. Kaftrio) are transforming outcomes. NHS newborn screening via IRT/DNA test.",
"nmc_platforms":["3 β Assessing needs","4 β Providing and evaluating care"],
"nice_link":"https://www.nice.org.uk/guidance/ta398","nice_label":"NICE TA398 (Lumacaftor/Ivacaftor)",
},
"DMD (Muscular Dystrophy)": {
"sym":"DMD","chr":"chrX","start":31119808,"end":31136192,"pos":31128000,
"category":"disease","omim":"300377","key_snp":"rs137852596",
"inheritance":"XL recessive","tissue_default":"Muscle",
"condition":"Duchenne / Becker Muscular Dystrophy",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=DMD",
"nursing_note":"DMD deletion/duplication of exons causes out-of-frame transcripts. Progressive muscle weakness; most boys need wheelchair by teen years. Monitor respiratory function (FVC), cardiac function (cardiomyopathy), and swallowing. Corticosteroids slow progression.",
"nmc_platforms":["3 β Assessing needs","7 β Coordinating care"],
"nice_link":"https://www.nice.org.uk/guidance/ng238","nice_label":"NICE NG238 (Duchenne MD)",
},
# PGx
"CYP2C9 (Warfarin metabolism)": {
"sym":"CYP2C9","chr":"chr10","start":94981200,"end":94997584,"pos":94989392,
"category":"pgx","drug":"Warfarin","omim":"601130",
"key_snp":"rs1799853 (*2), rs1057910 (*3)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Altered Warfarin metabolism β bleeding or clotting risk",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=CYP2C9",
"pharmgkb":"https://www.pharmgkb.org/gene/PA126",
"nursing_note":"Poor metabolisers (*2/*2, *3/*3) need lower Warfarin doses β over-anticoagulation risk. Monitor INR closely when initiating therapy. Check CYP2C9 genotype before prescribing. MHRA guidance recommends dose adjustment based on genotype.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/ng196","nice_label":"NICE NG196 (Anticoagulation)",
},
"CYP2C19 (Clopidogrel / PPIs)": {
"sym":"CYP2C19","chr":"chr10","start":94775000,"end":94791384,"pos":94783192,
"category":"pgx","drug":"Clopidogrel / PPIs","omim":"124020",
"key_snp":"rs4244285 (*2), rs12248560 (*17)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Clopidogrel non-response; altered PPI metabolism",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=CYP2C19",
"pharmgkb":"https://www.pharmgkb.org/gene/PA124",
"nursing_note":"Poor metabolisers (*2/*2) cannot activate Clopidogrel β higher risk of MI/stroke post-PCI. Ultra-rapid metabolisers (*17) may need reduced PPI doses. Alert prescriber before dual antiplatelet therapy.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/cg94","nice_label":"NICE CG94 (ACS)",
},
"CYP2D6 (Codeine / Opioids)": {
"sym":"CYP2D6","chr":"chr22","start":42118000,"end":42134384,"pos":42126192,
"category":"pgx","drug":"Codeine / Tramadol / Opioids","omim":"124030",
"key_snp":"rs3892097 (*4), rs16947 (*2)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Opioid toxicity (ultra-rapid) or no analgesia (poor metaboliser)",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=CYP2D6",
"pharmgkb":"https://www.pharmgkb.org/gene/PA128",
"nursing_note":"Ultra-rapid metabolisers convert Codeine to Morphine very rapidly β risk of fatal respiratory depression, especially in children. MHRA contraindicated Codeine in breastfeeding mothers (UMs). Poor metabolisers get no pain relief from Codeine. Use alternative opioids.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/ng177","nice_label":"NICE NG177 (Chronic Pain β Opioids)",
},
"SLCO1B1 (Statin β Myopathy)": {
"sym":"SLCO1B1","chr":"chr12","start":21132000,"end":21148384,"pos":21140192,
"category":"pgx","drug":"Simvastatin / Statins","omim":"604843",
"key_snp":"rs4149056 (*5)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Statin-induced myopathy / rhabdomyolysis",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=SLCO1B1",
"pharmgkb":"https://www.pharmgkb.org/gene/PA134865839",
"nursing_note":"SLCO1B1*5 (rs4149056 C allele) reduces hepatic uptake of statins, raising plasma levels and myopathy risk. Check CK if patient reports muscle pain/weakness on statins. Consider dose reduction or switch to Rosuvastatin (less affected by SLCO1B1).",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/cg181","nice_label":"NICE CG181 (Cardiovascular Risk)",
},
"TPMT (Azathioprine / 6-MP)": {
"sym":"TPMT","chr":"chr6","start":18139000,"end":18155384,"pos":18147192,
"category":"pgx","drug":"6-Mercaptopurine / Azathioprine","omim":"187680",
"key_snp":"rs1800462 (*2), rs1800460 (*3B)","inheritance":"Pharmacogenomic",
"tissue_default":"Blood (General)","condition":"Thiopurine toxicity β bone marrow suppression",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=TPMT",
"pharmgkb":"https://www.pharmgkb.org/gene/PA356",
"nursing_note":"Poor metabolisers (TPMT *3A/*3A) accumulate thioguanine nucleotides β severe myelosuppression. NICE mandates TPMT testing before azathioprine in IBD. Monitor FBC closely. Teach patients to report bruising/bleeding/fever.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/ng129","nice_label":"NICE NG129 (IBD)",
},
"DPYD (5-Fluorouracil / Capecitabine)": {
"sym":"DPYD","chr":"chr1","start":97878000,"end":97894384,"pos":97886192,
"category":"pgx","drug":"5-Fluorouracil / Capecitabine","omim":"612779",
"key_snp":"rs3918290 (*2A), rs55886062 (*13), c.557A>G (African ancestry β NHS RHO 2024)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Fluoropyrimidine toxicity β mucositis, neutropenia, death",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=DPYD",
"pharmgkb":"https://www.pharmgkb.org/gene/PA145",
"nursing_note":"**NHS England mandates DPYD genotyping before all fluoropyrimidine chemotherapy** (5-FU, Capecitabine, Tegafur) β mandatory since 2020. DPD metabolises ~80% of 5-FU; deficiency causes life-threatening drug accumulation. **Current UK panel tests 4 variants β all identified in White European populations.** **NHS RHO Lay Summary (July 2024)** found 53 DPYD variants across 5 ethnic groups; recommends adding **c.557A>G** (enriched in African ancestry) to the National Genomic Test Directory β *decision under review*. Approximately 1β3% of patients carry *2A (European). **β οΈ Health equity risk:** Black/African heritage patients may carry c.557A>G or other non-European variants β current testing may miss them entirely. **Signs of toxicity:** severe mucositis, diarrhoea (β₯6 episodes/day), hand-foot syndrome, myelosuppression, neurotoxicity β onset Days 5β14. **Nurse action:** Verify DPYD result documented BEFORE any fluoropyrimidine. If absent β hold dose, contact oncology consultant. If toxicity develops β STOP immediately, escalate, consider uridine triacetate antidote (within 96 h). Complete incident report.",
"nmc_platforms":["2 β Promoting health and preventing ill health","4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.england.nhs.uk/publication/dpyd-genotyping/","nice_label":"NHS England DPYD Genotyping Mandate",
"named_variants": {
"β *2A β rs3918290 (European, ~1%)": {"pos":97886192,"ref":"G","alt":"A","ancestry":"European","equity_alert":False},
"*13 β rs55886062 (European, ~0.2%)": {"pos":97883500,"ref":"T","alt":"G","ancestry":"European","equity_alert":False},
"π c.557A>G β African ancestry (NHS RHO 2024 β οΈ)": {"pos":97879800,"ref":"A","alt":"G","ancestry":"African","equity_alert":True},
},
},
"VKORC1 (Warfarin sensitivity)": {
"sym":"VKORC1","chr":"chr16","start":31093000,"end":31109384,"pos":31101192,
"category":"pgx","drug":"Warfarin","omim":"608547",
"key_snp":"rs9923231 (-1639G>A)","inheritance":"Pharmacogenomic",
"tissue_default":"Liver","condition":"Increased Warfarin sensitivity β bleeding risk",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=VKORC1",
"pharmgkb":"https://www.pharmgkb.org/gene/PA133787052",
"nursing_note":"VKORC1 -1639A allele reduces VKORC1 expression β increased Warfarin sensitivity. Patients need lower doses to achieve target INR. Works in combination with CYP2C9 genotype for dose prediction. Monitor INR more frequently in first weeks of therapy.",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/ng196","nice_label":"NICE NG196 (Anticoagulation)",
},
"HLA-B (Abacavir / Carbamazepine)": {
"sym":"HLA-B","chr":"chr6","start":31353000,"end":31369384,"pos":31361192,
"category":"pgx","drug":"Abacavir / Carbamazepine","omim":"142830",
"key_snp":"HLA-B*57:01 (Abacavir), HLA-B*15:02 (Carbamazepine)","inheritance":"Pharmacogenomic / Immunogenetic",
"tissue_default":"Blood (General)","condition":"Severe hypersensitivity β Stevens-Johnson syndrome risk",
"clinvar":"https://www.ncbi.nlm.nih.gov/clinvar/?term=HLA-B",
"pharmgkb":"https://www.pharmgkb.org/gene/PA35056",
"nursing_note":"HLA-B*57:01 β Abacavir hypersensitivity (fever, rash, GI β potentially fatal on re-challenge). NICE mandates HLA-B*57:01 screening before Abacavir. HLA-B*15:02 β Stevens-Johnson/TEN risk with Carbamazepine (mainly South/Southeast Asian populations).",
"nmc_platforms":["4 β Providing and evaluating care","6 β Improving safety"],
"nice_link":"https://www.nice.org.uk/guidance/ta91","nice_label":"NICE TA91 (Abacavir)",
},
}
TISSUE_OPTIONS = {
"Blood (General)":"UBERON:0000178","Liver":"UBERON:0002107","Skin":"UBERON:0002097",
"Breast":"UBERON:0000310","Brain":"UBERON:0000955","Lung":"UBERON:0002048",
"Heart":"UBERON:0000948","Kidney":"UBERON:0002113","Pancreas":"UBERON:0001264","Muscle":"UBERON:0002385",
}
if "history" not in st.session_state:
st.session_state.history = []
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------
st.markdown('
𧬠Virtual Gene Scope v2.0
', unsafe_allow_html=True)
st.markdown("Explore the Regulatory Genome with Google DeepMind's AlphaGenome
Expression Β· Splicing Β· Chromatin Β· Contact Maps
", unsafe_allow_html=True)
st.warning("βοΈ **Clinical Disclaimer:** For **educational purposes only**. Does not constitute clinical advice. Always verify with ClinVar, PharmGKB, NICE guidelines, and a qualified healthcare professional.")
# ---------------------------------------------------------------------------
# Sidebar
# ---------------------------------------------------------------------------
st.sidebar.header("π¬ Analysis Settings")
mode = st.sidebar.radio("Analysis Mode", ["π₯ Disease Risk", "π Drug Response (PGx)", "π§ͺ Custom Variant"])
if "Disease" in mode:
filtered = {k: v for k, v in GENE_LIBRARY.items() if v["category"] == "disease"}
elif "PGx" in mode:
filtered = {k: v for k, v in GENE_LIBRARY.items() if v["category"] == "pgx"}
else:
filtered = GENE_LIBRARY
gene_label = st.sidebar.selectbox("Select Gene", list(filtered.keys()))
gi = filtered[gene_label]
gene_sym = gi["sym"]
st.sidebar.markdown(f"""{gene_sym}
π {gi['chr']}:{gi['start']:,}β{gi['end']:,}
𧬠Key SNP: {gi.get('key_snp','N/A')}
π Inheritance: {gi.get('inheritance','N/A')}
""", unsafe_allow_html=True)
st.sidebar.markdown("---")
st.sidebar.subheader("π« Tissue Context")
default_t = gi.get("tissue_default", "Blood (General)")
tissue = st.sidebar.selectbox("Tissue", list(TISSUE_OPTIONS.keys()), index=list(TISSUE_OPTIONS.keys()).index(default_t))
ont = TISSUE_OPTIONS[tissue]
st.sidebar.markdown("---")
st.sidebar.subheader("π Modalities")
modalities = st.sidebar.multiselect("Tracks", ["RNA Expression","Splicing","Chromatin Accessibility","Contact Map"], default=["RNA Expression","Splicing"])
vpos = gi["pos"]; ref_b, alt_b = "A", "C"
named_variants = gi.get("named_variants", {})
if named_variants and "Custom" not in mode:
st.sidebar.markdown("---")
st.sidebar.subheader("𧬠Select Variant")
variant_label = st.sidebar.selectbox("Named Variant", list(named_variants.keys()))
nv = named_variants[variant_label]
vpos = nv["pos"]; ref_b = nv["ref"]; alt_b = nv["alt"]
if nv.get("equity_alert"):
st.sidebar.markdown('β οΈ NHS RHO 2024: c.557A>G is NOT currently in the UK DPYD testing panel β recommended for inclusion. Enriched in African ancestry populations. Proceeding with standard panel risks missing this variant.
', unsafe_allow_html=True)
elif "Custom" in mode:
st.sidebar.markdown("---")
st.sidebar.subheader("𧬠Variant Input")
vpos = st.sidebar.number_input("Position", min_value=gi["start"], max_value=gi["end"], value=gi["pos"])
c1, c2 = st.sidebar.columns(2)
ref_b = c1.selectbox("REF", ["A","T","G","C"])
alt_b = c2.selectbox("ALT", ["A","T","G","C"], index=2)
intensity = st.sidebar.slider("Mutation Impact (demo)", 0.0, 1.0, 0.5)
st.sidebar.markdown("---")
st.sidebar.subheader("π AlphaGenome API")
api_key = os.environ.get("ALPHAGENOME_API_KEY") or st.sidebar.text_input("API Key (optional)", type="password", help="Leave blank for demo mode.")
st.sidebar.markdown("---")
st.sidebar.subheader("π Drug β Gene Lookup")
drug_input = st.sidebar.text_input("Search by drug name", placeholder="e.g. Warfarin, Codeineβ¦").strip().lower()
if drug_input:
drug_hits = [(k, v) for k, v in GENE_LIBRARY.items()
if drug_input in v.get("drug", "").lower()
or drug_input in v.get("condition", "").lower()]
if drug_hits:
for lbl, info in drug_hits:
st.sidebar.markdown(f"""
{info['sym']}
{info.get('drug','')}
{info.get('condition','')[:60]}β¦
""", unsafe_allow_html=True)
else:
st.sidebar.caption("No matching gene found. Try 'Warfarin', 'Codeine', 'Statins'β¦")
# ---------------------------------------------------------------------------
# Static data: Quiz, Cases, Population Frequencies, Glossary
# ---------------------------------------------------------------------------
# ββ Gene Quiz β 4 MCQs per gene βββββββββββββββββββββββββββββββββββββββββ
GENE_QUIZ = {
"INS": [
{"q": "A neonate is found to have persistent hyperglycaemia from birth. A pathogenic INS variant is identified. What is the most likely diagnosis?",
"opts": ["Type 1 Diabetes", "Neonatal Diabetes Mellitus", "Type 2 Diabetes", "Gestational Diabetes"],
"ans": 1, "rationale": "Neonatal Diabetes Mellitus (NDM) presents within the first 6 months of life and is often caused by INS variants affecting insulin secretion. It is distinct from autoimmune Type 1 Diabetes."},
{"q": "Which monitoring parameter is MOST important for a patient with an INS variant causing reduced insulin secretion?",
"opts": ["Serum potassium", "Blood glucose / HbA1c", "Serum sodium", "Haemoglobin"],
"ans": 1, "rationale": "Reduced insulin secretion causes hyperglycaemia. Blood glucose monitoring and HbA1c are the primary monitoring tools for glycaemic control."},
{"q": "A patient with an INS-related diabetes variant is started on insulin therapy. What is the PRIORITY nursing intervention?",
"opts": ["Monitor blood pressure", "Educate on hypoglycaemia recognition and sick-day rules", "Restrict dietary fluid", "Apply compression stockings"],
"ans": 1, "rationale": "Insulin therapy carries a risk of hypoglycaemia. Patient education on recognition (shakiness, sweating, confusion) and sick-day management is the priority nursing intervention."},
{"q": "Which UK guideline governs management of Type 1 Diabetes in adults?",
"opts": ["NICE NG28", "NICE NG17", "NICE NG143", "BNF Chapter 6"],
"ans": 1, "rationale": "NICE NG17 (Type 1 Diabetes in adults: diagnosis and management) is the primary UK guideline. NG28 covers Type 2 Diabetes."},
],
"SCN9A": [
{"q": "A patient with a SCN9A gain-of-function variant presents with severe burning pain in their feet. Which condition does this suggest?",
"opts": ["Diabetic neuropathy", "Erythromelalgia", "Raynaud's disease", "Peripheral arterial disease"],
"ans": 1, "rationale": "SCN9A gain-of-function variants cause Primary Erythromelalgia β characterised by severe burning pain, redness and warmth, typically in feet and hands."},
{"q": "A child with SCN9A loss-of-function variant has never reported pain. What is the PRIMARY nursing safety concern?",
"opts": ["Falls risk", "Unrecognised injury or infection", "Constipation", "Pressure ulcers only"],
"ans": 1, "rationale": "Congenital insensitivity to pain means the child cannot feel injury. Unrecognised fractures, burns, infections, or appendicitis are major safety concerns requiring regular surveillance."},
{"q": "When assessing pain in a patient known to have SCN9A pain insensitivity, which approach is MOST appropriate?",
"opts": ["Use the NRS 0-10 scale only", "Use behavioural and physiological cues alongside verbal report", "Assume no pain is present", "Only assess at annual review"],
"ans": 1, "rationale": "Standard pain scales rely on subjective report which is unreliable in SCN9A insensitivity. Behavioural cues (guarding, grimacing), vital signs changes, and physical inspection must supplement verbal assessment."},
{"q": "Which NICE guideline covers chronic primary pain management relevant to SCN9A gain-of-function conditions?",
"opts": ["NICE NG193", "NICE NG59", "NICE NG17", "NICE NG198"],
"ans": 0, "rationale": "NICE NG193 (Chronic pain β primary and secondary in over 16s) provides evidence-based guidance on assessment and management of chronic pain conditions."},
],
"MMP9": [
{"q": "An MMP9 over-expression variant is identified in a patient with a leg ulcer not healing after 6 weeks. What is the MOST appropriate action?",
"opts": ["Continue current dressing unchanged", "Refer to Tissue Viability Nurse (TVN)", "Apply a pressure bandage", "Discharge to GP"],
"ans": 1, "rationale": "Any wound not healing within 4 weeks should be referred to the Tissue Viability Nurse (TVN). MMP9 over-expression impairs matrix remodelling, increasing chronic wound risk."},
{"q": "Which wound assessment framework is recommended for structured nursing wound assessment in the UK?",
"opts": ["NEWS2", "TIMPE", "MUST", "SBAR"],
"ans": 1, "rationale": "TIMPE (Tissue, Infection/Inflammation, Moisture, Periwound, Edge) is the extended UK framework for wound assessment, aligned with Wounds UK Best Practice 2021."},
{"q": "The SSKIN bundle is used to prevent which complication?",
"opts": ["Deep vein thrombosis", "Pressure injuries", "Surgical site infection", "Urinary tract infection"],
"ans": 1, "rationale": "SSKIN (Surface, Skin inspection, Keep moving, Incontinence management, Nutrition) is the evidence-based care bundle for pressure injury prevention, relevant where MMP9 variants impair wound healing."},
{"q": "Which pressure injury category describes intact skin with non-blanchable erythema?",
"opts": ["Category 2", "Category 1", "Category 3", "Deep Tissue Injury"],
"ans": 1, "rationale": "EPUAP Category 1 is intact skin with non-blanchable erythema β the earliest detectable stage. Particularly difficult to detect on darker skin tones (Fitzpatrick IVβVI)."},
],
"HBB": [
{"q": "A patient with sickle cell disease presents with severe bone pain, fever, and cough. Which EMERGENCY complication must be excluded FIRST?",
"opts": ["Vaso-occlusive crisis only", "Acute Chest Syndrome", "Cholelithiasis", "Priapism"],
"ans": 1, "rationale": "Acute Chest Syndrome (ACS) β new pulmonary infiltrate + respiratory symptoms in SCD β is life-threatening and requires immediate escalation, Oβ, analgesia, blood transfusion and antibiotic therapy."},
{"q": "Which NHS programme screens for HBB variants (sickle cell) in newborns?",
"opts": ["NHS Genomic Medicine Service", "NHS Newborn Blood Spot Screening Programme", "NHS Cancer Screening", "UK Biobank"],
"ans": 1, "rationale": "The NHS Newborn Blood Spot Screening Programme (heel prick test at 5 days) screens for sickle cell disease alongside PKU, hypothyroidism, CF, and MCADD."},
{"q": "Which medication reduces the frequency of vaso-occlusive crises in sickle cell disease?",
"opts": ["Aspirin", "Hydroxyurea (hydroxycarbamide)", "Clopidogrel", "Warfarin"],
"ans": 1, "rationale": "Hydroxyurea (hydroxycarbamide) increases foetal haemoglobin (HbF) production, reducing sickling events. It is first-line disease-modifying therapy per NICE NG143."},
{"q": "The HBB rs334 variant causes which amino acid substitution?",
"opts": ["LysβGlu at position 6", "GluβVal at position 6", "ValβAla at position 11", "GlyβSer at position 17"],
"ans": 1, "rationale": "HBB c.20A>T (rs334) causes a Glutamic acid β Valine substitution at position 6 of the Ξ²-globin chain. This single change causes haemoglobin to polymerise under low Oβ, distorting the red cell into a sickle shape."},
],
"BRCA1": [
{"q": "A 30-year-old woman is found to carry a BRCA1 pathogenic variant. What is her approximate LIFETIME risk of breast cancer?",
"opts": ["12% (population risk)", "~70%", "~30%", "~5%"],
"ans": 1, "rationale": "BRCA1 pathogenic variant carriers have approximately 69β72% lifetime breast cancer risk and 44β46% ovarian cancer risk, compared to ~12% and ~2% in the general population."},
{"q": "Which UK specialist service should a BRCA1 variant carrier be referred to?",
"opts": ["District Nurse", "Clinical Genetics service", "Dermatology", "Physiotherapy"],
"ans": 1, "rationale": "Clinical Genetics services provide genetic counselling, risk assessment, surveillance planning (MRI/mammogram), and discussion of risk-reducing surgery options (prophylactic mastectomy/salpingo-oophorectomy)."},
{"q": "Which nursing role is MOST important when a patient receives a BRCA1 positive result?",
"opts": ["Prescribing tamoxifen", "Emotional support and signposting to specialist charities", "Performing a biopsy", "Ordering genetic tests for the patient's children"],
"ans": 1, "rationale": "A positive BRCA1 result has profound psychological impact and affects the entire family. Nurses provide emotional support, active listening, and signpost to Breast Cancer Now, FORCE, and genetics counselling."},
{"q": "Which NICE guidance covers genetic testing for BRCA1 in the UK?",
"opts": ["NICE NG151", "NICE DG27", "NICE TA428", "NICE CG41"],
"ans": 1, "rationale": "NICE DG27 (BRCA1 and BRCA2 testing) provides guidance on who should be offered genetic testing, covering mainstreaming through oncology and GP referral pathways."},
],
"LDLR": [
{"q": "Familial Hypercholesterolaemia affects approximately 1 in ___ people in the UK?",
"opts": ["1 in 2,500", "1 in 250", "1 in 25,000", "1 in 50"],
"ans": 1, "rationale": "FH affects approximately 1 in 250 (heterozygous) in the UK β meaning ~265,000 people have it, but only ~7% are currently diagnosed. It is one of the most common serious genetic conditions."},
{"q": "A patient with LDLR pathogenic variant has a total cholesterol of 9.8 mmol/L. Which drug class is FIRST-LINE treatment?",
"opts": ["Fibrates", "Statins (high-intensity)", "Bile acid sequestrants", "Omega-3 fatty acids"],
"ans": 1, "rationale": "High-intensity statins (atorvastatin 80mg) are first-line per NICE CG71. The goal is β₯50% reduction in LDL-C. PCSK9 inhibitors are added if targets not achieved."},
{"q": "Which physical sign, when present, strongly supports a clinical diagnosis of Familial Hypercholesterolaemia?",
"opts": ["Xanthelasma only", "Tendon xanthomata", "Butterfly rash", "Koilonychia"],
"ans": 1, "rationale": "Tendon xanthomata (cholesterol deposits in tendons, especially Achilles and extensor tendons of hands) are pathognomonic for FH. Corneal arcus before age 45 is also suggestive."},
{"q": "After diagnosing FH in a patient, what is the NEXT recommended public health action?",
"opts": ["Dietary advice only", "Cascade testing of first-degree relatives", "Population lipid screening", "Report to MHRA"],
"ans": 1, "rationale": "Cascade screening β systematic testing of first-degree relatives (parents, siblings, children) β is mandated by NICE CG71 as it identifies affected family members who may be undiagnosed."},
],
"CFTR": [
{"q": "Which is the MOST COMMON CFTR variant causing Cystic Fibrosis in the UK?",
"opts": ["G551D", "F508del (rs113993960)", "W1282X", "N1303K"],
"ans": 1, "rationale": "F508del (deletion of phenylalanine at position 508) accounts for ~70β90% of CF alleles in UK/European populations. It causes protein misfolding and premature degradation."},
{"q": "A CF patient is prescribed Kaftrio (elexacaftor/tezacaftor/ivacaftor). What class of drug is this?",
"opts": ["Antibiotic", "CFTR modulator", "Bronchodilator", "Mucolytic"],
"ans": 1, "rationale": "CFTR modulators address the underlying protein defect. Kaftrio (triple combination) is a corrector/potentiator therapy approved by NICE for patients with β₯1 F508del allele aged β₯2 years, transforming CF outcomes."},
{"q": "Daily airway clearance is a cornerstone of CF nursing care. Which technique is evidence-based?",
"opts": ["Postural drainage only", "Active Cycle of Breathing Technique (ACBT) / physiotherapy devices", "Coughing exercises only", "Incentive spirometry alone"],
"ans": 1, "rationale": "ACBT and oscillating positive expiratory pressure (OPEP) devices (e.g. Acapella, Flutter) are evidence-based airway clearance techniques. Physiotherapist-led programmes are individualised."},
{"q": "How is CF inherited?",
"opts": ["Autosomal dominant", "X-linked recessive", "Autosomal recessive", "Mitochondrial"],
"ans": 2, "rationale": "CF is autosomal recessive β a person must inherit two pathogenic CFTR alleles (one from each parent) to be affected. Carriers (one copy) are unaffected but can pass the variant to children."},
],
"DMD": [
{"q": "Duchenne Muscular Dystrophy primarily affects which sex, and why?",
"opts": ["Females, because it is autosomal dominant", "Males, because it is X-linked recessive", "Both sexes equally", "Females, because of imprinting"],
"ans": 1, "rationale": "DMD is X-linked recessive. Males have one X chromosome so a single pathogenic DMD allele causes disease. Females have two X chromosomes and are usually carriers; they rarely show significant symptoms."},
{"q": "Which cardiac complication is a leading cause of death in DMD?",
"opts": ["Hypertensive heart disease", "Dilated cardiomyopathy", "Hypertrophic obstructive cardiomyopathy", "Infective endocarditis"],
"ans": 1, "rationale": "Dilated cardiomyopathy develops in virtually all DMD patients by their 20s. Annual echocardiography is recommended. ACE inhibitors and beta-blockers are used prophylactically."},
{"q": "A 12-year-old boy with DMD reports difficulty swallowing. What is the PRIORITY nursing action?",
"opts": ["Refer to physiotherapy", "Refer to Speech and Language Therapy (SALT) for dysphagia assessment", "Increase oral fluids", "Prescribe antacids"],
"ans": 1, "rationale": "Progressive muscle weakness affects swallowing muscles. SALT referral for dysphagia assessment and modified texture diet recommendations is priority to prevent aspiration pneumonia."},
{"q": "Which corticosteroid is used to slow progression in DMD and is included in NICE NG238?",
"opts": ["Prednisolone / Deflazacort", "Dexamethasone (high dose)", "Hydrocortisone", "Fludrocortisone"],
"ans": 0, "rationale": "Prednisolone and deflazacort are recommended in NICE NG238 to maintain muscle function and delay loss of ambulation. Side effects (weight gain, bone health, behaviour) require monitoring."},
],
"LDLR": [
{"q": "Familial Hypercholesterolaemia affects approximately 1 in ___ people in the UK?",
"opts": ["1 in 2,500", "1 in 250", "1 in 25,000", "1 in 50"],
"ans": 1, "rationale": "FH affects approximately 1 in 250 (heterozygous) in the UK."},
{"q": "A patient with LDLR variant has total cholesterol of 9.8 mmol/L. First-line treatment is?",
"opts": ["Fibrates", "High-intensity statins", "Bile acid sequestrants", "Omega-3"],
"ans": 1, "rationale": "High-intensity statins (atorvastatin 80mg) are first-line per NICE CG71."},
{"q": "Which physical finding is pathognomonic for Familial Hypercholesterolaemia?",
"opts": ["Xanthelasma only", "Tendon xanthomata", "Butterfly rash", "Koilonychia"],
"ans": 1, "rationale": "Tendon xanthomata are pathognomonic for FH."},
{"q": "After diagnosing FH, the NEXT public health action is?",
"opts": ["Dietary advice only", "Cascade testing of first-degree relatives", "Population screening", "MHRA report"],
"ans": 1, "rationale": "Cascade screening of first-degree relatives is mandated by NICE CG71."},
],
"CYP2C9": [
{"q": "A patient prescribed Warfarin is found to be a CYP2C9 *3/*3 poor metaboliser. What is the clinical implication?",
"opts": ["Higher dose needed", "Lower dose needed β over-anticoagulation risk", "No dose adjustment needed", "Warfarin is contraindicated"],
"ans": 1, "rationale": "CYP2C9 *3/*3 severely reduces Warfarin metabolism β drug accumulates β INR rises β bleeding risk. A significantly lower dose is required, with frequent INR monitoring."},
{"q": "INR monitoring is essential during Warfarin initiation. What is the TARGET INR range for most indications (e.g. AF, DVT)?",
"opts": ["1.0 β 1.5", "2.0 β 3.0", "3.5 β 4.5", "4.0 β 5.0"],
"ans": 1, "rationale": "The standard therapeutic INR range for most indications (AF, DVT/PE, mechanical heart valves low risk) is 2.0β3.0. Mechanical mitral valve may target 2.5β3.5."},
{"q": "Which drug interaction INCREASES Warfarin effect by inhibiting CYP2C9?",
"opts": ["Rifampicin", "Fluconazole", "Carbamazepine", "St John's Wort"],
"ans": 1, "rationale": "Fluconazole is a potent CYP2C9 inhibitor β it reduces Warfarin metabolism, raising plasma levels and INR. This is a serious drug interaction requiring dose reduction or temporary discontinuation."},
{"q": "A patient on Warfarin reports taking ibuprofen for a headache. What is your nursing concern?",
"opts": ["NSAIDs have no effect on anticoagulation", "NSAIDs increase bleeding risk β via antiplatelet effect and GI irritation", "NSAIDs reduce INR", "Only aspirin is dangerous with Warfarin"],
"ans": 1, "rationale": "NSAIDs (including ibuprofen) inhibit platelets and irritate the GI mucosa β both increase bleeding risk in anticoagulated patients. Paracetamol is the preferred analgesic (though it too can slightly raise INR at high doses)."},
],
"CYP2C19": [
{"q": "A patient post-primary PCI is prescribed Clopidogrel. CYP2C19 *2/*2 genotype is identified. What is the clinical risk?",
"opts": ["Increased bleeding", "Poor antiplatelet response β higher MI/stent thrombosis risk", "No clinical significance", "Increased GI side effects"],
"ans": 1, "rationale": "CYP2C19 *2 is a loss-of-function variant. *2/*2 patients cannot activate Clopidogrel (a prodrug) effectively β insufficient platelet inhibition β increased risk of stent thrombosis and MI."},
{"q": "Which alternative antiplatelet agent is NOT affected by CYP2C19 polymorphism?",
"opts": ["Clopidogrel", "Prasugrel", "Aspirin", "Both B and C"],
"ans": 3, "rationale": "Prasugrel (active drug, no metabolic activation required) and Aspirin (different mechanism) are not affected by CYP2C19 status. Prasugrel or Ticagrelor are preferred in CYP2C19 poor metabolisers."},
{"q": "CYP2C19 *17 ultra-rapid metaboliser status affects which common drug class?",
"opts": ["Statins", "Proton Pump Inhibitors (PPIs)", "Beta-blockers", "ACE inhibitors"],
"ans": 1, "rationale": "CYP2C19 *17 ultra-rapid metabolisers clear PPIs (omeprazole, lansoprazole) more rapidly β reduced acid suppression β PPI therapy may be less effective for H. pylori eradication or GORD."},
{"q": "Before starting dual antiplatelet therapy post-ACS, which nursing action is MOST important regarding genomics?",
"opts": ["Test for BRCA1", "Alert prescriber to check CYP2C19 genotype or choose a non-prodrug antiplatelet", "Check HbA1c", "Screen for DPYD"],
"ans": 1, "rationale": "CYP2C19 genotyping or default use of Ticagrelor/Prasugrel (not affected by CYP2C19) should be considered in high-risk ACS patients. Nurses should flag genomic considerations to the prescribing team."},
],
"CYP2D6": [
{"q": "A breastfeeding mother is prescribed Codeine for post-partum pain. The MHRA issued guidance regarding this. What is the concern?",
"opts": ["Codeine causes constipation in the infant", "Ultra-rapid metabolisers produce excess morphine β neonatal respiratory depression reported", "Codeine is safe in all breastfeeding women", "Codeine causes jaundice"],
"ans": 1, "rationale": "The MHRA and NICE advise against Codeine in breastfeeding. CYP2D6 ultra-rapid metaboliser mothers produce high morphine concentrations which transfer to breast milk β neonatal CNS/respiratory depression. Fatalities have been reported."},
{"q": "A CYP2D6 poor metaboliser is prescribed Tramadol for pain. What is the expected outcome?",
"opts": ["Increased opioid toxicity", "Inadequate analgesia β Tramadol requires CYP2D6 activation", "Normal response", "Sedation only"],
"ans": 1, "rationale": "Tramadol (like Codeine) requires CYP2D6 conversion to its active O-desmethyltramadol metabolite. Poor metabolisers gain little analgesic benefit. Alternative opioids not reliant on CYP2D6 (e.g. Morphine, Oxycodone) should be considered."},
{"q": "Which type of medication MOST commonly inhibits CYP2D6, creating drug-drug-gene interactions?",
"opts": ["Penicillins", "Antidepressants (SSRIs/SNRIs)", "ACE inhibitors", "Diuretics"],
"ans": 1, "rationale": "Many SSRIs (fluoxetine, paroxetine) and SNRIs are potent CYP2D6 inhibitors. A CYP2D6 normal metaboliser taking paroxetine becomes a phenotypic poor metaboliser β this affects Codeine, Tamoxifen, and other CYP2D6 substrates."},
{"q": "A patient is a CYP2D6 ultra-rapid metaboliser taking Tamoxifen for breast cancer. What is the concern?",
"opts": ["Tamoxifen toxicity", "Reduced endoxifen (active metabolite) production β reduced efficacy", "Increased bone density", "No concern"],
"ans": 1, "rationale": "Tamoxifen is metabolised by CYP2D6 to active endoxifen. Ultra-rapid metabolisers may actually be expected to do well, but concurrent CYP2D6-inhibiting drugs (SSRIs) dramatically reduce endoxifen levels β reduced breast cancer protection."},
],
"SLCO1B1": [
{"q": "A patient on Simvastatin 40mg reports muscle aches. SLCO1B1*5 (rs4149056) is identified. What does this mean?",
"opts": ["The statin is ineffective", "Reduced hepatic uptake β raised plasma statin β myopathy risk", "Statin dose should be increased", "The patient is non-compliant"],
"ans": 1, "rationale": "SLCO1B1*5 reduces the hepatic transporter OATP1B1 function β statins accumulate in plasma rather than being taken up by the liver β muscle toxicity (myopathy, rhabdomyolysis)."},
{"q": "When a patient on a statin develops myopathy, which blood test should be checked URGENTLY?",
"opts": ["INR", "Creatine Kinase (CK)", "HbA1c", "Thyroid function"],
"ans": 1, "rationale": "CK (Creatine Kinase) is the biomarker for muscle damage. CK >10x upper limit of normal with symptoms = statin-induced myopathy. >40x = rhabdomyolysis β requires immediate cessation and monitoring of renal function."},
{"q": "Which statin is LEAST affected by SLCO1B1 polymorphism?",
"opts": ["Simvastatin 40mg", "Atorvastatin 80mg", "Rosuvastatin", "Lovastatin"],
"ans": 2, "rationale": "Rosuvastatin is less dependent on SLCO1B1-mediated hepatic uptake than simvastatin. Switching to rosuvastatin at a lower dose is a common clinical strategy for SLCO1B1*5 carriers with myopathy."},
{"q": "A nurse notes a patient is taking Simvastatin with amiodarone. What is the pharmacogenomic concern?",
"opts": ["No interaction", "Amiodarone inhibits CYP3A4 and SLCO1B1 β statin toxicity risk", "Amiodarone induces statin metabolism", "The combination is always safe"],
"ans": 1, "rationale": "Amiodarone inhibits CYP3A4 and drug transporters including SLCO1B1 β this compounds the risk of statin accumulation, especially in SLCO1B1*5 carriers. BNF recommends Simvastatin dose capping at 20mg with amiodarone."},
],
"TPMT": [
{"q": "Before starting a patient with IBD on Azathioprine, which test is mandated by NICE?",
"opts": ["CYP2C9 genotyping", "TPMT activity/genotyping", "DPYD genotyping", "HLA-B*57:01 testing"],
"ans": 1, "rationale": "NICE NG129 mandates TPMT testing before starting thiopurines (Azathioprine, 6-mercaptopurine) in IBD. TPMT poor metabolisers (1 in 300 people) are at risk of severe life-threatening myelosuppression."},
{"q": "A TPMT-deficient patient is inadvertently given standard dose Azathioprine. What is the IMMEDIATE nursing concern?",
"opts": ["Hypertension", "Severe bone marrow suppression (neutropenia, thrombocytopenia)", "Liver failure", "Renal failure"],
"ans": 1, "rationale": "TPMT deficiency causes accumulation of cytotoxic thioguanine nucleotides β severe myelosuppression within 2β4 weeks. FBC must be monitored weekly for the first 4β8 weeks. Urgent escalation if neutropenia develops."},
{"q": "A patient on Azathioprine presents with fever, sore throat, and mouth ulcers. What should a nurse suspect?",
"opts": ["Azathioprine rash", "Neutropenic sepsis β medical emergency", "Viral upper respiratory infection", "Thrush"],
"ans": 1, "rationale": "Fever + sore throat + mouth ulcers in a patient on immunosuppressants = neutropenic sepsis until proven otherwise. This is a medical emergency requiring immediate sepsis 6 bundle, FBC, and urgent haematology review."},
{"q": "TPMT activity follows a trimodal distribution. Which population has FULL TPMT activity?",
"opts": ["1 in 300 people", "~89% of the population (homozygous wild-type)", "~11% of population", "All people with IBD"],
"ans": 1, "rationale": "~89% are homozygous wild-type (high TPMT activity), ~11% are heterozygous (intermediate activity β may need dose reduction), and ~1 in 300 are homozygous variant (deficient β standard doses are dangerous)."},
],
"DPYD": [
{"q": "NHS England mandates DPYD genotyping before which chemotherapy agents?",
"opts": ["Methotrexate and Cyclophosphamide", "5-Fluorouracil (5-FU) and Capecitabine", "Tamoxifen and Letrozole", "Carboplatin and Paclitaxel"],
"ans": 1, "rationale": "NHS England mandated DPYD genotyping before all fluoropyrimidine chemotherapy (5-FU, Capecitabine, Tegafur) from 2020. This identified ~1β3% at risk of severe toxicity β preventing fatal reactions."},
{"q": "A DPYD *2A patient develops severe mucositis and hand-foot syndrome on Capecitabine Day 5. What is the PRIORITY action?",
"opts": ["Continue therapy β this is expected", "STOP treatment immediately and escalate to oncologist", "Reduce dose by 10%", "Prescribe analgesia and continue"],
"ans": 1, "rationale": "Severe early toxicity in a DPYD variant carrier indicates drug accumulation. Immediate cessation is required. Uridine triacetate (antidote) may be used in life-threatening fluoropyrimidine toxicity."},
{"q": "DPYD encodes Dihydropyrimidine Dehydrogenase. What does DPD normally do to 5-Fluorouracil?",
"opts": ["Activates 5-FU to its toxic form", "Inactivates (degrades) ~80% of 5-FU", "Transports 5-FU into cells", "None of the above"],
"ans": 1, "rationale": "DPD catabolises ~80% of 5-FU in the liver. DPYD deficiency β reduced 5-FU degradation β massive accumulation β GI toxicity (mucositis, diarrhoea), myelosuppression, and neurotoxicity."},
{"q": "Hand-foot syndrome is a distinctive toxicity of Capecitabine. Early signs a nurse should monitor for include:",
"opts": ["Jaundice and dark urine", "Redness, swelling, tingling/numbness of palms and soles", "Haematuria", "Chest pain"],
"ans": 1, "rationale": "Hand-foot syndrome (palmar-plantar erythrodysaesthesia) presents with redness, swelling, and pain/tingling of palms and soles β progressing to blistering. Early recognition and dose modification are essential."},
{"q": "The NHS Race and Health Observatory (July 2024) recommends adding which DPYD variant to the UK testing panel to reduce health inequalities?",
"opts": ["*2A (rs3918290)", "c.557A>G β enriched in African ancestry", "*13 (rs55886062)", "HapB3 (rs56038477)"],
"ans": 1, "rationale": "The NHS RHO systematic review (2024, Wolfson Centre/University of Liverpool) found strong evidence for c.557A>G in individuals of African ancestry β NOT in the current UK panel (which covers 4 European-ancestry variants). Inclusion in the National Genomic Test Directory is under review. Missing this variant could cause life-threatening fluoropyrimidine toxicity in Black/African heritage patients."},
],
"VKORC1": [
{"q": "A patient carries the VKORC1 -1639AA genotype. How does this affect Warfarin therapy?",
"opts": ["Higher Warfarin dose needed", "Lower Warfarin dose needed β increased sensitivity", "No change needed", "Warfarin is ineffective"],
"ans": 1, "rationale": "VKORC1 -1639AA reduces VKORC1 gene expression β less target enzyme β greater Warfarin effect at lower doses. These patients need lower doses and more frequent INR monitoring especially during initiation."},
{"q": "VKORC1 and CYP2C9 genotyping are used together for which clinical purpose?",
"opts": ["Statin dose prediction", "Warfarin dose prediction algorithms", "Clopidogrel selection", "TPMT activity estimation"],
"ans": 1, "rationale": "VKORC1 (sensitivity) + CYP2C9 (metabolism) combined with age, weight and indication are used in validated Warfarin dosing algorithms (e.g. IWPC algorithm) to predict starting dose, reducing time in therapeutic range."},
{"q": "VKORC1 -1639A allele frequency is highest in which population?",
"opts": ["African ancestry (~8%)", "European ancestry (~37%)", "East Asian ancestry (~92%)", "South Asian ancestry (~40%)"],
"ans": 2, "rationale": "The VKORC1 -1639A allele is most common in East Asian populations (~92%), which is why East Asian patients typically need much lower Warfarin doses than European patients for equivalent anticoagulation."},
{"q": "What does VKORC1 stand for and why is it important in anticoagulation?",
"opts": ["Vascular Kinase Receptor 1", "Vitamin K epOxide Reductase Complex subunit 1", "Vitamin K Organiser Complex 1", "None of the above"],
"ans": 1, "rationale": "VKORC1 (Vitamin K ePoxide Reductase Complex subunit 1) recycles oxidised Vitamin K β active form needed for clotting factor activation. Warfarin works by inhibiting VKORC1. Variants reduce the enzyme amount, so less Warfarin is needed."},
],
"HLA-B": [
{"q": "Why is HLA-B*57:01 testing mandatory before prescribing Abacavir (an HIV antiretroviral)?",
"opts": ["Abacavir is renally cleared", "HLA-B*57:01 carriers develop severe hypersensitivity reaction (HSR) β potentially fatal on re-challenge", "Abacavir is contraindicated in all patients", "To confirm HIV diagnosis"],
"ans": 1, "rationale": "HLA-B*57:01 is present in ~5β8% of white Europeans. Carriers who receive Abacavir develop Abacavir Hypersensitivity Syndrome (fever, rash, GI symptoms). Re-challenge after stopping is potentially fatal. NICE mandates screening before prescribing."},
{"q": "HLA-B*15:02 is associated with severe cutaneous reactions to Carbamazepine. Which ethnic group is at highest risk?",
"opts": ["Irish", "South and Southeast Asian populations", "Sub-Saharan African", "North European"],
"ans": 1, "rationale": "HLA-B*15:02 is found in ~10% of Han Chinese, Thai, Malaysian, Vietnamese, and other Southeast Asian populations. NICE recommends HLA-B*15:02 testing before Carbamazepine in these groups to prevent Stevens-Johnson Syndrome/TEN."},
{"q": "Stevens-Johnson Syndrome is a life-threatening skin reaction. What is the FIRST nursing priority if suspected?",
"opts": ["Apply emollient cream", "STOP the causative drug and escalate immediately to emergency medical team", "Prescribe antihistamine", "Continue medication and monitor"],
"ans": 1, "rationale": "SJS/TEN requires immediate withdrawal of the causative drug, emergency escalation, transfer to burns unit if >10% body surface area affected, IV fluids, wound care, and ophthalmology review. Mortality is 10β30%."},
{"q": "Which immunological mechanism underlies HLA-B associated drug hypersensitivity reactions?",
"opts": ["IgE-mediated (Type I hypersensitivity)", "T-cell mediated (Type IV hypersensitivity via HLA-drug-peptide complex)", "Complement-mediated (Type III)", "Autoantibody-mediated (Type II)"],
"ans": 1, "rationale": "HLA-B*57:01/Abacavir reactions are T-cell mediated (Type IV). The drug or drug-peptide complex binds HLA-B*57:01, activating CD8+ T cells β cytotoxic immune response β widespread tissue damage."},
],
}
# ββ Clinical Cases β 2 per gene ββββββββββββββββββββββββββββββββββββββββββ
GENE_CASES = {
"INS": [
{"title": "πΌ Neonatal Hyperglycaemia", "scenario": "Jake, a 3-week-old neonate on the neonatal unit, has persistent blood glucose of 18β22 mmol/L despite reducing feeds. Genetic testing reveals a pathogenic INS variant. He is started on subcutaneous insulin.", "questions": ["What is the likely diagnosis?", "What monitoring will Jake require?", "What education should his parents receive before discharge?"], "model_answer": "Diagnosis: Neonatal Diabetes Mellitus (NDM). Monitoring: BM 4-hourly, HbA1c 3-monthly, renal function. Education: insulin injection technique, BM monitoring, sick-day rules, hypoglycaemia recognition, emergency contact information. NDM caused by INS variants may be transient (resolves in weeks-months) or permanent β long-term endocrine follow-up is essential."},
{"title": "π§ Young Adult with MODY10", "scenario": "Amara, 23, is referred from GP after three family members on her mother's side were diagnosed with 'Type 1 Diabetes'. She is found to have an INS variant consistent with MODY10. Her HbA1c is 58 mmol/mol.", "questions": ["How does MODY10 differ from Type 1 Diabetes in management?", "What dietary advice is appropriate?", "What are the genetic implications for Amara's siblings?"], "model_answer": "MODY10 is monogenic β autosomal dominant inheritance (50% risk to first-degree relatives). Unlike Type 1, no autoimmune destruction occurs. Insulin therapy may be needed but doses are often lower. Dietary management similar to T1D. Family cascade testing is important. Genetic counselling referral recommended."},
],
"SCN9A": [
{"title": "π₯ Burning Pain Unresponsive to Analgesia", "scenario": "Marcus, 35, presents to the pain clinic with a 5-year history of bilateral burning foot pain, worsening at night and with heat. Standard analgesics have been ineffective. Genetic testing reveals an SCN9A gain-of-function variant (erythromelalgia).", "questions": ["What nursing assessment should you perform?", "What non-pharmacological strategies may help?", "What are the patient safety considerations?"], "model_answer": "Assessment: Pain characterisation (NRS, burning quality, triggers, timing), sleep impact, mood screening (PHQ-9), functional assessment. Non-pharm: Cool water immersion, fans, avoiding heat triggers, elevation. Pharmacological: Sodium channel blockers (carbamazepine, mexiletine) may help. Safety: Skin cooling must be careful to avoid frostbite. Psychological support for chronic pain. NICE NG193 guides management."},
{"title": "πΆ Child Who Never Cries with Pain", "scenario": "Priya, 7, is brought to A&E with a swollen ankle after a fall. Her mother reports she has never complained of pain β she recently sat on a hot radiator without reacting. An SCN9A loss-of-function variant is confirmed.", "questions": ["What safety plan should be developed with the family?", "How will you assess Priya's needs going forward?", "Which professionals should be involved in her care?"], "model_answer": "Safety plan: Regular full-body skin inspections, protective footwear, temperature awareness education for Priya and parents, school nurse notification. Assessment: Behavioural pain cues (facial expression, guarding), physiological signs. MDT: Geneticist, paediatric neurologist, school nurse, physiotherapist, orthopaedics. Priya needs dental review (dental pain undetected)."},
],
"MMP9": [
{"title": "𦡠Non-Healing Leg Ulcer in a Diabetic Patient", "scenario": "Edna, 72, with T2DM and an MMP9 over-expression variant, has a venous leg ulcer on her right shin present for 10 weeks. It is 4cm Γ 3cm, sloughy, with surrounding erythema.", "questions": ["Apply the TIMPE framework to Edna's assessment.", "What referral is appropriate?", "What preventive measures should be implemented?"], "model_answer": "TIMPE: Tissue β sloughy (debridement needed); Infection/Inflammation β erythema suggests infection, swab needed, consider antibiotics; Moisture β moist wound bed, moisture balance dressing; Periwound β assess for maceration; Edge β rolled edges suggest chronicity. Referral: TVN urgently. Prevention: SSKIN bundle, compression therapy (if ABPI >0.8), blood glucose optimisation. MMP9 over-expression impairs matrix remodelling β targeted dressings (matrix metalloprotease-inhibiting) may be considered by TVN."},
{"title": "π₯ Post-Surgical Wound Dehiscence", "scenario": "Robert, 58, has wound dehiscence 8 days post-laparotomy. Genomic testing reveals an MMP9 regulatory variant associated with impaired wound healing. The surgical team ask nursing to manage the wound.", "questions": ["What wound assessment would you perform?", "What are the infection indicators to monitor?", "How would you document and escalate this?"], "model_answer": "Assessment: Measure wound dimensions, depth, tissue type (granulation vs necrosis vs slough), exudate amount/type, wound edges, periwound skin, pain. Infection signs: Increasing erythema, purulent exudate, warmth, fever, raised WBC, increasing pain. Escalation: Complete wound assessment documentation, photograph, escalate to surgical team if signs of infection, refer TVN, consider surgical review for re-closure. SBAR handover for escalation."},
],
"HBB": [
{"title": "π¨ Sickle Cell Crisis on the Ward", "scenario": "Yemi, 26, with sickle cell disease (HbSS), is admitted with severe bilateral leg pain scoring 9/10, temperature 38.4Β°C, and Oβ saturation 92% on air. He appears short of breath.", "questions": ["What are your IMMEDIATE nursing priorities using ABCDE?", "What is the concern regarding his respiratory symptoms?", "Outline the nursing care plan for the next 24 hours."], "model_answer": "ABCDE: Airway patent. Breathing: RR, Oβ sats, apply Oβ to achieve β₯95%. Circulation: IV access, IV fluids, bloods (FBC, U&E, cultures, blood film), cardiac monitoring. Disability: Pain β IV morphine/opioid titration per sickle cell protocol. Exposure: Temperature β blood cultures if sepsis suspected. Concern: Oβ 92% + SOB + fever = Acute Chest Syndrome until proven otherwise. Escalate immediately β may need transfusion, antibiotics, high-flow Oβ. Care plan: 4-hourly obs, BM, strict fluid balance, pain scoring every 30 min, antibiotic prophylaxis, liaise with haematology."},
{"title": "πΆ Newborn Screening Result", "scenario": "A midwife receives a newborn blood spot result for Baby Oluwaseun: HbSS detected. The parents are shocked β they had no prior knowledge of their carrier status.", "questions": ["How would you break this news sensitively?", "What information and support should the family receive?", "What follow-up is arranged?"], "model_answer": "Breaking news: Private, calm setting. Use clear language (avoid jargon), allow silence, ask what they already know. Information: Explain sickle cell disease, what HbSS means, that baby needs specialist care but can live well. Both parents are carriers (HbAS). Support: Refer to Sickle Cell and Thalassaemia Centre, Sickle Cell Society leaflets, peer support groups. Practical: Daily penicillin prophylaxis from age 3 months (prevents pneumococcal sepsis), vaccinations, folic acid, red flag symptoms (fever >38Β°C = emergency). Follow-up: Paediatric haematology within 2 weeks, genetic counselling for family."},
],
"BRCA1": [
{"title": "π BRCA1 Positive Result in a 32-Year-Old", "scenario": "Sofia, 32, has just received her BRCA1 positive result after her sister was diagnosed with breast cancer at 29. She is seen in the genetics clinic. She asks the nurse: 'Does this mean I'll definitely get cancer?'", "questions": ["How do you respond to Sofia's question accurately and compassionately?", "What options should Sofia know about?", "Who else in Sofia's family might be at risk?"], "model_answer": "Response: 'Not definitely β a BRCA1 variant means a higher risk (~70% lifetime) but many women with BRCA1 don't get cancer, and there are steps we can take to monitor and reduce your risk.' Options: Enhanced surveillance (annual MRI from age 30), risk-reducing surgery (prophylactic bilateral mastectomy reduces risk by ~90%; salpingo-oophorectomy by age 40 reduces ovarian cancer risk), chemoprevention (tamoxifen). Family: First-degree relatives (mother, sister, children β₯18) each have 50% chance of inheriting the variant β cascade testing offered. Referral to Breast Cancer Now and FORCE charity for peer support."},
{"title": "π₯ Pre-operative BRCA1 Assessment", "scenario": "Deirdre, 55, BRCA1 carrier, is on the list for prophylactic bilateral risk-reducing mastectomy. She confides in the nurse pre-operatively: 'I feel like I'm having surgery for something I haven't even got yet.'", "questions": ["How do you provide psychological support?", "What post-operative nursing care will be specific to her situation?", "What follow-up will Deirdre need?"], "model_answer": "Psychological support: Validate her feelings ('Your feelings are completely normal β this is a difficult, brave decision'). Explore concerns. Contact clinical nurse specialist (CNS) and consider psychology referral. Check for low mood/anxiety. Post-op: Standard post-mastectomy care β drain management, wound assessment, arm mobility exercises, lymphoedema prevention, PICC/drain education. Discharge pack including Breast Cancer Now support. Follow-up: 2-week wound check, breast reconstruction MDT (if applicable), annual gynaecological surveillance until oophorectomy, psychological review at 6 months."},
],
"LDLR": [
{"title": "π¨ Young Man with Chest Pain", "scenario": "Jamie, 34, presents to A&E with exertional chest pain. His total cholesterol is 9.4 mmol/L. His father had a fatal MI at 42. An LDLR variant is identified β Familial Hypercholesterolaemia confirmed.", "questions": ["What is the significance of the family history?", "What immediate and long-term management does Jamie need?", "Who should be offered cascade testing?"], "model_answer": "Family history: Premature CVD (father MI at 42) is a major FH red flag. Autosomal dominant inheritance β 50% risk to first-degree relatives. Jamie's siblings, children need testing. Immediate: Refer to lipidologist/cardiologist. High-intensity statin (atorvastatin 80mg). Consider PCSK9 inhibitor if LDL target not achieved. Long-term: Lifestyle (diet, exercise, no smoking), annual lipid profile, cardiovascular event surveillance, stress test/CT coronary angiogram. Cascade testing: Parents, siblings, children β₯10 years β contact via GP or FH cascade testing service."},
{"title": "π§ Child with FH on School Screening", "scenario": "A school health nurse identifies Anya, 12, through a FH cascade screening programme. Her LDL is 6.1 mmol/L. Her mother has confirmed FH.", "questions": ["What lifestyle advice is appropriate for a 12-year-old?", "Is statin therapy appropriate at this age?", "What psychological support should Anya receive?"], "model_answer": "Lifestyle: Heart-healthy diet (reduce saturated fat, increase fruit/vegetables/fibre), regular physical activity β₯60 min/day, avoid smoking. Statins: NICE CG71 recommends considering statin therapy from age 10 in children with FH if LDL remains high after dietary intervention. Low-dose atorvastatin/rosuvastatin with growth and development monitoring. Psychology: Normalise ('this doesn't define you'), age-appropriate explanation of FH, involve school nurse, reassure Anya that treatment significantly reduces future risk. Family support groups (Heart UK FH children's resources)."},
],
"CFTR": [
{"title": "π¬οΈ CF Exacerbation on the Respiratory Ward", "scenario": "Callum, 19, with CF (F508del homozygous) on Kaftrio, is admitted with increased sputum, reduced FEV1, and temperature 38.2Β°C. His usual FEV1 is 72% predicted; today it is 58%.", "questions": ["What is a pulmonary exacerbation of CF?", "What nursing care does Callum need?", "How will you assess his response to treatment?"], "model_answer": "Exacerbation: New/worsened respiratory symptoms + β₯10% decline in FEV1 requiring IV antibiotics. Nursing care: IV antibiotics as per sensitivities (Pseudomonas often requires Tobramycin + Piperacillin-Tazobactam), twice-daily physiotherapy (ACBT), Kaftrio continuation, high-calorie diet + dietitian, nebulised DNase, Oβ to maintain SpOβ β₯94%, IV fluids. Response monitoring: Daily spirometry (FEV1), symptom assessment, sputum colour/volume, temperature, CRP trend. Target: Return to baseline FEV1. Duration: Typically 14 days IV antibiotics."},
{"title": "π½οΈ CF-Related Malnutrition", "scenario": "Libby, 22, with CF, has a BMI of 17.5. She reports abdominal cramping after eating and poor appetite. MUST score = 2 (high risk).", "questions": ["What is the relationship between CF and nutrition?", "What nursing interventions are appropriate?", "How do you document and escalate?"], "model_answer": "CF and nutrition: CFTR dysfunction causes exocrine pancreatic insufficiency β malabsorption of fat and fat-soluble vitamins (A, D, E, K). High caloric need (110β120% of normal) due to increased energy expenditure. Interventions: Pancreatic enzyme replacement therapy (PERT β Creon) dose review with dietitian, high-calorie supplements (Calogen, Ensure), nasogastric/gastrostomy feeding if oral intake insufficient, fat-soluble vitamin supplementation. Cramping may indicate DIOS (Distal Intestinal Obstruction Syndrome) β escalate if severe. Documentation: MUST score, fluid balance, weight trend, escalate to dietitian and CF specialist nurse."},
],
"DMD": [
{"title": "π₯ Respiratory Decline in DMD", "scenario": "Tyler, 22, with DMD, is reviewed in clinic. He uses a power wheelchair and NIV at night. FVC has declined from 48% to 31% over 18 months. He is having morning headaches.", "questions": ["What do morning headaches suggest in this context?", "What respiratory assessment should be done?", "What nursing support does Tyler need regarding NIV?"], "model_answer": "Morning headaches: Suggest nocturnal hypoventilation / COβ retention β a sign that NIV settings need reviewing or additional ventilatory support is needed. Assessment: Overnight pulse oximetry, ABG (or transcutaneous COβ), spirometry (FVC sitting and supine β >25% supine drop indicates diaphragm weakness), peak cough flow. NIV support: Review NIV mask fit, compliance data download from machine, troubleshoot leaks, escalate settings review to respiratory physiotherapist and consultant. Advance care planning discussions should be sensitively initiated at this stage."},
{"title": "π Corticosteroid Monitoring in a Boy with DMD", "scenario": "Noah, 8, with DMD is started on deflazacort. His mother asks the school nurse what to watch for.", "questions": ["What are the main side effects to monitor?", "What nutritional advice is needed?", "What should the school nurse communicate to the school?"], "model_answer": "Side effects: Weight gain (cushingoid appearance), growth slowing, mood/behaviour changes (especially withdrawal), osteoporosis risk (fragility fractures), cataract, hypertension, blood glucose changes. Monitoring: Monthly weight and BP, annual DEXA scan, eye review. Nutrition: Limit excess calories, avoid high-sodium and high-sugar foods, calcium and Vitamin D supplementation (bone protection). School: Fatigue management (rest periods), PE modification, fall risk (fragility fractures), emotional support, emergency steroid card (sick-day rules β never stop suddenly). Contact school SENCO."},
],
"CYP2C9": [
{"title": "π Warfarin Initiation in AF", "scenario": "Margaret, 74, is started on Warfarin for paroxysmal AF. CYP2C9 *1/*3 intermediate metaboliser. Her INR on day 5 is 4.8.", "questions": ["What is the clinical concern?", "What nursing actions are required?", "How does CYP2C9 *1/*3 status explain this INR?"], "model_answer": "Concern: Supratherapeutic INR (>4) β significantly elevated bleeding risk. Nursing actions: Hold next Warfarin dose, contact prescribing team immediately, assess for bleeding (bruising, haematuria, PR bleeding, headache), check BP. Advise patient to avoid injury, fall prevention. Consider Vitamin K (oral 1β2mg for INR 5β9 without bleeding per local protocol). CYP2C9 *1/*3 explanation: *3 allele reduces CYP2C9 metabolism of Warfarin's S-enantiomer (more potent) β drug accumulates faster than in a normal metaboliser β lower dose needed, more frequent monitoring in first weeks."},
{"title": "πΏ Herbal Supplement Interaction", "scenario": "David, 68, on Warfarin for DVT, tells the nurse he has started taking St John's Wort from a health food shop to help his mood.", "questions": ["What is your immediate concern?", "How do you explain this to David?", "What documentation and escalation is needed?"], "model_answer": "Concern: St John's Wort is a potent CYP enzyme inducer β it increases Warfarin metabolism β INR will FALL β thromboembolic risk. This is a serious drug-herb interaction. Explanation: 'St John's Wort affects the way your body processes Warfarin β it will make your blood clot more than it should, which could cause your DVT to come back or get worse. You need to stop taking it and we need to check your INR today.' Escalation: Inform prescriber, urgent INR check, document in notes, advise patient never to start supplements/herbal remedies without checking with pharmacist or anticoagulation team first. Report on incident system if INR had significantly dropped."},
],
"CYP2C19": [
{"title": "β€οΈ Post-PCI: Clopidogrel Non-Response", "scenario": "Chen, 61, has just had a drug-eluting stent for STEMI. He is prescribed Aspirin + Clopidogrel (DAPT). CYP2C19 *2/*2 genotype is found on post-PCI genomic panel.", "questions": ["What is the clinical risk for Chen?", "What should be escalated to the cardiology team?", "What patient education should Chen receive?"], "model_answer": "Risk: CYP2C19 *2/*2 = poor metaboliser β Clopidogrel activation severely impaired β inadequate platelet inhibition β stent thrombosis/MI risk. Escalation: Contact cardiology/prescriber immediately β Clopidogrel should be switched to Ticagrelor or Prasugrel (not CYP2C19-dependent, more reliable antiplatelet effect). Education: Explain why medication change is needed ('your body can't convert this tablet into its active form'), reinforce never stopping antiplatelet therapy without medical advice (risk of stent thrombosis), carry a cardiac alert card."},
{"title": "π H. Pylori Eradication Failure", "scenario": "Mei, 45, has failed two courses of H. pylori triple therapy (PPI + Amoxicillin + Clarithromycin). CYP2C19 *17/*17 ultra-rapid metaboliser is identified.", "questions": ["How does CYP2C19 *17 affect PPI therapy?", "What alternative eradication regimens exist?", "What is the nursing role in medication adherence?"], "model_answer": "CYP2C19 *17: Ultra-rapid metaboliser clears PPIs very quickly β reduced acid suppression β sub-optimal environment for H. pylori eradication (bacteria requires pH >6 for antibiotic activity). Alternative: High-dose PPI (double dose), Vonoprazan (acid blocker not CYP2C19 dependent), quadruple therapy (bismuth-containing). Nursing role: Assess adherence (ask non-judgementally), ensure correct timing (30 min before meals), explain importance of completing full course, discuss side effects (Clarithromycin taste changes), follow up at 4 weeks with urea breath test or stool antigen test."},
],
"CYP2D6": [
{"title": "π€± Post-partum Codeine Safety", "scenario": "Niamh, 28, is prescribed Codeine 30mg QDS for perineal pain post-forceps delivery. She is breastfeeding. She tells the midwife she is a 'fast metaboliser' from a previous genomic test.", "questions": ["What are the risks for Niamh's baby?", "What should the midwife do?", "What alternative analgesia is appropriate?"], "model_answer": "Risk: CYP2D6 ultra-rapid metaboliser β rapid conversion of Codeine to Morphine β high morphine concentrations in breast milk β neonatal CNS and respiratory depression. MHRA contraindicated Codeine in breastfeeding (all women) due to this risk. Action: STOP Codeine immediately, inform obstetric team and prescriber, monitor neonate for sedation/respiratory depression (BRUE β Brief Resolved Unexplained Event). Alternative: Paracetamol (safe in breastfeeding), ibuprofen (short-term, after 12 hours post-delivery), topical cooling/perineal care. Escalate to clinical pharmacist for individual review."},
{"title": "π§ Antidepressant and Opioid Interaction", "scenario": "Kevin, 52, on paroxetine (SSRI) for depression, is admitted with poorly controlled chronic back pain. He is prescribed Codeine 60mg QDS. Despite this, he reports no pain relief.", "questions": ["Explain why Codeine is ineffective for Kevin.", "What is the pharmacogenomic mechanism?", "What should be prescribed instead?"], "model_answer": "Why ineffective: Paroxetine is a potent CYP2D6 inhibitor. Even if Kevin is a normal CYP2D6 metaboliser by genotype, paroxetine turns him into a phenotypic poor metaboliser β Codeine cannot be converted to active Morphine β no analgesia. Mechanism: CYP2D6 converts Codeine (prodrug) to Morphine (active). Paroxetine blocks CYP2D6 β conversion fails β only Codeine and norcodeine (weak) accumulate. Alternative: Switch to an opioid not requiring CYP2D6 activation β Morphine (direct agonist), Oxycodone (partial CYP2D6 substrate but primarily 3A4), or Fentanyl. Refer to clinical pharmacist."},
],
"SLCO1B1": [
{"title": "πͺ Statin Myopathy in a Heart Failure Patient", "scenario": "George, 67, with heart failure on Simvastatin 40mg, Bisoprolol, and Amiodarone, presents with severe proximal muscle weakness. CK is 8,200 U/L. SLCO1B1*5/*5 is identified.", "questions": ["What is the diagnosis?", "What is the IMMEDIATE nursing action?", "Explain the pharmacogenomic interaction."], "model_answer": "Diagnosis: Statin-induced myopathy (CK >10Γ ULN) β risk of rhabdomyolysis. IMMEDIATE action: STOP Simvastatin, escalate to medical team, IV hydration to protect kidneys (myoglobin nephrotoxic), monitor renal function and urine output, daily CK until normalising. Interaction: SLCO1B1*5 reduces hepatic uptake of Simvastatin β elevated plasma levels. Amiodarone additionally inhibits CYP3A4 (Simvastatin metabolism) and SLCO1B1 β double toxicity risk. Long-term: Switch to Rosuvastatin (less SLCO1B1-dependent) at low dose after CK normalises. Consider Ezetimibe or PCSK9i as adjuncts."},
{"title": "π¬ Pre-Prescription Genomic Screening", "scenario": "The pharmacist in your ward refers a new patient, Aditya, 58, to you before Simvastatin 40mg is started. His genomic report shows SLCO1B1*1/*5 (heterozygous β intermediate risk).", "questions": ["What does *1/*5 heterozygous mean for Aditya's statin risk?", "What monitoring plan would you implement?", "What patient education should Aditya receive?"], "model_answer": "Heterozygous *1/*5: Intermediate SLCO1B1 function β lower statin exposure than *5/*5, but higher than *1/*1. Risk of myopathy is intermediate. Monitoring: Baseline CK before starting, repeat at 3 months, then 6-monthly. Ask about muscle symptoms at every contact. Consider lower dose (20mg) or alternative statin (Pravastatin/Rosuvastatin β less SLCO1B1-dependent). Education: Report unexplained muscle pain, weakness, or dark urine immediately. Avoid grapefruit juice (CYP3A4 inhibitor). Do not stop medication without medical advice. Carry statin card."},
],
"TPMT": [
{"title": "π©Έ Bone Marrow Suppression on Azathioprine", "scenario": "Fatima, 34, with Crohn's disease, is started on Azathioprine 2mg/kg. TPMT testing was not done. At week 3, she presents with fever, bruising, and fatigue. FBC shows WBC 1.2, neutrophils 0.4, platelets 68.", "questions": ["What has happened?", "What is the IMMEDIATE nursing/medical response?", "How could this have been prevented?"], "model_answer": "What happened: TPMT deficiency (likely) β thioguanine nucleotide accumulation β severe myelosuppression. Neutropenic sepsis. IMMEDIATE: STOP Azathioprine, isolate (reverse barrier if possible), urgent FBC/CRP/cultures, Sepsis 6 within 1 hour (high-flow Oβ, IV access, blood cultures, IV antibiotics, IV fluids, monitor urine output), urgent haematology review, G-CSF consideration. Prevention: NICE NG129 mandates TPMT testing BEFORE starting thiopurines. This is a serious clinical incident β duty of candour, incident reporting, root cause analysis. TPMT *3A/*3A frequency ~1:300 β routine testing prevents this."},
{"title": "π TPMT Intermediate Activity Dose Adjustment", "scenario": "Lena, 28, with autoimmune hepatitis, has TPMT activity 9 nmol/hr/mL (intermediate β heterozygous *1/*3A). She is to start Azathioprine.", "questions": ["What dose adjustment is appropriate?", "What monitoring is needed?", "What should Lena be told?"], "model_answer": "Dose adjustment: Intermediate TPMT β start at 50% of standard dose (1mg/kg rather than 2mg/kg) per CPIC guidelines. Monitor response and tolerability before increasing. Monitoring: FBC weekly for first 4 weeks, then monthly for 3 months, then 3-monthly. LFTs 3-monthly (azathioprine hepatotoxicity). TPMT activity or genotype guides further dose titration. Education: Report bruising, bleeding, persistent fever, mouth ulcers, unexplained fatigue immediately. Do not take with allopurinol (XANTHINE OXIDASE INHIBITOR β severe azathioprine toxicity β unless dose reduced by 75%). Avoid live vaccines. Sun protection (azathioprine increases skin cancer risk)."},
],
"DPYD": [
{"title": "π¨ Fluoropyrimidine Toxicity Emergency", "scenario": "Grace, 61, starts Capecitabine for stage III colorectal cancer. On Day 7, she calls the oncology helpline reporting profuse diarrhoea (8 times overnight), severe mouth ulcers preventing eating, and blistering of her palms. DPYD *2A genotype was NOT checked pre-treatment.", "questions": ["What is happening to Grace?", "What are your immediate actions?", "What long-term lesson does this case illustrate?"], "model_answer": "What is happening: Severe fluoropyrimidine toxicity β likely DPYD *2A variant causing drug accumulation β mucositis, diarrhoea, hand-foot syndrome. Immediate actions: Advise Grace to STOP Capecitabine immediately and attend A&E. Assess severity (diarrhoea >6 episodes = Grade 3+ β hospitalise). IV fluids, anti-diarrhoeals, oral care, wound care for hands. Uridine triacetate antidote (if available within 96 hours of last dose). Oncology consultant and pharmacist review. Incident report β DPYD test should have been done. Long-term: NHS England mandate (2020) requires DPYD genotyping before all fluoropyrimidine chemotherapy. This was a preventable serious adverse event. Incident must be documented and reported."},
{"title": "π©ββοΈ Pre-Chemotherapy Genomic Assessment", "scenario": "You are a chemotherapy nurse admitting Vera, 55, for her first cycle of FOLFOX (Oxaliplatin + 5-Fluorouracil) for colon cancer. You notice DPYD genotype is not documented in her notes.", "questions": ["What should you do before administering chemotherapy?", "What are the consequences of proceeding without DPYD testing?", "How do you explain this delay to Vera?"], "model_answer": "Action: DO NOT administer 5-FU. Contact oncology consultant and pharmacist immediately. DPYD testing should be completed and result reviewed before proceeding. This is an NHS England mandatory requirement. Consequences: ~1β3% of patients are DPYD *2A carriers; proceeding risks severe/fatal toxicity (mucositis, neutropenic sepsis, respiratory failure). Unadjusted dosing in carriers = serious medication error. Explanation to Vera: 'Before we start your chemotherapy, we need to do a quick blood test to check how your body processes this particular drug. It only takes a few days. This is a standard safety check we do for everyone β it helps us give you exactly the right dose.' Offer written information. Rebooking within 5β7 days."},
{"title": "π Health Equity β The Missing Variant (NHS RHO 2024)", "scenario": "Adaeze, 48, a Nigerian-British woman, is starting Capecitabine for breast cancer at your oncology unit. The standard DPYD panel (4 European-ancestry variants) comes back negative β 'no variants detected'. Her oncologist proceeds with full-dose Capecitabine. By Day 10, Adaeze is admitted with Grade 4 diarrhoea, severe mucositis, and neutropenic sepsis.", "questions": ["Why might the negative DPYD result have been misleading?", "What does the NHS RHO July 2024 report say about this scenario?", "What should nurses advocate for to prevent this happening again?"], "model_answer": "Why misleading: The current UK DPYD panel tests only 4 variants identified in White European populations. The c.557A>G variant β enriched in African ancestry β is NOT included. Adaeze may carry c.557A>G or other non-European DPYD variants causing DPD deficiency that were entirely missed. A 'negative' result on a panel that does not cover her ancestry does not mean she has normal DPD activity. NHS RHO 2024: The Wolfson Centre/University of Liverpool systematic review screened 8,132 articles, reviewed 32 studies, and identified c.557A>G as the strongest evidence-based candidate for panel expansion in African ancestry patients. The NHS RHO has formally recommended its inclusion in the National Genomic Test Directory (under review at time of writing). Nursing advocacy: Nurses should know the limitations of current testing. For patients of African, South Asian, East Asian or other non-European heritage β raise with oncology team whether extended DPYD testing or DPD enzyme phenotyping (blood test) is available. Document ancestry in notes. Challenge assumptions that 'negative = safe'. Incident report and Duty of Candour apply. Reference: NHS Race and Health Observatory. Genetic Testing to Reduce Side Effects from Chemotherapy Drugs in the NHS. July 2024."},
],
"VKORC1": [
{"title": "π Warfarin Sensitivity in an East Asian Patient", "scenario": "Li Wei, 70, originally from Hong Kong, is started on Warfarin for AF. Her initial Warfarin dose (3mg) results in an INR of 6.2 on Day 6. VKORC1 -1639AA and CYP2C9 *1/*1 are identified.", "questions": ["Why is Li Wei so sensitive to Warfarin?", "What nursing actions are required?", "What dose should the team consider?"], "model_answer": "Sensitivity: VKORC1 -1639AA is present in ~92% of East Asians, dramatically reducing VKORC1 enzyme β very little inhibition needed to achieve anticoagulation β extremely high sensitivity. CYP2C9 *1/*1 (normal metabolism) is not the issue here β it's the VKORC1. Actions: Hold Warfarin, inform prescribing team, check for bleeding, monitor INR daily until stable. Starting dose in VKORC1 AA patients typically 1β2mg. IWPC dosing algorithm incorporating VKORC1 + CYP2C9 + patient factors gives accurate dose prediction. Alternatives: DOAC (apixaban, rivaroxaban) are not affected by VKORC1/CYP2C9 and may be more appropriate β discuss with prescriber."},
{"title": "π Dosing Algorithm in an Anticoagulation Clinic", "scenario": "As an anticoagulation clinic nurse, you are seeing William, 63, whose Warfarin has been unstable for 6 months (INR frequently >4 or <2). A genomic panel shows CYP2C9 *1/*3 and VKORC1 -1639AG.", "questions": ["What does the combined genomic result mean?", "How might a dosing algorithm help?", "What non-genomic factors also affect INR stability?"], "model_answer": "Combined result: *1/*3 reduces CYP2C9 metabolism moderately (~50% activity); -1639AG (heterozygous) means intermediate VKORC1 sensitivity. Together these suggest William needs a below-average dose. Dosing algorithm: IWPC or WarfarinDosing.org algorithms use genotype + age + weight + indication + race β predict maintenance dose more accurately than fixed standard doses. Non-genomic factors: Diet (vitamin K in green vegetables), alcohol, intercurrent illness, medications (antibiotics, antifungals, NSAIDs), adherence, liver function. INR instability should be investigated holistically β genetic profiling is one piece of the puzzle."},
],
"HLA-B": [
{"title": "π Pre-HIV Treatment Screening", "scenario": "Kofi, 34, newly diagnosed with HIV, is reviewed by the HIV nurse specialist. The proposed regimen includes Abacavir/Lamivudine/Dolutegravir (Triumeq). Kofi asks: 'Why do I need a blood test before I can start?'", "questions": ["How do you explain HLA-B*57:01 testing to Kofi?", "What is Abacavir Hypersensitivity Syndrome?", "What happens if Kofi is HLA-B*57:01 positive?"], "model_answer": "Explanation: 'Before you start one of the medicines called Abacavir, we check a gene that affects how your immune system responds to it. In a small number of people (about 5-8%), the body reacts badly to Abacavir β causing a severe reaction. This test tells us if you're one of those people, so we can choose the safest treatment for you.' HSR: Fever, rash, fatigue, GI symptoms, respiratory symptoms β typically within first 6 weeks. Re-challenge after stopping is FATAL. If positive: Abacavir is absolutely contraindicated for life. Triumeq switched to Tenofovir-based regimen (e.g. Bictegravir/Emtricitabine/TAF). Document allergy in records and patient-held alert card."},
{"title": "π§ New Carbamazepine Prescription in a Southeast Asian Patient", "scenario": "Mei-Lin, 28, born in Malaysia, is seen in neurology outpatients. She is to start Carbamazepine for focal epilepsy. You notice no HLA-B*15:02 test has been requested.", "questions": ["What is your concern?", "What action should you take before the prescription is dispensed?", "How do you explain this to Mei-Lin?"], "model_answer": "Concern: Mei-Lin is from Southeast Asia (Malaysian) β HLA-B*15:02 prevalence ~10%. This allele is associated with Stevens-Johnson Syndrome/Toxic Epidermal Necrolysis (SJS/TEN) β a life-threatening skin condition β when Carbamazepine is taken. NICE and MHRA recommend HLA-B*15:02 screening in relevant ethnic groups before Carbamazepine. Action: Flag to neurologist and pharmacist BEFORE prescription is dispensed. Delay start until result available (usually 5β10 days). If positive β Carbamazepine contraindicated; alternatives (Lamotrigine β noting *also* SJS risk, Levetiracetam) should be considered. Explanation: 'There is a gene test we'd like to do first because, in some people from your part of the world, this medicine can occasionally cause a serious skin reaction. The test only takes a few days and helps us confirm it's safe for you.'"},
],
}
# ββ Population Frequencies (gnomAD v4 β approximate allele frequencies) ββ
POPULATION_FREQS = {
"INS": {"snp":"rs5219","European (EUR)":"33%","African (AFR)":"41%","South Asian (SAS)":"38%","East Asian (EAS)":"24%","Latino (AMR)":"35%","note":"KCNJ11 E23K variant near INS β common, modest T2DM risk"},
"SCN9A": {"snp":"rs6746030","European (EUR)":"11%","African (AFR)":"4%","South Asian (SAS)":"9%","East Asian (EAS)":"5%","Latino (AMR)":"8%","note":"Pain sensitivity modifier β higher frequency in European populations"},
"MMP9": {"snp":"rs3918242","European (EUR)":"19%","African (AFR)":"28%","South Asian (SAS)":"22%","East Asian (EAS)":"12%","Latino (AMR)":"21%","note":"MMP9 promoter variant β higher in African populations"},
"HBB": {"snp":"rs334 (HbS)","European (EUR)":"<1%","African (AFR)":"7%","South Asian (SAS)":"0.3%","East Asian (EAS)":"<0.1%","Latino (AMR)":"1%","note":"HbS allele highest in malaria-endemic regions β heterozygotes are protected from severe malaria (sickle cell trait)"},
"BRCA1": {"snp":"rs28897672","European (EUR)":"<0.1%","African (AFR)":"<0.1%","South Asian (SAS)":"<0.1%","East Asian (EAS)":"<0.1%","Latino (AMR)":"<0.1%","note":"Rare pathogenic variant β population frequency low but clinical significance is very high"},
"LDLR": {"snp":"rs28942080","European (EUR)":"0.2%","African (AFR)":"0.1%","South Asian (SAS)":"0.3%","East Asian (EAS)":"0.1%","Latino (AMR)":"0.2%","note":"FH is pan-ethnic β different LDLR founder variants exist in different populations"},
"CFTR": {"snp":"rs113993960 (F508del)","European (EUR)":"2.1%","African (AFR)":"0.3%","South Asian (SAS)":"0.2%","East Asian (EAS)":"<0.1%","Latino (AMR)":"0.8%","note":"F508del is predominantly Northern European β CF much rarer in African and East Asian populations"},
"DMD": {"snp":"rs137852596","European (EUR)":"<0.1%","African (AFR)":"<0.1%","South Asian (SAS)":"<0.1%","East Asian (EAS)":"<0.1%","Latino (AMR)":"<0.1%","note":"DMD affects ~1 in 3,500 males globally β de novo mutations account for ~1/3 of cases"},
"CYP2C9": {"snp":"rs1799853 (*2)","European (EUR)":"12%","African (AFR)":"1%","South Asian (SAS)":"6%","East Asian (EAS)":"0.5%","Latino (AMR)":"6%","note":"CYP2C9*2 predominant in European populations β explains higher Warfarin sensitivity in some patients"},
"CYP2C19":{"snp":"rs4244285 (*2)","European (EUR)":"15%","African (AFR)":"17%","South Asian (SAS)":"25%","East Asian (EAS)":"30%","Latino (AMR)":"11%","note":"*2 (poor metaboliser) allele most common in East/South Asians β affects Clopidogrel response disparities across populations"},
"CYP2D6": {"snp":"rs3892097 (*4)","European (EUR)":"21%","African (AFR)":"5%","South Asian (SAS)":"8%","East Asian (EAS)":"1%","Latino (AMR)":"9%","note":"CYP2D6*4 (poor metaboliser) predominantly European β explains Codeine toxicity variability between populations"},
"SLCO1B1":{"snp":"rs4149056 (*5)","European (EUR)":"15%","African (AFR)":"2%","South Asian (SAS)":"10%","East Asian (EAS)":"12%","Latino (AMR)":"9%","note":"SLCO1B1*5 myopathy risk allele present across all populations β European frequency is highest"},
"TPMT": {"snp":"rs1800462 (*2)","European (EUR)":"3%","African (AFR)":"2%","South Asian (SAS)":"2%","East Asian (EAS)":"1%","Latino (AMR)":"2%","note":"TPMT deficiency (~1:300 all populations) β TPMT*3A/*3C combinations vary by ethnicity"},
"DPYD": {"snp":"rs3918290 (*2A) + c.557A>G","European (EUR)":"1% / ~0.1%","African (AFR)":"0.1% / ~1β2%","South Asian (SAS)":"0.3% / ~0.2%","East Asian (EAS)":"0.1% / <0.1%","Latino (AMR)":"0.3% / ~0.1%","note":"Format: *2A frequency / c.557A>G frequency. c.557A>G is enriched ~10β20Γ in African ancestry vs European β yet is NOT in the current UK testing panel. NHS RHO (July 2024) recommends its inclusion. A negative standard DPYD result in a Black/African heritage patient does NOT rule out DPD deficiency."},
"VKORC1": {"snp":"rs9923231 (-1639A)","European (EUR)":"37%","African (AFR)":"8%","South Asian (SAS)":"42%","East Asian (EAS)":"92%","Latino (AMR)":"45%","note":"VKORC1 -1639A dramatically higher in East Asians β explains why East Asian patients need ~3Γ lower Warfarin doses than African Americans"},
"HLA-B": {"snp":"HLA-B*57:01","European (EUR)":"5β8%","African (AFR)":"4β8%","South Asian (SAS)":"4β7%","East Asian (EAS)":"1β2%","Latino (AMR)":"3β5%","note":"HLA-B*15:02 (Carbamazepine SJS risk): Han Chinese ~8%, Thai ~8%, European <0.1% β highlights importance of ethnicity-aware prescribing"},
}
# ββ Genomics Glossary βββββββββββββββββββββββββββββββββββββββββββββββββββββ
GLOSSARY = [
("Allele", "One version of a gene at a given position (locus). Humans typically have two alleles per gene (one from each parent)."),
("c.557A>G (DPYD)", "A DPYD variant enriched in individuals of African ancestry that reduces DPD enzyme activity β increasing fluoropyrimidine toxicity risk. NOT currently in the standard UK DPYD testing panel (which covers 4 European-ancestry variants). The NHS Race and Health Observatory (July 2024) recommends its inclusion in the National Genomic Test Directory. A key example of health inequity in pharmacogenomics."),
("Autosomal Dominant (AD)", "A condition where one copy of a pathogenic variant (heterozygous) is sufficient to cause disease. Affects males and females equally; 50% chance of passing to children."),
("Autosomal Recessive (AR)", "A condition requiring two copies of a pathogenic variant to cause disease. Carriers (one copy) are usually unaffected. 25% risk of affected child if both parents are carriers."),
("Cascade Testing", "Systematic testing of family members after an index case is identified. Recommended for FH, BRCA1/2, HNPCC, and other high-risk conditions."),
("ClinVar", "A public NCBI database of genetic variants and their clinical significance. Variants are classified as pathogenic, likely pathogenic, VUS, likely benign, or benign."),
("Copy Number Variant (CNV)", "A genomic segment present in more or fewer copies than normal (e.g. DMD exon deletions/duplications). Can be detected by MLPA or whole genome sequencing."),
("CPIC", "Clinical Pharmacogenomics Implementation Consortium β provides evidence-based prescribing guidelines for pharmacogenomics (e.g. CYP2D6+Codeine, CYP2C9+Warfarin)."),
("CYP Enzymes", "Cytochrome P450 enzymes (CYP2D6, CYP2C9, CYP2C19 etc.) responsible for metabolising most drugs. Variants alter drug levels and response."),
("de novo Variant", "A new genetic variant that is not inherited from either parent β arises spontaneously in sperm, egg, or early development. Common in DMD, autism spectrum conditions."),
("Drug-Gene Interaction (DGI)", "When a genetic variant alters drug efficacy or safety. Studied by pharmacogenomics."),
("Epigenetics", "Heritable changes in gene expression NOT involving DNA sequence changes β e.g. methylation. Important in cancer and development."),
("Exome", "The ~1β2% of the genome that codes for proteins (all exons). Whole Exome Sequencing (WES) captures protein-coding variants."),
("Genotype", "An individual's specific DNA sequence at a particular locus. E.g. CYP2C9 *1/*3 genotype."),
("gnomAD", "Genome Aggregation Database β the largest public catalogue of human genetic variation across >730,000 individuals. Used to assess variant frequency."),
("HGVS Notation", "Human Genome Variation Society standardised nomenclature for describing variants: e.g. NM_000518.5:c.20A>T (HBB sickle cell variant)."),
("HLA (Human Leukocyte Antigen)", "Immune system proteins encoded by the MHC region on chromosome 6. Specific HLA alleles (e.g. B*57:01, B*15:02) cause drug hypersensitivity reactions."),
("Heterozygous", "Carrying two different alleles at a locus β e.g. one normal and one pathogenic copy. In AD conditions, this is sufficient to cause disease."),
("Homozygous", "Carrying identical alleles at a locus β e.g. two pathogenic copies. In AR conditions, this causes disease."),
("HRAS / Oncogene", "Genes that normally promote cell growth. Gain-of-function mutations β uncontrolled cell proliferation β cancer."),
("Incidental Finding", "A genetic result discovered during testing for another purpose β e.g. a BRCA1 variant found during whole genome sequencing for cancer. Requires careful counselling."),
("Inheritance Pattern", "How a condition is passed through families: autosomal dominant (AD), autosomal recessive (AR), X-linked dominant (XLD), X-linked recessive (XLR), mitochondrial, or complex/multifactorial."),
("Loss-of-Function (LoF) Variant", "A variant that reduces or abolishes the normal function of a gene product. Examples: BRCA1 (tumour suppressor lost), CFTR (chloride channel non-functional)."),
("Mainstreaming Genomics", "The integration of genomic testing into mainstream clinical specialties (oncology, cardiology, neurology) rather than only in specialist genetics services β now standard in NHS England."),
("Metaboliser Status", "In pharmacogenomics: Poor Metaboliser (PM), Intermediate (IM), Normal/Extensive (NM/EM), Rapid (RM), or Ultra-Rapid (UM), based on functional CYP enzyme activity."),
("Missense Variant", "A single nucleotide change that results in a different amino acid being incorporated into the protein. E.g. HBB GluβVal (sickle cell)."),
("NHS Genomic Medicine Service (GMS)", "The NHS England infrastructure for delivering genomic medicine β including the 7 Genomic Laboratory Hubs and national whole genome sequencing (100,000 Genomes Project)."),
("Nonsense Variant", "A variant that creates a premature STOP codon, causing translation to terminate early β usually resulting in a non-functional truncated protein."),
("OMIM", "Online Mendelian Inheritance in Man β comprehensive database of human genes and genetic disorders. Every gene and condition has a unique OMIM number."),
("Pathogenic Variant", "A variant that is known to cause or increase risk of a disease. Distinguished from VUS (variant of uncertain significance) and benign variants."),
("Penetrance", "The proportion of people with a pathogenic variant who develop the condition. High-penetrance: BRCA1 (~70% breast cancer risk). Low-penetrance: most common variants have partial penetrance."),
("Pharmacogenomics (PGx)", "The study of how genetic variants affect drug response β including metabolism, efficacy, and adverse reactions. Core to precision/personalised medicine."),
("PharmGKB", "Pharmacogenomics Knowledge Base β curated database of drug-gene interactions, clinical annotations, and CPIC guidelines."),
("Phenotype", "The observable characteristics of an individual β including clinical features, lab values, and response to drugs β resulting from genotype + environment interactions."),
("Polygenic Risk Score (PRS)", "A composite score aggregating the effects of many small-effect variants to estimate disease risk. Used for conditions like Type 2 Diabetes, CAD, and breast cancer."),
("Precision Medicine", "Tailoring medical treatment to the individual characteristics of each patient, including their genomic profile. Also called personalised medicine."),
("Prodrug", "A pharmacologically inactive compound converted to its active form by enzymes (e.g. CYP2D6 converts Codeine β Morphine; CYP2C19 converts Clopidogrel β active thiol metabolite)."),
("rsID (Reference SNP ID)", "A unique identifier assigned to each SNP in NCBI's dbSNP database (e.g. rs334 = HBB sickle cell variant; rs9923231 = VKORC1 Warfarin sensitivity variant)."),
("SNP (Single Nucleotide Polymorphism)", "A variation at a single nucleotide in the genome occurring in β₯1% of the population. The most common type of genetic variant."),
("Splice Site Variant", "A variant at the boundary between an exon and intron that disrupts normal RNA splicing β often causing exon skipping or intron retention."),
("Tumour Suppressor Gene", "A gene that normally prevents uncontrolled cell growth. Inactivating variants (e.g. in BRCA1, TP53, APC) increase cancer risk."),
("UK Biobank", "A large-scale biomedical database of ~500,000 UK participants with genetic and health data β enabling research into genomic determinants of disease."),
("Variant of Uncertain Significance (VUS)", "A genetic variant whose clinical significance is unknown at the time of reporting. May be reclassified as pathogenic or benign with future evidence. Causes significant anxiety for patients."),
("Whole Genome Sequencing (WGS)", "Sequencing of the entire DNA genome (~3 billion base pairs). NHS England offers WGS via the NHS Genomic Medicine Service for rare disease and cancer."),
("X-linked Recessive", "Condition where the gene is on the X chromosome. Males (XY, one copy) are affected if they carry the variant. Females are usually carriers. Examples: DMD, Haemophilia A."),
]
# ---------------------------------------------------------------------------
# Demo chart helpers
# ---------------------------------------------------------------------------
def _rna(sym, inten):
x = np.linspace(0,100,500); rng=np.random.default_rng(42)
ref = np.exp(-((x-50)**2)/200)+rng.normal(0,.02,500)
alt = ref*(1-inten*.65)+np.random.default_rng(7).normal(0,.02,500)
fig,ax = plt.subplots(figsize=(10,3))
ax.fill_between(x,ref,alpha=.45,color="#4CAF50",label="Reference")
ax.fill_between(x,alt,alpha=.45,color="#ff4b4b",label="Alternate")
ax.axvline(50,color="orange",linestyle="--",alpha=.7,label="Variant site")
ax.set_title(f"{sym} β RNA Expression (demo)",fontweight="bold"); ax.legend(fontsize=9)
for s in ["top","right"]: ax.spines[s].set_visible(False)
ax.grid(True,alpha=.25); ax.set_facecolor("white"); fig.patch.set_facecolor("white"); fig.tight_layout()
return fig
def _splice(sym, inten):
x = np.linspace(0,100,500); fig,ax = plt.subplots(figsize=(10,3))
for p in [150,350]:
ax.bar(x[p:p+10],[.9]*10,width=.5,alpha=.55,color="#4CAF50",label="REF" if p==150 else "")
ax.bar(x[p:p+10],[.9*(1-inten)]*10,width=.3,alpha=.8,color="#ff4b4b",label="ALT" if p==150 else "")
ax.set_title(f"{sym} β Splice Site Usage (demo)",fontweight="bold"); ax.legend(fontsize=9)
for s in ["top","right"]: ax.spines[s].set_visible(False)
ax.grid(True,alpha=.25); ax.set_facecolor("white"); fig.patch.set_facecolor("white"); fig.tight_layout()
return fig
def _chromatin(sym, inten):
x = np.linspace(0,100,500); rng=np.random.default_rng(99)
ref = np.abs(rng.normal(0,.3,500)); ref[200:220]=1.4; ref[280:300]=1.1
alt = ref*(1-inten*.4)
fig,ax = plt.subplots(figsize=(10,3))
ax.fill_between(x,ref,alpha=.45,color="#805ad5",label="REF"); ax.fill_between(x,alt,alpha=.45,color="#dd6b20",label="ALT")
ax.set_title(f"{sym} β Chromatin Accessibility (demo)",fontweight="bold"); ax.legend(fontsize=9)
for s in ["top","right"]: ax.spines[s].set_visible(False)
ax.grid(True,alpha=.25); ax.set_facecolor("white"); fig.patch.set_facecolor("white"); fig.tight_layout()
return fig
def _contact(sym, inten):
rng=np.random.default_rng(13); n=40; base=np.zeros((n,n))
for i in range(n):
for j in range(n): base[i,j]=np.exp(-abs(i-j)*.2)+rng.normal(0,.05)
alt_m = base*(1-inten*.3)
fig,axes = plt.subplots(1,2,figsize=(10,4))
for ax,data,title,cmap in zip(axes,[base,alt_m],["REF contact map","ALT contact map"],["Blues","Reds"]):
im=ax.imshow(data,cmap=cmap,aspect="auto",vmin=0)
ax.set_title(f"{sym} β {title} (demo)",fontweight="bold",fontsize=9)
plt.colorbar(im,ax=ax,fraction=.046,pad=.04)
fig.patch.set_facecolor("white"); fig.tight_layout()
return fig
def build_docx(sym, gi, tissue, vpos, rb, ab, inten, figs):
doc = Document()
doc.add_heading("Virtual Gene Scope v2.0 β Gene Analysis Report", 0)
p = doc.add_paragraph("EDUCATIONAL USE ONLY β not for clinical decision-making.")
p.runs[0].font.color.rgb = RGBColor(0xC5,0x30,0x30)
doc.add_heading("Gene Summary", 1)
t = doc.add_table(rows=1, cols=2); t.style = "Light Shading Accent 1"
t.rows[0].cells[0].text = "Field"; t.rows[0].cells[1].text = "Value"
for field, val in [
("Gene", sym), ("Location", f"{gi['chr']}:{gi['start']:,}β{gi['end']:,}"),
("Key SNP", gi.get("key_snp","N/A")), ("Inheritance", gi.get("inheritance","N/A")),
("Condition", gi.get("condition","N/A")), ("Tissue", tissue),
("Variant", f"{gi['chr']}:{vpos} {rb}>{ab}"), ("Impact", f"{inten:.0%}"),
]:
r = t.add_row().cells; r[0].text = field; r[1].text = val
doc.add_heading("Nursing Reference", 1); doc.add_paragraph(gi.get("nursing_note",""))
doc.add_heading("NMC Standards Alignment", 1)
for p_nmc in gi.get("nmc_platforms",[]): doc.add_paragraph(f"β’ Platform {p_nmc}", style="List Bullet")
if gi.get("pharmgkb"): doc.add_paragraph(f"PharmGKB: {gi['pharmgkb']}")
doc.add_heading("Resources", 1)
for label,url in [("ClinVar",gi.get("clinvar","")),("NICE",gi.get("nice_link","")),("PharmGKB",gi.get("pharmgkb",""))]:
if url: doc.add_paragraph(f"{label}: {url}", style="List Bullet")
if figs:
doc.add_heading("Visualisation Tracks", 1)
for fig in figs:
buf=io.BytesIO(); fig.savefig(buf,format="png",dpi=150,bbox_inches="tight"); buf.seek(0)
w = doc.sections[0].page_width - doc.sections[0].left_margin - doc.sections[0].right_margin
doc.add_picture(buf, width=w); buf.close()
doc.add_paragraph("Built by Clinical Quality Artificial Intelligence β Nurse Citizen Developers\nhttps://github.com/Clinical-Quality-Artifical-Intelligence\nThis tool supports but does not replace clinical judgment.")
out=io.BytesIO(); doc.save(out); return out.getvalue()
# ---------------------------------------------------------------------------
# Tabs
# ---------------------------------------------------------------------------
st.markdown("---")
tab_a, tab_r, tab_nmc, tab_hist, tab_quiz, tab_cases, tab_pop, tab_gloss = st.tabs([
"π Analysis", "π©ββοΈ Nurse Reference", "π NMC Alignment", "π Session History",
"π§ Gene Quiz", "π₯ Clinical Cases", "π Population Data", "π Glossary",
])
with tab_a:
col_s, col_t = st.columns([1,2])
with col_s:
st.subheader("π Summary")
st.markdown(f"""{gene_sym}
Mode: {mode}
Tissue: {tissue}
Variant: {gi['chr']}:{vpos} {ref_b}>{alt_b}
Impact: {intensity:.0%}
Condition: {gi.get('condition','N/A')}
""", unsafe_allow_html=True)
if gi.get("category") == "pgx":
drug = gi.get("drug","Unknown")
if intensity > 0.55:
st.markdown(f'β οΈ ADVERSE DRUG REACTION RISK
Drug: {drug}
Phenotype: Poor / Intermediate Metaboliser
Action: Consider dose reduction or alternative agent
', unsafe_allow_html=True)
else:
st.markdown(f'β
STANDARD DOSING LIKELY
Drug: {drug}
Phenotype: Normal Metaboliser
Action: Standard protocol applies
', unsafe_allow_html=True)
else:
lvl = "High" if intensity>.65 else "Moderate" if intensity>.35 else "Low"
colours = {"High":("#fff5f5","#e53e3e"),"Moderate":("#fffbeb","#d69e2e"),"Low":("#f0fff4","#38a169")}
bg,bd = colours[lvl]
st.markdown(f'Predicted Impact: {lvl}
{gi.get("condition","")}
', unsafe_allow_html=True)
st.markdown("**π Authoritative Sources**")
lc1, lc2 = st.columns(2)
btns = [("ClinVar", gi.get("clinvar","")), ("OMIM", f"https://omim.org/entry/{gi.get('omim','')}" if gi.get("omim") else ""),
("NICE", gi.get("nice_link","")), ("PharmGKB", gi.get("pharmgkb",""))]
for i,(lbl,url) in enumerate(btns):
if url: (lc1 if i%2==0 else lc2).link_button(lbl, url, use_container_width=True)
st.link_button("π₯ NHS Genomics England", f"https://www.genomicsengland.co.uk/search?q={gene_sym}", use_container_width=True)
with col_t:
st.subheader("π Predicted Tracks")
figs_out = []
if not HAS_ALPHAGENOME or not api_key:
st.info("π¬ **Demo Mode** β Realistic simulated tracks. Add AlphaGenome API key in sidebar for live predictions.", icon="βΉοΈ")
if "RNA Expression" in modalities:
f=_rna(gene_sym,intensity); st.pyplot(f); figs_out.append(f)
if "Splicing" in modalities:
f=_splice(gene_sym,intensity); st.pyplot(f); figs_out.append(f)
if "Chromatin Accessibility" in modalities:
f=_chromatin(gene_sym,intensity); st.pyplot(f); figs_out.append(f)
if "Contact Map" in modalities:
f=_contact(gene_sym,intensity); st.pyplot(f); figs_out.append(f)
else:
st.sidebar.success("β
AlphaGenome API connected")
model = dna_client.create(api_key)
try:
with st.spinner(f"Querying AlphaGenome for {gene_sym}β¦"):
interval = genome.Interval(chromosome=gi["chr"], start=gi["start"], end=gi["end"])
variant = genome.Variant(chromosome=gi["chr"], position=vpos, reference_bases=ref_b, alternate_bases=alt_b)
outputs = model.predict_variant(interval=interval, variant=variant, ontology_terms=[ont], requested_outputs=[dna_client.OutputType.RNA_SEQ])
if hasattr(outputs.reference, "rna_seq"):
fig = plot_components.plot(
[plot_components.OverlaidTracks(tdata={"REF":outputs.reference.rna_seq,"ALT":outputs.alternate.rna_seq}, colors={"REF":"dimgrey","ALT":"#ff4b4b"})],
interval=outputs.reference.rna_seq.interval.resize(2**14),
annotations=[plot_components.VariantAnnotation([variant], alpha=0.8)],
)
st.pyplot(fig); figs_out.append(fig)
except Exception as e:
st.error(f"AlphaGenome error: {e}")
f=_rna(gene_sym,intensity); st.pyplot(f); figs_out.append(f)
if HAS_DOCX and figs_out:
st.markdown("---")
docx_bytes = build_docx(gene_sym, gi, tissue, vpos, ref_b, alt_b, intensity, figs_out)
st.download_button("π₯ Download Report (.docx)", data=docx_bytes,
file_name=f"VirtualGeneScope_{gene_sym}_{tissue.replace(' ','_')}.docx",
mime="application/vnd.openxmlformats-officedocument.wordprocessingml.document",
use_container_width=True)
entry = {"gene":gene_sym,"tissue":tissue,"mode":mode,"variant":f"{gi['chr']}:{vpos} {ref_b}>{alt_b}","impact":f"{intensity:.0%}"}
if not st.session_state.history or st.session_state.history[-1] != entry:
st.session_state.history.append(entry)
if len(st.session_state.history) > 10: st.session_state.history.pop(0)
with tab_r:
st.subheader(f"π©ββοΈ Nurse Reference β {gene_sym}")
st.markdown(f'π₯ Condition: {gi.get("condition","N/A")}
𧬠Key SNP: {gi.get("key_snp","N/A")}
π Inheritance: {gi.get("inheritance","N/A")}
', unsafe_allow_html=True)
st.markdown("#### π‘ Nursing Practice Guidance")
st.markdown(gi.get("nursing_note",""))
if gi.get("category") == "pgx":
st.markdown("---"); st.markdown("#### π PGx Quick Reference")
drug = gi.get("drug","N/A"); ca,cb = st.columns(2)
ca.markdown(f'β οΈ Poor Metaboliser
Drug: {drug}
Accumulation β toxicity
Reduce dose / switch agent
', unsafe_allow_html=True)
cb.markdown(f'β
Normal Metaboliser
Drug: {drug}
Standard response expected
Standard dosing protocol
', unsafe_allow_html=True)
if gi.get("pharmgkb"): st.link_button(f"π PharmGKB β {gene_sym}", gi["pharmgkb"], use_container_width=True)
st.markdown("---"); st.markdown("#### π UK Clinical Guidelines")
if gi.get("nice_link"): st.link_button(f"π {gi.get('nice_label','NICE Guidance')}", gi["nice_link"], use_container_width=True)
st.link_button("π₯ NHS Genomics England", f"https://www.genomicsengland.co.uk/search?q={gene_sym}", use_container_width=True)
st.link_button("π¬ ClinVar", gi.get("clinvar", f"https://www.ncbi.nlm.nih.gov/clinvar/?term={gene_sym}"), use_container_width=True)
if gi.get("omim"): st.link_button("π OMIM", f"https://omim.org/entry/{gi['omim']}", use_container_width=True)
with tab_nmc:
st.subheader("π NMC Standards of Proficiency Alignment")
st.markdown("All CQAI tools map to the [NMC Standards of Proficiency for Registered Nurses (2018)](https://www.nmc.org.uk/standards/standards-for-nurses/standards-of-proficiency-for-registered-nurses/).")
st.markdown(f"**{gene_sym} β {gi.get('condition','')}**")
all_platforms = [
"Platform 1 β Being an accountable professional",
"Platform 2 β Promoting health and preventing ill health",
"Platform 3 β Assessing needs and planning care",
"Platform 4 β Providing and evaluating care",
"Platform 5 β Leading and managing nursing care",
"Platform 6 β Improving safety and quality of care",
"Platform 7 β Coordinating care",
]
for plat in all_platforms:
active = any(p in plat for p in gi.get("nmc_platforms",[]))
icon = "β
" if active else "β¬"
colour = "#2d6a4f" if active else "#6c757d"
st.markdown(f"{icon} {plat}", unsafe_allow_html=True)
st.markdown("---"); st.markdown("#### π Genomics in Nursing β Resources")
for label, url in [
("NHS Genomics Education Programme","https://www.hee.nhs.uk/our-work/genomics"),
("Genomics England β NHS Genomic Medicine Service","https://www.genomicsengland.co.uk/"),
("RCN β Genomics for Nursing","https://www.rcn.org.uk/clinical-topics/genomics"),
("PharmGKB","https://www.pharmgkb.org/"),
("NHS England DPYD Genotyping Mandate","https://www.england.nhs.uk/publication/dpyd-genotyping/"),
]:
st.link_button(label, url, use_container_width=True)
with tab_hist:
st.subheader("π Session History (last 10)")
if not st.session_state.history:
st.info("No analyses run yet this session.")
else:
st.dataframe(pd.DataFrame(st.session_state.history[::-1]), use_container_width=True)
if st.button("ποΈ Clear History", type="secondary"): st.session_state.history=[]; st.rerun()
# ---------------------------------------------------------------------------
# Gene Quiz tab
# ---------------------------------------------------------------------------
with tab_quiz:
st.subheader(f"π§ Gene Quiz β {gene_sym}")
st.caption("NCLEX-style questions to test your clinical genomics knowledge. Select your answer and check your understanding.")
qs = GENE_QUIZ.get(gene_sym, [])
if not qs:
st.info("No quiz questions available for this gene yet.")
else:
if "quiz_state" not in st.session_state:
st.session_state.quiz_state = {}
qkey = f"quiz_{gene_sym}"
if qkey not in st.session_state.quiz_state:
st.session_state.quiz_state[qkey] = {"answers": [None]*len(qs), "submitted": False}
qstate = st.session_state.quiz_state[qkey]
for i, item in enumerate(qs):
with st.container():
st.markdown(f"**Q{i+1}.** {item['q']}")
choice = st.radio(
f"Select answer for Q{i+1}:",
options=item["opts"],
index=qstate["answers"][i] if qstate["answers"][i] is not None else 0,
key=f"quiz_{gene_sym}_{i}",
label_visibility="collapsed",
)
qstate["answers"][i] = item["opts"].index(choice)
if qstate["submitted"]:
correct = item["ans"]
if qstate["answers"][i] == correct:
st.markdown(f'β
Correct! {item["rationale"]}
', unsafe_allow_html=True)
else:
st.markdown(f'β Incorrect. Correct answer: {item["opts"][correct]}
{item["rationale"]}
', unsafe_allow_html=True)
st.markdown("---")
col_sub, col_rst = st.columns(2)
if col_sub.button("β
Submit Answers", type="primary", key=f"sub_{gene_sym}"):
qstate["submitted"] = True
st.rerun()
if col_rst.button("π Reset Quiz", key=f"rst_{gene_sym}"):
st.session_state.quiz_state[qkey] = {"answers": [None]*len(qs), "submitted": False}
st.rerun()
if qstate["submitted"]:
score = sum(1 for i, item in enumerate(qs) if qstate["answers"][i] == item["ans"])
pct = score / len(qs) * 100
colour = "#38a169" if pct >= 75 else "#d69e2e" if pct >= 50 else "#e53e3e"
st.markdown(f'{score}/{len(qs)} ({pct:.0f}%)
{"Excellent! π" if pct>=75 else "Good effort β review the rationales above π" if pct>=50 else "Keep studying β genomics takes practice! πͺ"}
', unsafe_allow_html=True)
# ---------------------------------------------------------------------------
# Clinical Cases tab
# ---------------------------------------------------------------------------
with tab_cases:
st.subheader(f"π₯ Clinical Cases β {gene_sym}")
st.caption("Real-world scenarios to develop clinical reasoning around genomics. Read each case, formulate your response, then reveal the model answer.")
cases = GENE_CASES.get(gene_sym, [])
if not cases:
st.info("No clinical cases available for this gene yet.")
else:
for i, case in enumerate(cases):
st.markdown(f"### Case {i+1}: {case['title']}")
st.markdown(f'{case["scenario"]}
', unsafe_allow_html=True)
st.markdown("**π Reflection questions:**")
for q in case["questions"]:
st.markdown(f"- {q}")
with st.expander("π‘ Reveal Model Answer", expanded=False):
st.markdown(case["model_answer"])
if i < len(cases) - 1:
st.markdown("---")
st.markdown("---")
st.markdown('π Reflective Practice (NMC Platform 1)
After completing these cases, consider: How would you feel managing a patient with this genomic condition? What extra learning do you need? Who are the MDT members you would involve?
', unsafe_allow_html=True)
# ---------------------------------------------------------------------------
# Population Data tab
# ---------------------------------------------------------------------------
with tab_pop:
st.subheader(f"π Population Allele Frequencies β {gene_sym}")
st.caption("Approximate gnomAD v4 allele frequencies for the key variant associated with each gene. Population data informs health equity practice.")
pop_data = POPULATION_FREQS.get(gene_sym)
if not pop_data:
st.info("No population frequency data available for this gene.")
else:
snp = pop_data.get("snp","N/A")
note = pop_data.get("note","")
pops = ["European (EUR)","African (AFR)","South Asian (SAS)","East Asian (EAS)","Latino (AMR)"]
freqs = {p: pop_data.get(p, "N/A") for p in pops}
st.markdown(f"**Variant:** `{snp}`")
if note:
st.markdown(f'{note}
', unsafe_allow_html=True)
# Bar chart
freq_vals, freq_lbls = [], []
for p in pops:
raw = freqs[p]
if raw != "N/A":
try:
val = float(raw.replace("%","").replace("<","").replace(">","").strip()) / 100
freq_vals.append(val)
freq_lbls.append(p.split(" ")[0])
except ValueError:
pass
if freq_vals:
fig_pop, ax_pop = plt.subplots(figsize=(7, 3))
colours_pop = ["#667eea","#f6a623","#38a169","#e53e3e","#d69e2e"]
bars = ax_pop.bar(freq_lbls, freq_vals, color=colours_pop[:len(freq_vals)], edgecolor="white", linewidth=1.2)
ax_pop.set_ylabel("Allele Frequency")
ax_pop.set_title(f"{gene_sym} β {snp}", fontsize=11, fontweight="bold")
ax_pop.set_ylim(0, max(freq_vals)*1.3 or 0.01)
for bar, val in zip(bars, freq_vals):
ax_pop.text(bar.get_x()+bar.get_width()/2, bar.get_height()+0.0005, f"{val:.2%}", ha="center", va="bottom", fontsize=9)
ax_pop.spines[["top","right"]].set_visible(False)
st.pyplot(fig_pop)
plt.close(fig_pop)
# Table
df_pop = pd.DataFrame([{"Population": p, "Allele Frequency": freqs[p]} for p in pops])
st.dataframe(df_pop, use_container_width=True, hide_index=True)
st.markdown("---")
st.markdown("""#### π₯ Health Equity in Genomics β Nursing Implications
- **Population variation matters:** Variant frequencies differ across ancestry groups. Screening programmes must be designed for ALL patients, not just European-ancestry populations.
- **DPYD *2A** is most common in Europeans β but rarer variants (e.g. c.2846A>T) occur across all populations. All patients must be tested regardless of ethnicity.
- **HBB (sickle cell)** rs334 is far more prevalent in African ancestry β underpins targeted NHS newborn screening and NHS SCT programme.
- **Nurse responsibility:** Avoid assumptions based on ethnicity. Every patient deserves genomic risk assessment. Advocate for equitable access to testing.
- **Data source:** gnomAD v4 (approximate values β always consult current gnomAD browser for precise frequencies).""")
st.link_button("π¬ gnomAD Browser", f"https://gnomad.broadinstitute.org/gene/{gene_sym}?dataset=gnomad_r4", use_container_width=True)
# ---------------------------------------------------------------------------
# Glossary tab
# ---------------------------------------------------------------------------
with tab_gloss:
st.subheader("π Genomics Glossary for Nurses")
st.caption("42 key terms explained in plain language. Use the search box to filter.")
search_term = st.text_input("π Search termsβ¦", placeholder="e.g. allele, variant, pharmacogenomics", key="gloss_search")
# GLOSSARY is a list of (term, definition) tuples β sort and filter accordingly
all_terms = sorted(GLOSSARY, key=lambda x: x[0])
filtered = [(k, v) for k, v in all_terms if search_term.lower() in k.lower() or search_term.lower() in v.lower()] if search_term else all_terms
if not filtered:
st.warning("No matching terms found.")
else:
st.caption(f"Showing {len(filtered)} of {len(GLOSSARY)} terms")
mid = (len(filtered)+1)//2
col_g1, col_g2 = st.columns(2)
for term, defn in filtered[:mid]:
col_g1.markdown(f'{term}
{defn}
', unsafe_allow_html=True)
for term, defn in filtered[mid:]:
col_g2.markdown(f'{term}
{defn}
', unsafe_allow_html=True)
st.markdown("---")
st.markdown('', unsafe_allow_html=True)
st.markdown("---")
st.markdown("""""", unsafe_allow_html=True)