<EMAIL_ADDRESS>[]Data and code availability is stated in the key
resources table in Section 4.4. Any additional information required to
reanalyze the data reported in this paper is available from the lead contact
upon request. []The authors declare no competing interests. Gutzen

# Comparing apples to apples -
Using a modular and adaptable analysis pipeline to compare slow cerebral
rhythms across heterogeneous datasets

Robin Gutzen  Giulia De Bonis  Chiara De Luca  Elena Pastorelli  Cristiano
Capone  Anna Letizia Allegra Mascaro  Francesco Resta  Arnau Manasanch
Francesco Saverio Pavone  Department of Physics and Astronomy, University of
Florence, Florence, Italy  National Institute of Optics, National research
Council, Sesto Fiorentino, Italy  Maria V. Sanchez-Vives  Maurizio Mattia
Sonja Grün  Pier Stanislao Paolucci  Michael Denker

###### Abstract

Neuroscience is moving towards a more integrative discipline, where
understanding brain function requires consolidating the accumulated evidence
seen across experiments, species, and measurement techniques. A remaining
challenge on that path is integrating such heterogeneous data into analysis
workflows such that consistent and comparable conclusions can be distilled as
an experimental basis for models and theories. Here, we propose a solution in
the context of slow wave activity ($<1$ Hz), which occurs during unconscious
brain states like sleep and general anesthesia, and is observed across diverse
experimental approaches. We address the issue of integrating and comparing
heterogeneous data by conceptualizing a general pipeline design that is
adaptable to a variety of inputs and applications. Furthermore, we present the
Collaborative Brain Wave Analysis Pipeline (Cobrawap) as a concrete, reusable
software implementation to perform broad, detailed, and rigorous comparisons
of slow wave characteristics across multiple, openly available ECoG and
calcium imaging datasets.

##  1 Introduction

Today’s research landscape excels in an unprecedented richness of experimental
data and methodologies. In neurophysiology, this enables an array of various
research applications and a better calibration of detailed models of brain
dynamics and function. However, different recording techniques differ
considerably in the way in which they capture neural activity. These
differences [133, 164] include the type of signal (e.g., electric activity,
magnetic fields, fluctuations of calcium concentrations, or radiant isotopes)
and the scales on which the signal is observed in terms of temporal resolution
(sub-milliseconds to seconds), spatial resolution (micrometer to centimeters),
and spatial extent (single electrode to the whole brain). This vast data
collection is crucial for obtaining a more comprehensive picture of the brain.
The complementary nature of the different experimental approaches, each one
focusing on specific aspects or features, enables a deeper understanding of
the various neuronal phenomena. In addition, the constant development of new
experimental methodologies and acquisition tools will further diversify the
points of view we have on the brain. However, when addressing analysis of such
complex data, it becomes necessary to develop strategies to integrate the
multi-scale, multi-methodology heterogeneity, as well as to define description
levels and benchmarks to properly exploit the richness of the available data
and translate it to the multitude of available analysis approaches for a more
cumulative aggregation of knowledge. As each recording technique comes with
certain trade-offs (e.g., spatial vs. temporal resolution, latency, artifacts,
biases, etc.), it is also indispensable to combine different kinds of
measurements to validate findings independently of a particular measurement
device [95].

Furthermore, cross-domain comparisons are required for various challenges in
neuroscience. They form the foundation of many validation scenarios for
theories, models, and experimental data to quantify biological variability for
reaching a higher level of abstraction in the description of phenomena [178,
130, 94]. However, performing such comparisons is not a trivial task and, so
far, only rarely addressed. Yet, even if authors adopt definitions and methods
from other publications, comparing their quantitative findings is not
necessarily straightforward. For example, in the studies [138] and [100] the
same methodology and wave definition is adopted. Still, a direct quantitative
relationship between the reported wave velocities of $2.7\pm 0.2$ m/s and
$1.0\pm 0.2$ m/s is difficult due to remaining crucial differences in the
analysis implementations, making it impossible to accurately retrace the
source of the discrepancy, especially when the respective analysis code or
data is not accessible or reusable. Even when definitions, standards, and
methods are shared, there can still be various potential undocumented
differences in the analysis due to different algorithmic and implementation
choices, which makes it increasingly ambitious to interpret and understand the
differences in the quantitative results.

The main challenge in such cross-domain comparisons is to find a common
analysis basis. What this constitutes depends on the involved data types and
the scientific questions to be addressed. More similar data can have more
immediate commonalities, whereas very different data may only be compared on
an abstract level. Generally, the comparison benefits from having a) a common
description level and corresponding comparison metrics, b) equivalent or at
least comparable methods for processing and analyzing, and c) the use of
equivalent implementations and standard algorithms. Indeed, much care is
required to eliminate as many potential confounds as possible, as it has been
shown numerous times that even seemingly feeble influences such as floating
point precision, the choice of the operating system, or software versions can
have crucial effects on numerical results and add sources of systematic errors
[125].

So, a prerequisite of comparability is reproducibility. Any analysis result
must first be reliably reproducible with the same data before it can be
reasonably compared with results from other data. Whereas the degree of
reproducibility [128] can already inform the expected agreement to other
results. Ideally, the analysis results to be compared are generated from the
same code base. However, for heterogeneous data, this requires a considerable
degree of generality and reusability of the code. The issue of lacking
reusability, especially in custom-written code, is a well-known problem and
apparent to anyone who ever tried to efficiently build upon the code
collection of a former colleague or even their own code from two years ago.
Understandably, writing useful analysis code is hard, and writing general,
understandable, reusable, and adaptable analysis code is even harder. However,
the extra effort is rewarded by being able to bridge otherwise specific and
isolated studies and contributing to a more collaborative scientific tool
base. In fact, many of the challenges in the realm of analysis workflows are
already formalized and being addressed by open-source software tools and
standards, such as data- and metadata representation [184, 169, 157],
provenance [101], version control [98], standardized algorithms and frameworks
[179, 119, 148], and workflow management [145, 113, 124]. Here, scientific
progress is not only made by developing new methods and algorithms but also by
building on existing ones and bringing the existing resources together.

A use case where there already exists a plethora of diverse analysis methods,
as well as observations and data from a variety of different measurement
techniques and species, is the phenomenon of slow wave activity. In general,
waves are well-studied phenomena as we see them all around us. They are
present in diverse physical contexts and are frequently associated with
informative content: electromagnetic waves are the carriers of radiant energy
and information, waves in compressible mediums enable sound transmission,
gravitational waves in space-time tell us about astronomical events [93], and
waves in the oceans attract surfers. In neuroscience, waves are a ubiquitous
phenomenon as well. However, their functional roles are not yet fully
understood [183]. Slow waves ($<1$ Hz) [170] describe propagating activity
patterns in the delta band, defined by transitions between states of low
activity (Down) and high activity (Up). They, in particular, are reliably
observed in mammals during deep-sleep and anesthesia (Figure 1), which makes
them especially interesting for the study of memory, consciousness, and the
cognitive effects of sleep [132, 106, 127].

In face of such a prevalent phenomenon as slow waves, it is not surprising
that the literature reveals a very heterogeneous mosaic of approaches,
methods, metrics, and terminology. Due to this plurality, the relationships
between the respective findings are rarely apparent and mostly qualitative,
limiting the potential of cumulative discovery by the collection of studies.
Still, there are many valuable insights in the literature that set the context
for ongoing slow-wave research. For example, findings include that the
transitions of cells between Up and Down states are synchronously coordinated
over a wide cortical range implying a larger network mechanism [180], that
coordinates with the synchronization of the astrocytic network [175], thalamic
activity [171, 174, 166], and across the cortex as reoccurring slow wave
patterns can appear over an entire hemisphere [146]. Evidence from slice and
in-vivo recordings further suggests that wave propagation is guided by
excitability, i.e., predominantly resides in layers 4 and 5 [107, 99], and
shows distinctly different oscillation characteristics across cortical regions
[158, 139, 117]. Although slow wave activity is characteristic of sleep and
anesthesia, it can even be observed in localized areas during wakefulness in
EEG recordings of behaving mice [181]. Additionally, modeling approaches
suggest the importance of long-range connections [112, 149], synchronous high-
amplitude events [135], and the correct E-I ratio [111, 136] to exhibit
propagating slow waves. Despite these detailed studies, it is generally
unclear which observables are relevant for either the local cortical function,
as network characteristics, or even for higher cognitive functions (e.g.,
memory consolidation). The properties that are typically reported are thus
often heuristic and include, for example, transition slopes [158], phase
velocity [138, 146], wave type classification [177, Denker2018_1,
Roberts2019_1056, 102, 150], source/sink location and propagation patterns
[134, 137], excitability [141, 159, 117], event frequency [103], and others.
Thus, we here also focus on such common observables (i.e., planarity, inter-
wave intervals, velocity, and direction). By investigating the relations of
the characteristics metrics with the comparison parameters (scale, brain
state, anesthetic level, spatial/temporal resolution, etc.), we may evaluate
the capabilities of measurement methods, identify biases, constrain theories,
develop and benchmark analysis methods, contribute to defining standards, as
well as aid the assessment of clinical data of, for example, in the case of
coma patients.

Figure 1: Multiscale, Uniphenomenon: the many faces of slow waves. a) wide-
field voltage-sensitive dye imaging of awake mice [109], b) recorded
anesthetized GCaMP6f mice with wide-field fluorescence microscopy [108], c)
distributed network of cortical columns of LIF with Spike Frequency Adaptation
neurons [149], d) one-dimensional multi-layer thalamo-cortical model with one-
and two-compartment neuron models using Hodgkin-Huxley kinetics [97], e) 2D
balanced conductance-based spiking neural network model [136], f) multi-
electrode recording in ferret cortical slices [107], g) human HD-EEG during
first sleep episode of the night [138], h) human ECoG recording during sleep
[146], i) intracranial depth EEG in sleeping human subjects [147], j)
intracranial depth EEG in humans during sleep [100].

In the following, we report two results: a) first, we conceptually address the
problem to develop a flexible formalized approach for constructing analysis
pipelines (Section 2.1) that we then leverage to implement the Collaborative
Brain Wave Analysis Pipeline (Cobrawap) as a modular pipeline to analyze
cortical slow wave activity (Section 2.2); b) then, we employ Cobrawap to
perform a structured and partially automatized analysis of many heterogeneous
datasets (Section 2.3), and to benchmark the Up state detection method by
interchanging the corresponding method block (Section 2.4).

##  2 Results

###  2.1 A modular analysis approach enables flexibility in studying slow
waves

Since there is no single fully comprehensive measure to characterize spatial
activity patterns, we focus on identifying common observables and analysis
metrics of slow wave activity that enable a reasonable comparison between
datasets of different measurement types. To this end, in a constructive
analysis pipeline design, we first need to align the heterogeneous input data
and find a common representation, independent of whether it is obtained via
EEG, implanted electrode arrays, imaging techniques, or even simulations.
Although the input data may differ in terms of spatial- or temporal
resolution, scale, or signal type, we want to integrate them to be processed
by common methods and algorithms and to converge towards a common description
of the phenomenon of interest. Based on the phenomenon definition and
representation, we can employ a variety of specific analyses and derive
characterization metrics that are agnostic about the data’s origin. In this
way, we arrive at relatable measures of slow waves and avoid mixing apples and
oranges (Figure 2).

Figure 2: Pipeline Approach. The proposed pipeline design has the role of
aligning methods and algorithms to create and operate on a common description
of the phenomenon of interest: integrating data from heterogeneous sources on
the one hand and being capable of extracting a variety of output metrics on
the other, enabling a basis for rigorous comparison. The foundations of the
pipeline are built on existing tools and standards, e.g., data and metadata
representation, file formats, standard packages and implementations,
environment handling, and workflow management. Within this framework, the
catalog of applicable methods is flexibly extendable, making the analysis
pipeline adaptable and reusable.

The key to making the pipeline adaptable to the different data processing
requirements, analysis approaches, and scientific questions is modularity.
Thus, in the first layer of structuring, we segment the analysis procedure
into a series of sequential stages. Each stage is a self-consistent logical
step in an analysis workflow with a well-defined purpose, input, and output. A
stage should be constructed general enough to be useable as a standalone or
potentially reusable in other pipelines. Along the pipeline, the stages become
necessarily more specific and tailored towards the scientific application,
while the early stages cope with more general tasks such as data integration
and preprocessing that are likely shared across different pipelines. Each
stage is further segmented into blocks. A block defines a concrete action to
be performed on the data, implementing a method. Similar to stages, blocks
have a well-defined input and output by which they can be chained together. In
contrast to stages, blocks are not necessarily executed in a predefined
sequence. Rather, each stage implements the mechanics of the block
interactions and defines which block combinations and sequences can be chosen.
Some blocks may need to be mandatory for the realization of the stage purpose
and have a fixed place in the execution order. Others may be optional and
flexibly arrangeable. We identified three basic arrangements to be employed in
the stages: 1 - fixed) a fixed execution order of the blocks, 2 - choose any)
a custom user-defined execution order, and 3 - choose one) a multiple-choice
selection between blocks for one execution position (see Figure 3).

###  2.2 Exemplary realization of the Collaborative Brain Wave Analysis
Pipeline
(Cobrawap) by selecting and connecting methods

Based on the conceptual framework illustrated above (Section 2.1), we
construct a specific analysis pipeline application for the analysis and
comparison of slow wave activity across $5$ publicly available datasets from
the EBRAINS Knowledge Graph platform111https://search.kg.ebrains.eu of
electrocorticography (ECoG) and wide-field calcium imaging recordings of
anesthetized mice. Besides the measurement technique, the $60$ examined
recordings vary in a range of factors such as experimental setup, the genetic
strain of the mice, anesthetic, anesthesia level, temporal- and spatial
resolution, and recording duration (see Section 4.1).

The pipeline implementation uses the open-source language Python to ensure
accessibility and reproducibility. Further, we base the pipeline’s
architecture on the Python-based workflow manager snakemake [145], which
employs input-to-output rules containing executable shell commands (e.g.,
Python scripts or bash commands). Snakemake structures the execution of the
rules by building dependency trees from the final result file(s) back to the
initial input, matching the input requirements to the outputs of preceding
rules (see Section 4.2.1).

We organized the pipeline into $5$ sequential stages, successively
transforming the raw data and extracting slow wave characterizations, as
illustrated in Figure 3. In the following, we describe the role of each stage
in the analysis of the ECoG and wide-field calcium imaging data. The general
functionality of the stages and blocks is further described in the Methods
(Section 4.2.1) and in the corresponding README files in the Github
Repository.

  * •

In the first stage, Data Entry, the data is being prepared for the later
stages by loading, structuring, and annotating the data and metadata according
to the defined representation scheme using the Neo data format [123]. For
loading the data and processing the often unique structure, typically, each
data source requires a custom script that can be adapted from a template
script, making use of utility functions and, ideally, the IO functionality of
Neo222https://neo.readthedocs.io/en/stable/io.html.

  * •

