Capstone C5

Capstone — Connectivity with and without leakage

~300 min

2 claims on this page are unverified. TODO(confirm) marks a specific statement the author has not yet checked against a primary source. Everything else on this page has been reviewed. Treat a marked claim as provisional and go to the cited source rather than quoting the sentence.

Brief

On ds-lemon eyes-closed resting data, compute alpha-band connectivity four ways — coherence at the sensor level, wPLI at the sensor level, wPLI after a surface Laplacian, and orthogonalized connectivity between cortical parcels — and then explain every difference between the four results.

The explanation is the capstone. Producing four matrices is a morning’s work; saying which of their differences are physiology, which are the estimator’s floor, which are the reference, which are leakage and which are the parcellation is the skill Level 5 exists to build. You will find that the four disagree substantially, and the temptation will be to decide which one is right. Resist it: they measure different things, and a result that appears in all four with the differences accounted for is worth far more than the prettiest matrix.

Write the analysis plan before you compute anything at the group level: frequency band and how you chose it, reference, cleaning, the measure, the surrogate construction, the multiple-comparisons correction, the exclusion rule, and — for the source half — the head model, the inverse operator and its regularization, the atlas, the parcel aggregation rule and the leakage correction. Keep the file.

Inputs

  • Data. ds-lemon eyes-closed resting recordings. The eyes-closed condition is chosen because alpha is largest there, which makes every connectivity estimate less noise-dominated, and because the resting state removes the “both channels are locked to the same stimulus” alternative explanation that an event-related design carries. LEMON also ships digitized electrode positions for a large subject set, which is what makes the head-model half of this capstone more than a template exercise. TODO(confirm): ds-lemon’s exact licence terms are recorded as unverified in this site’s catalogue, although both recorded statements are permissive; confirm the entry before shipping any derived asset.
  • Prior lessons. L5.1 (why the sensor matrix looks the way it does, and the 1/K floor), L5.2 (the measures and the surrogates), L5.3 (CSD and what it removes), L5.4 (head models and what a template costs), L5.5 (the inverse, and the resolution matrix), L5.6 (leakage, orthogonalization and parcellation).
  • A cleaning pipeline. The C2 pipeline, or an equivalent, with one Level 5 addition: record the rank of the data after cleaning, because ICA component removal and channel interpolation both reduce it and both bias every measure of shared variance between channels (L5.2). Interpolated channels should be excluded from the connectivity analysis, not merely flagged.

The source-space half is licence-blocked, and that is part of the assignment

This site’s notebooks cannot fetch a template anatomy. Both candidates fail the licensing policy: ds-fsaverage is governed by the FreeSurfer Software License Agreement v1.0, which permits derivative works only by propagating the whole agreement onto every copy, and is recorded as access: registration; ds-mne-sample’s licence is contested at source and is an open decision for this site’s author. Notebooks here use only openly accessible datasets, so the shipped nb-c5-connectivity-leakage does not download either, and no parcellation, leakage matrix or connectome ships anywhere in Level 5.

You have three honest routes, and the report must name which you took:

  1. Sensor space only, done properly. Deliver the first three analyses, and replace the fourth with the computable part of the source-space argument: build an inverse operator on a sphere model with a volume source space, compute its resolution matrix, and report how leakage falls with distance and grows with depth under your own operator and regularization. This establishes the mechanism without any anatomy, and it is a complete capstone.
  2. Obtain the anatomy yourself, under its own terms. The FreeSurfer licence is free to accept and the template is then yours to use locally. Nothing about that route is blocked for an individual; what is blocked is this site redistributing the result. If you take it, say so, name the licence you accepted, and do not commit anatomy-derived files to a public repository without checking what its terms require of you.
  3. Use your own individual MRIs, if you have them, which is the better analysis anyway and removes the template error entirely (L5.4).

Whichever route you take, the report states it in the methods, because the reader’s assessment of your localization claims depends on it. A capstone that quietly produces a parcel connectome without saying where the anatomy came from has failed the rubric line that matters most.

Subset rule and runtime

Capstone notebooks run on a documented subset inside the site’s ten-minute limit on a free cloud tier, and scale to the full cohort locally.

  • The documented subset is 10–20 subjects, listed by ID in the notebook’s first cells with the reason for the selection. Select by a rule that cannot depend on the result — the first n IDs, or every subject passing the pre-specified exclusion rule, in ID order.
  • A FULL_COHORT switch (default False) extends the run locally. Report which state every quoted number came from.
  • LEMON’s raw sampling rate is high and its files are large. Download only the subjects and the condition you need, resample to a documented rate before anything else, cache the derived per-subject products, and delete the raw downloads.
  • Per-subject products worth caching: the cleaned continuous data, the per-subject connectivity matrices for each of the four analyses, and the surrogate distributions, which are the expensive part.
  • The notebook uses shared helpers, contains no absolute paths, states every parameter in one place with the seed, and prints in its final cell every number the report quotes.

