Closed pesojka closed 3 years ago
Hello!
Many thanks for letting us know - this issue should now be resolved (it was not excluding the corpus callosum when extracting the centroids hence the index error).
Please let us know if you have any more issues!
Sara. ðŸ¤
Hi Sara, many thanks for your quick reply. I reran the code with your fix and unfortunately I am still getting the same error:
~/.local/lib/python3.8/site-packages/enigmatoolbox/permutation_testing/permutation_testing.py in perm_sphere_p(x, y, perm_id, corr_type, null_dist) 264 y_perm2 =[] 265 for ii in range(nroi): --> 266 x_perm2 = np.append(x_perm2, x[int(perm_id[ii, rr])]) 267 y_perm2 = np.append(y_perm2, y[int(perm_id[ii, rr])]) 268 x_perm = np.vstack((x_perm, x_perm2))
IndexError: index 68 is out of bounds for axis 0 with size 68
Best, Petr
Hi Petr,
Can you please tell me which command produces the error and which dataset you load as I can't seem to be able to reproduce the error.
Sara.
Hi Sara, please find bellow the script that produces the error:
from enigmatoolbox.datasets import load_summary_stats from enigmatoolbox.datasets import load_fc from enigmatoolbox.permutation_testing import spin_test
sum_stats = load_summary_stats('epilepsy')
CT = sum_stats['CortThick_case_vs_controls_ltle']
CT_d = CT['d_icv']
fc_ctx, fc_ctxlabels, , _ = load_fc()
fc_ctx_epi = [] fc_ctx_epi_p = []
for seed in range(fc_ctx.shape[0]): seed_con = fc_ctx[:, seed] fc_ctx_epi = np.append(fc_ctx_epi, np.corrcoef(seed_con, CT_d)[0, 1]) fc_ctx_epi_p = np.append(fc_ctx_epi_p, spin_test(seed_con, CT_d, surface_name='fsa5', parcellation_name='aparc', type='pearson', n_rot=1000, null_dist=False))
Hi Petr,
I ran this in python 3.8 and did not get an error:
from enigmatoolbox.datasets import load_summary_stats
from enigmatoolbox.datasets import load_fc
from enigmatoolbox.permutation_testing import spin_test
import numpy as np
sum_stats = load_summary_stats('epilepsy')
CT = sum_stats['CortThick_case_vs_controls_ltle']
CT_d = CT['d_icv']
#Load functional connectivity data
fc_ctx, fc_ctx_labels, _, _ = load_fc()
#The following piece of code is copied from https://enigma-toolbox.readthedocs.io/en/latest/pages/07.epicenter/index.html
fc_ctx_epi = []
fc_ctx_epi_p = []
for seed in range(fc_ctx.shape[0]):
seed_con = fc_ctx[:, seed]
fc_ctx_epi = np.append(fc_ctx_epi, np.corrcoef(seed_con, CT_d)[0, 1])
fc_ctx_epi_p = np.append(fc_ctx_epi_p,
spin_test(seed_con, CT_d, surface_name='fsa5', parcellation_name='aparc', type='pearson', n_rot=1000, null_dist=False))
Perhaps make sure to cd into the ENIGMA folder, git pull
, and python setup.py install
I've also just published a new v1.1.0 release with the updated functions (should you prefer to download the .zip file). Also make sure however to python setup.py install
to update the python package.
Dear Sara, it works now! Many thanks, I really appreciate! Best Wishes, Petr
Hello, I ran spin permutation tests with the example data set provided and got this error:
~/.local/lib/python3.8/site-packages/enigmatoolbox/permutation_testing/permutation_testing.py in perm_sphere_p(x, y, perm_id, corr_type, null_dist) 264 y_perm2 =[] 265 for ii in range(nroi): --> 266 x_perm2 = np.append(x_perm2, x[int(perm_id[ii, rr])]) 267 y_perm2 = np.append(y_perm2, y[int(perm_id[ii, rr])]) 268 x_perm = np.vstack((x_perm, x_perm2))
IndexError: index 69 is out of bounds for axis 0 with size 68