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

Fix bug if no event descriptions are present; support stim_type column in events.tsv #680

Merged
merged 3 commits into from
Jan 14, 2021

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Jan 14, 2021

If no event descriptions could be generated, we'd crash as we'd try
to access descriptions like an array, while our placeholder would only
be a string. This is fixed now.

The other part of this PR is related to the naming of the column in the
events.tsv file that contains the event description. According to
BIDS, this column is optional and shall be named trial_type. Now
I've come across multiple (older?) datasets where the column is
called stim_type instead. I've now added support for reading this
column if trial_type is not present. A warning will be issued in
this case, informing the user that the column name should be changed.

This was necessary to read the ds000117 datset from
https://openneuro.org/datasets/ds000117

Merge checklist

Maintainer, please confirm the following before merging:

  • All comments resolved
  • This is not your own PR
  • All CIs are happy
  • PR title starts with [MRG]
  • whats_new.rst is updated
  • PR description includes phrase "closes <#issue-number>"

If no event descriptions could be generated, we'd crash as we'd try
to access descriptions like an array, while our placeholder would only
be a string. This is fixed now.

The other part of this PR is related to the naming of the column in the
events.tsv file that contains the event description. According to
BIDS, this column is optional and shall be named `trial_type`. Now
I've come across multiple (older?) datasets where the column is
called `stim_type` instead. I've now added support for reading this
column if `stim_type` is not present. A warning will be issued in
this case, informing the user that the column name should be changed.

This was necessary to read the ds000117 datset from
https://openneuro.org/datasets/ds000117
@hoechenberger hoechenberger changed the title [MRG] Fixing quickstart doc bug, write_raw_bids doc bug, and coordsystem.json overwriting error (#675) Fix bug if no event descriptions are present; support stim_type Jan 14, 2021
hoechenberger added a commit to hoechenberger/mne-bids-pipeline that referenced this pull request Jan 14, 2021
Closes mne-tools#41

Remaining / highlightes issues:

- Original dataset doesn't store fine-calibration and crosstalk files
   according to BIDS, so not doing Maxwell filtering for now

- I'd like to calculate the contrast of "face" vs "scrambled", however,
   to do that, I'd need to merge the "familiar" and "unfamiliar" events
   to "faces". We need to add support for operations like this.

Tests will fail until mne-tools/mne-bids#680
has been merged.
@hoechenberger hoechenberger changed the title Fix bug if no event descriptions are present; support stim_type Fix bug if no event descriptions are present; support stim_type column in events.tsv Jan 14, 2021
@codecov-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

Merging #680 (7ba638a) into master (9b82c86) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #680      +/-   ##
==========================================
+ Coverage   93.71%   93.80%   +0.08%     
==========================================
  Files          22       22              
  Lines        2707     2713       +6     
==========================================
+ Hits         2537     2545       +8     
+ Misses        170      168       -2     
Impacted Files Coverage Δ
mne_bids/read.py 97.33% <100.00%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9b82c86...7ba638a. Read the comment docs.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

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

I don't know where "stim_type" comes from, but I think it's fair enough to handle it as proposed in this PR.

@hoechenberger
Copy link
Member Author

1 job failing due to download problems.

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

LGTM

+1 for MRG when CIs are green

@hoechenberger
Copy link
Member Author

Since the download problem seems to be persistent (@adam2392 was running into this issue too), and given that all but that one CI runs are green, this should be good to merge.

@sappelhoff sappelhoff merged commit 17fbf49 into mne-tools:master Jan 14, 2021
@sappelhoff
Copy link
Member

thanks @hoechenberger

@hoechenberger hoechenberger deleted the stim_type branch January 14, 2021 13:44
agramfort pushed a commit to mne-tools/mne-bids-pipeline that referenced this pull request Jan 14, 2021
* Process Faces dataset

Closes #41

Remaining / highlightes issues:

- Original dataset doesn't store fine-calibration and crosstalk files
   according to BIDS, so not doing Maxwell filtering for now

- I'd like to calculate the contrast of "face" vs "scrambled", however,
   to do that, I'd need to merge the "familiar" and "unfamiliar" events
   to "faces". We need to add support for operations like this.

Tests will fail until mne-tools/mne-bids#680
has been merged.

* Remove cruft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants