packagePharmacogenomics

Extends from Modelica.Icons.Package (Icon for standard packages).

Information

Pharmacogenomics


Pharmacogenomic

Pharmacogenomic (PGx) can model dynamic influence of Genotype/Phenotype by altering parameters of PK/PD absorption, clearance, metabolism and effect.

Three gene shapes

A gene enters a model as exactly one of three kinds, and CPIC's own lookupmethod decides which, so it is not a judgement call in this library:

  • Gene + Effect — an activity axis. Alleles carry activity scores, the diplotype maps to a MetabolizerStatus, and an Effect turns that into a dimensionless factor on ONE model parameter. This is the only shape that touches a PK or PD equation.
  • RiskGene — allele carriage (HLA-A, HLA-B). A Boolean, not a factor: there is no dose at which an HLA-B*57:01 carrier may receive abacavir, so no multiplier on a parameter expresses it.
  • GradedGene — an ordered deficiency severity (G6PD's WHO classes I-IV). Neither an activity axis nor a binary flag.

Where the decision to fail belongs

The model layer computes and reports; the simulation layer decides. A risk carrier's pharmacokinetics are perfectly well defined, and simulating them is often the whole point — you may want the exposure profile precisely because this is the subject you are worried about. So nothing here refuses to solve on account of a genotype.

What the model exposes instead: each risk component publishes its own state (CarriageComponent.carrier, DeficiencyComponent.level and .deficient), and Modifiers.RiskSummary aggregates any number of them into the single atRisk flag plus a count that an application reads to decide whether to proceed, warn a user, or refuse to prescribe. Those are prescribing decisions, and they belong above the model.

Warnings are advisory and switchable — warnIfCarrier, warnIfDeficient, warnIfAtRisk — and none of them fails a run.

Exactly ONE condition raises an error: an allele name that appears in no table for its gene (checkAlleles, on by default). That is not a finding about a patient, it is a malformed model — the requested genotype does not exist — and every lookup here fails soft and silently in the dangerous direction if it is allowed through. An unlisted allele scores as fully functional, so a mistyped no-function allele turns a poor metaboliser into a normal one, and a mistyped *57:01 reads as a subject who may safely receive the drug. Better to stop.

Contents

NameDescription
Genesallele -> phenotype knowledge, one record per gene
Effectswhat a phenotype does to ONE model parameter, per (gene, parameter, drug)
Diplotypesa subject's alleles, one record per gene — set `allele`
GenesCuratedgenes NOT derivable from CPIC — hand-written, and illustrative
RiskGenescarriage genes — CPIC assigns these by ALLELE STATUS
DiplotypesCuratedsubject alleles for the hand-written genes in GenesCurated
Carriagesa subject's alleles for a risk gene — set `allele`
GradedGenesgenes whose consequence is a GRADED deficiency
Deficienciesa subject's alleles for a graded gene — set `allele`
PGx
Modifiers