Code and documentation for the consitency paper
Prerequisites:
- Python 3.5 or 3.6
- Python package nwtools. You can install it with:
pip install -e https://github.com/research-Dafne/network-tools
.
Read a node file and edge file, and run consensus clustering for a specific threshold, and calculate edge and node consistency scores.
Example usage: python scripts/run_consistency.py data/edges.csv data/nodes.csv
Usage: run_consistency.py [OPTIONS] EDGE_FILE NODE_FILE
Options:
-sn, --sepn TEXT seperator for node file
-se, --sepe TEXT seperator for edges file
-i, --idcol TEXT name of ID column in nodes header
-w, --weightcol TEXT name of weight column in edges header
-t, --threshold FLOAT threshold for consensus clustering
-n, --nriter INTEGER number of initial clusterings
-o, --out_dir PATH
--help
Runs consensus clustering for different thresholds, with the same initial partitions that it reads from a file on DATAPATH
Usage: consensus_clustering.py [OPTIONS] DATAPATH
Options:
-s, --stepsize FLOAT stepsize for threshold list
-o, --out_dir PATH
--help
There is a notebook with the plots in the paper, as well as some further exploration, on an example data set.