R/get_hpo_termID_direct.R

Defines functions get_hpo_termID_direct

Documented in get_hpo_termID_direct

#' Get HPO term ID direct
#'
#' This is similar to the \code{get_hpo_germID} function except it does not take
#' the ID from the phenotype_to_genes dataframe. It directly gets it from the HPO
#' ontology object (found in the ontologyIndex package \code{data(hpo)}). This
#' allows you to get the ID of terms that do not have gene annotations.
#'
#' Why not always use this? I have found that occasionally it doesnt work. Also,
#' it requires you to load the full hpo object to get an ID, which is wasteful
#' if you are only using the gene annotations.
#'
#' @param phenotype The phenotype of interest <string>
#' @param hpo The HPO object from ontologyIndex package <list>
#' @returns The HPO ID of phenotype <string>
#' @export
get_hpo_termID_direct <- function(hpo,phenotype = "Phenotypic abnormality") {
  return (hpo$id[which(phenotype == hpo$name)])
}
ovrhuman/HPOExplorer documentation built on Dec. 22, 2021, 5:21 a.m.