Giter VIP home page Giter VIP logo

ecg_thermomice's Introduction

ecg_thermomice

Collection of jupyter notebooks for processing mice ECG data describes the pipeline, which we used to process data of heart potential together with stimulation pulses (trigger pulses of IR laser).

Our paper in press:

Thermogenetics for cardiac pacing Alexander V. Balatskiy, Alexey M. Nesterenko, Aleksandr A. Lanin, Vera S. Ovechkina, Semyon S. Sabinin, Elena S. Fetisova, Alexander A. Moshchenko, David Jappy, Rostislav A. Sokolov, Diana Z. Biglova, Georgy M. Solius, Ekaterina M. Solyus, Sergei V. Korolev, Oleg V. Podgorny, Ilya V. Kelmanson, Andrei V. Rozov, Andrei B. Fedotov, Tobias Bruegmann, Alexei M. Zheltikov, Andrey A. Mozhaev, Vsevolod V. Belousov bioRxiv 2024.01.02.573885; doi: https://doi.org/10.1101/2024.01.02.573885

For input we have CSV files containing one ECG potential (mostly its LR) and one trigger pulse recorded by 10MHz ADC device. For output we have picture like the following one (Fig.2 from our paper-in-press):

Fig2biorxiv

Typical example of atrium pacing with a frequency slightly higher than the intrinsic one. Pacing was at 2.5 Hz with 80 ms pulses, initial HR was โˆผ2 Hz. A. Position of the P-peak and laser pulse in relation to the R-peak in ms. Negative values mean that events occur before the reference peak. B. Change of complex shape (black curve) and heart rate (blue curve) during the experiment. Vertical red lines demonstrate the pulse widths of the trigger pulses. C. ECG signal and trigger pulses in short intervals corresponding to the beginning and ending parts of the pacing. The positions of the intervals are indicated with gray bars in panes A and B.

The most complicated thing in this image is the A pane; to build it, we have to go through the following steps:

  • the segmentation of ECG (defining R-peaks);
  • the determination of P-peak inside every R-R interval;
  • the calculation of the relative position of P-peak and trigger pulse inside corresponding R-R interval. Once you do that, you can set the relative position of P-peak and the start/end position of the trigger pulse to Y-coordinate and the number of R-R interval to the X-coordinate, then you will get a plot like shown at Fig. 1A.

The mostly commented code part demonstrating how to do that is located in the file ecg-commented-sample.ipynb; this file you are invited to use as a tutorial. It shows all phases of the protocol including baseline correction, ECG segmentation, P-peak annotation, phase-plot drawing. The phase analysis is done in-place by our scripts. Segmentation and peak annotation are done using NeuroKit2. Also we demonstrate here the application of PCA-based noise filtration.

average-complex-shape.ipynb demonstrates how to average complex shape during pacing and outside pacing period.

ecg-other-samples.ipynb demonstrates the application of the protocol to another 3 samples (without intensive comments).

ecg-resonance-visualisation.ipynb demonstrates how we can work with a complicated phase behaviour; in the notebook we analyze the 4:3 phase lock where every 4 laser pulses create a repeating pattern of 3 R-R intervals.

We hope these scripts will help you in your ECG analysis!

ecg_thermomice's People

Contributors

comcon1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.