From 5b738d234c68daa785ef6599d6cbc5561dfe9438 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 20 Aug 2024 16:36:48 -0400 Subject: [PATCH 1/2] feat(schema): Validate the iEEG data files have associated electrodes.tsv --- src/schema/meta/context.yaml | 9 +++++++++ src/schema/rules/checks/ieeg.yaml | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/schema/rules/checks/ieeg.yaml diff --git a/src/schema/meta/context.yaml b/src/schema/meta/context.yaml index 8783b46371..8deb853cc2 100644 --- a/src/schema/meta/context.yaml +++ b/src/schema/meta/context.yaml @@ -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 diff --git a/src/schema/rules/checks/ieeg.yaml b/src/schema/rules/checks/ieeg.yaml new file mode 100644 index 0000000000..1a60e35de0 --- /dev/null +++ b/src/schema/rules/checks/ieeg.yaml @@ -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 != "" From bd6ee0eca6c80db650d32988ad9de7ed2d3a96cb Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 20 Aug 2024 16:40:44 -0400 Subject: [PATCH 2/2] feat(schema): Add associations rule for electrodes --- src/schema/meta/associations.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/schema/meta/associations.yaml b/src/schema/meta/associations.yaml index 503fa728c1..ee2320585e 100644 --- a/src/schema/meta/associations.yaml +++ b/src/schema/meta/associations.yaml @@ -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'])