build_motif_adjacency_matrix: Build a motif adjacency matrix

Description Usage Arguments Details Value Examples

View source: R/motifadjacency.R

Description

Build a motif adjacency matrix from an adjacency matrix.

Usage

1
2
3
4
5
6
7
build_motif_adjacency_matrix(
  adj_mat,
  motif_name,
  motif_type = c("struc", "func"),
  mam_weight_type = c("unweighted", "mean", "poisson"),
  mam_method = c("sparse", "dense")
)

Arguments

adj_mat

Adjacency matrix from which to build the motif adjacency matrix.

motif_name

Motif used for the motif adjacency matrix.

motif_type

Type of motif adjacency matrix to build. One of "func" or "struc".

mam_weight_type

The weighting scheme to use. One of "unweighted", "mean" or "product".

mam_method

Which formulation to use. One of "dense" or "sparse". The sparse formulation avoids generating large dense matrices so tends to be faster for large sparse graphs.

Details

Entry (i, j) of a motif adjacency matrix is the sum of the weights of all motifs containing both nodes i and j. The motif is specified by name and the type of motif instance can be one of:

The weighting scheme can be one of:

Value

A motif adjacency matrix.

Examples

1
2
adj_mat <- matrix(c(1:9), nrow = 3)
build_motif_adjacency_matrix(adj_mat, "M1", "func", "mean")

Example output

3 x 3 sparse Matrix of class "dgCMatrix"
                                 
[1,]  1.333333 14.000000 16.66667
[2,] 14.000000  6.666667 19.33333
[3,] 16.666667 19.333333 12.00000

motifcluster documentation built on Nov. 15, 2021, 9:06 a.m.