This is a test version of Biostars. For the public version, visit https://www.biostars.org.
clusterProfiler enricher question

I meet a problem when use enricher of clusterProfiler :

my CC background gene number is 9052, print summary(ego), its show BgRatio is 9052, but when i use ego@geneSets to show only 5k, then i use plotGOgraph,the first level of go`s gene number is 5k, not 9052, other levels gene number is right as the same as showing of summary(ego)

  1. i use latest version of clusterProfiler
  2. library(clusterProfiler)
    annot <- read.table("PFC/annot.C", header=F, sep="\t", quote="", colClasses = "character")
    allg <- read.table("Unigene.fa.bgl", header=F, colClasses = "character")
    deg <- read.table("../CK-VS-T.glist", header=F, colClasses = "character")
    g2g <- annot[, c("V1", "V2")]
    g2t <- annot[, c("V1", "V3")]
    ego <- enricher(deg$V1, universe=allg$V1, pAdjustMethod = "none", minGSSize = 1, TERM2GENE= g2g, TERM2NAME = g2t, pvalueCutoff =1, qvalueCutoff =1)
    write.table(summary(ego)[,-6][,-8], "test/test.C.xls", sep="\t", row.names=F, quote=F)
    ego <- enricher(deg$V1, universe=allg$V1, pAdjustMethod = "none", minGSSize = 1, TERM2GENE= g2g, TERM2NAME = g2t, pvalueCutoff =0.05, qvalueCutoff =1)
    ego@ontology = "CC"
    if(length(rownames(summary(ego))) != 0)
    {
    pdf("test/test.C.pdf")
    if(length(rownames(summary(ego))) > 9)
    {
        plotGOgraph(ego)
    }else{
        plotGOgraph(ego, firstSigNodes = length(rownames(summary(ego))))
    }
    dev.off()
    }
clusterprofiler enricher

2 answers

you did not follow the guide, http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example, to make a reproducible example, and I have no idea of your input, output and plot.

BgRatio is 9052, but when i use ego@geneSets to show only 5k

Here, you did not give enough information either.

BgRatio should be something like M/N, M is the number of genes belong the a specific term and N should be the number of all genes in background.

geneSets is a list of geneSet, while each geneSet contains genes that belong to that term, that is corresponding to M.

It seems here 9052 is N and 5k is M and of course they M << N.

yes, I know BgRatio is format to M/N

9052 is N, the number of geneSets is 5k, are they the same? i think it must be the same, or i use plotGOgraph show the first level of go`s gene number is 5k, not 9052

pls install the newest release of DOSE, it should solve your issue.

reproducible example, pls, otherwise I can't get your idea.

Please use ADD REPLY/ADD COMMENT to respond to existing posts. SUBMIT ANSWERS should be reserved for new answers to original question.

Log in to answer this question.