MICA-MNI / BrainSpace

BrainSpace is an open-access toolbox that allows for the identification and analysis of gradients from neuroimaging and connectomics datasets | available in both Python and Matlab |
http://brainspace.readthedocs.io
BSD 3-Clause "New" or "Revised" License
183 stars 73 forks source link

Odd Hemispheric Gradients #9

Closed mgirn closed 4 years ago

mgirn commented 4 years ago

Hi Reinder, Oualid, and Boris,

I'm getting some odd outputs from running the diffusion embedding algorithm. I've attached images of the first three gradients. These are the mean gradient (mean of Procustes-aligned gradients) for n=82 healthy young adults. Each individual subject also had more or less similar gradients when looked at individually pre-alignment.

I've run this exact same code on a different dataset and have not gotten these odd results. The vertex-wise timeseries for the sessions, as well as the Z matrices, do not show any clearly discernible hemisphere differences. Our QC metrics on the data and the conversion from volume to surface space also don't shed light on the issue as far as I can tell. In addition, this data has been used for other projects and a clear hemispheric pattern was not observed.

Any thoughts on what might be going on? See below for the code that I used to compute these gradients.

Thanks in advance, Manesh

G1_young G2_young G3_young

curr_Z = gradients_getZ(sess_folder, sess1_left, sess1_right, sess2_left, sess2_right);

young_toRemove(k,:)=all(curr_Z==0,2); % get columns that contain a zero
curr_remove=young_toRemove(k,:);
curr_Z(curr_remove',:)=[];
curr_Z(:,curr_remove)=[];

gm = GradientMaps();

curr_gm = gm.fit(curr_Z);
gradients_young{k,:}.gradients = curr_gm.gradients;
gradients_young{k,:}.lambda = curr_gm.lambda;

%% add back in removed values

for i=1:82 % for each subject

young_gradient_vectors=gradients_young{i, 1}.gradients{:, 1};
idx=find(young_toRemove(i,:));

for k=1:10 % for each gradient

curr_gradient_young(:,k)=single(zeros(10000,1));
c=0;

for j=1:10000 % for each vertex

    if ~ismember(j,idx)
        c=c+1;
        curr_gradient_young(j,k)=young_gradient_vectors(c,k); 
    else
        curr_gradient_young(j,k)=0;
    end
end
end
young_gradients_unaligned{1,i}=curr_gradient_young;
end
function Z = gradients_getZ(dataDir, fileName, fileName2, fileName3, fileName4)

mgh_name = [dataDir filesep  fileName];
data = MRIread(mgh_name);
TSleft1 = squeeze(data.vol)';

mgh_name = [dataDir filesep fileName2];
data = MRIread(mgh_name);
TSright1 = squeeze(data.vol)';

mgh_name = [dataDir filesep  fileName3];
data = MRIread(mgh_name);
TSleft2 = squeeze(data.vol)';

mgh_name = [dataDir filesep fileName4];
data = MRIread(mgh_name);
TSright2 = squeeze(data.vol)';

TS1=[TSleft1 TSright1];
TS2=[TSleft2 TSright2];

 %% downsample TS from fsa5 (20484) to fsa 10K
load('/lbc/lbc1/derivatives/MG/aging_gradients/fsa5_to_fsa10k/fsa5_to_fsa_10k.mat')
load('/lbc/lbc1/derivatives/MG/aging_gradients/fsa5_to_fsa10k/fsa_10k_mask.mat')

FSA10k_1=zeros(200,10000);
FSA10k_2=zeros(200,10000);

for i=1:20484
    if ~isempty(find(id_20k_to_10k==i))
        idx=find(id_20k_to_10k==i);
        FSA10k_1(:,idx)=TS1(:,i);
        FSA10k_2(:,idx)=TS2(:,i);   
    end
end
clear TS1 TS2 TSleft1 TSleft2 TSright1 TSright2

FSA10k_1(~mask_10k)=0;
FSA10k_2(~mask_10k)=0;

%%
R(:,:,1)= corr(single(FSA10k_1));
R(:,:,2)= corr(single(FSA10k_2));
R=nanmean(R,3);

Z = atan(R);
Z(isnan(Z)) = 0;
Z(isinf(Z)) = 0;
ReinderVosDeWael commented 4 years ago

I don't see anything wrong with the BrainSpace code usage. This may be an issue with the input data.

I suggest you try the following steps to look for inter-hemispheric differences.

1) If you simply plot the correlation matrix, does it look normal? Do the left/right hemispheres look like they have similar connectivity profiles? 2) If 1) looks fine, try reconstructing the 7 Yeo-Krienen networks (https://surfer.nmr.mgh.harvard.edu/fswiki/CorticalParcellation_Yeo2011) with seed-based connectivity analyses. Do these networks look normal? Do you see hemispheric biases in connectivity strength?
3) If the above fails, try lowering the sparsity parameter. If subtle differences exist between inter- and intra- hemispheric connection strengths then sparsifying the matrix may exacerbate these.

Hope that helps,

Reinder

mgirn commented 4 years ago

Thanks for the suggestions.

Hmm, the correlation matrices look normal with respect to hemisphere similarity, and we had examined the 7 networks using Schaefer parcellation ROIs as a part of our QC pipeline and did not find any salient hemispheric biases. Also, I tried with 75% sparsity and the results were largely similar.

There's something fishy going on and I will continue to look into it... But yes, this must be a data issue rather than Brainspace.

ReinderVosDeWael commented 4 years ago

I'll close this issue since it doesn't appear to be related to the BrainSpace code