Data Analysis - GoldbergLab/RodentJoystick GitHub Wiki
After the full post processing pipeline is executed, any number of analysis scripts from the list below can be called.
#Data Analysis Scripts Below is a list of analysis functions and a brief overview. For detailed information and the full specification see the individual function's documentation.
###PPUtilities Common utilities used by multiple scripts.
- rdir: returns a list of files or directories (supports arbitrary file matching - ex: rdir([pwd, '*']);
- load_jstructs: returns a cell array of jstruct structures from a list of directories of processed data.
- load_stats: returns a struct array of stats structures from a list of directories of processed data.
-
extract_contingency_info: returns the contingency values for a specific directory day, assuming that directory is in the format
root\<date>_<contingency>\<date> - sort_traj_into_bins: sorts trajectories from a stats.traj_struct field into bins, and can be used to filter trajectories by defining a 2 element bin.
- draw_heat_map: draws a heat map, supporting options for logarithmic mapping and color percentiles.
- hist2d: computes a 2d histogram from 2 dimensional data.
- multiday_pcolor_template: a template for plotting progress in two dimensional data over time.
###SensorDistributions This group of scripts displays/generates data for various sensor onset/offset distributions.
Dependencies: requires jstruct, stats struct to be saved in directory
- gaps: plots the distribution of the duration a sensor was on
- np_js_distribution: plots the nosepoke joystick onset distribution
- np_post_distribution: plots the nosepoke post touch onset distribution
- multipcolor_np_js: generates a pcolor plot of a single mouse's progress in the nosepoke joystick onset distribution for all days with data.
- multipcolor_np_post: generates a pcolor plot of a single mouse's progress in the nosepoke post onset distribution for all days the mouse.
###ActivityDistributions This group of plots performs various heat maps of velocity/acceleration/position profiles.
Dependencies: requires stats, velaccel, and velaccelraw structs to be saved in directory (generated by xy_getstats and compute_vel_accel_distr):
- multiday_video: generates a video showing the progression of the activity heat map for multiple days
- activity_summary_heat_maps: performs all of the analysis listed below on a single figure
- activity_heat_map: heat map of joystick position during valid trajectories
- velocity_heat_map: heat map of trajectory velocities using median
- velocityvar_heat_map: heat map of trajectory velocity variation using difference between 75th and 25th percentiles for each cell.
- accel_heat_map: heat map of trajectory acceleration at each point in (x,y) space using median measure
- accelvar_heat_map: heat map of trajectory acceleration variation at each point in (x,y) space using difference between 75th and 25th percentiles
- accelnorm_heat_map: heat map of the normal component of acceleration at each point in (x,y) space
- accelang_heat_map: heat map of the angular component of acceleration at each point in (x, y) space
- get_vel_accel_distr: loads information required for the above distributions/plots assuming that they have been saved to appropriate directories (data only). also combines data when appropriate rather than compute from scratch.
- compute_vel_accel_distr: computes all information required for the above distributions/plots (data only) - can be very slow. does it separately for each day.
###Trajectory Analysis Dependencies: requires stats structs to be saved in directories:
-
getmaxcontlength: returns the length of time that a specific trajectory stayed within some threshold, finding the maximum continuous length, if multiple segments satisfy this condition.
-
js_touch_dist: computes the recommended center hold threshold based on current data, and plots a distribution of the maximum hold times for all trajectories.
-
multi_js_touch_dist: runs js_touch_dist for multiple directories/days
-
multipcolor_jstouch_dist: generates a pcolor plot showing the progress in the js_touch_dist distribution over multiple days
-
perform_sector_analysis: computes a probability distribution describing the probability a trajectory covers the angle described as well as computing a target sector based on some reward rate
-
multi_sector_analysis: runs perform_sector_analysis for multiple days.
-
trajectory_analysis: bins trajectories by hold time and then computes percentiles of trajectory distance at each time point
-
multi_trajectory_analysis: calls trajectory_analysis of magnitude of several days on one set of plots
-
multipcolor_trajectory_analysis: generates a pcolor plot showing the progress in the median trajectory displacement over multiple days.
###Time Distributions Dependencies: requires jstruct, stats structs to be saved in directories (future edits may change this to improve efficiency, requiring a separate struct containing raw data instead)
-
hold_time_distr: plots distribution of hold times of all trajectories using js onset to js offset as measure of hold times
-
rewarded_time_distr: plots distribution of rewarded hold times
-
rewardrate_distr: plots distribution of reward rate by hold time interval
-
joystick_to_reward_distr: plots distribution of joystick touch onset time to reward time
-
get_rewardandht_distr: generates/computes the data used by the 4 plots above.
-
all_holdtimes_distr.m: plots all four kinds of hold time distributions above onto a single figure.
-
multipcolor_allht: generates a pcolor plot using hold_time_distr to show the progress in learning hold times.
-
generate_time_distr: generates a histogram showing the activity of the mouse using nosepoke and reward timestamps.
-
multi_time_distr: runs generate_time_distr for multiple days
#Post Processing GUI The post processing GUI (pp_gui) is a tool to visualize multiple plots and perform data analysis. It allows selection of multiple different days and allows selection of any combination of plots. The process for making a new function and adding support for it to the GUI is described on the page Guidelines for New Analysis Scripts