-
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.
- Loading branch information
Showing
18 changed files
with
135 additions
and
48 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
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
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
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,47 @@ | ||
#' @describeIn get_ get_ | ||
#' Get Human Phenotype Ontology (HPO) mappings | ||
#' | ||
#' Get mappings between HPO terms and their corresponding IDs in | ||
#' other medical ontologies (e.g. SNOMED CT, UMLS, ICD-9/10). | ||
#' @param to Medical ontologies to provide mappings to. | ||
#' @param max_dist Maximum cross-ontology distance to search for mappings. | ||
#' A distance of 1 means only direct mappings are returned. | ||
#' Greater distances mean that mappings are found through intermediate terms | ||
#' and are therefore less reliable. | ||
#' @inheritDotParams get_data | ||
#' @returns A named list of \link{data.table} objects containing mappings. | ||
#' | ||
#' @export | ||
#' @examples | ||
#' mappings <- get_mappings() | ||
get_mappings <- function(terms=NULL, | ||
to=c("UMLS","SNOMED","ICD9","ICD10"), | ||
max_dist=1, | ||
force_new=FALSE, | ||
save_dir=KGExplorer::cache_dir(package="HPOExplorer"), | ||
|
||
...){ | ||
file_name <- distance <- NULL; | ||
|
||
files <- piggyback::pb_list(repo = "neurogenomics/HPOExplorer") | ||
files <- data.table::data.table(files)[grepl("*_to_HPO_dist3\\.csv\\.gz$", | ||
file_name)] | ||
files$to <- strsplit(files$file_name,"_to_HPO_dist3\\.csv\\.gz$")|>unlist() | ||
opts <- intersect(toupper(unique(files$to)), | ||
toupper(to)) | ||
if(length(opts)==0){ | ||
stop("`to` must be one of: ",paste0(shQuote(opts),collapse=", ")) | ||
} | ||
out <- lapply(stats::setNames(opts,opts), function(x){ | ||
f <- get_data(file=files[opts==x]$file_name[1], | ||
overwrite = force_new, | ||
save_dir = save_dir, | ||
...) | ||
d <- data.table::fread(f) | ||
if(is.numeric(max_dist)){ | ||
d <- d[distance<=max_dist] | ||
} | ||
d | ||
}) | ||
return(out) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.