The second stage, Processing, offers a series of blocks implementing basic
processing steps that can be arbitrarily combined. Both data types undergo a
background subtraction, a normalization, and a detrending step to remove
eventual recording artifacts. Considering the different measurement modalities
and temporal resolutions of the data types, additionally, the calcium imaging
recordings are cut to a region-of-interest and filtered from $0.1$ to $5$ Hz,
while the raw ECoG signals are transformed to a logMUA signal (see Section
4.2.2) with a reduced sampling rate better suited to capture the slow
oscillations and the transitions between Down and Up states (which are
detected in the third stage).

  * •

the third stage, Trigger Detection, provides multiple options for a trigger
detection method, identifying the time stamps of state transitions (upward or
downward trigger) in each channel as an indicator for the possible passage of
a wavefront. In the following, only upward transitions are considered as
triggers. Since the logMUA signal shows sharp state transitions, they are best
detected by a threshold determined from a channel-wise fit of the amplitude
distributions (as in [117]). Conversely, the transitions in the imaging data
are determined by the slow activation function of the fluorescent indicators.
Therefore, they are better detected by identifying the upwards slopes by
either the Hilbert phase signal crossing a specific value (here $-\pi/2$) or
by the local minima preceding a dominant peak (see Section 4.2.3). In the
following, we use the trigger detection via the Hilbert phase, however, we
focus on the quantitatively comparison of the two methods in Section 2.4. The
output of stage 3 is a series of trigger events that is stored alongside the
signals in the output data object.

  * •

Within the fourth stage Wave Detection, the channel-wise trigger times are
grouped to define the individual waves (see Section 4.2.4). This wave
representation as a collection of local upward transition times is optionally
enriched with additional descriptions such as the optical flow Section 4.2.5
and the critical points of the resulting vector field [176] or an additional
clustering of the waves into modes, based on the spatial arrangement of the
trigger delays.

  * •

The final stage, Wave Characterization, applies a series of quantitative
characterizations on the basis of the common and measurement-independent slow
wave description generated by the previous stages. The selection of
characterization metrics can be tailored toward addressing specific scientific
questions or research objectives. To have a consistent output format for this
stage, there are two distinct realizations for the fifth stage: one for a wave
characterization using wave-wise measures, e.g., determining one velocity
value per wave; and another for a characterization using channel-wise
measures, e.g., calculating local velocity values per channel and wave. For
simplicity, these alternatives are presented together in Figure 3A.

Figure 3: Pipeline illustration. This figure shows the progression of two test
datasets (ECoG in blue, wide-field calcium imaging in green, see Section 4.1)
through the analysis pipeline. A: The five successive stages contain a
collection of modular blocks in three different selection modes (fixed, choose
one, choose any). The analysis path is adaptable for specific datasets and
analyses by selecting the desired blocks (indicated by colored dots for the
test datasets) and by setting the corresponding parameters in the config file.
Where reasonable, blocks either trigger the execution of a plotting block to
illustrate the intermediate result or produce a plot as an additional output.
B: The intermediate results after each stage are visualized for the two test
datasets as color-coded signal on the electrode/pixel grid covering most of
the right hemisphere of the mouse brain (up=anterior, right=lateral) with the
ECoG grid spanning $4.95\times 2.75$ mm and calcium imaging $5\times 5$ mm.
From left to right, they show the analysis process from loading the raw data,
processing the signal, detecting upward transitions (black marker), grouping
them into wavefronts (red marker) together with their optical flow (arrows),
to the example result of quantifying the linear flow alignment within the
waves (i.e., planarity).

To demonstrate the capabilities of the pipeline approach to generate
meaningful quantification of slow-wave phenomena, we choose four metrics as
the basis for cross-dataset comparisons: the local (i.e., channel-wise) inter-
wave interval, velocity, and direction measures; and the global (i.e., wave-
wise) planarity measure. The inter-wave interval is defined as the time delay
between the occurrence of two consecutive waves at a recording site. The
channel-wise velocity $v$ is calculated from the derivatives of the delay
function of a wave $T(x,y)$, which indicates when a wave has reached the
position $(x,y)$ in its propagation [129, 107, 150]:

$v_{x,y}=\sqrt{\frac{1}{\partial_{x}T^{2}+\partial_{y}T^{2}}}$ (1)

The channel-wise direction of wave propagation can also be directly derived
from the time delay function $T(x,y)$. However, in the following, we use the
optical flow of the phase signal (see Section 4.2.5 for details). The optical
flow is a continuous vector-valued signal for each position $(x,y)$,
indicating in which directions the contour lines of equal phase propagate. We
define the channel-wise wave directions of a propagating wave as the optical
flow vector directions at the time and position of its trigger events. The
planarity $P$ of a wave is also defined via the optical flow as the absolute
value of the normalized channel-wise direction vectors at the times and
positions of all trigger events that belong to a wave, quantifying their
alignment on a scale from $0$ to $1$:

$P=\frac{||\sum\vec{v_{i}}||}{\sum||\vec{v_{i}}||}$ (2)

