igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Regarding saving edge-list file


From: Tamas Nepusz
Subject: Re: [igraph] Regarding saving edge-list file
Date: Wed, 10 Jun 2009 10:58:01 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi Anupam,

Use the NCOL format instead of edgelist. The edgelist format uses
numeric IDs and it does not know anything about vertex attributes. The
NCOL format uses the "name" vertex attribute by default, but you can
supply alternative names using the names= keyword argument.

-- 
Tamas

On Wed, Jun 10, 2009 at 12:53:20PM +0530, anupam sinha wrote:
> 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

> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help

Attachment: pgp6n2owuyDPA.pgp
Description: PGP signature


reply via email to

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