Error: ***missing run 5 dataset

AFNI version info (afni -ver): AFNI_23.2.11
Hi AFNI experts!
When trying to run afni_proc.py on my participant data, I'm running into this error:

(base) ajcoope9@TCLAPSY-LN4P2CT2HW LC_PROJECT % tcsh -xef scripts/ap_script_b.py 2>&1 | tee output.ap_script_b.py
set top_dir = /Users/ajcoope9/Desktop/LC_PROJECT
set nifti_dir = /Users/ajcoope9/Desktop/LC_PROJECT/mri_data
set outputs_dir = /Users/ajcoope9/Desktop/LC_PROJECT/Afni_outputs
set stim_dir = /Users/ajcoope9/Desktop/LC_PROJECT/Participant_files
set subj = sub102
set group_id = LC_PROJECT
set scan_num = scan1
afni_proc.py -subj_id sub102 -copy_anat /Users/ajcoope9/Desktop/LC_PROJECT/Afni_outputs/SSwarper_outputs/sub102/anatSS.sub102.nii -anat_has_skull no -anat_follower anat_w_skull anat /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/MPRAGE.nii -dsets /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run1.nii /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run2.nii /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run3.nii /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run4.nii
** missing run 5 dataset:
----------------------------------------------------------------------
** failed command (create_blocks):

  afni_proc.py -subj_id sub102 -copy_anat                                                        \
      /Users/ajcoope9/Desktop/LC_PROJECT/Afni_outputs/SSwarper_outputs/sub102/anatSS.sub102.nii \
      -anat_has_skull no -anat_follower anat_w_skull anat                                         \
      /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/MPRAGE.nii                    \
      -dsets                                                                                      \
      /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run1.nii              \
      /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run2.nii              \
      /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run3.nii              \
      /Users/ajcoope9/Desktop/LC_PROJECT/mri_data/sub102/mri/scan1/oddball_run4.nii              \

I only have 4 runs for this subject, which is why I'm confused that it is saying it is missing run 5. Does anyone know why it could be generating this error?

Here is my afni_proc.py script:

#!/usr/bin/env tcsh

# set data directories
set top_dir = /Users/ajcoope9/Desktop/LC_PROJECT
set nifti_dir = /Users/ajcoope9/Desktop/LC_PROJECT/mri_data
set outputs_dir = /Users/ajcoope9/Desktop/LC_PROJECT/Afni_outputs 
set stim_dir = /Users/ajcoope9/Desktop/LC_PROJECT/Participant_files

# set subject and group identifiers
set subj = sub102
set group_id  = LC_PROJECT
set scan_num = scan1

# run afni_proc.py to create a single subject processing script
afni_proc.py -subj_id $subj                                                              \
        -copy_anat $outputs_dir/SSwarper_outputs/${subj}/anatSS.${subj}.nii              \
        -anat_has_skull no                                                               \
        -anat_follower                                                                   \
            anat_w_skull anat $nifti_dir/${subj}/mri/${scan_num}/MPRAGE.nii              \
        -dsets $nifti_dir/${subj}/mri/${scan_num}/oddball_run1.nii                       \
            $nifti_dir/${subj}/mri/${scan_num}/oddball_run2.nii                          \
            $nifti_dir/${subj}/mri/${scan_num}/oddball_run3.nii                          \
            $nifti_dir/${subj}/mri/${scan_num}/oddball_run4.nii                          \ 
        -blocks tshift align tlrc volreg mask blur                                       \
            scale regress                                                                \
        -radial_correlate_blocks tcat volreg regress                                     \
        -align_opts_aea -cost lpc+ZZ                                                     \
            -giant_move                                                                  \
            -check_flip                                                                  \
        -tlrc_base MNI152_2009_template_SSW.nii.gz                                       \
        -tlrc_NL_warp                                                                    \
        -tlrc_NL_warped_dsets $outputs_dir/SSwarper_outputs/${subj}/anatQQ.${subj}.nii   \
            $outputs_dir/SSwarper_outputs/${subj}/anatQQ.${subj}.aff12.1D                \
            $outputs_dir/SSwarper_outputs/${subj}/anatQQ.${subj}_WARP.nii                \
        -volreg_align_to MIN_OUTLIER                                                     \
        -volreg_align_e2a                                                                \
        -volreg_tlrc_warp                                                                \
        -volreg_compute_tsnr yes                                                         \
        -mask_epi_anat yes                                                               \
        -blur_size 3.0                                                                   \
        -regress_stim_times                                                              \
            $stim_dir/${subj}/Oddball/${scan_num}/oddball.1D                             \
            $stim_dir/${subj}/Oddball/${scan_num}/default.1D                             \
        -regress_stim_types AM1 AM1                                                      \
        -regress_stim_labels                                                             \
            oddball default                                                              \
        -regress_basis                                                                   \
            'dmBLOCK(1)'                                                                 \
        -regress_opts_3dD -jobs 8                                                        \
            -gltsym 'SYM: oddball -default'                                              \
            -glt_label 1 oddball-default                                                 \
            -gltsym 'SYM: oddball default'                                               \
            -glt_label 2 oddball+default                                                 \
        -regress_motion_per_run                                                          \
        -regress_censor_motion 0.3                                                       \
        -regress_censor_outliers 0.05                                                    \
        -regress_3dD_stop                                                                \
        -regress_reml_exec                                                               \
        -regress_compute_fitts                                                           \
        -regress_make_ideal_sum "sum_ideal.1D"                                           \
        -regress_est_blur_epits                                                          \
        -regress_est_blur_errts                                                          \
        -regress_run_clustsim no                                                         \
        -html_review_style pythonic                                                      \
        -execute

Thank you!

Hi Annie,

There is a space after the '\' on the line with the run4 dataset, so afni_proc.py might be seeing an empty argument. More importantly, you are probably getting an error like:
-blocks : Command not found.

If this is in a file called run_ap.txt, then consider evaluated/fixing it using something like:

file_tool -test -infiles run_ap.txt -prefix run_ap_FIXED.txt

Using just -test (i.e. no -prefix OUTPUT), file_tool will warn about bad backslashes like that.

  • rick

Yep, that was it! Thank you so much Rick.