School Lyon - 22/10/2021
Etienne Combrisson - Postdoc BraiNets' team INT Marseille
30min
1h30min
1h
1h
30min
My very optimistic program !
[FRITES] Framework for Information Theoretical analysis of Electrophysiological data and Statistics
Vinicius Lima Cordeiro
INT/INS, Marseille
Brain data
Information Framework
Task-related functional (un)directed connectivity
Local task-related
brain activity
Group-level statistical inferences
Extract dynamic spatiotemporal cognitive brain networks in relation to cognitive processes
Inputs
Local measures power, phase, PAC etc.
Connectivity estimations (d)FC, (un)directed
Graph-measures degree, modularity, associativity etc.
Link with external variable
(IT)
Contrasting conditions
"classification" like
baseline vs. task
stimulus A vs. B
Reaction time (RT)
Learning model
Prediction error
Regression
"correlation" like
Removing influence
"partial-correlation" like
RT | {easy, hard}
Group-level statistics
Measure of information
"Conjunction" #subjects significant
Fixed-effect case studies
Random-effect generalization
Data
Results
Task variable
Brain data
Effect size
P-value
Statistics
frites.workflows
WfStats
Corrected p-value
Information
frites.workflows
WfMi
Measure of effect size
Dataset
frites.dataset
DatasetEphy
Merge group data
17 subjects with a pharmaco resistant epilepsy implanted with intracranial electrodesÂ
[REW] Reward condition
[PUN] Punishment condition
Inside each brain region, there is multiple recording sites (i.e. channels / contacts) coming from multiple subjects (potentially different)
[anat] Single subject excel files containing anatomical informations. Two columns :Â
[beh] Single subject excel files containing behavioral informations. Five columns :Â
[hga] Single subject high-gamma activity (HGA). The data are saved as 3D arrays (n_epochs, n_channels, n_times)
Let's talk about how your data should be formatted to start using Frites
INPUTS
OUTPUTS
-1
-0.75
-0.5
-.025
0.
0.25
0.5
0.75
1.
1.25
3.
3.25
3.5
3.75
4.
4.25
4.5
4.75
5.
5.25
Times (seconds)
e1
e2
e3
e4
e5
e26
e27
e28
e29
e30
Electrodes
s1
s1
s1
s2
s2
s10
s10
s11
s11
s11
Subjects
Baseline
Period of interest
Your data
Labelling
Labelling layer on top of your data to facilitate data selection and overall manipulations
"Select the neural activity during the baseline of subject 10, electrode 26"
# data.shape = (n_electrodes, n_times)
# select the electrode of the subject
is_subject = subject_names == 's10'
is_elec = elec_names == 'e26'
is_both = np.logical_and(is_subject, is_elec)
# select baseline activity
is_baseline = times < 0.
# apply selection to the data
data_n = data[is_both, is_baseline]
# data.shape = (n_electrodes, n_times)
# assuming that data is already an DataArray
data_n = data.sel(
subject='s10',
elec='e26',
times='baseline'
)
NumPy → Xarray
Array labelling
import numpy as np
import xarray as xr
"""
raw.shape = NumPy array (n_electrodes, n_times)
elec_names = vector of electrode names (n_electodes,)
time_vec = time vector (n_times,)
"""
raw_xr = xr.DataArray(
raw, # NumPy array of data
dims=('electrodes', 'times'), # dimension names
coords=(elec_names, time_vec) # coordinates values
)
Xarray → NumPy
Drop labelling
import numpy as np
import xarray as xr
"""
raw_xr.shape = Xarray DataArray (n_electrodes, n_times)
elec_names = vector of electrode names (n_electodes,)
time_vec = time vector (n_times,)
"""
# retrieve coordinates
elec_names = raw_xr['electrodes'].data
time_vec = raw_xr['times'].data
# get the raw data as a NumPy array
raw = raw_xr.data
Advantages of using Xarray
# maximum / minimum and mean across time points
data.max('times')
data.min('times')
data.mean('times')
# operations on groups
data.groupby('brain_regions').mean('brain_regions')
data.groupby('time_period').mean('time_period')
# add attributes
data.attrs['sampling_frequency'] = 1024.
data.attrs['session'] = 1
data.attrs['animal'] = 'rat_1'
# save and reload your data
data.to_netcdf('my_data.nc')
data = xr.open_dataarray('my_data.nc')
Limitations of Xarray
frites.dataset.DatasetEphy
Container of brain data for then performing computations either on a single subject or on a population (i.e. to find reproducible effects across participants or sessions)
## Merging multiple participants
from frites.dataset import DatasetEphy
dt = DatasetEphy([raw_s1, raw_s2, raw_s2, raw_s3, raw_s4])
DatasetEphy([ ])
## Input type for each participant
=Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â |
## Input shape for each participant
3D epochs data
4D epochs data
Brain data Power, spiking rate, functional connectivity etc.
Brain data
Measure of information Reflects how much brain data carry information about the task (Kriegeskorte et al. 2006)
Task-variables and behavior
Discret stimulus, outcomes
Continuous psychometrics Reaction times
Continuous behavioral models Prediction error, Surprise
Information-based measures :Â how much a neural signal or a link between brain regions carry information about the task (Kriegeskorte et al., 2006)
Information-theory (IT) Mutual-information, entropy Model-free
Machine-learning (ML) Classifiers, regressions Model-based
mi_type='cd'
brain data = continuous
variable = discrete
mi_type='cc'
brain data = continuous
variable = continuous
Contrasting conditions
Quantifying how much the brain activity differs between 2 (or more) conditions
Stimulus A vs. Stimulus B; Baseline vs. Outcome etc.
Correlation-like
"Correlate" brain activity with a continuous variable
Learning curve, contingency, surprise, prediction error etc.
Three important points
Combrisson, E., Allegra, M., Basanisi, R., Ince, R. A., Giordano, B., Bastin, J., & Brovelli, A. (2021). Group-level inference of information-based measures for the analyses of cognitive brain networks from neurophysiological data. under review + biorxiv
What does population mean?
Several subjects
Several sessions from a single subject
Several recording sites in a single brain region
Single-participant
Fixed-Effect
Random-Effect
Quantitative statistics
How many participant / contacts / sessions have the effect?
Typical characteristics of the population of participants
Average characteristics of the population of participants
Friston et al., NeuroImage (1999);Â Maris and Oostenveld, 2000; Giordano et al., 2017; Combrisson et al. in prep
Static functional connectivity
Contact 1 Contact 2
Times
Dynamic functional connectivity
Contact 1 Contact 2
I(roi_1past; roi_2present | roi_2past)
ROI 1
ROI 2
Static covGC
times
Dynamic covGC