1. Methods
1. Methods
1.1 Network and notation
The vertex set contains the driver gene a, R response genes b and the intermediate genes, N vertices in total. Interactions are directed edges u → v. The adjacency matrix is stored as Avu = 1 when the edge u → v exists (destination first, as in getLaplacian), and the Laplacian is L = Dout − A, where Dout holds out-degrees. Every column of L sums to zero, so the dynamics below conserve total activity.
1.2 Response dynamics
The driver is given unit activity and activity spreads by linear diffusion, dx/dt = −L x, with solution x(t) = G(t) x(0) and Green's function G(t) = exp(−tL). The entry Gxa(t) is the activity at gene x at time t after perturbing a. Because G is a matrix exponential, G(T) = G(T−t) G(t) for any 0 ≤ t ≤ T.
1.3 Time scale (relaxation parameter r)
At short times the driver's activity decays at rate kout(a). The code picks the total time T = ntΔt so that, to leading order, driver activity falls by the fraction r: Δt = −ln(1−r) / (kout(a) · nt). The defaults are r = 0.5 and nt = 16.
1.4 Gene weight
For intermediate gene x, the unnormalised weight sums over responses the time integral of "activity reaches x from the driver at time t, then reaches the response in the remaining time":
W(x) = Σb ∫0T Gbx(T−t) Gxa(t) dt, w(x) = W(x) / Σy W(y).
By the semigroup property, summing the integrand over all genes x gives Gba(T) at every t. So w(x) is the time-averaged share of driver-to-response influence that is routed through x. This is a mechanistic ranking: genes that sit on many short, well-connected routes between the driver and the responses score highly, whatever their global connectivity. As in the reference code, the driver and the response currently being scored are excluded from its own term, and weights are normalised to sum to 1.
1.5 Numerics and complexity
G(ti) for i = 0…16 is built from one matrix exponential exp(−Δt L) (scipy.linalg.expm) and repeated multiplication. The 17-point grid fits Romberg quadrature (scipy.integrate.romb), which needs 2k+1 samples. My implementation contracts all responses and genes in one tensor operation. Cost is O(nt N3) time and O(nt N2) memory for the dense matrices, which is fine for a few thousand genes but not for much larger networks. Ranks use competition ranking for ties (1, 2, 2, 4).
1.6 Baselines
Baselines (all run on the network). Driver-to-response betweenness (NetworkX subset, the paper's comparator), full-network betweenness, out-degree, and driver personalised PageRank (restart at Twist1, α = 0.85). Only NetPert uses the responses as diffusion targets (subset betweenness uses them as path endpoints).
1.7 Simulated benchmark design
| Element | Setting |
|---|---|
| Network | 17,191 genes; 1,891,745 directed edges (IID mouse PPI + TRRUST v2 regulatory edges) |
| Driver | Twist1 (inducible Twist1 mouse mammary organoids) |
| Responses | 168 in-network of 182 DE genes (14 absent from IID+TRRUST); all responses used |
| Ground truth | None — DIR/path-type status, drug mapping and dissemination assays (all NetPert-independent) |
| Evaluation | Rank agreement (Spearman), top-k overlap, druggable enrichment; stability over 3 edge-drop repeats; relaxation sweep r = 0.1–0.99 (nt = 16) |
| Edge removal | 10%, 25%, 50% of edges removed uniformly; 3 repeats; Spearman vs unperturbed ranking |
| Relaxation sweep | r = 0.1, 0.25, 0.5, 0.75, 0.9, 0.99 (nt fixed at 16) |
1.8 Known weaknesses of this design
Known weaknesses of this design. There is no ground truth on , so accuracy claims are replaced by NetPert-independent checks (path types, drug enrichment, assays). TRRUST directions are but regulation sign is ignored (40% missing and context-dependent, per the paper). 14/182 responses are absent from IID+TRRUST. Edge-drop intervals use 3 repeats and are descriptive. This page covers the algorithmic core plus the paper's data pipeline: IID + TRRUST construction and Drug Repurposing Hub scoring via mouse–human homology.
Design supplement ()
Six stages, no invented inputs.
Every number from inputs.
1 driver + intermediates + 168 in-network responses.