sccn / eeglab

EEGLAB is an open source signal processing environment for electrophysiological signals running on Matlab and developed at the SCCN/UCSD

Home Page:https://eeglab.ucsd.edu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EEGLAB STUDY: 'datselect' function ignored when reading erspdata

LauraKlatt opened this issue · comments

Description

When creating a STUDY design, the function std_makedesign() still accepts the input 'datselect'. In previous versions of EEGLAB this input command allowed the user to select only a subset of trials for a given design (e.g., only correct trials). I'm now using EEGLAB v. 2021.1. When creating a design with std_makedesign(), the datselect input is still accepted and in the command window a confirmation is printed (e.g., only trials with field corr = 1 selected). However, I now realized that when I read the data with std_erpplot(), the datselect setting is ignored. Since the 'datselect' field also disappeared from the GUI, I assume this is an intended behavior since the major remake of eeglab, when the datselect command was probably depreciated? To make all users aware of this and to avoid errors, it might make sense to fully remove the datselect command from std_makedesign such that it returns an error message when it is used.

[Description of the bug or feature
Attach a link to Dropbox or Google Drive with screenshots and your data if possible.
]


#### Steps to Reproduce
  1. Create a STUDY and add a STUDY design with std_makedesign(), including the input 'datselect'. E.g., I ran the following command:

STUDY = std_makedesign(STUDY, ALLEEG, 2, ...
'name','Design2: MidSounds - Condition x Response',...
'delfiles','off',...
'defaultdesign','off',...
'variable1','condStr',...
'values1',{'OdorBoth','OdorLeft','OdorRight','Aonly'},...
'vartype1','categorical',...
'variable2','button',...
'values2',{'right','left'},...
'vartype2','categorical',...
'datselect',{'soundpos',{'mid'}},...
'subjselect',SUBJECT,...
'filepath',PATHOUT');

  1. Precompute ERSPs (or ERPs), e.g.,

[STUDY, ALLEEG] = std_precomp(STUDY, ALLEEG, {},'erp', 'on', 'ersp','on','erspparams',...
{'cycles', [3 0.5], 'freqs', [4 30], 'nfreqs', 52, 'timesout', 300, ...
'baseline', NaN, 'commonbase', 'on', 'basenorm', 'off', 'trialbase', 'off'} ,...
'itc','on');

  1. Read single-trial data to check if 'datselect' command was considered. E.g.,:

%read raw power values per condition
[STUDY, erspdata, ersptimes, erspfreqs, events, paramsersp] = std_readdata(STUDY, ALLEEG, 'channels', channels, 'timerange', [], 'freqrange', [], 'subject', SUBJECT{s}, 'singletrials', 'on', 'design', STUDY.currentdesign, 'datatype', 'ersp', 'subbaseline', 'off');

  1. Compare trial counts for each erspdata cell with trial-counts previously obtained from the event structure or with known per-condition trial counts (in my case, it was pretty obvious that the datselect command was not considered, cause the trial numbers exceeded the number of trials that were included in the experiment for the condition I wanted to select (soundpos = mid).

#### Expected behavior: [*What you expected to happen*]

The procedure shows that when the data are read for the selected design, the settings included in std_makedesign() for the 'datselect' command are not considered.


#### Actual behavior: [*What actually happened*] The trial counts don't correspond to the numbers I should get if the datselect command was applied properly.
#### Versions
OS version [14.1.2 (23B92)]
Matlab version [2021b]
EEGLAB version [2021.1]

Note, I also briefly checked with the most recent version of EEGLAB and the same unwanted behavior still occurs.

Yes, your observation is correct. 'datselect' was removed from the GUI but was kept on the command line (while it should not have).

'datselect' was deprecated because data should be selected based on events. The same can be achieved by combining events. Also, this function was complex, not intuitive, and nobody was using it from our knowledge.

We have removed 'datselect' from the help message and now issue an error if you use it in 0a4fc63