Storing data on participant groups in bids-compliant file structure

Dear authors,
In our project amongst other topics we work on ensuring data storage compliant with the BIDS standard. While mne-bids allows to store such information as task, session, age etc, we could not find a clear way of storing the “group” marker (e.g. left-handed, right-handed etc). Could you suggest us the most meaningful way of storing such kind of information? A code example containing some mne-bids tools would be most appreciated :smiley:
Thanks in advance
Best regards,
Michał

hi,

This is typically written in the participants.tsv file.

You can put this information in the raw.info[“subject_info”][“hand”]. See
https://mne.tools/dev/generated/mne.Info.html#mne.Info

Alex

@agramfort’s answer is the correct way to do it.

Actually I believe we currently don’t cover this in any examples of the MNE-BIDS docs. But we should :sweat_smile:

@sappelhoff thoughts?

Thank you for your ansewer. Maybe the example was not very good. By a “group” I meant not only handedness, but any arbitrary group (the examples may be more or less abstract: student of IT/ student of maths/student of psychology, education: only school education/university bachelor/university master/university PhD etc).

These also go into participants.tsv as custom columns and, ideally, are accompanied by an explanation of their meaning in participants.json. See the BIDS spec:
https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#participants-file

I don’t believe MNE-BIDS currently allows adding custom columns via its API, but it will respect (and preserve) anything you’ve added manually.

Richard

indeed, you’ll have to write some custom code for this, e.g., using pandas to read in the participants file and then editing it.

I’d do that as a last step, I think.

I believe there is an open issue for this: https://github.com/mne-tools/mne-bids/issues/439. This may be worth revisiting …

Mainak

Thank you for your responses! I think we will try to implement saving such kind of data into participants.tsv.