Hello,
I am interested in making a KEGG pathway diagram to display the results of my KEGG pathway enrichment analysis (affymetrix zebrafish 1.1 ST microarray platform -> pd.zebgene.1.1.st). Below is an example of the data returned after applying edgeR's kegga function. Can anyone point me in the right direction as to how I can generate a colored pathway diagram (ex. Phototransduction - path:dre04744)?
Secondary to this, I would also like to generate a heatmap using all "up" and "down" genes for Glycolysis/Gluconeogenesis (path:dre00010). If it were possible, I would also like to generate a heatmap using all "up" and "down" genes from multiple pathways (ex- path:dre00010 and path:dre00020).
Pathway N Up Down P.Up P.Down
path:dre00010 Glycolysis / Gluconeogenesis 70 32 1 1.021135e-16 0.5755094
path:dre00020 Citrate cycle (TCA cycle) 29 4 0 2.262706e-01 1.0000000
path:dre00030 Pentose phosphate pathway 28 18 1 2.378557e-13 0.2896853
path:dre00040 Pentose and glucuronate interconversions 23 10 0 7.273981e-06 1.0000000
path:dre00051 Fructose and mannose metabolism 34 19 0 1.849783e-12 1.0000000
Here is the code I used to generate the pathway results:
setwd("C:\\Users\\mat149\\Desktop\\GG")
library(oligo)
CELlist <- list.celfiles("C:\\Users\\mat149\\Desktop\\GG\\CEL", full.names=TRUE, pattern=NULL, all.file=FALSE)
pdat<-read.AnnotatedDataFrame("C:\\Users\\mat149\\Desktop\\GG\\CEL\\phenoMOD.txt",header=TRUE,row.name="Filename",sep="\t")
CELdat <- read.celfiles(filenames = CELlist,experimentData=TRUE,phenoData=pdat,verbose=TRUE)
eset<-rma(CELdat, background=TRUE, normalize=TRUE, subset=NULL, target="core")
library(affycoretools)
eset <- annotateEset(eset, annotation(eset))
library(org.Dr.eg.db)
fd <- fData(eset)
fd$ENTREZID <- mapIds(org.Dr.eg.db, as.character(fd$SYMBOL), "ENTREZID","SYMBOL",multiVals="first")
fData(eset) <- fd
ph = CELdat@phenoData
ph@data[ ,1] = c("WT1","WT2","WT3","WT4","WT5","WT6","WT7","WT8","MO1","MO2","MO3","MO4","RS1","RS2","RS3","RS4")
ph@data[ ,2] = c("control","control","control","control","control","control","control","control","morphant","morphant","morphant","morphant","rescue","rescue","rescue","rescue")
colnames(ph@data)[2]="Treatment"
colnames(ph@data)[1]="Sample"
groups = ph@data$Treatment
f = factor(groups,levels=c("control","morphant","rescue"))
library(limma)
design = model.matrix(~ 0 + f)
colnames(design)=c("control","morphant","rescue")
data.fit = lmFit(eset,design)
contrast.matrix = makeContrasts(morphant-control,rescue-control,morphant-rescue,levels=design)
data.fit.con = contrasts.fit(data.fit,contrast.matrix)
data.fit.eb = eBayes(data.fit.con)
library(edgeR)
entzzvec<-as.vector(data.fit.eb$genes$ENTREZID)
MOkegg<-kegga(data.fit.eb,coef=1,geneid=entzzvec,FDR=0.05,species.KEGG="dre",convert=TRUE)
RSkegg<-kegga(data.fit.eb,coef=2,geneid=entzzvec,FDR=0.05,species.KEGG="dre",convert=TRUE)
MORSkegg<-kegga(data.fit.eb,coef=3,geneid=entzzvec,FDR=0.05,species.KEGG="dre",convert=TRUE)
Thanks,
Matt