Error with afni_proc.py

Hi there,

My afni_proc.py file is having difficulty with opening one of my stimulus files.

When I ran the file_tool code, it indicated there were no “bad characters”. Any other suggestions I can try?

Thank you very much

file_tool -test -infile Instruct.txt
Instruct.txt has 0 bad characters
Instruct.txt file type: DOS
consider: file_tool -show_file_type -infile Instruct.txt -prefix FIXED.txt

tcsh -xef AfniProc
afni_proc.py -subj_id 1423 -script proc.Dec5_2020 -scr_overwrite -blocks tshift align tlrc volreg blur mask scale regress -copy_anat /imaging/Tamara/Youth/1423/1423.anat+orig -dsets /imaging/Tamara/Youth/1423/1423.1+orig.HEAD /imaging/Tamara/Youth/1423/1423.2+orig.HEAD /imaging/Tamara/Youth/1423/1423.3+orig.HEAD /imaging/Tamara/Youth/1423/1423.4+orig.HEAD /imaging/Tamara/Youth/1423/1423.5+orig.HEAD /imaging/Tamara/Youth/1423/1423.6+orig.HEAD -tcat_remove_first_trs 0 -tlrc_base MNI152_T1_2009c+tlrc -tlrc_NL_warp -volreg_align_to MIN_OUTLIER -volreg_align_e2a -volreg_tlrc_warp -blur_size 4.0 -regress_stim_times /imaging/Tamara/Youth/1423/Dfeel_Bad_NoResp.txt /imaging/Tamara/Youth/1423/Dfeel_Bad_Resp.txt /imaging/Tamara/Youth/1423/Dfeel_Happy_NoResp.txt /imaging/Tamara/Youth/1423/Dfeel_Happy_Resp.txt /imaging/Tamara/Youth/1423/Feel_Bad_NoResp.txt /imaging/Tamara/Youth/1423/Feel_Bad_Resp.txt /imaging/Tamara/Youth/1423/Feel_Happy_NoResp.txt /imaging/Tamara/Youth/1423/Feel_Happy_Resp.txt /imaging/Tamara/Youth/1423/Nat_neg_NoResp.txt /imaging/Tamara/Youth/1423/Nat_neg_Resp.txt /imaging/Tamara/Youth/1423/Nat_post_NoResp.txt /imaging/Tamara/Youth/1423/Nat_post_Resp.txt /imaging/Tamara/Youth/1423/Rating.txt /imaging/Tamara/Youth/1423/Instruct.txt -regress_stim_labels Dfeel_Bad_NoResp Dfeel_Bad_Resp Dfeel_Happy_NoResp Dfeel_Happy_Resp Feel_Bad_NoResp Feel_Bad_Resp Feel_Happy_NoResp Feel_Happy_Resp Nat_neg_NoResp Nat_neg_Resp Nat_post_NoResp Nat_post_Resp Rating Instruct -regress_basis dmBLOCK -regress_stim_types AM1 -regress_censor_motion 1.0 -regress_censor_outliers 0.1 -regress_apply_mot_types demean deriv -regress_motion_per_run -regress_make_ideal_sum sum_ideal.1D -regress_est_blur_epits -regress_est_blur_errts -regress_run_clustsim no -execute
– will use min outlier volume as motion base
– tcat: reps is now 366
++ updating polort to 3, from run len 366.0 s
– using non-linear template alignment
– volreg: using base dset vr_base_min_outlier+orig
++ volreg: applying volreg/epi2anat/tlrc xforms to isotropic 2.5 mm tlrc voxels
– applying anat warps to 1 dataset(s): 1423.anat
– masking: group anat = ‘MNI152_T1_2009c+tlrc’, exists = 1
– have 1 ROI dict entries …
++ applying 14 stim types: [‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’, ‘AM1’]
– will apply motion types: demean, deriv
** warnings for global stim_times format of file /imaging/Tamara/Youth/1423/Dfeel_Bad_NoResp.txt

  • negative stim time -1
  • has repeated times
    ** warnings for global stim_times format of file /imaging/Tamara/Youth/1423/Dfeel_Happy_NoResp.txt
  • negative stim time -1
  • has repeated times
    ** warnings for global stim_times format of file /imaging/Tamara/Youth/1423/Feel_Bad_NoResp.txt
  • negative stim time -1
  • has repeated times
    ** warnings for global stim_times format of file /imaging/Tamara/Youth/1423/Feel_Happy_NoResp.txt
  • negative stim time -1
  • has repeated times
    ** warnings for global stim_times format of file /imaging/Tamara/Youth/1423/Nat_neg_NoResp.txt
  • negative stim time -1
  • has repeated times
    ** unusable token, bad floats : .4:
    line = .4: .9 18.6: .9 35.9: .9 56.1: .9 73.4: .9 89.6: .9 107.9: .9 131.6: .9 151.9: .9 168.1: .9 191.9: .9 209.1: .9 225.4: .9 248.1: .9 266.4: .9 283.6: .9 301.9: .9 323.1: .9 *
    ** A1D: failed to read data file /imaging/Tamara/Youth/1423/Instruct.txt
    ** failed to load stimulus timing file ‘/imaging/Tamara/Youth/1423/Instruct.txt’
    – consider use of ‘-test_stim_files no’ if files are OK

