igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Regarding saving edge-list file


From: anupam sinha
Subject: [igraph] Regarding saving edge-list file
Date: Wed, 10 Jun 2009 12:53:20 +0530

Hi all,
       I am trying to construct metabolic networks of organisms using the .xml files and the BioC package KEGGgraph. I want to get the graph object in the form of an edge-list file and also want to retain the gene-names.But instead of gene-names I am getting the edge-list  with numbers substituted for gene names. Following are the steps I have followed :

>library("Rgraphviz")
> library("graph")
> library("igraph")
> library("KEGGgraph")
> org_mja<-"/home/anupam/Anupam_data/Results/mja.xml"
> mja<-parseKGML(org_mja)
> mja_met<-KEGGpathway2Graph(mja,genesOnly=TRUE,expandGenes=TRUE)
>nodes(mja_met)
  [1] "mja:MJ0108"   "mja:MJ0232"   "mja:MJ0010"   "mja:MJ1612"   "mja:MJ1528" 
  [6] "mja:MJ0400"   "mja:MJ1585"   "mja:MJ1605"   "mja:MJ0636"   "mja:MJ0641" 

I want to retain the names of the nodes as above when I save the edge-list file.


mja_met
is a graphNEL object which I convert into igraph object and then save the edge-list  file in the following manner :

> met_mja<-igraph.from.graphNEL(mja_met,name=TRUE,unlist.attrs=TRUE)
> write.graph(met_mja,"/home/anupam/Anupam_data/Results/met_mja",format=c("edgelist"))

Following is format of met_mja :

sor dest
1     2
1     3
2     9
2     11
3     9
3     11
4     5
4     6
4     10
4     11

Can anyone help me out?? Any help is appreciated. Thanks in advance.


Regards,


Anupam Sinha


reply via email to

[Prev in Thread] Current Thread [Next in Thread]