Skip to content

Commit

Permalink
Merge pull request #18 from YuLab-SMU/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
huerqiang committed Mar 15, 2023
2 parents 7e5674a + 37572b5 commit 2204cb9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 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.25.0.001
Version: 3.25.0.002
Authors@R: c( person(given = "Guangchuang", family = "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre")),
person(given = "Li-Gen", family = "Wang", email = "reeganwang020@gmail.com", role = "ctb"),
person(given = "Vladislav", family = "Petyuk", email = "petyuk@gmail.com", role = "ctb"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# DOSE 3.25.0.001
# DOSE 3.25.0.002

+ use `inherits` to judge the class of objects (2022-11-20, Sun)
+ test whether slot in `GSON` object is NULL (e.g., `GSON@keytype`) when assigning it to enrichment result (2022-11-07, Mon)

# DOSE 3.24.0
Expand Down
3 changes: 2 additions & 1 deletion R/build_Anno.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ build_Anno <- function(path2gene, path2name) {
}
Anno_clusterProfiler_Env <- get(".Anno_clusterProfiler_Env", envir= .GlobalEnv)

if(class(path2gene[[2]]) == 'list') {
# if(class(path2gene[[2]]) == 'list') {
if (inherits(path2gene[[2]], "list")){
## to compatible with tibble
path2gene <- cbind(rep(path2gene[[1]],
times = vapply(path2gene[[2]], length, numeric(1))),
Expand Down
3 changes: 2 additions & 1 deletion R/enricher_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ enricher_internal <- function(gene,
p.adj <- p.adjust(Over$pvalue, method=pAdjustMethod)
qobj <- tryCatch(qvalue(p=Over$pvalue, lambda=0.05, pi0.method="bootstrap"), error=function(e) NULL)

if (class(qobj) == "qvalue") {
# if (class(qobj) == "qvalue") {
if (inherits(qobj, "qvalue")) {
qvalues <- qobj$qvalues
} else {
qvalues <- NA
Expand Down
8 changes: 5 additions & 3 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ calculate_qvalue <- function(pvals) {

qobj <- tryCatch(qvalue(pvals, lambda=0.05, pi0.method="bootstrap"), error=function(e) NULL)

if (class(qobj) == "qvalue") {
# if (class(qobj) == "qvalue") {
if (inherits(qobj, "qvalue")) {
qvalues <- qobj$qvalues
} else {
qvalues <- NA
Expand Down Expand Up @@ -78,8 +79,9 @@ calculate_qvalue <- function(pvals) {
return(numeric(0))

qobj <- tryCatch(qvalue(pvals, lambda=0.05, pi0.method="bootstrap"), error=function(e) NULL)

if (class(qobj) == "qvalue") {

# if (class(qobj) == "qvalue") {
if (inherits(qobj, "qvalue")) {
qvalues <- qobj$qvalues
} else {
qvalues <- NA
Expand Down

0 comments on commit 2204cb9

Please sign in to comment.