Giter VIP home page Giter VIP logo

optoanalysis's Introduction

Optogenetics Freezing Analysis

This is a set of scripts to analyze and visualize freezing data generated from cyansite.cc/freeze.html where the output on the side panel is copied and pasted into a .txt file as is. You can visualize as a time series for more short time bins, or as a bar plot for larger time bins (or vice versa if you so choose, but I do wonder why you would...)

File Preparation

  1. Use cyansite.cc/freeze.html to score your freezing and copy and paste the freezing results into a text editor. Save as "animalname_group" with group being whichever way you have blinded yourself.
  • You must check the very last entry of each file and remove it if it is an incomplete freezing episode (e.g.
    476 -
    where you pressed 'f' to initiate an episode and the video ended before you could close off the episode)
  1. Put all the .txt files from the same experiment in the same folder and keep note of their location.
  2. Create a groups.txt file (named exactly as such) in the same folder with the following:
  • First Line: the groups you used in your file naming convention for this experiment separated by commas
  • Second Line: a python dictionary indicating your corresponding unblinded group names in the same order as you entered the blinded group names in the first line, starting from 0 to the number of groups you have.
  • See below for example where group 1 corresponds to your vehicle group and group 2 corresponds to the drug group.
group1, group2
{0: 'Vehicle', 1: 'Drug'}
  • Make sure there is not any extra lines of whitespace in this groups.txt file.

Usage

Using shell, you can run the following:

python main.py /directory/ bin_size total_time output.csv --style

Where:

  • /directory/ is the location of your animalname_group.txt and groups.txt files are located
  • bin_size is the length of the time bins in seconds
  • total_time is the total length of your recording session in seconds
  • output.csv is the csv you'd like to save the parsed data in. The format will be one row per animal, where each column after the first column (their group name) gives the freezing percentages for that column's bin.
  • optional --style flag: --ts for time series is the default, --bar for a bar plot

optoanalysis's People

Contributors

linamnt avatar

Stargazers

Patrick Steadman avatar

Watchers

James Cloos 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.