All work
Research Software · 2026

CausalPhylo

Active

A published Python library implementing Pearl's backdoor criterion over knowledge graphs, separating edges that can carry a causal claim from those asserting only co-occurrence. Single dependency, typed, documented, on PyPI.

  • Python
  • NetworkX
What is checkable

causalphylo 0.1.0 on PyPI since 2026-10-17. One dependency, networkx>=3.3. Correctness verified on the four cases that separate a right implementation from a wrong one: confounder recovered, collider not adjusted for, mediator not adjusted for, trivial case identified.

Licence — LicenseRef-CausalPhylo-NonCommercial, source-available, not open source

Install
pip install causalphylo
Problem

What was broken.

A biomedical knowledge graph hands you edges. Most of them assert co-occurrence rather than cause — a literature co-mention, a shared pathway, an undirected interaction whose arrow is an artifact of column order — and an estimator applied to one of those returns a plausible number with nothing behind it. Identification is the stage that decides whether a causal claim is licensed at all, and it is the stage most pipelines assume rather than prove. Mine did, and the audit found it unsound.

Architecture

How it is wired.

Pearl's backdoor criterion over NetworkX directed graphs, with the admissibility rules that decide which edges may carry a causal claim in the first place. A query comes back as one of three things: identifiable with no adjustment, identifiable given an adjustment set the library hands back, or not identifiable — a refusal rather than a zero, and reported as one. One dependency, networkx>=3.3, so it drops into a pipeline without pulling a framework in behind it. It knows nothing about biology, and nothing about NeoRx.

Build

What I shipped.

  • Backdoor-criterion identification over NetworkX directed graphs, returning an adjustment set or an explicit refusal
  • Edge-admissibility rules separating a directed mechanism from an edge that only asserts co-occurrence
  • A typed public surface with its own test suite — test_backdoor.py and test_graph_semantics.py
  • The four correctness cases that separate a right implementation from a wrong one: confounder recovered, collider left alone, mediator left alone, trivial case identified
  • Published to PyPI as causalphylo 0.1.0, with its own documentation site, CHANGELOG and licence
Tradeoffs

Why these choices.

Shipped as a standalone library rather than as a module inside the platform that needed it, because a correctness claim is easier to check — and easier for anyone else to reuse — when it is not entangled with a pipeline. "Published" here means published to PyPI: there is no CausalPhylo paper, and the word is used in that narrower sense deliberately. The licence is source-available and non-commercial, not open source. NeoRx imports this; the dependency runs one way.