A hoverbox is a box of text that shows up when the cursor hovers over something. These can be useful when making interactive network plots of the HPO phenotypes because we can include a hoverbox that gives information and data associated with each phenotype.

make_hoverboxes(
  phenos,
  columns = list_columns(),
  interactive = TRUE,
  width = 60,
  digits = 3,
  verbose = TRUE
)

Arguments

phenos

dataframe of phenotypes and values / parameters.

columns

A named vector of columns in phenos to add to the hoverdata via make_hoverboxes.

interactive

Make the plot interactive with ggplotly.

width

Positive integer giving target line width (in number of characters). A width less than or equal to 1 will put each word on its own line.

digits

integer indicating the number of decimal places (round) or significant digits (signif) to be used. For round, negative values are allowed (see ‘Details’).

verbose

Print messages.

Value

A nicely formatted string with newlines etc, to be used as a hoverbox.

Details

This function expects a dataframe of with a "hpo_name" column that has the name of each phenotype. It must then include columns for all of the parameters you wish to include in the hoverbox.

Examples

phenos <- make_phenos_dataframe(ancestor = "Neurodevelopmental delay",
                                add_hoverboxes = FALSE)
#>  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!
phenos <- make_hoverboxes(phenos = phenos)
#> Making hoverboxes from: 'hpo_name', 'hpo_id', 'ontLvl', 'ontLvl_geneCount_ratio', 'definition', 'ancestor', 'ancestor_name'