# EEG graph analysis

Home Forums General Help EEG graph analysis

Viewing 10 posts - 1 through 10 (of 10 total)
• Author
Posts

Hi Mite,

I have question regarding the results returned by Braph of my EEG graph analysis. Looking at the nodal measures (after clicking at comparision), in this window there are columns like –> difference, p(1 tailed), fdr(1 -tailed)… and so on.
I am wondering that do we still have to apply fdr if this column has zero values. Sometime it has value like 1e-3 (fdr-1 tail). Does it show the value of false discovery?
Also if I have repeated measure design, do I have to define some other parameters or by selecting longitudinal study will work?

Thanks,
Amna

Hi Amna,

We are very happy you chose to use Braph for your analysis and I hope everything is going well with it.

The table on the Nodal measures panel contains the information on the calculated parameters outputted from the permutation test. The fdr part of this table works in the following way:

To calculate the false discovery rate (corrected by using the Benjamini-Hochberg procedure, http://braph.org/manual/brain-graphs/) the p-values are ranked in ascending order and compared with their false corrected values. Once the largest p-value that is smaller than the corresponding false-rate-corrected value is identified, all the p-values smaller than this value are considered significant. These multiple comparisons are performed at a particular density for a given measure across all of the regions in the brain atlas.

Therefore, if you have a zero in the fdr column this means that none of the regions show a significant differences at that particular density value once their corresponding p-values are fdr corrected. Conversely, a non-zero p-value in the fdr column is the largest p-value discussed earlier (this value can be for any region but it is calculated at the particular density). In other words, if the p-value that is shown in the p-value column is smaller than the corresponding fdr value shown in the fdr column, that region is significant at this density. Please note that as you change the regions from the popup menu, the fdr value does not change since for a given measure it depends only on the density.

For your second question, yes, the longitudinal study will work.

If you need further help, please do not hesitate to contact me.

Best,
Mite

Hi Mite,

I have already calculated connectivity matrices using phase locking values (PLV). For that reason I would like to bypass the connectivity matrices calculation option and start graph theoretical analysis on matrices that I already got using PLV algorithm. However, I can see that one has to select different measures (spearman, pearson etc) in braph. The question is how can I eliminate this option in Braph? Cause changing this option is effecting my already calculated connectivity matrices. Is it possible or do I have to measure connectivities again using time series of EEG data?

Many thanks,
Amna

Hi Amna,

Currently you cannot enter the adjacency matrix directly from the graphical user interface. However, you could still perform the analysis with a pre-calculated adjacency matrix from the command line while using all functionalities of Braph (like calculation of graph measures).

If, on the other hand, you would still like to use the graphical interface you would need to modify the code a bit in order to allow for the adjacency matrix to be inputted.

Assuming that you have an adjacency matrix already calculated for each subject you would need to modify two things:
1. Modify the input to the GUIfMRICohort / fMRICohort so that instead of time series for each brain region, you will be able to import matrices.
2. Modify the fMRIGraphAnalysis object (in the method adjmatrix either add one case in the switch function or modify an existing case that you would not use) so that instead of reading the object data and calculating the matrix, it reads the adjacency matrix from each subject and accepts it without doing any calculation.

If you instead have a ready Matlab code that will calculate the adjacency matrix with the PLV method provided the time series of the subject, you could just modify the fMRIGraphAnalysis object. In this case, you would add another case in the switch function (the method adjmatrix) that would execute PLV instead of the standard correlation methods.

After these modifications, all other features of BRAPH will work as in the original case.

Best,
Mite Veronique
Guest

Dear Mite,
I have just knwon about BRAPH software and I am very happy to have find it on the web !! However, as Amma, I am a little bit concerned about EEG connectivity matrix . Indeed, in the EEG field, connectivity matrix are not calculated from correlation (pearson or others types) while it is the case in fMRI data …. so as Amma I have already calculated connectivity matrices using phase locking values (PLV).
You have given information about how to proceede with but unfortunately I am not familiar with Matlab so I do not know how to do when you say:
1. Modify the input to the GUIfMRICohort ……
2. Modify the fMRIGraphAnalysis ….
What do you mean by modify ?? What should I do ??
Many thanks,
Veronique

Dear Veronique,

I am happy you are using Braph and hope you find it useful and helpful for your research.

I understand your concern. I will implement the feature to import and analyze pre-calculated adjacency matrix and will describe a detailed step by step instructions in the next few days.

If you need any additional help please do not hesitate to contact me.

Best,
Mite Veronique
Guest

Thank you so much. This is very kind.
I look forward to seeing progress …
Veronique

Hi Veronique,

I modified the Braph toolbox in order to be able to accept previously calculated matrices. It works in the following way:

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 EEG Cohort files you would be able to import the adjacency matrices for each group as explained in the manual (http://braph.org/manual/fmri/fmri-cohort/ ; since EEG analysis is analogous to the fMRI analysis, the manual’s explanations are valid for both cases).
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):
%
% matrix of p-values for correlations P, given the graph analysis GA
% and its subject data DATA.
%

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);
end

switch ga.getProp(EEGGraphAnalysis.NEG)
case EEGGraphAnalysis.NEG_ZERO
A(A<0) = 0;
case EEGGraphAnalysis.NEG_ABS
A = abs(A);
otherwise % EEGGraphAnalysis.NEG_NONE
end
end

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

3) 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 that this explanation helps you and you will be able to modify Braph to suit your analysis. If you need any additional help with this issue or any other question please do not hesitate to ask and I will do my best to help.

Best,
Mite Che Liu
Guest

Hello Mite,
Braph makes the analysis much easier. Now, I want to load connectivity matrix from fMRI data, because I want to control for age and gender. I read the one you posted about how to modify the Braph toolbox (http://braph.org/forums/topic/eeg-graph-analysis/). I followed each steps. However, there is still errors as below:
Matrix dimensions must agree.
Error in GUIfMRIGraphAnalysis/update_matrix (line 714)
A = A+ga.getA(indices(i));
Error in GUIfMRIGraphAnalysis/cb_calc_corr (line 439)
update_matrix()
Error while evaluating UIControl Callback.
Matrix dimensions must agree.
Error in GUIfMRIGraphAnalysis/update_matrix (line 714)
A = A+ga.getA(indices(i));
Error in GUIfMRIGraphAnalysis/cb_calc_graph (line 434)
update_matrix()
Error while evaluating UIControl Callback.
Matrix dimensions must agree.
Error in GUIfMRIGraphAnalysis/update_matrix (line 714)
A = A+ga.getA(indices(i));
Error in GUIfMRIGraphAnalysis/cb_calc_corr (line 439)
update_matrix()
Error while evaluating UIControl Callback.

Do you know how to fix the errors? I think need to change something in the updatamatrix.m too.

Thanks a lot.
Che

Dear Che,

Thank you for using Braph and your kind words. Hopefully it will be a very useful tool for you during your research.

I am not sure what the mistake it currently, but if you send me an e-mail, I could send you a modified version of Braph that is able to upload pre-calculated connectivity matrices.

Looking forward to hearing from you.

Best,
Mite

Viewing 10 posts - 1 through 10 (of 10 total)