Skip to content

Commit

Permalink
make plot_GSEA more compatible to gsea_result data frame generated by…
Browse files Browse the repository at this point in the history
… other means
  • Loading branch information
hsiaoyi0504 authored Dec 9, 2024
1 parent f123d6d commit c248ecc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/enrichment.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ GSEA_test <- function(se, col=NULL, database="GO Biological Process", file=NULL,

#' @export
plot_GSEA <- function(gsea_result, categroies=15) {
if (!"Count" %in% colnames(gsea_result)) {
gsea_result$Count <- str_count(gsea_result$core_enrichment, "/")
}
temp <- gsea_result[order(gsea_result$NES, decreasing = T),]
ID_selected <- temp[c(1:categroies, (dim(temp)[1]-categroies + 1):dim(temp)[1]),"ID"]
temp <- temp[temp$ID %in% ID_selected,]
Expand Down

0 comments on commit c248ecc

Please sign in to comment.