====== Motex Overview ======
Some matlab routines for downloading, processing and converting mouse GCaMP data from [[http://benuccilab.brain.riken.jp|Benucci lab]] to [[:mrtools:overview|mrTools]] format.
====== Motex download ======
Requires two repositories:
* **motex** git clone https://github.com/justingardner/motex.git motex
* **mrTools** git clone https://github.com/justingardner/mrTools.git mrTools
Download both and add both to your Matlab path: addpath(genpath('~/proj/mrTools')) and addpath(genpath('~/proj/motex'))
====== Download data ======
Instructions for connecting to server and downloading data are [[gruprivate:motex|here]]
===== Download =====
You can download files using the motexGetData function to a local directory that you should create on your computer. The default is ~/data/motex/raw
% make the local directory (assuming you have not already)
mkdir ~/data/motex/raw;
% download data for M190802_RN
motexGetData('M190802_RN');
Note that it defaults to looking in particular directories for the data and the log files (see help motexGetData). You can override these by doing:
% specify the paths where data and logs will be read from. Note that either
% of these can be cell arrays if you want the program to search multiple directories
motexGetData('M190802_RN','fromDataPaths=/Volumes/tex/IMAGING','fromLogPaths=/Volumes/DATA/MOUSE/LOGS','toPath=~/data/motex/raw');
====== Convert data to mrTools ======
After you have downloaded the raw data locally then you can convert it to mrTools with the function motex2mrtools
% convert all of the runs in M190718_RN which have been dowloaded with motexGetData
motex2mrtools('M190718_RN');
If you only want to process a particular session/run you can specify that as follows:
% convert only a specific session / run
motex2mrtools('M190718_RN','sessionNum=1','runNum=1');
You can also specify the stimulus type:
% convert only a specific session / run
motex2mrtools('M190718_RN','sessionNum=1','runNum=1', 'stimulusType=manual');
See help on motex2mrtools for more details.
This function first analyzes the raw data folders and then the logs. If you just want that information, you can run those independently:
% load raw info (if you don't need to convert to mrtools but want to use these functions)
d = motexGetRawInfo('M190718_RN');
% load logs
d = motexGetLogs(d);
The functions will analyze the analog inputs to determine when the photo-diode picks up a frame trigger. It will put up a figure that looks like the following and ask you to confirm: