FMRIPrep
FMRIPrep is a preprocessing tool for FMRI data
FMRIPrep is a commonly used FMRI pre-processing program that is distributed and runs as an Apptainer/Singularity container.
Using FMRIPrep on RCC resources#
To use FMRIPrep on RCC resources, you will first need to download and build the Singularity/Apptainer container. This is done by using the following command:
Note
We recommend that you use the latest FMRIPrep available unless you have reason to do otherwise.
If you want to use a different version, you can build it with this command:
<version>
with the version number you want to use: 1.5.0
for example.
Running FMRIPrep jobs#
You can submit non-interactive batch mode FMRIPrep jobs to the scheduler. This is the preferred way to submit long-running preprocessing jobs.
Example Job using a tutorial#
The following is an example of a batch job submission script (job.sh
) that will run a FMRIPrep preprocessing job on
data provided by this FMRIPrep tutorial.
-
First, we need to set up the tools necessary to download the data. This will be datalad. Datalad is best installed in a conda environment. We can do that with the following commands:
-
Now that we have to tools to download the data, we need to run the download script for the example data provided here. We should also prepare a dedicated folder for the data:
Now that we have the data downloaded, we need to prepare the working directory. FMRIPrep will use this as a temporary and intermediate file directory.
-
Now we can deactivate the datalad environment
-
Next, we need to prepare the FMRIPrep job submission folder. Assuming we've already downloaded the FMRIPrep container to our home directory and it is at
~/fmriprep-latest.simg
, we can use the following script, which we will save to a file calledjob.sh
: -
Finally, we can run
sbatch job.sh
All output should be placed in ~/tutorialdata/ds000102/derivatives
and all temp files/intermediate data should be written to ~/tutorialdata/working
.
Using directories aside from your Home Directory for job I/O#
In some cases, it may turn out that you don't have enough space for your data in your home directory.
If this is the case, you can place the data on your HPC storage research partition, such as /gpfs/research/<YOUR_LAB_NAME_HERE>
if you or your lab group have purchased space, or you can use scratch space /gpfs/research/scratch/<YOUR_FSUID>
.
In this case, you will need to change the following variables in the above script:
Warning
If you are planning to use a directory for your working and data directories OTHER than your home directory, you must explicitly bind those directories into the container.
The above script does this for you by creating the DATA_DIR
and WORK_DIR
environment variables and adding them to APPTAINER_BINDPATH
. APPTAINER_BINDPATH
is a variable that Apptainer uses to determine bind paths.
Warning
If you are planning to use a directory for your working and data directories OTHER than your home directory, then you must explicitly tell FMRIPrep which path to use for it's working directory in addition to binding it into the container.
You can do this by setting the -w
parameter in your FMRIPrep job script.