GithubHelp home page GithubHelp logo

murthylab / flytrap Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 521 KB

Code for analyzing playback experiments in Deutsch et al. (2019).

Home Page: https://www.biorxiv.org/content/10.1101/366765v2

MATLAB 99.95% M 0.05%

flytrap's Introduction

Installation

ffmpeg for reading frames (used by VideoReaderFFMPEG):

  • OSX: brew install ffmpeg
  • WIN: download binaries from here
  • VideoReaderFFMPEG look for the ffmpeg binary in /usr/local/bin (OSX) or C:\Program Files\ffmpeg\bin (WIN). See help VideoReaderFFMPEG for how to set a custom path to the binary.

GhostScript for saving figures. Download binaries from the official website. Add directory with the ghostscript binary (gs or gs.exe) to your system path.

Download the code git clone https://github.com/murthylab/FLyTRAP.git, cd into the newly created directory FLyTRAP and add the src subdirectory to your matlab path: addpath(genpath('src')); savepath().

Organization of data

Raw data should be copied to /scratch/murthyplayback/dat/. After the recordings have been processed copy to /bucket/murthy/playback/dat.processed/ regularly to free up space on scratch (and to make sure everything is backed up safely).

Tracking results are saved to /bucket/murthy/playback/res/ on bucket one VIDEOFILENAME_spd.mat file per recording.

Metadata for generating tuning curves reside in a spreadsheet on google docs:

  • The sheet list describes each recorded video: filename, genotype and age, playlist, housing condition.
  • The sheet playbackLists describes playlists\tuning curves: playlist name (in list), x-axis and x-tick labels, etc.
  • The sheets are pulled from google docs automatically by tuning.m.

Running analyses

Annotate videos

Copy folder for each recording to /scratch/murthyplayback and run on a local machine:

cd /scratch/murthyplayback
video_preProcessLocal

This will run through all videos that have not been pre-processed in dat/ so you can mark the fly positions. The script will present you with the first frame of each video and uses roipoly for annotating the flies: 1) click on all flies you want tracked, 2) when done right click to close the polygon (even if there's just a single fly), and 3) double click inside the polygon to move on to the next video.

Track videos

To track the videos run on spock:

cd /scratch/murthyplayback
module load matlab/R2016b
matlab -r 'video_submit([1 1 1]);exit'

This will submit three types of jobs that will process the video in serial order:

  1. Preprocessing: detects chambers and initializes tracker
  2. Tracking: tracks files and creates one *res.mat file per chamber
  3. Postprocessing: aggregrates the data in the *res.mat for each experiment and copies the results to /bucket/murthy/playback/res/*_spd.mat

See help video_submit for arguments.

Generate tuning curves

See tuning.m.

flytrap's People

Contributors

dpacheco0921 avatar postpop avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.