Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cparsania committed Oct 10, 2024
1 parent 46b9439 commit 97bce02
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions R/rnaseq_related.R
Original file line number Diff line number Diff line change
Expand Up @@ -1645,11 +1645,17 @@ enrichMsigDB <- function(gene_list,


# Convert input gene id(default SYMBOL) into desired format(default ENTREZ).
if(from_type == "ENTREZID"){
fromtype_to_entrez = tibble::tibble(ENTREZID = gene_list)
} else {
fromtype_to_entrez <- clusterProfiler::bitr(gene_list,
OrgDb = orgdb,
fromType=from_type,
toType="ENTREZID") %>% tibble::as_tibble()
}



fromtype_to_entrez <- clusterProfiler::bitr(gene_list,
OrgDb = orgdb,
fromType=from_type,
toType="ENTREZID") %>% tibble::as_tibble()


# prepare target geneset from msigdbr
Expand Down Expand Up @@ -1678,10 +1684,15 @@ enrichMsigDB <- function(gene_list,


# converts input background id to entrez id.
bg_to_entrez <- clusterProfiler::bitr(background,
OrgDb = orgdb,
fromType=from_type,
toType="ENTREZID")
if(from_type == "ENTREZID"){
bg_to_entrez <- tibble::tibble(ENTREZID = unique(background))
} else {
bg_to_entrez <- clusterProfiler::bitr(background,
OrgDb = orgdb,
fromType=from_type,
toType="ENTREZID")
}



# msigdb_t2g <- dplyr::bind_rows(msigdb_t2g,tibble::tibble(gs_name = "UN_ANNOTATED",
Expand Down

0 comments on commit 97bce02

Please sign in to comment.