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

[BUG] bids.diagnostic does not properly handle "trial_type_col" argument #745

Open
3 of 6 tasks
kacross opened this issue Feb 7, 2025 · 2 comments
Open
3 of 6 tasks

Comments

@kacross
Copy link

kacross commented Feb 7, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Operating system

  • Linux
  • Mac
  • Windows

Operating system version

- Windows 10 Enterprise Version 22H2 OS build 19045.5131

Platform

  • MATLAB
  • Octave

Platform version

- MATLAB 2023a

bids-matlab version

v0.1.0

branch / commit number

Expected Behavior

bids.diagnostic(mybids,'trial_type_col','type')

Use the column "type" to create a diagnostic events table

Current Behavior

Uses the default column "trial_type" even though a trial_type_col argument is provided.

Error message

Warning: Escaped character '\C' is not valid. See 'doc sprintf' for supported special characters. 
> In bids.internal.error_handling (line 51)
In bids.internal.list_all_trial_types (line 101)
In bids.internal.list_events (line 70)
In bids.diagnostic (line 177) 
Warning:
No "trial_type" column found in files:
	- D: 
> In bids.internal.error_handling (line 60)
In bids.internal.list_all_trial_types (line 101)
In bids.internal.list_events (line 70)
In bids.diagnostic (line 177)

Anything else?

I believe this is because the list_events.m does not pass the "trial_type_col" argument to the list_all_trial_types call on line 67:

current line 67 in list_events.m
trial_type_list = bids.internal.list_all_trial_types(BIDS, task, ...
'tolerant', true, 'verbose', true);

should be:
trial_type_list = bids.internal.list_all_trial_types(BIDS, task, ...
'trial_type_col', trial_type_col,...
'tolerant', true, 'verbose', true);

@Remi-Gau
Copy link
Collaborator

I am struggling to reproduce the issue by adapting the test for this function:
https://github.com/bids-standard/bids-matlab/blob/main/tests/tests_slow/test_diagnostic.m

can you attach a sample events.tsv from your dataset?

Also are you using a Windows machine?

@kacross
Copy link
Author

kacross commented Feb 10, 2025

The tsv is attached (as a text file due to github not allowing my .tsv extension).
I used and I called as
bids.diagnostic(mybids,'split_by','task','trial_type_col','type','output_path',fullfile(bidsdir,'derivatives','import'),'verbose',false);

sub-CM40_task-reaching_run-1_events.txt

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

No branches or pull requests

2 participants