GithubHelp home page GithubHelp logo

jovo / oopsi Goto Github PK

View Code? Open in Web Editor NEW
24.0 8.0 9.0 62 KB

up-to-date code for model-based inference of spike trains from calcium imaging

License: Apache License 2.0

MATLAB 100.00%

oopsi's Introduction

better algorithm/implementation for fast-oopsi now available

imho, there is no reason to use this repo anymore unless you really want to use the particle filter based approach, i recommend that you use the above codes for R, python, and matlab.

oopsi algorithm info

This is a repo containing the most current code for doing model-based spike train inference from calcium imaging. Manuscripts explaining the theory and providing some results on simulated and real data are available from the fast-oopsi, smc-oopsi, and pop-oopsi github repositories. Those repositories also contain code that you may run and data to download to play with things. Any question, ask them in the issues tab. Please let me know of any positive or negative experiences. Much Obliged, jovo

A question we often get is: "how shall we interpret the output? probability of spiking? instantaneous firing rate??

the answer is: yes, maybe :)

the "issue" is the lack of calibration data, which means we do not know the absolute size of a calcium transient evoked from a single spike. we estimate it from the data, but if the neuron happens to always spike twice, for example, our estimate will be off by a factor of 2.

we can think of the above this way: is it likely that the neuron to spikes multiple times per time bin?

if so, i don't normalize the output, and interpret it as the instantaneous firing rate.

if not, i normalize the output so that its max is 1, and then i interpret it as the probability of a spike.

i hope this helps!

if not, please post issues here

oopsi's People

Contributors

jovo avatar rysk-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oopsi's Issues

Parameter fitting in fast_oopsi.m fails for b

Nice code! I was trying to do parameter estimation using fast_oopsi, and I found that the likelihood oscillates if I try to estimate the baseline flourescence.

A minimum working example:

V = struct();
V.dt = 0.03
V.est_sig = 1;
V.est_lam = 1;
V.est_gam = 1;
V.est_a = 1;
V.fast_ignore_post = 1;
V.fast_iter_max = 100;
V.fast_plot = 1;

%The critical line
V.est_b = 1;

fast_oopsi(ones(1, 10000), V);

The problem appears to be in estimating b --- if we set V.est_b=0, then the oscillations disappear.

Typo in the definition of P.lam

oopsi/demo.m, Line 12:
P.lam = 0.1; % firing rate = lam*dt

Here, I believe the comment should be "firing rate = lam/dt".
To avoid confusion, it may be better to substitute P.lam with P.fr, and use lam exclusively for the expected number of spike counts for each time bin (dt).

fluorescence time series

Hi Joshua,

Could you provide the real calcium trace data that you used for your papers please?

Thanks.

Receiving errors like "Undefined function or variable "C1" when using it for a single time series

I have been trying to quantify spontaneous Ca recordings in the Olfactory bulb, when i came across your very attractive code on Github, fast-oopsi.
As I am new to the concept of spike deconvolution, i tried to include my traces in a Matlab matrix (a modification to your demo.m is attached), but i get an error:
"Undefined function or variable "C1.
Error in fast_oopsi/est_MAP (line 306)
C = C1; % update C
Error in fast_oopsi (line 166)
[n C posts(1)] = est_MAP(F,P);
Error in oopsie_test (line 35)
[data(l).Nhat data(l).Phat] = fast_oopsi(F2,V,P);"
As suggested, I have tried passing each time-series as a vector on its own, but the same error persists.
Could you please help me figure out the problem. Thanks a lot in advance.
Highly obliged for your kind attention
Regards,
Soham

a.zip

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.