Spectral Connectivity

Spectral Connectivity: a python package for computing multitaper spectral estimates and frequency-domain brain connectivity measures on the CPU and GPU - Published in JOSS (2022)

https://github.com/eden-kramer-lab/spectral_connectivity

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 16 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

brain-connectivity canonical-coherence coherence connectivity-measures electrophysiology frequency-domain global-coherence multitaper neuroscience phase-lag-index python spectral-granger-causality spectrogram

Scientific Fields

Mathematics Computer Science - 40% confidence
Last synced: 4 months ago · JSON representation ·

Repository

Frequency domain estimation and functional and directed connectivity analysis tools for electrophysiological data

Basic Info
  • Host: GitHub
  • Owner: Eden-Kramer-Lab
  • License: gpl-3.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 31.9 MB
Statistics
  • Stars: 129
  • Watchers: 3
  • Forks: 45
  • Open Issues: 9
  • Releases: 12
Topics
brain-connectivity canonical-coherence coherence connectivity-measures electrophysiology frequency-domain global-coherence multitaper neuroscience phase-lag-index python spectral-granger-causality spectrogram
Created over 8 years ago · Last pushed 7 months ago
Metadata Files
Readme Contributing License Code of conduct Citation

README.md

spectral_connectivity

PR Test DOI Binder status PyPI version Anaconda-Server Badge Documentation Status Coverage Status

Tutorials | Documentation | Usage Example | Installation | Citation | Developer Installation

What is spectral_connectivity?

spectral_connectivity is a Python software package that computes multitaper spectral estimates and frequency-domain brain connectivity measures such as coherence, spectral granger causality, and the phase lag index using the multitaper Fourier transform. Although there are other Python packages that do this (see nitime and MNE-Python), spectral_connectivity has several differences:

  • it is designed to handle multiple time series at once
  • it caches frequently computed quantities such as the cross-spectral matrix and minimum-phase-decomposition, so that connectivity measures that use the same processing steps can be more quickly computed.
  • it decouples the time-frequency transform and the connectivity measures so that if you already have a preferred way of computing Fourier coefficients (i.e. from a wavelet transform), you can use that instead.
  • it implements the non-parametric version of the spectral granger causality in Python.
  • it implements the canonical coherence, which can efficiently summarize brain-area level coherences from multielectrode recordings.
  • easier user interface for the multitaper fourier transform
  • all function are GPU-enabled if cupy is installed and the environmental variable SPECTRAL_CONNECTIVITY_ENABLE_GPU is set to 'true'.

Tutorials

See the following notebooks for more information on how to use the package:

Usage Example

```python from spectral_connectivity import Multitaper, Connectivity

Compute multitaper spectral estimate

m = Multitaper(timeseries=signals, samplingfrequency=samplingfrequency, timehalfbandwidthproduct=timehalfbandwidthproduct, timewindowduration=0.060, timewindowstep=0.060, starttime=time[0])

Sets up computing connectivity measures/power from multitaper spectral estimate

c = Connectivity.from_multitaper(m)

Here are a couple of examples

power = c.power() # spectral power coherence = c.coherencemagnitude() weightedphaselagindex = c.weightedphaselagindex() canonicalcoherence = c.canonicalcoherence(brainarea_labels) ```

Documentation

See the documentation here.

Citation

For citation, please use the following:

Denovellis, E.L., Myroshnychenko, M., Sarmashghi, M., and Stephen, E.P. (2022). Spectral Connectivity: a python package for computing multitaper spectral estimates and frequency-domain brain connectivity measures on the CPU and GPU. JOSS 7, 4840. 10.21105/joss.04840.

Implemented Measures

Functional

  1. coherency
  2. canonical_coherence
  3. imaginary_coherence
  4. phaselockingvalue
  5. phaselagindex
  6. weightedphaselag_index
  7. debiasedsquaredphaselagindex
  8. debiasedsquaredweightedphaselag_index
  9. pairwisephaseconsistency
  10. global coherence