For one of the calcium imaging recordings, Figure 4 presents some of the
measures in the pipeline output, i.e., a table (pandas dataframe [142])
containing all wave characteristics. The channel-wise and wave-wise measured
directions and velocities, as well as the wave-wise planarities, are
summarized for 4 groups of similar waves, i.e., "wave modes". The wave-mode
clustering method (implemented as an optional block in stage 4 of the
pipeline) applies a k-means clustering on the trigger delay matrix containing
the relative trigger times for each channel in each wave [158, 107, 150]. The
number of modes was set by hand to reasonably represent the variability of
wave types in the recording. Generally, the ’optimal’ number of modes to set
for the k-means algorithm depends on recording and the analysis application.
For the presented recording, most waves are relatively planar and travel along
the lateral-posterior-to-medial-anterior axis (modes #2 and #4), mode #1 is a
variation of mode #4 with a lower average velocity, and mode #3 contains only
one wave that seems to be a collision of two opposing wavefronts. Although the
channel-wise and wave-wise measures for the direction and velocity (Figure
4B,D) are defined and calculated in a completely different way, they agree
considerably well for the modes #1, #2, and #4 when the wave pattern is
predominantly planar. The complex wave pattern of mode #3 can not be
accurately captured by a single wave-wise value for the direction and
velocity, resulting in the presented deviations. Otherwise, the different
measures provide a coherent characterization of each wave mode. In the
following, we only use channel-wise measures for the analyses, with the
exception of the wave-wise planarity measure, which has no channel-wise
equivalent.

Figure 4: Representation of the pipeline output for one exemplary wide-field
calcium imaging recording. Within the pipeline, the optional block
wave_mode_clustering groups together similar waves into wave modes. The
characterization of the waves in each of the 4 modes is shown in the
corresponding columns (in no specific order). A: The average wave pattern
(number of waves indicated on top) is illustrated as a time-delay heatmap with
iso-delay contours. B: The aggregated histogram of channel-wise directions in
waves of this mode. The black lines indicate the average wave-wise direction
measure. C: Map of the average channel-wise velocities in waves of this mode,
overlayed with the average channel-wise direction determined via the optical
flow. D: The corresponding distributions of channel-wise velocities and, as
black ticks and errorbars, the average and $95\%$ CI of the corresponding
wave-wise velocities. E: The average and $95\%$ CI of the planarity values for
the waves of this mode. An analogous example figure for an ECoG recording is
shown in Appendix Figure 9.

###  2.3 Dataset comparisons quantify the variability of slow wave
characteristics

Based on the exemplary realization of the pipeline, we are now in a position
to perform quantitative comparisons of slow wave dynamics across the described
ECoG and wide-field calcium imaging datasets, contrasting various experimental
parameters. In the following, we demonstrate the application of the pipeline
to investigate the influences of the anesthetic type and dosage, the
application of disease models via genetic knock-out, and the measurement
technique itself, in particular, its spatial resolution.

To check the validity of the pipeline, we first qualitatively replicate some
of the results that were previously published using the same datasets. It has
been shown that the dynamics of slow waves crucially depend on the level of
anesthesia. While the velocity of waves tends to decrease slightly in deeper
anesthesia states [150], the inter-wave intervals become more prolonged, i.e.,
the frequency of waves decreases [150, 115]. The same trends are visible in
the corresponding pipeline output presented in Figure 5A. The velocity and
frequency of slow waves were also measured in the context of a disease model
for Williams-Beuren Syndrome (WBS) in knock-out (KO) condition and wild-type
(WT) (of the same genetic strain) [116, 161]. In both, the previous
publication and the pipeline output (Figure 5B), there is no major effect on
the wave characteristics visible except for a slight increase in the measures’
variances in the knock-out condition (Figure 5B). Including yet another
dataset from a similar experiment that models the Fragile-X Syndrome (FXS)
[160] allows us to expand the analysis across experiments. Looking only at the
wild-type control subjects, we can compare the influence of other experimental
parameters between the WBS and FXS experiments. A notable difference between
the two experimental setups is that in the WBS experiment, ketamine was used
as the anesthetic ($100$ mg/kg inducing + $37$ mg/kg maintaining), while the
FXS experiment used isoflurane ($4$ % inducing + $1$ % maintaining). Comparing
the distributions of wave propagation velocities for the wild-type mice shows
considerably larger velocities measured in the experiment that used isoflurane
and a larger range of inter-wave intervals for the experiment that used
ketamine (Figure 5B). In comparison to Figure 5A, where anesthesia was induced
with ketamine ($75$ mg/kg) but maintained with isoflurane ($0.1$-$1.16$ %), we
see a better agreement to the velocities in the WBS (ketamine) experiment than
to the FXS (isoflurane) experiment. However, comparing the exact depth of
anesthesia across different anaesthetics is generally difficult. Furthermore,
it is to be noted that since this is a meta-analysis, there is little control
for confounding parameters between the different datasets. So, the attribution
of the differences in wave characteristics to one parameter, here the
anesthetic type, has to take this into account.

Next, we are expanding the scope of the analysis and contrast the ECoG
recordings of ketamine- and isoflurane-anesthetized mice to analogous
recordings that use wide-field calcium imaging on anesthetized Thy1-GCaMP6f
mice to measure the cortical activity via the fluorescent response in
excitatory neurons [154, 155]. Figure 5C illustrates the distributions of wave
characteristics grouped by measurement technique and anesthetic type. A
principal difference between the measurement techniques is their spatial
resolution. The wide-field calcium imaging data has a resolution of $0.05$ mm
compared to $0.55$ mm for the ECoG data. The finer resolution allows for a
better distinction of complex non-planar wave patterns, as can be seen by the
broader planarity distribution that is shifted towards smaller planarity
values. Additionally, complex wave patterns with low planarity seem to be more
prevalent under isoflurane-induced anesthesia than with ketamine-induced
anesthesia, which can also be seen to a smaller extent in the ECoG recordings.
Furthermore, the detected waves in the calcium imaging data are more frequent
and regular, as shown by the inter-wave-interval distributions. Regarding the
wave velocity distributions, there is a notable discrepancy between the
measurement techniques for the isoflurane datasets, while the velocities for
the ketamine dataset are quite similar. This considerable difference in wave
velocities is likely related to a difference in the isoflurane concentration
($1\%$ in ECoG and $1.5-2\%$ in calcium imaging recordings), as even small
differences in the concentration can have a considerable effect on the wave
dynamics (cf. Figure 5A,B). The slow waves we detect with the pipeline tend to
propagate along a preferred axis and primarily in one direction. This axis
seems to be approximately consistent within the data of each measurement
technique but not across. In the ECoG data, the preferred propagation axis
spans from posterior-medial to anterior-lateral, with the preferred direction
being different for the isoflurane and ketamine datasets. In the wide-field
calcium imaging data, the preferred wave direction is from posterior-lateral
to anterior-medial. Wave propagations being principally oriented in a back-to-
front or front-to-back manner is also reported in previous studies [162, 138,
147, 158, 166, 129, 150]. The spread of the wave direction histogram around
the preferred directions can be either caused by a variance of channel-wise
directions between waves or within waves, e.g., low-planarity waves have, per
definition, a broader spread of channel-wise directions.

To further investigate the observed differences in the wave characteristics
between the ECoG and calcium imaging data, we eliminate the aspect of their
different spatial resolution by spatially downsampling the calcium imaging
data. By downsampling in a stepwise manner up to a downsampling factor of
$11$, for which the spatial resolution is then equal to the one of ECoG
($0.55$ mm), we can disentangle the effects the resolution has on the measured
wave characteristics. Figure 5D shows how the distributions of wave
characteristics change as a function of the downsampling factor. With a
decreasing spatial resolution, fewer waves are detected, and they appear more
planar as some complex local patterns are no longer detected. This effect is
particularly obvious for the isoflurane datasets. A similar effect on the
probability of detecting a planar wave as a function of ROI size has been
previously shown by [137]. As mentioned before, there are relationships
between the planarity of a wave and the corresponding measured channel-wise
velocities and directions. The fact that the direction histogram of the
downsampled calcium imaging data is more narrow indicates that the propagation
directions are consistent across waves, and the variances observed in Figure
5C are caused mainly by non-planarity. With increasing planarity, in
particular, the waves in the isoflurane datasets also exhibit faster channel-
wise velocities that surpass the ketamine wave velocities, as is also visible
in the ECoG data.

So, we demonstrate how the adaptable pipeline approach enables the comparison
of slow wave characteristics across heterogenous datasets, including
electrical and optical acquisition methods. This meta-analysis illustrates
distinct differences within the aggregated data and potential dependencies on
the experimental parameters to be further investigated.

Figure 5: Quantitative comparison of slow waves across heterogeneous datasets.
Violin plots show sample distributions with indications of the median (dashed
line) and the quartiles (dotted lines). Line plots also show the median and
quartiles (shaded areas). Polar plots show the distributions of wave
directions in the right hemisphere so that up corresponds to an anterior
direction and right to a lateral direction. A: Velocity and inter-wave
intervals of slow waves in ECoG recordings as a function of the anesthesia
level. B: Velocity and inter-wave intervals of slow waves in ECoG recordings
of experiments modeling Willems-Beuren Syndrome (WBS) and Fragile-X Syndrome
(FXS) split into wild-type (WT, blue) and knock-out (KO, green) subjects. C:
The ECoG data from panel B is compared to calcium imaging data, split into
anesthetic types, concerning wave velocities, inter-wave intervals, wave
planarity, and wave direction. D: Effect of stepwise spatially downsampling
the calcium imaging data from $0.05$ mm (factor 1) to $0.55$ mm (factor 11),
the spatial resolution of the ECoG data. The wave direction histograms are
only shown for the fully downsampled data (with factor 11).

###  2.4 Interchangeable method blocks enable benchmarking tests

While applying the same analysis method to different data enables rigorous
comparisons, applying different methods to the same data allows investigating
the influence of the choice of the method itself. In the analysis of slow
waves, the method for detecting the transitions from Down to Up states plays
an important role. So far, in the calcium imaging data, we detected the
trigger times at the upstroke of the transitions as the Hilbert phase of the
signal crossing a threshold value of $-\frac{\pi}{2}$ (Section 4.2.3).
However, there also exist alternative methods to define potential trigger
times, such as using the local minima of the filtered signal, for example,
done in [108]. Figure 6 illustrates the influences the two different detection
methods have on the resulting wave characteristics. Realizing this method-
benchmarking workflow with our pipeline only requires selecting the
corresponding detection block in the config file of the wave detection stage
and to rerun the analysis on the calcium imaging data. As shown in Figure 6A,
the resulting triggers differ clearly in number and exact timing, influencing
the timing and number of detected waves. As a result, the representation of
individual waves can differ to varying degrees (see an example in Figure 6B).
Nevertheless, the overall distributions of wave characteristics remain very
similar (Figure 6C). The slightly shorter inter-wave intervals for the minima-
detected waves can be attributed to the increased number of detected waves.

This method comparison allows us to evaluate the strength of each way of
detecting upward transitions and check for potential biases introduced in the
wave characterization. The minima detection method is less strict and
therefore detects more waves, including some smaller local ones. The Hilbert-
phase method detects fewer waves, which are, however, better separated and
more coherent across channels. Thus, we see that finding slow waves in
different use cases is also a matter of applying the appropriate methods while
being aware of their advantages and disadvantages. For a more extensive method
comparison, including specific edge cases, this approach can be further
combined with simulated data.

Figure 6: Comparison of trigger detection methods in calcium imaging data. A:
Upward transitions (triggers, black vertical lines) found by two different
detection algorithms, looking for either local minima or a crossing of the
Hilbert phase $=-\pi/2$, in an example signal taken from the black-colored
pixel indicated in panel B. B: The same exemplary wave (corresponding to the
last trigger in panel A) illustrated over the recorded area as detected using
the two trigger detection algorithms. The arrows indicate the local direction
of the wavefront at the time of the trigger, which is also encoded as the
color of the arrow. C: The distributions of the comparative characteristics of
the resulting waves with the two different methods in the calcium imaging
datasets.

##  3 Discussion

###  3.1 Benefits of enhancing rigor in analysis implementations

The use-case-specific slow wave analysis illustrates the benefits of a
structured, modular pipeline approach. These benefits, however, are not
limited to slow wave analyses but can contribute generally relevant aspects to
rigorous data analysis procedures. So, the pipeline features built-in
mechanisms (largely due to the use of snakemake) to retain information about
the analysis scripts, their execution order, and parameter settings. The stage
and block documentation and the visualization of their respective outcomes
help to follow the workflow in detail to redo the analysis, but also to check
results and increase confidence in the findings. By further aligning the
workflows for different datasets within the pipeline using the same or
analogous analysis methods (while still catering to their diverse processing
demands), the individual results become more comparable. This does not mean
that the results are expected to be the same, but by controlling the
variations in the analysis workflow, the remaining differences (measurement
techniques, species, anesthetics, etc.) can be reasonably evaluated and
quantified. The flexibility to deal with the input of very different datasets
also trivially extends to simulated data. Therefore, the pipeline design also
provides a basis for the validation testing of models. The modularity that
enables the pipeline to be adapted to different datasets also brings the
additional advantage that the individual analysis steps become interchangeable
and can thus be evaluated on their own. Analyzing the same dataset with such
an adapted pipeline lets us test the influence of a method on the downstream
results. Eventually, the gain of such a pipeline design extends even further
as all its elements work as well as standalone components and can be reused
for other pipeline or non-pipeline applications. Finally, the goal is not to
fully automate data analyses but to provide a tool base to make the creation
of analysis workflows more efficient, rigorous, and reproducible. No software
can replace a thoughtful scientist, but the right software can give a
scientist more room to think.

###  3.2 How a structured analysis pipeline can contribute to progressing the
study of slow waves

The presented meta-analysis across heterogenous datasets comprises ECoG and
wide-field calcium imaging recordings (Figure 5). These measurement techniques
are known to result in fundamentally different signals. While ECoG tends to
record only the spiking activity of neurons in the superficial layer with a
high firing rate and a high signal-to-noise ratio with high temporal and low
spatial resolution, wide-field imaging of GCaMP6f in Thy1-GCaMP6f mice
measures population spiking activity from excitatory neurons in layers 2/3 and
5 as a delayed, low-pass filtered, non-linearly transformed fluorescence
signal with low temporal and high spatial resolution [168, 167, 118].
Therefore, even elaborate models can’t fully capture all aspects of their
complex relationship, and there is generally no precise agreement between
results derived from the two measurements beyond coarse qualitative measures
[182, Chen2013_295b, 173]. In this context, our analysis pipeline can
quantitatively illustrate the differences in the measurement types regarding
the characteristics of slow wave activity. For analyzing wave characteristics,
it is of particular interest from which cortical layer the measurement
technique samples the recorded neurons since aspects like frequency power or
propagation speed are known to vary considerably with cortical depth [131,
107]. Taking these considerations into account, an integrative approach of
using multiple measurement techniques may benefit from the complementing
viewpoints that, for example, ECoG and calcium imaging can provide.

Besides the biases of the measurement technique and its resolution, we further
present the influences of the anesthetic type and dosage on the wave
characteristics, showing in particular that ketamine tends to produce more
planar waves than isoflurane, in turn also influencing the measured directions
and velocities. This effect is likely linked to the known attributes of the
anesthetics, that ketamine is more effective in generating slow-wave activity
as it increases LFP power in the delta frequency band while isoflurane rather
enhances LFP activity in the theta band and above [143, 152].

The need to quantitatively relate results from the literature to each other
becomes quite apparent when, for example, investigating the sources of
variance of the velocity of slow waves, which can vary from a few mm/s in in-
vitro measurements and in-vivo recordings of anesthetized rodents up to $\sim
10$ m/s in human sleep experiments [138, 158, 146]. Studied influences to this
variability include the extent of axonal projections [126, 112, 138], axonal
conductances [158], involved cell types [97], and neuronal excitability
depending on anesthetics [150], neuromodulators [121], or cortico-cortical or
cortico-thalamic loops [162, Mohajerani2013_1426a]. Furthermore, the velocity
of a wave may depend on its direction, which in turn is influenced by an
interplay of local and global connectivity properties and frequency effects
[122, Mohajerani2013_1426a, 138]. Comparison between data from different
studies can help relate and discern such influences.

While the exploration of wave characteristics under different conditions can
provide further insight into the understanding of the underlying processes,
experimental data can also suffer from constraints in the data size, parameter
regime, and uncontrolled confounds. Therefore, in many scenarios, it is
crucial to be able also to include modeling data in the analysis. The
following subsection discusses a use-case where the adaptability of the
pipeline to simulation output is exploited in the context of model
calibration.

###  3.3 Integration in model development and data-driven simulations

Applying the Collaborative Brain Wave Analysis Pipeline to experimental data
enables the extraction of key spatio-temporal characteristics of slow waves
acquired with multiple experimental methodologies at local and multi-areal
spatial resolution. These insights are, of course, beneficial to modelers as
they can inform the model development process and offer new approaches to
exploit data to introduce complexity and biological realism in the models.
However, the pipeline can also be directly applied to simulation outcomes to
extract the same characteristics as from the experimental data and perform a
quantitative comparison in a subsequent validation step. Furthermore, a
similar step can already be integrated into the model development in the form
of an explicit calibration. One purpose of this procedure might be to find the
best model describing a specific dataset. This is the strategy considered in
[103] where, after a preliminary estimation of model parameters through
likelihood maximization [104], a subset of these is further adjusted by
performing a grid exploration relying on the direct comparison between data
and simulations. The comparisons in [103] are derived from the selection of
observables described here, considering the waves’ local velocities,
directions, and frequencies. This calibration approach allowed for a meta-
inference procedure, finding the optimal parameters of a neuromodulation
current to reproduce the dynamics observed in experimental data. Such an
approach is essential to complement the theoretical understanding of the
relationship between the spatio-temporal features of cortical waves and the
cortical structure [105].

###  3.4 Re-usability: related pipelines and outlook

As the pipeline is built up in a modular fashion, there are multiple levels of
reusability. The simplest is to use the adaptability via the config files to
change the selection, order, or parameters of blocks to modify the pipeline
execution. For larger, more specific changes to the pipeline, new blocks can
be added, for example, to integrate a new dataset or to carry out data
analysis focused on other observables. For this, the pipeline repository
provides corresponding templates and instructions. There is no principal
restriction of types of data: as long as it conforms to the minimum
requirements (e.g., an electrode/pixel layout on a grid), the pipeline may be
applied on EEG, LFP, or even spiking data. While both blocks and stages are
designed to also work as stand-alone analysis snippets in other workflows,
most notably, the pipeline design allows deriving new analysis pipelines for
other applications. For example, current work entails the development of a
pipeline realization that focuses rather on the local oscillations of multi-
unit activity signals between Up and Down states, i.e., ignoring the spatial
propagation, similar to work done in [117]. The goal of this Slow Oscillation
Analysis Pipeline (SOAP) is to complement the output of the Cobrawap with more
detailed local information. The structure of the SOAP reuses the first three
stages of the Cobrawap and then branches off with specialized stages. Another
envisioned pipeline derivation will focus on data that shows oscillations as a
result of electrical stimulation to quantify response complexity by a
perturbation-complexity index (PCI). Yet another effort is pursued to also
analyze the characteristics of wave-like phenomena in other frequency regimes.
For example, in alpha, beta, and gamma frequency ranges, diverse and complex
wave patterns have been observed in various experiments of awake behaving
animals [96, 176, Denker2018_1, 183, 165, 151]. A pipeline approach similar to
the Cobrawap may disentangle and align some of the various reported results,
methods, and terminologies.

###  3.5 Conclusion

In this paper, we show how formalizing analysis approaches can have
miscellaneous advantages. By taking a data-science perspective, we work
towards integrating heterogeneous insights from different data and analysis
types. Furthermore, we experienced how structuring our methodology and
implementation also contributed greatly to our structure of thought. We are
confident that this work pushes forward the requirement of reusability for
analysis resources and succeeds in promoting making use of and contributing to
community software projects (like Elephant, Neo, Nix, Snakemake, and many
more). Because in the end, the scientific community is more efficient when
everyone can directly benefit and build on each other’s work and can
rigorously compare their results without re-implementing the wheel.

##  4 Materials and methods

###  4.1 Experimental model and subject details

An overview of all the individual recordings is presented in Appendix Figure
8.

####  4.1.1 Mouse ECoG recordings

The three experimental ECoG datasets have been provided by IDIBAPS (Institut
d’Investigacions Biomèdiques Agustí Pi i Sunyer): Williams Beuren Syndrome
(WBS) 3-4 months old adult male mice (Wild-Type and Knock-Out), Fragile X
Syndrome (FXS) (Wild-Type and Knock-Out) mice and Propagation Modes of
Cortical Slow Waves across anesthesia levels in adult male C57BL/6J mice
(PMSW). All animals were bred in-house at the University of Barcelona and kept
under a $12$ h light/dark cycle with food and water ad libitum. All procedures
were approved by the Ethics Committee at the Hospital Clínic of Barcelona and
were carried out to the standards laid down in Spanish regulatory laws
(BOE-A-2013-6271) and European Communities Directive (2010/63/EU).

For WBS subjects, an intraperitoneal injection of ketamine ($100$ mg/kg) and
medetomidine ($1.3$ mg/kg) was administered to induce anesthesia. It was
maintained by a constant administration of subcutaneous ketamine ($37$
mg/kg/h). For FXS subjects, anesthesia was induced by the inhalation of $4$%
isofluorane in $100$% oxygen for induction and $1$% for maintenance. Finally,
for PMSW subjects, an intraperitoneal injection of ketamine ($75$ mg/kg) and
medetomidine ($1.3$ mg/kg) and maintained by the inhalation of different
concentrations of isoflurane in pure oxygen. In PMSW, three levels of
anesthesia were reached that were classified according to the provided
isoflurane concentrations: deep=$1.16\pm 0.08\%$ (s.e.m); medium=$0.34\pm
0.06\%$; light=$0.1\pm 0.0\%$. The volume delivered was $0.8$ L/min.

In order to avoid respiratory secretions and edema, atropine ($0.3$ mg/kg),
methylprednisolone ($30$ mg/kg), and mannitol ($0.5$ g/kg) were administered
subcutaneously to all subjects. So as to aid breathing and once in the
surgical plane of anesthesia, a tracheotomy was performed. The animal was then
placed on a stereotaxic frame (SR-6M, Narishige, Japan) with constant body
temperature monitoring maintained at $37^{\circ}$C by means of a thermal
blanket (RWD Life Science, China). A wide craniotomy and durotomy were
performed over the left or right (only left in FXS) hemisphere from -$3.0$ mm
to +$3.0$ mm relative to the bregma and +$3.0$ mm relative to the midline. A
32-channel multielectrode array ($550\leavevmode\nobreak\ \mu$m spacing)
covering a large part of the hemisphere’s surface was used to record the
extracellular micro-electrocorticogram (micro-ECoG) activity. For WBS and FXS
datasets, recordings were acquired from spontaneous activity in the animal
under anesthesia. Regarding the PMSW dataset, each anesthesia level was
maintained for $20$–$30$ minutes, and spontaneous recordings were consistently
obtained in a stable slow oscillatory regime (approximately $10$ minutes after
the change in concentration). During the recording protocol, a precise visual
inspection of all channels was made in order to ensure that all of them were
properly acquiring the signal.

The signals were amplified (Multichannel Systems, GmbH), digitized at $5$ kHz,
and fed into a computer via a digitizer interface (CED 1401 and Spike2
software, Cambridge Electronic Design, UK).

####  4.1.2 Mouse wide-field calcium imaging recordings

Experimental data acquired from mice have been provided by LENS (European
Laboratory for Non-Linear Spectroscopy333LENS Home Page,
http://www.lens.unifi.it (accessed on Nov. 2019)) and by the Department of
Physics and Astronomy of the University of Florence. All procedures involving
mice were performed in accordance with the rules of the Italian Minister of
Health (Protocol Number 183/2016-PR). Mice were housed in clear plastic
enriched cages under a $12$ h light/dark cycle and were given ad libitum
access to water and food.

Mouse Model: The transgenic mouse line used is the
C57BL/6J-Tg(Thy1GCaMP6f)GP5.17Dkim/J (referred to as GCaMP6f mice444For more
details, see The Jackson Laboratory, Thy1-GCaMP6f,
https://www.jax.org/strain/025393 (accessed on Nov. 2019).) from Jackson
Laboratories (Bar Harbor, Maine USA). In this mouse model, the ultra-sensitive
calcium indicator (GCaMP6f) is selectively expressed in excitatory neurons
[110, 114].

Surgery and wide-field imaging: Surgery procedures and imaging protocols were
performed as described in [108]. Briefly, 6 months old male mice are
anesthetized with either a mix of ketamine and Xylazine in doses of $100$
mg/kg and $10$ mg/kg respectively or isoflurane ($3-4\%$ induction and
$1.5-2\%$ maintaining). To obtain optical access to neuronal activity over the
right hemisphere, the local anesthetic lidocaine ($20$ mg/mL) was applied and
the skin and the periosteum over the skull were removed. Wide-field imaging
was performed right after the surgical procedure. GCaMP6f fluorescence imaging
was performed with a $505$ nm LED light (M505L3 Thorlabs, New Jersey, United
States) deflected by a dichroic filter (DC FF 495-DI02 Semrock, Rochester, New
York, USA) on the objective (2.5x EC Plan Neofluar, NA 0.085, Carl Zeiss
Microscopy, Oberkochen, Germany). The fluorescence signal was selected by a
band-pass filter (525/50 Semrock, Rochester, New York, USA) and collected on
the sensor of a high-speed complementary metal-oxide semiconductor (CMOS)
camera (Orca Flash 4.0 Hamamatsu Photonics, NJ, USA).

###  4.2 Method details

####  4.2.1 Design of the analysis pipeline

##### Code development

The implementation of the general "Collaborative Brain Wave Analysis pipeline"
(Cobrawap) infrastructure is being developed on
GitHub555https://github.com/INM-6/cobrawap.

##### Terminology

We organize the analysis pipeline hierarchically into three layers. The top
layer constitutes the pipeline itself or a task-specific realization of a
pipeline, which we here call workflow. A pipeline we define as a sequence of
processing/analysis stages to be executed following a given order (“from left
to right”). As a stage we describe a self-consistent logical episode within
the analysis process, such that the output of a stage can be considered a
reasonable intermediate result. Furthermore, a stage should be general enough
to be reusable in multiple workflows or pipelines. Each stage is segmented
into blocks, which can be selected and rearranged depending on the
configurations of the user and the mechanics of the stage. A block is the
smallest unit of the analysis pipeline and performs a specific action on the
data. Blocks implement methods. In the case of alternative methods or
alternative algorithms implementing a method, they can be either represented
as options of a single block or separate blocks. The related terms “action”,
“step”, “method”, and “algorithm”, we use without special definition in their
common sense.

##### Implementation with snakemake

We designed the structure of the pipelines having in mind the features of the
Snakemake workflow management framework [145]. The rules are defined in script
files called snakefile which also link to a config file. Thus, our pipeline
structure is conveniently mappable onto the snakemake elements: blocks are
represented by rules and stages by snakefiles. In addition, we use another
top-level snakefile to combine the stages as snakemake subworkflows and make
the pipeline executable as a whole. Within the stage Snakefiles, each block is
represented by a snakemake rule which in most cases executes a Python script.
Furthermore, we expand the standard functionality of snakemake by three
mechanics required by our pipeline design: 1) chaining the stages by linking
the outputs and inputs of subworkflows, 2) manually selecting a specific block
(i.e., method) or a sequence of blocks by choosing the desired methods in a
config file, and 3) selecting and switching between sets of configs files
("profiles") for all stages. More details of the pipeline implementation are
further explained in Section 4.2.1.

