Home › Forums › General Help › Tractographybased connectome matrix
This topic contains 1 reply, has 2 voices, and was last updated by Mite Mijalkov 6 months, 2 weeks ago.

AuthorPosts

PedroHello,
Congratulations for this great software.
I have connectome matrices that are based on tractography: adjacency matrices, each cell representing the number of streamlines between two regions of interest (one matrix per subject).
I would like to know if it is possible to import and analyse these matrices in Braph?
Since these are not correlation matrices, I couldn’t find a way to import data as specified in the manual.Many thanks,
PedroHi Pedro,
Currently, BRAPH does not allow you to import adjacency matrices. In order to import adjacency matrices in BRAPH directly, without calculating the correlation coefficients, you would need to modify the underlying code in Braph. Below, I write a detailed list what would you need to do in BRAPH in order to import your matrices:
1) You should have the adjacency matrix for each subject saved separately in a Matlab file (.mat) and group the matrices according to your study. Then, without any modification to the Cohort files you would be able to import the adjacency matrices for each group as explained in the manual (http://braph.org/manual/fmri/fmricohort/ ; for your case, as you have one matrix per subject you could do the fMRI/EEG analysis).
Please note that your adjacency matrix needs to be consistent with the atlas you uploaded for this to work; for example if you upload brain atlas of 200 regions, you need to have an adjacency matrix of size 200×200.2) In the EEGGraphAnalysis.m file, locate the function adjmatrix. In this function, after the line case EEGGraphAnalysis.CORR_KENDALL you should see [A,P] = corr(data,’Type’,’Kendall’) (this should be located at line 355 in EEGGraphAnalysis.m). You would need to modify this line to read:
A = data;
P = zeros(size(data));
In other words, the function [A,P] = adjmatrix(ga,data) in the file EEGGraphAnalysis.m should look like this (notice the line commented out after case EEGGraphAnalysis.CORR_KENDALL):
function [A,P] = adjmatrix(ga,data)
% ADJMATRIX calculates the adjaciency matrix
%
% [A,P] = ADJMATRIX(GA,DATA) calculates the adjaciency matrix A and the
% matrix of pvalues for correlations P, given the graph analysis GA
% and its subject data DATA.
%
% See also EEGGraphAnalysis, corr, partialcorr, corrcoef.switch ga.getProp(EEGGraphAnalysis.CORR)
case EEGGraphAnalysis.CORR_SPEARMAN
[A,P] = corr(data,’Type’,’Spearman’);
case EEGGraphAnalysis.CORR_KENDALL
%[A,P] = corr(data,’Type’,’Kendall’);
A = data;
P = zeros(size(data));
case EEGGraphAnalysis.CORR_PARTIALPEARSON
[A,P] = partialcorr(data,’Type’,’Pearson’);
case EEGGraphAnalysis.CORR_PARTIALSPEARMAN
[A,P] = partialcorr(data,’Type’,’Spearman’);
otherwise % EEGGraphAnalysis.PEARSON
[A,P] = corrcoef(data);
endswitch ga.getProp(EEGGraphAnalysis.NEG)
case EEGGraphAnalysis.NEG_ZERO
A(A<0) = 0;
case EEGGraphAnalysis.NEG_ABS
A = abs(A);
otherwise % EEGGraphAnalysis.NEG_NONE
end
endWhat this accomplishes is to modify the Kendall correlation option in the graphical interface to use the adjacency matrix you provide instead of calculating correlation coefficient. Therefore, please choose this option of the rest of your analysis. If you choose any of the other four options, they would still work as coded originally; they would treat your adjacency matrix as time series and calculate correlation coefficient between different columns.
Finally, let me say that this modification is not specific to EEG analysis or to Kendall option. If you would actually need to use Kendall correlation coefficient you could modify any of the other option as explained above and this method would still work. Moreover, if you would like to use the fMRI analysis part, you can modify the fMRIGraphAnalysis.m file analogously.
I hope this helps you with your analysis. If there is anything else you would need help with, please do not hesitate to contact me.
Best,
Mite 
AuthorPosts