Module 20: Statistical Models and Inference for Connectomics

Build defensible statistical inference workflows for connectomics analyses, from null models to uncertainty reporting.

Stylized vector art: two overlapping distributions with the effect gap bracketed.

Lesson Flow

Learn

Goals and Concepts

Start with the capability target and concept set for this module.

Practice

Studio Activity

Apply the ideas in a guided activity tied to realistic outputs.

Check

Assessment Rubric

Use the rubric to verify competency and identify improvement targets.

Interactive Lab

Practice in short loops: checkpoint quiz, microtask decision, and competency progress tracking.

Inference Design Checkpoint

Q1. You found an enriched motif by scanning 13 motif classes in one dataset. What can that dataset establish about it?

Correction controls the error rate of the scan; it does not convert the winner of that scan into a tested hypothesis, because the same data both chose and evaluated it. Effect size speaks to whether a result matters, not to how it was found. Label the finding exploratory and reserve a separate dataset, or a preregistered test, for confirmation.

Q2. Two null models give contradictory answers about the same motif. What is the correct response?

A null encodes an assumption about what should count as chance, so two nulls preserving different properties are answering different questions. When a degree-preserving and a spatially constrained null disagree, the gap between them estimates how much geometry contributes, which is a result. Choosing the flattering null is the researcher-degrees-of-freedom failure this module names.

Q3. Why do standard tests that treat each edge as independent understate uncertainty in a connectome?

Non-independence is the structural problem: neighbouring pairs share geometry, staining and alignment, so the effective number of independent observations is far below the edge count and p-values come out too small. Count distributions and low density are real complications, but permutation tests handle those while still assuming exchangeable units, which is exactly what autocorrelation breaks.

Inference Design Sheet Microtask

Which pair belongs on your inference design sheet before any test is run?

Progress Tracker

State is saved locally in your browser for this module.

0% complete

Capability target

Design and execute a connectomics inference plan that includes null-model choice, multiplicity control, uncertainty reporting, and explicit claim boundaries.

Why this module matters

Connectomics analyses can produce thousands of statistically testable patterns. Without disciplined inference, teams risk publishing artifacts from preprocessing bias, multiple comparisons, or misaligned null assumptions.

Concept set

1) Null models encode scientific assumptions

2) Multiplicity is structural, not optional

3) Exploratory and confirmatory analyses must be separated

4) Statistical challenges unique to connectomics

Connectomics datasets present several statistical difficulties that are uncommon in other fields. Massive multiple comparisons arise when testing thousands of motifs, cell-type pairs, or connection patterns simultaneously. Spatial autocorrelation is pervasive because nearby neurons share arbor overlap, creating non-independent edges that violate standard test assumptions. The threshold problem is particularly acute: choosing a minimum synapse count (e.g., 3 vs. 5 synapses to define a “real” connection) changes the resulting graph and all downstream statistics, yet no universally accepted threshold exists.

Researcher degrees of freedom in null model selection further compound these issues. Different null models that preserve different graph properties (degree sequence, spatial distance distribution, cell-type composition) can yield contradictory conclusions from the same data. Best practices include using permutation tests over parametric alternatives when distributional assumptions are uncertain, reporting effect sizes alongside p-values to distinguish statistical significance from biological relevance, and performing sensitivity analyses across multiple thresholds and null model variants to confirm that findings are robust rather than artifacts of a single analytical choice.

Worked example: the motif that survived the null and died in the error band

The numbers below are illustrative — they show the shape of the reasoning, not results from a specific dataset. The companion example — the same reciprocity count yielding 2.9x enrichment, 1.4x, or no effect depending on the null — is worked line by line in Technical Unit 09; read it first. This example starts where that one ends: the null is already chosen well, and the claim still falls apart.

You run a triad census on a 300-neuron subgraph: 16 directed three-node classes. The feedforward-loop triad looks enriched.

Step 1: choose the null from the hypothesis, not the toolbox. The hypothesis is “feedforward structure beyond what degree and distance explain,” so the null must preserve each node’s in- and out-degree and the empirical connection-probability-versus-distance curve. Rewiring 10,000 times gives a null mean of 350 feedforward loops, sd 20, against an observed 402: enrichment 1.15x, z = 2.6, nominal p = 0.009. So far this looks publishable.

Step 2: count the tests you actually ran. You tested all 16 triad classes, and before settling you looked at the graph under two synapse-count thresholds (at least 3 and at least 5 synapses per edge). That is 32 tests, not 1. Bonferroni at α = 0.05 requires p below 0.0016; your 0.009 does not clear it. Benjamini-Hochberg is more forgiving but depends on the other 31 results — and its verdict must be reported either way.

Step 3: respect the dependence between tests. Triad counts move together — adding one edge changes many triads at once — so treating the 16 tests as independent overstates confidence in both directions. Permutation inference over the whole census, using the maximum-enrichment statistic, respects the dependence; here it gives a family-wise p of 0.06 for the feedforward loop. Borderline, honestly computed.

Step 4: run the error-sensitivity check. Your validation work gives measured error rates: 2% merge, 6% split. Perturb the graph at those rates 200 times and recompute enrichment each time: the band spans 0.97 to 1.28 — it crosses 1.0. Worse, the bias is directional: merges manufacture dense motifs, so reconstruction error pushes the statistic toward exactly the result you are hoping for.

Step 5: check threshold sensitivity. At threshold 3 synapses, enrichment is 1.15x; at threshold 5 it drops to 1.04x. The effect is concentrated in weak edges — which is also where synapse-detection false positives concentrate.

What gets reported. An exploratory finding: “feedforward-loop counts are 1.15x the degree-and-distance null (permutation p = 0.06, family-wise), not robust to measured reconstruction error rates or to the edge threshold.” The confirmatory path is written in the same paragraph: preregister the null, the threshold, and this single test, then run it on the next data release or a held-out region.

What this example does not establish: that the motif is absent. It shows only that this dataset, at these error rates, cannot support the enrichment claim — which is itself a result worth stating plainly.

Core workflow: connectomics inference protocol

  1. Question-to-test mapping
    • Convert biological question into estimand(s), test set, and effect-size target.
  2. Null-model design
    • Define null constraints and why they preserve key confounders.
  3. Inference execution
    • Run model/tests with preregistered thresholds and multiplicity controls.
  4. Robustness checks
    • Test sensitivity to preprocessing variant, sampling region, and parameter choice.
  5. Claim calibration
    • Report supported, uncertain, and unsupported claims in separate blocks.

60-minute tutorial run-of-show

Pre-class preparation (15 min async)

Minute-by-minute plan

  1. **00:00-06:00 Framing: the null is the scientific step**
    • Prompt: “Same graph, same motif, three null models, three different conclusions. Which one is right?”
    • Establish that the answer depends on what the hypothesis treats as uninteresting.
  2. **06:00-18:00 Worked example: reciprocity across nulls**
    • Instructor works the Unit 09 example live: 100 neurons, 1,200 edges, 210 reciprocal pairs.
    • Erdos-Renyi gives 2.9x. Degree-preserving gives 1.4x. Degree-and-distance gives 1.14x, not significant.
    • Think aloud about which null matches which hypothesis, not which gives the nicer number.
  3. **18:00-30:00 Guided practice: write the uninteresting explanation**
    • In pairs, learners take their brought-in claim and write, in words, the sentence “this result would be uninteresting if ___”.
    • Then name the null that preserves exactly that.
    • Instructor circulates asking “what does your null preserve, and what does it randomize?”
  4. **30:00-40:00 Multiplicity**
    • Count the tests actually run, including unreported ones. Choose a correction and justify it.
    • Surface the dependence problem: triad counts move together, so analytic p-values overstate confidence. Permutation inference respects the dependence.
  5. **40:00-50:00 Robustness and error sensitivity**
    • Each learner names one preprocessing choice (synapse threshold, inclusion criteria, boundary handling) and states how they would test sensitivity to it.
    • Introduce the error-simulation check: perturb the graph at measured merge and split rates, report the band.
  6. **50:00-57:00 Competency check**
    • Each learner submits: estimand, null model with what it preserves, correction strategy, one robustness check, and one claim they will not make.
  7. **57:00-60:00 Exit ticket**
    • “One result I now doubt, and the null model that would settle it.”

Formative checkpoints

Studio activity: motif inference challenge

Scenario: A team reports motif enrichment in one dataset and asks whether the claim generalizes.

Tasks

  1. Propose at least two candidate null models and justify each.
  2. Run or outline multiplicity-aware testing strategy across motif set.
  3. Draft a results summary separating exploratory and confirmatory findings.
  4. Add one robustness check for cross-dataset comparability.

Expected outputs

Assessment rubric

Common errors and how to recover

What this module does not cover

Content library references

Teaching resources

Evidence anchors from connectomics practice

Key papers to use in this module

Key datasets to practice on

Competency checks

Quick practice prompt

Write a 6-8 sentence inference note that includes:

  1. hypothesis and estimand,
  2. null-model assumptions,
  3. multiplicity strategy,
  4. one robust conclusion and one unresolved uncertainty.

Teaching Materials

Activity Worksheet

Learner worksheet aligned to the studio activity and rubric.

Open worksheet

Slide Source

Marp source file for editing and rendering.

course/decks/marp/modules/module20.marp.md

Related Content