LFP from raw data neuralynx

Hi
I am using brain storm to analyse electrophysiological data acquired using neuralynx (continuous ncs file). I tied to generate an LFP form loaded raw data but it did say data mismatch. I want also to integrate single unit data sorted using kilosort and cleaned using phy2 to the LFP. The other part is to do place cell analysis using behavioral data acquired using neuralynx.
Your program can be used friendly and it will be helpful if I can do all that and other things using neuralynx data.
Thanks
Mohamed

Please give some more context to this error:

  • how exactly do you get to this error
  • copy-paste here the full error messages you get from the Matlab command window.

I want also to integrate single unit data sorted using kilosort and cleaned using phy2 to the LFP. The other part is to do place cell analysis using behavioral data acquired using neuralynx.
Your program can be used friendly and it will be helpful if I can do all that and other things using neuralynx data.

I am not very familiar with this field.
If these are questions, please describe exactly the features, methods or interfaces you'd like to access from Brainstorm, that are not available at the moment.

Hi,
I am using Neuralynx for data acquisition. I did load my data to brainstorm and I can do some analysis with it. Many thanks. Brainstorm offer many features and methods for many interfaces. I hope that it will be extended to Neurallynx interface. It is a hard work thanks for making it an open source.

Cheers,

Mohamed

Hello Francois,

I would like to know how to import single unit data. when sorting is done outside of brainstorm. As I am using Neuralynx I can not do the spike sorting through brainstorm. Thanks.

Best,

Mohamed

@mpompolas @Sylvain

Hi Francois,

The function convert Raw to LFP is shadowed and when I click on it I still get the pipeline convert raw to LFP. but when I run it popup BOX with data type mismatch
Error dat type mismatch
invalid inputs for process
"Convert Raw to LFP

I also made an events file for single units I did upload it but when I tried to do the analysis example raster plot I got a graph with no thing on it. attached is the events file. Thanks for your help.
events.mat (632.4 KB)

The problem you describe here is unrelated with the file format. What you select in the Process1 box is an "epoch", not a "continuous file".
You must link the recordings to the database with the menu "Review raw file", not "Import MEG/EEG".

https://neuroimage.usc.edu/brainstorm/e-phys/Introduction#Import_recordings
https://neuroimage.usc.edu/brainstorm/Tutorials/ChannelFile#Review_vs_Import

I also made an events file for single units I did upload it but when I tried to do the analysis example raster plot I got a graph with no thing on it. attached is the events file.

I'm sorry, I'm not sure I understand what you expect from us by sharing this file.
Can you please explain better what you've doing, what you're trying to do, and what doesn't work as expected? Screen captures would help a lot.

Thanks Francois. I did use Import MEG/EEG that is why it did not work. I tied "Review raw file" and I have the function "convert raw to LFP". For the file it is to verify with you if it is the right format for events. Thanks again for your help.

All the best,

Mohamed

Hi Francois,

When trying to convert to lfp, I got a message The DeriveLFP toolbox is not installed. download and install the latest version. I have the latest version of Brainstorm. Where can I download that toolbox. Thanks.

Best,

Mohamed

Hi Francois,

When I run convert raw to lfp function without despiking I get this error


thanks for your help.
Mohamed

Hi all,

regarding the behavioral data:
Loading behavioral data is supported only in NWB files and Tucker Davis acquisition systems.

Regarding spike sorting outside of Brainstorm and sequentially importing the events as a Brainstorm structure:
I've written an example procedure here: https://neuroimage.usc.edu/brainstorm/e-phys/ConvertToBrainstormEvents
The fact that your raster plot doesn't have anything in it, means that no spikes were detected within the trials you selected.
A common mistake that people do is to use the wrong sampling rate when they go from samples to seconds. Make sure the values of the timestamps in your events.mat make sense.

Regarding convert raw to LFP error:
You mention that the function is shadowed, yet you still run it. I have the feeling that you are not dropping a "link to raw file" in the processing box.
If the filetype is correct and you still get the error, you will have to send to Francois the file to be able to assess what's going on there.
The 'Dot indexing is not supported for variables of this type' error is not informative at this point.

