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)
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
Scientific Fields
Repository
Frequency domain estimation and functional and directed connectivity analysis tools for electrophysiological data
Basic Info
Statistics
- Stars: 129
- Watchers: 3
- Forks: 45
- Open Issues: 9
- Releases: 12
Topics
Metadata Files
README.md
spectral_connectivity
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
cupyis installed and the environmental variableSPECTRAL_CONNECTIVITY_ENABLE_GPUis 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
- coherency
- canonical_coherence
- imaginary_coherence
- phaselockingvalue
- phaselagindex
- weightedphaselag_index
- debiasedsquaredphaselagindex
- debiasedsquaredweightedphaselag_index
- pairwisephaseconsistency
- global coherence
Directed
- directedtransferfunction
- directed_coherence
- partialdirectedcoherence
- generalizedpartialdirected_coherence
- directdirectedtransfer_function
- group_delay
- phaselagindex
- 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.
- 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
- 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
- Detection of Directed Connectivities in Dynamic Systems for Different Excitation Signals using Spectral Granger Causality https://doi.org/10.1007/978-3-662-58485-9_11
- Network Path Convergence Shapes Low-Level Processing in the Visual Cortex https://doi.org/10.3389/fnsys.2021.645709
- Subthalamic–Cortical Network Reorganization during Parkinson's Tremor https://doi.org/10.1523/JNEUROSCI.0854-21.2021
- Unifying Pairwise Interactions in Complex Dynamics https://doi.org/10.48550/arXiv.2201.11941
- Phencyclidine-induced psychosis causes hypersynchronization and disruption of connectivity within prefrontal-hippocampal circuits that is rescued by antipsychotic drugs https://doi.org/10.1101/2021.02.03.429582
- The cerebellum regulates fear extinction through thalamo-prefrontal cortex interactions in male mice https://doi.org/10.1038/s41467-023-36943-w
Owner
- Name: Eden-Kramer Lab
- Login: Eden-Kramer-Lab
- Kind: organization
- Email: tzvi@bu.edu
- Website: https://eden-kramer-lab.github.io/
- Repositories: 39
- Profile: https://github.com/Eden-Kramer-Lab
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
Authors
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
National Institute of Neurological Disorders and Stroke, Bethesda, Maryland, United States of America
Tags
Neuroscience Multitaper analysis Spectral estimation Brain connectivity measures Fourier transformCitation (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
Top Committers
| Name | 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
- Homepage: https://github.com/Eden-Kramer-Lab/spectral_connectivity
- Documentation: https://spectral-connectivity.readthedocs.io/en/latest/
- License: GPL-3.0
-
Latest release: 1.1.2
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- numpydoc *
- sphinx *
- sphinx_rtd_theme *
- 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
- actions/checkout v2 composite
- psf/black stable composite
- 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