Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mediation analysis Error message #8

Open
mgogniat opened this issue Sep 13, 2018 · 16 comments
Open

Mediation analysis Error message #8

mgogniat opened this issue Sep 13, 2018 · 16 comments
Assignees
Labels

Comments

@mgogniat
Copy link

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)

@trislett
Copy link
Owner

@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

@HippocampusGirl
Copy link
Collaborator

It seems like one of the inputs to run has zero length. @trislett, could you point me to where you call the function?

@trislett
Copy link
Owner

Here it is:

calcTFCE = CreateAdjSet(float(opts.tfce[0]), float(opts.tfce[1]), adjac) # i.e. default: H=2, E=2, 26 neighbour connectivity

@HippocampusGirl
Copy link
Collaborator

@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 ?

@trislett
Copy link
Owner

@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.

@mgogniat
Copy link
Author

@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

@mgogniat
Copy link
Author

@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

@trislett
Copy link
Owner

trislett commented Sep 16, 2018

@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?

@mgogniat
Copy link
Author

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

@trislett
Copy link
Owner

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

@mgogniat
Copy link
Author

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

@trislett
Copy link
Owner

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!

@mgogniat
Copy link
Author

mgogniat commented Oct 2, 2018

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

@mgogniat
Copy link
Author

mgogniat commented Oct 3, 2018

Along this same line, is the SobelZ_M_TFCE_FWEcorrP.nii.gz already thresholded at p=.05?

Thanks,

Marissa

@mgogniat
Copy link
Author

Just following up on my questions above, thanks!

@trislett
Copy link
Owner

Hi @mgogniat,

The SobelZ_M_TFCE_FWEcorrP.nii.gz is a 1-P(FWER corrected) image. That means that any values in the image above 0.95 are significant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants