MNE-BIDS-Pipeline processing EEG separately in a combined MEEG dataset

Hi,

I may have found another documentation issue, now related to processing EEG separately in a combined MEEG dataset. At the documentation of the data_type option one of the examples says:

β€œThe dataset contains simultaneous recordings of MEG and EEG, and we only wish to process the EEG data, which is stored inside the MEG files:”

ch_types = ['eeg']
data_type = 'eeg'

I tried this and got the error below at the very beginning of the processing:

[16:47:00] β”Œβ•΄πŸš€ preprocessing/_01_data_quality Now running  πŸ‘‡
[16:47:00] β”‚ ❌ preprocessing/_01_data_quality sub-01 A critical error occurred. The error message was: Missing file: /imaging/davis/Projects/SpeechMisperceptionMEEG/MNE-BIDS_data/sub-01/eeg/sub-01_split-01

Aborting pipeline run. The full traceback is:

Traceback (most recent call last):

  File "/home/ma09/.conda/envs/my_mne1.4_fix/lib/python3.11/site-packages/mne_bids_pipeline/_run.py", line 54, in wrapper
    out = memory.cache(func)(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/ma09/.conda/envs/my_mne1.4_fix/lib/python3.11/site-packages/mne_bids_pipeline/_run.py", line 147, in wrapper
    in_files = kwargs["in_files"] = self.get_input_fnames(**these_kwargs)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/ma09/.conda/envs/my_mne1.4_fix/lib/python3.11/site-packages/mne_bids_pipeline/steps/preprocessing/_01_data_quality.py", line 46, in get_input_fnames_data_quality
    in_files = _get_raw_paths(
               ^^^^^^^^^^^^^^^

  File "/home/ma09/.conda/envs/my_mne1.4_fix/lib/python3.11/site-packages/mne_bids_pipeline/_import_data.py", line 540, in _get_raw_paths
    _update_for_splits(in_files, key, single=True)

  File "/home/ma09/.conda/envs/my_mne1.4_fix/lib/python3.11/site-packages/mne_bids_pipeline/_run.py", line 335, in _update_for_splits
    assert not missing, f"Missing file: {bids_path.fpath}"

AssertionError: Missing file: /imaging/davis/Projects/SpeechMisperceptionMEEG/MNE-BIDS_data/sub-01/eeg/sub-01_split-01

So the pipeline is looking for the eeg subdirectory in the subject directory, which is not right as the data type is β€˜meg’ in the BIDS structure.

I think this is likely a documentation error and the correct example settings should be:

ch_types = ['eeg']
data_type = 'meg'

If this is indeed the case and others agree I’m happy to correct this.

Best wishes,
MΓ‘tΓ©

System info:

Platform             Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.17
Python               3.11.3 | packaged by conda-forge | (main, Apr  6 2023, 08:57:19) [GCC 11.3.0]
Executable           /home/ma09/.conda/envs/my_mne1.4/bin/python
CPU                  x86_64 (32 cores)
Memory               251.4 GB

Core
β”œβ˜‘ mne               1.4.0
β”œβ˜‘ numpy             1.24.3 (OpenBLAS 0.3.23 with 32 threads)
β”œβ˜‘ scipy             1.10.1
β”œβ˜‘ matplotlib        3.7.1 (backend=agg)
β”œβ˜‘ pooch             1.7.0
β””β˜‘ jinja2            3.1.2

Numerical (optional)
β”œβ˜‘ sklearn           1.2.2
β”œβ˜‘ numba             0.57.0
β”œβ˜‘ nibabel           5.1.0
β”œβ˜‘ nilearn           0.10.1
β”œβ˜‘ dipy              1.7.0
β”œβ˜‘ openmeeg          2.5.6
β”œβ˜‘ pandas            2.0.2
β””β˜ unavailable       cupy

Visualization (optional)
β”œβ˜‘ pyvista           0.39.1 (OpenGL unavailable)
β”œβ˜‘ pyvistaqt         0.0.0
β”œβ˜‘ ipyvtklink        0.2.2
β”œβ˜‘ vtk               9.2.6
β”œβ˜‘ qtpy              2.3.1 (None=None)
β”œβ˜‘ pyqtgraph         0.13.3
β”œβ˜‘ mne-qt-browser    0.0.0
β””β˜ unavailable       ipympl

Ecosystem (optional)
β”œβ˜‘ mne-bids          0.12
β”œβ˜‘ mne-bids-pipeline 1.3.0
β””β˜ unavailable       mne-nirs, mne-features, mne-connectivity, mne-icalabel

You’re right, this is another doc issue. In BIDS, combined M/EEG recordings are of the meg data type.

Best wishes,
Richard

1 Like

This has been fixed: Fix for documentation issue related to processing EEG separately in a combined M/EEG dataset by allermat Β· Pull Request #751 Β· mne-tools/mne-bids-pipeline Β· GitHub