Make a dataframe from a subset of the Human Phenotype Ontology.
make_phenos_dataframe(
ancestor = NULL,
hpo = get_hpo(),
phenotype_to_genes = load_phenotype_to_genes(),
adjacency = NULL,
add_ont_lvl_absolute = TRUE,
add_ont_lvl_relative = FALSE,
add_info_contents = FALSE,
add_description = TRUE,
add_disease_data = FALSE,
add_ndiseases = add_disease_data,
add_onsets = add_disease_data,
add_deaths = add_disease_data,
add_pheno_frequencies = add_disease_data,
add_tiers = add_disease_data,
add_severities = add_disease_data,
add_hoverboxes = FALSE,
columns = list_columns(),
interactive = TRUE,
verbose = TRUE
)
The ancestor to get all descendants of. If NULL
,
returns the entirely ontology.
Human Phenotype Ontology object, loaded from ontologyIndex.
Output of load_phenotype_to_genes mapping phenotypes to gene annotations.
An adjacency matrix generated by adjacency_matrix.
Add the absolute ontology level of each HPO term. See get_ont_lvls for more details.
Add the relative ontology level of each HPO term. See get_ont_lvls for more details.
Add information content column for each phenotype.
Whether to get the phenotype descriptions as well (slower).
Add all disease metadata columns.
This will expand the data using allow.cartesian=TRUE
.
Add the number of diseases per phenotype.
Add age of onset columns using add_onset.
Add age of death columns using add_death.
Add the frequency of each phenotype in each disease.
Add severity Tiers column using add_tier.
Add severity column using add_severity.
Add hoverdata with make_hoverboxes.
A named vector of columns in phenos
to add to the hoverdata via make_hoverboxes.
Make the plot interactive with ggplotly.
Print messages.
The HPO in dataframe format.
phenos <- make_phenos_dataframe(ancestor = "Neurodevelopmental delay")
#> ℹ All local files already up-to-date!
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2023-10-09
#> Extracting data for 23 descendents.
#> Computing gene counts.
#> Getting absolute ontology level for 23 HPO IDs.
#> Computing ontology level / gene count ratio.
#> Adding term definitions.
#> ℹ All local files already up-to-date!
#> Adding level-3 ancestor to each HPO ID.
#> ℹ All local files already up-to-date!