From d17f1958c2a2313b0daa023ef1136791a1df79e4 Mon Sep 17 00:00:00 2001 From: NelsonGon Date: Mon, 6 Dec 2021 09:17:23 +0100 Subject: [PATCH] Sort decreasing only for DOSE YuLab-SMU/DOSE#58 --- R/gsea.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/gsea.R b/R/gsea.R index 99c43aa..0783cc0 100644 --- a/R/gsea.R +++ b/R/gsea.R @@ -162,8 +162,10 @@ GSEA_internal <- function(geneList, ...) { by <- match.arg(by, c("fgsea", "DOSE")) - if (!is.sorted(geneList)) + + if (all(!is.sorted(geneList), by == "DOSE")){ stop("geneList should be a decreasing sorted vector...") + } if (by == 'fgsea') { .GSEA <- GSEA_fgsea } else {