GithubHelp home page GithubHelp logo

epnev / continuous_time_ca_sampler Goto Github PK

View Code? Open in Web Editor NEW
19.0 8.0 13.0 4.27 MB

The code takes as an input a time series vector of calcium observationsand produces samples from the posterior distribution of the underlying spike in continuous time.

License: GNU General Public License v2.0

MATLAB 100.00%

continuous_time_ca_sampler's Introduction

Join the chat at https://gitter.im/epnev/ca_source_extraction

MCMC spike inference in continuous time

The code takes as an input a time series vector of calcium observations and produces samples from the posterior distribution of the underlying spike in continuous time. The code also samples the model parameters (baseline, spike amplitude, initial calcium concentration, firing rate, noise variance) and also iteratively re-estimates the discrete time constant of the model. More info can be found at

Pnevmatikakis, E., Merel, J., Pakman, A. & Paninski, L. (2014). Bayesian spike inference from calcium imaging data. Asilomar Conf. on Signals, Systems, and Computers. http://arxiv.org/abs/1311.6864

For initializing the MCMC sampler, the algorithm uses the constrained deconvolution method maintained separately in https://github.com/epnev/constrained-foopsi

Contributors

Eftychios A. Pnevmatikakis, Simons Foundation

John Merel, Columbia University

Contact

For questions join the chat room (see the button above) or open an issue (for bugs etc).

Acknowledgements

Special thanks to Tim Machado for providing the demo dataset.

License

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 2 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 http://www.gnu.org/licenses/.

continuous_time_ca_sampler's People

Contributors

epnev avatar farznaj avatar jsmerel avatar rysk-t avatar

Stargazers

 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

continuous_time_ca_sampler's Issues

Missing file "constrained_foopsi"

Dear developers,

while looking for a method to infer spikes from calcium imaging traces that I can compare to my usually used method, I stumbled across this repository.
I downloaded it just to try it out and in each run I get the error of a file missing:
Undefined function or variable 'constrained_foopsi'.
Where do I find this file?

I greatly appreciate your help!
Best regards
Jana Wrosch

Cannot run wrapper

Hi there,

I was trying to implement this but cannot run wrapper.m, which shows

"Initializing using noise constrained FOOPSI... Struct contents reference from a non-struct array object.

Error in cvxprob (line 48)
selected = cvx___.solvers.selected;

Error in cvx_begin (line 41)
assignin( 'caller', 'cvx_problem', cvxprob( varargin{:} ) );

Error in cvx_foopsi (line 20)
cvx_begin quiet

Error in constrained_foopsi (line 178)
[c(:,rep),bas(rep),cin(rep)] = cvx_foopsi(y,b,c1,sn,b_lb,g,w_,~mis_data);

Error in get_initial_sample (line 20)
[c,b,c1,g,sn,sp] =
constrained_foopsi(Y,params.b,params.c1,params.g,params.sn,options);

Error in cont_ca_sampler (line 123)
params.init = get_initial_sample(Y,params);

Error in wrapper (line 12)
SAMP = cont_ca_sampler(Y,params);"

Anyone have some idea what's happening? Thanks a lot!

Error

Hi @epnev !

What we are doing now is updating the temporal components on the first iteration with constrained foopsi and running the second iteration with MCMC, as recommended in the paper. But when I do this I get this error:

Error using get_next_spikes (line 66)
Error: File: /Users/axel/Desktop/ca_source_extraction-master/removeSpike.m Line: 46 Column: 1
The input character is not valid in MATLAB statements or expressions.

Error in cont_ca_sampler (line 238)
[spiketimes, ~] = get_next_spikes(spiketimes_(:)',A_*Gs',Ym',ef,tau,sg_^2, rate,
std_move, add_move, Dt, A_);

Error in update_temporal_components (line 205)
parfor jj = 1:length(O{jo})

Please let me know how to proceed.

Thank you very much,
Ginny

Out of memory when using optimal_foopsi_lars

Hi,

I tried to reconstruct the spikes of a single calcium trace and ran into some memory issues (on a machine with 128 GB ram). But maybe I'm just calling optimal_foopsi_lars the wrong way? My first test was:

[Z, b] = optimal_foopsi_lars(y, 0.94, 0.1);

where y is a 71984x1 calcium trace (100Hz).

??? Out of memory. Type HELP MEMORY for your options.

Error in ==> optimal_foopsi_lars>lars_regression_noise at 81
    M = -X'*X;            % N x N matrix

Error in ==> optimal_foopsi_lars at 17
    [~, ~, spikes, ~, ~] = lars_regression_noise(y', Ginv, 1, sn^2*T);

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.