MyNixOS website logo
Description

Calculate Exploded Coordinates Based on Original Node Coordinates and Node Clustering Membership.

Current layout algorithms such as Kamada Kawai do not take into consideration disjoint clusters in a network, often resulting in a high overlap among the clusters, resulting in a visual “hairball” that often is uninterpretable. The ExplodeLayout algorithm takes as input (1) an edge list of a unipartite or bipartite network, (2) node layout coordinates (x, y) generated by a layout algorithm such as Kamada Kawai, (3) node cluster membership generated from a clustering algorithm such as modularity maximization, and (4) a radius to enable the node clusters to be “exploded” to reduce their overlap. The algorithm uses these inputs to generate new layout coordinates of the nodes which “explodes” the clusters apart, such that the edge lengths within the clusters are preserved, while the edge lengths between clusters are recalculated. The modified network layout with nodes and edges are displayed in two dimensions. The user can experiment with different explode radii to generate a layout which has sufficient separation of clusters, while reducing the overall layout size of the network. This package is a basic version of an earlier version called [epl]<https://github.com/UTMB-DIVA-Lab/epl> that searched for an optimal explode radius, and offered multiple ways to separate clusters in a network (Bhavnani et al(2017) <PMID: 28815099>). The example dataset is for a bipartite network, but the algorithm can work also for unipartite networks.

ExplodeLayout

The ExplodeLayout algorithm takes as input (1) an edge list of a unipartite or bipartite network, (2) node layout coordinates (x, y) generated by a layout algorithm such as Kamada Kawai, (3) node cluster membership generated from a clustering algorithm such as modularity maximization, and (4) a radius to enable the node clusters to be “exploded” to reduce their overlap. The algorithm uses these inputs to generate new layout coordinates of the nodes which “explodes” the clusters apart, such that the edge lengths within the clusters are preserved, while the edge lengths between clusters are recalculated. The modified network layout with nodes and edges are displayed in two dimensions. This package is a basic version of an earlier version called epl that offered multiple ways to separate clusters in a network (see PMID: 28815099).

Installation

You can install the development version of ExplodeLayout like so:

install.packages("remotes")
remotes::install_github("DIVA-Lab-UTMB/ExplodeLayout")

Example

The following describes how to use ExplodeLayout for a simple network:

library(ExplodeLayout)
str(example_nodelist)
#> 'data.frame':    806 obs. of  5 variables:
#>  $ Label  : chr  "Patient_1" "Patient_2" "Patient_3" "Patient_4" ...
#>  $ Cluster: int  2 2 2 4 4 2 3 2 4 2 ...
#>  $ X      : num  3.379 2.242 -1.436 0.465 4.62 ...
#>  $ Y      : num  3.06 2.07 -3.47 2.26 2.8 ...
#>  $ Entity : num  1 1 1 1 1 1 1 1 1 1 ...
str(example_incidmat)
#> 'data.frame':    798 obs. of  8 variables:
#>  $ Symptom_1: int  1 1 0 1 1 1 0 1 0 0 ...
#>  $ Symptom_2: int  1 1 0 1 1 1 0 1 1 0 ...
#>  $ Symptom_3: int  1 1 0 1 0 0 0 0 1 0 ...
#>  $ Symptom_4: int  1 1 0 1 1 1 1 1 1 0 ...
#>  $ Symptom_5: int  1 1 1 1 0 1 0 1 1 1 ...
#>  $ Symptom_6: int  0 1 0 1 1 1 0 1 1 0 ...
#>  $ Symptom_7: int  1 1 0 0 1 1 1 1 1 0 ...
#>  $ Symptom_8: int  1 0 1 1 1 1 0 1 1 0 ...
exploded_nodelist=get_explode_nodelist(example_nodelist,radius=1.2)
str(exploded_nodelist)
#> 'data.frame':    806 obs. of  5 variables:
#>  $ Label    : chr  "Patient_1" "Patient_2" "Patient_3" "Patient_4" ...
#>  $ X        : num  -3.579 -5.075 -11.646 0.569 4.626 ...
#>  $ Y        : num  3.02 3.19 2.17 -6.8 -5.75 ...
#>  $ Color    : chr  "#94EA18" "#94EA18" "#94EA18" "#808080" ...
#>  $ baseShape: num  21 21 21 21 21 21 21 21 21 21 ...
p=plot_binet_ggplot2(exploded_nodelist,example_incidmat)
print(p)

Documentation

Please read the documentation using ?get_explode_nodelist, ?plot_binet_ggplot2, ?example_nodelist, or ?example_incidmat for more details.

Reference

Bhavnani(2017)

Metadata

Version

0.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows