NetBench Protocol v1.0.0 is a small, dependency-light reference implementation of the five-step benchmark protocol described in the manuscript. It converts a collection of cross-study association-network comparisons into an auditable report.
The workflow evaluates five questions:
- What is the within-study reproducibility baseline?
- Which comparisons are protocol matched, mismatched, or uncertain?
- Does network concordance add information beyond composition concordance?
- Is an observed class contrast larger than the minimum detectable effect?
- How often does an estimator fail, and what are the sample-to-node constraints?
The implementation is intentionally separate from any single microbiome estimator. Inputs are pair-level and within-study summary tables, so the protocol can be applied to correlation networks, graphical models, Bayesian networks, species-interaction models, or other association graphs.
Python 3.10 or later is required.
python -m pip install -e .The reference example uses only NumPy and pandas.
Windows PowerShell:
.\run_example.ps1POSIX shell:
./run_example.shThe command writes three files to examples/rhizosphere/output/:
benchmark_summary.json: machine-readable results.benchmark_report.md: human-readable audit report.benchmark_checks.csv: completeness and interpretation checks.
Association matrices can be converted to one pair-level record with:
python tools/compare_association_matrices.py \
--a network_a.csv \
--b network_b.csv \
--density 0.05 \
--out pair_record.jsonThe matrix files use the first column as the node identifier. Node identifiers must match after alignment. The tool computes rank correlation over off-diagonal edge weights and Jaccard overlap among the highest-absolute-weight edges at the declared density.
python -m netbench \
--pairs examples/rhizosphere/pairs.csv \
--within examples/rhizosphere/within_study.csv \
--mde examples/rhizosphere/mde.csv \
--config examples/rhizosphere/config.json \
--out examples/rhizosphere/output
Required columns:
| Column | Meaning |
|---|---|
pair_id |
Stable identifier for a comparison |
study_class |
User-defined comparison class |
method |
Association-network estimator |
network_similarity |
Pair-level network concordance |
composition_similarity |
Concordance of system state variables, community composition, or another non-network comparator |
protocol_match |
matched, mismatched, or uncertain |
estimator_failed |
true or false; true if the estimator returned an unusable or empty graph |
sample_to_node_ratio |
Samples divided by nodes for the smaller or limiting network |
Required columns:
| Column | Meaning |
|---|---|
study_id |
Stable identifier for a study or experimental unit |
method |
Association-network estimator |
network_similarity |
Agreement among independently reconstructed graphs from the same study |
Required columns:
| Column | Meaning |
|---|---|
method |
Association-network estimator |
contrast |
Two class labels separated by ` |
minimum_detectable_effect |
Smallest absolute difference detectable at a declared power |
If this file is omitted, NetBench reports an analytic normal-approximation calculation based on the observed class-level standard deviations. Analytical values are a screening aid. Design-based resampling should be used for publication-grade inference.
Example:
{
"primary_method": "spearman_clr",
"reference_class": "cross_crop",
"comparisons": ["same_crop", "same_platform"],
"alpha": 0.05,
"power": 0.8,
"minimum_class_size": 5
}The workflow does not declare a network comparison valid or invalid. It reports the evidence needed to bound the interpretation:
- A class contrast at or above the within-study baseline is not automatically valid.
- A contrast below the minimum detectable effect is reported as unresolved, not as evidence of no difference.
- A network comparator must be evaluated against a composition comparator.
- Missing estimator outputs are retained as failures rather than silently removed.
- Shared code, preprocessing, and node sets are recorded as sources of non-independence.
python -m unittest discover -s tests -vMIT. See LICENSE.