Miniscope Board

General Category => Data Analysis => Topic started by: Jesper.vernooij on August 18, 2016, 08:51:57 PM

Title: Error in msExtractFiring and additional basic questions for analysis
Post by: Jesper.vernooij on August 18, 2016, 08:51:57 PM
Hi everybody,

We have recently gotten some sessions with neurons popping up, therefore we have delved into the analysis part of the miniscope. All the standard functions in msRunBatch and msRun seem to work fine up till ms = msExtractFiring(ms); where I get the following error:

>> ms = msExtractFiring(ms);
 Undefined function or variable 'C1'.

Error in fast_oopsi/est_MAP (line 305)
                C    = C1;                      % update C

Error in fast_oopsi (line 165)
[n C posts(1)] = est_MAP(F,P);

Error in msExtractFiring (line 25)
    [n_best p_best V2 C] = fast_oopsi(F,V,P);

Does anyone know how to fix this? I assume C1 is not produced by the while loop in est_MAP where it should be produced because of some reason. It it perhaps because of some of the thresholds or ROIs I have set? Can I just uncomment the msExtractFiring and still get a meaningful ms.mat?

Other basic questions (I might have already asked them on the old forum, but it might be good to have the answers here as well):
 1- What features are important when selecting the threshold for ms = msSelectFluorThresh(ms), ROIs in ms = msSelectROIs(ms), the mean frame in ms = msMeanFrame(ms,downsample), the best alignment in ms = msSelectAlignment(ms);.
 2- Once all current processing functions are ran, which parameters contain what information? (important ones, like post-proc traces for all segments, ).
 3- Is there a function that creates a video file of the processed traces, like the one on the main page of the miniscope website?

I'm sorry for the amount of questions for one post, but I hope the answers will benefit all :)

Thank you,

Jesper
Title: Re: Error in msExtractFiring and additional basic questions for analysis
Post by: Daniel Aharoni on August 18, 2016, 11:28:03 PM
Hi Jesper,
msExtractFiring() implements an algorithm developed by Vogelstein, http://www.stat.columbia.edu/~liam/research/pubs/vogelstein-fast.pdf (http://www.stat.columbia.edu/~liam/research/pubs/vogelstein-fast.pdf). His source code, Fast_Oopsi can be found on GitHub here, https://github.com/jovo/fast-oopsi (https://github.com/jovo/fast-oopsi). I don't think I have run into this particular error in the past but I will try to see if I can reproduce it. msExtractFiring() attempts to deconvolve out the slow calcium decay from the dF/F signal. Fast_Oopsi is a particularly good approach to doing this but you can also work with some more straightforward deconvolutions such as the deconvlucy() function in MATLAB.

Answers to your other quections:
Title: Re: Error in msExtractFiring and additional basic questions for analysis
Post by: Jesper.vernooij on August 18, 2016, 11:50:39 PM
Thank you very much Daniel!

I'll look into the deconvlucy() function if I can't get fast-oopsi to work and post my results if any.
Title: Re: Error in msExtractFiring and additional basic questions for analysis
Post by: kjlawlor on April 16, 2018, 08:56:43 PM
I am getting the same error in regardsto undefined function or variable 'C1'. Was this issue ever resolved? Thanks!
Title: Re: Error in msExtractFiring and additional basic questions for analysis
Post by: Daniel Aharoni on May 02, 2018, 05:41:18 PM
Hi kjlawlor,
I can't remember what became of this issue but I suggest you switch over to doing your processing and analysis with the CaImAn package, https://github.com/flatironinstitute/CaImAn. Definitely the standard in the field right now and what we are now using.