Skip to content

How to duplicate the process in F1000research article

Kozo Nishida edited this page Aug 1, 2014 · 26 revisions

Outlines

  1. Importing KEGG pathway and Exporting KEGG node table
  2. Preprocessing the microarray data in ecoliLeucine package
  3. How to integrate Pathway and T-test result in Cytoscape

Importing KEGG pathway and Exporting KEGG node table

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.

Preprocessing the microarray data in ecoliLeucine package

Preprocessing with R(bioconductor)

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")

Preprocessing T-test matrix with Python

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()

How to integrate Pathway and T-test result in Cytoscape

Importing T-test result for KEGG pathway

  • Click Import Table From File toolbar icon and open ttest4pathway.csv
  • Import To an unassigned table like this

Merging tables for microarray data and KEGG pathway

  • Click menubar(Tools --> Merge --> Tables...), and set like following image.

Vizmapping T-test P-values to the KEGG Pathway

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 F1000Research Figure 4.