Giter Site home page Giter Site logo

oasis_matlab's People

Contributors

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oasis_matlab's Issues

What is tau_r and tau_d in 'exp2' kernel model?

I'm trying to use OASIS for calcium deconvolution. I'm a beginner in this field and I don'know which kernel model is recommended.

In this part:
% pars: parameters for the specified convolution kernel. it has
% different shapes for differrent types of the convolution model:
% 'ar1': scalar
% 'ar2': 2 x 1 vector, [r_1, r_2]
% 'exp2': 2 x 1 vector, [tau_r, tau_d]
% 'kernel': maxISI x 1 vector, the kernel.

What's the difference between this three models?
I've tried the 'ar1' model but the result seems not good. Some calcium event are in the falling edge of the spikes, which is not expected.
Next I plan to use 'exp2'. It seems to be related to tau (the timescale of the sensor). GCaMP6f is used for imaging so the tau is 0.7s, but what value should tau_r, tau_d be?
Thank you very much.

readme didn't quite work for me

`>> run examples/paper/fig*.m

Error using run (line 72)
RUN cannot execute the file 'examples/paper/fig*.m'. RUN requires a valid MATLAB script`

run examples/Paper/test_all.m

did work.

i'm using matbal R2016b

How to obtain onset times of deconvolved events?

I believe the deconvolved signal consists of events with a typical rise and decay and variable amplitude? How can I obtain the onset times of all events that underlie the deconvolved signal? It seems to be this likely is determined as part of the deconvolution process, but I don't see these data exposed in the output parameters. Any help would be appreciated - thank you.

error

Hi,

I run the setup.m first and it went well.
And then I use the example you gave:

[c, s, options] = deconvolveCa(y, 'foopsi', 'ar1', 'smin', -3, 'optimize_pars', true, 'optimize_b', true)
Error:File: foopsi_oasisAR1.m Line: 155 Column: 21
Identifier 'h' is not a function or a shared variable. To share 'h' with nested function, initialize it in the current scope. For more
information, see Sharing Variables Between Parent and Nested Functions.

Error in deconvolveCa (line 120)
[c, s, options.b, options.pars] = foopsi_oasisAR1(y-b0, options.pars, options.lambda, ...

This error pop out in other examples too.
Please help.

Thank you so much
Hanyan

a potential type or bug in update_g

I got a warning from MATLAB.
After review the code, It does look worth checking.
Line 35 of update_g.m

tmp_h = exp(log(g)*(0:maxl)');   % response kernel
tmp_hh = cumsum(h.*h);        % hh(k) = h(1:k)'*h(1:k)

"h" looks to be tmp_h instead.
actual h is coming from rss_g function.

It may just work, since they are same.
Please check.

oasisAR1 output with unexpected size

If oasisAR1.m is called with an empty array as the first argument, as in constrained_oasisAR1; line 179:
[solution, spks, active_set] = oasisAR1([], g, lam, [], active_set);

then the second output variable, s, may not have the same size as c.
Specifically, it will have active_set(end)-1 fewer elements than c.

A quick workaround is to modify lines 92-93 of oasisAR1.m to
len_y = sum(active_set(end,3:4))-1;
c = zeros(1,len_y);
s = zeros(1,len_y);

Error when using constrained methods from deconvolveCa

When I am running constrained foopsi method on my calcium df/f traces given decay constants, sometimes I get the following error:

code:
[c, s, options] = deconvolveCa(trace,'constrained','ar1', 0.9381, 'optimize_b');

error:

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-8500.

Error in constrained_oasisAR1/update_lam_b (line 189)
active_set(end,1) = active_set(end,1) - lam*g^(active_set(end,4));

Error in constrained_oasisAR1 (line 125)
update_lam_b();

Error in deconvolveCa (line 114)
[c, s, options.b, options.pars, options.lambda] = constrained_oasisAR1(y,...

This is the plot of calcium traces that is being deconvoluted:

dff_trace_for_bug_deconv_8500frames

Also, if I just run with foopsi method, no error occurs.

estimate_time_constant typo and missing variables

Hello!

I've already discussed this topic with Johannes, but he said the matlab code is not identical to the python one, so here goes the issue:

I encountered a problem with some of my data -- when in ' estimate time constant.m' cannot find a good model, the software crashes here:
while max(abs(roots([1,-g(:)']))>1) && p < 5
% warning('No stable AR(%i) model found. Checking for AR(%i) model \n',options.p,options.p+1);
p = p + 1;
g = estimate_time_constants(y,p,sn,lags);
end

because it cannot find 'options', but also because estimate_time_constants is not available in the package I downloaded (I guess this is a typo and it's calling itself again?).
Thanks

CLaudia

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.