No Description

Enrico Trombetta a3b63d56d8 Split bioRxiv and eNeuro (will revert after publication) 8 months ago
+tools 05ec1bca85 Synched from github 8 months ago
WN results 4004e3380d Switch to git-annex 8 months ago
AssignModulesAndQuantify.m 05ec1bca85 Synched from github 8 months ago
ConcatenateFrequencies.m 05ec1bca85 Synched from github 8 months ago
LICENSE 929d184cab Initial commit 8 months ago
ModulesExtraction.m 05ec1bca85 Synched from github 8 months ago
PoseExtraction.m 05ec1bca85 Synched from github 8 months ago
README.md a6794a0d1d Fix typos and missing dataset reference 8 months ago
SEB3r.m 05ec1bca85 Synched from github 8 months ago
SelectRange.m 05ec1bca85 Synched from github 8 months ago
SequenceDuration.m 05ec1bca85 Synched from github 8 months ago
WN3dPlots.m 05ec1bca85 Synched from github 8 months ago
datacite.yml a3b63d56d8 Split bioRxiv and eNeuro (will revert after publication) 8 months ago

README.md

SEB3R: Stimulus-Evoked Behavioural Tracking for Rodents

The SeB3R framework allows you to automate and standardize ethologically-driven observations of mice in freely-moving scenarios.

In short, it allows for automatic between- and within-groups posture and body module labelling of mice data starting from already-tracked frames; this is accomplished through a 2-step k-means clustering: from the 3D position of the mice skeleton we identify N subject-specific behavioural clusters. After some analysis, the user can reforce the analysis to make all subjects be reclassified on a constant K number of behavioural modules, and obtain tagged frame data that can be superimposed to the original dataset.

There are very few constraints on the dataset, which are discussed below. Our paper motivates and applies this framework on an applied use case of whisker nuisance, but any behavioral task is allowed.

NOTE: tracking goes beyond the scope of this tool. We recommend DeepLabCut for this task, and also urge you to follow the dataset specifications below.

Installation

You should have MATLAB installed, in particular we recommend MATLAB R2023a. as the tool was tested against this version. Octave will not work.

First, download or clone this repo.

Secondly, install the kmeans_opt package, by either moving its main module or adding it to MATLAB's search path.

How to use

We provide a whisker nuisance dataset experiment for reference. To run the analysis, you can either:

  • run SEB3R.m, which will automatically call the modules mentioned below, or
  • run in order PoseExtraction.m, ModulesExtraction.m, AssignModulesAndQuantify.m, SequenceDuration.m (NEW). This is recommended, as it requires you to think about how many body modules you want.

This is a breakdown of what each step entails:

  1. We start by investigating body postures on a per-subject basis. Run PoseExtraction.m. This will ask you to select your dataset root folder and will perform the analysis itself, and subsequently create a Clusters folder inside each subject folder, showing the corresponding frame for each found cluster (e.g. 058/Clusters/C3.csv contains all frames that matched the third cluster).

  2. Next, we assign previously found clusters to body modules (or BM). Run ModulesExtraction.m. It will prompt the user to provide the number of wished BMs, and then the dataset folder again (TODO in the SEB3R.m script this could be passed as a parameter?). Such number can be arbitrary but we recommend taking into account the cohort cluster distribution first. Refer to the module for details.

  3. Lastly, re-perform clustering on the newly found BMs. Run AssignModulesAndQuantify.m.

  4. Optionally, extract the sequence length for each body module of interest. After being prompted a directory for the dataset of interest, it will create a directory containing all sequencing grouped by experimental condition.

Dataset format

Please make sure your dataset follows the following format:

  • A folder contains a list of subjects, arranged in subject folders.

  • Each subject folder follows a purely numeric code, e.g. "123" or "007"; note that "007" and "7" are distinct.

  • Each subject folder contains the same set of evaluating condition, named ${SUBJECT}_{CONDITION}_DLC_3D.csv, for example 058_OF_DLC_3D.csv. These will be processed in lexicographical order, therefore if you wish to ensure consistent ordering we recommend prefixing them with a number, e.g. 1_Control, 2_ExperimentalCondition etc.

  • Each condition is stored in a CSV matrix as returned by DLC. In particular:

    • Each matrix should have the same header as shown here

    • Each matrix should have the same number of frames and tracked body parts. Warning: currently the number of followed body parts is 6 due to instrumental and visual occlusion limitations. This may change in future releases!

Questions

We understand the instructions above may not be exhaustive. For bug-related questions (e.g crashes), please open an issue, otherwise drop us an email and we will assist you.

datacite.yml
Title SEB3R Pipeline
Authors Chelini,Gabriele;University of Trento;ORCID:0000-0001-6654-4332
Trombetta,Enrico Maria;University of Trento;ORCID:0000-0001-5162-1059
Description A MATLAB pipeline for parcellation of freely-moving mouse behaviour. The tool runs starting from DeepLabCut-3d output files and identifies ethologically-relevant body postures.
License Creative Commons CC0 1.0 Public Domain Dedication (https://creativecommons.org/publicdomain/zero/1.0/)
References Chelini G., Trombetta E. M., Fortunato-Asquini T., Ollari O., Pecchia T., Bozzi Y. (2023) "Automated Segmentation of the Mouse Body Language to Study Stimulus-Evoked Emotional Behaviors", bioRxiv [doi:10.1101/2022.11.27.518077] (IsSupplementTo)
Chelini G., Trombetta E. M., Fortunato-Asquini T., Ollari O., Pecchia T., Bozzi Y. (in press) "Automated Segmentation of the Mouse Body Language to Study Stimulus-Evoked Emotional Behaviors", eNeuro [doi:tba] (IsSupplementTo)
Chelini G., Trombetta E. M. (2023) SEB3R Validation Data. G-Node. https://doi.org/10.12751/g-node.jmy711 [doi:10.12751/g-node.jmy711] (IsReferencedBy)
Funding CARITRO postdoctoral fellowship
EU, EU.63,000
Keywords Neuroscience
Murine behaviour
Neuroethology
Machine Learning
Resource Type Software