sparsify {backbone}R Documentation

Extract the backbone from a network using a sparsification model

Description

A generic function to extract the backbone of an undirected, unipartite network using a sparsification model described by a combination of an edge scoring metric, a edge score normalization, and an edge score filter.

Usage

sparsify(
  U,
  s,
  escore,
  normalize,
  filter,
  symmetrize = TRUE,
  umst = FALSE,
  class = "original",
  narrative = FALSE
)

Arguments

U

An unweighted unipartite graph, as: (1) an adjacency matrix in the form of a matrix or sparse Matrix; (2) an edgelist in the form of a two-column dataframe; (3) an igraph object.

s

numeric: Sparsification parameter

escore

string: Method for scoring edges' importance

normalize

string: Method for normalizing edge scores

filter

string: Type of filter to apply

symmetrize

boolean: TRUE if the result should be symmetrized

umst

boolean: TRUE if the backbone should include the union of minimum spanning trees, to ensure connectivity

class

string: the class of the returned backbone graph, one of c("original", "matrix", "Matrix", "igraph", "edgelist"). If "original", the backbone graph returned is of the same class as U.

narrative

boolean: TRUE if suggested text & citations should be displayed.

Details

The escore parameter determines how an unweighted edge's importance is calculated. Unless noted below, scores are symmetric and larger values represent more important edges.

The normalize parameter determines whether edge scores are normalized.

The filter parameter determines how edges are filtered based on their (normalized) edge scores.

Using escore == "degree" or normalize == "rank" can yield an assymmetric network. When symmetrize == TRUE (default), after applying a filter, the network is symmetrized by such that i-j if i->j or i<-j.

Specific combinations of escore, normalize, filter, and umst correspond to specific sparsification models in the literature, and are available via the following wrapper functions: sparsify.with.skeleton(), sparsify.with.gspar(), sparsify.with.lspar(), sparsify.with.simmelian(), sparsify.with.jaccard(), sparsify.with.meetmin(), sparsify.with.geometric(), sparsify.with.hypergeometric(), sparsify.with.localdegree(), sparsify.with.quadrilateral(). See the documentation for these wrapper functions for more details and the associated citation.

Value

An unweighted, undirected, unipartite graph of class class.

References

Neal, Z. P. (2022). backbone: An R Package to Extract Network Backbones. PLOS ONE, 17, e0269137. doi:10.1371/journal.pone.0269137

Examples

U <- igraph::sample_sbm(60, matrix(c(.75,.25,.25,.25,.75,.25,.25,.25,.75),3,3), c(20,20,20))
plot(U) #A hairball
sparse <- sparsify(U, s = 0.6, escore = "jaccard", normalize = "rank",
filter = "degree", narrative = TRUE)
plot(sparse) #Clearly visible communities

[Package backbone version 2.1.4 Index]