** script creation failure for block ‘regress’
± consider use of: -html_review_style pythonic

** failed command (create_script):

afni_proc.py -subj_id 1423 -script proc.Dec5_2020 -scr_overwrite -blocks
tshift align tlrc volreg blur mask scale regress -copy_anat
/imaging/Tamara/Youth/1423/1423.anat+orig -dsets
/imaging/Tamara/Youth/1423/1423.1+orig.HEAD
/imaging/Tamara/Youth/1423/1423.2+orig.HEAD
/imaging/Tamara/Youth/1423/1423.3+orig.HEAD
/imaging/Tamara/Youth/1423/1423.4+orig.HEAD
/imaging/Tamara/Youth/1423/1423.5+orig.HEAD
/imaging/Tamara/Youth/1423/1423.6+orig.HEAD -tcat_remove_first_trs 0
-tlrc_base MNI152_T1_2009c+tlrc -tlrc_NL_warp -volreg_align_to
MIN_OUTLIER -volreg_align_e2a -volreg_tlrc_warp -blur_size 4.0
-regress_stim_times /imaging/Tamara/Youth/1423/Dfeel_Bad_NoResp.txt
/imaging/Tamara/Youth/1423/Dfeel_Bad_Resp.txt
/imaging/Tamara/Youth/1423/Dfeel_Happy_NoResp.txt
/imaging/Tamara/Youth/1423/Dfeel_Happy_Resp.txt
/imaging/Tamara/Youth/1423/Feel_Bad_NoResp.txt
/imaging/Tamara/Youth/1423/Feel_Bad_Resp.txt
/imaging/Tamara/Youth/1423/Feel_Happy_NoResp.txt
/imaging/Tamara/Youth/1423/Feel_Happy_Resp.txt
/imaging/Tamara/Youth/1423/Nat_neg_NoResp.txt
/imaging/Tamara/Youth/1423/Nat_neg_Resp.txt
/imaging/Tamara/Youth/1423/Nat_post_NoResp.txt
/imaging/Tamara/Youth/1423/Nat_post_Resp.txt
/imaging/Tamara/Youth/1423/Rating.txt
/imaging/Tamara/Youth/1423/Instruct.txt -regress_stim_labels
Dfeel_Bad_NoResp Dfeel_Bad_Resp Dfeel_Happy_NoResp Dfeel_Happy_Resp
Feel_Bad_NoResp Feel_Bad_Resp Feel_Happy_NoResp Feel_Happy_Resp
Nat_neg_NoResp Nat_neg_Resp Nat_post_NoResp Nat_post_Resp Rating
Instruct -regress_basis dmBLOCK -regress_stim_types AM1
-regress_censor_motion 1.0 -regress_censor_outliers 0.1
-regress_apply_mot_types demean deriv -regress_motion_per_run
-regress_make_ideal_sum sum_ideal.1D -regress_est_blur_epits
-regress_est_blur_errts -regress_run_clustsim no -execute

