Coder Social home page Coder Social logo

afcarl / replay_classification Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eden-kramer-lab/replay_classification

0.0 0.0 0.0 38.14 MB

State space models for categorization of replay content from multiunit spiking activity. Deng et al. 2016

License: GNU General Public License v3.0

Makefile 0.30% Shell 0.07% Python 99.63%

replay_classification's Introduction

replay_classification

Coverage Status DOI

Binder

replay_classification is a python package for categorizing hippocampal replay events using multiunit spiking activity. Multiunit spiking activity can be more informative than sorted spikes, because there is no need to distinguish between neurons. This has several advantages:

  1. We can take advantage of partial information from neurons that are not well separated in terms of electrophysiological signal.
  2. Saves time, because no spike-sorting step is necessary.

This package also provides:

  • Metrics for the confidence of classification, allowing for experimental intervention before a replay event is completed.

Probability of States

  • Convenient functions for diagnostic plotting.

Posterior Density

See the notebooks (#1, #2 for more information on how to use the package.

References and Citation

Please cite:

Deng, X., Liu, D.F., Karlsson, M.P., Frank, L.M., and Eden, U.T. (2016). Rapid classification of hippocampal replay content for real-time applications. Journal of Neurophysiology 116, 2221-2235.

and the DOI for the package repository (see the DOI badge at the start of the README).

Package Requirements

  • python>=3.5
  • numpy
  • scipy
  • pandas
  • xarray
  • statsmodels
  • matplotlib
  • seaborn
  • patsy
  • numba
  • holoviews

Installation

pip install replay_classification

Or

conda install -c edeno replay_classification

Developer Installation

  1. Install miniconda (or anaconda) if it isn't already installed. Type into bash (or install from the anaconda website):
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
  1. Go to the local repository (.../replay_classification) and install the anaconda environment for the repository. Type into bash:
conda update -q conda
conda info -a
conda env create -f environment.yml
source activate replay_classification
python setup.py develop

Example Usage

  1. Classify replays into Inbound-Forward, Inbound-Reverse, Outbound-Forward, Outboud-Reverse using the clusterless decoder:
from replay_classification import ClusterlessDecoder

decoder = ClusterlessDecoder(
    position=linear_distance,
    trajectory_direction=trajectory_direction,
    spike_marks=test_marks,
    replay_speedup_factor=16,
)

decoder.fit()

results = decoder.predict(ripple_marks)
  1. Classify replays using sorted spikes:
from replay_classification import SortedSpikeDecoder

decoder = SortedSpikeDecoder(
    position=linear_distance,
    trajectory_direction=trajectory_direction,
    spikes=test_spikes,
    replay_speedup_factor=16,
)

decoder.fit()

results = decoder.predict(ripple_spikes)
  1. Decode only Inbound and Outbound by specifying the observation and state transition order:
from replay_classification import ClusterlessDecoder

decoder = ClusterlessDecoder(
    position=linear_distance,
    trajectory_direction=trajectory_direction,
    spike_marks=test_marks,
    observation_state_order=['Inbound', 'Outbound'],
    state_transition_state_order=['Inbound', 'Outbound'],
    state_names=['Inbound', 'Outbound'],
    initial_conditions='Uniform',
)

decoder.fit()

results = decoder.predict(ripple_spikes)
  1. Decode replay position:
from replay_classification import ClusterlessDecoder

decoder = ClusterlessDecoder(
    position=linear_distance,
    trajectory_direction=np.ones_like(position), spike_marks=test_marks,
    observation_state_order=[1],
    state_transition_state_order=[1],
    state_names=['replay_position'],
    initial_conditions='Uniform',
)

decoder.fit()

results = decoder.predict(ripple_spikes)

replay_classification's People

Contributors

edeno 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.