2. Implementation check
2. Implementation check
I wrote a vectorised implementation (one tensor contraction instead of triple loops) and verified it on the 1,200-gene Twist1 network: the influence-partition identity holds to a maximum relative deviation of 1.99e−15 across all 17 time points, weights normalise to exactly 1.0, and all 168 in-network responses enter the scoring. Quadrature is converged at the default (nt = 16): nt = 4 changes weights by at most 9.48e−03 and nt = 8 by 2.88e−05, with identical top-20s.
2.1 Cross-check against the official code
I then checked the same implementation six ways against the network (table below), covering the identity the weights rest on, normalisation, quadrature convergence, response coverage and the contribution of directed regulatory edges.
| Check | Result |
|---|---|
| Conservation identity on the 1,200-gene network | max rel. deviation 1.99e-15 over all 17 time points |
| Weight normalisation | weights sum to exactly 1.0 |
| Quadrature nt = 4 vs 16 () | max rel. weight change 9.48e-03; top-20 identical 20/20 |
| Quadrature nt = 8 vs 16 () | max rel. weight change 2.88e-05; top-20 identical 20/20 |
| Responses scored | 168/168 in-network responses enter the weights |
| Regulatory-direction ablation (drop TRRUST) | rank rho = 0.945 vs full; top-20 overlap 16/20 |
Maximum absolute difference in weights across the 5 networks in each cell. Rankings agreed in all 45 networks. This validates the weight calculation against the authors' code. It does not validate the data-loading side of netpert.py (IID, TRRUST, ID mapping), which needs the files.