Author Topic: Error message while running msRun  (Read 4526 times)

thkim3

  • Newbie
  • *
  • Karma: +1/-0
    • View Profile
Error message while running msRun
« on: September 02, 2016, 10:09:11 AM »
Hi,

We just began our GRIN lens implantation surgery and I was trying to run the MATLAB data analysis files on your sample images before I get mine.

I was running msRun and I got this error message:

Extracting dF/F traces: 90
Extracting dF/F traces: 100
Reference to non-existent field 'time'.

Error in msExtractFiring (line 9)
V.dt = mode(diff(ms.time))/1000;

Error in msRun (line 52)
ms = msExtractFiring(ms);

When I erase ms = msExtractFiring(ms); in msRun, it goes well but I get another problem selecting LED:

should I just click on LED or drag and draw a circle around LED?

Nothing happens after this

Select ROI
Keep ROI? (Y/N)y
Select LED

even though I selected the LED on Figure 1 pannel..

Has any one experienced same issue?

I have no one with  experience in MATLAB programming and am pretty lost....

Hope you could give me some advice on these matter

Thank you,

 TaeHyun

Daniel Aharoni

  • Administrator
  • Full Member
  • *****
  • Karma: +15/-0
    • View Profile
Re: Error message while running msRun
« Reply #1 on: September 02, 2016, 03:36:36 PM »
Hi TaeHyun,
The Miniscope analysis code still needs some work to make it user friendly. It was initially written mainly for lab use internally and we haven't gotten around to updating it for the Miniscope community. For now think of it as a jumping off point for analyzing your Miniscope data.

That being said, the issues you are having are easily fixed.
  • Reference to non-existent field 'time'. Can you tell me which sample data set you are running the analysis on? There is likely an issue with the timestamp.dat file caused by a bug in an old version of the Miniscope DAQ software. You can try running the analysis on a different sample data set or just run the line below in MATLAB to fix the problem:
    ms.time = linspace(0,ms.numFrames/30*1000,ms.numFrames);
  • Select ROI and Select LED. The ROI being selected defines the size of the environment the animal is exploring. So you generally will click and drag your mouse to make a rectangle outline of the experimental environment. Select LED is used to select the color value range of the LED for position tracking. This is done by dragging and positioning an oval around to the LED then double clicking. It is a good idea to zoom in around the LED first and make sure that the selection oval only contains pixels that should the LED. Once you double click the figure pixels that fall inside the LED color range will turn green. You want only the LED to turn green while the rest of the environment doesn't change.

Take a look at the msPlayVidObj() function. This function will play a video of the Miniscope data after applying things like alignment and dF/F. It is a nice way to check the results of your analysis as you are working through it.

thkim3

  • Newbie
  • *
  • Karma: +1/-0
    • View Profile
Re: Error message while running msRun
« Reply #2 on: September 06, 2016, 10:55:03 AM »
Hi Daniel,

I was using files in  CA1 Linear track, animal G95 day 10

As you advised, I downloaded different files (Subiculum Open Field) and ran into same error message.

Then, I realized that using only msCam1.avi and behavcam1.avi, settings_and_notes, Thumbs, timestamp.dat filed (since using whole sets of .avi files took so long to analyze..) might have caused the problem.

When I used the whole sets of video files, there was still a message in the beginning:

>> msRun
Problem matching up timestamps for H:\04- 실험 data\Miniscope\Subiculum Open Field-20160903T015036Z\Subiculum Open Field
Calculating column correction. 7.7759% done

but the analysis process smoothly moved on to behavior part.

So.. not using the whole video file set was the problem I guess?

And here is a following question;

Is there any way I can analyze only a subset of recorded video files?

For problem in selecting LED, I had an error message like :
Unknown function hsvthreshold ...
but the error message was gone after I copied hsvthreshold file from util folder to SingleFunctions folder

Thank you for your advise!

TaeHyun

Daniel Aharoni

  • Administrator
  • Full Member
  • *****
  • Karma: +15/-0
    • View Profile
Re: Error message while running msRun
« Reply #3 on: September 06, 2016, 05:45:40 PM »
Hi TaeHyun,
Yes, only running the analysis on a subset of the data collected in a single recording session would have caused that ms.time error. Basically the analysis tried to match up the time stamps in timestamp.dat with the recordings in msCam.avi. If the number for frames in timestamp.dat does not match the number of frames across all your msCam.avi files then it will throw that error. You could modify the initial analysis to still match up time stamps or just run 'ms.time = linspace(0,ms.numFrames/30*1000,ms.numFrames);' after the msGenerateVidObj to approximate the time stamps for the msCam.avi videos. Once you run that line you should be able to run the rest of the analysis on a subset of data.

thkim3

  • Newbie
  • *
  • Karma: +1/-0
    • View Profile
Re: Error message while running msRun
« Reply #4 on: September 07, 2016, 10:25:24 AM »
Thanks Daniel,

I have finally run the msRun script without any error message to the animal movement track figure!

I was expecting some sort of dF/F graph or other summary data figures, but after the message: 'Calculating animal position. 98.xxxx% done.'  , nothing happens and the script ends.

Is this normal? Or am I doing something wrong? Do I need to run another script to analyze single cell firing with behavior track?

When I typed in 'msPlayVidObj',

Error : msPlayVidObj (line 5)  for frameNum=1:downSamp:vidObj.numFrames

pops up.


chalspark

  • Newbie
  • *
  • Karma: +2/-0
    • View Profile
Re: Error message while running msRun
« Reply #5 on: November 01, 2016, 09:10:51 AM »
Hello TaeHyun,
msRun.m script doesn't include function in order to show dF/F. If you want to check result of dF/F, we should use msRastorPlot function.

sarah.lopez1

  • Newbie
  • *
  • Karma: +0/-0
    • View Profile
Re: Error message while running msRun
« Reply #6 on: November 07, 2016, 03:53:50 PM »
Hi Daniel,

We are also having an error message during our data analysis, always at the same step, during the "align across sessions" stage of analysis.  Our error message reads:

Extracting dF/f traces: 82.2707
Extracting dF/F traces: 90.4977
Extracting dF/F traces: 98.7248
Extracting firing... 75%
Undefined function or variable 'msRef'.

Error in msRun (line 55)
ms=msAlignBetweenSessions (msRef,ms);

Based on this error message read out, please let me know if you have advice on how to correct this error.

Thank you!
-Sarah


Daniel Aharoni

  • Administrator
  • Full Member
  • *****
  • Karma: +15/-0
    • View Profile
Re: Error message while running msRun
« Reply #7 on: November 07, 2016, 06:38:32 PM »
Hi Sarah,
It looks like you are trying to run msAlignBetweenSessions from msRun.m. msAlignBetweenSessions should only be run when you have multiple recordings from the same animal and msAlignBetweenSessions should be commented out in msRun.m (because it generally shouldn't be used here). When you do have multiple recording sessions to align you should use the Batch version of this function which is located in msBatchRun.m.