Skip to content

ValueError: Split EEGFiles don't seem to match what are in the events #236

@shaigoldman

Description

@shaigoldman
  • CML Data Readers version: 0.9.8
  • Python version: 3.6.10
  • Operating System: unix on rhino2

Description

On subject R1052E_2, unable to load any EEg for events from YC1. Instead I get ValueError: Split EEGFiles don't seem to match what are in the events. Looking into the rhino database reveals that the EEG split files exist, but are perhaps misnamed. It should be possible to get cmlreaders to recognize these files despite the slight misnaming.

What I Did

cmlreaders import get_data_index, CMLReader
reader = CMLReader(subject='R1052E', montage=2, session=3, experiment='YC1')
events = reader.load('events')
elec_scheme = reader.load('contacts')[114:115]
reader.load_eeg(events=events, rel_start=-100, rel_stop=800,
            scheme=elec_scheme).to_ptsa()

This apparently happens because the spliEEG files for R1052E_2 are named as though they were R1052E montage 0. See: '/protocols/r1/subjects/R1052E/experiments/YC1/sessions/3/ephys/current_processed/noreref'.

On my own copy of cmlreaders, I edited the filesearcher in cmlreaders/readers/eeg.py as so:

255             names = Path(self.filename).name.split("_")
256             if 'R1052E' in names and '2' in names:
257                 # fix here
258                 names.remove('2')

This solves the problem, but it's a hack, and won't work on another case of the same nature, of which I assume there are a few.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions