Motif-based spectral clustering of weighted directed networks
This repository provides implementations of motif-based spectral clustering of weighted directed networks in R, Python and Julia. This code is based on methods detailed in [Underwood, Elliott and Cucuringu, 2020], which is available at arXiv:2004.01293. These packages 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.
The main branch contains stable versions. The develop branch may be unstable, and is for development purposes only.
- William George Underwood, Princeton University (Python, R, Julia, maintainer)
- Andrew Elliott, The Alan Turing Institute (Python)
This repository and its included R, Python and Julia packages are all licensed under GPLv3.
The motifcluster R package is in the R directory.
The R package can be installed from CRAN with:
install.packages("motifcluster")
The R package has the following dependencies, available on CRAN:
- igraph
- Matrix
- RSpectra
The package's manual is in the R/doc directory. R documentation files are provided for each function available in the package. An instructional vignette is in the R/vignettes directory.
The motifcluster Python package is in the python directory.
The Python package can be installed from PyPI with:
pip install motifcluster
Alternatively it can be installed with conda using:
conda install -c conda-forge motifcluster
The Python package has the following dependencies:
- Networkx
- Numpy
- Scipy
- Scikit-learn
Full documentation is available at motifcluster.readthedocs.io.
The MotifCluster Julia package is in the julia directory.
From the Julia General registry:
] add MotifCluster
- Aqua
- Clustering
- Distributions
- Graphs
Documentation for the MotifCluster package is available on the web.
The performance directory contains scripts and plots relating to timing the construction of motif adjacency matrices, in R, Python and Julia.
A high-resolution hexagonal sticker is available in the sticker directory.