Error when creating mne object

Hello everyone, I am currently working on simultaneous recordings of HD-EEG and MEG, and I want to export it to MNE-python for further analysis( after preprocessing and SSP to get rid of artifacts). I initially tried exporting in edf+ format to find that MEG sensors are not supported in edf+ format. Trying to export it in .mat/.dat generated the following error( see image attached)

error in mat

When tried to open the file using mne_out_data,using the given command
mneObj=out_mne_data('C:\Users\sxb2391\Downloads\brainstorm_db\All\data\TD05@rawTD005_CombinedMEGHDEEG_Run01\data_0raw_TD005_CombinedMEGHDEEG_Run01.mat','Raw','C:\Users\sxb2391\Downloads\brainstorm_db\All\data\TD05@rawTD005_CombinedMEGHDEEG_Run01\channel_vectorview306_acc1.mat')

The following error was obtained

C:\Users\sxb2391\AppData\Local\Programs\Python\Python39\lib\site-packages\mne\io\meas_info.py:728: DeprecationWarning: Info does not support directly setting the key 'creator', this warning will turn into an error after 0.24. You can set info['temp'] to store temporary objects in an Info instance, but these will not survive an I/O round-trip.
warn(f"Info does not support directly setting the key {repr(key)},"
C:\Users\sxb2391\AppData\Local\Programs\Python\Python39\lib\site-packages\mne\io\meas_info.py:723: DeprecationWarning: dig cannot be set directly. Please use inst.set_montage() instead. This warning will turn into an error after 0.24
warn(f'{self._attributes[key]} This warning will turn '
C:\Users\sxb2391\AppData\Local\Programs\Python\Python39\lib\site-packages\mne\io\meas_info.py:723: DeprecationWarning: projs cannot be set directly. This warning will turn into an error after 0.24
warn(f'{self._attributes[key]} This warning will turn '
C:\Users\sxb2391\AppData\Local\Programs\Python\Python39\lib\site-packages\mne\io\meas_info.py:723: DeprecationWarning: sfreq cannot be set directly. Please use method inst.resample() instead. This warning will turn into an error after 0.24
warn(f'{self._attributes[key]} This warning will turn '
Error using check>_validate_type (line 444)
Python Error: TypeError: bads must be an instance of list, got <class 'tuple'> instead.

Error in meas_info>_check_bads (line 213)

Error in meas_info>setitem (line 726)

How can I resolve the error?

Or if there is any other way to export simultaneous EEG/MEG recordings to MNE python,please let me know.

i have attached the file here

data_0raw_TD005_CombinedMEGHDEEG_Run01.mat (213.2 KB)

@SubratBastola

I fixed the bug related with the export of the bad channels:
https://github.com/brainstorm-tools/brainstorm3/commit/f1e96b8148e26302ad2651d67de7ab4ca991c4fd

Please update Brainstorm to get this fix.
Note that you don't have to explicitly pass the channel file in input, it can be obtained from the database.

@Alexandre
How can I get rid of all these DeprecationWarning?
I tried setting the _unlocked attribute to True at the beginning, but it doesn't help, as the attributes don't exist before...
The documentation recommends creating the Info structures with mne.create_info (https://mne.tools/dev/generated/mne.Info.html), but then how to I add the information I need to stick in there?

https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/io/out_mne_channel.m#L111

in MNE the edits to info are now protected in a context manager like this for example:

but setting _unlocked to True just after calling create_info should work

can you point me to the code you tried?

Alex

Thanks for confirming this was the right direction.
I found a solution that seems to work without triggering any warning:

ch_names = {'MRC23', 'MRC24', 'MRC25'};
ch_types = {'mag', 'mag', 'mag'};
mneInfo = py.mne.create_info(ch_names, 1000, ch_types);

mneSetStatus = py.getattr(mneInfo, '__setstate__');
mneSetStatus(py.dict(pyargs('_unlocked', true)));

mneGetStatus = py.getattr(mneInfo, '__getstate__');
mneGetStatus()

mneInfo{'hpi_meas'} = py.list(py.dict(pyargs('creator', 'test')));
mneInfo{'dig'} = py.list();
mneInfo{'projs'} = py.list();

Implemented in this commit:
https://github.com/brainstorm-tools/brainstorm3/commit/f2c25578866eec0be01c859101b952557010a99b#diff-12c42dea9a032ee334e1e52881bfd66e3f7329c715c06021ed22c2893729570fR113