dirconn#
Directed functional connectivity for neurophysiology signals (EEG, MEG, iEEG, LFP) at sensor and region level.
Note
dirconn is alpha software. It estimates predictive directed influence (Granger causality and related measures). It does not establish interventional causality, and every result records the assumptions it relies on.
Where to start#
Tutorials: eighteen tutorials, from a first directed connectivity to the reading of sources and sinks, the controls for zero-delay mixing, model-free spectral Granger causality, PCMCI, transfer entropy (including one hypothesis on the EEG sources of a recording and the multivariate mode on an indirect path and a shared driver), three methods compared on the same simulated regions, the renormalised PDC with its asymptotic threshold, and the whole pipeline run on a BIDS dataset with one
dirconn-bidscommand, and the reading of the participant report it writes. Each ends on what its result does and does not show.Statistics in dirconn and Surrogate data and what a surrogate test can tell you: which test answers which question, and what each surrogate keeps.
Gaps, selected samples and event locks: records with gaps, models fitted on selected samples (such as bursts), and event locks with matched controls.
API reference: every public class and function.
Command line, Pipeline configuration and Outputs: the
dirconn-bidscommand line, which runs the pipeline on a BIDS dataset, its TOML configuration and the derivatives it writes.
Install#
pip install dirconn # the package
pip install "dirconn[plot,stats]" # with plotting and the statsmodels-based tests
pip install "dirconn[app]" # with the dirconn-bids command line
pip install -e ".[dev,all]" # from a clone, for development
Plots need the plot extra (matplotlib and, for the chord diagram of dirconn.viz,
pyCirclize); the map of the cortical surface needs plot-extra and MNE’s 3D plotting.
Tutorials that need the MNE sample dataset#
Tutorials 1 to 6, 9 to 12 and 15 to 18 use simulated data only. Tutorials 7, 8, 13 and 14 need the MNE
sample dataset (about 1.5 GB). dirconn never downloads it without being asked: the tutorials
call dirconn.datasets.require_sample(), which looks for the data locally and, if it is missing,
stops with the size, the MNE_DATA setting and the download command.
How the methods were validated#
Every method is scored on simulated networks with a known truth. Method validation covers
small region-level networks (chain, common driver, collider, feedback loop, zero-lag coupling, hidden
driver, observation noise); Benchmark on realistic head models describes the benchmark through the head models of the
MNE sample subject, and Benchmark conclusions states what the results do and do not show,
followed by tables generated from the saved results. Time-varying methods and
Non-stationary validation do the same for the time-varying methods.