Git Product home page Git Product logo

Comments (1)

reedliu avatar reedliu commented on June 9, 2024

Hi, this issue is due to the duplicated terms in test_ego.

library(genekitr)
library(geneset)
library(dplyr)
gs3 <- getReactome(org = "human")
testgenes <- read.csv(file = "~/Downloads/for_R_test/testgenelist.csv", header = TRUE, sep = ",")
## ORA Analysis
id <- testgenes$GeneID
test_ego <- genORA(id,
                   geneset = gs3,
                   p_cutoff = 0.05,
                   q_cutoff = 0.10
)

# check duplicated term
description <- test_ego$Description
dup_term <- description[duplicated(description)] # "Maturation of nucleoprotein"

# get IDs
dup_term_ids <- test_ego %>% filter(Description == dup_term) %>% pull(ID)
# "R-HSA-9683610" "R-HSA-9694631"

You can see both R-HSA-9694631 and R-HSA-9683610 all belong to "Maturation of nucleoprotein". While the Y-axis of the plot does not support duplicated terms.

So the solution is to make the duplicated terms unique.
For example, we could combine Reactome IDs with "Maturation of nucleoprotein".

# modify duplicated description
test_ego <- test_ego %>% mutate(Description = if_else(Description %in% dup_term,
                                          paste0(Description,'_',ID),
                                          Description))
plotEnrich(test_ego, plot_type = "bar")

image

Anyway, I have updated the function in v1.2.3, which could automatically check if duplicated terms exist and give users warning instead of error:

image

from genekitr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.