Open the teaching deck, worksheet, and editable slide source.
Interactive Lab
Practice in short loops: checkpoint quiz, microtask decision, and competency progress tracking.
Graph Representation Checkpoint
Graph Schema Microtask
Your PI asks whether one cell type concentrates its input on the proximal dendrites of another. Which representation can answer that?
Progress Tracker
State is saved locally in your browser for this module.
0% complete
Capability target
Build one connectome graph representation and justify two metric choices for a defined hypothesis.
Concept set
1) From EM to graph: a lossy transformation
A connectome graph is an abstraction. The path from EM images to a graph involves: raw images → segmentation → synapse detection → neuron-to-neuron edge list → graph. Each step loses information: the graph retains connectivity topology but discards spatial relationships, organelle details, and membrane geometry. This is a feature (graphs are computationally efficient and analytically tractable) and a limitation (the graph cannot answer questions that require spatial context).
Key decision: What are your nodes? What are your edges? Neurons as nodes and synapses as directed edges is the default, but alternatives exist — compartment-level nodes (axon vs dendrite of the same neuron), type-level nodes (aggregating neurons by class), and different edge weightings (binary, synapse count, cleft area).
2) The threshold problem
In real connectomes, many neuron pairs share only 1-2 synapses. Are these “real” connections or detection noise? The choice of minimum synapse threshold for defining an edge dramatically changes the graph:
Threshold = 1: maximum sensitivity, maximum noise
Threshold = 5: cleaner graph, but genuine weak connections lost
No threshold: use continuous weights
There is no universally correct threshold. Report results across multiple thresholds (sensitivity analysis) and justify your choice based on the analysis question.
3) Graph metrics and what they mean biologically
Degree (in/out): How many partners does this neuron have? Hub neurons have high degree.
Clustering coefficient: Are a neuron’s partners connected to each other? High clustering = dense local circuits.
Path length: How many synapses separate two neurons? Short paths = efficient information flow.
Reciprocity: Fraction of connections that are bidirectional. High reciprocity in cortex (4× enriched, Song et al. 2005).
Modularity: Can the graph be partitioned into densely connected subgroups? Modules may correspond to functional units or cell-type communities.
4) Null models and the interpretation trap
A graph metric is meaningless without a baseline. “Clustering coefficient = 0.15” tells you nothing until you compare to a random graph with the same degree distribution (where clustering might be 0.02 — making 0.15 highly significant). Every metric computation should include the corresponding null-model comparison.
Misconception guardrails
Each of these is a belief a learner plausibly holds on arriving. Name it, then check your own work against it.
Misconception guardrail: the connectivity graph is the data, rather than one lossy projection of it that discards all geometry.
Misconception guardrail: the synapse threshold is a technical detail that does not need reporting.
Misconception guardrail: a graph metric means the same thing biologically as it does in its original network-science context.
Misconception guardrail: Erdos-Renyi is an acceptable null for a spatially embedded, degree-heterogeneous connectome.
Worked example: the hub that was a merge error
The numbers below are illustrative — they show the shape of the reasoning, not results from a specific published dataset.
Your PI hands you a 500-neuron subgraph from a cortical column and asks whether the circuit has hub neurons. You build the graph at threshold ≥1 synapse: 500 nodes, 11,400 directed edges, density 0.046. Here is the expert’s pass through it.
Step 1 — Look at the degree distribution before computing anything else. Sorted out-degrees: the top node has 214 partners; the next highest has 91. A degree outlier at more than twice the runner-up is a data-quality question before it is a biology question, because a merge error fuses two neurons’ partner lists and manufactures exactly this signature. Pull the mesh for the top node: two somata. It is a merge. Flag it upstream, exclude it from this analysis, and record the exclusion. The new top degree is 91, inside a smooth heavy tail — no single dramatic hub, but a top-5% tier of well-connected cells worth naming as candidates.
Step 2 — Compute clustering, then immediately ask “compared to what.” Clustering coefficient = 0.19. Alone, this number means nothing. Against 1,000 degree-preserving rewirings: null mean 0.11, sd 0.008 — the observed value is 1.7x the null, z about 10. Before writing “significant local structure,” say the next sentence out loud: nearby neurons connect more often because their arbors overlap, and a spatially constrained null would absorb some of this. You cannot run that null without soma positions in hand this week, so the claim is scoped: “clustering exceeds the degree-preserving expectation; a spatial null has not been applied.” That one sentence is the difference between a defensible report and a retraction-in-waiting; the spatial machinery itself is Technical Unit 09.
Step 3 — Re-run the headline numbers at a second threshold. At ≥3 synapses the graph keeps 4,100 edges — the 1-2 synapse pairs were 64% of all edges. Clustering rises to 0.24 against a null of 0.10, so the direction of the conclusion holds. But the hub candidate list changes: 3 of the top 10 cells by degree drop out, because their rank depended on many weak connections that may be detection noise. Report both thresholds and present the hub list as the intersection, with the cells that moved flagged.
Step 4 — Say what the abstraction lost. The graph cannot distinguish a synapse on the soma from one on a distal dendrite, and it has discarded every spatial relationship, so “hub” here means “many partners,” not “many strong or strategically placed inputs.” If the biological question is about influence rather than partner count, the compartment-level information this graph discarded is the missing evidence, and the module that handles synapse placement is Module 11.
What gets reported. A metrics table at two thresholds with null comparisons, the merged object’s exclusion with its evidence, the scoped clustering claim, and a hub candidate list stable across thresholds. What this does not establish: that the hubs are functionally important, that clustering survives a spatial null, or that the 1-synapse edges were noise — each of those is a further, separately designed test.
Core workflow
Define node/edge schema: what are your nodes, what are your edges, what weighting scheme?
Construct graph from synapse table (e.g., using CAVEclient + NetworkX). Inspect: number of nodes, edges, density, connected components.
Compare each metric to null-model expectation (degree-preserving random graph as minimum).
Interpret metrics against hypothesis. Report which metrics are significant and which are not.
Document abstraction limits: what information was lost in the graph construction?
60-minute tutorial run-of-show
Pre-class preparation (10 min async)
Read the graph representations content library entry
Install NetworkX: pip install networkx
Minute-by-minute plan
**00:00-08:00
Graph abstraction choices**
Show the same circuit as: (a) 3D EM rendering, (b) adjacency matrix, (c) node-link diagram. “These are three views of the same biology. Today we work with (b) and (c).”
Discussion: “What did we gain and lose in each transformation?”
**08:00-20:00
Graph build demo**
Live coding: load a synapse table, construct a NetworkX DiGraph, apply threshold, print basic stats.
Visualize the graph with spring layout. Color nodes by cell type.
“Notice: the spatial layout in this diagram is arbitrary. The graph doesn’t know where neurons are in the brain.”
**20:00-34:00
Metric computation**
Hands-on: learners compute degree distribution, clustering coefficient, and average path length.
Plot degree distribution (log-log). Is it heavy-tailed?
Compute clustering and compare to a random graph (NetworkX: nx.watts_strogatz_graph for comparison).
**34:00-46:00
Interpretation and null concerns**
“Your clustering coefficient is 3× higher than the random graph. What does that mean biologically?”
Discuss: spatial proximity as a confound. Would a spatially constrained null model change the conclusion?
Walk through one example: reciprocal connections. Count in real data vs degree-preserving null.
**46:00-60:00
Competency check**
Each learner writes a 1-paragraph graph analysis summary:
Schema (nodes, edges, threshold)
Two metrics with values and null-model comparisons
One biological interpretation and one limitation
Exit ticket: “Name one reason a graph metric might be misleading in your dataset.”
Studio activity: graph analysis report (60-75 minutes)
Scenario: You have the connectivity graph of 500 neurons in a cortical column from the MICrONS dataset. Your PI asks: “Is this circuit small-world? Are there hub neurons? Are there communities?”
Task sequence:
Load the graph and compute basic statistics (nodes, edges, density, components).
Compute: degree distribution, clustering coefficient, average path length.
Compare to degree-preserving random graph and Watts-Strogatz small-world reference.
Identify candidate hub neurons (top 5% by degree or betweenness centrality).
Run community detection (Louvain or Leiden). Do detected communities align with cell types?
Write a 1-page graph analysis report with figures, metrics, null comparisons, and biological interpretation.
Expected outputs:
Graph statistics summary table.
Degree distribution plot (log-log scale).
Community detection results with cell-type comparison.
1-page report.
Assessment rubric
Minimum pass
The node/edge schema is stated explicitly — node definition, edge direction, weighting, and synapse threshold — before any metric appears.
Each reported metric is paired with a null-model comparison; no bare metric values stand alone.
At least two metrics are linked in writing to the specific question they answer for the PI’s three asks (small-world, hubs, communities).
The report names at least one piece of information the graph abstraction discarded and one question it therefore cannot answer.
Strong performance
The headline result is re-run at a second synapse threshold, and the report states which conclusions held and which moved.
Degree outliers are checked against the underlying reconstruction before being reported as hubs, with the check documented.
More than one null model is used, or the limits of the single null are stated in words (what it does and does not control for).
Detected communities are compared against external labels (cell types), and disagreement is reported as a finding rather than suppressed.
Common failure to flag
Metric dumping — computing every available metric without explaining what question each answers.
Hub or community claims made without checking whether a merge error or threshold choice manufactured them.
A significance claim against Erdos-Renyi only, on a graph with obvious degree heterogeneity.
Common errors and how to recover
A metric is reported without a baseline. “Clustering = 0.19” is not a result. Recover by generating at least 1,000 degree-preserving rewirings, reporting the null mean and spread next to the observed value, and stating in one sentence what the null does not control (space, cell type).
The synapse threshold was chosen once and never revisited. In real connectomes 1-2 synapse pairs are typically the majority of edges, so the threshold silently decides your graph. Recover by re-running the headline numbers at a second threshold and reporting both; a conclusion that flips with the threshold is itself the finding.
A “hub” turns out to be a reconstruction artifact. A degree outlier far above the rest of the tail is a merge candidate. Recover by inspecting the object’s morphology before publishing the hub list, excluding confirmed merges with a documented reason, and rechecking whether the hub tier survives.
Community detection returned a partition and you believed it. Modularity methods return a partition for any graph, including a random one. Recover by comparing the achieved modularity to that of rewired graphs, and by validating detected communities against independent labels such as cell types; details are in Network analysis methods.
The report reads as if the graph were the biology. Path length in synapses is not conduction delay, and degree is not influence. Recover by adding a limits paragraph that names what the abstraction discarded — geometry, compartment targeting, synapse size — and which of the PI’s questions actually need that information.
What this module does not cover
Null models beyond degree preservation. Distance-dependent, cell-type-stratified, and generative nulls — and the worked example showing an effect vanish as nulls strengthen — are Technical Unit 09 and Motif analysis.
Motif-level statistics. The triad census, multiple-comparison handling, and merge-error bias on motif counts are Module 11 and Technical Unit 09.
Hypothesis design discipline. What makes a graph claim testable in the first place — metric scope, interpretation boundaries, pre-declared tests — is Module 08.
Where the edge list comes from. Segmentation and synapse-detection error, and how much to trust a 1-synapse edge, are Module 06 and Technical Unit 08.
Spectral methods, graph matching, and embeddings. These are surveyed in Network analysis methods; this module stops at the metric families a first analysis needs.