From 87f26711769eafc45a196d3ce671d13fdb137903 Mon Sep 17 00:00:00 2001 From: bschilder Date: Tue, 7 Jan 2025 23:45:06 -0500 Subject: [PATCH] Remove get_hpo function --- NAMESPACE | 1 - NEWS.md | 2 ++ R/get_hpo.R | 43 ------------------------------ R/map_upheno_data_i.R | 2 +- man/get_.Rd | 62 +++++++++++++------------------------------ 5 files changed, 21 insertions(+), 89 deletions(-) delete mode 100644 R/get_hpo.R diff --git a/NAMESPACE b/NAMESPACE index 20f5822..8111e39 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,7 +22,6 @@ export(get_gencc) export(get_gene_lengths) export(get_genes_disease) export(get_graph_colnames) -export(get_hpo) export(get_monarch) export(get_monarch_files) export(get_monarch_kg) diff --git a/NEWS.md b/NEWS.md index 97e6e8a..cb19657 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ * `get_opentargets`: Limit threads and files to import in example. * Merge fixes by @HDash https://github.com/neurogenomics/KGExplorer/pull/2 * `dt_to_kg`: fix reference to graph `g`. +* `get_hpo` + - Remove ported function to avoid conflicting namespaces. Instead, simply use `get_ontology("hpo")` # KGExplorer 0.99.05 diff --git a/R/get_hpo.R b/R/get_hpo.R deleted file mode 100644 index 00f526c..0000000 --- a/R/get_hpo.R +++ /dev/null @@ -1,43 +0,0 @@ -#' @describeIn get_ get_ -#' Get Human Phenotype Ontology (HPO) -#' -#' Updated version of Human Phenotype Ontology (HPO). -#' Created from the OBO files distributed by the HPO project's -#' \href{https://github.com/obophenotype/human-phenotype-ontology}{GitHub}. -#' Adapted from \link[HPOExplorer]{get_hpo}. -#' -#' By comparison, the \code{hpo} data from \pkg{ontologyIndex} is from 2016. -#' Note that the maximum ontology level depth in the 2016 version was 14, -#' whereas in the 2023 version the maximum ontology level depth is 16 -#' (due to an expansion of the HPO). -#' @inheritParams get_ontology -#' @inheritDotParams get_ontology -#' @returns \link[simona]{ontology_DAG} object. -#' -#' @export -#' @examples -#' hpo <- get_hpo() -get_hpo <- function(lvl = 2, - force_new = FALSE, - terms=NULL, - ## rols imports the international version for some reason - method="github", - save_dir=cache_dir(package = "KGExplorer"), - ...){ - - file <- file.path(save_dir,"hp.rds") - if(!file.exists(file) || isTRUE(force_new)){ - ont <- get_ontology(name = "hp", - lvl = lvl, - force_new = force_new, - terms = terms, - method = method, - save_dir = save_dir, - ...) - saveRDS(ont,file) - } else { - ont <- readRDS(file) - } - ont <- filter_ontology(ont = ont, terms = terms) - return(ont) -} diff --git a/R/map_upheno_data_i.R b/R/map_upheno_data_i.R index da5104a..6c94cae 100644 --- a/R/map_upheno_data_i.R +++ b/R/map_upheno_data_i.R @@ -27,7 +27,7 @@ map_upheno_data_i <- function(pheno_map_method, pheno_map[,db1:=gsub("*:.*","",basename(id1))] } else if(pheno_map_method=="monarch"){ - hpo <- get_hpo() + hpo <- get_ontology(name = "hpo") out <- monarchr::monarch_search(query = NULL, category = "biolink:PhenotypicFeature", limit = 500) diff --git a/man/get_.Rd b/man/get_.Rd index 8d92860..1e3e879 100644 --- a/man/get_.Rd +++ b/man/get_.Rd @@ -2,12 +2,12 @@ % Please edit documentation in R/0docs.R, R/get_alphamissense.R, % R/get_clinvar.R, R/get_data_package.R, R/get_definitions.R, R/get_gencc.R, % R/get_gene_lengths.R, R/get_genes_disease.R, R/get_graph_colnames.R, -% R/get_hpo.R, R/get_medgen_maps.R, R/get_metadata_omim.R, -% R/get_metadata_orphanet.R, R/get_monarch.R, R/get_monarch_files.R, -% R/get_monarch_kg.R, R/get_monarch_models.R, R/get_mondo_maps.R, -% R/get_mondo_maps_files.R, R/get_ols_options.R, R/get_ontology.R, -% R/get_ontology_dict.R, R/get_ontology_levels.R, R/get_pli.R, -% R/get_prevalence.R, R/get_ttd.R, R/get_upheno.R, R/get_version.R +% R/get_medgen_maps.R, R/get_metadata_omim.R, R/get_metadata_orphanet.R, +% R/get_monarch.R, R/get_monarch_files.R, R/get_monarch_kg.R, +% R/get_monarch_models.R, R/get_mondo_maps.R, R/get_mondo_maps_files.R, +% R/get_ols_options.R, R/get_ontology.R, R/get_ontology_dict.R, +% R/get_ontology_levels.R, R/get_pli.R, R/get_prevalence.R, R/get_ttd.R, +% R/get_upheno.R, R/get_version.R \name{get_} \alias{get_} \alias{get_alphamissense} @@ -18,7 +18,6 @@ \alias{get_gene_lengths} \alias{get_genes_disease} \alias{get_graph_colnames} -\alias{get_hpo} \alias{get_medgen_maps} \alias{get_metadata_omim} \alias{get_metadata_orphanet} @@ -86,15 +85,6 @@ get_genes_disease( get_graph_colnames(g, what = c("nodes", "edges")) -get_hpo( - lvl = 2, - force_new = FALSE, - terms = NULL, - method = "github", - save_dir = cache_dir(package = "KGExplorer"), - ... -) - get_medgen_maps() get_metadata_omim(save_dir = cache_dir()) @@ -253,7 +243,7 @@ Passes to \link{get_monarch_files}.} \item{run_map_mondo}{Run \link{map_mondo} to map MONDO IDs to disease IDs.} \item{...}{ - Arguments passed on to \code{\link[=link_monarch]{link_monarch}}, \code{\link[=get_ontology]{get_ontology}}, \code{\link[data.table:fread]{data.table::fread}}, \code{\link[data.table:fread]{data.table::fread}}, \code{\link[=get_ontology_github]{get_ontology_github}} + Arguments passed on to \code{\link[=link_monarch]{link_monarch}}, \code{\link[data.table:fread]{data.table::fread}}, \code{\link[data.table:fread]{data.table::fread}}, \code{\link[=get_ontology_github]{get_ontology_github}} \describe{ \item{\code{node_filters}}{A named list of filters to apply to the node data. Names should be name of the metadata column, and values should be a vector of @@ -304,17 +294,6 @@ return any rows where the "type" column contains either "gene" or "variant".} \item{what}{What should get activated? Possible values are \code{nodes} or \code{edges}.} -\item{lvl}{Depth of the ancestor terms to add. -Will get the closest ancestor to this level if none have this exact level.} - -\item{terms}{A vector of ontology term IDs.} - -\item{method}{Compute ontology levels using: -\itemize{ - \item{"height" (default)} \link[simona]{dag_height}. - \item{"depth"} \link[simona]{dag_depth}. -}} - \item{queries}{A list of free-form substring queries to filter files by (using any column in the metadata). For example, \code{list("gene_disease","variant_disease")} will return any @@ -359,13 +338,24 @@ Can be a character vector of one or more column names.} \item{ol}{An \link[rols]{Ontologies} object.} +\item{method}{Compute ontology levels using: +\itemize{ + \item{"height" (default)} \link[simona]{dag_height}. + \item{"depth"} \link[simona]{dag_depth}. +}} + \item{filetype}{File type to search for.} \item{import_func}{Function to import the ontology with. If \code{NULL}, automatically tries to choose the correct function.} +\item{terms}{A vector of ontology term IDs.} + \item{add_metadata}{Add metadata to the resulting ontology object.} +\item{lvl}{Depth of the ancestor terms to add. +Will get the closest ancestor to this level if none have this exact level.} + \item{add_n_edges}{Add the number of edges (connections) for each term.} \item{add_ontology_levels}{Add the ontology level for each term.} @@ -430,8 +420,6 @@ A named list of data.tables of AlphaMissense predictions. data.table -\link[simona]{ontology_DAG} object. - \link[data.table]{data.table} \link[data.table]{data.table} of mappings. @@ -516,19 +504,6 @@ Load gene lists associated with each disease phenotype from: \item \code{get_graph_colnames()}: get_ Get column names in the nodes and/or edges of a tbl_graph. -\item \code{get_hpo()}: get_ -Get Human Phenotype Ontology (HPO) - -Updated version of Human Phenotype Ontology (HPO). -Created from the OBO files distributed by the HPO project's -\href{https://github.com/obophenotype/human-phenotype-ontology}{GitHub}. -Adapted from \link[HPOExplorer]{get_hpo}. - -By comparison, the \code{hpo} data from \pkg{ontologyIndex} is from 2016. -Note that the maximum ontology level depth in the 2016 version was 14, -whereas in the 2023 version the maximum ontology level depth is 16 - (due to an expansion of the HPO). - \item \code{get_medgen_maps()}: get_ Get MedGen maps. @@ -650,7 +625,6 @@ ont <- get_ontology("hp", terms=10) def <- get_definitions(ont) d <- get_gencc() genes <- get_genes_disease() -hpo <- get_hpo() dat <- get_monarch(maps=list(c("gene","disease"))) files <- get_monarch_files() \dontrun{