Deliverables

  1. The analysis plan, verbatim, with the date it was fixed and any later deviations listed with reasons.
  2. The cleaning and its cost. Bad channels detected and interpolated per subject, ICA components removed with reasons, the rank of the data before and after, and which channels were excluded from the connectivity analysis and why. A reader must be able to see that no channel in your matrix is an arithmetic combination of its neighbours.
  3. The band and why. The alpha band you used and how its edges were chosen — a fixed band, or each subject’s individual alpha frequency from L1.7. If fixed, show the group PSD and state what fraction of subjects have a peak inside it; a subject with no alpha peak has no alpha connectivity to measure.
  4. Analysis 1 — sensor coherence. The matrix, the reference used, the number of Welch segments K, and the 1/K floor drawn on the same colour scale as the data. This single figure is the one that makes the rest of the capstone legible.
  5. Analysis 2 — sensor wPLI. The same matrix under wPLI, with its own surrogate null, computed through the identical pipeline.
  6. Analysis 3 — CSD then wPLI. The Laplacian parameters (stiffness, regularization), whether template or digitized electrode positions were used, and the matrix. State the units of the transformed data and that they are not comparable with the referential amplitudes.
  7. Analysis 4 — the source-space half, by whichever of the three routes above you took: either parcel-level orthogonalized connectivity with the atlas, inverse operator, regularization, parcel aggregation rule and orthogonalization method all stated, or the resolution-matrix analysis of route 1 with leakage reported as a function of distance and depth.
  8. The reference sensitivity check. At least analyses 1 and 2 recomputed under a second reference. Coherence is reference-dependent and this check costs one line of code; its absence is the commonest hole in a sensor-space connectivity paper.
  9. Surrogate nulls for every measure, built through the whole pipeline including filtering, epoching and normalisation, with the construction named and justified in terms of the hypothesis it encodes (L5.2).
  10. The multiple-comparisons correction, stated as one family over the pairs tested, with the number of pairs given. 30 channels give 435 pairs; 64 give 2016; 68 parcels give 2278.
  11. The comparison table, which is the heart of the report: for a chosen set of channel or parcel pairs — near, far, homologous, and one pair you have a prior hypothesis about — the value under all four analyses side by side, each with its null, in one table.
  12. The explanation. One paragraph per systematic difference between the four results, each naming the mechanism and, where possible, a check that would distinguish it from the alternatives. The differences you should expect to have to explain: why the coherence matrix is far more uniform than the others; why its lowest values are not zero; why CSD reduces the long-range structure and leaves short-range structure; why the source-space result is not simply a cleaner version of the sensor result; and any pair where two analyses disagree in direction.

Rubric

  • Reference and CSD choices stated — the reference for every referential analysis, the reference-sensitivity check actually run, and the Laplacian’s stiffness, regularization and electrode-position source. The report says explicitly that CSD amplitudes are in different units and are not compared with referential ones.
  • Leakage addressed — not merely mentioned. Either the cross-talk between the specific pairs being claimed is computed and reported under your own operator, or, on the sensor-only route, the resolution-matrix analysis shows how leakage behaves for your montage and regularization. Orthogonalization, if used, is named, and the report says what it removed along with the leakage.
  • No claim exceeds what the method supports — every stated relationship names its measure, and no sentence asserts that two regions “communicate” on the strength of a symmetric statistic. Negative results under a lag-based measure are reported as uninformative about instantaneous coupling rather than as absence of connection.
  • Every matrix is shown against its own null, and the 1/K floor appears on the coherence figure.
  • The rank of the cleaned data is reported and interpolated channels are excluded from the connectivity analysis.
  • The multiple-comparisons family is defined once, with the number of pairs, and is the same family used for every claim.
  • The source-space route taken is named, with the anatomy’s provenance and licence where one was used.
  • The subject subset, the selection rule and the FULL_COHORT state of every quoted number are stated.
  • The notebook runs top to bottom on the documented subset inside the runtime limit, and its final cell prints every number the report quotes.
  • A reader with the dataset could reproduce every figure from the report alone.

Example report structure

  1. Analysis plan, verbatim, with deviations.
  2. Data and subset. Subjects, selection rule, FULL_COHORT state, resampling, the dataset’s licence and citation.
  3. Cleaning. Pipeline steps, bad channels, ICA components removed, rank before and after, channels excluded from the connectivity analysis.
  4. Band selection. Group PSD, the band and its justification, and the subjects with no alpha peak.
  5. Sensor space. Coherence and wPLI matrices with their nulls and the 1/K floor; the reference-sensitivity check.
  6. CSD. Parameters, positions, the transformed topographies, and the wPLI matrix computed on them.
  7. Source space or resolution analysis. The route taken, the operator, and the leakage report.
  8. Comparison table. The chosen pairs under all four analyses, with nulls.
  9. Explanation. One paragraph per systematic difference, each naming the mechanism.
  10. What this establishes, and what it does not. A short section written in the negative: the claims a reader might draw from these figures that the analysis does not support.
  11. Reproducibility. Package versions, seed, configuration, runtime, and what a reader would need to re-run it.

Estimated time: TODO(confirm) — the minutes value in the frontmatter is a site-design estimate, not from the spec.

Rubric — self-assessment

Check each item you can honestly demonstrate in your report. This is the "submit" step: it is stored in your browser only.

0 / 3 rubric items checked. Self-assessment only; stored in this browser.

Notebook

nb-c5-connectivity-leakage nb-c5-connectivity-leakage

capstone notebook not yet indexed
Open in Colab Download Read it here