This repository was developed for the analysis of the data generated during the making of the following paper (please cite when using any tools derived from this repository):
- Track file: the MATLAB file generated by the function
modules.process_mouse_trials_lib.ethovision_to_track_matfile; please, refer to this function for a detailed description of the data in the track file
All these modules are under the modules folder
-
modules.edge_detectorlib containing functions to detect arena edges and holes, used to extract the proper coordinates from the arena pictures in thecrop_arena_pictures.ipynbnotebook -
modules.helper_func_classlib containig miscellaneous auxiliary functions for all the other libs -
modules.iolib containg I/O functions for most of this applications; a few exceptions happen in themodules.process_mouse_trials_liblib -
modules.plot_funcauxiliary plot functions for all the other scripts -
modules.process_mouse_trials_libused to convert the Ethovision excel files into track files, and to extract metadata from track files -
modules.traj_analysisa set of functions that are used to calculate all the kinetic, geometric and uncertainty properties of the mouse trajectories -
modules.traj_to_step_matrixlib used to calculate the step probability matrices from the track files.
-
arena_picturecontains all the PNG arena pictures for theplot_mouse_trial.pyscript -
example_figsome example figures from themouse_deviation_velocity_threshold_example.ipynbnotebook -
experimentsthe preprocessed experimental data... these are track files (under their respective experiment folder), generated by thepreprocess_mice_trials.pyscript; and self-intersection files (generated by thecalc_self_intersections.pyscript) -
figspreliminary figures and analyses generated by thetrajectory_analysis_*.ipynbnotebooks -
moduleswhere the magic happens -
spatial_distributionsscripts that plot distributions of the positions and velocities of the mice; developed by another student -
step_prob_matricescontains the step probability matrices generated by thecalc_step_probability_matrix.pyscript -
step_prob_matrices_viewMATLAB plotting of the step probability matrices generated by thecalc_step_probability_matrix.pyscript
-
calc_self_intersections.pycalculates the self-crossings of the track files in theexperimentssubfolder -
calc_step_probability_matrix.pyoverlays a square lattice on the arena, and calculates the probability matrices of the mouse steps in between the lattice squares (outputs tostep_prob_matricesfolder) -
crop_arena_pictures.ipynbthis jupyter notebook is used to crop the PNG arena pictures for each experiment, and outputs: arena radius, the hole coordinates, the entrance coordinates in text files under the folderarena_picture -
export_tracks_to_txt.pydeprecated... saves the track data to txt files (not useful for anything at the moment) -
mouse_deviation_velocity_threshold_example.ipynbjupyter notebook illustrating some features of this application -
plot_mouse_trial.pya script that can be called from the terminal and used to plot a track MATLAB file under theexperimentsfolder -
preprocess_mice_trials.pybatch process Excel Ethovision files into track files and saves them in subfolders of theexperimentsfolder -
test_mouse_trials_lib.pytests many of the functionalities of this application... not all tests are guaranteed to work, since I'm constantly updating some functions, and these updates might not be backwards compatible to the time when I wrote the tests :) -
trajectory_analysis_*.ipynbpreliminary statistical trajectory analysis for the paper experiments
- python==3.8.2
- numpy==1.24.1
- matplotlib==3.6.2
- scipy==1.8.0
- numba==0.58.1
- networkx==3.1
- pandas==1.2.0
- PIL==9.1.0
- wxPython==4.1.0 (optional)
- zlib==1.0 (optional)