How to get gseKEGG() to accept an input gene list?
0
0
Entering edit mode
3.4 years ago
DN99 ▴ 20

I've got a csv file with 2 columns - one of Entrez IDs and another of gene's measurement/fold-change. I am running code trying to use gseKEGG(), getting the gene list prepared for that function like this:

d <-fread("file.csv")

geneList <- d[,2]
names(geneList) <- as.character(d[,1])
geneList <- sort(geneList, decreasing = TRUE)

Error in `[.data.frame`(x, i) : undefined columns selected

I'm not sure how to work around this error as I can't see what I'm doing wrong here compared to the guidance given to complete this step for gseKEGG() - given here: https://github.com/YuLab-SMU/DOSE/wiki/how-to-prepare-your-own-geneList

What am I missing to get this working?

A snippet of what's in my csv file looks like this (there's no header):

107986084   0.809859097
100874369   0.913054347
100506380   0.423823357
100288797   0.369738668
100137049   0.798110485
100130742   0.78013134
723788  0.764999211
643136  0.231925398
641649  0.317150593
497258  0.754656732

I've also tried just putting a vector of the first column in, which allows me to use sort(), but this outputs:

 kk2 <- gseKEGG(geneList     = geneList,
                organism     = kegg_organism,
                nPerm        = 10000,
                minGSSize    = 3,
                maxGSSize    = 200,
                pvalueCutoff = 0.05,
                pAdjustMethod = "fdr",
                keyType       = "ncbi-geneid")

preparing geneSet collections...
--> Expected input gene ID: 2990,3033,8802,219,131,160287
Error in check_gene_id(geneList, geneSets) : 
  --> No gene can be mapped....
clusterprofiler dose gene-enrichment-analysis R • 5.2k views
ADD COMMENT
0
Entering edit mode

gseKEGG() accepts gene list in this pattern hsa04510, which is clearly different from yours.

ADD REPLY
0
Entering edit mode

Thank you for your reply. Does this refer to the keyType setting where you can set it as
one of "kegg", 'ncbi-geneid', 'ncib-proteinid' and 'uniprot'? If I am understanding it right my entrez ids should be ok if I've set this to 'ncbi-geneid'. I've also tried to amend my code and had an error from gseKEGG() asking for entrez IDs - I'll amend my question to include this test and in the meantime try another version with KEGG ids.

ADD REPLY
2
Entering edit mode

Sorry, for my last answer. Your gene ID seems fine. This is the code i tried with header , and it seems to be working fine.

kegg_gene_list <- list$FC
names(kegg_gene_list) <- list$ID

kegg_gene_list<-na.omit(kegg_gene_list)

kegg_gene_list = sort(kegg_gene_list, decreasing = TRUE)
kegg_organism = "hsa"

kk2 <- gseKEGG(geneList     = kegg_gene_list,
               organism     = kegg_organism,
               nPerm        = 10000,
               minGSSize    = 3,
               maxGSSize    = 800,
               pvalueCutoff = 0.05,
               pAdjustMethod = "none",
               keyType       = "ncbi-geneid")




ID  FC
107986084   0.809859097
100874369   0.913054347
100506380   0.423823357
100288797   0.369738668
100137049   0.798110485
100130742   0.78013134
723788  0.764999211
643136  0.231925398
641649  0.317150593
497258  0.754656732
ADD REPLY
0
Entering edit mode

This has ran for me too - thank you for your help!

ADD REPLY
0
Entering edit mode

Hi, I was wondering if you could help me, I have the same kind of problem. Here is the link to my post : gseKEGG - no gene can be mapped (RNAseq analysis)

Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 2169 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6