##### Modularity

One of the main design principles in constructing the analysis pipeline is
modularity. This has the purpose of making the pipeline flexible and thus
adaptable to different demands, by making it possible to rearrange and switch
elements of the pipeline. In contrast to other typical analysis workflows,
here, the construction of a specific workflow does not require the changing of
any scripts but is rather like tracing a path along the selected stages and
blocks within a larger framework offered by the pipeline. Practically, for the
stages, this means that different combinations or variations of stages can be
chained together. For the selection blocks, there are two flavors of
modularity used in the stages: choose one, selecting one method block from
multiple options; and choose any, selecting any number of method blocks in any
order (see Figure 3). Another aspect of modularity is that each element should
be usable on its own as well as in combination with other elements. Therefore,
much care needs to be put into managing the respective interfaces where the
elements interact.

##### Pipeline stages

For the analysis of slow wave activity, we chose five stages (Figure 3)
starting from more generic stages (Data Entry, Processing) to task-specific
stages (Trigger Detection, Wave Detection, Wave Characterization) which build
up the Collaborative Brain Wave Analysis Pipeline (Cobrawap):

  1. 1

Data Entry: This first stage loads a dataset and the required and optional
metadata and converts the data into a standardized representation scheme
(using the Neo data format). This loading script is the only custom code that
is required to add a new data source to the pipeline, integrating information
from a data file and a corresponding config file. It is checked whether the
resulting data object conforms with the requirements of the pipeline and an
overview of a data sample is plotted.

  2. 2

Processing: In the second stage, the data is prepared for analysis. The user
can select any combination of processing blocks to fit the data type and their
analysis objectives. Where available, the blocks use standard function
implementations by the Elephant Electrophysiology Analysis Toolkit
[Denker2018_a], the stack of scientific Python packages (i.e. scipy, scikit,
etc.), or algorithms from the literature.

  3. 3

Trigger Detection: Based on the processed data, this stage detects the
transition times from Down to Up states (upward transitions, i.e., trigger)
and, if possible, Up to Down states (downward transitions) by applying one of
the available trigger detection blocks. What this trigger exactly relates to
depends on the dataset, the processing, and the detection method.
Additionally, there are optional filter blocks that can be applied to clean
the collection of detected triggers. The trigger collection is added as a
neo.Event named ’transitions’ to the input Neo object containing the processed
data. This stage is general enough to also be of use for the analysis of other
wave-like activity, beyond slow waves.

  4. 4

Wave Detection: Latest at this stage, the wave description converges to a
common level. The selected detection method operates on the trigger times,
grouping them into individual wavefronts while being completely agnostic about
the type and origin of the original data. The resulting groups of triggers,
i.e. waves, are added as another neo.Event named ’wavefronts’. Optionally, any
number of additional wave descriptions can be calculated and added to the neo
object, including the optical flow vector field or a wave-mode clustering.

  5. 5a

Wave-wise Characterization: The final stage calculates one or multiple
characteristic measure(s) of the detected waves. This contains scalar measures
as, for example, the wave velocity or its duration, but may also contain
metadata information like analysis parameters or information about the dataset
added in stage 1 (selected via the annotations block). The output is a pandas
dataframe [142] where each row represents one wave and each column an
attribute/characteristic. This pipeline output for one dataset can be directly
merged or compared with the output for other datasets and serves as the basis
for various cross-domain comparisons (e.g., data comparisons, model
validation, method benchmarking).

  6. 5b

Channel-wise Characterization: This alternative final stage is equivalent to
the ’Wave-wise Characterization’ in its functionality, but its characteristic
measures are calculated per wave and channel (i.e. electrode or pixel).
Therefore, in the output dataframe, one row represents one channel for one
wave. For either of the two options for the final stage, the characterization
can also optionally be performed only on the wave modes instead of on each
wave.

Figure 7: Pipeline structure. The diagrams show the execution order of the
blocks for each stage (plus the full pipeline) as generated by the snakemake
workflow management framework [145]. Blocks that are specific for the ECoG
data are shown in blue, and blocks specific for calcium imaging in green,
while common blocks are grey. In stage 5, dashed blocks are wave-wise measures
and dotted blocks are channel-wise measures. Next to the blocks, the
parameters are indicated that can be set in the corresponding config files.

##### Data and metadata representation

When designing a pipeline with the objective of modularity and generality, it
is of crucial importance to properly define the interfaces between the
individual analysis elements (blocks, stages) as well as to the user and other
tools. This entails the representation of the data and metadata in a
standardized format. For this, we chose the data format Neo [123]. Neo
supports a variety of data types and reading and writing of various common
file formats. This interoperability is, thus, ideal for aiding the flexible
use of the pipeline. Since Neo itself is very versatile, there are multiple
ways how to organize the data and metadata in the Neo structure, so we need to
be even more precise in standardizing the data structure. That means that
within the pipeline we store the data of all channels in one
‘neo.AnalogSignal‘ object and the metadata in the corresponding annotations
and array annotations for channel-wise metadata (like their x and y
coordinates). Processing and transformation blocks overwrite the data in this
Analogsignal object and add corresponding metadata. In stages 3 and 4,
additional ‘neo.Event‘ objects may be added to represent transition times and
wavefronts as well as an additional AnalogSignal object for derived vector
fields (e.g., the optical flow). The file format to use for storing the
intermediate results of blocks and stages can be format supported by Neo. We
recommend Nix [172] for a robust file format, or the pickle or numpy for a
less robust format that is, however, faster to read and write and produces
smaller files.

The entire first stage is dedicated to being the interface between the
pipeline and the data resource. It checks whether the data has the required
capabilities and then organizes data and metadata into the Neo structure. For
the analysis of slow waves with this pipeline, the data needs to be obtained
from electrodes or pixels that are arranged on a rectangular grid (which may
include empty sites), and that exhibit propagating Up states. The
corresponding minimal set of metadata required for the pipeline to process the
data are i) the sampling rate, ii) the distance between the electrodes/pixels,
iii) and their relative spatial locations of the grid as integer x and y
coordinates. Although not explicitly used, it is strongly recommended to
include more information such as the measured cortical location, the spatial
scale of the grid, the units of the signal, the type and dosage of the
anesthetic, an identifier of the dataset, etc. This additional metadata is
propagated through the pipeline alongside the data in order to reasonably use
and interpret the results.

##### Pipeline interfaces

This degree of flexibility in the execution order of both stages and blocks is
based on standardizing the input and output formats. By defining the input
requirements for each stage and block, they can successfully interact while
remaining interchangeable and thus reusable for other pipelines or
applications. Since the individual stages are designed to be potentially
reused in other pipelines, the stage outputs, i.e. the intermediate results,
should suffice to the same level of completeness and documentation as a final
result. Thus, also each stage needs to come with a detailed definition of its
input and output structure which is checked by a dedicated ’check_input’
block. These definitions are collected in the stage’s README file to guide
developers of alternative pipelines as well as contributors of new blocks for
the stage. Similarly, the individual blocks are also thought to serve the
modular design by being easy to reuse and recombine, or even used as a
standalone application. Therefore, they also need to clearly state the type
and format of their in- and outputs. Other than for the stages, this is
largely handled organically in form of the dependencies of the corresponding
snakemake rule and the definition of the script’s command line arguments and
complemented by its docstring.

##### Logging and intermediate results

The modular organization of the pipeline facilitates maintainability, and
additional built-in means, such as provenance tracking and storing
intermediate results alongside their config files, further support
reproducibility, and transparency. Moreover, we emphasize the integration of
automatically generated plots of intermediate results. Most blocks produce a
plot illustrating their function to make the evolution of the results (or
potential bugs) visible. To further enable the provenance of the analysis
results, snakemake provides logs and reports which contain execution
statistics, dependency trees, plots, and config settings. Additionally, we are
currently working on integrating a formalized provenance tracking with
fairgraph666https://pypi.org/project/fairgraph/.

##### Pipeline configuration

The flip side of flexibility and adaptability is complexity and ambiguity. The
many combinatorial possibilities need to be controlled by a user interface
separate from the actual analysis scripts, e.g., what stages and blocks should
be executed, in which order, and with which parameters. Config files (e.g., in
csv, yaml, json format) offer human-readable access and control to a user to
adapt and execute different variations of the pipeline. Thus, we assign one
config file to each stage. Consequently, blocks need to be implemented having
generality in mind with any specification handled by corresponding parameters
settings, given as command line arguments, i.e. within the pipeline via the
config file. Even though this approach is initially more time-consuming, it
does pay off in both the quality of the method implementation and its
(re-)usability. Furthermore, the availability and aggregation of parameters
allow for easier and more transparent calibration of the pipeline across
blocks and stages. Additionally, there is a top-level config file for the
entire pipeline that specifies the stages and their order and can define
global parameters that may also overwrite stage parameters, e.g., for setting
the file format or plotting parameters for all stages. Parameters in the
config files are typically calibrated for a specific data type or experiment
setup. To conveniently switch between calibration presets, the pipeline
supports a hierarchical organization of config presets via profiles. By
executing the pipeline with PROFILE=data1, for each stage the corresponding
config file config_data1.yaml is used. For more versatility, profile names can
use underscores to define subcategories and exceptions, e.g., data1_subject3.
In this case, each stage first looks if a corresponding config file of the
same name exists, and if not removes the subcategory with the last underscore
from the name, and repeats this lookup until it finds the named config file or
defaults to config.yaml. Furthermore, profiles can have variations indicated
in the name with a ’|’, e.g., data1_subject3|methodA. This variation key is
not removed when first looking up existing config files in the naming
hierarchy, only when config|methodA.yaml doesn’t exit it is removed and the
lookup loop is repeated.

####  4.2.2 LogMUA estimation (in stage 2)

The multi-unit activity (MUA) is an estimate of the local population firing
rate, based on the relative spectral power in the high-frequency regime
($200$-$1500$ Hz) of the extracellular recordings. [140, 153, 117] The
corresponding algorithm first selects a moving window that samples the
recording at a given rate. From these samples, the power spectral density
(PSD) is calculated using the Welch algorithm. The MUA is defined as the
average power in the defined frequency band divided by the average power of
the full spectrum. Using the logarithm of the MUA helps to emphasize further
the bi-modality of the distribution in the presence of slow oscillations. In
the selection of the parameters for the algorithm, it is crucial to choose a
moving window size large enough so that the chosen frequencies can be
accurately estimated
($\mathrm{window\;size}\leq\frac{1}{\mathrm{highpass\;frequency}}$) and a
corresponding MUA rate so that the full recording is sampled from
($\mathrm{MUA\;rate}<\frac{1}{\mathrm{window\;size}}$).

####  4.2.3 Trigger detection (in stage 3)

The pipeline implementation provides multiple options to detect trigger
events, i.e., transitions from a low activity state to a high activity state
(Up).

  * threshold:

The trigger events can either be defined by setting a threshold value for all
the signals or by fitting a bimodal function to the amplitude distribution for
each channel in order to set the threshold value. In the latter case, the
fitting function is the sum of two Gaussians and the threshold value is set to
the central minima. This option is applied to the ECoG datasets in this paper.
As an alternative to a double Gaussian fit, there is also the option to only
fit the first peak corresponding to the low activity state by only looking at
the data left of the peak and defining the threshold as
$\mathrm{mean}+\mathrm{std}\cdot\mathtt{SIGMA\\_FACTOR}$ with a user-defined
SIGMA_FACTOR. Since the thresholding method detects also the corresponding
downward transitions, this block is usually paired with an additional block
that removes Up and Down states that are too short, given user-defined minimal
Up and Down durations.

  * Hilbert phase:

Instead of detecting threshold crossings on the actual signal, the upstrokes
of the upward transitions can be detected by thresholding the phase signal of
the corresponding analytic signal. An adequate threshold value is a matter of
definition, here, we apply $-\pi/2$, which corresponds well to the beginning
of the upstroke in the actual signal. To be more robust, the algorithm only
selects time points where the threshold is crossed from smaller to larger
values and where the crossing is followed by a peak (phase $=0$). This option
is applied to the calcium imaging datasets in this paper unless otherwise
indicated.

  * minima:

As a third option, we adapted and improved the minima detection method
presented in [108]. This method relies on the assumption that in an adequately
filtered signal that the existence of a local minimum followed by a peak of a
certain height indicates the start of a upward transition. This is
particularly suitable for recording techniques characterized by a fast
characteristic rise time (i.e. comparable with the theoretical minimum time
interval between the passage of two waves on a single channel, e.g. optical
data). We improved this method by including some further refinement on trigger
candidates. Under the assumption that only one minima candidate can lie
between two "good" local maxima candidates, we impose that 1) local maxima
candidates need to have a signal intensity higher than a relative threshold
value, determined in a moving window; 2) local maxima candidates need to be
separated by a minimum distance (associated with the characteristic frequency
of the investigate phenomenon); 3) a local minima candidate needs to be
followed by a monotonically rising signal for a defined time interval (also
associated to the characteristic frequency of the investigated phenomenon). If
more than one candidate minimum is found between two local maxima candidates,
the last one before the following "good" maxima is selected.

####  4.2.4 Trigger clustering (in stage 4)

Wavefronts are defined as clusters of trigger times in the three-dimensional
space of the electrode arrangement (x,y) and samples in time (t). To run a
clustering algorithm in this space, the units of the time dimension need to be
translated to the units of the spatial dimensions. The ideal transformation
factor (TIME_SPACE_RATIO) depends on the expected dynamic of the phenomena. A
wave that propagates linearly with $v_{0}$ is best recognized in the cluster
when the time dimension is transformed by a factor
$v_{0}/(\mathrm{sampling\;rate}\times\mathrm{spatial\;scale})$. Thus, if we
expect a propagation velocity roughly in the order of $\sim 10-20\frac{mm}{s}$
then the transformation factor for the calcium imaging data with sampling rate
$25$ Hz and spatial scale $50\mu$m is $\sim 8-16\frac{pixel}{frame}$. Here, we
choose a TIME_SPACE_RATIO of $11$ for the calcium imaging data which scales
according to the spatial resolution to a factor of $0.25$ for the logMUA ECoG
data with a sampling rate of $100$ Hz. The clustering is performed by a
density-based algorithm (scipy.cluster.DBSCAN), illustrated in Appendix Figure
10. The additional parameters for this algorithm are the minimum number of
samples (MIN_SAMPLES_PER_WAVE) and the typical distance between neighboring
sample points (NEIGHBOUR_DISTANCE) and were determined by calibrating test
recordings from both calcium imaging and ECoG data and scaled consistently
with the spatial resolution.

####  4.2.5 Optical flow estimation (in stage 4)

The optical flow is the pattern of apparent motion in a visual scene, which
here corresponds to the recorded signal on the recording grid. To estimate the
optical flow of the spatial propagation of activation, we apply the Horn-
Schunck algorithm with a quadratic penalty function and a 3x3 Scharr
derivative filter on the phase of the signal (the alternative application
using the signal’s amplitude, as well as different derivative filters can be
selected via the configuration). Although other penalty functions, i.e., the
Charbonnier function, are more accurate, we found that here the simple
quadratic function is sufficient. This observation is in agreement with [176]
who report good results for the near quadratic edge case of the penalty
function. Their study also guided our choice of the parameter $\alpha=1.5$,
determining the weight of the smoothness constraint over the brightness
constancy constraint. The resulting vector field is smoothed by a Gaussian
kernel which reflects the dimensions of the expected wave activity with
respect to the spatial and temporal scale of the data.

###  4.3 Quantification and statistical analysis

####  4.3.1 Kernel estimation

The kernel estimations for the plotted distributions in Figure 5 and Figure 6
use scipy.gaussian_kde with the default Scott’s rule [163] as bandwidth
method, except for the distributions of inter-wave intervals which use $0.2$
times the standard deviation as the kernel size.

####  4.3.2 Velocity filter

Since the channel-wise velocity measure can produce unreasonably high values
when there are near identical time delays between spatially distant triggers,
we cap the presented distributions at $120$ mm/s.

###  4.4 Key resources table

Table 1: Key resources table

REAGENT or RESOURCE | SOURCE | IDENTIFIER |
---|---|---|---
Deposited data |  |  |
Mouse ECoG (WBS) | EBRAINS Knowledge Graph | 10.25493/DZWT-1T8 |
Mouse ECoG (FXS) | EBRAINS Knowledge Graph | 10.25493/ANF9-EG3 |
Mouse ECoG (Propagation modes) | EBRAINS Knowledge Graph | 10.25493/WKA8-Q4T |
Wide-field calcium imaging (ketamine) | EBRAINS Knowledge Graph | 10.25493/QFZK-FXS |
Wide-field calcium imaging (isoflurane) | EBRAINS Knowledge Graph | 10.25493/XJR8-QCA |
Experimental models: Organisms/strains |  |  |
Mus Musculus: C57BL/6J | IDIBAPS | RRID:IMSR_JAX:000664 |
Mus Musculus: Del(5Gtf2i-Fkbp6)1Vcam/Vcam (WBS-KO) | IDIBAPS |  |
Mus Musculus: ATJ/FVB.129P2-FMR1-mix (FXS-KO) | IDIBAPS |  |
Mus Musculus: C57BL/6J-Tg(Thy1-GCaMP6f)GP5.17Dkim/J | LENS | RRID:IMSR_JAX:025393 |
Software and algorithms |  |  |
Collaborative Brain Wave Analysis Pipeline (Cobrawap) | This paper | RRID:SCR_022966 |
Snakemake | [145] | RRID:SCR_003475 |
Neo | [123] | RRID:SCR_000634 |
Nix | [172] | RRID:SCR_016196 |
Elephant | [Denker2018_a] | RRID:SCR_003833 |
SciPy | [179] | RRID:SCR_008058 |
Pandas | [142] | RRID:SCR_018214 |

##  5 Acknowledgments

