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

[ENH] events.tsv should be sorted by onset values #1732

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions src/modality-specific-files/task-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ and a guide for using macros can be found at
-->
{{ MACROS___make_columns_table("task.TaskEvents") }}

The content of `events.tsv` files SHOULD be sorted by values in the `onset` column.

Note for MRI data:
If any acquired scans have been discarded before forming the imaging data file,
ensure that an `onset` of 0 corresponds to the time the first image was stored.
Expand Down
12 changes: 12 additions & 0 deletions src/schema/rules/checks/events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ StimulusFileMissing:
- columns.stim_file != null
checks:
- exists(columns.stim_file, "stimuli") == length(columns.stim_file) - count(columns.stim_file, "n/a")

SortedOnsets:
issue:
code: EVENT_ONSET_ORDER
message: |
The onset column in events.tsv files should be sorted.
level: warning
selectors:
- suffix == "events"
- extension == ".tsv"
checks:
- sorted(columns.onset) == columns.onset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwblair Do you agree?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n/a would be the only thing to mess it up if allowed. Otherwise looks good.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I think it being a warning should make that an annoyance, not a show-stopper. Will add a comment, though.

effigies marked this conversation as resolved.
Show resolved Hide resolved