Skip to main content

Tool for automated MEG and EEG data quality control

Project description

MEGqc

MEGqc is an open-source, BIDS-aligned toolbox for automated MEG quality assessment (QA) and explicit quality control (QC) summarization.

It is designed for large cohorts and reproducible workflows, and provides both:

  • interactive HTML reports for human inspection, and
  • machine-readable derivatives for downstream automation.

What MEGqc Provides

  • QA-first quality profiling of raw MEG signal quality before exclusion decisions.
  • Multi-metric coverage including:
    • standard deviation (STD),
    • peak-to-peak amplitude (PtP),
    • power spectral density (PSD),
    • ECG/EOG-related contamination,
    • high-frequency muscle burden,
    • optional head-motion summaries.
  • Multi-scale reporting across recording, channel, epoch, subject, dataset group, and multi-sample comparisons.
  • QC support layer with configurable module-level criteria and a Global Quality Index (GQI).
  • Reproducible execution with profile-aware outputs and saved settings provenance.
  • Three usage modes: CLI, GUI, and programmatic dispatchers.

Requirements

  • Python 3.10
  • MEG data organized according to BIDS/MEG-BIDS.

Installation

Option 1: Installer-based (recommended for most users)

Download the installer bundle from the MEGqc releases and follow the platform-specific instructions in the installation guide.

Option 2: CLI-based (Conda + pip)

conda create -n megqc-py310 python=3.10 pip -y
conda activate megqc-py310
pip install meg-qc

For detailed installation instructions, see the CLI installation guide.

Quick Start (CLI)

  1. Export default config:
get-megqc-config --target_directory ./config
  1. Run QA/QC calculation:
run-megqc --inputdata /path/to/bids_dataset --config ./config/settings.ini
  1. Build plotting reports:
run-megqc-plotting --inputdata /path/to/bids_dataset
  1. Recompute GQI summaries (optional):
globalqualityindex --inputdata /path/to/bids_dataset
  1. Run full pipeline in one command (calculation + plotting):
run-megqc --inputdata /path/to/bids_dataset --config ./config/settings.ini --run-all

Launch GUI

megqc

The GUI uses the same backend logic as CLI dispatchers and writes the same derivative/report outputs.

HPC and CBRAIN Deployment (Apptainer)

MEGqc can be containerized with Apptainer and deployed on any Linux HPC system, including CBRAIN — the distributed computing platform at the Montreal Neurological Institute (MNI) / McGill University, which MEGqc is being integrated into as part of an active collaboration.

The hpc/ folder contains the complete deployment materials:

File Description
hpc/MEGQC.def Apptainer definition file (source of truth for building the image)
hpc/BUILD_APPTAINER_IMAGE.md Build guide: prerequisites, image creation, GUI launch, distribution
hpc/CLI_REFERENCE.md Full CLI reference + CBRAIN/Slurm job script template

Quick start:

# Build the image
apptainer build MEGqc.sif hpc/MEGQC.def

# Run full analysis on a BIDS dataset
apptainer run --containall \
  --bind /path/to/bids_dataset:/mnt_IN \
  --bind "$PWD/settings.ini":/mnt_config/settings.ini \
  --bind "$PWD/outputs":/mnt_OUT \
  MEGqc.sif \
  --inputdata /mnt_IN --config /mnt_config/settings.ini \
  --derivatives_output /mnt_OUT --analysis_mode new --run-all --all

See hpc/README.md for the full overview and attribution.


Typical Outputs

MEGqc writes outputs under BIDS derivatives (default):

  • derivatives/Meg_QC/calculation/ — metric tables + JSON summaries
  • derivatives/Meg_QC/reports/ — interactive HTML reports
  • derivatives/Meg_QC/summary_reports/ — QC summaries including GQI artifacts

Documentation

Source Code

https://github.com/ANCPLabOldenburg/MEGqc

License

MIT License.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meg_qc-0.9.8.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meg_qc-0.9.8-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file meg_qc-0.9.8.tar.gz.

File metadata

  • Download URL: meg_qc-0.9.8.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for meg_qc-0.9.8.tar.gz
Algorithm Hash digest
SHA256 9628f2aa56b76ff59bf1c22d783999ed553a4d1a3fddf7a55ad08c2b61aa3f97
MD5 8ff9e3cf6c8dea246906b3e9be2c420f
BLAKE2b-256 4cd9dfeedfbe3254e038bbec8b3bde851b7a4959cec74b4b00a5b95dea746514

See more details on using hashes here.

File details

Details for the file meg_qc-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: meg_qc-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for meg_qc-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7a56d04a5fcad51bd56cea494b93ae17a3f27077f97a8f2162f36a1d9aea4d68
MD5 48d750c835b8767a0045ab78bf1ad9ef
BLAKE2b-256 205e53934ef98d2244773aa41274e31dffaae58a7d6ab1ee182ed8c7a7d6f808

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page