Skip to main content

Python package to reconstruct axonal branches from high-density micro-electrode array data

Project description

PyPI version DOI

Axon velocity

Graph-based algorithm to reconstruct axonal branches and compute velocities from extracellular multi-electrode array (MEA) recordings in Python.

Installation

To install the axon_velocity package, you can clone the repo and install using pip:

pip install axon_velocity

To install from sources:

git clone https://github.com/alejoe91/axon_velocity.git
cd axon_velocity
python setup.py install (or develop)

Requirements

axon_velocity depends on the following packages, which are automatically installed

  • numpy
  • matplotlib
  • scipy
  • networkx
  • sklearn
  • MEAutility
  • probeinterface

For the simulation notebooks in the simulation_notebooks folder, additional requirements are needed:

All additional requirements can be installed with: pip install -r requirements_fill.txt

Usage

The inputs to the tracking algorithm are:

  • templates: mean extracellular waveforms (n_channels x n_samples)
  • locations: x-y position of electrodes (n_channels x 2)
  • fs: sampling frequency (float)

The graph-based method can be run as follows:

import axon_velocity as av

gtr = av.compute_graph_propagation_velocity(template=your_template, locations=your_locations, fs=fs)

To inspect available arguments, you can use av.compute_graph_propagation_velocity?.

The output gtr is an object of a class called GraphAxonTracking. It contains the following fields:

  • branches: List of dictionaries containing the following fields:
    • 'selected_channels': selected channels in the path
    • 'velocity': velocity estimate in mm/s (if locations in um and fs in Hz)
    • 'offset': offset of velocity estimate (same units as locations)
    • 'r2': r-squared of the velocoty fit
    • 'error': standard error of the linear fit
    • 'pval': p_value of the fit
    • 'distances': array with distances computed along the branch
    • 'peak_times': array with peak differences with initial channel
    • 'init_channel': channel used as initial channel
  • selected_channels: List of selected channels
  • graph: NetworkX directed graph

The GraphAxonTracking also implements useful methods for plotting the selected channels (gtr.plot_channel_selection()), plot the underlying graph (gtr.plot_graph()), plot the selected axonal branches (gtr.plot_branches()), and plot the estimated velocities for each branch (gtr.plot_velocities()).

Contribute

Contributions are welcome! Before pushing, make sure to clean up all notebooks with nbconvert:

pip install nbconvert (just once)

jupyter nbconvert --to notebook --ClearOutputPreprocessor.enabled=True --ClearMetadataPreprocessor.enabled=True --inplace **/*.ipynb (before committing)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axon_velocity-0.1.2.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

axon_velocity-0.1.2-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file axon_velocity-0.1.2.tar.gz.

File metadata

  • Download URL: axon_velocity-0.1.2.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for axon_velocity-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0d1121f6db9d5745c1d6f62c2371ce8a47ff09ea04ea737dcac9655be0bce214
MD5 9da4ef0851531b99ef93e5a2b51c9da7
BLAKE2b-256 721c093e748574369f8d524e2c5667b21d53123365362c0b94f1cf17964d57cf

See more details on using hashes here.

File details

Details for the file axon_velocity-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: axon_velocity-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for axon_velocity-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 71aa9c4c8cdf88c8e75d2c36623cc3f90a5739712a6afeac1577a1a5a9e76ff4
MD5 2b10dd983aa8515d2df3f6c90450ec4c
BLAKE2b-256 af43fa2063f218d54ecad1ff6491218d21d4ce3afe52969697a9945dfc73fc5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page