Hi Everyone
I am new to using gage and pathway view to get some view about my genes. My edgeR genes are using symbols like this: INSM1, LTF, JAK2, ..etc. I tried to change the DB to EnsDb but still doesn't work with me. I don't think the figures generated are for the genes I have as it seems they fail to be mapped to pathway. Any help please? Thanks
#edgeR code here
#in summary the final two steps are:
et <- exactTest(dge, pair=c("Control", "treated"))
etp <- topTags(et, n= 100000)
#Gage and pathview
kegg.sets.hs = kegg.sets.hs[sigmet.idx.hs]
head(kegg.sets.hs, 3)
res = etp$table
foldchanges = res$logFC
names(foldchanges) = res$symbol
keggres = gage(foldchanges, gsets=kegg.sets.hs, same.dir=TRUE)
lapply(keggres, head)
keggrespathways = data.frame(id=rownames(keggres$greater), keggres$greater) %>%
tbl_df() %>%
filter(row_number()<=10) %>%
.$id %>%
as.character()
keggrespathways
keggresids = substr(keggrespathways, start=1, stop=8)
keggresids
data(go.sets.hs)
data(go.subs.hs)
gobpsets = go.sets.hs[go.subs.hs$BP]
gobpres = gage(foldchanges, gsets=gobpsets, same.dir=TRUE)
lapply(gobpres, head)
# Define plotting function for applying later
plot_pathway = function(pid) pathview(gene.data=foldchanges,gene.idtype="SYMBOL", pathway.id=pid, species="hsa")
# plot multiple pathways (plots saved to disk and returns a throwaway list object)
tmp = sapply(keggresids, function(pid) pathview(gene.data=foldchanges,gene.idtype="SYMBOL", pathway.id=pid, species="hsa"))
These are the warnings and the generated pathway figures don't include any of my interesting genes.
Warning: None of the genes or compounds mapped to the pathway! Argument gene.idtype or cpd.idtype may be wrong.
select()' returned 1:1 mapping between keys and columns Info: Working in directory Info: Writing image fil hsa00232.pathview.png Warning: None of the genes or compounds mapped to the pathway! Argument gene.idtype or cpd.idtype may be wrong.
'select()' returned 1:1 mapping between keys and columns Info: Working in directory Info: Writing image file hsa00983.pathview.png Warning: None of the genes or compounds mapped to the pathway! Argument gene.idtype or cpd.idtype may be wrong.
'select()' returned 1:1 mapping between keys and columns Info: Working in directory /.. Info: Writing image file hsa00230.pathview.png Warning: None of the genes or compounds mapped to the pathway! Argument gene.idtype or cpd.idtype may be wrong.
'select()' returned 1:1 mapping between keys and columns Info: Working in directory Info: Writing image file hsa04514.pathview.png Warning: None of the genes or compounds mapped to the pathway! Argument gene.idtype or cpd.idtype may be wrong.
'select()' returned 1:1 mapping between keys and columns Info: Working in directory Info: Writing image file hsa04010.pathview.png There were 50 or more warnings (use warnings() to see the first 50)
2 answers
Default KEGG mapping uses ENTREZID, so you have to map your symbol or Ensembl IDs to Entrez IDs. Pathview provides the function id2eg() to perform such conversion, or you can use BioMart.
For the sake of any one who needs to solve this, it is solved this way:
res$symbol <- mapIds(org.Hs.eg.db,
keys=row.names(res),
column="SYMBOL",
keytype="ALIAS",
multiVals="first")
res$entrez <- mapIds(org.Hs.eg.db,
keys=row.names(res),
column="ENTREZID",
keytype="ALIAS",
multiVals="first")
Log in to answer this question.
Thank you. Do you have an example please? This works but triggers 1:many mapping between keys and columns.