Skip to content

Commit 9a39af6

Browse files
authored
Update README.md
1 parent ec4aabb commit 9a39af6

File tree

1 file changed

+33
-118
lines changed

1 file changed

+33
-118
lines changed

README.md

Lines changed: 33 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
# BehaviorDEPOT ReadME
22

33

4-
## Documentation is being moved over to the BehaviorDEPOT Wiki page (https://github.com/DeNardoLab/BehaviorDEPOT/wiki). Head there to check out updated documentation!
4+
- **Documentation is being moved over to the BehaviorDEPOT Wiki (https://github.com/DeNardoLab/BehaviorDEPOT/wiki). Head there for the latest documentation!**
55

6-
- BehaviorDEPOT v1.1 is now live! Please give it a try, and let us know of any issues you may encounter.
6+
- **BehaviorDEPOT has been published! For more information or to cite BehaviorDEPOT in your own work, check out our paper on eLife: https://elifesciences.org/articles/74314**
77

8-
- To find out more about BehaviorDEPOT or to cite the software in your own paper, see our pre-print on bioRxiv: https://www.biorxiv.org/content/10.1101/2021.06.20.449150v2
8+
- BehaviorDEPOT v1.5 is now live! Please give it a try, and let us know of any issues you may encounter.
9+
10+
- View original BehaviorDEPOT pre-print on bioRxiv: https://www.biorxiv.org/content/10.1101/2021.06.20.449150v2
911

1012
- Demo data is now available that can be used to test installation, classifiers, spatial/temporal filtering, and modules. Due to limitations on file size, the original video file (necessary to run the analysis module from scratch) is not available on Github but can be downloaded from: https://drive.google.com/drive/folders/1VNv9FuXyiI4xgt-RokcVvWk-1dBovuqO?usp=sharing
1113

1214
- Sample DeepLabCut networks that have been trained on our data are available for use. These may work on your own data, depending on the individual camera/chamber setup, but these models can serve as starting points for quickly training your own new networks! Find them here: https://drive.google.com/drive/folders/1Fl4PmLz6CWQcqOjfQ1q_60ZCZjI5949-?usp=sharing
1315

14-
**Patch Notes v1.1**
15-
- Updated mainscript to accomodate custom ROIs in classifiers
16-
- Added elevated plus maze (EPM) classifier
17-
- Added open field test (OFT) classifier
18-
- Added in-GUI button to open classifier folder
19-
- Adjusted spatial/temporal ROI output structure; collapsed Behavior_Filter into Behavior.Spatial and Behavior.Temporal
20-
- Minor bug fixes
21-
- Fixed a bug causing repeat analysis of single file on 'single' mode
22-
- Updated plotting files
16+
## Patch Notes v1.5
17+
### Major Updates
18+
- [x] Drastically speed up pipeline (2-5x!!!) using parallel processing for smoothing (option to select in GUI)
19+
- [NOTE: requires Parallel Processing Toolbox]
20+
- [x] Most recent GUI settings are now loaded by default
21+
- [x] Classifier optimization module now supports batch analysis on a parent directory containing folders with BD output and human annotation files (hB)
22+
23+
### Minor Updates
24+
- [x] Added ability to re-use ROI name and/or limits in batch mode
25+
- [x] Added menu option to redraw an ROI
26+
- [x] Add option to select tracking file type (DLC H5, SLEAP H5, DLC CSV, etc.) from GUI
27+
- [x] Add ability to re-do part registration
28+
29+
### Bug Fixes
30+
- [x] Fixed issue with validation module output naming
31+
- [x] Fixed issue with optimization module initilization
32+
- [x] Fixed issue causing pipeline to crash using H5 files (DLC or SLEAP)
33+
- [x] Fixed issue with CSV detection (eliminate the requirement and force manual selection OR figure out a more complex way of doing it automatically)
2334

2435
**----------------------------------------------------------------------------------------------------**
2536

@@ -35,9 +46,11 @@ BehaviorDEPOT was written using MATLAB 2020b and requires the following MATLAB t
3546
2) Curve Fitting Toolbox
3647
3) Image Processing Toolbox
3748
4) Statistics and Machine Learning Toolbox
49+
5) Parallel Processing Toolbox **(Optional)**
3850

3951
Compatibility has been tested on Windows 10 and MacOS Catalina using Matlab 2018 - 2020b.
40-
Installation
52+
53+
## Installation
4154
BehaviorDEPOT is written as a MATLAB app. Simply open the install file and allow MATLAB to install BehaviorDEPOT. It will appear under the ‘apps’ tab in Matlab. Click the app to launch.
4255

