forked from kozo2/kgmlreader
-
Notifications
You must be signed in to change notification settings - Fork 10
How to duplicate the process in F1000research article
Kozo Nishida edited this page Aug 1, 2014
·
26 revisions
- Importing KEGG pathway and Exporting KEGG node table
- Preprocessing the microarray data in ecoliLeucine package
- How to integrate Pathway and T-test result in Cytoscape
- Import a pathway(eco00260), please refer https://github.com/idekerlab/KEGGscape/wiki/How-to-import-KGML-with-KEGGscape
- We recommend you use KEGG API to download kgml quickly
wget http://rest.kegg.jp/get/eco00260/kgml -O eco00260.xml
- Click Export Table to File icon, here we export the node table as keggnode.csv.
Following R commands generates t-test results between two groups, mutants and controls, in a global expression profile. Here we filtered the T-test results (with threshold p.value < 0.05).
source("http://bioconductor.org/biocLite.R")
biocLite(c("genefilter", "ecoliLeucine"))
library("ecoliLeucine")
library("genefilter")
data("ecoliLeucine")
eset = rma(ecoliLeucine)
r = rowttests(eset, eset$strain)
filtered = r[r$p.value < 0.05,]
write.csv(filtered, file="ttest.csv")
Here we append a column for merging KEGG pathway and T-test matrix. To append a column please run following Python script. This Python script generates a table named ttest4pathway.csv.
import csv
import re
ttest_re = re.compile("b[0-9]{4}")
lines = []
with open('ttest.csv') as ttest:
ttestreader = csv.reader(ttest)
for ttestrow in ttestreader:
ttest_match = ttest_re.findall(ttestrow[0])
if len(ttest_match) > 0:
bnumber = ttest_match[0]
bnumber_re = re.compile(bnumber)
with open('keggnode.csv') as kegg:
keggreader = csv.reader(kegg)
for keggrow in keggreader:
kegg_match = bnumber_re.findall(keggrow[1])
if len(kegg_match) > 0:
lines.append(','.join(ttestrow) + ',"' + keggrow[4] + '"\n')
ttest4pathway = open('ttest4pathway.csv', 'w')
ttestheader = open('ttest.csv').readline().strip()
keggheader = open('keggnode.csv').readline().split(',')[4]
ttest4pathway.write(ttestheader + ',' + keggheader + '\n')
ttest4pathway.writelines(set(lines))
ttest4pathway.close()
- Click Import Table From File toolbar icon and open ttest4pathway.csv
- Import To an unassigned table like this
- Click menubar(Tools --> Merge --> Tables...), and set like following image.
Click Style from Control Panel, and Click Show All from Properties,and set Vizmap like this.
Finally bundle edges from menubar(Layout --> Bundle Edges --> All Nodes and Edges). And you will get