Annotate each HPO with modifier terms, including (but not limited to) progression and severity ratings. In order of increasing severity:

  • HP:0012825 "Mild" (Severity_score=4)

  • HP:0012827 "Borderline" (Severity_score=3)

  • HP:0012828 "Severe" (Severity_score=2)

  • HP:0012829"Profound" (Severity_score=1)

add_severity(
  phenos,
  hpo = get_hpo(),
  all.x = TRUE,
  allow.cartesian = FALSE,
  severity_threshold = NULL,
  verbose = TRUE
)

Arguments

phenos

dataframe of phenotypes and values / parameters.

hpo

Human Phenotype Ontology object, loaded from ontologyIndex.

all.x

logical; if TRUE, then extra rows will be added to the output, one for each row in x that has no matching row in y. These rows will have 'NA's in those columns that are usually filled with values from y. The default is FALSE, so that only rows with data from both x and y are included in the output.

allow.cartesian

See allow.cartesian in [.data.table.

severity_threshold

Only keep phenotypes with a mean severity score (averaged across multiple associated diseases) below the set threshold. The severity score ranges from 1-4 where 1 is the MOST severe. Include NA if you wish to retain phenotypes that do not have any severity score.

verbose

Print messages.

Value

phenos data.table with extra columns

Examples

phenos <- example_phenos()
#>  All local files already up-to-date!
phenos2 <- add_severity(phenos = phenos)
#> Annotating phenos with modifiers
#> Annotating phenos with Disease
#> Reading cached RDS file: phenotype.hpoa
#> + Version: v2023-10-09