Session #4: Human Phenotype Ontology and algorithms
Free University Berlin
2026-04-26
In 1995, Resnik introduced a method for evaluating the semantic similarity between two concepts in an ontology with is_a relations.1
pebble is a stone, and every stone is a natural object.entity.
Knowing a random term is a descendent of entity provides no added information. Conversely, the probability of a specific term like pebble is much lower, meaning its Information Content is correspondingly higher.
Logic of Inheritance
Recall that:
\(x\) instance_of \(A\) AND \(A\) is_a \(B\) \(\implies\) \(x\) instance_of \(B\).
is_a \(c_j\), then \(p(c_i) \leq p(c_j)\).The Information Content (IC) of a concept is the negative log likelihood of its probability:
\[\text{IC}(t) = -\log p(t)\]
As the probability of a concept increases, its information content decreases. This mirrors information theory:
Summary
The more specific a term is (lower probability), the higher its Information Content. The more general it is (higher probability), the lower its Information Content.
Mathematical Foundation
Information Content relies heavily on the properties of logarithms. These identities are essential for calculating IC across different branches of an ontology.
The following logarithmic identities1 are fundamental to the behavior of \(IC(t) = -\log p(t)\):
\[ \begin{aligned} \log 1 &= 0 \\ \log xy &= \log x + \log y \\ \log x^r &= r \log x \\ \log \frac{1}{x} &= - \log x \\ \log_a x &= \frac{\log x}{\log a} \end{aligned} \]
Game plan
This lecture covers a review of artificial neural networks and backpropagation as a prerequisite for understanding transformers and LLMs.
Shannon defined the information content of an outcome \(x\) as
\[ h(x) = \log_2 \dfrac{1}{p(x)} \tag{1}\]
Note that because of the properties of logarithms, \(\log_2 \frac{1}{p(x)} = -\log_2 p(x)\), which is the definition of information content. The entropy of the random variable \(X\), written as \(H(X)\), was defined by Shannon as the average information content of all of the possible outcomes of \(X\).1
\[ H(X) = \sum_{i=1}^n p(x_i)\log_2\dfrac{1}{p(x_i)} \tag{2}\]
Entropy and information content are measured in units called bits (not to be confused with the definition of a bit as a zero or one in computer science).
\[ H(X) = p(x')\log_2\dfrac{1}{p(x')} = 1\times (-1)\times\log_2 1 = 0 \]
On the other hand the entropy of \(X\) is maximized if there is maximal uncertainty about the outcome – this is the case if no outcome is more likely than the others, or stated differently, if \(X\) follows a uniform distribution.
We want to show: among all probability distributions on \(n\) outcomes, entropy
\[ H(p) = -\sum_{i=1}^n p_i \log p_i \]
is maximized by the uniform distribution \(p_i = 1/n\).
Introduce a multiplier \(\lambda\) for the normalization constraint:
\[ \mathcal{L}(p, \lambda) = -\sum_{i=1}^n p_i \log p_i \;-\; \lambda\left(\sum_{i=1}^n p_i - 1\right) \]
\[ \begin{align} \frac{\partial \mathcal{L}}{\partial p_i} &= -\log p_i - 1 - \lambda = 0 \quad \Longrightarrow \quad p_i = e^{-1-\lambda} \end{align} \]
\[ \nabla^2 \mathcal{L} = \begin{bmatrix} -\dfrac{1}{p_1} & 0 & \cdots & 0 \\ 0 & -\dfrac{1}{p_2} & \cdots & 0 \\ 0 & 0 & \ddots & 0 \\ 0 & 0 & \cdots & -\dfrac{1}{p_n} \end{bmatrix} \]
Since \(p_i > 0\), every diagonal entry is negative, and off-diagonal entries vanish.
\(H(p)\) is therefore strictly concave — the unique critical point is a global maximum, not a saddle or minimum.
\[ H(p) \leq H\left(\tfrac{1}{n}, \dots, \tfrac{1}{n}\right) = \log n \]
for every probability distribution \(p\) on \(n\) outcomes, with equality iff \(p\) is uniform.
Interpretation: maximal uncertainty about the outcome corresponds exactly to maximal entropy — any deviation from uniformity introduces predictability and strictly lowers \(H\).
The function \(IC(x) = -\log p(x)\) is a natural one for measuring information content, for several reasons.
\[ IC(x,y) = -\log_2 (xy) = -\log_2 x - \log_2 y = IC(x) + IC(y) \]
Claude Shannon’s definition of entropy is not arbitrary; it is the only function that satisfies three fundamental postulates.
Theorem: Uniqueness of Entropy
Let \(P = \{p_1, p_2, \dots, p_n\}\) be the probabilities of outcomes \(\{x_1, x_2, \dots, x_n\}\), where \(p_i \geq 0\) and \(\sum p_i = 1\).
A continuous function \(H(P)\) satisfies the following:
Then \(H\) must take the form: \[H(p_1, p_2, \dots, p_n) = \lambda \sum_{i=1}^n - p_i \log p_i\] where \(\lambda\) is a positive constant (usually \(\lambda=1\)).
In the setting of GO, the probability of a term \(t\) is the probability that a randomly chosen gene product (usually: protein) is annotated to that term.
Note
This reflects “surprise”: discovering a gene is annotated to the root is expected, while discovering a rare, specific annotation provides significant information.
Assume we have a set of 256 annotated genes:
| Genes Annotated to Term | Probability \(p(t)\) | IC calculation (\(-\log_2 p(t)\)) | IC Value |
|---|---|---|---|
| 256 (All) | \(256/256 = 1\) | \(-\log_2(1)\) | 0 |
| 4 | \(4/256\) | \(-\log_2(4/256) = 8 - 2\) | 6 |
| 2 | \(2/256\) | \(-\log_2(2/256) = 8 - 1\) | 7 |
| 1 (Unique) | \(1/256\) | \(-\log_2(1/256)\) | 8 |
Resnik defined similarity between two terms based on the Information Content of their Most Specific Ancestor (MSA).
\[\text{IC}(t) = -\log p(t)\]
The similarity is the IC of the most specific ancestor \(a\) in the set of common ancestors \(\mathcal{A}(t_1, t_2)\):
\[ \mathrm{sim}(t_1, t_2) = \max_{a \in \mathcal{A}(t_1, t_2)} [-\log p(a)] \tag{3}\]
We refer to this as the IC of the Most Specific Ancestor: \(\text{IC}(a')\), or MICA
lion and cheetah are similarbeagle and wildcat are not \(\ldots\)Game plan
This lecture covers a review of artificial neural networks and backpropagation as a prerequisite for understanding transformers and LLMs.
\[ \begin{equation*} \mbox{American Football} = \mbox{Football} \neq \mbox{Football} = \mbox{European Football} = \mbox{Soccer} \end{equation*} \]
A football \(\ldots\)
A football \(\ldots\)
When you see ``football’’, your computer sees: 0100011001101111011011110111010001100010011000010110110001101100
\[ \begin{equation*} \mbox{muscle fibrillation} = \mbox{fibrillation} \neq \mbox{fibrillation} = \mbox{ventricular fibrillation} \end{equation*} \]
fibrillation \(\ldots\)
fibrillation \(\ldots\)
When you see ``fibrillation’’, your computer sees: 011001100110100101100010011100100110100101101100011011000110000101110100011010010110111101101110
Core Purpose
Precise language (and thinking), interoperability, and improved database models to reliably capture and interpret phenotype information.
A medical phenotype ontology describes the individual manifestations of diseases:
Robinson PN, Webber C (2014) Phenotype ontologies and cross-species analysis for translational research. PLoS Genet 10:e1004268.
The precise and comprehensive analysis of phenotypic abnormalities.
PN Robinson (2012) Deep phenotyping for precision medicine. Hum Mutat 33:777–780. Special Issue of Human Mutation on Deep Phenotyping
Core Purpose
Ontologies have two major (interrelated) use cases
Brookes and Robinson (2015) Human genotype-phenotype databases: aims,challenges and opportunities, Nature Reviews Genetics 16:702-15
generalized amyotrophy, generalized muscle atrophy, muscular atrophy, generalized, (etc)An ontology provides a standardised “Term” for each entity in its domain that can be used for data exchange.
| Field | Description |
|---|---|
| ID | HP:0000256 |
| Name | Macrocephaly |
| Definition | Occipitofrontal (head) circumference greater than 97th centile compared to appropriate, age matched, sex-matched normal standards. Alternatively, an apparently increased size of the cranium. |
| Synonyms | Large head, big head, large cranium, large calvaria, Increased head circumference, … |
| Xrefs | MeSH:D058627, UMLS:C0221355, SNOMED CT:19410003, ICHPT:T0028, EoM:1d53660e657259f0, … |
| Translations |
Ontologies are used for myriad applications in biomedical research and translational applications. The greatest common denominator is: Compute over human knowledge!
Haendel, Chute, Robinson (2018) Classification, Ontology, and Precision Medicine.
N Eng J Med 379:1452-1462
Robinson Am J Hum Genet 2008
Köhler Am J Hum Genet 2009
Robinson Clin Genet. 2010
Schulz BMC Bioinformatics. 2011
Köhler Hum Mutat. 2012
Bauer Bioinformatics 2012
Köhler Nucleic Acids Res 2014
Köhler J Med Genet 2014
Zemojtel Sci Transl Med. 2014
Robinson PLoS Genet. 2014
Robinson Genome Res. 2014
Groza Am J Hum Genet 2015
Groza Database (Oxford). 2015
Smedley Nat Protoc 2015
Smedley Genome Med. 2015
Smedley Am J Hum Genet. 2016
Köhler Nucleic Acids Res 2017
Vasilevsky Nat Genet 2018
Köhler Nucleic Acids Res 2019
Köhler Curr Protoc Hum Genet. 2019
Carmody Orphanet J Rare Dis. 2020
Köhler Nucleic Acids Res 2021
Dhombres Am J Med Genet C 2022
Gargano Nucleic Acids Res 2024
Game plan
This lecture covers a review of artificial neural networks and backpropagation as a prerequisite for understanding transformers and LLMs.
Goal: Calculate a similarity between a set of query terms and computational disease models.
Phenomizer
Köhler et al. (2009) Am J Hum Genet 85:457-64
Exact Score Distribution
Schulz MH et al (2011) BMC Bioinformatics 12:441
BOQA
Bauer et al. (2012) Bioinformatics 28:2502-8
\[\text{sim}(\color{orange}{Q} \rightarrow \color{blue}{d}) = \text{avg} \left[ \sum_{s \in \color{orange}{Q}} \max_{t \in \color{blue}{d}} \text{sim}(s,t) \right]\]
\(\color{orange}{Q}\): Query terms
\(\color{blue}{d}\): Disease terms
Query terms: The HPO is frequently used to create a set of terms that accurately describe the observed clinical abnormalities of an individualbeing evaluated for suspected rare genetic disease.
Disease model: The HPO is frequently used to create a set of terms that accurately describe the observed clinical abnormalities of an individualbeing evaluated for suspected rare genetic disease.
query:
For demo purposes, let’s create two simplified disease models
Noonan syndrome type 1 (NS1)
Neurodevelopmental disorder 1 (NDD1)
| Query term | Noonan syndrome 1 | NS1 score | Neurodevelopmental disorder 1 | NDD1 score |
|---|---|---|---|---|
| Pulmonic stenosis | Pulmonic stenosis | 4.19 | Phenotypic abnormality | 0.00* |
| Upslanted palpebral fissure | Downslanted palpebral fissure | 2.59* | Phenotypic abnormality | 0.00* |
| Proportionate short stature | Short stature | 1.91* | Short stature | 1.91* |
| Headache | Phenotypic abnormality | 0.00* | Abnormality of the nervous system | 0.51* |
| Sum | 8.60 | 2.42 |
The table in the previous slide demonstrates how to calculate the phenomizer score \[ \mathrm{sim}(Q\rightarrow D) = \mathrm{avg} \sum_{s\in Q}\max_{t\in D}\mathrm{sim}(s,t) \] - \(\mathrm{sim}(s,t)\) is calculated as the IC of the maximally informative common ancestor (MICA), see Equation 3.
From raw score to p-value:
Raw similarity scores aren’t directly comparable across diseases:
For each candidate disease \(D\):
\[ p = \frac{\#\{\text{random scores} \geq \text{observed score}\}}{N} \]
Recall Bayes’ law: \[ P(A\mid B) = \frac{P(B\mid A)\cdot P(A)}{P(B)} \tag{4}\]
\[ P(D^{+}\mid x=\mathrm{abn}) = \frac{P(x=\mathrm{abn}\mid D^{+})\cdot P(D^{+})}{P(x=\mathrm{abn})} \tag{5}\]
Similarly, the probability of the absence of the disease (D–) given the test result is \[ \begin{align} P(D^{-}\mid x=\mathrm{abn}) &= 1 - P(D^{+}\mid x=\mathrm{abn}) \\ &= \frac{P(x=\mathrm{abn}\mid D^{-})\cdot P(D^{-})}{P(x=\mathrm{abn})} \\ \end{align} \tag{6}\]
Dividing Equation 5 by Equation 6 and replacing P(D–) with 1 – P(D+) gives: \[ \frac{P(D^{+}\mid x=\mathrm{abn}) }{1-P(D^{+}\mid x=\mathrm{abn}) } = \frac{P(x=\mathrm{abn}\mid D^{+})}{P(x=\mathrm{abn}\mid D^{-})} \times \frac{P(D^{+})}{1 - P(D^{+})} \]
This is \[ \text{Post-test odds of }D^{+} = \frac{P(x=\mathrm{abn}\mid D^{+})}{P(x=\mathrm{abn}\mid D^{-})} \times \text{Pre-test odds of }D^{+} \]
This is the equation used in the Bayesian approach to interpret test results.
The factor \(\tfrac{P(x=\mathrm{abn}\mid D^{+})}{P(x=\mathrm{abn}\mid D^{-})}\) is termed the likelihood ratio (LR)
When the test result equals to \(r\), we write \(LR(r)\).
Generally speaking, the likelihood ratio indicates how many times more (or less) likely a certain condition for a test result is expected to be observed in diseased, compared with non-diseased, people
Habibzadeh F, Habibzadeh P (2019) The likelihood ratio and its graphical representation. Biochem Med (Zagreb)
Odds and probability both describe uncertainty, and are related by the following equation
\[ \text{odds} = \frac{P(\text{event})}{P(\text{not event})} = \frac{p}{1-p} \tag{7}\]
| Probability | Odds | Reads as |
|---|---|---|
| 50% | 1.00 | 1 : 1 |
| 90% | 9.00 | 9 : 1 |
| 2% | 0.0204 | ~1 : 49 |
\[ \rm{LR}=\dfrac{P(x|\mathcal{D})}{P(x|\neg \mathcal{D})} \tag{8}\]
The definition of the LR can be extended to multiple tests. Suppose \(X=(x_1,x_2,\cdots,x_n)\) is an array of \(n\) test results. Under the assumption that the tests are independent, \(\rm{LR}(X)\) is defined as:
\[ \frac{{\rm{{Pr}}}(X|\mathcal{D})}{{\rm{Pr}}(X|\neg \mathcal{D})} = \frac{{\rm{Pr}}(x_1,x_2,\cdots,x_n|\mathcal{D})}{{\rm{{Pr}}}(x_1,x_2,\cdots,x_n|\neg \mathcal{D})} = \prod_{i=1}^{n} \dfrac{{\rm{{Pr}}}(x_i|\mathcal{D})}{{\rm{Pr}}(x_i|\neg \mathcal{D})} \tag{9}\]
phenotype.hpoa fileLIRICAL therefore makes the assumption that every individual in the population has some Mendelian disease.
Then we can estimate \(P(h_i|\neg \mathcal{D})\) as follows (with a total of \(N\) Mendelian diseases) \[ P(h_i\mid D_j) = \frac{1}{N-1}\sum_{k\neq j} P(h_i\mid D_k) \approx \frac{1}{N}\sum_{k} f_{i}^{D_k} \]
Here, \(f_{i}^{D_k}\) is the frequency of HPO term \(i\) in individuals with disease \(k\)
This is the key assumption (“trick”) that allows us to apply the likelihood ratio framework to HPO-based differential diagnostic support
There are many details about how to calculate \(f_{i}^{D_k}\) in different situations and how to true-path rule is applied
The next slide gives an impression of the algorithms.1
LIRICAL also introduces an approach to estimate likelihood ratios for genotypes that we will not cover here.
Calculating the likelihood ratios for phenotypes
HPO annotations and frequency data: used to calculate \(\dfrac{P(x|\mathcal{D})}{P(x|\neg \mathcal{D})}\), with heuristics for non-exact matches.
Robinson PN et al., Interpretable Clinical Genomics with a Likelihood Ratio Paradigm
Am J Hum Genet 2020;107:403-417
free for academic use