How to use this template
- You will need to have datalad installed, check this for a crash course
-
Click the green button
Use this template
. -
Give a name to the repository you want to create. Something short that contains the name of your experiment:
analysis_fMRI_FaceLocalizer
. -
Decide if you want this new repo to be public or private.
-
Click on
Create repository from template
You now have a copy of the template on your Github account. You can then download the code and the pre-set dependencies like this.
- Click on green
Code
button and copy theURL_to_your_repo
that is shown there. - Open a terminal and type this:
datalad install --recursive URL_to_your_repo
This will set up everything automatically in your current directory.
- All inputs (i.e. building blocks from other sources) are located in
inputs/
. - All custom code is located in
code/
. - All outputs will go in
outputs/
To do so, you need to:
- create on GIN the empty repository for each of the (sub)subdataset
- copy each (ssh) URL of the the just created GIN repo into
dataladConfig.sh
- run
bash dataladSetUp.sh
Note that if any of the URLs in dataladConfig.sh
is left empty then the
subdatasets will still be created but no sibling will be added and you will have
to set the siblings manually and set the url in the parent dataset. This can be
quite annoying so we strongly recommend creating the remote repos first.
These scripts can be modified to everyone needs (eg also add into derivatives
fmriprep
or mriqc
or freesurfer
or etc.).
The script dataladSetUp.sh
as it is will:
- install a ready
inputs/raw
dataset from a URL (either from openneuro or GIN) - install
- a subdataset
outputs/derivatives
- install sub-subdatasets for
outputs/derivatives/cpp_spm-preproc
outputs/derivatives/cpp_spm-preproc
- a subdataset
- make sure that the derivatives folders are datalad datasets and not pure git repos
.
└── derivatives
├── cpp_spm-preproc
└── cpp_spm-stats
Use this URL for the raw data set in dataladConfig.sh
[email protected]:/cpp-lln-lab/CPP_visMotion-raw.git
You will need to set up a proper alias to launch matlab from your mac or linux command line to tdo the next step:
matlab -nodisplay -nosplash -nodesktop -r "run('code/src/demoRunSpatialPrepro.m'); exit;"
# OR
matlab -nodisplay -nosplash -nodesktop -r 'run code/src/demoRunSpatialPrepro.m; exit;'
To make it easier to understand, when can use some bash variables
MATFLAGS="-nodisplay -nosplash -nodesktop"
cmd_to_run="run('code/src/demoRunSpatialPrepro.m'); exit;"
matlab $MATFLAGS -r "$cmd_to_run"
And now we insert in a datalad run command
# THIS DOES NOT WORK
datalad run -m "Try again to create a list of podcast titles" \
--input "inputs/raw" \
--output "outputs/derivatives" \
"matlab -nodisplay -nosplash -nodesktop -r 'run code/src/demoRunSpatialPrepro.m; exit;'"
datalad run -m "Try again to create a list of podcast titles" \
--input "inputs/raw" \
--output "outputs/derivatives" \
'matlab $MATFLAGS -r "$cmd_to_run"'