Directed

  1. directedtransferfunction
  2. directed_coherence
  3. partialdirectedcoherence
  4. generalizedpartialdirected_coherence
  5. directdirectedtransfer_function
  6. group_delay
  7. phaselagindex
  8. pairwisespectralgranger_prediction

Package Dependencies

spectral_connectivity requires:

  • python
  • numpy
  • matplotlib
  • scipy
  • xarray

See environment.yml for the most current list of dependencies.

Installation

bash pip install spectral_connectivity

or

bash conda install -c edeno spectral_connectivity

Developer Installation

If you want to make contributions to this library, please use this installation.

  1. Install miniconda (or anaconda) if it isn't already installed. Type into bash (or install from the anaconda website):

bash 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. Clone the repository to your local machine (.../spectral_connectivity) and install the anaconda environment for the repository. Type into bash:

bash conda env create -f environment.yml conda activate spectral_connectivity pip install -e .

Recent publications and pre-prints that used this software

Owner

  • Name: Eden-Kramer Lab
  • Login: Eden-Kramer-Lab
  • Kind: organization
  • Email: tzvi@bu.edu

Tools for analysis of neural data

JOSS Publication

Spectral Connectivity: a python package for computing multitaper spectral estimates and frequency-domain brain connectivity measures on the CPU and GPU
Published
December 13, 2022
Volume 7, Issue 80, Page 4840
Authors
Eric L. Denovellis ORCID
Howard Hughes Medical Institute - University of California, San Francisco, San Francisco, California, United States of America, Departments of Physiology and Psychiatry, University of California, San Francisco, San Francisco, California, United States of America, Kavli Institute for Fundamental Neuroscience, University of California, San Francisco, San Francisco, California, United States of America
Maxym Myroshnychenko ORCID
National Institute of Neurological Disorders and Stroke, Bethesda, Maryland, United States of America
Mehrad Sarmashghi ORCID
Division of Systems Engineering, Boston University, Boston, Massachusetts, United States of America
Emily P. Stephen ORCID
Department of Mathematics and Statistics, Boston University, Boston, Massachusetts, United States of America, Center for Systems Neuroscience, Boston University, Boston, Massachusetts, United States of America
Editor
Elizabeth DuPre ORCID
Tags
Neuroscience Multitaper analysis Spectral estimation Brain connectivity measures Fourier transform

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
title: 'Eden-Kramer-Lab/spectral_connectivity'
doi: 10.5281/zenodo.10023078
authors:
  - family-names: Denovellis
    given-names: Eric
    orcid: https://orcid.org/0000-0003-4606-087X
    affiliation: Howard Hughes Medical Institute - University of California, San Francisco, San Francisco, California, United States of America
  - family-names: Myroshnychenko
    given-names: Maxym
    affiliation: National Institute of Neurological Disorders and Stroke, Bethesda, Maryland, United States of America
    orcid: https://orcid.org/0000-0001-7790-257X
  - family-names: Sarmashghi
    given-names: Mehrad
    affiliation: Division of Systems Engineering, Boston University, Boston, Massachusetts, United States of America
    orcid: https://orcid.org/0000-0002-7976-6636
  - family-names: Stephen
    given-names: Emily
    affiliation: Department of Mathematics and Statistics, Boston University, Boston, Massachusetts, United States of America
    orcid: https://orcid.org/0000-0003-1978-9622

title: Eden-Kramer-Lab/spectral_connectivity
version: v1.1.2
date-released: 2023-10-17
repository-code: https://github.com/Eden-Kramer-Lab/spectral_connectivity
license: GPL-3.0