Regarding DeriveLFP toolbox is not installed message:
This was automatically getting downloaded and installed when users called the function (at least 3 years ago when it was designed).
Maybe the plugin manager needs reevaluation

Hello,

Regarding Raw to LFP
Here is a single channel recording.it is 20s recording. it is a Neuralynx file.

CSC2.ncs (1.3 MB)

For single units
I did upload the events and can display them with raw data when using link to raw data. But in this case all function for unit analysis are shadowed.

Thanks for your help.

Mohamed

Brainstorm should downlaod the DeriveLFP toolbox automatically.
If this doesn't work, you can try downloading manually:
http://packlab.mcgill.ca/despikingtoolbox.zip
Download the file, unzip it (NOT in any of the Brainstorm folders), and add it to your Matlab path.

When I run convert raw to lfp function without despiking I get this error

I can try to help debugging this, but I am not familiar with the e-phys processes at all, you'd need to guide me step-by-step. I need to be able to reproduce your error in order to try and fix it.
Starting from downloading the .ncs file, please tell me exactly how to reproduce the error (what files you select in process1, what processes with what options you executed, etc). Screen captures would help.

Thanks

Hi Francois,

Her is what I did
I put the file CSC2.ncs (I sent you) in a folder.
I opened Brainstorm created a new protocol then new subject after that I did review data file
a new folder is create link to raw file
I put that in process1
I click on run
process selection (box appear)
select
electrophysiology
then
1 convert raw to LFP (Despike lfp not checked)
a new folder is created
in my case mouse LFP (1k file in it) and an error appears

2 convert raw to LFP (Despike lfp selected)
no new folder 9mouse LFP) was created

I got this error

With the same file I can do preprocessing without a problem (resampling, filtering, band pass filtering, notch filter) process that are done when converting raw data to LFP.
Please let me know if you need more info. Thanks for your help

Mohamed

Thanks for the example data and the step-by-step instructions to reproduce the bugs. I could reproduce the errors on my computer and fix them.

The two errors are independent bugs:

  1. No despike: This option was incompatible with the option "Parallel processing toolbox" (in a parfor loop, the GlobalData variable is not accessible, and the test for the signal processing Tb was crashing).
    Fix: https://github.com/brainstorm-tools/brainstorm3/commit/60a261a8e944ecb4989f86deda746b0f029e2ed7

  2. The external toolbox DeriveLFP was not available in the compiled distribution of Brainstorm. I made it a new Brainstorm plugin (https://neuroimage.usc.edu/brainstorm/Tutorials/Plugins), and included it in the compiled version of Brainstorm.
    Fix: https://github.com/brainstorm-tools/brainstorm3/commit/2cf62e02ea8edb898238efdca28ecd2dc5b2e0c5

I am currently recompiling Brainstorm and will post an update before the end of the day.
Please download this last update (make sure the Brainstorm title bar indicates today's date) and try again.

Update: The new compiled version is online:

Thanks Francois. the step to convert raw data to LFP (from neuralynx file) was done successfully with the new compiled version. Unfortunately many of the function analyse LFP are shadowed. like in

  • frequency process
    -electrophysiology process
  • connectivity process is all shadowed and others.

when I did import meg/EEG I was able to do some of those analysis.
Do you have any idea why is that? thanks

Mohamed

Post screen captures showing:

  • the Brainstorm window with the file you want to process both in the database explorer and in the Process1 tab
  • the Pipeline Editor showing the disabled menus.

To make screen captures on windows easily: Press the key PrintScreen (or ALT+PrintScreen for a single window), and paste it in the forum editor with CTRL+V

Good morning Francois,
her is screen copy of what I got with my single channel file



This is from data from brainstorm tutorial


Thanks for your help

Mohamed

Nothing is wrong with what you are showing here.
The greyed-out menus are designed to be executed on other types of files. For example, for the time-frequency processes, you must epoch your data first.
https://neuroimage.usc.edu/brainstorm/Tutorials/PipelineEditor#Selecting_processes

We recommend you start by following the introduction tutorials (section Get Started - at least until #19), using the example dataset provided, before trying to process your own files.
https://neuroimage.usc.edu/brainstorm/Tutorials