4356
## Customization
@@ -51,111 +64,13 @@ BehaviorDEPOT was developed by Chris Gabirel, Benita Jin, Zachary Zeidler, and L
5164
## License
5265
This work is licensed under the GNU General Public License 3.0.
5366

54-
**----------------------------------------------------------------------------------------------------**
55-
56-
# USAGE GUIDE
67+
## Module Descriptions:
5768

58-
### Analysis Module
59-
1) After installation, launch BehaviorDEPOT from App window in Matlab.
69+
#### Data Prep Module:
70+
Allows user to input one or more videos plus DLC-analyzed files to smooth tracking data, calculate a wide array of metrics, process custom ROI and temporal filters. Output of this module are several structures containing smoothed tracking and kinematic/postural metrics of animal behavior.
6071

61-
2) Select which classifiers to use:
62-
- Certain classifiers have adjustable parameters. Click on ‘Edit Params’ to adjust those parameters.
63-
64-
3) Set distance calibration
65-
- Calibration can be calculated using ImageJ. Open a frame from a video and measure out the pixel distance of a known dimension (e.g. arena length). Use that to calculate the pixel-to-centimeter ratio.
66-
67-
4) Enter number of ROIs
68-
69-
5) Choose whether or not to filter based on frame-locked events
70-
- Input for these is required to be a spreadsheet file (.csv, .xlsx), with each event as a row, the start frame in the first column and the end frame in the second column.
71-
72-
6) Select plotting preferences
73-
- ‘View Spatial Trajectory’ plots all the positions of the animal across the session.
74-
- ‘View spatiotemporal trajectory’ plots position across time, color coding the location points.
75-
- ‘View behavior location’ overlays a marker on the locations where behavior(s) of interest occurred.
76-
77-
7) Select single session or batch process
78-
- Single session for analyzing one paired DLC output and video file.
79-
- Batch process for analyzing multiple files with the same parameters. The required input structure for batch processing:
80-
- Grandparent folder, which is selected for analysis.
81-
- Parent folder 1 (Containing exclusively a single, matching pair of spreadsheet and video files)
82-
\**A single event file can also be included, and must be indicated with ‘cue’ in the filename (eg myevents_cue.csv)*
83-
- Parent folder 2 (same as above)
84-
- Parent folder n (same as above)
85-
86-
8) Hit Start.
87-
88-
9) Follow the onscreen prompts to enter and customize your data. Depending on your settings:
89-
- If doing ‘single session’, you will be prompted to use the directory browser to select the spreadsheet and video files for analysis.
90-
- If doing ‘batch process’, you will be prompted to select the folder containing directories for analysis (see batch process instructions for data organization)
91-
- You may be prompted by the GUI to draw and name ROIs or parts of the arena, depending on your settings.
92-
- You will be prompted to select the body part corresponding to your custom named part.
93-
- You may be prompted to select timestamp files containing the start and stop frames of temporal events, and then name those events.
94-
95-
10) Results will be saved in a new folder in the same directory as the data.
96-
97-
### Converting Manual Annotations to BehaviorDEPOT format (hB files)
98-
1) Save manual annotations as a 3 column table (1st: Start Frame, 2nd: Stop Frame, 3rd: Behavior Label)
99-
- Function is compatible with data tables in .mat or .csv files
100-
- To import data from larger excel/csv files, select "import data" in Matlab and create 3 column tables for each video analyzed
101-
- After importing data as a table, save the table file as a .mat
102-
103-
2) Run convertHumanAnnotations function in Matlab
104-
- Inputs:
105-
- 1) table_filename: str/char pointing to MATLAB table file (requires path if not in current directory)
106-
- 2) total_frames: int, optional total number of frames in analyzed video
107-
- NOTE: if total_frames is empty, function will use the video file IF IN SAME FOLDER AS INPUT TABLE
108-
- 3) output_filename: str/char, optional; (default behavior = hB_[original filename])
109-
110-
3) Results will be saved as an hBehavior structure (similar in format to Behavior structures from Analysis Module)
111-
- File name will be 'hB_[original filename]' or named as [output_filename] if applicable
112-
113-
### Output: Analysis Module
114-
1) Data is saved in separate analysis folder within the directory of the tracking spreadsheet.
115-
116-
2) Depending on settings, output will include:
117-
- ‘Behavior Bouts.fig’ - a plot indicating when behavior occurred across time
118-
-[BehaviorName] Map.fig’ - a map of the animal location across time, with location of behaviors indicated
119-
- Behavior.mat - struct containing all behaviors analyzed. Within each behavior struct:
120-
- Bouts: start and stop frames of each behavior bout
121-
- Count: number of behavior bouts
122-
- Length: duration of each behavior bout
123-
- Vector: behavior vector across all frames
124-
- Metrics.mat - a struct containing information about speed, movement, and velocity of the tracked parts
125-
- Diff: contains the location differential across frames for various points
126-
- Velocity: the velocity at each frame
127-
- Acceleration: the acceleration at each frame
128-
- Location: location of animal
129-
- Movement_cmpersec: movement speed in cm/sec
130-
- DistanceTravelled_cm: total distance traveled in cm
131-
- Tracking.mat - a struct containing the location of each tracked part
132-
- The first layer of Tracking contains the original information from the tracking spreadsheet
133-
- Smooth: contains the location of each tracked part after smoothing
134-
- Behavior_Filter.mat - contains Behavior information filtered by space or time
135-
- Temporal: contains Behavior information during cue frames
136-
- EventVector: a vector indicating when the events occurred
137-
- EventBouts: start and stop frames of each event
138-
- [Behavior]: e.g. Freezing
139-
- BehInEventVector: vector when behavior occurred during an event (ie both EventVector and BehaviorVector are true)
140-
- Cue_BehInEventVector: events as rows, each containing a vector representing behavior
141-
- PerBehInEvent: percent behavior in event. Proportion of behavior occurring during the event (vs outside of the event)
142-
- PerBehDuringCue: percent of event duration that behavior occurs.
143-
\**Eg if Freezing occurred for 50% of first event, and 30% of second event, values would be {0.5, 0.3}*
144-
- Spatial: contains Behavior information in ROIs
145-
- PerTimeInROI: percent total time spent in the ROI
146-
- inROIVector: vector of whether animal was in ROI or not
147-
- [Behavior]
148-
- inROIbehaviorVector: vector of when animal was in ROI and engaging in behavior (eg both inROIVector and BehaviorVector are true)
149-
- PerBehaviorInROI: percent of behavior that occurred within the ROI
150-
- Intersect
151-
- SpaTemBeh: intersection of spatial, temporal, and behavior vectors
152-
- ROIduringCue_PerTime: percent time of event that animal spent in ROI
153-
- ROIduringCue_Vector: vector, one row per event, of when animal was in ROI during each event
154-
155-
### Module Descriptions:
156-
157-
#### Analysis Module:
158-
Allows user to input one or more videos plus DLC-analyzed files to smooth tracking data, calculate a wide array of metrics, and classify behaviors with or without spatial and temporal filtering.
72+
#### Behavior Analysis Module:
73+
Allows user to use pre-built or customized classifier files to quantify behaviors with or without spatial and temporal filtering.
15974

