create a multilayer network from a group of data.frames

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

create a multilayer network from a group of data.frames

Rafael Pereira
Hi all,

Is there a way to create a multilayer network from a group of data.frames?

This would make it very easy to import data to create multigraphs in graph-tool. This is possible for example in igrap library and for MuxViz in R( https://github.com/manlius/muxViz).

In Muxviz, for example, one can create a multilayer network using three data.frames. I copy some of the explanation below from their documentation:


###  Node list

One df with following columns :
  • nodeID: [mandatory] numerical integer id to identify each node
  • nodeLabel: [optional] string specifying the label attribute
  • nodeX: [optional] float value specifying the Cartesian coordinate x for the layout
  • nodeY: [optional] float value specifying the Cartesian coordinate x for the layout
  • nodeLat: [optional] float value specifying the latitude for the geographic layout
  • nodeLong: [optional] float value specifying the longitude for the geographic layout



###  Edges list

One or more df with data on the edges. A typical edges list is expected to be a file with at most three columns, giving the list of edges from a node (first column) to other nodes (second column), possibly weighted by an integer or floating number (third column). For instance:

1 2 0.5
1 3 1.4
...
18 124 0.1


### input df

Muxviz also uses a third data.frame that brings information on the list of layers to be included in a multiplex, the corresponding labels and the possible layout file to define node properties (e.g., ID, labels, geographic coordinates, etc).

best wishes,

Rafael H M Pereira


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool
Reply | Threaded
Open this post in threaded view
|

Re: create a multilayer network from a group of data.frames

Tiago Peixoto
Administrator
On 23.11.2017 17:46, Rafael Pereira wrote:
> Is there a way to create a multilayer network from a group of data.frames?

Please take a look at the Graph.add_edge_list() function:

https://graph-tool.skewed.de/static/doc/graph_tool.html#graph_tool.Graph.add_edge_list

This function is versatile enough to provide the functionality you mention.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>
Reply | Threaded
Open this post in threaded view
|

Re: create a multilayer network from a group of data.frames

Rafael Pereira
I'll have a look, Tiago! Thank you.

best,

Rafael H M Pereira

On Thu, Nov 23, 2017 at 3:55 PM, Tiago de Paula Peixoto <[hidden email]> wrote:
On 23.11.2017 17:46, Rafael Pereira wrote:
> Is there a way to create a multilayer network from a group of data.frames?

Please take a look at the Graph.add_edge_list() function:

https://graph-tool.skewed.de/static/doc/graph_tool.html#graph_tool.Graph.add_edge_list

This function is versatile enough to provide the functionality you mention.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool



_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool