Error: *.results already exists

AFNI version info (afni -26.2.05):

Greetings,

I am running afni_proc.py for resting state functional connectivity analysis. I am running the script twice in a row within the same code to analyse pre and post intervention data. The pre script will run, but the post script. Also, when I try just the post section or re-run the script I get the following error:

set subj = ###endifset output_dir = .../sub-###/ses-INTERVENTION/Pre/if ( -d .../sub-###/ses-INTERVENTION/Pre/ ) thenecho output dir ###.results already existsoutput dir ###.results already exists

This is afni_proc.py code I am trying to run is attached







Howdy-

When you run afni_proc.py, you will often get three main outputs:

  • a text file called proc.<subj_id> to store the full, commented processing script that will be run to process your subject's dataset
  • a <subj_id>.results directory to store the all the outputs during the execution of that processing script
  • (if using -execute or copy+pasting the text that afni_proc.py describes to execute the proc script) an output.proc.<subj_id> text file that is a log of all the text that gets dumped to the terminal, to help answer any questions or debugging, etc.

If you want to rerun an afni_proc.py command and any one of those three things exist, it will whine at you. The reason for this is to help prevent scripting or copy+paste or other mistakes occur that delete processed data you might want. So, if you want to re-run something and output it in the same place, you need to move (or remove) those three things before you can process your data again.

Note that sometimes with a partial/interrupted/failed processing execution, you might only get a subset of those things. For example, only a proc script but not a results directory. In that case, you still just have to move/remove that partial file or directory content.

--pt

A small bit to consider: it might be helpful to use -subj_id as :

   -subj_id ${subj}_pre

And similarly for ${subj}_post. Otherwise, it might be hard to distinguish the results. You will need to know which is which anyway.

-rick