16075
#### Inter-Rater Module:
16176
Allows user to make comparisons and visualizations of behavior annotations from multiple users using an averaged-rater projection or a chosen rater as a reference; includes useful visualizations and the ability to output a report of errors between each user and the reference dataset.
@@ -164,7 +79,7 @@ Allows user to make comparisons and visualizations of behavior annotations from
16479
Allows user to choose a batch of BehDEPOT-analyzed files (with associated hBehavior files) and quickly generate performance statistics and visualizations for each video and average statistics for the entire set.
16580

16681
#### Classifier Optimization Module:
167-
Allows user to choose a behavior classifier, 1-2 classifier parameters (i.e. thresholds), a range of test values, and a human annotation file to quickly examine effects of chosen values on classifier performance (reporting F1 score and ROC-based AUC values for range of tested parameters)
82+
Allows user to choose a behavior classifier, 1-2 classifier parameters (i.e. thresholds), a range of test values, and a human annotation file to quickly examine effects of chosen values on classifier performance (reporting F1 score and ROC-based AUC values for range of tested parameters). Can be run on single sessions or batches of sessions with average performance reported.
16883

16984
#### Data Exploration Module:
170-
Allows user to choose 1 or 2 metrics from a BehDEPOT-analyzed file and an associated hBehavior file to sort data by chosen behavior and generates a report comparing the behavior subset to the complete dataset based on the selected Metrics.
85+
Allows user to choose 1 or 2 metrics from a BehDEPOT-analyzed file and an associated hBehavior file to sort data by chosen behavior and generates a report comparing the behavior subset to the complete dataset based on the selected Metrics. Comes in 'Broad' and 'Focused' modes to help find and test metrics for new classifiers.

0 commit comments

Comments
 (0)