[BioC] building enzyme centric metabolic network

Saroj K Mohapatra smohapat at vbi.vt.edu
Mon Apr 20 03:56:23 CEST 2009

Hi Anupam:

Using your second criterion, i.e., two enzymes are linked if they are in the same pathway, one strategy would be to use the information from org. packages for creating a network for each species.

# For mouse, use the package org.Mm.eg.db to get the list of all entrez ids, associated KEGG id
egKEGGids = as.list(org.Mm.egPATH)

# many entrez ids have no KEGG id; discard these
egKEGGids = egKEGGids[!is.na(egKEGGids)]

# For all possible entrez id pairs, find a KEGG id; if not available, drop that pair
keggnet = matrix(ncol=3, nrow=0) # Empty matrix with 3 columns
colnames(keggnet) = c("EG1", "EG2", "KEGG")
mycounter = 1 # to count the current entrez id pair
numEg = length(egKEGGids) # number of entrez ids
for(i in 1:(numEg-1)) {
  for(j in (i+1):numEg) {
    eg1 = names(egKEGGids)[i]
    eg2 = names(egKEGGids)[j]
    kegg1 = as.character(unlist(egKEGGids[i])) 
		# kegg id for the first gene
    kegg2 = as.character(unlist(egKEGGids[j])) 
		# kegg id for the 2nd gene
    common = intersect(kegg1, kegg2) # common between two
    numCommon = length(common) # how many shared
    if(numCommon>0) {
      for(k in 1:numCommon) {
	keggnet = rbind(keggnet, c(eg1, eg2, common[k]))
	cat(i,  "\t", j,   "\t", numEg,"\t | ") 
	cat(eg1,"\t", eg2, "\t", common[k], "\n")
		# monitor progress
	mycounter = mycounter+1 # move the counter

# now write the data to a file for future use
write.table(keggnet, file="mouse_KEGG_network.txt", 
	col.names=T, row.names=F, sep="\t", quote=F)

The resulting file has three columns for two entrez ids (EG1, EG2) and KEGG (ID) shared by the two entrez ids. There might be a faster way of using it though (in stead of the for loops). Also, there might already be such networks available within bioconductor. 

I imagine that you would need one such file for each species of your interest (to study "evolutionary aspects").



----- Original Message -----
From: "anupam sinha" <anupam.contact at gmail.com>
To: Bioconductor at stat.math.ethz.ch
Sent: Sunday, April 19, 2009 4:35:12 AM GMT -05:00 US/Canada Eastern
Subject: [BioC] building enzyme centric metabolic network

Hi all,
         I am working on the evolutionary aspects of metabolic net
works(enzyme centric). This network will consists of nodes that are enzymes
and any two enzymes are linked if they share a metabolite (or in the same
pathway). Can anyone suggest me a way to build these networks using
KEGGgraph or KEGGSOAP packages ? Thanks in advance.


Anupam Sinha

	[[alternative HTML version deleted]]

Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

Computational Biology
VBI @ Virginia Tech

More information about the Bioconductor mailing list