I should also indicate that I also ran the " -prefix FIXED.txt" option, and I received the same error message when I used the “fixed” stimulus file.

Thank you very much for your help.

Hi-

What is the output of:


ls -l /imaging/Tamara/Youth/1423/Instruct.txt

and


cat ls -l /imaging/Tamara/Youth/1423/Instruct.txt

?

–pt

Thank you very much for your response. I could only get an output for the first command, the other one did not work (see output below)

ttavare@MitchellLabImage:/imaging/Tamara/Youth/1423$ ls -l /imaging/Tamara/Youth/1423/Instruct.txt
-rw-r–r-- 1 ttavare domain^users 1092 Dec 6 21:09 /imaging/Tamara/Youth/1423/Instruct.txt

ttavare@MitchellLabImage:/imaging/Tamara/Youth/1423$ cat ls -l /imaging/Tamara/Youth/1423/Instruct.txt
cat: invalid option – ‘l’
Try ‘cat --help’ for more information.

I tried the second command without the hyphen…

ttavare@MitchellLabImage:/imaging/Tamara/Youth/1423$ cat ls l /imaging/Tamara/Youth/1423/Instruct.txt
cat: ls: No such file or directory
cat: l: No such file or directory
.4: .9 18.6: .9 35.9: .9 56.1: .9 73.4: .9 89.6: .9 107.9: .9 131.6: .9 151.9: .9 168.1: .9 191.9: .9 209.1: .9 225.4: .9 248.1: .9 266.4: .9 283.6: .9 301.9: .9 323.1: .9 *
5.9: .9 22.1: .9 39.4: .9 57.6: .9 84.4: .9 100.6: .9 120.9: .9 137.1: .9 154.4: .9 172.6: .9 192.9: .9 211.1: .9 227.4: .9 250.1: .9 268.3: .9 286.6: .9 303.9: .9 322.1: .9 *
.4: .9 20.6: .9 38.9: .9 56.1: .9 74.4: .9 91.6: .9 113.3: .9 130.6: .9 148.9: .9 165.1: .9 181.4: .9 205.1: .9 221.4: .9 238.6: .9 260.4: .9 277.6: .9 299.9: .9 321.1: .9 *
.4: .9 20.6: .9 38.9: .9 55.1: .9 72.4: .9 88.6: .9 115.4: .9 131.6: .9 148.8: .9 166.1: .9 189.9: .9 210.1: .9 227.3: .9 251.1: .9 269.3: .9 287.6: .9 303.9: .9 322.1: .9 *
.4: .9 16.6: .9 34.9: .9 52.1: .9 69.4: .9 87.6: .9 105.9: .9 123.1: .9 140.4: .9 158.6: .9 189.9: .9 206.1: .9 227.9: .9 245.1: .9 263.4: .9 283.6: .9 304.9: .9 321.1: .9 *
.4: .9 18.6: .9 35.8: .9 56.1: .9 77.9: .9 96.1: .9 114.3: .9 134.6: .9 150.8: .9 169.1: .9 185.4: .9 202.6: .9 220.9: .9 243.6: .9 260.9: .9 277.1: .9 294.4: .9 322.1: .9 *
ttavare@MitchellLabImage:/imaging/Tamara/Youth/1423$

Hello,

The onset:duration pairs should not have any space inside (there seems to be a space after each colon).
To remove those spaces, replace colon-space pairs with just colons, as in:

sed ‘s/: /:/g’ Instruct.txt > new.Instruct.txt

  • rick