Skip to content

Commit d2492ee

Browse files
authored
Merge pull request #201 from ttngu207/dev_new_main
Major refactor! Remove additional variation of the "ephys" modules! Support using SpikeInterface for spike sorting
2 parents 89e4d68 + 0ee86d2 commit d2492ee

31 files changed

+1160
-6858
lines changed

.github/workflows/test.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
name: Test
22
on:
33
push:
4+
branches:
5+
- main
46
pull_request:
7+
branches:
8+
- main
59
workflow_dispatch:
610
jobs:
711
devcontainer-build:
@@ -11,12 +15,7 @@ jobs:
1115
strategy:
1216
matrix:
1317
py_ver: ["3.9", "3.10"]
14-
mysql_ver: ["8.0", "5.7"]
15-
include:
16-
- py_ver: "3.8"
17-
mysql_ver: "5.7"
18-
- py_ver: "3.7"
19-
mysql_ver: "5.7"
18+
mysql_ver: ["8.0"]
2019
steps:
2120
- uses: actions/checkout@v3
2221
- name: Set up Python ${{matrix.py_ver}}
@@ -31,4 +30,3 @@ jobs:
3130
run: |
3231
python_version=${{matrix.py_ver}}
3332
black element_array_ephys --check --verbose --target-version py${python_version//.}
34-

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exclude: (^.github/|^docs/|^images/)
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v4.4.0
6+
rev: v4.5.0
77
hooks:
88
- id: trailing-whitespace
99
- id: end-of-file-fixer
@@ -16,7 +16,7 @@ repos:
1616

1717
# black
1818
- repo: https://github.com/psf/black
19-
rev: 22.12.0
19+
rev: 24.2.0
2020
hooks:
2121
- id: black
2222
- id: black-jupyter
@@ -25,15 +25,15 @@ repos:
2525

2626
# isort
2727
- repo: https://github.com/pycqa/isort
28-
rev: 5.11.2
28+
rev: 5.13.2
2929
hooks:
3030
- id: isort
3131
args: ["--profile", "black"]
3232
description: Sorts imports in an alphabetical order
3333

3434
# flake8
3535
- repo: https://github.com/pycqa/flake8
36-
rev: 4.0.1
36+
rev: 7.0.0
3737
hooks:
3838
- id: flake8
3939
args: # arguments to configure flake8

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
44
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
55

6+
## [0.4.0] - 2025-01-28
7+
8+
+ Update - No longer support multiple variation of ephys module, keep only `ephys_no_curation` module, renamed to `ephys`
9+
+ Update - Remove other ephys modules (e.g. `ephys_acute`, `ephys_chronic`) (moved to different branches)
10+
+ Feat - Add support for `SpikeInterface`
11+
+ Update - Remove support for `ecephys_spike_sorting` (moved to a different branch)
12+
+ Update - Simplify the "activate" mechanism
13+
614
## [0.3.8] - 2025-01-16
715

816
* Fix - Revert GHA Semantic Release caller and update changelog

docs/docker-compose.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ services:
3030
export ELEMENT_UNDERSCORE=$$(echo $${PACKAGE} | sed 's/element_//g')
3131
export ELEMENT_HYPHEN=$$(echo $${ELEMENT_UNDERSCORE} | sed 's/_/-/g')
3232
export PATCH_VERSION=$$(cat /main/$${PACKAGE}/version.py | grep -oE '\d+\.\d+\.[a-z0-9]+')
33-
git clone https://github.com/datajoint/workflow-$${ELEMENT_HYPHEN}.git /main/delete || true
34-
if [ -d /main/delete/ ]; then
35-
mv /main/delete/workflow_$${ELEMENT_UNDERSCORE} /main/
36-
mv /main/delete/notebooks/*ipynb /main/docs/src/tutorials/
37-
rm -fR /main/delete
38-
fi
3933
if echo "$${MODE}" | grep -i live &>/dev/null; then
4034
mkdocs serve --config-file ./docs/mkdocs.yaml -a 0.0.0.0:80 2>&1 | tee docs/temp_mkdocs.log
4135
elif echo "$${MODE}" | grep -iE "qa|push" &>/dev/null; then

docs/mkdocs.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,7 @@ nav:
99
- Concepts: concepts.md
1010
- Tutorials:
1111
- Overview: tutorials/index.md
12-
- Data Download: tutorials/00-data-download-optional.ipynb
13-
- Configure: tutorials/01-configure.ipynb
14-
- Workflow Structure: tutorials/02-workflow-structure-optional.ipynb
15-
- Process: tutorials/03-process.ipynb
16-
- Automate: tutorials/04-automate-optional.ipynb
17-
- Explore: tutorials/05-explore.ipynb
18-
- Drop: tutorials/06-drop-optional.ipynb
19-
- Downstream Analysis: tutorials/07-downstream-analysis.ipynb
20-
- Visualizations: tutorials/10-data_visualization.ipynb
21-
- Electrode Localization: tutorials/08-electrode-localization.ipynb
22-
- NWB Export: tutorials/09-NWB-export.ipynb
23-
- Quality Metrics: tutorials/quality_metrics.ipynb
12+
- Tutorial: tutorials/tutorial.ipynb
2413
- Citation: citation.md
2514
- API: api/ # defer to gen-files + literate-nav
2615
- Changelog: changelog.md

docs/src/concepts.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,16 @@ significant community uptake:
5959
Kilosort provides most automation and has gained significant popularity, being adopted
6060
as one of the key spike sorting methods in the majority of the teams/collaborations we
6161
have worked with. As part of our Year-1 NIH U24 effort, we provide support for data
62-
ingestion of spike sorting results from Kilosort. Further effort will be devoted for the
62+
ingestion of spike sorting results from Kilosort.
63+
64+
Further effort has been devoted for the
6365
ingestion support of other spike sorting methods. On this end, a framework for unifying
6466
existing spike sorting methods, named
6567
[SpikeInterface](https://github.com/SpikeInterface/spikeinterface), has been developed
6668
by Alessio Buccino, et al. SpikeInterface provides a convenient Python-based wrapper to
67-
invoke, extract, compare spike sorting results from different sorting algorithms.
69+
invoke, extract, compare spike sorting results from different sorting algorithms.
70+
SpikeInterface is the primary tool supported by Element Array Electrophysiology for
71+
spike sorting as of version `0.4.0`.
6872

6973
## Key Partnerships
7074

@@ -95,22 +99,10 @@ Each of the DataJoint Elements creates a set of tables for common neuroscience d
9599
modalities to organize, preprocess, and analyze data. Each node in the following diagram
96100
is a table within the Element or a table connected to the Element.
97101

98-
### `ephys_acute` module
102+
### `ephys` module
99103

100104
![diagram](https://raw.githubusercontent.com/datajoint/element-array-ephys/main/images/attached_array_ephys_element_acute.svg)
101105

102-
### `ephys_chronic` module
103-
104-
![diagram](https://raw.githubusercontent.com/datajoint/element-array-ephys/main/images/attached_array_ephys_element_chronic.svg)
105-
106-
### `ephys_precluster` module
107-
108-
![diagram](https://raw.githubusercontent.com/datajoint/element-array-ephys/main/images/attached_array_ephys_element_precluster.svg)
109-
110-
### `ephys_no_curation` module
111-
112-
![diagram](https://raw.githubusercontent.com/datajoint/element-array-ephys/main/images/attached_array_ephys_element_no_curation.svg)
113-
114106
### `subject` schema ([API docs](https://datajoint.com/docs/elements/element-animal/api/element_animal/subject))
115107

116108
Although not required, most choose to connect the `Session` table to a `Subject` table.
@@ -181,12 +173,11 @@ Major features of the Array Electrophysiology Element include:
181173
+ Probe-insertion, ephys-recordings, LFP extraction, clusterings, curations, sorted
182174
units and the associated data (e.g. spikes, waveforms, etc.).
183175

184-
+ Store/track/manage different curations of the spike sorting results - supporting
185-
both curated clustering and kilosort triggered clustering (i.e., `no_curation`).
176+
+ Store/track/manage the spike sorting results.
186177

187178
+ Ingestion support for data acquired with SpikeGLX and OpenEphys acquisition systems.
188-
+ Ingestion support for spike sorting outputs from Kilosort.
189-
+ Triggering support for workflow integrated Kilosort processing.
179+
+ Ingestion support for spike sorting outputs from SpikeInterface.
180+
+ Triggering support for workflow integrated SpikeInterface processing.
190181
+ Sample data and complete test suite for quality assurance.
191182

192183
## Data Export and Publishing
@@ -208,8 +199,7 @@ pip install element-array-ephys[nwb]
208199

209200
## Roadmap
210201

211-
Incorporation of SpikeInterface into the Array Electrophysiology Element will be
212-
on DataJoint Elements development roadmap. Dr. Loren Frank has led a development
202+
Dr. Loren Frank has led a development
213203
effort of a DataJoint pipeline with SpikeInterface framework and
214204
NeurodataWithoutBorders format integrated
215205
[https://github.com/LorenFrankLab/nwb_datajoint](https://github.com/LorenFrankLab/nwb_datajoint).

docs/src/index.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
# Element Array Electrophysiology
22

33
This Element features DataJoint schemas for analyzing extracellular array
4-
electrophysiology data acquired with Neuropixels probes and spike sorted using Kilosort
5-
spike sorter. Each Element is a modular pipeline for data storage and processing with
4+
electrophysiology data acquired with Neuropixels probes and spike sorted using [SpikeInterface](https://github.com/SpikeInterface/spikeinterface).
5+
Each Element is a modular pipeline for data storage and processing with
66
corresponding database tables that can be combined with other Elements to assemble a
77
fully functional pipeline.
88

99
![diagram](https://raw.githubusercontent.com/datajoint/element-array-ephys/main/images/diagram_flowchart.svg)
1010

11-
The Element is comprised of `probe` and `ephys` schemas. Several `ephys` schemas are
12-
developed to handle various use cases of this pipeline and workflow:
13-
14-
+ `ephys_acute`: A probe is inserted into a new location during each session.
15-
16-
+ `ephys_chronic`: A probe is inserted once and used to record across multiple
17-
sessions.
18-
19-
+ `ephys_precluster`: A probe is inserted into a new location during each session.
20-
Pre-clustering steps are performed on the data from each probe prior to Kilosort
21-
analysis.
22-
23-
+ `ephys_no_curation`: A probe is inserted into a new location during each session and
24-
Kilosort-triggered clustering is performed without the option to manually curate the
25-
results.
26-
27-
Visit the [Concepts page](./concepts.md) for more information about the use cases of
11+
The Element is comprised of `probe` and `ephys` schemas. Visit the
12+
[Concepts page](./concepts.md) for more information about the `probe` and
2813
`ephys` schemas and an explanation of the tables. To get started with building your own
2914
data pipeline, visit the [Tutorials page](./tutorials/index.md).
15+
16+
Prior to version `0.4.0` , several `ephys` schemas were
17+
developed and supported to handle various use cases of this pipeline and workflow. These
18+
are now deprecated but still available on their own branch within the repository:
19+
20+
* [`ephys_acute`](https://github.com/datajoint/element-array-ephys/tree/main_ephys_acute)
21+
* [`ephys_chronic`](https://github.com/datajoint/element-array-ephys/tree/main_ephys_chronic)
22+
* [`ephys_precluster`](https://github.com/datajoint/element-array-ephys/tree/main_ephys_precluster)
23+
* [`ephys_no_curation`](https://github.com/datajoint/element-array-ephys/tree/main_ephys_no_curation)

docs/src/tutorials/index.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Tutorials
22

3+
## Executing the Tutorial Notebooks
4+
5+
The tutorials are set up to run using GitHub Codespaces. To run the tutorials, click on
6+
the "Open in Codespaces" button from the GitHub repository. This will open a
7+
pre-configured environment with a VSCode IDE in your browser. THe environment contains
8+
all the necessary dependencies and sample data to run the tutorials.
9+
310
## Installation
411

512
Installation of the Element requires an integrated development environment and database.
613
Instructions to setup each of the components can be found on the
7-
[User Instructions](https://datajoint.com/docs/elements/user-guide/) page. These
8-
instructions use the example
9-
[workflow for Element Array Ephys](https://github.com/datajoint/workflow-array-ephys),
10-
which can be modified for a user's specific experimental requirements. This example
11-
workflow uses several Elements (Lab, Animal, Session, Event, and Electrophysiology) to construct
14+
[User Instructions](https://datajoint.com/docs/elements/user-guide/) page. The example
15+
tutorial uses several Elements (Lab, Animal, Session, Event, and Electrophysiology) to construct
1216
a complete pipeline, and is able to ingest experimental metadata and run model training
1317
and inference.
1418

@@ -23,32 +27,10 @@ Electrophysiology.
2327
### Notebooks
2428

2529
Each of the notebooks in the workflow
26-
([download here](https://github.com/datajoint/workflow-array-ephys/tree/main/notebooks)
30+
([download here](https://github.com/datajoint/workflow-array-ephys/tree/main/notebooks))
2731
steps through ways to interact with the Element itself. For convenience, these notebooks
2832
are also rendered as part of this site. To try out the Elements notebooks in an online
2933
Jupyter environment with access to example data, visit
3034
[CodeBook](https://codebook.datajoint.io/). (Electrophysiology notebooks coming soon!)
3135

32-
- [Data Download](./00-data-download-optional.ipynb) highlights how to use DataJoint
33-
tools to download a sample model for trying out the Element.
34-
- [Configure](./01-configure.ipynb) helps configure your local DataJoint installation to
35-
point to the correct database.
36-
- [Workflow Structure](./02-workflow-structure-optional.ipynb) demonstrates the table
37-
architecture of the Element and key DataJoint basics for interacting with these
38-
tables.
39-
- [Process](./03-process.ipynb) steps through adding data to these tables and launching
40-
key Electrophysiology features, like model training.
41-
- [Automate](./04-automate-optional.ipynb) highlights the same steps as above, but
42-
utilizing all built-in automation tools.
43-
- [Explore](./05-explore.ipynb) demonstrates how to fetch data from the Element.
44-
- [Drop schemas](./06-drop-optional.ipynb) provides the steps for dropping all the
45-
tables to start fresh.
46-
- [Downstream Analysis](./07-downstream-analysis.ipynb) highlights how to link
47-
this Element to Element Event for event-based analyses.
48-
- [Visualizations](./10-data_visualization.ipynb) highlights how to use a built-in module
49-
for visualizing units, probes and quality metrics.
50-
- [Electrode Localization](./08-electrode-localization.ipynb) demonstrates how to link
51-
this Element to
52-
[Element Electrode Localization](https://datajoint.com/docs/elements/element-electrode-localization/).
53-
- [NWB Export](./09-NWB-export.ipynb) highlights the export functionality available for the
54-
`no-curation` schema.
36+
- [Tutorial](../../../notebooks/tutorial.ipynb)

element_array_ephys/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
from . import ephys_acute as ephys
1+
from . import ephys
2+
3+
ephys_no_curation = ephys # alias for backward compatibility

0 commit comments

Comments
 (0)