greenelab / xswap-analysis

Analysis and experiments for https://github.com/greenelab/xswap-manuscript
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link
degree edge-prior hetnets networks notebooks permutation software tool xswap

Analysis and figure generation for XSwap project

This repository hosts notebooks, images, and data for the XSwap project. The results of these analyses are described in the manuscript titled:

The probability of edge existence due to node degree: a baseline for network-based predictions

Along with the manuscript, this project produced an open-source implementation of our network permutation algorithm. Available on PyPI as xswap and source on GitHub in hetio/xswap.

Layout

The analyses for this repository are performed by sequentially numbered Jupyter notebooks in the nb directory. Data is written to the data directory and figures are exported to the img directory.

The analyses depend on the Hetionet HetMat dataset, which can be downloaded by running the following Python command from this repo's root directory:

from hetmatpy.hetmat.archive import load_archive
load_archive(
    archive_path="https://github.com/hetio/hetionet/raw/b467b8b41087288390b41fdb796577ada9f03bda/hetnet/matrix/hetionet-v1.0.hetmat.zip",
    destination_dir="data/task1/hetionet-v1.0.hetmat",
)

Environment

This repository uses conda to manage its environment as specified in environment.yml. Install the environment with:

# install new xswap-analysis environment
conda env create --file=environment.yml

# update existing xswap-analysis environment
conda env update --file=environment.yml

# export the locked environment specification, which lists every package
# installed in the environment including implicit dependencies.
# Includes build numbers and is operating system specific.
conda env export --name=xswap-analysis > environment-lock-linux.yml

Then use conda activate xswap-analysis and conda deactivate to activate or deactivate the environment.

License

The entire repository is released under a BSD 3-Clause License. Furthermore: