Skip to content

A script for analyzing the data of novel object recognition and Y-maze test generated by DeepLabCut

License

Notifications You must be signed in to change notification settings

hayashi-laboratory/deeplabcut-analysis

Repository files navigation

A package for analyzing the data from DeepLabCut

how to use this script

  • Install python 3.9 using miniconda only for install python and pip
conda create -n -y your_env_name python=3.9 
conda activate your_env_name
  • create a venv in the directory your want
  • It will create a .venv folder in your enviornment

https://code.visualstudio.com/docs/python/python-tutorial

conda activate your_env_name
python3 -m venv .venv
  • Deactivate the conda environment
  • Then activate the python venv enviroment

For windows user

Activate .venv in command prompt

(.venv) C:Users\yourname\....\directory_you_want>  ./.venv/Scripts/activate

Clone this repository using git bash

git clone https://github.com/lycantrope/deeplabcut-analysis.git && cd deeplabcut-analysis

Install all necessary packages

python -m pip install .

For Linux/MacOs user

source ./.venv/bin/activate
git clone https://github.com/lycantrope/deeplabcut-analysis.git && cd deeplabcut-analysis
python -m pip install .   

Add a kernel to jupyter lab

pip install ipykernel
python -m ipykernel install --user --name=your_env_name

Add other kernel to current kernel (Both environment need ipykernel installed)

/path/to/kernel/env/bin/python -m ipykernel install --prefix=/path/to/jupyter/env --name 'python-my-env'


pyDLCbehavior package provides NovelObjectRecognitionAnalysis and YMazeAnalysis class objects, which can analyze the NOR test and Y-maze test.
These class objects have the result dataframe obtained from every experimental file, so the results can be summarized in Jupyter lab or Jupyter notebook using the following ipynb files.




novel_object_analysis.ipynb

Run this code in Jupyter.

  • dataset requirements, preferably stored in the same directory
  1. csv files exported from DLC.
  2. pickle files exported from DLC.
  3. avi files recorded in your NOR experiment.
  • Set the directory path HOMEDIR that stores above datasets.

  • Set the ROI to determine the coordinate of the center of each object
    e.g.)
    zone1: right upper object
    zone2: left lower object




YMaze_analysis.ipynb

Run this code in Jupyter.

  • dataset requirements, preferably stored in the same directory
  1. csv files exported from DLC.
  2. pickle files exported from DLC.
  • Set the directory path HOMEDIR that stores above datasets.


About

A script for analyzing the data of novel object recognition and Y-maze test generated by DeepLabCut

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published