motif_census: Compute 3-nodes motif census

View source: R/motif_census.R

motif_censusR Documentation

Compute 3-nodes motif census

Description

Compute 3-nodes motif census for unidirection and bidirectional unipartite networks.

Usage

motif_census(mat, unidirectional = FALSE)

motif_census_triplet(mat)

Arguments

mat

a square matrix of logical describing a network.

unidirectional

a logical. Is the network considered unidirectional? Default is set to FALSE meaning that the network is bidirectional.

Value

A list of two elements:

  • motifs: total motif count.

  • motifs_node: motif count per node.

  • positions: total position count.

  • positions_node: position count per nodes

If unidirectional is TRUE, then motifs ordered as follows:

  • 1 linear chains bottom;

    • 2 apparent competition;

    • 3 exploitative competition;

    • 4 omnivory;

    • 5 circular; and positions are as follows:

    • 1 linear chains bottom;

    • 2 linear chains middle;

    • 3 linear chains top;

    • 4 apparent competition botton;

    • 5 apparent competition top;

    • 6 exploitative competition bottom;

    • 7 exploitative competition top;

    • 8 omnivory bottom;

    • 9 omnivory middle;

    • 10 omnivory top;

    • 11 circular (e.g. 1->2->3->1).

If mat corresponds to a bidirectional network, then the 13 motifs are ordered following Milo (2002), see the documentation of bidirectional_motifs3 for more details.

Functions

  • motif_census_triplet(): return details for all motifs

References

  • Milo, R. (2002). Network Motifs: Simple Building Blocks of Complex Networks. Science, 298(5594), 824–827. https://doi.org/10.1126/science.298. 5594.824

Examples

net <- rbind(c(0, 0, 0, 0), c(0, 0, 0, 0), c(1, 1, 0, 0), c(0, 0, 1, 0))
motif_census(net, unidirectional = TRUE)
motif_census_triplet(net)

KevCaz/motifcensus documentation built on May 13, 2023, 11:46 a.m.