Configuration Examples

Configuration Examples#

MEGFlow uses one layered configuration schema for a single dataset, multiple datasets, and recording-specific behavior. Start from a complete base config and override only the values that differ for the study.

Example Sequence#

Start with the single-dataset page for first-pass QC, anatomy, epochs, covariance, and source reconstruction. Use the second page for recording overrides, heterogeneous corpora, source-mode demos, and cluster execution.

  1. Single-Dataset Configuration Examples: first MEG pass, anatomy, events, covariance, source reconstruction, and Maxwell/tSSS.

  2. Multi-Dataset and Override Examples: per-dataset and per-recording overrides, corpus execution, the runnable multi-dataset demo, and cluster launch.

Repository validation parses every Groovy block, checks every shell and Docker command, and previews representative profile layouts with synthetic paths. Dataset-specific event definitions, calibration files, anatomy, and scientific parameter choices still need to be verified against the real study data.

Canonical Templates#

Use one of these repository files as the base:

  • quickstart.config is the recommended first Docker project overlay. It selects all discovered MEG recordings and stops at ICA; add only study-specific overrides.

  • nextflow_for_docker.config contains the authoritative paths and defaults for the distributed container.

  • nextflow.config on GitHub contains the source-run defaults and execution profiles. It is a deployment config, so replace its site paths before using it elsewhere.

  • nextflow_multi_dataset_demo.config on GitHub is a complete source-run example for WAND, SMN4Lang, and MEG-MASC. Its data, output, and code paths are site-specific.

  • nextflow_maxwell_tsss_example.config on GitHub demonstrates MEGIN/Elekta Maxwell filtering and tSSS at default, dataset, and recording configuration levels without enabling it in the shared defaults.

For Docker, a small project config contains only study-specific overrides. The entrypoint automatically loads the full config already present inside the image before applying this file with Nextflow -c:

// Project-specific overrides start immediately.
params {
  megflow {
    defaults {
      steps = "meg_ica"
    }
  }
}

Mount that overlay at a container path such as /config/project.config and pass the path through --config. This keeps the project file visibly separate from the defaults bundled with the image. For a source run, either copy nextflow/nextflow.config and edit it or include it with a path that is valid from the project config’s location.