This study was carried out in the framework of the Human Brain Project
(HBP777https://www.humanbrainproject.eu) and EBRAINS888https://ebrains.eu. We
thank Andrew Davison for his continued advice and support in developing and
integrating Cobrawap.

##  6 Funding

This research was funded by the European Union’s Horizon 2020 Framework
Programme for Research and Innovation under Specific Grant Agreements No.
785907 (HBP SGA2) and No. 945539 (HBP SGA3); the Joint Lab “Supercomputing and
Modeling for the Human Brain; the Deutsche Forschungsgemeinschaft (DFG, German
Research Foundation) - 368482240/GRK2416; and the Ministry of Culture and
Science of the State of North Rhine-Westphalia, Germany, under NRW-network
’iBehave’ grant number NW21-049.

##  7 Author contributions

conceptualization: MD, PP, RG, GDB; methodology: RG, GDB, CDL, PP, MD, CC, MM,
AAM, FR, AM, EP; software: RG, CDL; investigation: RG, GDB, CDL, PP, MD;
resources: AAM, AM, FR, FP, MS; writing – original draft preparation: RG;
writing – review and editing: all; visualization: RG; supervision: MD, PP;
project administration: MD, PP, SG, MM, MS; funding acquisition: PP, MD, SG,
FP, MS

Author abbreviations: RG (Robin Gutzen), GDB (Giulia De Bonis), CDL (Chiara De
Luca), EP (Elena Pastorelli), CC (Cristiano Capone), AAM (Anna Letizia Allegra
Mascaro), FR (Francesco Resta), AM (Arnau Manasanch), FP (Francesco Saverio
Pavone), MS (Maria V. Sanchez-Vives), MM (Maurizio Mattia), SG (Sonja Grün),
PP (Pier Stanislao Paolucci), MD (Michael Denker)

## References

  * [1] B.. Abbott et al.  “Observation of Gravitational Waves from a Binary Black Hole Merger”  In _Physical Review Letters_ 116.6 American Physical Society, 2016, pp. 061102  DOI: 10.1103/PhysRevLett.116.061102
  * [2] Anna Letizia Allegra Mascaro, Ludovico Silvestri, Leonardo Sacconi and Francesco S. Pavone  “Towards a Comprehensive Understanding of Brain Machinery by Correlative Microscopy”  In _Journal of Biomedical Optics_ 20.6 SPIE, 2015, pp. 061105  DOI: 10.1117/1.JBO.20.6.061105
  * [3] Anna Letizia Allegra Mascaro et al.  “Experimental and Computational Study on Motor Control and Recovery After Stroke: Toward a Constructive Loop Between Experimental and Virtual Embodied Neuroscience”  In _Frontiers in Systems Neuroscience_ 14, 2020, pp. 31
  * [4] Karthikeyan Balasubramanian et al.  “Propagating Patterns of Activity across Motor Cortex Facilitate Movement Initiation”  In _bioRxiv_ , 2019, pp. 549568  DOI: 10.1101/549568
  * [5] Maxim Bazhenov, Igor Timofeev, Mircea Steriade and Terrence J. Sejnowski  “Model of Thalamocortical Slow-Wave Sleep Oscillations and Transitions to Activated States”  In _Journal of Neuroscience_ 22.19, 2002, pp. 8691–8704  DOI: 10.1523/JNEUROSCI.22-19-08691.2002
  * [6] Jonathan Bell, Thomas D. LaToza, Foteini Baldmitsi and Angelos Stavrou  “Advancing Open Science with Version Control and Blockchains”  In _2017 IEEE/ACM 12th International Workshop on Software Engineering for Science (SE4Science)_ , 2017, pp. 13–14  DOI: 10.1109/SE4Science.2017.11
  * [7] Arjun Bharioke et al.  “General Anesthesia Globally Synchronizes Activity Selectively in Layer 5 Cortical Pyramidal Neurons”  In _Neuron_ 110.12, 2022, pp. 2024–2040.e10  DOI: 10.1016/j.neuron.2022.03.032
  * [8] Vicente Botella-Soler et al.  “Large-Scale Cortical Dynamics of Sleep Slow Waves”  In _PLoS ONE_ 7.2, 2012  DOI: 10.1371/journal.pone.0030757
  * [9] Anila Sahar Butt and Peter Fitch  “ProvONE+: A Provenance Model for Scientific Workflows”  In _Web Information Systems Engineering – WISE 2020_ , Lecture Notes in Computer Science  Cham: Springer International Publishing, 2020, pp. 431–444  DOI: 10.1007/978-3-030-62008-0_30
  * [10] Alessandra Camassa, Maurizio Mattia and Maria V. Sanchez-Vives  “Energy-Based Hierarchical Clustering of Cortical Slow Waves in Multi-Electrode Recordings”  In _2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC)_, 2021, pp. 198–203  DOI: 10.1109/EMBC46164.2021.9630931
  * [11] Cristiano Capone and Maurizio Mattia  “Speed Hysteresis and Noise Shaping of Traveling Fronts in Neural Fields: Role of Local Circuitry and Nonlocal Connectivity”  In _Scientific Reports_ 7.1 Nature Publishing Group, 2017, pp. 39611  DOI: 10.1038/srep39611
  * [12] Cristiano Capone, Guido Gigante and Paolo Del Giudice  “Spontaneous Activity Emerging from an Inferred Network Model Captures Complex Spatio-Temporal Dynamics of Spike Data”  In _Scientific Reports_ 8.1 Nature Publishing Group, 2018, pp. 17056  DOI: 10.1038/s41598-018-35433-0
  * [13] Cristiano Capone et al.  “Slow Waves in Cortical Slices: How Spontaneous Activity Is Shaped by Laminar Structure”  In _Cerebral Cortex_ 29.1, 2019, pp. 319–335  DOI: 10.1093/cercor/bhx326
  * [14] Cristiano Capone, Elena Pastorelli, Bruno Golosio and Pier Stanislao Paolucci  “Sleep-like Slow Oscillations Improve Visual Classification through Synaptic Homeostasis and Memory Association in a Thalamo-Cortical Model”  In _Scientific Reports_ 9.1, 2019, pp. 1–11  DOI: 10.1038/s41598-019-45525-0
  * [15] Cristiano Capone et al.  “Simulations Approaching Data: Cortical Slow Waves in Inferred Models of the Whole Hemisphere of Mouse”  arXiv, 2022  DOI: 10.48550/arXiv.2104.07445
  * [16] Marco Celotto et al.  “Analysis and Model of Cortical Slow Waves Acquired with Optical Techniques”  In _Methods and Protocols_ 3.1, 2020, pp. 14  DOI: 10.3390/mps3010014
  * [17] Allen W. Chan et al.  “Mesoscale Infraslow Spontaneous Membrane Potential Fluctuations Recapitulate High-Frequency Activity Cortical Motifs”  In _Nature Communications_ 6.1, 2015, pp. 1–12  DOI: 10.1038/ncomms8738
  * [18] Tsai-Wen Chen et al.  “Ultrasensitive Fluorescent Proteins for Imaging Neuronal Activity”  In _Nature_ 499.7458 Nature Publishing Group, 2013, pp. 295–300  DOI: 10.1038/nature12354
  * [19] Albert Compte, Maria V. Sanchez-Vives, David A. McCormick and Xiao-Jing Wang  “Cellular and Network Mechanisms of Slow Oscillatory Activity ($<$1 Hz) and Wave Propagations in a Cortical Network Model”  In _Journal of Neurophysiology_ 89.5 American Physiological Society, 2003, pp. 2707–2725  DOI: 10.1152/jn.00845.2002
  * [20] Albert Compte, Ramon Reig and Maria V. Sanchez-Vives  “Timing Excitation and Inhibition in the Cortical Network”  In _Coherent Behavior in Neuronal Networks_ , Springer Series in Computational Neuroscience  New York, NY: Springer, 2009, pp. 17–46  DOI: 10.1007/978-1-4419-0389-1_2
  * [21] Michael R. Crusoe et al.  “Methods Included: Standardizing Computational Reuse and Portability with the Common Workflow Language”  In _arXiv:2105.07028 [cs]_ , 2021  DOI: 10.1145/3486897
  * [22] Hod Dana et al.  “Thy1-GCaMP6 Transgenic Mice for Neuronal Population Imaging In Vivo”  In _PLOS ONE_ 9.9 Public Library of Science, 2014, pp. e108697  DOI: 10.1371/journal.pone.0108697
  * [23] Miguel Dasilva et al.  “Modulation of Cortical Slow Oscillations and Complexity across Anesthesia Levels”  In _NeuroImage_ 224, 2021, pp. 117415  DOI: 10.1016/j.neuroimage.2020.117415
  * [24] Zachary W. Davis et al.  “Spontaneous Travelling Cortical Waves Gate Perception in Behaving Primates”  In _Nature_ Nature Publishing Group, 2020, pp. 1–5  DOI: 10.1038/s41586-020-2802-y
  * [25] Giulia De Bonis et al.  “Analysis Pipeline for Extracting Features of Cortical Slow Oscillations”  In _Frontiers in Systems Neuroscience_ 13, 2019, pp. 70  DOI: 10.3389/fnsys.2019.00070
  * [26] Saskia E.. de Vries et al.  “A Large-Scale Standardized Physiological Survey Reveals Functional Organization of the Mouse Visual Cortex”  In _Nature Neuroscience_ 23.1 Nature Publishing Group, 2020, pp. 138–151  DOI: 10.1038/s41593-019-0550-9
  * [27] Michael Denker, Alper Yegenoglu and Sonja Grün  “Collaborative HPC-enabled Workflows on the HBP Collaboratory Using the Elephant Framework”  In _Neuroinformatics_ , 2018  DOI: 10.12751/incf.ni2018.0019
  * [28] Michael Denker et al.  “LFP Beta Amplitude Is Linked to Mesoscopic Spatio-Temporal Phase Patterns”  In _Scientific Reports_ 8.1, 2018, pp. 5200  DOI: 10.1038/s41598-018-22990-7
  * [29] A. Destexhe, D. Contreras and M. Steriade  “Cortically-Induced Coherence of a Thalamic-Generated Oscillation”  In _Neuroscience_ 92.2, 1999, pp. 427–443  DOI: 10.1016/S0306-4522(99)00024-X
  * [30] Vitaly L. Galinsky and Lawrence R. Frank  “Universal Theory of Brain Waves: From Linear Loops to Nonlinear Synchronized Spiking and Collective Brain Rhythms”  In _Physical Review Research_ 2.2, 2020, pp. 023061  DOI: 10.1103/PhysRevResearch.2.023061
  * [31] Samuel Garcia et al.  “Neo: An Object Model for Handling Electrophysiology Data in Multiple Formats”  In _Frontiers in Neuroinformatics_ 8.February, 2014, pp. 10  DOI: 10.3389/fninf.2014.00010
  * [32] Daniel Garijo, Yolanda Gil and Oscar Corcho  “Abstract, Link, Publish, Exploit: An End to End Framework for Workflow Sharing”  In _Future Generation Computer Systems_ 75, 2017, pp. 271–283  DOI: 10.1016/j.future.2017.01.008
  * [33] Tristan Glatard et al.  “Reproducibility of Neuroimaging Analyses across Operating Systems”  In _Frontiers in Neuroinformatics_ 9, 2015, pp. 12  DOI: 10.3389/fninf.2015.00012
  * [34] D. Golomb, X.. Wang and J. Rinzel  “Propagation of Spindle Waves in a Thalamic Slice Model”  In _Journal of Neurophysiology_ 75 American Physiological Society, 1996, pp. 750–769  DOI: 10.1152/jn.1996.75.2.750
  * [35] Bruno Golosio et al.  “Thalamo-Cortical Spiking Model of Incremental Learning Combining Perception, Context and NREM-sleep”  In _PLOS Computational Biology_ 17.6 Public Library of Science, 2021, pp. e1009045  DOI: 10.1371/journal.pcbi.1009045
  * [36] Steven N. Goodman, Daniele Fanelli and John P.. Ioannidis  “What Does Research Reproducibility Mean?”  In _Science Translational Medicine_ 8.341 American Association for the Advancement of Science, 2016, pp. 341ps12–341ps12  DOI: 10.1126/scitranslmed.aaf5027
  * [37] Anastasia Greenberg, Javad Karimi Abadchi, Clayton T. Dickson and Majid H. Mohajerani  “New Waves: Rhythmic Electrical Field Stimulation Systematically Alters Spontaneous Slow Dynamics across Mouse Neocortex”  In _NeuroImage_ 174, 2018, pp. 328–339  DOI: 10.1016/j.neuroimage.2018.03.019
  * [38] Robin Gutzen et al.  “Reproducible Neural Network Simulations: Statistical Methods for Model Validation on the Level of Network Activity Data”  In _Frontiers in Neuroinformatics_ 12, 2018, pp. 90  DOI: 10.3389/fninf.2018.00090
  * [39] Mila Halgren et al.  “Superficial Slow Rhythms Integrate Cortical Processing in Humans”  In _Scientific Reports_ 8.1 Nature Publishing Group, 2018, pp. 2055  DOI: 10.1038/s41598-018-20662-0
  * [40] Erin C. Hanlon et al.  “Effects of Skilled Training on Sleep Slow Wave Activity and Cortical Gene Expression in the Rat”  In _Sleep_ 32.6, 2009, pp. 719–729  DOI: 10.1093/sleep/32.6.719
  * [41] Guosong Hong and Charles M. Lieber  “Novel Electrode Technologies for Neural Recordings”  In _Nature Reviews Neuroscience_ 20.6, 2019, pp. 330–345  DOI: 10.1038/s41583-019-0140-6
  * [42] Xiaoying Huang et al.  “Spiral Wave Dynamics in Neocortex”  In _Neuron_ 68.5, 2010, pp. 978–990  DOI: 10.1016/j.neuron.2010.11.007
  * [43] Daniel Jercog et al.  “UP-DOWN Cortical Dynamics Reflect State Transitions in a Bistable Network”, 2017, pp. e22425  DOI: 10.7554/eLife.22425.001
  * [44] Adam Keane and Pulin Gong  “Propagating Waves Can Explain Irregular Neural Dynamics.”  In _The Journal of Neuroscience_ 35.4, 2015, pp. 1591–605  DOI: 10.1523/JNEUROSCI.1669-14.2015
  * [45] Yuqi Liang et al.  “Cortex-Wide Dynamics of Intrinsic Electrical Activities: Propagating Waves and Their Interactions”  In _Journal of Neuroscience_ 41.16 Society for Neuroscience, 2021, pp. 3665–3678  DOI: 10.1523/JNEUROSCI.0623-20.2021
  * [46] Marcello Massimini et al.  “The Sleep Slow Oscillation as a Traveling Wave”  In _J. Neurosci._ 6.4, 2004, pp. 1160–1170  DOI: 10.1523/JNEUROSCI.1318-04.2004
  * [47] Teppei Matsui, Tomonari Murakami and Kenichi Ohki  “Transient Neuronal Coactivations Embedded in Globally Propagating Waves Underlie Resting-State Functional Connectivity”  In _Proceedings of the National Academy of Sciences_ 113.23 Proceedings of the National Academy of Sciences, 2016, pp. 6556–6561  DOI: 10.1073/pnas.1521299113
  * [48] Maurizio Mattia and Maria V. Sanchez-Vives  “Exploring the Spectrum of Dynamical Regimes and Timescales in Spontaneous Cortical Activity”  In _Cognitive Neurodynamics_ 6.3, 2012, pp. 239–250  DOI: 10.1007/s11571-011-9179-4
  * [49] Maurizio Mattia, Stefano Ferraina and Paolo Del Giudice  “Dissociated Multi-Unit Activity and Local Field Potentials: A Theory Inspired Analysis of a Motor Decision Task”  In _NeuroImage_ 52.3, Computational Models of the Brain, 2010, pp. 812–823  DOI: 10.1016/j.neuroimage.2010.01.063
  * [50] Wes McKinney  “Data Structures for Statistical Computing in Python”  In _Proceedings of the 9th Python in Science Conference_ , 2010, pp. 56–61  DOI: 10.25080/Majora-92bf1922-00a
  * [51] Nicholas J. Michelson and Takashi D.. Kozai  “Isoflurane and Ketamine Differentially Influence Spontaneous and Evoked Laminar Electrophysiology in Mouse V1”  In _Journal of Neurophysiology_ 120.5, 2018, pp. 2232–2245  DOI: 10.1152/jn.00299.2018
  * [52] Majid H. Mohajerani et al.  “Spontaneous Cortical Activity Alternates between Motifs Defined by Regional Axonal Projections”  In _Nature Neuroscience_ 16.10, 2013, pp. 1426–1435  DOI: 10.1038/nn.3499
  * [53] Felix Mölder et al.  “Sustainable Data Analysis with Snakemake”  In _F1000Research_ 10, 2021, pp. 33  DOI: 10.12688/f1000research.29032.2
  * [54] Lyle Muller et al.  “Rotating Waves during Human Sleep Spindles Organize Global Patterns of Activity That Repeat Precisely through the Night”  In _eLife_ 5, 2016, pp. e17267  DOI: 10.7554/eLife.17267
  * [55] Yuval Nir et al.  “Regional Slow Waves and Spindles in Human Sleep”  In _Neuron_ 70.1, 2011, pp. 153–169  DOI: 10.1016/j.neuron.2011.02.043
  * [56] Cyrus Omar, Jonathan Aldrich and Richard C. Gerkin  “Collaborative Infrastructure for Test-Driven Scientific Model Validation”  In _Companion Proceedings of the 36th International Conference on Software Engineering_ Hyderabad India: ACM, 2014, pp. 524–527  DOI: 10.1145/2591062.2591129
  * [57] Elena Pastorelli et al.  “Scaling of a Large-Scale Simulation of Synchronous Slow-Wave and Asynchronous Awake-Like Activity of a Cortical Model With Long-Range Interconnections”  In _Frontiers in Systems Neuroscience_ 13, 2019, pp. 33  DOI: 10.3389/fnsys.2019.00033
  * [58] Antonio Pazienti et al.  “Slow Waves Form Expanding, Memory-Rich Mesostates Steered by Local Excitability in Fading Anesthesia”  In _iScience_ 25.3 Elsevier, 2022, pp. 103918  DOI: 10.1016/j.isci.2022.103918
  * [59] Carl C.. Petersen, Amiram Grinvald and Bert Sakmann  “Spatiotemporal Dynamics of Sensory Responses in Layer 2/3 of Rat Barrel Cortex Measured In Vivo by Voltage-Sensitive Dye Imaging Combined with Whole-Cell Voltage Recordings and Neuron Reconstructions”  In _Journal of Neuroscience_ 23.4 Society for Neuroscience, 2003, pp. 1298–1309  DOI: 10.1523/JNEUROSCI.23-04-01298.2003
  * [60] Patrick L. Purdon, Aaron Sampson, Kara J. Pavone and Emery N. Brown  “Clinical Electroencephalography for Anesthesiologists: Part I: Background and Basic Signatures”  In _Anesthesiology_ 123.4, 2015, pp. 937–960  DOI: 10.1097/ALN.0000000000000841
  * [61] R. Reig et al.  “Temperature Modulation of Slow and Fast Cortical Rhythms”  In _Journal of Neurophysiology_ 103.3 American Physiological Society, 2009, pp. 1253–1261  DOI: 10.1152/jn.00890.2009
  * [62] Francesco Resta, Anna Letizia Allegra Mascaro and Francesco Pavone  “Study of Slow Waves (SWs) Propagation through Wide-Field Calcium Imaging of the Right Cortical Hemisphere of GCaMP6f Mice (v2) [Data Set]”  In _EBRAINS_ , 2020  DOI: 10.25493/QFZK-FXS
  * [63] Francesco Resta, Anna Letizia Allegra Mascaro and Francesco Pavone  “Wide-Field Calcium Imaging of the Right Cortical Hemisphere of GCaMP6f Mice at Different Anesthesia Levels [Data Set]”  In _EBRAINS_ , 2020  DOI: 10.25493/XJR8-QCA
  * [64] James A. Roberts et al.  “Metastable Brain Waves”  In _Nature Communications_ 10.1 Nature Publishing Group, 2019, pp. 1–17  DOI: 10.1038/s41467-019-08999-0
  * [65] Oliver Rübel et al.  “The Neurodata Without Borders Ecosystem for Neurophysiological Data Science”  Cold Spring Harbor Laboratory, 2021, pp. 2021.03.13.435173  DOI: 10.1101/2021.03.13.435173
  * [66] Marcel Ruiz-Mejias, Laura Ciria-Suarez, Maurizio Mattia and Maria V Sanchez-Vives  “Slow and Fast Rhythms Generated in the Cerebral Cortex of the Anesthetized Mouse”  In _Journal of Neurophysiology_ 106.6, 2011, pp. 2910–2921  DOI: 10.1152/jn.00440.2011
  * [67] Marcel Ruiz-Mejias et al.  “Overexpression of Dyrk1A, a Down Syndrome Candidate, Decreases Excitability and Impairs Gamma Oscillations in the Prefrontal Cortex”  In _Journal of Neuroscience_ 36.13, 2016, pp. 3648–3659  DOI: 10.1523/JNEUROSCI.2517-15.2016
  * [68] Maria V. Sanchez-Vives  “Cortical Activity Features in Transgenic Mouse Models of Cognitive Deficits (Fragile X Syndrome) [Data Set]”  In _Human Brain Project Neuroinformatics Platform_ , 2019  DOI: 10.25493/ANF9-EG3
  * [69] Maria V. Sanchez-Vives  “Cortical Activity Features in Transgenic Mouse Models of Cognitive Deficits (Williams Beuren Syndrome) [Data Set]”  In _Human Brain Project Neuroinformatics Platform_ , 2019  DOI: DOI: 10.25493/DZWT-1T8
  * [70] Maria V. Sanchez-Vives and David A. McCormick  “Cellular and Network Mechanisms of Rhythmic Recurrent Activity in Neocortex”  In _Nature Neuroscience_ 3.10 Nature Publishing Group, 2000, pp. 1027–1034  DOI: 10.1038/79848
  * [71] David W. Scott  “Multivariate Density Estimation: Theory, Practice, and Visualization”  John Wiley & Sons, 2015
  * [72] Terrence J. Sejnowski, Patricia S. Churchland and J. Movshon  “Putting Big Data to Good Use in Neuroscience”  In _Nature Neuroscience_ 17.11 Nature Publishing Group, 2014, pp. 1440–1441  DOI: 10.1038/nn.3839
  * [73] David M. Senseman and Kay A. Robbins  “High-Speed VSD Imaging of Visually Evoked Cortical Waves: Decomposition Into Intra- and Intercortical Wave Motions”  In _Journal of Neurophysiology_ 87.3, 2002, pp. 1499–1514  DOI: 10.1152/jn.00475.2001
  * [74] Maxim Sheroziya and Igor Timofeev  “Global Intracellular Slow-Wave Dynamics of the Thalamocortical System”  In _Journal of Neuroscience_ 34.26 Society for Neuroscience, 2014, pp. 8875–8893  DOI: 10.1523/JNEUROSCI.4460-13.2014
  * [75] Joshua H. Siegle et al.  “Survey of Spiking in the Mouse Visual System Reveals Functional Hierarchy”  In _Nature_ 592.7852 Nature Publishing Group, 2021, pp. 86–92  DOI: 10.1038/s41586-020-03171-x
  * [76] Joshua H Siegle et al.  “Reconciling Functional Differences in Populations of Neurons Recorded with Two-Photon Imaging and Electrophysiology”  In _eLife_ 10 eLife Sciences Publications, Ltd, 2021, pp. e69068  DOI: 10.7554/eLife.69068
  * [77] Julia Sprenger et al.  “odMLtables: A User-Friendly Approach for Managing Metadata of Neurophysiological Experiments”  In _Frontiers in Neuroinformatics_ 13, 2019, pp. 62  DOI: 10.3389/fninf.2019.00062
  * [78] Mircea Steriade and Igor Timofeev  “Neuronal Plasticity in Thalamocortical Networks during Sleep and Waking Oscillations”  In _Neuron_ 37.4, 2003, pp. 563–576  DOI: 10.1016/S0896-6273(03)00065-5
  * [79] Mircea Steriade, Angel Nunez and Florin Amzica  “A Novel Slow ($<$ 1 Hz) Oscillation of Neocortical Neurons in Vivo: Depolarizing and Hyperpolarizing Components”  In _Journal of Neuroscience_ 13.8, 1993, pp. 3252–3265  DOI: 10.1523/JNEUROSCI.13-08-03252.1993
  * [80] Adrian Stoewer et al.  “File Format and Library for Neuroscience Data and Metadata”  In _Front. Neuroinform. Conference Abstract: Neuroinformatics_ , 2014  DOI: 10.3389/conf.fninf.2014.18.00027
  * [81] Carsen Stringer et al.  “High-Dimensional Geometry of Population Responses in Visual Cortex”  In _Nature_ 571.7765 Nature Publishing Group, 2019, pp. 361–365  DOI: 10.1038/s41586-019-1346-5
  * [82] Albrecht Stroh et al.  “Making Waves: Initiation and Propagation of Corticothalamic Ca2+ Waves In Vivo”  In _Neuron_ 77.6, 2013, pp. 1136–1150  DOI: 10.1016/j.neuron.2013.01.031
  * [83] Zsolt Szabó et al.  “Extensive Astrocyte Synchronization Advances Neuronal Coupling in Slow Wave Activity in Vivo”  In _Scientific Reports_ 7.1, 2017, pp. 6018  DOI: 10.1038/s41598-017-06073-7
  * [84] Rory G Townsend and Pulin Gong  “Detection and Analysis of Spatiotemporal Patterns in Brain Activity”  In _PLOS Computational Biology_ 14.12, 2018, pp. e1006643  DOI: 10.1371/journal.pcbi.1006643
  * [85] Rory G Townsend et al.  “Emergence of Complex Wave Patterns in Primate Cerebral Cortex.”  In _The Journal of neuroscience : the official journal of the Society for Neuroscience_ 35.11, 2015, pp. 4657–62  DOI: 10.1523/JNEUROSCI.4509-14.2015
  * [86] Guido Trensch et al.  “Rigorous Neural Network Simulations: A Model Substantiation Methodology for Increasing the Correctness of Simulation Results in the Absence of Experimental Validation Data”  In _Frontiers in Neuroinformatics_ 12, 2018, pp. 81  DOI: 10.3389/fninf.2018.00081
  * [87] Pauli Virtanen et al.  “SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python”  In _Nature Methods_ 17.3 Nature Publishing Group, 2020, pp. 261–272  DOI: 10.1038/s41592-019-0686-2
  * [88] Maxim Volgushev, Sylvain Chauvette, Mikhail Mukovski and Igor Timofeev  “Precise Long-Range Synchronization of Activity and Silence in Neocortical Neurons during Slow-Wave Sleep”  In _Journal of Neuroscience_ 26.21, 2006, pp. 5665–5672  DOI: 10.1523/JNEUROSCI.0279-06.2006
  * [89] Vladyslav V. Vyazovskiy et al.  “Local Sleep in Awake Rats”  In _Nature_ 472.7344, 2011, pp. 443–447  DOI: 10.1038/nature10009
  * [90] Ziqiang Wei et al.  “A Comparison of Neuronal Population Dynamics Measured with Calcium Imaging and Electrophysiology”  In _PLOS Computational Biology_ 16.9 Public Library of Science, 2020, pp. e1008198  DOI: 10.1371/journal.pcbi.1008198
  * [91] Jian-Young Wu, Xiaoying Huang and Chuan Zhang  “Propagating Waves of Activity in the Neocortex: What They Are, What They Do”  In _The Neuroscientist_ 14.5, 2008, pp. 487–502  DOI: 10.1177/1073858408317066
  * [92] Lyuba Zehl et al.  “Handling Metadata in a Neurophysiology Laboratory.”  In _Frontiers in neuroinformatics_ 10.July, 2016, pp. 26  DOI: 10.3389/fninf.2016.00026

