generated from neurogenomics/templateR
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port function from HPOExplorer to avoid circular dependency
- Loading branch information
Showing
7 changed files
with
104 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,6 @@ Suggests: | |
BiocGenerics, | ||
readxl, | ||
htmlwidgets, | ||
HPOExplorer, | ||
sparklyr, | ||
httr, | ||
jsonlite, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#' @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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.