PyNeuroTrace - Python code for neural activity time series

PyNeuroTrace - Python code for neural activity time series - Published in JOSS (2024)

https://github.com/padster/pyneurotrace

Science Score: 98.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 10 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

analytics neuroscience timeseries
Last synced: 6 months ago · JSON representation ·

Repository

Python code for processing neural timeseries

Basic Info
Statistics
  • Stars: 2
  • Watchers: 3
  • Forks: 2
  • Open Issues: 1
  • Releases: 0
Topics
analytics neuroscience timeseries
Created almost 8 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

PyNeuroTrace: Python code for Neural Timeseries

Tests DocumentationDOI

Installation

'pyNeuroTrace' can be installed with pip:

pip install pyNeuroTrace

GPU Supported functions use the Python Library Cupy. This library has the following requirements: * NVIDIA CUDA GPU with the Compute Capability 3.0 or larger.

  • CUDA Toolkit: v11.2 / v11.3 / v11.4 / v11.5 / v11.6 / v11.7 / v11.8 / v12.0 / v12.1 / v12.2 / v12.3 / v12.4

'pyNeuroTrace' can be installed with Cupy using pip:

pip install pyNeuroTrace[GPU] If Cupy fails to build from the wheel using this command try installing Cupy first using a wheel that matches your CUDA Toolkit version ie: pip install cupy-cuda12x

Followed by this command to install pyNeuroTrace pip install pyNeuroTrace

For more information in on installing CuPy, see their CuPy installation documentation.

Documentation

To help get started using 'pyNeuroTrace', full documentation of the software and available modules and methods is available at our pyNeuroTrace github.io site.

Vizualization

Probably the most useful section of pyNeuroTrace, there are a number of visualization functions provided to help display the trace data in easy to understand formats. For more details, and visual examples of what is available, please consult the README next to viz.py.

Notebook utilities

Unrelated to neuron time series, but useful when using this regardless, PyNeuroTrace also provides a collection of tools for running analysis in Jupyter notebooks.

These include:

notebook.filePicker to selecting an existing file, notebook.newFilePicker for indicating a new path, and notebook.folderPicker for selecting an existing folder.

These all open PyQT file dialogs, to make it easy for users to interact with the file system. Customisation options exist, for example prompt and default locations.

showTabs(data, func, titles, progressBar=False)

Useful for performing analysis repeated multiple times across e.g. different neurons, experiments, conditions, ...etc. Given either a list, or dictionary, all items will be iterated over, and each individually drawn onto their own tab with the provided func. The method provided expects func(idx, key, value), where idx is the (0-based) index of the tab, key is the list/dictionary key, and value is what is to be processed.

Processing Data

Common per-trace processing filters are provided within filters.py. These are all designed to take a numpy array of traces, with each row an independent trace, and all return a filtered array of the same size.

These include:

filters.deltaFOverF0(traces, hz, t0, t1, t2)

Converts raw signal to the standard Delta-F-over-F0, using the technique given in Jia et al, 2011. The smoothing parameters (t0, t1, t2) are as described in the paper, all with units in seconds. Sample rate must also be provided to convert these to sample units.

filters.okada(traces)

Reduces noise in traces by smoothing single peaks or valleys, as described in Okada et al, 2016

Event Detection

Python implementations of the three algorithms discussed in our paper Sakaki et al, 2018 for finding events within Calcium fluorescent traces.

ewma(data, weight)

calculates the Exponentially-Weighted Moving Average for each trace, given how strongly to weight new points (vs. the previous average).

cusum(data, slack)

calculates the Cumulative Sum for each trace, taking a slack parameter which controls how far from the mean the signal the signal needs to be to not be considered noise.

matchedFilter(data, windowSize, A, tA, tB)

calculates the likelihood ratio for each sample to be the end of a window of expected transient shape, being a double exponential with amplitude A, rise-time tA, and decay-time tB (in samples).

The results of each of these three detection filters can then be passed through thresholdEvents(data, threshold), to register detected events whenever the filter strength increases above the given threshold.

Reading Data (lab-specific)

