Mediation analysis Error message
mgogniat opened this issue · 16 comments
Hi Dr. Lett, thank you for all of your help. I am running into some issues with the mediation step and I have attached the error message I continue to receive below. Do you have an idea as to why this may be happening?
Command:
TFCEfunc.run(voxelStat_out, voxelStat_TFCE)
tfce_mediation step1-voxel-mediation -i ../home/millerlab/mag53440/TFCE_mediation/MVPA_resids.csv ../home/millerlab/mag53440/TFCE_mediation/DKEFS_resids.csv -c ../home/millerlab/mag53440/TFCE_mediation/covars.csv -m M
Error Message:
File "tfce_mediation/tfce.pyx", line 45, in tfce_mediation.tfce.CreateAdjSet.run
IndexError: Out of bounds on buffer access (axis 0)
@HippocampusGirl there seems to an issue with referencing the adjacency set with cython. Any thoughts?
@mgogniat I have few of questions:
(a) Which version of TFCE_mediation are you using?
(b) What type of neuroimaging data are you analyzing?
(c) How did you create your mask?
(d) Did you compile TFCE_mediation yourself, or did you install with PIP?
Thank you,
Tris
It seems like one of the inputs to run has zero length. @trislett, could you point me to where you call the function?
Here it is:
@HippocampusGirl that was my first thought too. I used the script successfully yesterday.
STEP_0 should automatically reduced the mask data to nonzero data. However, this may not work if there is negative data.
@HippocampusGirl there seems to an issue with referencing the adjacency set with cython. Any thoughts?
@mgogniat I have few of questions:
(a) Which version of TFCE_mediation are you using?
(b) What type of neuroimaging data are you analyzing?
(c) How did you create your mask?
(d) Did you compile TFCE_mediation yourself, or did you install with PIP?Thank you,
Tris
Hello,
(a) tfce_mediation 1.5.2
(b) 4D image generated by fsl and then TBSS to look at whole brain FA following standard DTI protocols (file name : all_FA_skeletonised.nii.gz)
(c) (file name: mean_FA_skeleton_mask.nii.gz)
I believe this mask is generated in TBSS Step 4 and is the projection of FA onto the skeleton, taking the 4D all_FA image (containing all subjects’ aligned FA data) and, for each “timepoint” (i.e., subject ID), projects the FA data onto the mean FA skeleton. This results in a 4D image file containing the projected skeletonized FA data which can then be used in voxelwise statistics.
(d) Yes, the IT person who installed this program confirmed that he installed with PIP
Thanks for your help,
Marissa
@trislett I can't see any obvious issue. Is it possible that there are no voxels in the mask? If not, would it be possible to make an example input that generates this error available @mgogniat ?
Hi @HippocampusGirl ,
I would be happy to do that but I am not sure what you mean by example input. This is the command I ran that generated this error: tfce_mediation step1-voxel-mediation -i ../home/millerlab/mag53440/TFCE_mediation/MVPA_resids.csv ../home/millerlab/mag53440/TFCE_mediation/DKEFS_resids.csv -c ../home/millerlab/mag53440/TFCE_mediation/covars.csv -m M
Thanks
@mgogniat
Thank you for the information.
There's no obvious issue with your input.
Just to double check, are you running the command from the same directory as python_temp folder?
Does running tfce_mediation step1-voxel-mediation also give you an error? e.g.,
tfce_mediation step1-voxel-regress -i MVPA_resids.csv covars.csv
Could you please move MVPA_resids.csv, DKEFS_resids.csv, and covars.csv files to the same directory as your python_temp folder and retry?
Last, could you please tell me the platform you are running the analysis on?
Hi @trislett
When I run the original command (tfce_mediation step1-voxel-mediation) from the python_temp file with all of the files also in the python_temp file, I get this error:
IOError: [Errno 2] No such file or directory: 'python_temp/raw_nonzero.npy'
Although there is a file called raw_nonzero.npy in my python_temp directory.
When I run the command you sent me above also from the python_temp file, I also get this error:
IOError: [Errno 2] No such file or directory: 'python_temp/raw_nonzero.npy'
I have double checked that everything is in the same directory that I am running the commands from (i.e., I already thought that might the source of the error and have been running everything from there).
In terms of the platform, our server is running Red Hat Enterprise Linux 7.5. It is physically a
Dell PowerEdge R530.
Thanks,
Marissa
Hi Marissa (@mgogniat ),
I finally got a RHEL/fedora virtual image up an running, and I haven't had any issues.
Both of your outputs suggests that TFCE_mediation is being run from the wrong directory, so I want to make sure...
If you run ls
you should see something along the lines of:
python_temp
MVPA_resids.csv
DKEFS_resids.csv
covars.csv
If you do have these files/folders, could you please post the output from running?
ls -lah
Could you also please try running tfce_mediation step0-voxel
again?
Thank you,
Tris
Hi Tris (@trislett),
After re-running step0, I got some output (that looks good)! However, I am having an issue with Step 5 (permutation testing). This is the command I used: tfce_mediation step2-randomise-parallel --voxel -n 10000 -m M -p 8
End of output: Evaluating 10000 permuations
sh: parallel: command not found
cat: write error: Broken pipe
Run: tfce_mediation voxel-calculate-fwep to calculate (1-P[FWE]) image (after randomisation is finished).
And it created no perm_SobelZ folder, just a file called cmd_TFCE_randomise_1537981295.
Is there something I am doing wrong here?
Marissa
Hi @mgogniat ,
That error means that GNU parallel is not installed ("parallel: command not found").
You have a few options.
a) If fsl_sub is working on your system, you can run step2-randomise-parallel with the -f flag
instead of -p {num_threads}
. This will work with systems running that use a "SGE" platform and have FSL installed.
b) You can ask your I.T. person to install GNU parallel or HTCondor (-c flag).
c) Likely the easiest solution is to just not use parallelization. It should not take too long for voxel-based analysis. For examples, to run randomise with 10000 permutations:
tfce_mediation voxel-mediation-randomise -r 1 10000 -m M
Good luck!
Hi @trislett,
Thanks for all of you help. I was able to complete option c) above and family wise error correct the file. I am now just trying to figure out how to extract a table of this information from the resulting image file.
Marissa
Along this same line, is the SobelZ_M_TFCE_FWEcorrP.nii.gz already thresholded at p=.05?
Thanks,
Marissa
Just following up on my questions above, thanks!