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

Hi All,

I'm using clusterProfiler but not able to run enrichGO on my datasets.

my Input data is like this:

gene entrez logFC P.Value q_value

ABR 29 -1.11808 0.01825 0.852004

ADAT3 113179 -0.0875548 0.9431 0.999156

AMDHD2 51005 -0.864244 0.3177 0.999156

ASNA1 439 -0.354129 0.53285 0.999156

ASPSCR1 79058 -0.255376 0.7536 0.999156

I want to use following commands:

library(clusterProfiler)

data(geneList)

gene <- names(geneList)[abs(geneList) > 2]

 ego <- enrichGO(gene= gene,universe= names(geneList),OrgDb= org.Hs.eg.db,ont= "CC",  pAdjustMethod = "BH", pvalueCutoff  = 0.01,qvalueCutoff  = 0.05, readable= TRUE)

cnetplot(ego, categorySize="pvalue", foldChange=geneList)

I went through clusterProfiler tutorial, but could not find about input file.

so how can I modify above code for my data.

Thanks,

gene

1 answer

Where is your problem ? Do you get any error ? The enrichGO() function takes as input a vector of Entrez gene IDs. So make sure that your gene variable is such a thing. Your code looks wrong. You probably want something like:

data<-read.delim("input.txt") # Assuming your file is tab-delimited
genes<-data$entrez[abs(data$logFC)>2]
ego<-enrichGO(gene=genes....)

EDIT: Use data$entrez to get the right column.

Thanks,

Im using same command, but got following errors

data<-read.delim("input.txt") 

genes<-data$gene[abs(data$logFC)>2]

 ego <- enrichGO(genes , organism= "human", ont= "CC",  pAdjustMethod = "BH", pvalueCutoff  = 0.1,qvalueCutoff  = 0.5, readable= TRUE)

 ego

[1] NA

also used

ego <- enrichGO(genes , organism= "human", ont= "CC",  pAdjustMethod = "BH", readable= TRUE)

ego

[1] NA

 cnetplot(ego, categorySize="pvalue", foldChange=genes)

Error in (function (classes, fdef, mtable)  : 

  unable to find an inherited method for function ‘cnetplot’ for signature ‘"logical"’

can you check whether your variable 'genes' is what you expect it to be by printing it?

You need the Entrez gene IDs. I made a mistake in the code I wrote because the IDs are in data$entrez not in data$gene.

Thanks a lot, Jean-Karim Heriche,

it works now

Log in to answer this question.