Error when running fmriprep from singujlarity image

Dear fmriprep experts,

I am running the following command line when trying to run fmriprep and I get the following error I do not know how to solve:

singularity exec --cleanenv /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg env | grep FS_LICENSE --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem --cifti-output 91k /media/rosalia/Nuevo_vol/ARTICO /media/rosalia/Nuevo_vol/ARTICO/derivativesgrep: unrecognised option ‘–participant-label’
Usage: grep [OPTION]… PATTERN [FILE]…edia/rosalia/Nuevo_vol/ARTICO>.

Any advice on how to get rid of this error would be greatly appreciated.

Best,
Rosie

try:

singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \
--participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref \
--force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem\
 --cifti-output 91k --fs-license-file $PATH/TO/FS_LICENSE $PATH/TO/BIDS/DIR $PATH/TO/BIDS/DIR/DERIVATIVES/ participant

Replacing the capital $PATH/TO arguments with the appropriate path in your filesystem.

Best,
Steven

EDIT: Added the bind string (-B) to add your local drives to the singularity image. If your license or BIDs directory are not in /media, then add the drives for those files/directories after -B /media,/OTHER_DRIVE,/OTHER_DRIVE2

Dear Steven,

Thank you very much for your clarification.
I am still getting some errors and I would greatly appreciate your input.

singularity run -e /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg
–participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref
–force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem
–cifti-output 91k --fs-license-file -e /media/rosalia/Nuevo_vol/license.txt
-e /media/rosalia/Nuevo_vol/ARTICO/derivatives/participant

fmriprep: error: argument --fs-license-file: expected one argument

Best wishes,
Rosie

Furthermore, the last line of the command says…/participant but my participant folder is not inside derivatives folder.

This is how I have my directory:
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol/ARTICO ls derivatives sub-003 work rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol/ARTICO

And I do not understand your comments on EDIT

Best wishes,
Rosie

fmriprep: error: argument --fs-license-file: expected one argument

You need to put the path to your license file directly after —fs-license-file argument. The -e you include after it makes fmriprep you are specifying a new argument. The only -e you need is after calling sinuglarity run.

And I do not understand your comments on EDIT

The edit I included after the comment is saying that any drive that has data relevant to your analysis needs to be called by singularity or else fmriprep will not be able to read or write to the directory. From your updated command it looks like only /media is important, so bind that.

Furthermore, the last line of the command says…/participant but my participant folder is not inside derivatives folder.

There is a space between the end of the output argument and participant. participant is actually one of the required positional arguments for fmriprep. Usage Notes — fmriprep version documentation

Try this:

 singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg
    –participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref
    –force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem
    –cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt 
    /media/rosalia/Nuevo_vol/ARTICO/   /media/rosalia/Nuevo_vol/ARTICO/derivatives/ participant

I presume your BIDs directory is /media/rosalia/Nuevo_vol/ARTICO/

Hi Steven,

It is still giving me error:

rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \

–participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem
–cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt /media/rosalia/Nuevo_vol/ARTICO
/media/rosalia/Nuevo_vol/ARTICO/derivatives/participant
/usr/local/miniconda/lib/python3.7/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the config_filename, ignore, force_index, and index_metadata arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the indexer argument.
warnings.warn("The ability to pass arguments to BIDSLayout that control "
usage: fmriprep [-h] [–version] [–skip_bids_validation]
[–participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL …]]
[-t TASK_ID] [–echo-idx ECHO_IDX] [–bids-filter-file FILE]
[–anat-derivatives PATH] [–bids-database-dir PATH]
[–nprocs NPROCS] [–omp-nthreads OMP_NTHREADS]
[–mem MEMORY_GB] [–low-mem] [–use-plugin FILE]
[–anat-only] [–boilerplate_only] [–md-only-boilerplate]
[–error-on-aroma-warnings] [-v]
[–ignore {fieldmaps,slicetiming,sbref,t2w,flair} [{fieldmaps,slicetiming,sbref,t2w,flair} …]]
[–longitudinal]
[–output-spaces [OUTPUT_SPACES [OUTPUT_SPACES …]]]
[–bold2t1w-init {register,header}] [–bold2t1w-dof {6,9,12}]
[–force-bbr] [–force-no-bbr] [–medial-surface-nan]
[–dummy-scans DUMMY_SCANS] [–random-seed _RANDOM_SEED]
[–use-aroma]
[–aroma-melodic-dimensionality AROMA_MELODIC_DIM]
[–return-all-components]
[–fd-spike-threshold REGRESSORS_FD_TH]
[–dvars-spike-threshold REGRESSORS_DVARS_TH]
[–skull-strip-template SKULL_STRIP_TEMPLATE]
[–skull-strip-fixed-seed]
[–skull-strip-t1w {auto,skip,force}] [–fmap-bspline]
[–fmap-no-demean] [–use-syn-sdc] [–force-syn]
[–fs-license-file FILE] [–fs-subjects-dir PATH]
[–no-submm-recon] [–cifti-output [{91k,170k}] |
–fs-no-reconall] [–output-layout {bids,legacy}]
[-w WORK_DIR] [–clean-workdir] [–resource-monitor]
[–reports-only] [–config-file FILE] [–write-graph]
[–stop-on-first-crash] [–notrack]
[–debug {compcor,all} [{compcor,all} …]] [–sloppy]
bids_dir output_dir {participant}
fmriprep: error: the following arguments are required: analysis_level
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $

Please try to copy and paste the command I included in my last reply. participant comes a space after the derivatives argument.

Hi Steven,

Sorry, I copied and pasted the command you included in the last reply and I got the following errors:

rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg /usr/local/miniconda/lib/python3.7/site-packages/bids/layout/validation.py:46: UserWarning: The ability to pass arguments to BIDSLayout that control indexing is likely to be removed in future; possibly as early as PyBIDS 0.14. This includes the `config_filename`, `ignore`, `force_index`, and `index_metadata` arguments. The recommended usage pattern is to initialize a new BIDSLayoutIndexer with these arguments, and pass it to the BIDSLayout via the `indexer` argument. warnings.warn("The ability to pass arguments to BIDSLayout that control " usage: fmriprep [-h] [--version] [--skip_bids_validation] [--participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]] [-t TASK_ID] [--echo-idx ECHO_IDX] [--bids-filter-file FILE] [--anat-derivatives PATH] [--bids-database-dir PATH] [--nprocs NPROCS] [--omp-nthreads OMP_NTHREADS] [--mem MEMORY_GB] [--low-mem] [--use-plugin FILE] [--anat-only] [--boilerplate_only] [--md-only-boilerplate] [--error-on-aroma-warnings] [-v] [--ignore {fieldmaps,slicetiming,sbref,t2w,flair} [{fieldmaps,slicetiming,sbref,t2w,flair} ...]] [--longitudinal] [--output-spaces [OUTPUT_SPACES [OUTPUT_SPACES ...]]] [--bold2t1w-init {register,header}] [--bold2t1w-dof {6,9,12}] [--force-bbr] [--force-no-bbr] [--medial-surface-nan] [--dummy-scans DUMMY_SCANS] [--random-seed _RANDOM_SEED] [--use-aroma] [--aroma-melodic-dimensionality AROMA_MELODIC_DIM] [--return-all-components] [--fd-spike-threshold REGRESSORS_FD_TH] [--dvars-spike-threshold REGRESSORS_DVARS_TH] [--skull-strip-template SKULL_STRIP_TEMPLATE] [--skull-strip-fixed-seed] [--skull-strip-t1w {auto,skip,force}] [--fmap-bspline] [--fmap-no-demean] [--use-syn-sdc] [--force-syn] [--fs-license-file FILE] [--fs-subjects-dir PATH] [--no-submm-recon] [--cifti-output [{91k,170k}] | --fs-no-reconall] [--output-layout {bids,legacy}] [-w WORK_DIR] [--clean-workdir] [--resource-monitor] [--reports-only] [--config-file FILE] [--write-graph] [--stop-on-first-crash] [--notrack] [--debug {compcor,all} [{compcor,all} ...]] [--sloppy] bids_dir output_dir {participant} fmriprep: error: the following arguments are required: bids_dir, output_dir, analysis_level rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref
–participant-label: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem –force-bbr: command not found rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt
–cifti-output: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ /media/rosalia/Nuevo_vol/ARTICO/ /media/rosalia/Nuevo_vol/ARTICO/derivatives/ participant

Sorry,

The error was:
fmriprep: error: the following arguments are required: bids_dir, output_dir, analysis_level
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref –participant-label: command not found rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem
–force-bbr: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol –cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt –cifti-output: command not found rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol /media/rosalia/Nuevo_vol/ARTICO/ /media/rosalia/Nuevo_vol/ARTICO/derivatives/ participant

Looks like the --force-bbr was put on a separate line, and -- got turned into -. Make sure each named argument (besides -w) is preceded by two dashes --. Make sure if you do put part of the command on a new line you separate the line by a \

singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \
    --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref \
    --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem \
    --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt \
    /media/rosalia/Nuevo_vol/ARTICO/   /media/rosalia/Nuevo_vol/ARTICO/derivatives/ \
    participant

Hi Steven,

Now it is much better, but still getting an error:

fmriprep: error: The selected working directory is a subdirectory of the input BIDS folder. Please modify the output path.
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $

Here it is what I have inside of my directory:

rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol/ARTICO $ ls
bids_dir derivatives output sub-003 work

Is bids_dir where your data are? If so, then you have to change the third-to-last argument to direct to that directory. That will fix fmriprep not finding data and the last error you got about the work directory. Glad we’re getting closer to the solution!

Steven

singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \
    --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref \
    --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem \
    --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt \
    /media/rosalia/Nuevo_vol/ARTICO/bids_dir   /media/rosalia/Nuevo_vol/ARTICO/derivatives/ \
    participant

Ups!

I do not know what’s going on now, just copying and pasting your command line:

fmriprep: error: the following arguments are required: bids_dir, output_dir, analysis_level
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref \

–participant-label: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem \

–force-bbr: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt \

–cifti-output: command not found
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ /media/rosalia/Nuevo_vol/ARTICO/bids_dir /media/rosalia/Nuevo_vol/ARTICO/derivatives/ \

bash: /media/rosalia/Nuevo_vol/ARTICO/bids_dir: Is a directory
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ participant

I am going to guess there’s a line break between the lines when there is not supposed to be. Just to be very sure, try putting everything on a single line.

Now I have another…

rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $ singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \ --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt /media/rosalia/Nuevo_vol/ARTICO/bids_dir /media/rosalia/Nuevo_vol/ARTICO/derivatives/ \ participant

fmriprep: error: Path does not exist: < --participant-label>.

When its on a single line you do not need the \

Sorry…
And now?
singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg \ --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --ignore fieldmaps sbref --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --low-mem --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt /media/rosalia/Nuevo_vol/ARTICO/bids_dir /media/rosalia/Nuevo_vol/ARTICO/derivatives/ participant

fmriprep: error: Path does not exist: < --participant-label>.
rosalia@rosalia-Lenovo-Y520-15IKBN /media/rosalia/Nuevo_vol $