/MiniscopeAnalysis

Analysis package for miniscope data

Primary LanguageMATLABGNU General Public License v3.0GPL-3.0

NOTE: MiniscopeAnalysis is not being developed anymore. This version is only compatible with the v3 miniscope DAQ software. Please keep submiting requests concerning issues or pull requests. I am currently working on a new analysis pipeline called PIMPN: https://github.com/etterguillaume/PIMPN PIMPN performs similar analyses using Google Colaboratory (virtual Python environment, and inputs/outputs compatible with MiniscopeAnalysis.

MiniscopeAnalysis

Analysis package for miniscope data Written by Guillaume Etter (Sylvain Williams Lab, McGill University) This is an updated version of the Miniscope analysis package developed by Daniel Aharoni at UCLA in collaboration with the Golshani lab, Silva lab, and Khaki lab. It combines core functions of the original ms analysis package with NormCorre alignment and CNMFE source extraction.

INSTALLATION:

  1. Download or clone this repositor, and add its path to your list of active Matlab paths
  2. You need to download or clone the latest versions of CNMFE (https://github.com/zhoupc/CNMF_E) and NormCorre (https://github.com/flatironinstitute/NoRMCorre) and add them to your path. This is important as the MiniscopeAnalysis package relies on these two toolboxes OPTIONAL: You can use CellReg (Ziv lab, https://github.com/zivlab/CellReg ) for chronic cell registration. This analysis package outputs spatial footprints that can be directly used with that code.
  3. Analyse your miniscope data:
  • msRun2018: in Matlab, go to your folder containing your miniscope videos (one session) and type ‘msRun2018’
  • msBatchRun2018: type this after having added the paths pointing to the folders containing your miniscope data (one folder for one session) to the ‘msBatchFileList.m’ file. Be careful not to enter them as strings (do not add the ‘’) but just as is (e.g. /Users/Documents/Calcium_data/cool_experiment/8_24_2018/H04_M37_S12/ ) Once you have entered all your sessions, just type in msBatchRun2018 and let it work. For your information the time spend analyzing is saved in each ms structure. This can give you an idea of the total time required to analyze all your sessions.

PARAMETERS: -Downsampling: spatial downsampling is very important. It can really speed up your analysis but when done in excess can hinder you from finding cells. I would recommend a factor of 2 to start with, you can increase it up to 4 if your cells appear large and clear.

-isnonrigid: If set to 'true', will perform NormCorre non-rigid motion correction (can be slightly slower), if set to 'false', will perform classic rigid motion correction

-Downsampling: spatial downsampling is very important. It can really speed up your analysis but when done in excess can hinder you from finding cells. I would recommend a factor of 2 to start with, you can increase it up to 4 if your cells appear large and clear.

  • Save to google drive: I implemented this one because I love to have my desktop analyse data, and then shoot it to the cloud once it’s done so I could access it from anywhere (café, bar, family reunion, etc…) If set to 'true', it will ask you to provide a root path where all your data will be backed up. Note that it can also be a hard-drive, a USB key, etc… Sub-folders will be created using the name that you enter for each subject in the DAQ software.

OUTPUT: Although this package tries to be as consistent as possible with previous versions of the ms package, there are a few changes here and there.

ms.Experiment: your experiment name, taken from the subject name that you enter in the DAQ software

ms.ds: the downsampling factor you used

ms.shifts: the full information about corrected motion generated by NormCorre

ms.Options: parameters used to perform CNMFE

ms.Centroids: Centroids used to initialize CNMFE. Please not these are not your final centroids (use SFPs to look at your actual spatial footprints and deduce centroids)

ms.SFPs: spatial footprints of the cells found while performing CNMFE extraction. You can plot them by typing: figure; imagesc(max(ms.SFPs,[],3));

ms.CorrProj: Correlation projection from the CNMFE. Displays which pixels are correlated together and suggests the location of your cells

ms.PeakToNoiseRatio: Peak-to-noise ratio of the correlation projection. Gives you an idea of most prominent cells in your recording.

ms.numSegments is now call ms.numNeurons (although not everyone performs calcium imaging in neurons... might be renamed in future releases)

In your behav structure, the background detected is now saved in the structure for plotting purposes later on: behav.background