igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Ouput of igraph functions


From: Gábor Csárdi
Subject: Re: [igraph] Ouput of igraph functions
Date: Fri, 4 Mar 2011 09:47:22 -0500

Hi Alex,

you can simply do 

d <- degree(gone)
names(d) <- V(gone)$gene_ID

Then, 'd' will be a named vector, containing the degree of the vertices, the names being the gene ids. Is this what you want?

Best,
Gabor

On Fri, Mar 4, 2011 at 9:43 AM, Alex Upton <address@hidden> wrote:

Good afternoon

 

I am hoping that someone can help me. I have created an igraph graph, and have assigned attributes to the vertices using the following code:

 

V(gone)$gene_ID =as.character(annot$Sym[match(V(gone)$name,annot$probeset_id)])

 

I have then calculated the degree for this graph using the following code:

 

d <- degree (gone, v=V(gone))

 

d

 

Using this code gives me an output of the vertex ids with the degree. What I would like to do is get an output with the degree matched to the gene_ID attribute that I have assigned. I have tried the following code:

 

d <- degree (gone, v=V(gone) $gene_ID)

 

However I get the result Error in as.igraph.vs(graph, v) : Invalid vertex names. Therefore, can anyone suggest how I could get the result that I am after, the degree of the gene_IDs directly, rather than having to match them manually using the vertex ids. Any help is greatly appreciated, my email address is address@hidden

 

Kind regards

 

Alex

 

 

___________________________________________________________________

to_modify
 
Alex Upton, BEng, MRes, PG Cert Business Administration
PhD Researcher Biomedical Informatics, Signals and Systems
School of Electronic, Electrical and Computer Engineering,
College of Engineering and Physical Sciences, University of Birmingham
Edgbaston, Birmingham, B15 2TT, United Kingdom

Fax: +44 121 4144291 (school general office)
Email: address@hidden<mailto:address@hidden>

Personal Web: http://postgrad.eee.bham.ac.uk/uptona/
__________________________________________________________________

 


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




--
Gabor Csardi <address@hidden>     UNIL DGM


reply via email to

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