Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
5fe1821
Add LEMBAS data retrieval module to networkcommons
HugoHakem Jun 17, 2026
277a83c
Add LEMBAS perturbation-response pipeline with baselines and tests
HugoHakem Jun 17, 2026
9dd5377
Add per-condition evaluation axis, LEMBAS tutorial notebook, and torc…
HugoHakem Jun 17, 2026
d422e5c
chore: migrate to uv
HugoHakem Jun 22, 2026
7255b29
chore: simplify formatter w/ ruff
HugoHakem Jun 22, 2026
e189579
chore: complete migration from poetry to uv, modernise tooling
HugoHakem Jun 22, 2026
ae3cc47
fix: upgrade dependencies and fix pypath RaMP import crash
HugoHakem Jun 22, 2026
27cc9fb
fix: adapt to corneto beta + decoupler 2.x API changes
HugoHakem Jun 22, 2026
578e24b
docs: update installation guide for new dependencies and GPU setup
HugoHakem Jun 22, 2026
93a28e0
ci: migrate ReadTheDocs config to native uv integration
HugoHakem Jun 22, 2026
6d74147
chore: add flop/pertpy/torch-cu128 extras, rdata dep, and dev-cu128 env
HugoHakem Jun 26, 2026
a1bd6e3
fix: resolve issues surfaced by re-running notebooks after env modern…
HugoHakem Jun 26, 2026
3a1a3bd
feat: add get_hmdb_mapper to MOON data module
HugoHakem Jun 26, 2026
f4bb2e7
feat: faithfully reimplement LEMBAS-RNN matching Nilsson et al. 2022
HugoHakem Jun 26, 2026
7616f06
fix: update tests broken by env modernisation and decoupler 2.x fix
HugoHakem Jun 26, 2026
9150065
ci: switch uv sync from --locked to --frozen in test workflow
HugoHakem Jun 26, 2026
a485f9b
feat: add omnipath-client dependency, note workaround branch for get_…
HugoHakem Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true -diff
26 changes: 6 additions & 20 deletions .github/workflows/sphinx_autodoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,15 @@ jobs:
- name: Install Pandoc
run: |
sudo apt-get install -y pandoc
- name: Setup Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
enable-cache: true
python-version: "3.11"
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
run: uv sync --locked --group docs
- name: Build documentation
run: poetry run make html --directory docs/
run: uv run make html --directory docs/
- name: Commit files
run: |
git config --local user.email "action@github.com"
Expand Down
33 changes: 8 additions & 25 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,22 @@ jobs:
echo "PATH=\"$(brew --prefix graphviz)/bin:$PATH\"" >> "$GITHUB_ENV"
echo "CFLAGS=\"-I$(brew --prefix graphviz)/include\"" >> "$GITHUB_ENV"
echo "LDFLAGS=\"-L$(brew --prefix graphviz)/lib\"" >> "$GITHUB_ENV"
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
enable-cache: true
python-version: ${{ matrix.python }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction -E corneto-backends
run: uv sync --frozen --group test --extra corneto-backends
- name: Tests and coverage
if: ${{ github.event_name == 'push' }}
run: |
poetry run pytest -v --cov --color=yes --durations=0
run: uv run pytest -v --cov --color=yes --durations=0
- name: Tests
if: ${{ github.event_name == 'pull_request' }}
run: |
poetry run pytest -v --cov --color=yes --durations=0
run: uv run pytest -v --cov --color=yes --durations=0
- name: Upload coverage reports to Codecov
if: ${{ github.event_name == 'push' }}
env:
CODECOV_NAME: ${{ matrix.python }}-${{ matrix.os }}
run: |
poetry run codecovcli --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'fast'-${{ github.run_id }} -F fast
uv run codecovcli --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'fast'-${{ github.run_id }} -F fast
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ work/
test.ipynb
flop.png
*.h5ad
.venv
.venv
.envrc
requirements-local.txt
flop_repo/
53 changes: 6 additions & 47 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,12 @@ repos:
- id: unexport
args: [--refactor, --single_quotes]
exclude: __init__.py$
- repo: https://github.com/google/yapf
rev: v0.32.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.0
hooks:
- id: yapf
additional_dependencies: [toml]
stages: [manual]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
additional_dependencies: [toml]
stages: [manual]
- repo: https://github.com/Instagram/Fixit
rev: 9d59f968e84bd2773f34b0069eeeaad3ce783254
hooks:
- id: fixit-run-rules
stages: [manual]
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
additional_dependencies: [toml]
- repo: https://github.com/snok/pep585-upgrade
rev: v1.0.1
hooks:
- id: upgrade-type-hints
args: [--futures=true]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/myint/unify
rev: v0.5
hooks:
Expand All @@ -67,19 +42,9 @@ repos:
- id: check-symlinks
- id: check-yaml
args: [--unsafe]
- id: check-ast
- id: fix-encoding-pragma
args: [--remove] # for Python3 codebase, it's not necessary
args: [--remove]
- id: requirements-txt-fixer
- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.2.3
hooks:
- id: Flake8-pyproject
additional_dependencies:
- flake8-docstrings
- flake8-comprehensions
- flake8-bugbear
- git+https://github.com/saezlab/flake8-kwargs-spaces.git
- repo: https://github.com/rstcheck/rstcheck
rev: v6.1.2
hooks:
Expand All @@ -89,11 +54,6 @@ repos:
rev: 1.13.0
hooks:
- id: blacken-docs
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py3-plus, --py38-plus, --keep-runtime-typing]
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.8.0
hooks:
Expand All @@ -103,7 +63,6 @@ repos:
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- id: python-check-blanket-noqa
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
18 changes: 10 additions & 8 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
version: 2

