Hello everyone
I am using gage to get the pathways of some affymatrix sets.
The set of up and down pathways are the same but with different order in one one pathway only when I set same.dr = true.
When I set same.dr = false
I got the same set of pathways.
This does not change whether or not I set paired or unpaired
.
Does this mean the pathways are both up and down? And what does this really mean? Or something is wrong?
Here is a snapshot from my code:
res$symbol <- mapIds(org.Hs.eg.db,
keys=row.names(res),
column="SYMBOL",
keytype="SYMBOL",
multiVals="first")
res$entrez <- mapIds(org.Hs.eg.db,
keys=row.names(res),
column="ENTREZID",
keytype="SYMBOL",
multiVals="first")
foldchanges = res$logfc
names(foldchanges) = res$entrez
#---------------Use Kegg and gage to get upregulated and downregulated pathways
datakegg.gs)
keggres = gage(foldchanges, gsets =kegg.gs, same.dir =,True, compare="unpaired" )
lapply(keggres, head)
keggrespathwaysup = data.frame(id=rownames(keggres$greater), keggres$greater) %>%
tbl_df() %>%
filter(row_number()<=5) %>%
.$id %>%
as.character()
keggrespathwaysdn = data.frame(id=rownames(keggres$less), keggres$less) %>%
tbl_df() %>%
filter(row_number()<=5) %>%
.$id %>%
as.character()
write.csv(keggrespathwaysup, "keggspathsup.csv")
write.csv(keggrespathwaysdn, "keggspathsdn.csv")
#-------------------------------------------------------
keggresidsup = substr(keggrespathwaysup, start=1, stop=8)
keggresidsup
keggresidsdn = substr(keggrespathwaysdn, start=1, stop=8)
gobpres = gage(foldchanges, gsets=kegg.gs, same.dir =TRUE, compare ="unpaired")
lapply(gobpres, head)
plot_pathway = function(pid) pathview(gene.data=foldchanges,gene.idtype="ENTREZID", pathway.id=pid,
species="hsa", new.signature=FALSE)
#------------------------------plot multiple pathways ups and downs
tmpup = sapply(keggresidsup, function(pid) pathview(gene.data=foldchanges,gene.idtype="ENTREZID", pathway.id=pid, species="hsa"))
tmpdn = sapply(keggresidsdn, function(pid) pathview(gene.data=foldchanges,gene.idtype="ENTREZID", pathway.id=pid, species="hsa"))
Thanks
Thank you.
Does this means for two sets of genes, one set up-regulate a pathway and the other set down-regulate the same pathway? I feel there is something I am still missing
I agree entirely with Jean-Karim. This is actually a common occurrence in in silico analyses. It does not necessarily mean that the entire pathway is being both up- and down-regulated. It could indicate that certain parts of the pathway are adversely and differently affected. Biology is pretty complex and, right now, even with all information that we have produced, cellular pathways are still very much unknown entities to us. Many different pathways are undoubtedly also inter-connected.
Thanks Jean-Karim and Kevin. I think it is much clear now !
Did the data validate? Were those gene entities non-overlapping (to a large extent)?
I am trying to print the genes but can't
A pathway often contains activators and inhibitors. Imagine that a cell treatment leads to activation of a signaling pathway. To activate the pathway, the cell may need to express some members of this pathway (e.g. positive regulators) while at the same time removing inhibitors (e.g. negative regulators part of some feedback loop) of this pathway. For the purpose of enrichment analysis, pathways are simply lists of genes participating in the same biological process. The way biological processes and pathways are defined is arbitrary and different resources/databases will have different definitions (for example, compare the DNA replication pathway in Panther and in KEGG).
Thanks Jean-Karim, very much appreciated !