Skip to content

shayokdutta/RippleDetectionAnalysis

Repository files navigation

Ripple detection with Trodes analysis and evaluation code

Note: nelpy is widely used during this analysis. However, the version of nelpy used is a modified one. See links below:

Nelpy
Nelpy used for analysis
Nelpy github

Trodes
Trodes + RippleDetection module software
How to use Trodes + RippleDetection module

Paper
Journal of Neural Engineering
bioRxiv preprint

Posters and other links can be found on sd54.web.rice.edu.

File Descriptions

This is being updated. This is not completed yet

General File(s)

  1. DataAnalysisScripts/ripple_filtering.py basic ripple detection functions

Single Channel Detection Analysis

  1. DataAnalysisNotebooks/SingleChannel.ipynb has canonical single channel ripple detection

  2. DataAnalysisScripts/singleChannelSimulatedDetections/singleChanAnalysis_singleChanDefn.cpp varies detection threshold params while simulating single channel detections

  3. DataAnalysisScripts/singleChannelSimulatedDetections/singleChanAnalysis_twoChanDefn.cpp varies detection threshold params while simulating single channel detections on two channel cannonical ripple definition

Multi-channel Detection Analysis

  1. DataAnalysisNotebooks/MultichannelAnalysis.ipynb has canonical detections using two channels

  2. DataAnalysisScripts/voting/voting2of2.cpp varies detection threshold params while simulating ripple detections across 2 channels that have to agree within 15 ms

  3. DataAnalysisScripts/voting/voting2of3.cpp varies detection threshold params while simulating ripple detections across 3 channels in which 2 of which agree that ripples are detected within 15 ms of each other

Synthetic Ripple Detection Analysis

  1. DataAnalysisNotebooks/SyntheticRippleAnalysis.ipynb has general pipeline for generating synthetic ripples and explores parameter space across varying synthetic ripples

  2. DataAnalysisScripts/simulatedRippleDetectionsSingleChan/main.cpp performs simulated ripple detections on synthetic data using a single channel with varying ripple amplitudes and

How to modify and run things

This is not complete. Unfortunately, a lot if this requires you to figure it out on your own. I shall make it more complete over time but if you want to explore before it has been updated feel free to reach out to me.

In general, all analysis begins with the filtering/thresholding functions located in the file listed after 1 in the File Descriptions section. In order to run this with your own data or own filter coefficients and run the evaluations that we have run in the paper, follow the steps below.

  1. Modify the filter coefficients within the ripple_filtering.py file.

  2. Grab a .rec file from Trodes or your own data and load it up into Python with the same filtering that is done during the realtime detections or expected to happen during the realtime detections. E.g., the version of Trodes used in our RippleDetector has a 400 Hz lowpass filter for LFP so data is first lowpass filtered at 400 Hz with modified extraction functions provided within the bitbucket repository for the RippleDetector.

  3. Perform ripple band filtering, power signal calculations and threshold crossing detections in order to determine canonical ripples. The code for these are provided within ripple_filtering.py. Examples of how to use this are within SingleChannel.ipynb and MultichannelAnalysis.ipynb. Save the canonical detection start and end bounds in separate files. See files 3, 4, 6 and 7 from the File Descriptions section to examine how they are being processed.

  4. Perform ripple band filtering and power estimations for how it will be in the realtime detections. Examples of these are shown in the analyisis notebooks. Save the final power estimation signal (i.e., the signal after the ripple band filtering, absolute value and lowpass filtering).

  5. Modify realtime detection estimation files (voting cpp files and/or singleChanAnalysis cpp files) to have desired file names that are defined in the macros at the top. Run the realtime detection code once it is setup appropriately!

  6. To visualize and plot results, modify the files within the figureCode_final directory. In particular, Figure4_SingleChannelAnalysis.ipynb and Figure5_MultiChannelAnalysis.ipynb. How the outputs should look in order to input them into these files are provided within the paperData/figureData file directory.

About

Analysis code and selected data for ripple detection paper with Trodes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published