Git Product home page Git Product logo

spike_tools's Introduction

Tools for analyzing calcium imaging with L0 Optimization

Code from Fleming & Jewell et al. (2021). https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0252345

Full paper dataset is available at figshare: https://doi.org/10.6084/m9.figshare.14627238.v1

Data preprocessing

Inspired and built off of the preprocessing toolkits of Theis et al (2016). Three main steps:

  1. Remove linear trends from the data
  2. Upsample data by a constant factor
  3. Normalize the data by percentiles

... plus a few additional formatting tools.

Preprocessing is applied to in vitro and in vivo imaging data (via data_preprocessing.py) prior to further analysis. See Examples 1 and 2 in the Demo Notebok (demo.ipynb).

Estimate AR1 decay rate from calibration data

Assuming that the underlying calcium concentration decays exponentially between spikes, that is c_t = decay_rate * c_{t-1}, we use the true spike times to estimate the decay_rate.

Decay rate estimation is performed on in vitro data consisting of simultaneously recorded imaging data and spike times (via estimate_decay_rates.py). See Example 1 in the Demo Notebook (demo.ipynb).

Estimate spikes with a target average firing rate via L0 optimization

Given a target firing rate and decay we estimate spikes so that the average estimated firing rate is close to the target firing rate.

Spike estimation is performed on in vitro and in vivo imaging data (via estimate_spikes.py). See Examples 1 and 2 in the Demo Notebook (demo.ipynb).

A target firing rate (in Hz) and decay rate must be inputted by the user to perform spike estimation. We provide recommended median decay rates for GCaMP6f and GCaMP6m for in vivo data, since decay rates are not directly observed in vivo (see recommended_decay_rates.rtf). Note that these recommended decay rates are for spike estimation on 60 Hz data. Imaging data can be upsampled in the preprocessing step. If estimating spikes at a final sampling rate other than 60 Hz, the decay rate must be adjusted (see note in recommended_decay_rates.txt).

spike_tools's People

Contributors

jewellsean avatar weston-fleming avatar

Watchers

 avatar  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.