Hello AFNI experts,
I’ve come for your expertise regarding afni_proc.py. I am analyzing data from a task-based experiment and want to do further analysis on the BOLD percent signal change timeseries. Essentially, I want to extract 2 timeseries and I am wondering what is a reasonable way to obtain them.
-
One timeseries is the error timeseries (error-timeseries-full) after running the GLM with all nuisance and regressors of interest (full-GLM).
-
The other timeseries is the raw signal, which will be used for further analysis. This timeseries only has the nuisance regressors regressed out, just like in resting-state analysis.
It is critical that both GLMs have the same nuisance parameter values.
At first, I was thinking of running afni_proc.py to extract the raw signal applying an only-nuisance-GLM using resting-state procedures (like detailed here). Then, I could run afni_proc.py on the full-GLM only including the regress block, using as input the last pbXX files from the only-nuisance-GLM, and the motion and censoring .1D files. However, I was wondering whether the nuisance regressors’ values might be different in both GLMs, thus being inconsistent. So this approach might not be reasonable.
Now, I am thinking that a more reasonable approach would be to first run afni_proc.py on the full-GLM and extract the error-timeseries-full. Then, instead of running afni_proc.py again on the only-nuisance-GLM, I could obtain the raw signal from the linear sum of the error-timeseries-full, and all the regressors timeseries multiplied by their beta-coefficients. I could extract this information from the results folder files: errts (to obtain the error-timeseries-full), the regressors timeseries (from the original regress-stim-times files), and the X.xmat.1D matrix (to obtain the beta-coefficients). This approach would ensure that the nuisance regressors’ values are the same. Do you think this approach is reasonable? Would you provide any other suggestions on how to obtain these 2 timeseries?
Howdy-
If I understand correctly, you want to do task-based FMRI, where your GLM contains both nuisance regressors and stimulus regressors of interest. In the afni_proc.py-created script, it is 3dDeconvolve that does this. Your first time series of interest described here is the errts*
file, which is the residuals of the full modeling.
For the second time series, it sounds like you want to run the same 3dDeconvolve command but just leave out the stimulus regressor information, and obtain the errts*
of that. Does that sound right?
So, to use the same intermediate results of afni_proc.py for the second 3dDeconvolve command. You can actually have afni_proc.py write you a script to use for an editable, second 3dDeconvolve command. This is done with this option, whose help I also include for a more detailed description:
-write_3dD_script SCRIPT : specify SCRIPT only for 3dDeconvolve command
e.g. -write_3dD_script run.3dd.tent
This option is intended to be used with the EXACT same afni_proc.py
command (aside from any -write_3dD_* options). The purpose is to
generate a corresponding 3dDeconvolve command script which could
be run in the same results directory.
Alternatively, little things could be changed that would only
affect the 3dDeconvolve command in the new script, such as the
basis function(s).
The new script should include a prefix to distinguish output files
from those created by the original proc script.
* This option implies '-test_stim_files no'.
See also -write_3dD_prefix, -test_stim_files.
Am I understanding correctly?
--pt
... and to add to my comment above, as I misunderstood initially how to use -write_3dD_script ..
.
First, you run your afni_proc.py (AP) command, and run that processing.
Then, you take the same AP command and add -write_3dD_script SOME_NAME, without changing anything else, and then run that, and it will simply create a text file called "SOME_NAME", with the starter 3dDeconvolve command you can edit. NB: you might want SOME_NAME to be output into the AP results directory, because it refers to files there without any path info.
You can edit that SOME_NAME script to make new output, and to remove the stim timing parts of the regressor set.
--pt