Learn R Programming

motifcluster

An R package for motif-based spectral clustering of weighted directed networks.

Introduction

The motifcluster package provides implementations of motif-based spectral clustering of weighted directed networks in R. These provide the capability for:

  • Building motif adjacency matrices
  • Sampling random weighted directed networks
  • Spectral embedding with motif adjacency matrices
  • Motif-based spectral clustering

The methods are all designed to run quickly on large sparse networks, and are easy to install and use. These methods are based on those described in [Underwood, Elliott and Cucuringu, 2020], which is available at arXiv:2004.01293.

Installation

install.packages("motifcluster")

Dependencies

  • igraph
  • Matrix
  • RSpectra

Documentation

Documentation for the motifcluster package is available in the doc directory.

Vignette

An instructional vignette for the motifcluster package is available in the vignettes directory.

Author

Copy Link

Version

Install

install.packages('motifcluster')

Monthly Downloads

271

Version

0.2.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

William George Underwood

Last Published

November 18th, 2022

Functions in motifcluster (0.2.3)

mam_M11

Perform the motif adjacency matrix calculations for motif M11
get_motif_names

Get common motif names
mam_M12

Perform the motif adjacency matrix calculations for motif M12
random_sparse_matrix

Build a random sparse matrix
run_motif_embedding

Run motif embedding
sample_bsbm

Sample a bipartite stochastic block model (BSBM)
run_laplace_embedding

Run Laplace embedding
mam_Ms

Perform the motif adjacency matrix calculations for motif Ms
run_motif_clustering

Run motif-based clustering
kmeanspp

kmeans++ clustering
sample_dsbm

Sample a directed stochastic block model (DSBM)
mam_M10

Perform the motif adjacency matrix calculations for motif M10
mam_M5

Perform the motif adjacency matrix calculations for motif M5
mam_M3

Perform the motif adjacency matrix calculations for motif M3
mam_M2

Perform the motif adjacency matrix calculations for motif M2
mam_M6

Perform the motif adjacency matrix calculations for motif M6
mam_M13

Perform the motif adjacency matrix calculations for motif M13
get_largest_component

Get largest connected component
mam_Mexpa

Perform the motif adjacency matrix calculations for motif Mexpa
mam_M4

Perform the motif adjacency matrix calculations for motif M4
mam_Mcoll

Perform the motif adjacency matrix calculations for motif Mcoll
mam_M1

Perform the motif adjacency matrix calculations for motif M1
mam_M9

Perform the motif adjacency matrix calculations for motif M9
mam_M7

Perform the motif adjacency matrix calculations for motif M7
mam_M8

Perform the motif adjacency matrix calculations for motif M8
mam_Md

Perform the motif adjacency matrix calculations for motif Md
build_Gd

Build double-edge adjacency matrix
build_motif_adjacency_matrix

Build a motif adjacency matrix
a_b_one

Compute a right-multiplication with the ones matrix
build_Gp

Build product adjacency matrix
build_Id

Build identity matrix
build_J0

Build missing-edge indicator matrix
demonstration_graph

Generate a small graph for demonstrations
build_J

Build directed indicator matrix
build_G

Build sparse adjacency matrix
build_Jd

Build double-edge indicator matrix
drop0_killdiag

Set diagonal entries to zero and sparsify
get_first_eigs

Compute first few eigenvalues and eigenvectors of a matrix
build_Gs

Build single-edge adjacency matrix
a_one_b

Compute a left-multiplication with the ones matrix
cluster_spectrum

Get cluster assignments from spectrum using k-means++
build_Jn

Build vertex-distinct indicator matrix
build_Je

Build edge-and-diagonal indicator matrix
build_Js

Build single-edge indicator matrix
build_laplacian

Build a Laplacian matrix