From 751ca5f0d48736dbfe419677a87f3793e2736192 Mon Sep 17 00:00:00 2001 From: Guangchuang Yu Date: Thu, 9 Dec 2021 10:57:18 +0800 Subject: [PATCH] change default order, #60 --- DESCRIPTION | 2 +- NEWS.md | 6 ++++++ R/gsea.R | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6f98ea6..4162d89 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: DOSE Type: Package Title: Disease Ontology Semantic and Enrichment analysis -Version: 3.21.1 +Version: 3.21.1.9001 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"), diff --git a/NEWS.md b/NEWS.md index 717f9d8..ea5288f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# DOSE 3.21.1.9001 + ++ update the default order of GSEA result (2021-12-09, Thu) + - if p.adjust is identical, sorted by `abs(NES)` + + # DOSE 3.21.1 + upate DisGeNET and NCG data (2021-11-14, Sun) diff --git a/R/gsea.R b/R/gsea.R index 99c43aa..622fe9a 100644 --- a/R/gsea.R +++ b/R/gsea.R @@ -86,7 +86,7 @@ GSEA_fgsea <- function(geneList, res <- res[!is.na(res$pvalue),] res <- res[ res$pvalue <= pvalueCutoff, ] res <- res[ res$p.adjust <= pvalueCutoff, ] - idx <- order(res$pvalue, decreasing = FALSE) + idx <- order(res$p.adjust, -abs(res$NES), decreasing = FALSE) res <- res[idx, ] if (nrow(res) == 0) { @@ -311,7 +311,7 @@ GSEA_DOSE <- function(geneList, res <- res[!is.na(res$pvalue),] res <- res[ res$pvalue <= pvalueCutoff, ] res <- res[ res$p.adjust <= pvalueCutoff, ] - idx <- order(res$pvalue, decreasing = FALSE) + idx <- order(res$p.adjust, -abs(res$NES), decreasing = FALSE) res <- res[idx, ] if (nrow(res) == 0) {