bids-standard / bids-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/bids-validator/
MIT License
1 stars 4 forks source link

deno validator: warning missing events.tsv file for emptyroom noise task #12

Closed monique2208 closed 1 week ago

monique2208 commented 2 months ago

I am getting a warning EVENTS_TSV_MISSING about the noise task that is part of empty room data for an meg dataset. Since this is explicitly how this task should be labelled according to the specification, should there not be an exception for noise as there is for rest?

EVENTS_TSV_MISSING Task scans should have a corresponding 'events.tsv' file.
If this is a resting state scan you can ignore this warning or rename the task to include the word "rest".
        /sub-emptyroom/ses-20190619/meg/sub-emptyroom_ses-20190619_task-noise_channels.tsv
        /sub-emptyroom/ses-20190619/meg/sub-emptyroom_ses-20190619_task-noise_meg.fif
        12 more files with the same issue

we are actually upgrading this warning to an error for our system, is there a way to avoid this error for the noise task specifically through configuration?

effigies commented 2 months ago

The place to fix this will be in the schema:

https://github.com/bids-standard/bids-specification/blob/0698f5a59db2e06c4559473c34432ce03b2306d5/src/schema/rules/checks/events.yaml#L4-L19

I would add the following selector:

    - (datatype != "meg" || entities.subject != "emptyroom")

Rather than matching on task-noise, catching the meg/sub-emptyroom seems better targeted to this case.

Would you be willing to open a PR over on the spec?

Moo-Marc commented 1 month ago

Rather than matching on task-noise, catching the meg/sub-emptyroom seems better targeted to this case.

This would not work for me. task-noise recordings are allowed under individual participant sessions instead of sub-emptyroom.

effigies commented 1 month ago

Can you update this section of the schema (note that it's in the specification repository) with your proposal?

https://github.com/bids-standard/bids-specification/blob/7ddb7beb108b9b90811f52f26c072645c3c97d3f/src/schema/rules/checks/events.yaml#L11-L20

Moo-Marc commented 1 month ago

I'm not sure about the syntax, so someone should check, but something like this (replacing line 18): - !(datatype == "meg" && (entities.subject == "emptyroom" || entities.task == "noise"))

It could be simpler since emptyroom should have task-noise, but I'd keep the subject check to make it a bit more robust.

effigies commented 1 month ago

Yes, that looks right though I would probably just distribute the not:

$$\neg(A \land (B \lor C))$$ $$\neg A \lor \neg(B \lor C)$$ $$\neg A \lor \neg B \land \neg C$$

datatype != "meg" || entities.subject != "emptyroom" && entities.task != "noise"