/neuroflow:data-analyze¶
Run an analysis pipeline on your preprocessed data.
/data-analyze covers the full range of neuroscience analysis methods โ ERPs, time-frequency, connectivity, decoding, and GLM โ with built-in statistical auditing to ensure your results are rigorous.
When to use it¶
- After
/data-preprocessโ you have cleaned, epoched data - You want to compute ERPs, time-frequency representations, or connectivity
- You need to run statistical comparisons or multivariate decoding
- You want an analysis plan before running anything (pre-registration support)
What it does¶
Claude asks:
- Analysis goal? (ERP, time-frequency, connectivity, decoding, GLM, other)
- Where is the preprocessed data?
- Is there a pre-registered analysis plan to follow?
Analysis approaches¶
Claude selects the appropriate tooling based on your goal:
Event-related potential analysis using MNE-Python.
# Example: P300 ERP comparison
evoked_standard = epochs['standard'].average()
evoked_target = epochs['target'].average()
# Grand average across subjects
grand_avg = mne.grand_average([evoked_target, ...])
# Statistical test: cluster permutation
T_obs, clusters, p_values, _ = mne.stats.permutation_cluster_1samp_test(
X, n_permutations=1000
)
Time-frequency analysis using Morlet wavelets or multitaper.
Functional connectivity using MNE spectral connectivity tools.
Multivariate pattern analysis (MVPA) using scikit-learn.
Statistical auditing¶
After running analysis, Claude audits the statistical approach:
- Test assumptions โ normality, sphericity, independence
- Multiple comparison correction โ cluster permutation, FDR, Bonferroni
- Effect size reporting โ Cohen's d, partial ฮทยฒ, AUC
- Pre-registration compliance โ if a plan exists, flags any deviations
Example session¶
Claude: Research question: "Does noise background reduce P300 amplitude?"
Analysis goal?
You: P300 ERP comparison between noise and silent conditions,
then cluster permutation test.
Claude: Analysis plan:
1. Average epochs by condition (noise, silent) per subject
2. Compute difference wave: noise - silent
3. Cluster permutation test across 300-600ms window, Pz
Writing analysis-plan.md...
Writing scripts/analysis/erp_analysis.py...
[runs analysis, generates figures/erp_comparison.png]
Results: Significant cluster at 350-520ms over central-parietal
electrodes (p = 0.012). P300 amplitude reduced by 2.3 ยตV in noise
condition (Cohen's d = 0.71).
Output¶
| File | Where | What it contains |
|---|---|---|
analysis-plan.md |
.neuroflow/data-analyze/ |
What will be computed, comparisons, statistical tests, expected output |
analysis.py |
scripts/analysis/ |
Analysis code |
analysis-summary.md |
.neuroflow/data-analyze/ |
Key findings, figures produced, open questions |
| Figures | figures/ |
All generated plots |
| Results | results/ |
Statistical output tables |
Files read and written¶
| Direction | Files |
|---|---|
| Reads | .neuroflow/project_config.md, .neuroflow/flow.md, .neuroflow/ideation/flow.md, .neuroflow/data-preprocess/flow.md, .neuroflow/data-analyze/flow.md |
| Writes | .neuroflow/data-analyze/, .neuroflow/data-analyze/flow.md, .neuroflow/sessions/YYYY-MM-DD.md, scripts/analysis/, results/, figures/ |
Related commands¶
/data-preprocessโ preprocess your data first/paperโ write the manuscript from your results