Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a0df46b
update: install neo from source until 0.14.1 release
ttngu207 Mar 4, 2025
234f38e
fix(docs): update home URL from `datajoint.com/docs` to `docs.datajoi…
MilagrosMarin May 19, 2025
efb91b8
style: apply formatting
MilagrosMarin May 19, 2025
fbf83de
Merge remote-tracking branch 'upstream/main' into update-docs
MilagrosMarin May 20, 2025
3bdf7e7
style: black formatting
MilagrosMarin May 20, 2025
0464fe2
Merge pull request #220 from MilagrosMarin/update-docs
ttngu207 May 20, 2025
e00ebef
Update: Use `Spikeinterface` official released versions (instead of i…
ttngu207 Jun 4, 2025
e4841ae
Merge pull request #221 from ttngu207/main
MilagrosMarin Jun 4, 2025
aa6f45d
Moved KiloSort's template_features to additional_files
tabedzki Jun 4, 2025
19ae04f
Update version.py
tabedzki Jun 4, 2025
297e261
Merge pull request #222 from tabedzki/patch-kilosort-files
ttngu207 Jun 4, 2025
3b187cb
update: update params in test/tutorials
ttngu207 Jun 6, 2025
fd837ec
chore: update changelog
ttngu207 Jun 6, 2025
9391f97
chore: set up jupyter kernel in devcontainer
ttngu207 Jun 6, 2025
9d03efb
chore: update dockerfile
ttngu207 Jun 6, 2025
6fbf5d4
fix: fix devcontainer
ttngu207 Jun 6, 2025
f61416b
Update setup.py - supports python3.11
ttngu207 Jun 9, 2025
1cd35a9
fix: jupyter kernel
ttngu207 Jun 9, 2025
e2c03ba
fix: jupyter kernel
ttngu207 Jun 9, 2025
bac296b
chore: update si params in notebook
ttngu207 Jun 9, 2025
d5eb76f
chore: minor bugfix
ttngu207 Jun 9, 2025
44548d3
Merge pull request #223 from ttngu207/main
dimitri-yatsenko Jun 11, 2025
c5a2285
update notebook with spectrogram plot
MilagrosMarin Jul 8, 2025
15874d0
remove `skip_duplicates`
MilagrosMarin Jul 8, 2025
776aa93
Merge pull request #224 from MilagrosMarin/main
ttngu207 Jul 8, 2025
c395bd0
black formatting
MilagrosMarin Sep 16, 2025
f0939d1
fix: rename `env.yml` to `conda_env.yml` for consistency with other p…
MilagrosMarin Sep 16, 2025
db99d0d
bump version and update CHANGELOG
MilagrosMarin Sep 16, 2025
7dc76e8
Merge pull request #225 from MilagrosMarin/main
ttngu207 Sep 17, 2025
0e5295c
Merge remote-tracking branch 'upstream/main'
ttngu207 Dec 5, 2025
ecd0cad
feat: use three-part-make for `EphysRecording` table
ttngu207 Dec 5, 2025
3eba39c
fix: update probe model assignment in SpikeGLXMeta class
ttngu207 Dec 5, 2025
aaa6e1a
Merge branch 'main_external-storage' of https://github.com/dj-sciops/…
ttngu207 Dec 5, 2025
9b51b74
templates_ind, whitening_mat, whitening_mat_inv in "_kilosort_additio…
ttngu207 Dec 10, 2025
fa6180a
Merge pull request #227 from dj-sciops/main
esutlie Dec 10, 2025
676c700
Merge pull request #228 from datajoint/fix_kilosort_core_files
esutlie Dec 10, 2025
12985af
version bump to 0.4.6
ttngu207 Dec 10, 2025
c4fafcd
Merge pull request #229 from datajoint/dev_version_bump_0.4.6
esutlie Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM python:3.9-slim@sha256:5f0192a4f58a6ce99f732fe05e3b3d00f12ae62e183886bca3ebe3d202686c7f
ARG PY_VER=3.11
ARG DISTRO=bullseye
FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO}

ENV PATH /usr/local/bin:$PATH
ENV PYTHON_VERSION 3.9.17
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

USER root

RUN \
adduser --system --disabled-password --shell /bin/bash vscode && \
# install docker
apt-get update && \
apt-get install ca-certificates curl gnupg lsb-release -y && \
Expand Down Expand Up @@ -45,4 +48,5 @@ ENV EPHYS_ROOT_DATA_DIR /workspaces/element-array-ephys/example_data
ENV DATABASE_PREFIX neuro_

USER vscode
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"

CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
},
"vscode": {
"extensions": [
"ms-python.python@2023.8.0",
"ms-toolsai.jupyter@2023.3.1201040234"
"ms-python.python@2025.6.1",
"ms-toolsai.jupyter@2025.4.1"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: DataJoint Contribution Guideline
url: https://docs.datajoint.org/python/community/02-Contribute.html
url: https://docs.datajoint.com/about/contribute/
about: Please make sure to review the DataJoint Contribution Guidelines
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [0.4.5] - 2025-09-17

+ Fix - Rename `env.yml` to `conda_env.yml` for consistency with other projects
+ Update - Passing tests by blackifying previous updates

## [0.4.4] - 2025-06-06

+ Update - Update params in test/tutorial
+ Fix - Moved KiloSort's template_features to additional_files

## [0.4.3] - 2025-06-03

+ Update - Use `Spikeinterface` official released versions (instead of install directly from source)

## [0.4.2] - 2025-03-25

+ Fix - Add key_source to `ProbeLevelReport` to filter for 'good' quality units
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contribution Guidelines

This project follows the
[DataJoint Contribution Guidelines](https://datajoint.com/docs/about/contribute/).
[DataJoint Contribution Guidelines](https://docs.datajoint.com/about/contribute/).
Please reference the link for more full details.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ environment and notebooks to learn the pipeline.
+ [Interactive tutorial on GitHub
Codespaces](https://github.com/datajoint/element-array-ephys#interactive-tutorial)

+ [Documentation](https://datajoint.com/docs/elements/element-array-ephys)
+ [Documentation](https://docs.datajoint.com/elements/element-array-ephys/)

## Support

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- # ---------------------- PROJECT SPECIFIC ---------------------------

site_name: DataJoint Documentation
site_url: http://localhost/docs/elements/element-array-ephys
site_url: https://docs.datajoint.com/elements/element-array-ephys/
repo_url: https://github.com/datajoint/element-array-ephys
repo_name: datajoint/element-array-ephys
nav:
Expand Down
7 changes: 3 additions & 4 deletions docs/src/.overrides/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
{% endif %}
<nav class="{{ class }}" aria-label="{{ lang.t('nav.title') }}" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}"
title="{{ config.site_name | e }}" class="md-nav__button md-logo"
aria-label="{{ config.site_name }}" data-md-component="logo">
<a href="{{ config.extra.homepage | d(nav.homepage.url, true) | url }}" title="{{ config.site_name | e }}"
class="md-nav__button md-logo" aria-label="{{ config.site_name }}" data-md-component="logo">
{% include "partials/logo.html" %}
</a>
{#-
Add DataJoint home link to navigation header, otherwise unchanged
-#}
<a href="https://datajoint.com/docs/elements/" title="DataJoint Elements">
<a href="https://docs.datajoint.com/elements/" title="DataJoint Elements">
⬅ Home
</a>
</label>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ is a table within the Element or a table connected to the Element.

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

### `subject` schema ([API docs](https://datajoint.com/docs/elements/element-animal/api/element_animal/subject))
### `subject` schema ([API docs](https://docs.datajoint.com/elements/element-animal/0.1/api/element_animal/subject/))

Although not required, most choose to connect the `Session` table to a `Subject` table.

| Table | Description |
| --- | --- |
| Subject | A table containing basic information of the research subject. |

### `session` schema ([API docs](https://datajoint.com/docs/elements/element-session/api/element_session/session_with_datetime))
### `session` schema ([API docs](https://docs.datajoint.com/elements/element-session/))

| Table | Description |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ all the necessary dependencies and sample data to run the tutorials.

Installation of the Element requires an integrated development environment and database.
Instructions to setup each of the components can be found on the
[User Instructions](https://datajoint.com/docs/elements/user-guide/) page. The example
[User Instructions](https://docs.datajoint.com/elements/user-guide/) page. The example
tutorial uses several Elements (Lab, Animal, Session, Event, and Electrophysiology) to construct
a complete pipeline, and is able to ingest experimental metadata and run model training
and inference.
Expand Down
36 changes: 30 additions & 6 deletions element_array_ephys/ephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pathlib
import re
from decimal import Decimal

from typing import Any, Dict, List, Tuple
import datajoint as dj
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -293,14 +293,28 @@ class EphysFile(dj.Part):
file_path: varchar(255) # filepath relative to root data directory
"""

def make(self, key):
"""Populates table with electrophysiology recording information."""
def make_fetch(self, key: dict) -> Tuple[pathlib.Path, str, List[str], List[str]]:
"""Fetch required data from database for processing."""
session_dir = find_full_path(
get_ephys_root_data_dir(), get_session_directory(key)
)
inserted_probe_serial_number = (ProbeInsertion * probe.Probe & key).fetch1(
"probe"
)
supported_probe_types = list(probe.ProbeType.fetch("probe_type"))
supported_acq_software = list(AcquisitionSoftware.fetch("acq_software"))

return session_dir, inserted_probe_serial_number, supported_probe_types, supported_acq_software

def make_compute(
self,
key: dict,
session_dir: pathlib.Path,
inserted_probe_serial_number: str,
supported_probe_types: List[str],
supported_acq_software: List[str],
) -> Tuple[Dict[str, Any], List[Dict[str, Any]], Dict[str, Any], List[Dict[str, Any]], List[Dict[str, Any]]]:
"""Populates table with electrophysiology recording information."""

# Search session dir and determine acquisition software
for ephys_pattern, ephys_acq_type in (
Expand All @@ -317,13 +331,11 @@ def make(self, key):
"Neither SpikeGLX nor Open Ephys recording files found"
)

if acq_software not in AcquisitionSoftware.fetch("acq_software"):
if acq_software not in supported_acq_software:
raise NotImplementedError(
f"Processing ephys files from acquisition software of type {acq_software} is not yet implemented."
)

supported_probe_types = probe.ProbeType.fetch("probe_type")

if acq_software == "SpikeGLX":
for meta_filepath in ephys_meta_filepaths:
spikeglx_meta = spikeglx.SpikeGLXMeta(meta_filepath)
Expand Down Expand Up @@ -483,6 +495,18 @@ def make(self, key):
f"Processing ephys files from acquisition software of type {acq_software} is not yet implemented."
)

return econfig_entry, econfig_electrodes, ephys_recording_entry, ephys_file_entries, ephys_channel_entries

def make_insert(
self,
key: dict,
econfig_entry: Dict[str, Any],
econfig_electrodes: List[Dict[str, Any]],
ephys_recording_entry: Dict[str, Any],
ephys_file_entries: List[Dict[str, Any]],
ephys_channel_entries: List[Dict[str, Any]],
) -> None:
"""Insert computed data into database tables."""
# Insert into probe.ElectrodeConfig (recording configuration)
if not probe.ElectrodeConfig & {
"electrode_config_hash": econfig_entry["electrode_config_hash"]
Expand Down
4 changes: 2 additions & 2 deletions element_array_ephys/ephys_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import datajoint as dj
from element_interface.utils import dict_to_uuid

from . import probe, ephys
from . import ephys, probe

schema = dj.schema()

Expand Down Expand Up @@ -50,7 +50,7 @@ class ProbeLevelReport(dj.Computed):
---
drift_map_plot: attach
"""

@property
def key_source(self):
return ephys.CuratedClustering & (
Expand Down
14 changes: 7 additions & 7 deletions element_array_ephys/readers/kilosort.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import re
import logging
from .utils import convert_to_number
from element_array_ephys.readers.utils import convert_to_number

log = logging.getLogger(__name__)

Expand All @@ -21,12 +21,7 @@ class Kilosort:
"similar_templates.npy",
"spike_templates.npy",
"spike_times.npy",
"template_features.npy",
"template_feature_ind.npy",
"templates.npy",
"templates_ind.npy",
"whitening_mat.npy",
"whitening_mat_inv.npy",
"spike_clusters.npy",
]

Expand All @@ -35,6 +30,11 @@ class Kilosort:
"spike_times_sec_adj.npy",
"cluster_groups.csv",
"cluster_KSLabel.tsv",
"template_features.npy",
"template_feature_ind.npy",
"templates_ind.npy",
"whitening_mat.npy",
"whitening_mat_inv.npy",
]

kilosort_files = _kilosort_core_files + _kilosort_additional_files
Expand All @@ -47,7 +47,7 @@ def __init__(self, kilosort_dir):

self.validate()

params_filepath = kilosort_dir / "params.py"
params_filepath = self._kilosort_dir / "params.py"
self._info = {
"time_created": datetime.fromtimestamp(params_filepath.stat().st_ctime),
"time_modified": datetime.fromtimestamp(params_filepath.stat().st_mtime),
Expand Down
2 changes: 1 addition & 1 deletion element_array_ephys/readers/spikeglx.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def __init__(self, meta_filepath):
elif probe_model == 24:
self.probe_model = "neuropixels 2.0 - MS"
else:
self.probe_model = str(probe_model)
self.probe_model = self.probe_PN

# Get recording time
self.recording_time = datetime.strptime(
Expand Down
2 changes: 1 addition & 1 deletion element_array_ephys/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Package metadata."""

__version__ = "0.4.2"
__version__ = "0.4.6"
Loading
Loading