preferred-citation:
  type: article
  authors:
  - family-names: Denovellis
    given-names: Eric
    orcid: https://orcid.org/0000-0003-4606-087X
    affiliation: Howard Hughes Medical Institute - University of California, San Francisco, San Francisco, California, United States of America
  - family-names: Myroshnychenko
    given-names: Maxym
    affiliation: National Institute of Neurological Disorders and Stroke, Bethesda, Maryland, United States of America
    orcid: https://orcid.org/0000-0001-7790-257X
  - family-names: Sarmashghi
    given-names: Mehrad
    affiliation: Division of Systems Engineering, Boston University, Boston, Massachusetts, United States of America
    orcid: https://orcid.org/0000-0002-7976-6636
  - family-names: Stephen
    given-names: Emily
    affiliation: Department of Mathematics and Statistics, Boston University, Boston, Massachusetts, United States of America
    orcid: https://orcid.org/0000-0003-1978-9622
  doi: "10.21105/joss.04840"
  journal: "Journal of Open Source Software"
  month: 12
  title: "Spectral Connectivity: a python package for computing multitaper spectral estimates and frequency-domain brain connectivity measures on the CPU and GPU"
  issue: 80
  volume: 7
  year: 2022

GitHub Events

Total
  • Issues event: 2
  • Watch event: 7
  • Issue comment event: 6
  • Push event: 1
  • Pull request review comment event: 2
  • Pull request review event: 3
  • Pull request event: 2
  • Fork event: 1
Last Year
  • Issues event: 2
  • Watch event: 7
  • Issue comment event: 6
  • Push event: 1
  • Pull request review comment event: 2
  • Pull request review event: 3
  • Pull request event: 2
  • Fork event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 366
  • Total Committers: 9
  • Avg Commits per committer: 40.667
  • Development Distribution Score (DDS): 0.115
Past Year
  • Commits: 8
  • Committers: 1
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Eric Denovellis e****s@g****m 324
Mehrad Sarmashghi 5****m 16
Leo Scholl l****l@g****m 8
Max Myroshnychenko m****s@g****m 7
Emily Stephen e****4@g****m 6
Stefan Appelhoff s****f@m****g 2
Patrick F. Bloniasz 7****p 1
Danylo Ulianych d****a@g****m 1
Andrew Quinn a****1@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 39
  • Total pull requests: 20
  • Average time to close issues: 8 months
  • Average time to close pull requests: 23 days
  • Total issue authors: 13
  • Total pull request authors: 8
  • Average comments per issue: 1.46
  • Average comments per pull request: 1.95
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 4.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • edeno (11)
  • sappelhoff (10)
  • EtienneCmb (4)
  • emilyps14 (3)
  • AJQuinn (3)
  • mkkubins (1)
  • christian-oreilly (1)
  • xiaolongwu0713 (1)
  • saarangp (1)
  • mschart (1)
  • mgm248 (1)
  • olivercliff (1)
  • KaetzelLab (1)
Pull Request Authors
  • mmyros (7)
  • emilyps14 (4)
  • MehradSm (2)
  • leoscholl (2)
  • dizcza (2)
  • sappelhoff (2)
  • AJQuinn (1)
  • bloniaszp (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 615 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 3
  • Total versions: 16
  • Total maintainers: 1
pypi.org: spectral-connectivity

Frequency domain functional and directedconnectivity analysis tools for electrophysiologicaldata

  • Versions: 16
  • Dependent Packages: 3
  • Dependent Repositories: 3
  • Downloads: 615 Last month
Rankings
Dependent packages count: 4.8%
Forks count: 6.4%
Stargazers count: 6.8%
Average: 7.5%
Dependent repos count: 9.0%
Downloads: 10.4%
Maintainers (1)
Last synced: 4 months ago

Dependencies

docs/requirements-docs.txt pypi
  • numpydoc *
  • sphinx *
  • sphinx_rtd_theme *
.github/workflows/PR-test.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • conda-incubator/setup-miniconda v2 composite
  • coverallsapp/github-action master composite
  • styfle/cancel-workflow-action 0.6.0 composite
.github/workflows/linting.yml actions
  • actions/checkout v2 composite
  • psf/black stable composite
setup.py pypi
environment.yml conda
  • black
  • coveralls
  • flake8
  • jupyter
  • jupyterlab
  • matplotlib
  • nitime
  • numpy >=1.11
  • numpydoc
  • pytest >=2.7.1
  • pytest-cov
  • scipy
  • setuptools
  • sphinx
  • sphinx-autoapi
  • sphinx-copybutton
  • xarray