GithubHelp home page GithubHelp logo

remi-gau / narps_cppl Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 0.0 32.28 MB

code for the CPPL participation to NARPS

MATLAB 96.24% Shell 1.16% R 2.60%
fmri fmri-task-based-analysis fmri-data-analysis

narps_cppl's Introduction

DOI

NARPS_CPPL

Code for the CPPL participation to NARPS

Some of the MRIQC and fMRIprep output was integrated to this repository in the folder /inputs to make it standalone.

Running the analysis

See further down for more info about docker and containers.

You can specify to the container where your code and data are when you call it.

  • the folder that will be mapped onto code must contain this repository
  • the folder that will be mapped onto data must contain the NARPS data (the folder that contains both the BIDS raw dataset and the fMRIprep derivatives)
  • the folder that will be mapped onto output can be any folder you wish. The container will simply create a /derivatives/spm12 folder in it to put the data.

Below are the commands examples we used to run this analysis

Start the docker image

Run the following to start the octave-SPM docker image. The equivalent docker image has been uploaded to docker hub for better reproducibility as docker images are not tagged on the SPM docker hub repository.

docker run -it --rm \
--entrypoint /bin/sh \
-v /Data/NARPS:/data:ro \
-v /Data/NARPS/NARPS_CPPL:/code/ \
-v /Data/NARPS:/output \
spmcentral/spm:octave-latest

This will start octave and move you to the correct directory:

octave
cd /code

Copy and unzipping data

Type in the following command to copy the relevant files and unzip them: step_1_copy_and_unzip_files

Smoothing the data

Type in the following command to copy the relevant files and unzip them: step_2_smooth_func_files.m

Running the subject level GLM

Type in the following command to copy the relevant files and unzip them: step_3_run_first_level.m

Quality control

Several scripts were created to vizualize participants' reactions times, or fMRIprep and MRIQC outputs.

For example:

All the quality_control*.m scripts.

make_figures_RT.m collects subject RT and plots how they are distributed across gain and loss on average at the group level and for each subject. It also checks overall distributions of RT for each subjects and missed responses.

make_figures_accept_reject.m collects subject responses (1 = weak accept ; 2 = strong accept ; -1 = weak reject ; -2 = strong reject) and plots how they are distributed across gain and loss on average at the group level and for each subject

Running the group level GLM

Type in the following command to copy the relevant files and unzip them: step_4_run_second_level.m

Subjects kicked out:

  • 56: switched behavioral response
  • 16, 30, 88, 100: too much movement on a single run
  • 18, 22, 110, 116: too much movement overall
  • 31: "noisy" anatomical scan

For the moment, this is hard-coded (don't 8 me!) in the rm_subjects.m function.

The group level analysis will be found in the /derivatives/spm12/group/GLM* folder.

Each group or between group analysis are in different subfolders.

The following folders contain the relevant group level GLMs:

  • ttest_gamble_trialxgain_sup_baseline : positive parametric effect of gain
  • ttest_gamble_trialxloss_inf_baseline : negative parametric effect of loss
  • ttest_gamble_trialxloss_sup_baseline : positive parametric effect of loss

There is only one contrast of interest per group analysis.

Making ROIs from neurosynth

The script create_ROIs.m will create the ROIs used to test each hypothesis.

pTFCE enhancement of the final results.

Each of the 9 contrasts corresponding to the 9 hypothesis tested were enhanced using the pTFCE toolbox. This was run on windows 10 with matlab 2018b as we could not incorporate it into the docker.

Final inference

Display the results for each hypothesis using the SPM GUI and the right ROI as inclusive mask to look for any activate voxel. This most likely will require matlab.

narps_cppl's People

Contributors

marcobarilari avatar remi-gau avatar

Watchers

 avatar  avatar  avatar  avatar

narps_cppl's Issues

minor bug in iqr_method.m

a=a(:);n=length(a);

hello! no idea how to start a new in-line comment for this script so I've found out that opening an 'issue' would be the way.

BTW, in iqr_method there is a bug concerning how the sample size n is calculated and used across the script. It should not change too much.

M.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.