Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schema): Validate the iEEG data files have associated electrodes.tsv #1896

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/schema/meta/associations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ channels:
extension: .tsv
inherit: true

electrodes:
selectors:
- intersects([suffix], ['eeg', 'ieeg', 'meg'])
- extension != '.json'
target:
suffix: electrodes
extension: .tsv
inherit: true

coordsystem:
selectors:
- intersects([suffix], ['eeg', 'ieeg', 'meg', 'nirs', 'motion', 'electrodes', 'optodes'])
Expand Down
9 changes: 9 additions & 0 deletions src/schema/meta/context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,15 @@ properties:
type: array
items:
type: string
electrodes:
description: 'Electrodes file'
type: object
required: [path]
additionalProperties: false
properties:
path:
description: 'Path to associated electrodes file'
type: string
coordsystem:
description: 'Coordinate system file'
type: object
Expand Down
14 changes: 14 additions & 0 deletions src/schema/rules/checks/ieeg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
iEEGElectrodesRequired:
issue:
code: IEEG_ELECTRODES_REQUIRED
message: |
iEEG data files must have an associated electrodes.tsv.
A single electrodes file may apply to multiple data files
via the inheritance principle.
level: error
selectors:
- suffix == "ieeg"
- extension != ".json"
checks:
- associations.electrodes.path != ""