## References

  * [93] B.. Abbott et al.  “Observation of Gravitational Waves from a Binary Black Hole Merger”  In _Physical Review Letters_ 116.6 American Physical Society, 2016, pp. 061102  DOI: 10.1103/PhysRevLett.116.061102
  * [94] Anna Letizia Allegra Mascaro et al.  “Experimental and Computational Study on Motor Control and Recovery After Stroke: Toward a Constructive Loop Between Experimental and Virtual Embodied Neuroscience”  In _Frontiers in Systems Neuroscience_ 14, 2020, pp. 31
  * [95] Anna Letizia Allegra Mascaro, Ludovico Silvestri, Leonardo Sacconi and Francesco S. Pavone  “Towards a Comprehensive Understanding of Brain Machinery by Correlative Microscopy”  In _Journal of Biomedical Optics_ 20.6 SPIE, 2015, pp. 061105  DOI: 10.1117/1.JBO.20.6.061105
  * [96] Karthikeyan Balasubramanian et al.  “Propagating Patterns of Activity across Motor Cortex Facilitate Movement Initiation”  In _bioRxiv_ , 2019, pp. 549568  DOI: 10.1101/549568
  * [97] Maxim Bazhenov, Igor Timofeev, Mircea Steriade and Terrence J. Sejnowski  “Model of Thalamocortical Slow-Wave Sleep Oscillations and Transitions to Activated States”  In _Journal of Neuroscience_ 22.19, 2002, pp. 8691–8704  DOI: 10.1523/JNEUROSCI.22-19-08691.2002
  * [98] Jonathan Bell, Thomas D. LaToza, Foteini Baldmitsi and Angelos Stavrou  “Advancing Open Science with Version Control and Blockchains”  In _2017 IEEE/ACM 12th International Workshop on Software Engineering for Science (SE4Science)_ , 2017, pp. 13–14  DOI: 10.1109/SE4Science.2017.11
  * [99] Arjun Bharioke et al.  “General Anesthesia Globally Synchronizes Activity Selectively in Layer 5 Cortical Pyramidal Neurons”  In _Neuron_ 110.12, 2022, pp. 2024–2040.e10  DOI: 10.1016/j.neuron.2022.03.032
  * [100] Vicente Botella-Soler et al.  “Large-Scale Cortical Dynamics of Sleep Slow Waves”  In _PLoS ONE_ 7.2, 2012  DOI: 10.1371/journal.pone.0030757
  * [101] Anila Sahar Butt and Peter Fitch  “ProvONE+: A Provenance Model for Scientific Workflows”  In _Web Information Systems Engineering – WISE 2020_ , Lecture Notes in Computer Science  Cham: Springer International Publishing, 2020, pp. 431–444  DOI: 10.1007/978-3-030-62008-0_30
  * [102] Alessandra Camassa, Maurizio Mattia and Maria V. Sanchez-Vives  “Energy-Based Hierarchical Clustering of Cortical Slow Waves in Multi-Electrode Recordings”  In _2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC)_, 2021, pp. 198–203  DOI: 10.1109/EMBC46164.2021.9630931
  * [103] Cristiano Capone et al.  “Simulations Approaching Data: Cortical Slow Waves in Inferred Models of the Whole Hemisphere of Mouse”  arXiv, 2022  DOI: 10.48550/arXiv.2104.07445
  * [104] Cristiano Capone, Guido Gigante and Paolo Del Giudice  “Spontaneous Activity Emerging from an Inferred Network Model Captures Complex Spatio-Temporal Dynamics of Spike Data”  In _Scientific Reports_ 8.1 Nature Publishing Group, 2018, pp. 17056  DOI: 10.1038/s41598-018-35433-0
  * [105] Cristiano Capone and Maurizio Mattia  “Speed Hysteresis and Noise Shaping of Traveling Fronts in Neural Fields: Role of Local Circuitry and Nonlocal Connectivity”  In _Scientific Reports_ 7.1 Nature Publishing Group, 2017, pp. 39611  DOI: 10.1038/srep39611
  * [106] Cristiano Capone, Elena Pastorelli, Bruno Golosio and Pier Stanislao Paolucci  “Sleep-like Slow Oscillations Improve Visual Classification through Synaptic Homeostasis and Memory Association in a Thalamo-Cortical Model”  In _Scientific Reports_ 9.1, 2019, pp. 1–11  DOI: 10.1038/s41598-019-45525-0
  * [107] Cristiano Capone et al.  “Slow Waves in Cortical Slices: How Spontaneous Activity Is Shaped by Laminar Structure”  In _Cerebral Cortex_ 29.1, 2019, pp. 319–335  DOI: 10.1093/cercor/bhx326
  * [108] Marco Celotto et al.  “Analysis and Model of Cortical Slow Waves Acquired with Optical Techniques”  In _Methods and Protocols_ 3.1, 2020, pp. 14  DOI: 10.3390/mps3010014
  * [109] Allen W. Chan et al.  “Mesoscale Infraslow Spontaneous Membrane Potential Fluctuations Recapitulate High-Frequency Activity Cortical Motifs”  In _Nature Communications_ 6.1, 2015, pp. 1–12  DOI: 10.1038/ncomms8738
  * [110] Tsai-Wen Chen et al.  “Ultrasensitive Fluorescent Proteins for Imaging Neuronal Activity”  In _Nature_ 499.7458 Nature Publishing Group, 2013, pp. 295–300  DOI: 10.1038/nature12354
  * [111] Albert Compte, Ramon Reig and Maria V. Sanchez-Vives  “Timing Excitation and Inhibition in the Cortical Network”  In _Coherent Behavior in Neuronal Networks_ , Springer Series in Computational Neuroscience  New York, NY: Springer, 2009, pp. 17–46  DOI: 10.1007/978-1-4419-0389-1_2
  * [112] Albert Compte, Maria V. Sanchez-Vives, David A. McCormick and Xiao-Jing Wang  “Cellular and Network Mechanisms of Slow Oscillatory Activity ($<$1 Hz) and Wave Propagations in a Cortical Network Model”  In _Journal of Neurophysiology_ 89.5 American Physiological Society, 2003, pp. 2707–2725  DOI: 10.1152/jn.00845.2002
  * [113] Michael R. Crusoe et al.  “Methods Included: Standardizing Computational Reuse and Portability with the Common Workflow Language”  In _arXiv:2105.07028 [cs]_ , 2021  DOI: 10.1145/3486897
  * [114] Hod Dana et al.  “Thy1-GCaMP6 Transgenic Mice for Neuronal Population Imaging In Vivo”  In _PLOS ONE_ 9.9 Public Library of Science, 2014, pp. e108697  DOI: 10.1371/journal.pone.0108697
  * [115] Miguel Dasilva et al.  “Modulation of Cortical Slow Oscillations and Complexity across Anesthesia Levels”  In _NeuroImage_ 224, 2021, pp. 117415  DOI: 10.1016/j.neuroimage.2020.117415
  * [116] Zachary W. Davis et al.  “Spontaneous Travelling Cortical Waves Gate Perception in Behaving Primates”  In _Nature_ Nature Publishing Group, 2020, pp. 1–5  DOI: 10.1038/s41586-020-2802-y
  * [117] Giulia De Bonis et al.  “Analysis Pipeline for Extracting Features of Cortical Slow Oscillations”  In _Frontiers in Systems Neuroscience_ 13, 2019, pp. 70  DOI: 10.3389/fnsys.2019.00070
  * [118] Saskia E.. de Vries et al.  “A Large-Scale Standardized Physiological Survey Reveals Functional Organization of the Mouse Visual Cortex”  In _Nature Neuroscience_ 23.1 Nature Publishing Group, 2020, pp. 138–151  DOI: 10.1038/s41593-019-0550-9
  * [119] Michael Denker, Alper Yegenoglu and Sonja Grün  “Collaborative HPC-enabled Workflows on the HBP Collaboratory Using the Elephant Framework”  In _Neuroinformatics_ , 2018  DOI: 10.12751/incf.ni2018.0019
  * [120] Michael Denker et al.  “LFP Beta Amplitude Is Linked to Mesoscopic Spatio-Temporal Phase Patterns”  In _Scientific Reports_ 8.1, 2018, pp. 5200  DOI: 10.1038/s41598-018-22990-7
  * [121] A. Destexhe, D. Contreras and M. Steriade  “Cortically-Induced Coherence of a Thalamic-Generated Oscillation”  In _Neuroscience_ 92.2, 1999, pp. 427–443  DOI: 10.1016/S0306-4522(99)00024-X
  * [122] Vitaly L. Galinsky and Lawrence R. Frank  “Universal Theory of Brain Waves: From Linear Loops to Nonlinear Synchronized Spiking and Collective Brain Rhythms”  In _Physical Review Research_ 2.2, 2020, pp. 023061  DOI: 10.1103/PhysRevResearch.2.023061
  * [123] Samuel Garcia et al.  “Neo: An Object Model for Handling Electrophysiology Data in Multiple Formats”  In _Frontiers in Neuroinformatics_ 8.February, 2014, pp. 10  DOI: 10.3389/fninf.2014.00010
  * [124] Daniel Garijo, Yolanda Gil and Oscar Corcho  “Abstract, Link, Publish, Exploit: An End to End Framework for Workflow Sharing”  In _Future Generation Computer Systems_ 75, 2017, pp. 271–283  DOI: 10.1016/j.future.2017.01.008
  * [125] Tristan Glatard et al.  “Reproducibility of Neuroimaging Analyses across Operating Systems”  In _Frontiers in Neuroinformatics_ 9, 2015, pp. 12  DOI: 10.3389/fninf.2015.00012
  * [126] D. Golomb, X.. Wang and J. Rinzel  “Propagation of Spindle Waves in a Thalamic Slice Model”  In _Journal of Neurophysiology_ 75 American Physiological Society, 1996, pp. 750–769  DOI: 10.1152/jn.1996.75.2.750
  * [127] Bruno Golosio et al.  “Thalamo-Cortical Spiking Model of Incremental Learning Combining Perception, Context and NREM-sleep”  In _PLOS Computational Biology_ 17.6 Public Library of Science, 2021, pp. e1009045  DOI: 10.1371/journal.pcbi.1009045
  * [128] Steven N. Goodman, Daniele Fanelli and John P.. Ioannidis  “What Does Research Reproducibility Mean?”  In _Science Translational Medicine_ 8.341 American Association for the Advancement of Science, 2016, pp. 341ps12–341ps12  DOI: 10.1126/scitranslmed.aaf5027
  * [129] Anastasia Greenberg, Javad Karimi Abadchi, Clayton T. Dickson and Majid H. Mohajerani  “New Waves: Rhythmic Electrical Field Stimulation Systematically Alters Spontaneous Slow Dynamics across Mouse Neocortex”  In _NeuroImage_ 174, 2018, pp. 328–339  DOI: 10.1016/j.neuroimage.2018.03.019
  * [130] Robin Gutzen et al.  “Reproducible Neural Network Simulations: Statistical Methods for Model Validation on the Level of Network Activity Data”  In _Frontiers in Neuroinformatics_ 12, 2018, pp. 90  DOI: 10.3389/fninf.2018.00090
  * [131] Mila Halgren et al.  “Superficial Slow Rhythms Integrate Cortical Processing in Humans”  In _Scientific Reports_ 8.1 Nature Publishing Group, 2018, pp. 2055  DOI: 10.1038/s41598-018-20662-0
  * [132] Erin C. Hanlon et al.  “Effects of Skilled Training on Sleep Slow Wave Activity and Cortical Gene Expression in the Rat”  In _Sleep_ 32.6, 2009, pp. 719–729  DOI: 10.1093/sleep/32.6.719
  * [133] Guosong Hong and Charles M. Lieber  “Novel Electrode Technologies for Neural Recordings”  In _Nature Reviews Neuroscience_ 20.6, 2019, pp. 330–345  DOI: 10.1038/s41583-019-0140-6
  * [134] Xiaoying Huang et al.  “Spiral Wave Dynamics in Neocortex”  In _Neuron_ 68.5, 2010, pp. 978–990  DOI: 10.1016/j.neuron.2010.11.007
  * [135] Daniel Jercog et al.  “UP-DOWN Cortical Dynamics Reflect State Transitions in a Bistable Network”, 2017, pp. e22425  DOI: 10.7554/eLife.22425.001
  * [136] Adam Keane and Pulin Gong  “Propagating Waves Can Explain Irregular Neural Dynamics.”  In _The Journal of Neuroscience_ 35.4, 2015, pp. 1591–605  DOI: 10.1523/JNEUROSCI.1669-14.2015
  * [137] Yuqi Liang et al.  “Cortex-Wide Dynamics of Intrinsic Electrical Activities: Propagating Waves and Their Interactions”  In _Journal of Neuroscience_ 41.16 Society for Neuroscience, 2021, pp. 3665–3678  DOI: 10.1523/JNEUROSCI.0623-20.2021
  * [138] Marcello Massimini et al.  “The Sleep Slow Oscillation as a Traveling Wave”  In _J. Neurosci._ 6.4, 2004, pp. 1160–1170  DOI: 10.1523/JNEUROSCI.1318-04.2004
  * [139] Teppei Matsui, Tomonari Murakami and Kenichi Ohki  “Transient Neuronal Coactivations Embedded in Globally Propagating Waves Underlie Resting-State Functional Connectivity”  In _Proceedings of the National Academy of Sciences_ 113.23 Proceedings of the National Academy of Sciences, 2016, pp. 6556–6561  DOI: 10.1073/pnas.1521299113
  * [140] Maurizio Mattia, Stefano Ferraina and Paolo Del Giudice  “Dissociated Multi-Unit Activity and Local Field Potentials: A Theory Inspired Analysis of a Motor Decision Task”  In _NeuroImage_ 52.3, Computational Models of the Brain, 2010, pp. 812–823  DOI: 10.1016/j.neuroimage.2010.01.063
  * [141] Maurizio Mattia and Maria V. Sanchez-Vives  “Exploring the Spectrum of Dynamical Regimes and Timescales in Spontaneous Cortical Activity”  In _Cognitive Neurodynamics_ 6.3, 2012, pp. 239–250  DOI: 10.1007/s11571-011-9179-4
  * [142] Wes McKinney  “Data Structures for Statistical Computing in Python”  In _Proceedings of the 9th Python in Science Conference_ , 2010, pp. 56–61  DOI: 10.25080/Majora-92bf1922-00a
  * [143] Nicholas J. Michelson and Takashi D.. Kozai  “Isoflurane and Ketamine Differentially Influence Spontaneous and Evoked Laminar Electrophysiology in Mouse V1”  In _Journal of Neurophysiology_ 120.5, 2018, pp. 2232–2245  DOI: 10.1152/jn.00299.2018
  * [144] Majid H. Mohajerani et al.  “Spontaneous Cortical Activity Alternates between Motifs Defined by Regional Axonal Projections”  In _Nature Neuroscience_ 16.10, 2013, pp. 1426–1435  DOI: 10.1038/nn.3499
  * [145] Felix Mölder et al.  “Sustainable Data Analysis with Snakemake”  In _F1000Research_ 10, 2021, pp. 33  DOI: 10.12688/f1000research.29032.2
  * [146] Lyle Muller et al.  “Rotating Waves during Human Sleep Spindles Organize Global Patterns of Activity That Repeat Precisely through the Night”  In _eLife_ 5, 2016, pp. e17267  DOI: 10.7554/eLife.17267
  * [147] Yuval Nir et al.  “Regional Slow Waves and Spindles in Human Sleep”  In _Neuron_ 70.1, 2011, pp. 153–169  DOI: 10.1016/j.neuron.2011.02.043
  * [148] Cyrus Omar, Jonathan Aldrich and Richard C. Gerkin  “Collaborative Infrastructure for Test-Driven Scientific Model Validation”  In _Companion Proceedings of the 36th International Conference on Software Engineering_ Hyderabad India: ACM, 2014, pp. 524–527  DOI: 10.1145/2591062.2591129
  * [149] Elena Pastorelli et al.  “Scaling of a Large-Scale Simulation of Synchronous Slow-Wave and Asynchronous Awake-Like Activity of a Cortical Model With Long-Range Interconnections”  In _Frontiers in Systems Neuroscience_ 13, 2019, pp. 33  DOI: 10.3389/fnsys.2019.00033
  * [150] Antonio Pazienti et al.  “Slow Waves Form Expanding, Memory-Rich Mesostates Steered by Local Excitability in Fading Anesthesia”  In _iScience_ 25.3 Elsevier, 2022, pp. 103918  DOI: 10.1016/j.isci.2022.103918
  * [151] Carl C.. Petersen, Amiram Grinvald and Bert Sakmann  “Spatiotemporal Dynamics of Sensory Responses in Layer 2/3 of Rat Barrel Cortex Measured In Vivo by Voltage-Sensitive Dye Imaging Combined with Whole-Cell Voltage Recordings and Neuron Reconstructions”  In _Journal of Neuroscience_ 23.4 Society for Neuroscience, 2003, pp. 1298–1309  DOI: 10.1523/JNEUROSCI.23-04-01298.2003
  * [152] Patrick L. Purdon, Aaron Sampson, Kara J. Pavone and Emery N. Brown  “Clinical Electroencephalography for Anesthesiologists: Part I: Background and Basic Signatures”  In _Anesthesiology_ 123.4, 2015, pp. 937–960  DOI: 10.1097/ALN.0000000000000841
  * [153] R. Reig et al.  “Temperature Modulation of Slow and Fast Cortical Rhythms”  In _Journal of Neurophysiology_ 103.3 American Physiological Society, 2009, pp. 1253–1261  DOI: 10.1152/jn.00890.2009
  * [154] Francesco Resta, Anna Letizia Allegra Mascaro and Francesco Pavone  “Study of Slow Waves (SWs) Propagation through Wide-Field Calcium Imaging of the Right Cortical Hemisphere of GCaMP6f Mice (v2) [Data Set]”  In _EBRAINS_ , 2020  DOI: 10.25493/QFZK-FXS
  * [155] Francesco Resta, Anna Letizia Allegra Mascaro and Francesco Pavone  “Wide-Field Calcium Imaging of the Right Cortical Hemisphere of GCaMP6f Mice at Different Anesthesia Levels [Data Set]”  In _EBRAINS_ , 2020  DOI: 10.25493/XJR8-QCA
  * [156] James A. Roberts et al.  “Metastable Brain Waves”  In _Nature Communications_ 10.1 Nature Publishing Group, 2019, pp. 1–17  DOI: 10.1038/s41467-019-08999-0
  * [157] Oliver Rübel et al.  “The Neurodata Without Borders Ecosystem for Neurophysiological Data Science”  Cold Spring Harbor Laboratory, 2021, pp. 2021.03.13.435173  DOI: 10.1101/2021.03.13.435173
  * [158] Marcel Ruiz-Mejias, Laura Ciria-Suarez, Maurizio Mattia and Maria V Sanchez-Vives  “Slow and Fast Rhythms Generated in the Cerebral Cortex of the Anesthetized Mouse”  In _Journal of Neurophysiology_ 106.6, 2011, pp. 2910–2921  DOI: 10.1152/jn.00440.2011
  * [159] Marcel Ruiz-Mejias et al.  “Overexpression of Dyrk1A, a Down Syndrome Candidate, Decreases Excitability and Impairs Gamma Oscillations in the Prefrontal Cortex”  In _Journal of Neuroscience_ 36.13, 2016, pp. 3648–3659  DOI: 10.1523/JNEUROSCI.2517-15.2016
  * [160] Maria V. Sanchez-Vives  “Cortical Activity Features in Transgenic Mouse Models of Cognitive Deficits (Fragile X Syndrome) [Data Set]”  In _Human Brain Project Neuroinformatics Platform_ , 2019  DOI: 10.25493/ANF9-EG3
  * [161] Maria V. Sanchez-Vives  “Cortical Activity Features in Transgenic Mouse Models of Cognitive Deficits (Williams Beuren Syndrome) [Data Set]”  In _Human Brain Project Neuroinformatics Platform_ , 2019  DOI: DOI: 10.25493/DZWT-1T8
  * [162] Maria V. Sanchez-Vives and David A. McCormick  “Cellular and Network Mechanisms of Rhythmic Recurrent Activity in Neocortex”  In _Nature Neuroscience_ 3.10 Nature Publishing Group, 2000, pp. 1027–1034  DOI: 10.1038/79848
  * [163] David W. Scott  “Multivariate Density Estimation: Theory, Practice, and Visualization”  John Wiley & Sons, 2015
  * [164] Terrence J. Sejnowski, Patricia S. Churchland and J. Movshon  “Putting Big Data to Good Use in Neuroscience”  In _Nature Neuroscience_ 17.11 Nature Publishing Group, 2014, pp. 1440–1441  DOI: 10.1038/nn.3839
  * [165] David M. Senseman and Kay A. Robbins  “High-Speed VSD Imaging of Visually Evoked Cortical Waves: Decomposition Into Intra- and Intercortical Wave Motions”  In _Journal of Neurophysiology_ 87.3, 2002, pp. 1499–1514  DOI: 10.1152/jn.00475.2001
  * [166] Maxim Sheroziya and Igor Timofeev  “Global Intracellular Slow-Wave Dynamics of the Thalamocortical System”  In _Journal of Neuroscience_ 34.26 Society for Neuroscience, 2014, pp. 8875–8893  DOI: 10.1523/JNEUROSCI.4460-13.2014
  * [167] Joshua H. Siegle et al.  “Survey of Spiking in the Mouse Visual System Reveals Functional Hierarchy”  In _Nature_ 592.7852 Nature Publishing Group, 2021, pp. 86–92  DOI: 10.1038/s41586-020-03171-x
  * [168] Joshua H Siegle et al.  “Reconciling Functional Differences in Populations of Neurons Recorded with Two-Photon Imaging and Electrophysiology”  In _eLife_ 10 eLife Sciences Publications, Ltd, 2021, pp. e69068  DOI: 10.7554/eLife.69068
  * [169] Julia Sprenger et al.  “odMLtables: A User-Friendly Approach for Managing Metadata of Neurophysiological Experiments”  In _Frontiers in Neuroinformatics_ 13, 2019, pp. 62  DOI: 10.3389/fninf.2019.00062
  * [170] Mircea Steriade, Angel Nunez and Florin Amzica  “A Novel Slow ($<$ 1 Hz) Oscillation of Neocortical Neurons in Vivo: Depolarizing and Hyperpolarizing Components”  In _Journal of Neuroscience_ 13.8, 1993, pp. 3252–3265  DOI: 10.1523/JNEUROSCI.13-08-03252.1993
  * [171] Mircea Steriade and Igor Timofeev  “Neuronal Plasticity in Thalamocortical Networks during Sleep and Waking Oscillations”  In _Neuron_ 37.4, 2003, pp. 563–576  DOI: 10.1016/S0896-6273(03)00065-5
  * [172] Adrian Stoewer et al.  “File Format and Library for Neuroscience Data and Metadata”  In _Front. Neuroinform. Conference Abstract: Neuroinformatics_ , 2014  DOI: 10.3389/conf.fninf.2014.18.00027
  * [173] Carsen Stringer et al.  “High-Dimensional Geometry of Population Responses in Visual Cortex”  In _Nature_ 571.7765 Nature Publishing Group, 2019, pp. 361–365  DOI: 10.1038/s41586-019-1346-5
  * [174] Albrecht Stroh et al.  “Making Waves: Initiation and Propagation of Corticothalamic Ca2+ Waves In Vivo”  In _Neuron_ 77.6, 2013, pp. 1136–1150  DOI: 10.1016/j.neuron.2013.01.031
  * [175] Zsolt Szabó et al.  “Extensive Astrocyte Synchronization Advances Neuronal Coupling in Slow Wave Activity in Vivo”  In _Scientific Reports_ 7.1, 2017, pp. 6018  DOI: 10.1038/s41598-017-06073-7
  * [176] Rory G Townsend and Pulin Gong  “Detection and Analysis of Spatiotemporal Patterns in Brain Activity”  In _PLOS Computational Biology_ 14.12, 2018, pp. e1006643  DOI: 10.1371/journal.pcbi.1006643
  * [177] Rory G Townsend et al.  “Emergence of Complex Wave Patterns in Primate Cerebral Cortex.”  In _The Journal of neuroscience : the official journal of the Society for Neuroscience_ 35.11, 2015, pp. 4657–62  DOI: 10.1523/JNEUROSCI.4509-14.2015
  * [178] Guido Trensch et al.  “Rigorous Neural Network Simulations: A Model Substantiation Methodology for Increasing the Correctness of Simulation Results in the Absence of Experimental Validation Data”  In _Frontiers in Neuroinformatics_ 12, 2018, pp. 81  DOI: 10.3389/fninf.2018.00081
  * [179] Pauli Virtanen et al.  “SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python”  In _Nature Methods_ 17.3 Nature Publishing Group, 2020, pp. 261–272  DOI: 10.1038/s41592-019-0686-2
  * [180] Maxim Volgushev, Sylvain Chauvette, Mikhail Mukovski and Igor Timofeev  “Precise Long-Range Synchronization of Activity and Silence in Neocortical Neurons during Slow-Wave Sleep”  In _Journal of Neuroscience_ 26.21, 2006, pp. 5665–5672  DOI: 10.1523/JNEUROSCI.0279-06.2006
  * [181] Vladyslav V. Vyazovskiy et al.  “Local Sleep in Awake Rats”  In _Nature_ 472.7344, 2011, pp. 443–447  DOI: 10.1038/nature10009
  * [182] Ziqiang Wei et al.  “A Comparison of Neuronal Population Dynamics Measured with Calcium Imaging and Electrophysiology”  In _PLOS Computational Biology_ 16.9 Public Library of Science, 2020, pp. e1008198  DOI: 10.1371/journal.pcbi.1008198
  * [183] Jian-Young Wu, Xiaoying Huang and Chuan Zhang  “Propagating Waves of Activity in the Neocortex: What They Are, What They Do”  In _The Neuroscientist_ 14.5, 2008, pp. 487–502  DOI: 10.1177/1073858408317066
  * [184] Lyuba Zehl et al.  “Handling Metadata in a Neurophysiology Laboratory.”  In _Frontiers in neuroinformatics_ 10.July, 2016, pp. 26  DOI: 10.3389/fninf.2016.00026

