[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: [igraph] Help combining vertices with the same ID into one new verte

**From**: |
Tamás Nepusz |

**Subject**: |
Re: [igraph] Help combining vertices with the same ID into one new vertex and removing multiple edges resulting from this |

**Date**: |
Wed, 19 Sep 2012 10:23:40 +0200 |

Hi Alex,
>* The issue is that for some gene symbols, multiples probes map to just one *
>* gene symbol. Therefore, what I would like to do is use V(gone)$gene_ID to *
>* create a new graph with only unique vertex values for this attribute.*
Have a look at the contract.vertices function. Given a graph and a mapping
vector that specifies which vertices are to be contracted into a single one,
this will construct a new graph for you where some of the vertices are
contracted into a single one but the edges are kept. You can also specify how
the attributes of the old vertices are mapped into the attributes of the new
vertices. Of course this procedure gives you a lot of multiple and/or loop
edges, so you should follow it by a call to simplify() where you can specify
how to collapse multiple edges into single ones and what to do with their
weights (in your case, take the maximum weight and use that).
Best,
Tamas