This repository contains basic local field potential analysis scripts and functions.
Link to article »
- 1 System Requirements
- 2 Installation Guide
- 3 Description of Code's Functionality
- 4 Instructions of Use
- 5 Citation
- 6 License
- MATLAB version: The code was developped using Matlab R2017b and also tested using Matlab R2019b and R2023b.
- Operating System: The code was developped and tested under Windows 7 and 10.
- MATLAB Toolboxes: Curve Fitting Toolbox, Signal processing toolbox, Wavelet Toolbox ( and helperCWTTimeFreqPlot.m from R2016a, included in the repository)
- Third-party MATLAB functions: Kelly Kearney (2024). 'boundedline.m', GitHub. Retrieved March 25, 2024. Brandon Kuczenski (2024). 'vline.m', MATLAB Central File Exchange. Retrieved March 25, 2024.
- Clone the repository to your local machine:
git clone https://github.com/LizbethMG/NatureNeuroscience_2024_LFP.git
- Navigate to the cloned directory:
cd NatureNeuroscience_2024_LFP
- Download the data used for the analysis and add it to your 'Data' project's folder.
- Add the project folder to your MATLAB path. You can do this in two ways:
- Open MATLAB.
- In the Command Window, type the following command, replacing
yourpath
with the path to your project:addpath('yourpath'); savepath;
- Open MATLAB.
- On the Home tab, in the Environment section, click Set Path.
- Click Add with Subfolders.
- Browse to the project folder and click OK.
- Click Save and then Close to save the changes.
- Install (if not already done) the Matlab Toolboxes mentioned in "1 System Requirements"
→ Basic analysis scripts to explore LFP signals around grooming events. The complete description can be found in the Methods section of the paper.
♦ For more detailed information, users can refer to the in-code comments within the script and its functions.
config.m
configuration file of the experiment(s)- data files copied in the Data/ folder
slmg_waveletn.m
- Loads data for each experiment, and prepares it for further analysis. It ensures that the data is standardized across events and sessions to facilitate consistent analysis.
- Low pass filtering
- Wavelet analysis
- Compute power within a specified frequency band
- Compute maximum wavelet power within specified frequency band
plotWaveletContour
Creates a contour plot of continuous wavelet transform (cwt) coefficients over time and frequency.
- Generates different plots within a frequency band:
- Wavelet contour
- Power vs time
- Power vs frequency
maxPower
Maximum power and its corresponding time and frequency values
- Ensure you added the project folder to your MATLAB path and set it as the current folder. In Matlab Command Window type
pwd
the result should be'YOUR_PATH\NatureNeuroscience_2024_LFP'
- Run the Live Script file
LFP_Analysis.m
. It will run the code for the data folder selected inconfig.m
lineconfWV.animalList = {M#ID};
.
It features the electrophysiological recordings in the mice's orbitofrontal cortex around grooming events. The data is available at the Open Science Framework DOI: 10.17605/OSF.IO/KDMJT
- Download dataset 2.
- Add the downloaded folder to your MATLAB path containing the code inside the
Data\extractedData
folder. - To analyze data from subject 1 you would have the source data file as:
YOUR_PATH\NatureNeuroscience_2024_LFP\Data\extractedData\M1\datasource_M1.mat
Each sub-folder in the data set 1 corresponds to a single subject (SAPAP3-KO). Each experiment has its configuration information in theconfig.m
♦ Expected run time for demo: For one subject (20 grooming events, 4 channels) like the one on dataset2 (M1), on a general-purpose computer expect the following approximately runtimes:
~ 14 s -- CPU: Intel Core i9-7960X @ 2.8 GHz, RAM: 32 GB, Operating System: Windows 10 64-bit, Matlab 2019b.
If you use this code or data we kindly ask you to cite our work.
- Data:
(APA style) Mondragón-González, S. L. (2024, March 26). 2024_Mondragon-Gonzalez_NatureNeuroscience. https://doi.org/10.17605/OSF.IO/KDMJT
- Article: Mondragon et al 2024: Link to paper
@article{Mondragon2024, title = {Closed-loop recruitment of striatal interneurons prevents compulsive-like grooming behaviours}, author = {Sirenia Lizbeth Mondragón-González and Christiane Schreiweis and Eric Burguière}, journal = {Nature Neuroscience}, year = {2024}, url = { https://www.nature.com/articles/s41593-024-01633-3 }}
Copyright <2024> <COPYRIGHT Sirenia Lizbeth Mondragón-González>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.