Unable to map genes to KEGG pathway using pathview
2
1
Entering edit mode
6.1 years ago

I was trying to map a list of genes to Oryza sativa (rice) KEGG pathways using pathview R package. But failed to map genes. I followed this tutorial.

For example, the code below

library("pathview")
geneList<-read.table("genes.txt",header=T,sep="\t") 
pathway <- pathview(gene.data  = geneList,
                 pathway.id = "00195",
                 gene.idtype = "RAPDB",
                 species    = "Oryza sativa japonica"                     
                 )

with the input "genes.txt"

Os03t0659266-00
Os04t0473150-00

Should map input genes to a specific pathway. But showing error

Error in pathview(gene.data = geneList, pathway.id = "00195", gene.idtype = "RAPDB",  : 
 No proper gene annotation package available!

However, the online version shows mapping with the same input. So how can I solve this problem?

clusterProfiler R Oryza sativa KEGG bioconductor • 8.9k views
ADD COMMENT
2
Entering edit mode
6.1 years ago
bigmawen ▴ 440

Your gene IDs (eg Os03t0659266-00) are not Entrez or KEGG gene ID, hence can’t be mapped to KEGG osa pathways. That’s why you saw the warning and plain graph with no data. you can generate simulated osa data with entrez/kegg ID as below, and it will work. So you need to convert your gene IDs to entrez/kegg gene IDs manually.

gdata.osa=sim.mol.data(mol.type="gene", species ="osa", id.type="kegg", nmol=10000) pv.out=pathview(gene.data = gdata.osa, pathway.id = "00195", gene.idtype = "KEGG", species = "Oryza sativa japonica")

FYI, you can check the ID type supported by pathview for your target species (i.e. osa) using korg data in pathview like:

data(korg)
ri=korg[,"kegg.code"]=="osa"
korg[ri,]

            ktax.id                  tax.id               kegg.code
           "T01015"                 "39947"                   "osa"
    scientific.name             common.name           entrez.gnodes
    "Oryza sativa japonica"         "Japanese rice"            "1"
         kegg.geneid             ncbi.geneid          ncbi.proteinid
          "4349630"               "4349630"          "XP_015615283"
            uniprot
       "A0A0P0XY71"

So supported gene ID for osa include: kegg.geneid, ncbi.geneid (entrez), ncbi.proteinid, uniprot.
The simulated data with Entrez/KEGG IDs look like:

head(gdata.osa)

 4328398    4326389    4338593  107277186    4334918    4335759
-1.4462875  0.3158558 -0.3427475 -1.9313531  0.2428210 -0.3627679
ADD COMMENT
2
Entering edit mode
6.1 years ago
zx8754 12k

There problem seems to be with gene.idtype = "RAPDB". The available gene.idtype.list can be checked:

data(gene.idtype.list); gene.idtype.list
# [1] "SYMBOL"       "GENENAME"     "ENSEMBL"      "ENSEMBLPROT"  "UNIGENE"     
# [6] "UNIPROT"      "ACCNUM"       "ENSEMBLTRANS" "REFSEQ"       "ENZYME"      
# [11] "TAIR"         "PROSITE"      "ORF"

Then from the manuals it is suggested to use KEGG, so below should work:

gene.idtype
character, ID type used for the gene.data, case insensitive. Default gene.idtype="entrez", i.e. Entrez Gene, which are the primary KEGG gene ID for many common model organisms. For other species, gene.idtype should be set to "KEGG" as KEGG use other types of gene IDs. For the common model organisms (to check the list, do: data(bods); bods), you may also specify other types of valid IDs. To check the ID list, do: data(gene.idtype.list); gene.idtype.list.

library("pathview")

geneList <- c("Os03t0659266-00", "Os04t0473150-00")
pathview(gene.data  = geneList,
         pathway.id = "00195",
         gene.idtype = "KEGG",
         species    = "Oryza sativa japonica")
ADD COMMENT
0
Entering edit mode

Thanks for your help. I tried with gene.idtype = "KEGG". But it not mapping the genes and throws warnings like,

Warning: None of the genes or compounds mapped to the pathway!
Argument gene.idtype or cpd.idtype may be wrong.
Warning: No annotation package for the species osa, gene symbols not mapped!
Info: Working in directory /home/genome/KEGG
Info: Writing image file osa00195.pathview.png
ADD REPLY
0
Entering edit mode

Please paste the code you are using, so we can reproduce the problem.

ADD REPLY
0
Entering edit mode

Sorry, I used exactly the same code which you have given.

library("pathview")
geneList <- c("Os03t0659266-00", "Os04t0473150-00")
pathview(gene.data  = geneList,
pathway.id = "00195",
gene.idtype = "KEGG",
species    = "Oryza sativa japonica")
ADD REPLY
0
Entering edit mode

I tried the code before posting the answer, and it worked for me. Or at least it did give an image output - osa00195.pathview.png, here are the warnings:

Info: Downloading xml files for osa00195, 1/1 pathways..
Info: Downloading png files for osa00195, 1/1 pathways..
Warning: None of the genes or compounds mapped to the pathway!
Argument gene.idtype or cpd.idtype may be wrong.
Warning: No annotation package for the species osa, gene symbols not mapped!
Info: Working in directory C:/Users/tdadaev/Documents
Info: Writing image file osa00195.pathview.png

My sessionInfo();

R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets  methods  
[9] base     

other attached packages:
[1] pathview_1.16.7      org.Hs.eg.db_3.4.1   AnnotationDbi_1.38.2
[4] IRanges_2.10.5       S4Vectors_0.14.7     Biobase_2.36.2      
[7] BiocGenerics_0.22.1 

loaded via a namespace (and not attached):
 [1] graph_1.54.0      Rcpp_0.12.18      KEGGgraph_1.38.1  XVector_0.16.0   
 [5] zlibbioc_1.22.0   bit_1.1-14        R6_2.2.2          blob_1.1.1       
 [9] httr_1.3.1        tools_3.4.1       grid_3.4.1        png_0.1-7        
[13] DBI_1.0.0         yaml_2.2.0        bit64_0.9-7       digest_0.6.17    
[17] Rgraphviz_2.20.0  KEGGREST_1.16.1   memoise_1.1.0     RSQLite_2.1.1    
[21] compiler_3.4.1    Biostrings_2.44.2 XML_3.98-1.16     pkgconfig_2.0.2
ADD REPLY
0
Entering edit mode

Thanks,.! Yes, image for corresponding pathway is being generated. But none of the input genes are mapped to the generated pathway image. (To test purpose, I used two genes in the pathway 00195. So these two genes with highlighted red box in the pathway image is the expected result.)

ADD REPLY
0
Entering edit mode

Hi, could you solve your issue ? I am facing the same problem

ADD REPLY
0
Entering edit mode

Hi, I couldn't figure out the problem...But somehow it is possible to do

ADD REPLY

Login before adding your answer.

Traffic: 1746 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