This repo contains code for the statistical analysis and figure generation associated with the results described in:
https://www.nature.com/articles/s41591-022-01744-z
BLUF: The evidence from two independent studies suggests that psilocybin therapy can alleviate depression via an increase in the brain's functional network integration.
- To extract measures of brain network modularity (Q) from preprocessed resting-state fMRI.
- Compare the Q of patients with depression before and after psilocybin therapy.
- Compare individual changes in Q to changes in depression severity.
Add third_party to the Matlab path for the code in functions to run.
Timecourses are extracted from a set of regions to measure functional connectivity as estimate normalized brain network modularity. eg:
% define imaging matrix
imaging_volume = 4D_brain_imaging_brain
% define atlas matrix
atlas_volume = 3D_regional_brain_atlas
% Estimate norm. modulatrity
Q_norm = calculate_static_modularity(imaging_volume, atlas_volume)
NB:- Imaging and atlas data need to be in the same space (e.g., MNI)
The modularity estimation was heavily inspired by Karolina Finc's Nature Communications paper on working memory: https://www.nature.com/articles/s41467-020-15631-z. To normalize Q, the maximum true Q is divided by the mean of a distribution of shuffled functional connectivity matrices.
The extracted Q and Beck Depression Inventory (BDI) measures are in .mat files here:
data/
|-- psilodep1/
| |-- dat_1.mat
|
|-- psilodep2/
| |-- dat_2.mat
To recreate the BDI figure that visualizes the reductions in depression severity following psilocybin therapy, run:
>>> BDI_figure
To recreate the brain imaging figures that visualises reductions in modularity (Q) following psilocybin therapy, run:
>>> Imaging_figure
The additional stats reported in the paper are calculated in:
functions/
|-- psilodep1.m
|-- psilodep2.m
After leaving academia, I no longer have access to Matlab licenses!
- find a bug
- would like to translate this repo into an open source language
- want help with applying this sort of analysis to your data.




