From 255fd20cce10808fa2edf18b54b5a60ba0133445 Mon Sep 17 00:00:00 2001 From: Marco Barilari Date: Wed, 3 Jul 2024 10:38:36 +0200 Subject: [PATCH] debug and improve how to run fmriprep --- doc/cpp_fmriprep.slurm | 21 +++++++++++++++------ doc/run_fmriprep.md | 9 ++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/doc/cpp_fmriprep.slurm b/doc/cpp_fmriprep.slurm index 1e836fe..c8135e8 100644 --- a/doc/cpp_fmriprep.slurm +++ b/doc/cpp_fmriprep.slurm @@ -10,14 +10,14 @@ #SBATCH --mail-user=marco.barilari@uclouvain.be #SBATCH --mail-type=ALL -#SBATCH --output=/home/ucl/irsp/marcobar/jobs_report/fmriprep_job-%j.txt +#SBATCH --output=/home/ucl/cosy/marcobar/jobs_report/fmriprep_job-%j.txt #SBATCH --comment=project-name #export OMP_NUM_THREADS=4 #export MKL_NUM_THREADS=4 -## CPP frmiprep script for CECI cluster v0.2.0 +## CPP frmiprep script for CECI cluster v0.3.0 # # writtent by CPP people # @@ -70,11 +70,15 @@ ceci_username="marcobar" # set fmriprep arguments nb_dummy_scans=0 +# cluster paths path_to_singularity_image="$HOME/tools/containers/images/bids/bids-fmriprep--${FMRIPREP_VERSION}.sing" -scratch_dir="/scratch/users/m/a/${ceci_username}" -bids_dir="$HOME/fmriprep_trial/raw" -output_dir="$HOME/fmriprep_trial/derivatives/fmriprep" -freesurfer_license_folder="$HOME/tools/freesurfer_license" +scratch_dir=$GLOBALSCRATCH +freesurfer_license_folder="$HOME/tools" + +# data paths +root_dir="$HOME/path-to-project-yoda-fodler" +bids_dir="$root_dir/inputs/raw" +output_dir="$root_dir/outputs/derivatives/fmriprep" # make the scratch folder, here there is no limit space and fmriprep can store stuff in case of crash and do not start from zero again mkdir -p "${scratch_dir}"/work-fmriprep @@ -99,3 +103,8 @@ singularity run --cleanenv \ --notrack \ --skip_bids_validation \ --stop-on-first-crash + + +# more useful options to keep in mind: +# +# --fs-no-reconall # skip freesurfer segmentation \ No newline at end of file diff --git a/doc/run_fmriprep.md b/doc/run_fmriprep.md index dce05fa..30ca7b5 100644 --- a/doc/run_fmriprep.md +++ b/doc/run_fmriprep.md @@ -15,7 +15,8 @@ To contribute see [here](https://cpp-lln-lab.github.io/CPP_HPC/contributing/) ## Prepare to run fmriprep on the cluster -- have your data on the cluster +- have your data on the cluster and unlock them if they are managed by datalad +- get your `freesurfer` license (user specific) for free [here](https://surfer.nmr.mgh.harvard.edu/registration.html) and move it to the cluster at `~/tools` - install datalad on your user (see [here](https://github.com/cpp-lln-lab/CPP_HPC/install_datalad)) - get the fmriprep singularity image as follow: @@ -38,14 +39,12 @@ cd path/to/containers datald update --merge `````` -Depending on the cluster “unlock” is needed or not. No need for `lemaitre3`. !!! TO CHECK ON LEMAITRE4 +Depending on the cluster “unlock” is needed or not. No need for `lemaitre4`. ```bash datalad unlock containers/images/bids/bids-fmriprep--24.0.0.sing ``` - - get your `freesurfer` license (user specific) for free [here](https://surfer.nmr.mgh.harvard.edu/registration.html) and move it to the cluster - ## Submit a fmriprep job via a `slurm` script - pros: @@ -60,7 +59,7 @@ Content of the `cpp_fmriprep.slurm` file (download and edit from [here](cpp_fmri !!! Warning 1. Read the fmriprep documentation to know what you are doing and how the arguments of the run call effects the results - 2. All the paths and email are set afte Marco's users for demosntration. + 2. All the paths and email are set afte Marco's users for demosntration. Change them for your user. 3. Edit the scripts with the info you need to make it run for your user from top to buttom of the script, do not over look the first "commented" chunk cause it is not a real commented section (check the email and job report path, data paths and the `username` etc.). ```bash