This repository contains analysis code for the following paper:
Waskom, M.L., Kumaran, D., Gordon, A.M., Rissman, J., Wagner, A.D. (2014) Frontoparietal representations of task context support the flexible control of goal-directed cognition. Journal of Neuroscience. 34(32): 10743-10755.
The paper itself is availible on the Journal of Neuroscience website.
The code is contained within several IPython notebooks that performed the analyses and generated all figures used in the manuscript.
Two processing steps were performed outside the scope of the notebooks. First, the anatomical image for each subject was processed using Freesurfer to generate the cortical surface models. Specifically, the following command line was used for each subject:
recon-all -s $subject -all -3T
Additionally, the functional data were preproccesed with FSL, Freesurfer, and
Nipype using lyman. The
processing used the experiment parameters in the dksort.py
file included in
this repository and was performed with the following command line:
run_fmri.py -s subjects.txt -w preproc reg -t -reg epi -unsmoothed
Once those commands have been executed, every analysis can be generated using these notebooks.
###Analysis Notebooks
To reproduce the analyses in the manuscript, the notebooks should be executed in the following order.
Using the label files in roi/
, warp the ROIs from group space to individual
subject sufaces and write binary masks in functional space.
Read the .mat
files generated by PsychToolBox and create
-
a master
.csv
file with behavioral and design information and -
specific event files for the decoding analyses.
All of the actual analyses are contained within this notebook.
The searchlight analysis is performed separately within this notebook and the
process_searchlight.py
script.
This notebook generates the experimental design figure in the manuscript.
This notebook generates the ROI figure in the manuscript. Unlike the other notebooks, it requires PySurfer.
The versions of all Python packages that were installed when these analyses
were performed are contained in the dependencies.txt
file.
To facilitate reproduction of these results, the minimum set of required
packages are contained in the conda_requirements.txt
and
pip_requirements.txt
files. These can be used to set up an analysis
environment using conda
and pip
respectively. Please note that an effort
was made for accuracy, but these files were created after the bulk of the
analyses had been run and cached.
Other software versions are recorded here:
- Freesurfer: 5.3
- FSL: 5.0
- R: 3.0.2
- lme4: 0.999999-2
Two different git snapshots of lyman correspond most directly to the analyses.
Freesurfer .label
files defining the ROIs in common surface space. These
labels were created from files distributed by
Freesurfer.
Figures that are output by these notebooks.
The lyman project file that was used to process the data.
The lyman experiment file for preprocessing the fMRI data.
The subject codes used in the processing.
A pip dependencies file that can be used to install a virtual environment with software versions that were used for these analyses.
The code in this notebook is under a BSD (3-clause) license.