TriFilterNet utilizes a feature selection and supervised classification approach to process electrophysiological recordings, identifying pre-grooming events within ongoing behavior. The system employs a set of triangular filters to reduce the size of the feature set, yielding a matrix of decorrelated coefficients. Subsequently, a minimal-architecture artificial neural network is used to classify behavioral states and detect pre-grooming instances based on these coefficients.
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.
- Operating System: The code was developped and tested under Windows 7 and 10.
- MATLAB Toolboxes: Deep Learning Toolbox
- Third-party MATLAB Packages: wrapped functions of RHD2000 MATLAB RHD file reader (
link to documentation)
and Kamil Wojcicki (2024). HTK MFCC MATLAB, Mathworks exchange link , MATLAB Central File Exchange.
- Clone the repository to your local machine:
git clone https://github.com/LizbethMG/Mondragon_NatNeuro_CL.git
- Navigate to the cloned directory:
cd Mondragon_NatNeuro_CL
- Download the data used for the `dataset1/m1` and add it to your project's folder data/m1.
- 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.
- You haven't installed Matlab's Deep Learning Toolbox yet, go to Matlab's main menu >> Adds-On>> Get Adds-on>> Search for "Deep Learning Toolbox" >> Install
→ Please refer to Figure 4 of the article as it provides a detailed schematic description of the code's workflow. The complete description can be found in the Methods section.
♦ For more detailed information, users can refer to the in-code comments within the script and its functions.
The core functionality of the main script:
m1_config.m
configuration file of the experiment- data/ m1/ data files
continous_classif__settings.mlx
settings for data processing
continuous_classif_fct.m
data processing is completely done in this function, including:
slmg_nextFromRecordedData.m
retrieves the next data segment from a continuous ephys recording fileslmg_read_Intan_files.m
read ephys files in a folderslmg_read_Intan_file.m
read ephys from a single file
slmg_power.m
computes the power from a signal sample.slmg_mfcc.m
computes cepstral coefficients from a signal.
slmg_NNCompute.m
classification using an artificial neural network (single electrode)slmg_ClassNNdecision.m
classification prediction according to single electrode classification results
TimestampsPredict
pre-grooming classification timestamps
♦ Expected run time for demo: For a 10-minute experiment (sampled at 30 kHz, 14 channels) like the one on the demo (m1), on a general-purpose computer expect the following approximately runtimes:
~ 8 min -- CPU: Intel Core i7-6700hq @ 2.6 GHz, RAM: 16 GB, Operating System: Windows 10 64-bit, Matlab 2019b.
- 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_TriFilterNet'
- Run the Live Script file
continous_classif__settings.mlx
. It will run the code for the demo data (Dataset1/m1) for 10 minutes and return the predictions made in that time window.
Dataset 1 features the electrophysiological recordings and the associated grooming markers used in the paper to asses the closed-loop algorithm. The data is available at the Open Science Framework DOI: 10.17605/OSF.IO/KDMJT
- Download dataset 1.
- Add the downloaded folder to your MATLAB path containing the code, inside
4_data
Each sub-folder in the data set 1 corresponds to a single experiment. Each experiment has its configuration file and raw data. - In the Live Script file
continous_classif__settings.mlx
simply change the path to the experimental data and the corresponding configuration files.
Example:- continuous_classif_settings.mlx >>
subjects_lists = "m1"
to analyze data for experiment m1 - continuous_classif_settings.mlx >>
subjects_lists = ["m1", "m2", "m3"]
to analyze data for experiment m1 to m3
- continuous_classif_settings.mlx >>
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: DOI link
@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 }}
<NatureNeuroscience_2024_TriFilterNet> Copyright (C) <2024> <Sirenia Lizbeth Mondragón-González and Eric Burguière>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.