riff_publication

Code related to the RIFF

https://github.com/jniediek/riff_publication

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Code related to the RIFF

Basic Info
  • Host: GitHub
  • Owner: jniediek
  • License: mit
  • Language: MATLAB
  • Default Branch: main
  • Size: 256 MB
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Created almost 5 years ago · Last pushed about 2 years ago
Metadata Files
Readme License Citation

Readme.md

DOI

Code related to the RIFF

The RIFF is an interactive arena for freely moving rats.

This repository contains code related to the publication

Jankowski M. M., Polterovich A., Kazakov A., Niediek J., Nelken I.: An automated, low-latency environment for studying the neural basis of behavior in freely moving rats.

BMC Biology 21, 172 (2023) https://doi.org/10.1186/s12915-023-01660-9

Folder structure

| Folder | Function of scripts | |--------|---------| | acquisition| to operate the RIFF | |figures| to create the figures in the publication| |processing | to process data generated in the RIFF | |misc | to label rat bodyparts and train the direction tagger model |

Instructions

Note that some parts of the code require the Curve Fitting Toolbox, Parallel Computing Toolbox and/or the Statistics and Machine Learning Toolbox of MATLAB.

Folder acquisition: The control code of the RIFF

This code operates the RIFF. There are four subfolders

|Folder |Purpose| |--------|-------| |common| basic modules for interaction with the hardware | |camera_tracker| controls the ceiling-mounted camera and extract the rats coordinates in real-time | |L_D_task_GUI | main program to run the L/D task | |St+_task_GUI | main program to run the St+ task |

We created wiki pages that explain how to create a new experiment in the RIFF, based on a modification of the L_D_task_GUI.

Folder figures: Reproducing figures from the manuscript

  1. Download/clone this repository
  2. Navigate Matlab to the subfolder of the figures that you are interested in
  3. Run the main script in that folder, called either main.m or similar to the name to the figure.

Folder processing: Processing raw data that was recorded in the RIFF

Note: This is the short version. For a more complete description of the raw data, see our wiki pages. 1. Download/clone this repository 2. Download the sample session from figshare: 5 minutes behavioral session. 3. Unzip the downloaded sample session 4. Navigate Matlab to the code of this repository and add the folder processing with subfolders to the Matlab path 5. Navigate Matlab to the folder processing/analysis_pipeline and open the file main.m in the editor 6. Change the variable data_location to the location of the folder RIFF_data from the downloaded, unzipped sample session (e.g., data_location = '~/Downloads/RIFF_data') 7. Change the variable results_location to your desired location for the output of results (e.g., results_location = '~/RIFF_results'). This folder will be created if it does not exist already. 8. Run the script main.m 9. Diagnostic plots of the results appear in folder .../RIFF_results/nightRIFF/250721/rat_9/01_Behavior 12. Run the script RIFF_player.m. 12. Copy the ~/RIFF_results path into the Pipeline output path input line in the left upper corner of the GUI. Press the button Load data. 13. Once the first frame of the experiment got loaded, right-click anywhere on the dark image area and use the left/right arrows to advance the frames. Use keys 4 and 6 in the numpad to skip 5 frames at once (make sure the NumLock is activated).

Here is how the exemplar exeperiment is visualized in the RIFF_player:

image

Other resources

We also supply a 90 minute long sample session with neural recordings here. See our wiki pages for instructions.

Processing the rat body directions (requires python framework and CUDA-enabled PC)

  1. Create new virtual environment (e.g., open anaconda/conda/miniconda command window and type >> conda create -n RIFF_env python=3.7)
  2. Activate the newly created environment: >> conda activate RIFF_env
  3. Change working directory of the console to ./processing/analysis_pipeline/body_directions/: >> cd ./processing/analysis_pipeline/body_directions/
  4. Install the requirements: >> pip install -r requirements.txt
  5. Change the variable exp_path in line 152 of extract_3_points_from_rat_images.py to the path of the RIFF_results folder.
  6. Run the code by: >> python extract_3_points_from_rat_images.py. The code will create a new file predicted_rat_body_points.mat in the experiment folder.
  7. Rerun the RIFF_player as in bullets 10-13 of the previous list to visualize he body directions.

Owner

  • Name: Johannes Niediek
  • Login: jniediek
  • Kind: user
  • Location: The Hebrew University of Jerusalem, Israel
  • Company: Edmond & Lily Safra Center for Brain Sciences

neural code

GitHub Events

Total
  • Watch event: 2
Last Year
  • Watch event: 2

Dependencies

misc/train_direction_tagger/requirements.txt pypi
  • PyPrind ==2.11.3
  • matplotlib ==3.6.2
  • numpy ==1.23.5
processing/analysis_pipeline/body_directions/requirements.txt pypi
  • h5py *
  • matplotlib *
  • numpy *
  • scipy *
  • torch ==1.9.0
  • torchaudio ==0.9.0
  • torchvision ==0.10.0