iddn.visualize_multi

Visualization of networks for multi-omics data

Functions

draw_multi_layer_network(cen_lst, rad_lst, mol_name[, ...])

Draw networks in multiple components

Module Contents

iddn.visualize_multi.draw_multi_layer_network(cen_lst, rad_lst, mol_name, mol_grp=None, mol_label=None, mol_color=None, mol_size=None, mol_font_alpha=None, mol_font_color=None, edge_mol0=None, edge_mol1=None, edge_color=None, edge_weight=None, edge_style=None, fig_size=np.array((4, 2)), fig_scale=5, font_size_scale=1.5, out_name='')

Draw networks in multiple components

For multi-omics data, it is often needed to use one component of an omics type. Sometimes it is also beneficial to further divide one omics type to more than one component for better view. This function provide the flexibility for these tasks. Each component can be an ellipse or line segment. Each node can have its own size and color. Each edge can have different color, weight, and style.

Several examples can be found in the visualization tutorial (Tutorial 3) of iDDN package.

We define C as the number of components. M is the number of nodes to show, E is the number of edges.

Parameters:
  • cen_lst ((C,2) array_like) – Each row is the x-y coordinate of the position of the center of each component. For details and more explanation, see Tutorial 3.

  • rad_lst ((C,2) array_like) – Each row is the axes lengths of each component. For details, see tutorial 3.

  • mol_name – The list of node names in the network. This is the internal name of each node. The edges must be described according to these names.

  • mol_label – The list of node labels to draw. This could be different from node_name. If not provided, we will display mol_name on the figure.

  • mol_grp – The component (grouping) membership of each node. The index of component is the same as in cen_lst and rad_lst.

  • mol_color – The color of each node. For eample, each element can be the name of color, like black.

  • mol_size – The size of each node. The value is relative to the standard size, which is automatically determined according to the canvas size and node number. Set to 1 will be the same as standard size, to 1.5 to get larger nodes, etc.

  • mol_font_alpha – The transparency of the text label of each node

  • mol_font_color – The color of the text label of each node

  • edge_mol0 – For each edge, list the name of the first node

  • edge_mol1 – For each edge, list the name of the second node

  • edge_color – The color of each edge

  • edge_weight – The weight of each edge, relative to the automatically determined standard value.

  • edge_style – The style of each edge, each element can be solid or dashed

  • fig_size – The size of the canvas. All distance related parameters appeared above should be based on this canvas size. See Tutorial 3 for details.

  • fig_scale (float or int) – The global scaling of the figure when printing or showing.

  • font_size_scale (float or int) – The font size relative to the automatically determined standard font size. For example, use 1.5 to get a larger font.

  • out_name (str, optional) – The name of the output file. Need to specify the file extension as well, like pdf or png.

Return type:

None