BIDS Migration Guide
This guide covers every upgrade path: from the original bids2nf Nextflow subworkflow, through the early plugin betas, up to 0.3.0.
Version timeline
| Version | Approx date | Key changes | Breaking? |
|---|---|---|---|
Baseline bids2nf |
pre-2024 |
Original Nextflow subworkflow |
— |
0.1.0 |
~Dec 2024 |
Initial plugin implementation |
No |
0.1.0-beta.1–4 |
Early 2025 |
Core functionality stabilisation |
Minor |
0.1.0-beta.5 |
~Oct 2025 |
|
Yes |
0.1.0-beta.6 |
~Nov 2025 |
Flat output format (opt-in); suffix mapping fix |
Optional |
0.1.0-beta.9 |
Dec 2025 |
Flat output becomes the default |
Yes |
v0.2.0 |
Future |
Legacy tuple format removed |
Yes |
Identify your starting version
// Baseline bids2nf?
include { bids2nf } from './modules/bids2nf' // → baseline
// Plugin?
plugins { id 'nf-bids@0.1.0-beta.9' } // → check version
Run nextflow plugin list to see what is actually loaded.
Migration paths
Path 1: Baseline bids2nf → 0.3.0
Step 2 — Update the workflow import
// Before
include { bids2nf } from './modules/bids2nf'
workflow { bids_channel = bids2nf(params.bids_dir, 'config.yaml') }
// After
include { fromBIDS } from 'plugin/nf-bids'
workflow { bids_channel = Channel.fromBIDS(params.bids_dir, 'config.yaml') }
Step 3 — Update entity and file access
[
["sub-01", "ses-01", "NA", "NA"], // [subject, session, run, task]
[
bidsParentDir: "/path/to/bids",
subject: "sub-01",
data: [
dwi: [nii: "sub-01/ses-01/dwi/sub-01_ses-01_dwi.nii.gz"] // RELATIVE
]
]
]
// Access: file("${data.bidsParentDir}/${data.data.dwi.nii}")
[
meta: [subject: "sub-01", session: "ses-01", run: "NA"],
dwi: [
nii: Path("/path/to/bids/sub-01/ses-01/dwi/sub-01_ses-01_dwi.nii.gz"), // ABSOLUTE
bval: Path("...bval"),
bvec: Path("...bvec")
]
]
// Access: item.dwi.nii (Path object, no concatenation needed)
Key differences:
-
No outer tuple; items are flat maps.
-
Entity metadata lives in
item.meta.*. -
Paths are absolute
java.nio.file.Pathobjects. -
Config key names appear directly (e.g.
item.dwi, notitem.data.dwi).
Path 2: Plugin beta.1–5 → 0.3.0
The primary change is the flat output format becoming default. Add
flatten_output: false as a temporary bridge while updating downstream code:
Channel.fromBIDS(params.bids_dir, 'config.yaml', [flatten_output: false])
Then migrate map accesses following the patterns in Path 1 Step 4 and remove the option.
Breaking changes by version
Troubleshooting
"Reserved key 'meta'" error
BidsConfigLoader rejects configs that use meta as a suffix name. Rename the
suffix in your YAML:
# ❌ Rejected
meta:
plain_set: {}
# ✅ Renamed
subject_metadata:
plain_set: {}
suffix_maps_to: meta
Null items in channel
Items are dropped when a required group is missing for named_set or mixed_set.
Check your config’s required list against the actual entity values present in your
dataset.