My scripts:
About myself: www.linkedin.com/in/ThomasWs-Mopfair
The HPO is composed of “parent” and subclass “child” terms, arranged in a directed acyclic graph. “Parent” terms have one or more “children”, whereas most “child” terms only have one “parent”. However, more complex ancestries exists, as illustrated by this example:
Ancestry of the HPO term “Cherry red spot of the
macula”
Several options exist for substituting “Cherry red spot of the macula” with HPO terms of lower specificity at index rank shown in red.
When the script summarises HPO terms at less specific levels the following decisions are implemented:
All ancestors of a term with the same index rank will be considered. I.e. in the above example, for term index = 7 “Cherry red spot of the macula” will be summarised as “Abnormal cardiovascular morphology”. However, term index ranks 8 or 9 will return both “Abnormal vascular morphoplogy” and “Abnormal posterior eye segment morphology”
HPO terms with an index rank lower than the chosen one will be preserved
For an individual patient ID, each summarised term will be counted once, regardless of how many descendants existed in the clinical record
The first two points can be verified by running the code chunk 2 (section 2.1), and looking at the messages that are generated.
Indexing is based on the R package ontologyIndex which is part of the
ontologyX suite (3). A recent paper seems to have used the same approach
but published no code (4).
The input file was a tab-delimited csv document. The clinical
phenotype of each patient (last column “HPO_Terms”) was represented by a
string of HPO ID numbers, separated by a comma without spaces.
Data in the example file are not actual patient data. However, the
overall frequencies of original HPO terms and variants, both of which
have been published (1), have been preserved.
# -- Chunk 1 -- #
## Load required R libraries and download HPO data
library(tidyverse)
library(ontologyIndex)
## Get latest version of HPO from the The Open Biological and Biomedical Ontologies Foundry
# Alternative server: http://purl.obolibrary.org/obo/hp.owl
hpo <- get_OBO ("http://purl.obolibrary.org/obo/hp.obo")
## Get example file with simulated data
variants_sim <-
read.delim("https://raw.githubusercontent.com/thomas-weissensteiner/portfolio/main/Summarizing_Human_Phenotype_Ontology_Terms/variants_simulated.csv",
quote = "")
# -- Optional: Show selected examples of patient data to illustrate data structure -- #
variants_sim[c(1,44,97), ] %>%
kable(., "html") %>% scroll_box(width = "100%")
ID_person | Gender | disease_.other_name. | cDna | Protein | new.published_variant | Type_on_DNA | Coding_Effect | Allele_zygosity | Clinical_Significance | cDna2 | Protein2 | Type_on_DNA2 | Coding_Effect2 | Clinical_Significance2 | HPO_Terms | Country.of.origin | Age.at.onset | Age.at.referral | Age.at.diagnosis | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | F | c.445C>T | p.R149C | Substitution | Missense | Homozygous | VUS | HP:0000252,HP:0000486,HP:0001252,HP:0001263,HP:0001283,HP:0001284,HP:0001298,HP:0001332,HP:0001347,HP:0002376,HP:0002398,HP:0003429,HP:0003577,HP:0003593,HP:0012448 | Jordan | 5.5 | 9 | 9 | |||||||
44 | 44 | ? | c.461_463del | p.I154del | Deletion | In-frame | Heterozygous | P | c.829_836delinsCCT | p.V277Pfs*5 | Insertion/Deletion_(indel) | Frameshift | P | HP:0001263,HP:0002197,HP:0002344,HP:0012444 | Kuwait | Not provided | unknown | unknown | ||
97 | 97 | M | juvenile_onset_CLN6 | c.84-1G>A | p.? | Substitution | Splicing mutation | Homozygous | LP | -1 | United Arab Emirates | 3 | 5.75 | 5.9 |
# ----------------------------------------------------------------------------------- #
# Clean data
variants_sim <- variants_sim %>%
filter (Allele_zygosity == "Homozygous" & !HPO_Terms %in% c(NA, "-1", "")) %>%
select (ID_person, Gender, cDna, Protein, Coding_Effect, Clinical_Significance, HPO_Terms)
The “findNode” function replaces an HPO term in the original case
annotations which new term(s) at the chosen level Messages are generated
whenever
* an original case annotation was kept because its HPO term was less
specific than the chosen term level
* an HPO term at the chosen level has parent terms in several different
branches of the ontology
Setting termIndex_rank to a high value (i.e.., 30) ensures all original HPO annotations are kept.
# -- Chunk 2 -- #
# -- Required objects generated in chunk 1: variants_sim -- #
## Set the level at which HPO terms will be summarised
# default is 3, in the HPO phenotype branch this corresponds to organ system abnormalities
termIndex_rank = 30
## Function to replace an HPO term in the original case annotations which new term(s) at the chosen level
findNode <-
function (x, termIndex_rank, excludeBranches) {
termsInfo <-
get_term_info_content (
hpo, get_ancestors (hpo, x)) %>%
.[order (as.numeric(.)) ]
ancestorNumber <- length (termsInfo)
if (termIndex_rank <= (ancestorNumber ) ) {
newTerms <-
termsInfo [termsInfo - termsInfo [termIndex_rank]==0] %>%
names ()
if (termsInfo [termsInfo -
termsInfo [termIndex_rank]==0] %>%
length() > 1) {
parents <-
termsInfo [termsInfo - termsInfo [termIndex_rank]==0] %>%
names()
cat (
x, hpo$name [[x]],
"summarised by ancestral terms from several HPO branches:", "\n",
paste (parents, hpo$name[parents]), "\n"
)
}
return (newTerms)
} else {
paste (x, hpo$name [[x]], "was not summmarised") %>%
print
return (x)
}
}
# Currently not required: add a column with a numeric value for later sorting of variants by nucleotide position
# variants_sim <- variants_sim %>% mutate (nt_pos = {.$cDna%>% gsub("c.*\\.", "", .) %>% sub("^(\\D*\\d+).*", "\\1", .) %>% as.numeric})
newList <- list()
for (i in 1 : nrow (variants_sim) ) {
queryTerms <-
select (variants_sim [i, ], HPO_Terms) %>%
separate_rows (., "HPO_Terms", sep=",")
newTerms <-
apply (queryTerms, 1, findNode, termIndex_rank, infoType)
newRow <- list (unique (newTerms))
newList <-
c (newList, newRow)
}
## [1] "HP:0000252 Microcephaly was not summmarised"
## [1] "HP:0000486 Strabismus was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001283 Bulbar palsy was not summmarised"
## [1] "HP:0001284 Areflexia was not summmarised"
## [1] "HP:0001298 Encephalopathy was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002398 Degeneration of anterior horn cells was not summmarised"
## [1] "HP:0003429 CNS hypomyelination was not summmarised"
## [1] "HP:0003577 Congenital onset was not summmarised"
## [1] "HP:0003593 Infantile onset was not summmarised"
## [1] "HP:0012448 Delayed myelination was not summmarised"
## [1] "HP:0005216 Impaired mastication was not summmarised"
## [1] "HP:0100022 Abnormality of movement was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001288 Gait disturbance was not summmarised"
## [1] "HP:0001321 Cerebellar hypoplasia was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0002141 Gait imbalance was not summmarised"
## [1] "HP:0002373 Febrile seizure (within the age range of 3 months to 6 years) was not summmarised"
## [1] "HP:0003128 Lactic acidosis was not summmarised"
## [1] "HP:0007185 Loss of consciousness was not summmarised"
## [1] "HP:0010819 Atonic seizure was not summmarised"
## [1] "HP:0010845 EEG with generalized slow activity was not summmarised"
## [1] "HP:0011203 EEG with abnormally slow frequencies was not summmarised"
## [1] "HP:0012015 EEG with frontal focal spikes was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0031987 Diminished ability to concentrate was not summmarised"
## [1] "HP:0000365 Hearing impairment was not summmarised"
## [1] "HP:0000598 Abnormality of the ear was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0002011 Morphological central nervous system abnormality was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002333 Motor deterioration was not summmarised"
## [1] "HP:0008981 Calf muscle hypertrophy was not summmarised"
## [1] "HP:0000708 Atypical behavior was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0002167 Abnormal speech pattern was not summmarised"
## [1] "HP:0003259 Elevated circulating creatinine concentration was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0001336 Myoclonus was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002518 Abnormal periventricular white matter morphology was not summmarised"
## [1] "HP:0007305 CNS demyelination was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0003593 Infantile onset was not summmarised"
## [1] "HP:0200134 Epileptic encephalopathy was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0011344 Severe global developmental delay was not summmarised"
## [1] "HP:0000708 Atypical behavior was not summmarised"
## [1] "HP:0000712 Emotional lability was not summmarised"
## [1] "HP:0000822 Hypertension was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001258 Spastic paraplegia was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001276 Hypertonia was not summmarised"
## [1] "HP:0001288 Gait disturbance was not summmarised"
## [1] "HP:0001324 Muscle weakness was not summmarised"
## [1] "HP:0002333 Motor deterioration was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0000739 Anxiety was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001337 Tremor was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0002505 Loss of ambulation was not summmarised"
## [1] "HP:0006957 obsolete Loss of ability to walk was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0007270 Atypical absence seizure was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0025045 Abnormal brain lactate level by MRS was not summmarised"
## [1] "HP:0100543 Cognitive impairment was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0000238 Hydrocephalus was not summmarised"
## [1] "HP:0000510 Rod-cone dystrophy was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0003621 Juvenile onset was not summmarised"
## [1] "HP:0006956 Lateral ventricle dilatation was not summmarised"
## [1] "HP:0007082 Dilated third ventricle was not summmarised"
## [1] "HP:0012501 Abnormal brainstem white matter morphology was not summmarised"
## [1] "HP:0040197 Encephalomalacia was not summmarised"
## [1] "HP:0100951 Enlarged fossa interpeduncularis was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0002267 Exaggerated startle response was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0003621 Juvenile onset was not summmarised"
## [1] "HP:0007360 Aplasia/Hypoplasia of the cerebellum was not summmarised"
## [1] "HP:0000735 obsolete Impaired social interactions was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001276 Hypertonia was not summmarised"
## [1] "HP:0001298 Encephalopathy was not summmarised"
## [1] "HP:0001328 Specific learning disability was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0001336 Myoclonus was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002072 Chorea was not summmarised"
## [1] "HP:0002194 Delayed gross motor development was not summmarised"
## [1] "HP:0002267 Exaggerated startle response was not summmarised"
## [1] "HP:0002307 Drooling was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002510 Spastic tetraplegia was not summmarised"
## [1] "HP:0004373 Focal dystonia was not summmarised"
## [1] "HP:0010862 Delayed fine motor development was not summmarised"
## [1] "HP:0011410 Caesarian section was not summmarised"
## [1] "HP:0025116 Fetal distress was not summmarised"
## [1] "HP:0031936 Delayed ability to walk was not summmarised"
## [1] "HP:0000543 Optic disc pallor was not summmarised"
## [1] "HP:0001317 Abnormal cerebellum morphology was not summmarised"
## [1] "HP:0002353 EEG abnormality was not summmarised"
## [1] "HP:0011004 Abnormal systemic arterial morphology was not summmarised"
## [1] "HP:0000329 Facial hemangioma was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002120 Cerebral cortical atrophy was not summmarised"
## [1] "HP:0002194 Delayed gross motor development was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0000752 Hyperactivity was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001268 Mental deterioration was not summmarised"
## [1] "HP:0002273 Tetraparesis was not summmarised"
## [1] "HP:0000280 Coarse facial features was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0010729 Cherry red spot of the macula was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002141 Gait imbalance was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0003739 Myoclonic spasms was not summmarised"
## [1] "HP:0010729 Cherry red spot of the macula was not summmarised"
## [1] "HP:0000280 Coarse facial features was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0010729 Cherry red spot of the macula was not summmarised"
## [1] "HP:0001344 Absent speech was not summmarised"
## [1] "HP:0002317 Unsteady gait was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002395 Lower limb hyperreflexia was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0010819 Atonic seizure was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0031826 Abnormal reflex was not summmarised"
## [1] "HP:0002136 Broad-based gait was not summmarised"
## [1] "HP:0002283 Global brain atrophy was not summmarised"
## [1] "HP:0002353 EEG abnormality was not summmarised"
## [1] "HP:0002355 obsolete Difficulty walking was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002371 Loss of speech was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002465 Poor speech was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0007185 Loss of consciousness was not summmarised"
## [1] "HP:0009046 Difficulty running was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0025401 Staring gaze was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001298 Encephalopathy was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002015 Dysphagia was not summmarised"
## [1] "HP:0002283 Global brain atrophy was not summmarised"
## [1] "HP:0002333 Motor deterioration was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002607 Bowel incontinence was not summmarised"
## [1] "HP:0006957 obsolete Loss of ability to walk was not summmarised"
## [1] "HP:0007359 Focal-onset seizure was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0012758 Neurodevelopmental delay was not summmarised"
## [1] "HP:0000035 Abnormal testis morphology was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0002069 Bilateral tonic-clonic seizure was not summmarised"
## [1] "HP:0100543 Cognitive impairment was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0000817 Reduced eye contact was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0000529 Progressive visual loss was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0000549 Abnormal conjugate eye movement was not summmarised"
## [1] "HP:0000572 Visual loss was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001276 Hypertonia was not summmarised"
## [1] "HP:0001430 Abnormal calf musculature morphology was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0003236 Elevated circulating creatine kinase concentration was not summmarised"
## [1] "HP:0000817 Reduced eye contact was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0025404 Abnormal visual fixation was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0000478 Abnormality of the eye was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0000572 Visual loss was not summmarised"
## [1] "HP:0000733 Motor stereotypy was not summmarised"
## [1] "HP:0000748 Inappropriate laughter was not summmarised"
## [1] "HP:0000952 Jaundice was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002465 Poor speech was not summmarised"
## [1] "HP:0006579 Prolonged neonatal jaundice was not summmarised"
## [1] "HP:0007360 Aplasia/Hypoplasia of the cerebellum was not summmarised"
## [1] "HP:0007461 Hemangiomatosis was not summmarised"
## [1] "HP:0000365 Hearing impairment was not summmarised"
## [1] "HP:0000505 Visual impairment was not summmarised"
## [1] "HP:0000608 Macular degeneration was not summmarised"
## [1] "HP:0000639 Nystagmus was not summmarised"
## [1] "HP:0000648 Optic atrophy was not summmarised"
## [1] "HP:0000707 Abnormality of the nervous system was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0000952 Jaundice was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0002066 Gait ataxia was not summmarised"
## [1] "HP:0002073 Progressive cerebellar ataxia was not summmarised"
## [1] "HP:0002123 Generalized myoclonic seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0011149 Absence seizure with eyelid myoclonia was not summmarised"
## [1] "HP:0100704 Cerebral visual impairment was not summmarised"
## [1] "HP:0007307 Rapid neurologic deterioration was not summmarised"
## [1] "HP:0001508 Failure to thrive was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0100022 Abnormality of movement was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002280 Enlarged cisterna magna was not summmarised"
## [1] "HP:0001653 Mitral regurgitation was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002465 Poor speech was not summmarised"
## [1] "HP:0006579 Prolonged neonatal jaundice was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0007360 Aplasia/Hypoplasia of the cerebellum was not summmarised"
## [1] "HP:0007461 Hemangiomatosis was not summmarised"
## [1] "HP:0001321 Cerebellar hypoplasia was not summmarised"
## [1] "HP:0002059 Cerebral atrophy was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0002011 Morphological central nervous system abnormality was not summmarised"
## [1] "HP:0003011 Abnormality of the musculature was not summmarised"
## [1] "HP:0009830 Peripheral neuropathy was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001321 Cerebellar hypoplasia was not summmarised"
## [1] "HP:0001324 Muscle weakness was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0003324 Generalized muscle weakness was not summmarised"
## [1] "HP:0003808 Abnormal muscle tone was not summmarised"
## [1] "HP:0006829 Severe muscular hypotonia was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002312 Clumsiness was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0012758 Neurodevelopmental delay was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001371 Flexion contracture was not summmarised"
## [1] "HP:0002333 Motor deterioration was not summmarised"
## [1] "HP:0002944 Thoracolumbar scoliosis was not summmarised"
## [1] "HP:0003621 Juvenile onset was not summmarised"
## [1] "HP:0004488 Macrocephaly at birth was not summmarised"
## [1] "HP:0009062 Infantile axial hypotonia was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001268 Mental deterioration was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001028 Hemangioma was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002180 Neurodegeneration was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0100543 Cognitive impairment was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001321 Cerebellar hypoplasia was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001276 Hypertonia was not summmarised"
## [1] "HP:0001508 Failure to thrive was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0002011 Morphological central nervous system abnormality was not summmarised"
## [1] "HP:0003739 Myoclonic spasms was not summmarised"
## [1] "HP:0009830 Peripheral neuropathy was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001317 Abnormal cerebellum morphology was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0007256 Abnormal pyramidal sign was not summmarised"
## [1] "HP:0100543 Cognitive impairment was not summmarised"
## [1] "HP:0000726 Dementia was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0007272 Progressive psychomotor deterioration was not summmarised"
## [1] "HP:0000726 Dementia was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0007272 Progressive psychomotor deterioration was not summmarised"
## [1] "HP:0001098 Abnormal fundus morphology was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001336 Myoclonus was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0012443 Abnormal brain morphology was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001337 Tremor was not summmarised"
## [1] "HP:0002355 obsolete Difficulty walking was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0006579 Prolonged neonatal jaundice was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002333 Motor deterioration was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002540 Inability to walk was not summmarised"
## [1] "HP:0003739 Myoclonic spasms was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001290 Generalized hypotonia was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0001348 Brisk reflexes was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002317 Unsteady gait was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002474 Expressive language delay was not summmarised"
## [1] "HP:0003676 Progressive was not summmarised"
## [1] "HP:0011166 Focal myoclonic seizure was not summmarised"
## [1] "HP:0012447 Abnormal myelination was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001324 Muscle weakness was not summmarised"
## [1] "HP:0002073 Progressive cerebellar ataxia was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002465 Poor speech was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001288 Gait disturbance was not summmarised"
## [1] "HP:0003487 Babinski sign was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0002133 Status epilepticus was not summmarised"
## [1] "HP:0002353 EEG abnormality was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0003551 Difficulty climbing stairs was not summmarised"
## [1] "HP:0006957 obsolete Loss of ability to walk was not summmarised"
## [1] "HP:0007010 Poor fine motor coordination was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001508 Failure to thrive was not summmarised"
## [1] "HP:0002059 Cerebral atrophy was not summmarised"
## [1] "HP:0002119 Ventriculomegaly was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0410263 Brain imaging abnormality was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0001992 Organic aciduria was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0000708 Atypical behavior was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001288 Gait disturbance was not summmarised"
## [1] "HP:0001324 Muscle weakness was not summmarised"
## [1] "HP:0001371 Flexion contracture was not summmarised"
## [1] "HP:0002015 Dysphagia was not summmarised"
## [1] "HP:0002194 Delayed gross motor development was not summmarised"
## [1] "HP:0002312 Clumsiness was not summmarised"
## [1] "HP:0002615 Hypotension was not summmarised"
## [1] "HP:0007010 Poor fine motor coordination was not summmarised"
## [1] "HP:0011443 Abnormality of coordination was not summmarised"
## [1] "HP:0012638 Abnormal nervous system physiology was not summmarised"
## [1] "HP:0025236 Somnambulism was not summmarised"
## [1] "HP:0000648 Optic atrophy was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001276 Hypertonia was not summmarised"
## [1] "HP:0001298 Encephalopathy was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0002505 Loss of ambulation was not summmarised"
## [1] "HP:0006957 obsolete Loss of ability to walk was not summmarised"
## [1] "HP:0000618 Blindness was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002059 Cerebral atrophy was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002493 Upper motor neuron dysfunction was not summmarised"
## [1] "HP:0000618 Blindness was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001298 Encephalopathy was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0003128 Lactic acidosis was not summmarised"
## [1] "HP:0010729 Cherry red spot of the macula was not summmarised"
## [1] "HP:0000546 Retinal degeneration was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001336 Myoclonus was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0000365 Hearing impairment was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001324 Muscle weakness was not summmarised"
## [1] "HP:0002015 Dysphagia was not summmarised"
## [1] "HP:0000365 Hearing impairment was not summmarised"
## [1] "HP:0000726 Dementia was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001260 Dysarthria was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002015 Dysphagia was not summmarised"
## [1] "HP:0000365 Hearing impairment was not summmarised"
## [1] "HP:0000405 Conductive hearing impairment was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0002354 Memory impairment was not summmarised"
## [1] "HP:0002373 Febrile seizure (within the age range of 3 months to 6 years) was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0007018 Attention deficit hyperactivity disorder was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0012447 Abnormal myelination was not summmarised"
## [1] "HP:0012448 Delayed myelination was not summmarised"
## [1] "HP:0001332 Dystonia was not summmarised"
## [1] "HP:0025268 Stuttering was not summmarised"
## [1] "HP:0030891 Periventricular white matter hyperintensities was not summmarised"
## [1] "HP:0410263 Brain imaging abnormality was not summmarised"
## [1] "HP:0000324 Facial asymmetry was not summmarised"
## [1] "HP:0000325 Triangular face was not summmarised"
## [1] "HP:0000426 Prominent nasal bridge was not summmarised"
## [1] "HP:0000494 Downslanted palpebral fissures was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001321 Cerebellar hypoplasia was not summmarised"
## [1] "HP:0001999 Abnormal facial shape was not summmarised"
## [1] "HP:0002353 EEG abnormality was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002415 Leukodystrophy was not summmarised"
## [1] "HP:0002515 Waddling gait was not summmarised"
## [1] "HP:0003781 Excessive salivation was not summmarised"
## [1] "HP:0006808 Cerebral hypomyelination was not summmarised"
## [1] "HP:0007359 Focal-onset seizure was not summmarised"
## [1] "HP:0011185 EEG with focal epileptiform discharges was not summmarised"
## [1] "HP:0012447 Abnormal myelination was not summmarised"
## [1] "HP:0000252 Microcephaly was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001272 Cerebellar atrophy was not summmarised"
## [1] "HP:0001336 Myoclonus was not summmarised"
## [1] "HP:0001337 Tremor was not summmarised"
## [1] "HP:0001348 Brisk reflexes was not summmarised"
## [1] "HP:0002120 Cerebral cortical atrophy was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0002395 Lower limb hyperreflexia was not summmarised"
## [1] "HP:0002500 Abnormal cerebral white matter morphology was not summmarised"
## [1] "HP:0002540 Inability to walk was not summmarised"
## [1] "HP:0010819 Atonic seizure was not summmarised"
## [1] "HP:0000252 Microcephaly was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001268 Mental deterioration was not summmarised"
## [1] "HP:0002167 Abnormal speech pattern was not summmarised"
## [1] "HP:0002359 Frequent falls was not summmarised"
## [1] "HP:0002371 Loss of speech was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0009830 Peripheral neuropathy was not summmarised"
## [1] "HP:0011170 Generalized myoclonic-atonic seizure was not summmarised"
## [1] "HP:0000252 Microcephaly was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001252 Hypotonia was not summmarised"
## [1] "HP:0001257 Spasticity was not summmarised"
## [1] "HP:0001347 Hyperreflexia was not summmarised"
## [1] "HP:0002194 Delayed gross motor development was not summmarised"
## [1] "HP:0002197 Generalized-onset seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0006872 Cerebral hypoplasia was not summmarised"
## [1] "HP:0012444 Brain atrophy was not summmarised"
## [1] "HP:0012447 Abnormal myelination was not summmarised"
## [1] "HP:0000252 Microcephaly was not summmarised"
## [1] "HP:0000750 Delayed speech and language development was not summmarised"
## [1] "HP:0001249 Intellectual disability was not summmarised"
## [1] "HP:0001250 Seizure was not summmarised"
## [1] "HP:0001263 Global developmental delay was not summmarised"
## [1] "HP:0001270 Motor delay was not summmarised"
## [1] "HP:0002373 Febrile seizure (within the age range of 3 months to 6 years) was not summmarised"
## [1] "HP:0003739 Myoclonic spasms was not summmarised"
## [1] "HP:0007369 Atrophy/Degeneration affecting the cerebrum was not summmarised"
## [1] "HP:0000240 Abnormality of skull size was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0004325 Decreased body weight was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0000007 Autosomal recessive inheritance was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## [1] "HP:0000007 Autosomal recessive inheritance was not summmarised"
## [1] "HP:0001251 Ataxia was not summmarised"
## [1] "HP:0001317 Abnormal cerebellum morphology was not summmarised"
## [1] "HP:0002121 Generalized non-motor (absence) seizure was not summmarised"
## [1] "HP:0002376 Developmental regression was not summmarised"
## [1] "HP:0007334 Bilateral tonic-clonic seizure with focal onset was not summmarised"
## [1] "HP:0011463 Childhood onset was not summmarised"
## Convert the list of new HPO_Terms to a table in which terms are separated into individual columns
## Ordered by overall frequency of the terms in the table, from left to right
##(a new HPO term which occurs multiple times in a single case is only counted once for that case)
# “termOrder” is a vector of unique new HPO terms, ordered by the number of positive cases
termOrder <-
newList %>%
lapply (., unlist)%>% lapply (., unique) %>% unlist %>%
table() %>% sort (decreasing = T)
# “newTable” stores cases and their new annotations in binary format (1: new HPO term was found at least once, 0: term and its descendants are absent)
# newTable <- tibble (variants_sim$ID_person)
newTable <-
variants_sim %>% select(ID_person, cDna)
for (i in 1 : length (termOrder)) {
newTable <-
cbind (newTable,
ifelse (
grepl (names(termOrder[i]), newList), 1, 0)
)
}
## Reformat contingency table
# Change column names from HPO identifiers to HPO names
termOrder <-
names(termOrder) %>%
lapply (., FUN=function (x) { hpo$name[[x]]} ) %>% unlist
newTable <-
set_names(newTable, c("ID_person", "cDna", termOrder))
# Optional: remove level 3 terms that are not an organ system abnormality, e.g. neoplasm or mode of inheritance
# This should be replaced with a filter that can be applied to all levels, i.e. selection of terms in the phenotype branch only
if (termIndex_rank == 3) {
newTable <-
newTable %>% select (., c(ID_person, grep ("Abnormality", names(.))))
}
newTable <-
newTable %>% column_to_rownames(., "ID_person")
## Write the results to a file in the working directory named “HPO. [termIndex_rank] .csv”,
# where [termIndex_rank] is a number indicating the node level of the collapsed HPO_Terms
write.csv (newTable, paste0 ("HPO.level", termIndex_rank, ".csv"))
head (newTable)
## cDna Developmental regression Seizure Ataxia Intellectual disability
## 1 c.445C>T 1 0 0 0
## 2 c.461_463del 0 0 0 0
## 3 c.794_796del 0 1 0 0
## 4 c.379C>T 0 1 0 0
## 5 c.715_717del 0 0 1 1
## 6 c.-158_83del 1 1 0 0
## Delayed speech and language development Spasticity Hypotonia
## 1 0 0 1
## 2 0 0 0
## 3 1 1 0
## 4 0 0 0
## 5 1 0 0
## 6 0 1 0
## Global developmental delay Cerebellar atrophy Hyperreflexia Motor delay
## 1 1 0 1 0
## 2 0 0 0 0
## 3 1 1 0 1
## 4 0 0 0 0
## 5 1 0 0 0
## 6 0 0 0 0
## Brain atrophy Dysarthria Generalized-onset seizure Childhood onset
## 1 0 0 0 0
## 2 0 0 0 0
## 3 1 0 0 0
## 4 0 0 0 0
## 5 0 1 0 0
## 6 1 1 0 0
## Generalized myoclonic seizure Neurodegeneration
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 1
## 5 0 0
## 6 0 1
## Abnormal cerebral white matter morphology Visual impairment Dystonia
## 1 0 0 1
## 2 0 0 0
## 3 0 0 1
## 4 0 0 0
## 5 0 0 0
## 6 0 0 1
## Frequent falls Leukodystrophy Attention deficit hyperactivity disorder
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Microcephaly Hearing impairment Hypertonia Encephalopathy
## 1 1 0 0 1
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 1 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Cerebellar hypoplasia Muscle weakness Myoclonus Motor deterioration
## 1 0 0 0 0
## 2 0 0 0 0
## 3 1 0 0 0
## 4 0 0 0 1
## 5 0 0 0 0
## 6 0 0 1 0
## Gait disturbance Dysphagia Delayed gross motor development EEG abnormality
## 1 0 0 0 0
## 2 0 0 0 0
## 3 1 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Poor speech Myoclonic spasms obsolete Loss of ability to walk
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Cherry red spot of the macula Abnormal myelination Cognitive impairment
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Atypical behavior Dementia Mental deterioration
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 1 0 0
## 6 0 0 0
## Abnormal cerebellum morphology Tremor Failure to thrive
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Morphological central nervous system abnormality Cerebral atrophy
## 1 0 0
## 2 0 0
## 3 0 0
## 4 1 0
## 5 0 0
## 6 0 0
## Febrile seizure (within the age range of 3 months to 6 years) Juvenile onset
## 1 0 0
## 2 0 0
## 3 1 0
## 4 0 0
## 5 0 0
## 6 0 0
## Prolonged neonatal jaundice Aplasia/Hypoplasia of the cerebellum
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Peripheral neuropathy Atonic seizure Autosomal recessive inheritance
## 1 0 0 0
## 2 0 0 0
## 3 0 1 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Coarse facial features Visual loss Blindness Optic atrophy
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Reduced eye contact Jaundice Brisk reflexes Flexion contracture
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Progressive cerebellar ataxia Cerebral cortical atrophy Gait imbalance
## 1 0 0 0
## 2 0 0 0
## 3 0 0 1
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormal speech pattern Exaggerated startle response Global brain atrophy
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 1 0 0
## 6 0 0 0
## Clumsiness Unsteady gait obsolete Difficulty walking Loss of speech
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Lower limb hyperreflexia Loss of ambulation Inability to walk Lactic acidosis
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 1
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Infantile onset Poor fine motor coordination Loss of consciousness
## 1 1 0 0
## 2 0 0 0
## 3 0 0 1
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Progressive psychomotor deterioration Focal-onset seizure Hemangiomatosis
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Delayed myelination Neurodevelopmental delay Abnormality of movement
## 1 1 0 0
## 2 0 0 1
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Brain imaging abnormality Abnormal testis morphology Hydrocephalus
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormality of skull size Facial asymmetry Triangular face Facial hemangioma
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Conductive hearing impairment Prominent nasal bridge Abnormality of the eye
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Strabismus Downslanted palpebral fissures Rod-cone dystrophy
## 1 1 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Progressive visual loss Optic disc pallor Retinal degeneration
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormal conjugate eye movement Abnormality of the ear Macular degeneration
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 1 0
## 5 0 0 0
## 6 0 0 0
## Nystagmus Abnormality of the nervous system Emotional lability
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Motor stereotypy obsolete Impaired social interactions Anxiety
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Inappropriate laughter Hyperactivity Hypertension Hemangioma
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Abnormal fundus morphology Spastic paraplegia Bulbar palsy Areflexia
## 1 0 0 1 1
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Generalized hypotonia Specific learning disability Absent speech
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormal calf musculature morphology Mitral regurgitation Organic aciduria
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormal facial shape Gait ataxia Bilateral tonic-clonic seizure Chorea
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Ventriculomegaly Generalized non-motor (absence) seizure Status epilepticus
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Broad-based gait Tetraparesis Enlarged cisterna magna Drooling
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Memory impairment Degeneration of anterior horn cells
## 1 0 1
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Expressive language delay Upper motor neuron dysfunction Spastic tetraplegia
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Waddling gait Abnormal periventricular white matter morphology
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 1
## Bowel incontinence Hypotension Thoracolumbar scoliosis
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Abnormality of the musculature
## 1 0
## 2 0
## 3 0
## 4 0
## 5 0
## 6 0
## Elevated circulating creatine kinase concentration
## 1 0
## 2 0
## 3 0
## 4 0
## 5 0
## 6 0
## Elevated circulating creatinine concentration Generalized muscle weakness
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 1 0
## 6 0 0
## CNS hypomyelination Babinski sign Difficulty climbing stairs Congenital onset
## 1 1 0 0 1
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Progressive Excessive salivation Abnormal muscle tone Decreased body weight
## 1 0 0 0 0
## 2 0 0 0 0
## 3 0 0 0 0
## 4 0 0 0 0
## 5 0 0 0 0
## 6 0 0 0 0
## Focal dystonia Macrocephaly at birth Impaired mastication
## 1 0 0 0
## 2 0 0 1
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Cerebral hypomyelination Severe muscular hypotonia Cerebral hypoplasia
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Lateral ventricle dilatation Dilated third ventricle Abnormal pyramidal sign
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Atypical absence seizure CNS demyelination Rapid neurologic deterioration
## 1 0 0 0
## 2 0 0 0
## 3 0 0 0
## 4 0 0 0
## 5 0 0 0
## 6 0 1 0
## Bilateral tonic-clonic seizure with focal onset
## 1 0
## 2 0
## 3 0
## 4 0
## 5 0
## 6 0
## Atrophy/Degeneration affecting the cerebrum Calf muscle hypertrophy
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 1
## 5 0 0
## 6 0 0
## Difficulty running Infantile axial hypotonia
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## EEG with generalized slow activity Delayed fine motor development
## 1 0 0
## 2 0 0
## 3 1 0
## 4 0 0
## 5 0 0
## 6 0 0
## Abnormal systemic arterial morphology Absence seizure with eyelid myoclonia
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Focal myoclonic seizure Generalized myoclonic-atonic seizure
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## EEG with focal epileptiform discharges EEG with abnormally slow frequencies
## 1 0 0
## 2 0 0
## 3 0 1
## 4 0 0
## 5 0 0
## 6 0 0
## Severe global developmental delay Caesarian section
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Abnormality of coordination EEG with frontal focal spikes
## 1 0 0
## 2 0 0
## 3 0 1
## 4 0 0
## 5 0 0
## 6 0 0
## Abnormal brain morphology Abnormal brainstem white matter morphology
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Abnormal nervous system physiology Abnormal brain lactate level by MRS
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Fetal distress Somnambulism Stuttering Staring gaze Abnormal visual fixation
## 1 0 0 0 0 0
## 2 0 0 0 0 0
## 3 0 0 0 0 0
## 4 0 0 0 0 0
## 5 0 0 0 0 0
## 6 0 0 0 0 0
## Periventricular white matter hyperintensities Abnormal reflex
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Delayed ability to walk Diminished ability to concentrate Encephalomalacia
## 1 0 0 0
## 2 0 0 0
## 3 0 1 0
## 4 0 0 0
## 5 0 0 0
## 6 0 0 0
## Cerebral visual impairment Enlarged fossa interpeduncularis
## 1 0 0
## 2 0 0
## 3 0 0
## 4 0 0
## 5 0 0
## 6 0 0
## Epileptic encephalopathy
## 1 0
## 2 0
## 3 0
## 4 0
## 5 0
## 6 0
# -- Chunk 3 -- #
# -- Required objects generated in chunk 2: newTable -- #
## Display a barchart of the most frequent new terms
# summary of HPO term frequencies is generated by newTable %>% ... colSums() %>% enframe()
# n sets the number of most frequent terms to be shown, default is slice_head (n=10)
newTable %>%
select(!cDna) %>%
colSums() %>% enframe() %>%
slice_head (n=10) %>%
ggplot(., aes(
x=factor(name, levels = name %>% rev()),
y=value)
) +
geom_bar(stat="identity") +
theme_bw() +
theme(text=element_text(size=12)) +
labs (x="HPO Term", y="Number of cases") +
coord_flip()
The plot shows the 10 most frequent HPO terms in the original data,
203 terms with lower frequency were not included. This barchart
resembles figure 3 in (1).
Summarising HPO terms at the organ system level (termIndex_rank = 3)
shows that the eye is the third most commonly affected organ:
Shown are the 10 most frequent summarised terms, 44 terms with lower
frequency were not included.
Abnormality of vision” was the
10th most frequent diagnosis at termIndex_rank = 5:
Shown are the 10 most frequent summarised terms, 4 terms with lower
frequency were not included.
This section contains unpublished work that did not contribute to the CLN6 paper (1). The results shown are for illustration only and not meant to represent results obtained with the actual patient data.
I used two approaches for exploring associations between genetic variants and clinical diagnoses:
The first approach aims to capture the full information content of the patient records by weighting HPO terms by their specificity (3). It has been used, e.g., to identify new candidate genes based on their association with related diseases (5). However, the clinical phenotype characteristic for a group of specific gene variant(s) is not immediately obvious. Therefore, I tried a complementary method that tests for association with summarised HPO terms. Here, interpretation of the results should be straightforward. Replacing higher specificity terms with common ancestors also decreases the number of comparisons, and increases the average size of individual groups. However, this comes with a loss of phenotypic information. Therefore, the term level with the highest statistical power for discriminating specific variant groups might need to be determined experimentally (in a kind of ML way- but I am not statistically astute enough to say how this will affect significance).
# Chunk 4 #
## Load additional R libraries
library(ontologySimilarity)
library(gplots)
library(RColorBrewer)
Visual inspection can indicate variants or variant groups that are associated with a similar disease phenotype. Original annotations rather than the summarised HPO terms should be used.
# -- Chunk 5 -- #
# -- Required objects generated in chunk 2: newList -- #
# -- Required objects generated in chunk 1: variants_sim -- #
## NOTE: if newList contains summarised HPO terms, run chunck 4 again setting termIndex_rank = 30
## Generate a heatmap for genetic variants, clustered by disease phenotype displayed by their carriers (semantic similarity of sets of HPO terms)
term_sets <-
set_names (newList, variants_sim$cDna)
sim_mat <-
get_sim_grid(ontology=hpo, term_sets=term_sets)
sim_mat %>%
heatmap (., scale = "none", col = cm.colors(256)
# Optional: remove "#" to display variants on x-axis in order of nucleotide position
# , Colv = NA,
# xlab = "Variants in order of nucleotide position",
# ylab = "Variants clustered by similarity of patient phenotypes",
# margins = c(7,7)
)
Phenotypes of patients with the frameshift variants c.395_396del and
c.397_398del form two clusters in the lower left quadrant of the heatmap
produced with the original HPO terms. The colour scale shows that
similarity between the two clusters exists.
Another variant associated with semantically similar HPO terms appears
to be c.773A>G.
Alternative heatmap: HPO terms summarised at organ system level,
variants ordered according to nucleotide position:
This might indicate whether mutations in a specific region of the
protein have functional consequences associated with a clinical
phenotype.
Based on the original HPO annotations, variant group c.395_396del and c.397_398del and variant c.773A>G are associated with significantly similar phenotypes, whereas the clinical presentation of CLN6 disease overall (“All”) is not significantly homogenous.
# -- Chunk 6 -- #
# -- Required objects generated in chunk 1: variants_sim -- #
# -- Required objects generated in chunk 5: sim_mat -- #
## Enter a list of variant groups
group_variants <- list(c("c.395_396del", "c.397_398del"),
"c.773A>G",
"All")
## Function for generating a table of variant groups and their characteristics
get_similarityTbl <- function(x) {
groupName <-
group_variants[[x]] %>% unlist() %>%
paste(., collapse = ", ")
if (groupName == "All") {
group_index <-
1:nrow(sim_mat)
n <-
nrow(variants_sim)
} else {
group_index <-
which( row.names(sim_mat) %in% unlist(group_variants[[x]]) )
n <-
sum( variants_sim$cDna %in% unlist(group_variants[[x]]) )
}
if (length(group_index) < 2) {
stop( paste( "Group", x, "should contain at least two members") )
}
s <-
sim_mat %>% get_sim(group_index)
p <-
sim_mat %>% get_sim_p(group_index)
result <- tibble(
Group = groupName,
`n(Group)` = n,
Similarity = s,
`p-value` = p
)
return(result)
}
map_df(seq_along(group_variants), get_similarityTbl)
## # A tibble: 3 × 4
## Group `n(Group)` Similarity `p-value`
## <chr> <int> <dbl> <dbl>
## 1 c.395_396del, c.397_398del 8 0.698 0.000360
## 2 c.773A>G 3 0.921 0.0000200
## 3 All 85 0.513 0.652
# -- Chunk 7 -- #
# -- Required objects generated in chunk 1: variants_sim -- #
# -- Required objects generated in chunk 2: newTable -- #
## This code is not intended for generating the final plot but rather dendograms of patient IDs and summarised HPO terms
# The reason is that the distance matrix requires unique column names (provided by the patient IDs)
# Patient IDs are the replaced with variant names (or any other variable from variants_sim) afterwards
## Choose methods for distance and clustering methods applied to columns and rows
# rd / rc are for columns, cd / cc for rows because matrix will be transformed later
# Different methods for distance and clustering of person IDs (y - axis) can be explored by changing the "#" ("ward" and "average" should perform best for sparse matrices)
rd <- newTable %>% select(!cDna) %>%
dist(., method= "euclidean")
# Change "#" to pick an alternative method for distance of x-axis values
# dist(., method = # "euclidean")^2
# as.dist((1-cor(t(.)))/2)
# dist(., method = "maximum")
# dist(., method = "manhattan")
# dist(., method = "canberra")
# dist(., method = "binary")
# dist(., method = "minkowski")
rc<-hclust(rd, method = "ward.D"
# Change "#" to pick an alternative method for distance of x-axis clustering
# "ward.D2"
# "single"
# "complete"
# "average"
# "mcquitty"
# "median"
# "centroid"
)
cd<- newTable %>% select(!cDna) %>%
t() %>%
dist(., method = "euclidean")
# Change "#" to pick an alternative method for distance of y-axis values
# dist(., method = "euclidean")^2
# as.dist((1-cor(t(.)))/2)
# dist(., method = "maximum")
# dist(., method = "manhattan")
# dist(., method = "canberra")
# dist(., method = "binary")
# dist(., method = "minkowski")
cc<-hclust(cd, method = "ward.D"
# Change "#" to pick an alternative method for distance of y-axis clustering
# "ward.D2"
# "single"
# "complete"
# "average"
# "mcquitty"
# "median"
# "centroid"
)
## Generate the dendrogram
hv <- newTable %>% select(!cDna) %>%
data.matrix () %>% t() %>%
heatmap.2(., scale="none",
Rowv=as.dendrogram(cc),
Colv=as.dendrogram(rc),
margins = c(0,0)
)
## Summarise "loss of function" (LoF) coding effects
variants_sim_lof <- variants_sim %>% mutate (LoF_status = Coding_Effect) %>%
mutate (LoF_status = case_when (
LoF_status %in% c("Frameshift", "Start loss", "Nonsense", "Splicing mutation") ~ "LoF",
LoF_status == "Effect unknown" ~"?",
.default = as.character (LoF_status) )
)
## Variable to replace patient IDs on the x-axis
# Change "#" to pick an alternative variable
xVar <-
"cDna"
# "LoF_status"
xVar <-
pull (variants_sim_lof, xVar)
new_labCol <-
rep('', nrow(variants_sim_lof))
new_labCol[hv$colInd[order(xVar)]] <-
xVar[hv$colInd[order(xVar)]]
# Alternative x-axis variable: LoF status
# new_labCol[hv$colInd[order(variants_sim_lof$LoF_status)]] <- variants_sim_lof$LoF_status[hv$colInd[order(variants_sim_lof$LoF_status)]]
## Variable to be displayed as column side colors
# Change "#" to pick an alternative variable
ColSideVar <-
"LoF_status"
# "Coding_Effect"
# "Clinical_Significance"
# "Gender"
ColSideVar <-
pull (variants_sim_lof, LoF_status)
ColSideColors <-
brewer.pal(
unique(ColSideVar) %>% length(), "Set1") %>%
factor() %>%
.[match (ColSideVar, unique(ColSideVar) %>% sort() )] %>%
as.character()
## Chunk 8 #
# -- Required objects generated in chunk 2: newTable, newList -- #
# -- Required objects generated in chunk 7: rc, cc, ColSideVar, ColSideColors -- #
## Generate plot with chosen variables for x-axis and optional column side colours
par(cex.main=1)
newTable %>% select(!cDna) %>%
data.matrix () %>% t() %>%
heatmap.2(
scale="none",
Rowv=as.dendrogram(cc),
Colv=as.dendrogram(rc),
col = colorpanel(2, "white", "darkgrey"),
key = F,
margins = c(1200/(newList %>%
unlist %>% unique %>% length()),36),
lhei = c(2,12), lwid = c(1,13),
cexRow = 0.4,
cexCol = 0.6,
labCol = new_labCol,
ColSideColors = ColSideColors,
tracecol=NA,
xlab = "Variant",
ylab = "HPO Term",
main=paste("Variants and Clinical Presentation")
)
legend (y = 1, x = 0.8, xpd=F,
legend = unique(ColSideVar),
col = unique(ColSideColors),
lty= 6,
lwd = 5,
cex= 0.7
)
LoF: “Loss of Function” variants (frameshift, splicing mutation,
start_loss, nonsense)
Alternative clustering with HPO terms
summarised at organ system level:
* Frameshift variants c.395_396del and c.397_398del appear to be
associated with eye abnormalities
In the figures above “cutting” the column dendogram branches at different heights produces groups of patients with more or less similar sets of clinical symptoms. The following code chunks analyse whether variants were enriched in any of these clusters. First, the branching height k is determined at which the distribution of variants diverges most significantly from the hypothesis is that each variant has an equal probability to be a member of any cluster. Next, a table of variant clusters and simulated p-value are returned for this value of k. In the current implementation, visual inspection of the cluster table can be used to identify variants which
## Chunk 9 #
# -- Required objects generated in chunk 2: newTable, newList -- #
# -- Required objects generated in chunk 7: variants_sim_lof,
# rc, cc, ColSideVar, ColSideColors -- #
## Generate a list of table showing the number of times each variant is present in different clusters, defined by cutting the dendogram at a height “k”
## Find the dendogram height at which the clustering is most significant and return the corresponding table of clusters
# P-values are based on simulations, testing the null hypothesis that the carriers of each variant are evenly distributed among the clusters
clusterTables <- list()
chisqTests <- list()
chisqTests_pVal <- c()
for (k in 2:(nrow(variants_sim_lof)-1)) {
clusters <-
tibble(cDna = unique (variants_sim_lof$cDna))
for (i in 1:k) {
next_cluster <-
cutree(rc, k) [hv$colInd] %>%
{ set_names(
variants_sim_lof$cDna[hv$colInd])[as.numeric(.)== i]} %>%
names() %>%
table() %>%
enframe( name = "cDna", value = paste ("Cluster", i) )
clusters <-
full_join (clusters, next_cluster, by = "cDna")
}
clusters <-
clusters %>% column_to_rownames (., var="cDna") %>%
replace( is.na(.), 0 ) %>%
mutate( prob = rowSums(.)/k)
clusterTables[[k]] <-
clusters
chisqTests[[k]] <-
clusters[ , 1:k] %>%
chisq.test( simulate.p.value = T, p = .$prob, rescale.p = T)
chisqTests_pVal <-
c( chisqTests_pVal, chisqTests[[k]] %>%
.$p.value )
}
chisqTests_pVal %>%
log10() %>%
plot(
x=c(2:(nrow(variants_sim_lof)-1)),
type = "b",
xlab = "k", ylab = "Cluster log10_p-value",
main = paste (
"Clustering is most significant when cutting the dendogram at a height of k = ",
which.min(chisqTests_pVal)+1 ),
cex.main = 0.9
)
## Chunk 10 #
# -- Required objects generated in chunk 9: clusterTables, chisqTests_pVal -- #
## Output details for the most significant k level
clusterTables[[which.min(chisqTests_pVal)+1]] %>%
write.csv (., paste0 ("clusters_", which.min(chisqTests_pVal)+1, ".csv"))
chisqTests[[which.min(chisqTests_pVal)+1]]
clusterTables[[which.min(chisqTests_pVal)+1]]
##
## Pearson's Chi-squared test with simulated p-value (based on 2000
## replicates)
##
## data: .
## X-squared = 201.35, df = NA, p-value = 0.0004998
##
## Cluster 1 Cluster 2 Cluster 3 Cluster 4 Cluster 5 prob
## c.445C>T 1 0 0 0 0 0.2
## c.461_463del 0 1 2 0 0 0.6
## c.794_796del 6 3 15 3 0 5.4
## c.379C>T 0 1 0 0 0 0.2
## c.715_717del 0 1 0 0 0 0.2
## c.-158_83del 0 0 1 0 0 0.2
## c.-158_83dup 0 1 0 0 0 0.2
## c.1_11del 0 0 1 0 0 0.2
## c.115C>G 0 1 0 0 0 0.2
## c.144G>A 0 0 1 0 0 0.2
## c.164A>C 0 0 0 1 0 0.2
## c.177C>G 0 0 1 0 0 0.2
## c.214G>T 0 1 0 0 0 0.2
## c.247G>A 0 0 2 0 0 0.4
## c.248A>G 1 0 0 0 0 0.2
## c.257A>G 2 2 0 1 0 1.0
## c.281C>T 0 0 0 1 0 0.2
## c.299T>G 0 0 1 0 0 0.2
## c.316dup 1 0 0 0 1 0.4
## c.350T>G 0 0 1 0 0 0.2
## c.395_396del 0 0 0 0 6 1.2
## c.397_398del 0 0 0 0 2 0.4
## c.406C>T 0 1 0 0 0 0.2
## c.407G>A 0 0 2 0 0 0.4
## c.434A>C 0 0 0 0 1 0.2
## c.434A>G 0 1 0 0 0 0.2
## c.476C>T 0 2 1 0 0 0.6
## c.486+2T>A 0 1 0 0 0 0.2
## c.486+2T>C 0 1 0 0 0 0.2
## c.543-2A>G 0 1 0 0 0 0.2
## c.587G>T 0 1 0 0 0 0.2
## c.659A>C 0 1 0 0 0 0.2
## c.662A>C 0 2 2 0 0 0.8
## c.757_759del 0 0 1 0 0 0.2
## c.765_785del 0 1 0 0 0 0.2
## c.768C>G 0 1 0 0 0 0.2
## c.773A>G 3 0 0 0 0 0.6
For associations with the original HPO terms, the most
significant variant enrichments exist when cutting the dendrogram at a
height of k = 5. Here, all phenotypes associated with c.395_396del and
c.397_398del variants become members of the same cluster (cluster 5),
constituting 8 of its 10 members. At the next most significant branch
level, k= 10 (p-value = 0.006), c.395_396del carriers comprise a unique
group (cluster 8), while c.397_398del carriers constitute 2 of the 4
members of cluster 7.
These result are consistent with the observations in section 4.1. which were made using information-content weighted HPO terms.
Summarizing HPO terms at different levels did not affect the p-value of the most significant clustering in most cases. However, it reduced significance for HPO levels 3, 4, 6, 11 and 15 (not shown).
Note that these results are for illustration and might not
reflect any associations present in patients with CLN6 disease!
Clinical and genetic characterization of a cohort of 97 CLN6 patients tested at a single center Rus CM, Weissensteiner T, Pereira C, …, Beetz C. Orphanet J Rare Dis. 2022 May 3;17(1):179
The Human Phenotype Ontology in 2021 Köhler S, Gargano M, Matentzoglu N, …, Robinson PN. Nucleic Acids Res. 2021 Jan 8;49(D1):D1207-D1217
ontologyX: a suite of R packages for working with ontological data Greene D, Richardson S, Turro E. Bioinformatics. 2017 Apr 1;33(7):1104-1106
Complex trait associations in rare diseases and impacts on Mendelian variant interpretation Smail C, Ge B, Keever-Keigher MR, Schwendinger-Schreck C, Cheung W, Johnston JJ, Barrett C; Genomic Answers for Kids Consortium; Feldman K, Cohen ASA, Farrow EG, Thiffault I, Grundberg E, Pastinen T. medRxiv [Preprint]. 2024 Jan 11:2024.01.10.24301111
Network analysis reveals rare disease signatures across multiple levels of biological organization Buphamalai P, Kokotovic T, Nagy V, Menche J. Nat Commun. 2021 Nov 9;12(1):6306