Skip to content

Commit

Permalink
FIX: Re-add run entity to electrodes.tsv (#1722)
Browse files Browse the repository at this point in the history
* FIX: Re-add run entity to electrodes.tsv

* [ENH] Recommend electrodes usage/require inheritance

* SCHEMA: Add check to warn against excessive electrode specificity
  • Loading branch information
effigies authored Apr 26, 2024
1 parent 90ec07f commit 3322a40
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modality-specific-files/electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ and a guide for using macros can be found at
-->
{{ MACROS___make_columns_table("eeg.EEGElectrodes") }}

`*_electrodes.tsv` files SHOULD NOT be duplicated for each data file,
for example, during multiple runs of a task.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate electrode positions for a given data file.
If electrodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this.

### Example `*_electrodes.tsv`

See also the corresponding [`electrodes.tsv` example](#example-channelstsv).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ and a guide for using macros can be found at
-->
{{ MACROS___make_columns_table("ieeg.iEEGElectrodes") }}

`*_electrodes.tsv` files SHOULD NOT be duplicated for each data file,
for example, during multiple runs of a task.
The [inheritance principle](../common-principles.md#the-inheritance-principle) MUST
be used to find the appropriate electrode positions for a given data file.
If electrodes are repositioned, it is RECOMMENDED to use multiple sessions to indicate this.

### Example `*_electrodes.tsv`

```Text
Expand Down
15 changes: 15 additions & 0 deletions src/schema/rules/checks/electrodes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
ElectrodeSpecificity:
issue:
code: EXCESSIVE_ELECTRODE_SPECIFICITY
message: |
Run or acquisition entities detected in electrodes.tsv.
Electrode definitions should generally not vary within a session.
Consider creating a new session each time electrodes are reconfigured.
level: warning
selectors:
- suffix == 'electrodes'
- extension == '.tsv'
checks:
- '!("run" in entities)'
- '!("acquisition" in entities)'
1 change: 1 addition & 0 deletions src/schema/rules/files/raw/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ electrodes:
subject: required
session: optional
acquisition: optional
run: optional
space: optional

# MEG has an additional entity available
Expand Down

0 comments on commit 3322a40

Please sign in to comment.