Skip to content

apex-lab/motor-fmri-analysis

Repository files navigation

environment.yml should install all packages required to run the main analysis scripts, but not the Jupyter notebooks that generate figures, which additionally require pycortex and ternary packages. pycortex doesn't play nicely with since it keeps a global config directory outside of the conda environment, so it should be installed seperately if you want to run those.

Once the conda environment is created and installed (and after preprocessing with fMRIPrep), .py scripts are run in the following order:

  1. calibration.py generates per-participant calibrations for the motion tracking glove, which map from the raw sensor values to joint angles.
  2. myoprep.py processes the motion tracking data and generates DNN-based features for voxelwise encoding.
  3. voxelwise.py fits the voxelwise encoding models on the Session 1 data..
  4. masks.py performs permutation statistics for the fit encoding models.
  5. shapley.py estimates Shapley values for the encoding models. While many of these scripts can be run faster on a high performance computing cluster, trying to run this one without a cluster is a bit hopeless... but you don't have to run it at all unless you want to generate the Shapley figure from the manuscript.
  6. betaprep.py estimates a "beta series" (i.e. single-trial fMRI responses) for decoding.
  7. decoding.py performs decoding from the Session 2 data, using masks from the Session 1 encoding models.

All scripts are run specifying a participant ID, e.g. python masks.py gg for sub-gg, so they must be run once for each participant. masks.py can additonally do python masks.py group to run compute group-level masks. decoding.py takes two arguments, the subject and whether to use the participant-specific (e.g. python decoding.py gg individual) or group-level masks (e.g. python decoding.py gg group) from Session 1.

Each script outputs to a BIDS derivatives directory with the same name. After running all the .py scripts, you should be able to run the .ipynb notebooks in any order.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published