Skip to content

About

Executable five-step benchmark protocol for cross-study association-network modelling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NetBench Protocol

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:

  1. What is the within-study reproducibility baseline?
  2. Which comparisons are protocol matched, mismatched, or uncertain?
  3. Does network concordance add information beyond composition concordance?
  4. Is an observed class contrast larger than the minimum detectable effect?
  5. 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.

Installation

Python 3.10 or later is required.

python -m pip install -e .

The reference example uses only NumPy and pandas.

Run the worked example

Windows PowerShell:

.\run_example.ps1

POSIX shell:

./run_example.sh

The 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.json

The 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.

Command line

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

Input schemas

pairs.csv

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

within_study.csv

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

mde.csv

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.

config.json

Example:

{
  "primary_method": "spearman_clr",
  "reference_class": "cross_crop",
  "comparisons": ["same_crop", "same_platform"],
  "alpha": 0.05,
  "power": 0.8,
  "minimum_class_size": 5
}

Output logic

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.

Tests

python -m unittest discover -s tests -v

License

MIT. See LICENSE.

About

Executable five-step benchmark protocol for cross-study association-network modelling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages