bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

participants.tsv participant IDs not checked against folder names

Open arnodelorme opened this issue 5 years ago • 2 comments

For example

participant_id	gender	age	aios_score
subj-07xxxxxxxx	M	41	70
subj-08a85ac6aa	F	54	92
subj-08xxxxxxxx	M	56	80

While the folder were named sub-07xxxxxxxx, sub-08a85ac6aa and sub-08xxxxxxxx This passed the validator no problem (validator from Jan 31, 2020).

arnodelorme avatar Apr 01 '20 00:04 arnodelorme

EDIT: Looking back at this after a while it took me a time to see what's wrong: In participants.tsv, the participant_id column contains subj-, not sub-

The issue I see here is that with a given participants.tsv, the validator should parse the participant_id column and use each row to populate a list subject_ids.

Then it should take the list subject_ids and assert that each entry corresponds to an existing directory at the BIDS root.

...

This new "feature" also has a flip side:

The validator should find all sub-<label> directories at the BIDS root, and collect them into a list.

Then it should go to participants.tsv and assert that each item from the list is represented by a single row (using the participant_id column)

sappelhoff avatar Jul 24 '20 15:07 sappelhoff

Actually, a check for this is in place here:

https://github.com/bids-standard/bids-validator/blob/b542235df3579ed1328058ad41777c5dd96d2d73/bids-validator/validators/bids/fullTest.js#L163-L169

using this function:

https://github.com/bids-standard/bids-validator/blob/b542235df3579ed1328058ad41777c5dd96d2d73/bids-validator/validators/bids/subjects.js#L1-L62

and this issue code:

https://github.com/bids-standard/bids-validator/blob/b542235df3579ed1328058ad41777c5dd96d2d73/bids-validator/utils/issues/list.js#L273-L277

the question is ... why is it not triggered? Any idea @rwblair ?

sappelhoff avatar Feb 23 '21 08:02 sappelhoff