Skip to content

Commit

Permalink
Merge pull request YuLab-SMU#21 from YuLab-SMU/devel
Browse files Browse the repository at this point in the history
update term2name
  • Loading branch information
huerqiang authored Oct 9, 2023
2 parents 6b0bb4a + 7040c5e commit e9266b9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DOSE
Type: Package
Title: Disease Ontology Semantic and Enrichment analysis
Version: 3.27.2
Version: 3.27.3
Authors@R: c( person(given = "Guangchuang", family = "Yu", email = "[email protected]", role = c("aut", "cre")),
person(given = "Li-Gen", family = "Wang", email = "[email protected]", role = "ctb"),
person(given = "Vladislav", family = "Petyuk", email = "[email protected]", role = "ctb"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# DOSE 3.27.3

+ update `TERM2NAME()` to return term if corresponding name not found. (2023-10-09, Mon)

# DOSE 3.27.2

+ use 'MPO.db' and 'HPO.db' to support phenotype ontology for mouse and human (2023-06-30, Fri)
Expand Down
19 changes: 12 additions & 7 deletions R/enricher_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,21 @@ TERM2NAME <- function(term, USER_DATA) {
if (is.null(PATHID2NAME) || all(is.na(PATHID2NAME))) {
return(as.character(term))
}
return(PATHID2NAME[term])
res <- PATHID2NAME[term]
i <- is.na(res)
res[i] <- term[i]
} else if (inherits(USER_DATA, "GSON")) {
gsid2name <- USER_DATA@gsid2name
res <- setNames(vapply(term, function(x) {
subset(gsid2name, gsid2name$gsid == x)[["name"]]
}, character(1)), term)
return(res)
}
i <- match(term, gsid2name$gsid)
j <- !is.na(i)
res <- term
res[j] <- gsid2name$name[i[j]]
} else {
res <- as.character(term)
}

return(as.character(term))
names(res) <- term
return(res)
}

get_geneSet_index <- function(geneSets, minGSSize, maxGSSize) {
Expand Down

0 comments on commit e9266b9

Please sign in to comment.