Deviation maps
Authors: Pauline Amrouche, Raymundo Cassani
This tutorial introduces the implementation of the deviation maps process in Brainstorm, using the five subjects of the OMEGA tutorial as an illustration. Before proceeding, please complete the OMEGA tutorial as we will build on its results.
Introduction
Electrophysiology recordings have been explored to identify and describe abnormal activity patterns in patients with specific clinical phenotypes compared to healthy controls. Normative modelling helps define the healthy range of certain biomarkers and map individual differences at the single-subject level—a concept known as deviation maps.
Several studies have explored the potential of electrophysiology recordings to identify and describe abnormal activity patterns in patients with specific clinical phenotypes compared to healthy controls. Normative modelling has been used to define the healthy range of certain biomarkers and map individual differences at the single-subject level, a concept to which we refer as deviation maps. This approach has been applied in refractory epilepsy using scalp EEG in Janiukstyte et al., 2023 and in identifying new biomarkers for mild traumatic brain injury (mTBI) using MEG in Itälinna et al., 2023 for instance.
In this tutorial, we will create dummy deviation maps from the MEG spectral features of five subjects from the OMEGA tutorial. Four subjects will serve as the reference population, against which the fifth subject will be compared.
Preprocessing: extract spectral features
Deviation maps can be derived from any statistic defined on a common spatial scale across subjects. In this example, we will extract statistics from the power spectrum density (PSD) using the Welch method. This method uses overlapping time windows, with the final power for a given frequency bin being the mean power across all time windows. Additionally, the standard deviation or the coefficient of variation (standard deviation/mean) of the power across time windows can also be analysed.
For this tutorial, we will compute the standard deviation of the power spectrum across time windows to illustrate to show how to use the Compute PSD features process. We will use only the first 100s of the recording as it is faster and should lead to similar results. Then we project those results on the common anatomy.
Drag and drop the five subjects (not sub-emptyroom) into the Process1 box and click the [Process sources] button. You should have one file selected per subject.
Select process: Frequency > Compute PSD features: 0-100s, 1s, 50% overlap, Physical, Extract std, Use relative power, Edit…, Group in frequency bands, Save individual
Time window, window length, window overlap ratio, units, scouts, scout function: same options as in Frequency > Power spectrum density (Welch).
Extract mean: Whether to extract mean feature (PSD).
Extract std: Whether to extract standard deviation (across time windows).
Extract varcoef: Whether to extract coefficient of variation (std/mean).
Use relative power: Check to consider the relative power (Power frequency bin / Total power) for each window instead of the raw power of the frequency bin.
- The process returns 1 to 3 files depending on the number of features extracted.
Add process: Sources>Project on default anatomy: Cortex surface.
Deviation maps process
For each vertex in the cortex parcellation (or each region of interest) and each frequency bin of the PSD’s std, we create a normative distribution from the reference population values. These values are z-scored to simplify interpretation. For a subject outside this reference population, we calculate the z-score for the same feature relative to the normative distribution. When considering a given deviation level d, if the subject's value falls outside the d/2 and 1−d/2 quantile interval in the empirical distribution, we flag the point as deviant. Repeating for every vertex and frequency bin creates the deviation map.
Important note: When choosing the deviation level, the number of subjects in the reference population must be taken into account. For example, in our example with only four subjects, as we must exclude at least 1 subject on each side of the distribution we need a minimal deviation level of 0.5. A deviation level of 0.5 is obviously too large, but this serves as a simplified example to illustrate the process. As the size of the reference population increases, the deviation level can be reduced.
We will now compute the deviation map for subject 2 compared to the reference population (subjects 3,4,6 and 7).
Click on the button [Search Database] (the magnifying glass) and then click on [New search].
- In the tab that opens, you can select files based on their name. We will select the files we created identified by the suffix “std relative”. Enter “std relative” in the Search for: field, make sure that you search by name with Equality set to Contains.
- Then in Process2, select the file for sub-0002, drag and drop it into Files A.
- Drag and drop the folders for the four other subjects into FilesB.
Select process: Test>Compare (A) to normative PSDs (B) : deviation level 0.5, frequency definition: Same as input.
Use log10 values: Check to use log values of power in power spectrum.
Deviation level: Two-sided level used to define the exclusion quantiles (for example a level of 0.05 leads to the quantiles at 2.5% and 97.5% of the reference distribution). If the power value for (A) falls outside of those quantiles, the value is flagged as deviant.
Assume normal distribution of residuals: Check to consider the quantiles of a normal distribution rather than the quantiles of the empirical distribution.
Test for normality of residuals: If checked will output in the Brainstorm report the ratio of distributions for which the normality hypothesis can be rejected according to Shapiro-Wilk test. If the ratio is too high then the distributions should not be assumed normal.
Frequency definition: Definition of the frequency bands, either the same as the input, individual frequencies (ie. Input frequencies in the range chosen by the user) or frequency bands defined by the user.
Open the file "comp. to norm. p<0.5 | bands" for "comparison to normative, deviation level of 0.5, frequency bins by bands". This is the dummy deviation map for subject 2, every vertex with value 1 falls outsite of the desired quantiles of the normative distribution.
References
V. Janiukstyte et al., ‘Normative brain mapping using scalp EEG and potential clinical application’, Sci Rep, vol. 13, no. 1, p. 13442, Aug. 2023, doi: 10.1038/s41598-023-39700-7.
V. Itälinna, H. Kaltiainen, N. Forss, M. Liljeström, and L. Parkkonen, ‘Using normative modeling and machine learning for detecting mild traumatic brain injury from magnetoencephalography data’, PLOS Computational Biology, vol. 19, no. 11, p. e1011613, Nov. 2023, doi: 10.1371/journal.pcbi.1011613.