Installation
Install from GitHub
pip install "skm-tools @ git+https://github.com/NIB-SI/skm-tools.git"
Or download and install:
git clone https://github.com/NIB-SI/skm-tools.git
cd skm-tools
pip install .
skm-tools needs Python 3.10 or later. The required dependencies are networkx (3 or later) and pandas (2 or later).
Optional dependencies
pip install "skm-tools[<optional-dependencies>] @ git+https://github.com/NIB-SI/skm-tools.git"
Where <optional-dependencies> is a comma-separated list of:
cytoscape: Cytoscape automation (skm_tools.cytoscape_utils), requires py4cytoscape and a running Cytoscape (3.10 or later); node charts also need the enhancedGraphics apppdf: cropping and combining PDFs, e.g. exported networks (skm_tools.pdf_utils), requires pypdf, pdfCropMargins and reportlabtutorials: to run the tutorials (matplotlib, py4cytoscape and a Jupyter kernel)docs: to build this documentationtest: to run the tests (pytest)
For example:
pip install "skm-tools[cytoscape,pdf] @ git+https://github.com/NIB-SI/skm-tools.git"
Graphviz layouts additionally need pygraphviz.
Messages
The functions report what they did (e.g. how many nodes a filter removed, a download, or
nodes that weren’t found) with Python’s standard logging, under the skm_tools
logger. Python shows only warnings by default; to see all messages, e.g. at the top of a
notebook:
import logging
logging.basicConfig(level="INFO")
Or only those of skm-tools: logging.getLogger("skm_tools").setLevel("INFO") (with a
handler, e.g. from logging.basicConfig()).
Tests
git clone https://github.com/NIB-SI/skm-tools.git
cd skm-tools
pip install ".[test]"
pytest
See https://github.com/NIB-SI/skm-tools/tree/main/tests. The Cytoscape tests mock py4cytoscape, so Cytoscape doesn’t need to run.
The tutorials double as integration tests: the CI runs them without their Cytoscape cells.
To run them completely, with a running Cytoscape, use tutorials/run-tutorials.sh.
Building the documentation
pip install ".[docs]"
cd docs
make clean
make html
The pages are written to docs/build/html.