Chen2013_295bChen2013_295 Denker2018_1Denker2018_5200 Denker2018_aDenker2018_
Mohajerani2013_1426aMohajerani2013_1426 Roberts2019_1056Roberts2019_1

##  Appendix A Data overview

Figure 8: Data overview. Each row shows one of the $60$ recordings used in
this study. The columns show some of the attributes in which they can differ,
and within each column, different values are colored differently.

##  Appendix B Characterization of wave-modes in one ECoG recording

Figure 9: Characterization of wave-modes in one ECoG recording. Within the
pipeline, the optional block ’wave_mode_clustering’ groups together similar
wave modes. Their characterization of the waves in each of the 4 modes is
shown in the corresponding columns. A: The average wave pattern (number of
waves indicated on top) is illustrated as a time-delay heatmap with iso-delay
contours. B: The aggregated histogram of channel-wise directions in waves of
this mode. The black lines indicate the average wave-wise direction measure.
C: Map of the average channel-wise velocities in waves of this mode, overlayed
with the average channel-wise direction determined via the optical flow. D:
The corresponding distributions of channel-wise velocities and as black ticks
and errorbars the average and $95\%$ CI of the corresponding wave-wise
velocities. E: The average and $95\%$ CI of the planarity values for the waves
of this mode. The figure is analogous to Figure 4.

##  Appendix C Wavefront definition via trigger clustering.

Figure 10: Wavefront definition via trigger clustering. Visualizing the
clustering of detected transition times in the space-time domain for $10$ s of
an example calcium imaging recording. The trigger events are grouped based on
their proximity in space and time using a density-based clustering algorithm
(color coded).