[FieldTrip] Testing group differences on coherence data

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Wed May 10 08:54:18 CEST 2023


Hi Anna-Maria,

There are 2 issues at hand here.

In principle it should be possible to (1) hand-craft a data structure such that ft_freqstatistics/(or ft_timelockstatistics) swallows it, in order to do inferential statistics. If - on top of that - you wish (2) to use a cluster-heuristic to address the multiple comparison problem, it would in addition require a defendible adjacency matrix for the edges in your graph. Neither of these 2 points have a ready made solution in FieldTrip, so it would require to make your hands dirty.

w.r.t. point (1), you could create for each subject and condition a data structure that has the (lower triangle) of the connectivity matrices, as a function of frequency. In order for FieldTrip to ‘understand’ these data structures, you’d need to make them internally consistent, i.e. have the freq.dimord to be ‘chan_freq’, and have a freq.label field to be a  N(N-1)/2 x 1 cell-array containing the names of the channels. In this case you could e.g. combine the two labels of the channels that constitute a pair:


for k = 1:numel(freq.freq)
  C(:,k ) = tril(freq.cohspctrm(:,:,k), -1);
end

% and

for k = 1:numel(freq.label)
  for m = (k+1):numel(freq.label)
    L{k,1} = sprintf(‘%s_%s’, freq.label{k}, freq.label{m});
  end
end

freqnew = [];
freqnew.powspctrm = C;
freqnew.label = L;
freqnew.dimord = ‘chan_freq’;
freqnew.freq = freq.freq; % plus perhaps some other stuff is needed, but I am not sure


w.r.t. point(2), this is more tricky. Conceptually, you’d need an adjacency matrix of size  N(N-1)/2 x N(N-1)/2 that defines which channel pairs are each others’ neighbours. There is no straightforward way to define this in terms of a ’neighbours’ struct-array in the same way as this can be done for univariate data (i.e. by calling ft_prepare_neighbours or so). However, the ft_<something>statistics functions allow for the use of a cfg.connectivity field, which is a boolean adjacency matrix, that will be used for the clustering (in fact, the cfg.neighbours structure will be converted into such a matrix in the lower-level code). In itself, the use of the cfg.connectivity directly should be done with care, because there is no internal check w.r.t. the consistent ordering and identity of the channels in this matrix with respect to the data (which is different from when the cfg.neighbours are used). If however the order and identity of the channels in all data arguments into the function are consistent, and this order is also maintained in the cfg.connectivity matrix, then using the cfg.connectivity matrix would be OK. The minor detail left is then how to hand-craft such an adjacency matrix. One possible way forward could be to define as neighbouring edges those channel pairs for which one of the two channels are each other’s first order neighbours:

for instance, if ‘a’ ‘b’ and ‘c’ are local neighbours, and ‘p’ ‘q’ and ‘r’ as well, then one could define ‘a-p’ as a neighbour to ‘a-q’, (and ‘b-p’ as a neighbour to ‘a-p’). The question is whether ‘a-p’ should be a neighbour to ‘b-q’, but I leave that up to you to think about it, and to consider whether you’d really need clustering for your statistical inference.

An alternative approach could be to do statistics on (the difference between) derived graph metrics of your coherence matrices, or of a graph metric derived from the coherence difference matrix. This would give you a univariate channel by frequency metric that can be subjected to the traditional spatial clustering.

I hope this helps, and keep up the good work,
Jan-Mathijs




On 9 May 2023, at 18:46, Grob, Anna-Maria via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:


Dear FieldTrip community,

I have computed the coherence between all channels for a specific stimulus and would now like to compare the output matrix (maybe just the upper triangle) between two groups (Sham vs. TMS). What would you suggest?

I have tried tweaking the matrix into a single vector to input it into the ft_timelockstatistics, but this did not rally work - also the neighbours file obviously does not fit anymore, since i now have a Channel x Channel matrix and its not ordered by single channels, if this makes sense.

Here is a picture of the coherence matrix of one participant:

<pastedImage.png>

Best,
Anna-Maria
<mailto:anna-maria.grob at uni-hamburg.de>




_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!5CAhodCyjiIwCfEeVK_b1ynuo37Xyw-kDXBcpZNVRsHcCCl7XuUGUXhPXVfVfLpAeM9QFeszVKqeGwFtZf37TYu30Im3RU0czxymSw$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230510/9ef30e17/attachment.htm>


More information about the fieldtrip mailing list