The code within this repository was designed to read data from experiments performed by the Kurt Haas lab at UBC. If you're from this lab, read below. If not, this part is probably not relevant, but fee free to ask if you'd be interested in loading your own data file formats.

A number of options for loading data files are available within files.py, including: * load2PData(path) takes an experiment output file (e.g STEP5EXPT.TXT) and returns ID, XYZ location, and raw intensity values for each node in the experiment. * loadMetadata(path) takes a metadata file (e.g. rscanmetadatastep_5.txt) and returns the stimulus start/stop samples, as well as the sample rate for the experiment. * loadTreeStructure(path) takes a tree structure file (e.g. interp-neuron-.txt) and returns the mapping of node IDs to tree information about that node (e.g. node type, children, ...).

Owner

  • Name: Pat Coleman
  • Login: padster
  • Kind: user

JOSS Publication

PyNeuroTrace - Python code for neural activity time series
Published
August 15, 2024
Volume 9, Issue 100, Page 6877
Authors
Patrick Coleman ORCID
Department of Cellular and Physiological Sciences, Centre for Brain Health, School of Biomedical Engineering, University of British Columbia, Vancouver, Canada
Peter William Hogg ORCID
Department of Cellular and Physiological Sciences, Centre for Brain Health, School of Biomedical Engineering, University of British Columbia, Vancouver, Canada
Tristan Dellazizzo Toth ORCID
Department of Cellular and Physiological Sciences, Centre for Brain Health, School of Biomedical Engineering, University of British Columbia, Vancouver, Canada
Kurt Haas ORCID
Department of Cellular and Physiological Sciences, Centre for Brain Health, School of Biomedical Engineering, University of British Columbia, Vancouver, Canada
Editor
Adam Tyson ORCID
Tags
neuroscience signal processing calcium imaging voltage imaging

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Coleman
  given-names: Patrick
  orcid: "https://orcid.org/0009-0001-5216-7748"
- family-names: Hogg
  given-names: Peter William
  orcid: "https://orcid.org/0000-0003-2176-4977"
- family-names: Toth
  given-names: Tristan Dellazizzo
  orcid: "https://orcid.org/0009-0001-3239-6930"
- family-names: Haas
  given-names: Kurt
  orcid: "https://orcid.org/0000-0003-4754-1560"
contact:
- family-names: Hogg
  given-names: Peter William
  orcid: "https://orcid.org/0000-0003-2176-4977"
doi: 10.5281/zenodo.13312905
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Coleman
    given-names: Patrick
    orcid: "https://orcid.org/0009-0001-5216-7748"
  - family-names: Hogg
    given-names: Peter William
    orcid: "https://orcid.org/0000-0003-2176-4977"
  - family-names: Toth
    given-names: Tristan Dellazizzo
    orcid: "https://orcid.org/0009-0001-3239-6930"
  - family-names: Haas
    given-names: Kurt
    orcid: "https://orcid.org/0000-0003-4754-1560"
  date-published: 2024-08-15
  doi: 10.21105/joss.06877
  issn: 2475-9066
  issue: 100
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 6877
  title: PyNeuroTrace - Python code for neural activity time series
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.06877"
  volume: 9
title: PyNeuroTrace - Python code for neural activity time series

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 199
  • Total Committers: 3
  • Avg Commits per committer: 66.333
  • Development Distribution Score (DDS): 0.492
Past Year
  • Commits: 10
  • Committers: 3
  • Avg Commits per committer: 3.333
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email Commits
peter-hogg p****6@g****m 101
Pat Coleman p****t@g****m 97
Adam Tyson c****e@a****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 5
  • Average time to close issues: 12 days
  • Average time to close pull requests: 8 days
  • Total issue authors: 3
  • Total pull request authors: 4
  • Average comments per issue: 2.22
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • danielmk (5)
  • stephenlenzi (3)
  • adamltyson (1)
Pull Request Authors
  • Peter-Hogg (4)
  • adamltyson (2)
  • dependabot[bot] (2)
  • padster (2)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 33 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 2
pypi.org: pyneurotrace

Python code for neural time series

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 33 Last month
Rankings
Dependent packages count: 9.4%
Average: 35.8%
Dependent repos count: 62.1%
Maintainers (2)
Last synced: 6 months ago