sphinx:
configuration: docs/src/conf.py

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.12"
uv: "latest"

python:
install:
- method: pip
path: .
- requirements: docs/src/requirements.txt
- method: uv
command: sync
groups:
- docs

sphinx:
configuration: docs/src/conf.py
36 changes: 36 additions & 0 deletions docs/src/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,24 @@ SignalingProfiler

methods.run_signalingprofiler

.. _api-perturbation:

Perturbation response
=====================
.. module::networkcommons.methods
.. currentmodule:: networkcommons

.. autosummary::
:toctree: api
:recursive:

methods.network_to_perturbation_table
methods.split_perturbation_data
methods.evaluate_predictions
methods.run_mean_response_baseline
methods.run_ridge_baseline
methods.run_lembas_rnn

.. _api-pk:

Prior Knowledge
Expand Down Expand Up @@ -223,6 +241,23 @@ Phospho-EGF meta-analysis
data.omics.phospho_egf_datatypes
data.omics.phospho_egf_tables

.. _api-lembas:

LEMBAS
~~~~~~
.. module::networkcommons.data.omics
.. currentmodule:: networkcommons

.. autosummary::
:toctree: api
:recursive:

data.omics.lembas_datasets
data.omics.lembas_network
data.omics.lembas_ligands
data.omics.lembas_tfs
data.omics.lembas_annotation

.. _api-eval:

Evaluation and description
Expand Down Expand Up @@ -300,6 +335,7 @@ Utilities
utils.to_networkx
utils.read_network_from_file
utils.network_from_df
utils.lembas_format_network
utils.get_subnetwork
utils.decoupler_formatter
utils.targetlayer_formatter
Expand Down
3 changes: 2 additions & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
'sphinx_autodoc_typehints',
'sphinx.ext.autosectionlabel',
'sphinx_copybutton',
'numpydoc',
'nbsphinx',
'IPython.sphinxext.ipython_console_highlighting'
]
Expand All @@ -39,6 +38,8 @@
# -- Options for HTML output
master_doc = 'contents'

nbsphinx_execute = 'never'

autosummary_generate = True
autosummary_imported_members = False
autodoc_member_order = "alphabetical"
Expand Down
3 changes: 2 additions & 1 deletion docs/src/contents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ NetworkCommons: Table of Contents
:caption: Additional resources

vignettes/A_moon
vignettes/B_pertpy
vignettes/B_pertpy
vignettes/C_lembas
22 changes: 22 additions & 0 deletions docs/src/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,28 @@ Phosphoproteomics in response to EGF

**Functions:** See API documentation for :ref:`Phospho-EGF meta-analysis<api-phosphoegf>`.

.. _details-lembas:

LEMBAS
------

**Alias:** lembas_macrophage, lembas_ligand_screen

**Description:** Signaling network, ligand concentration and TF activity data from the LEMBAS resource

**Publication Link:** `Nilsson, A. et al. Artificial neural networks enable genome-scale simulations of intracellular signaling. Nat Commun 13, 3069 (2022). <https://doi.org/10.1038/s41467-022-30684-y>`_

**Data location:** `Zenodo (macrophage) <https://zenodo.org/records/10815391>`_ / `GitHub — Lauffenburger-Lab/LEMBAS (ligand screen) <https://github.com/Lauffenburger-Lab/LEMBAS>`_

**Detailed Description:** Two experimental datasets used in the LEMBAS paper to train and evaluate the signaling network RNN model.
The **macrophage dataset** (low-coverage) contains ~10 extracellular ligands across ~170 stimulation conditions in macrophages.
The **ligand screen dataset** (high-coverage) contains ~60 extracellular ligands across ~500 conditions.
Each dataset includes three components: a prior knowledge signaling network (protein–protein interactions with stimulating/inhibiting annotations),
a ligand input matrix (binary presence/absence per condition), and a TF activity matrix (DoRothEA/VIPER scores normalised to [0, 1]).
Node identifiers are UniProt IDs throughout.

**Functions:** See API documentation for :ref:`LEMBAS <api-lembas>`.

.. _details-pk:


Expand Down
Loading
Loading