Skip to content

Commit c5f20b0

Browse files
authored
Merge branch 'datajoint:main' into main
2 parents 8035648 + 47dea95 commit c5f20b0

20 files changed

+1771
-676
lines changed

.github/workflows/u24_element_release_call.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
secrets:
1818
TWINE_USERNAME: ${{secrets.TWINE_TEST_USERNAME}}
1919
TWINE_PASSWORD: ${{secrets.TWINE_TEST_PASSWORD}}
20-
GOOGLE_ANALYTICS_KEY: ${{secrets.GOOGLE_ANALYTICS_KEY}}
2120
call_u24_elements_release_alpine:
2221
if: >-
2322
github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'datajoint' && !contains(github.event.workflow_run.head_branch, 'test')
@@ -27,5 +26,4 @@ jobs:
2726
secrets:
2827
TWINE_USERNAME: ${{secrets.TWINE_USERNAME}}
2928
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
30-
GOOGLE_ANALYTICS_KEY: ${{secrets.GOOGLE_ANALYTICS_KEY}}
3129

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,35 @@
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.2.10] - 2023-05-26
7+
8+
+ Add - Kilosort, NWB, and DANDI citations
9+
+ Fix - CSS to improve readability of tables in dark mode
10+
+ Update - mkdocs.yaml
11+
12+
## [0.2.9] - 2023-05-11
13+
14+
+ Fix - `.ipynb` dark mode output for all notebooks.
15+
16+
## [0.2.8] - 2023-04-28
17+
18+
+ Fix - `.ipynb` output in tutorials is not visible in dark mode.
19+
20+
## [0.2.7] - 2023-04-19
21+
22+
+ Bugfix - A name remapping dictionary was added to ensure consistency between the column names of the `metrics.csv` file and the attribute names of the `QualityMetrics` table
23+
24+
## [0.2.6] - 2023-04-17
25+
26+
+ Fix - Update Pandas DataFrame column name to insert `pt_ratio` in `QualityMetrics.Waveform` table
27+
28+
## [0.2.5] - 2023-04-12
29+
30+
+ Add - docstrings for quality metric tables
31+
+ Fix - docstring errors
32+
+ Update - `concepts.md`
33+
+ Update - schema diagrams with quality metrics tables
34+
635
## [0.2.4] - 2023-03-10
736

837
+ Update - Requirements with `ipywidgets` and `scikit-image` for plotting widget
@@ -90,6 +119,12 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
90119
+ Add - Probe table supporting: Neuropixels probes 1.0 - 3A, 1.0 - 3B, 2.0 - SS,
91120
2.0 - MS
92121

122+
[0.2.10]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.10
123+
[0.2.9]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.9
124+
[0.2.8]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.8
125+
[0.2.7]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.7
126+
[0.2.6]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.6
127+
[0.2.5]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.5
93128
[0.2.4]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.4
94129
[0.2.3]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.3
95130
[0.2.2]: https://github.com/datajoint/element-array-ephys/releases/tag/0.2.2

docs/.docker/pip_requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ mkdocs-gen-files
88
mkdocs-literate-nav
99
mkdocs-exclude-search
1010
mkdocs-markdownextradata-plugin
11-
mkdocs-jupyter
11+
mkdocs-jupyter
12+
mkdocs-section-index

docs/docker-compose.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ services:
1414
- PACKAGE
1515
- UPSTREAM_REPO
1616
- MODE
17-
- GOOGLE_ANALYTICS_KEY
1817
- PATCH_VERSION
1918
volumes:
2019
- ../docs:/main/docs

docs/mkdocs.yaml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ---------------------- PROJECT SPECIFIC ---------------------------
1+
--- # ---------------------- PROJECT SPECIFIC ---------------------------
22

33
site_name: DataJoint Documentation
44
site_url: http://localhost/docs/elements/element-array-ephys
@@ -7,19 +7,20 @@ repo_name: datajoint/element-array-ephys
77
nav:
88
- Element Array Ephys: index.md
99
- Concepts: concepts.md
10-
- Tutorials:
11-
- 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
10+
- Tutorials:
11+
- 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
2324
- Citation: citation.md
2425
- API: api/ # defer to gen-files + literate-nav
2526
- Changelog: changelog.md
@@ -35,7 +36,7 @@ nav:
3536
# 02. Instead of designating codeblocks with bash, use console. For example..
3637
# ```console
3738
# cd ../my_dir
38-
# ```
39+
# ```
3940
# 03. Links across docs should ...
4041
# A. Not involve line breaks.
4142
# B. Use relative paths to docs in the same repo
@@ -54,19 +55,16 @@ nav:
5455
# UPSTREAM_REPO=https://github.com/datajoint/element-{ELEMENT}.git \
5556
# HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
5657
# ```
57-
# 02. Site analytics depend on a local environment variable GOOGLE_ANALYTICS_KEY
58-
# You can find this in LastPass or declare with any string to suppress errors
59-
# 03. The API section will pull docstrings.
58+
# 02. The API section will pull docstrings.
6059
# A. Follow google style guide e.g.,
6160
# https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
6261
# With typing suggestions: https://docs.python.org/3/library/typing.html
6362
# B. To pull a specific workflow fork, change ./docs/src/api/make_pages.py#L19
64-
# 04. To see your fork of the workflow-{element} in this render, change the
63+
# 03. To see your fork of the workflow-{element} in this render, change the
6564
# URL in ./docs/src/api/make_pages.py#L19 to your fork.
66-
# 05. For redirecting options For redirect options, see 'redirects' below.
67-
# 06. To deploy this site on your fork,
65+
# 04. To deploy this site on your fork,
6866
# A. declare a branch called gh-pages
69-
# B. go to the your fork > settings > pages
67+
# B. go to the your fork > settings > pages
7068
# C. direct pages to render from the gh-pages branch at root
7169
# D. push a tag to your fork with the format test*.*.*
7270
#
@@ -99,9 +97,6 @@ theme:
9997
plugins:
10098
- markdownextradata: {}
10199
- search
102-
# - redirects: # OPTIONAL REDIRECTS
103-
# redirect_maps:
104-
# "index.md": "getting_started.md"
105100
- mkdocstrings:
106101
default_handler: python
107102
handlers:
@@ -112,14 +107,15 @@ plugins:
112107
line_length: 88
113108
- gen-files:
114109
scripts:
115-
- ./src/api/make_pages.py
110+
- ./src/api/make_pages.py
116111
- literate-nav:
117112
nav_file: navigation.md
118113
- exclude-search:
119114
exclude:
120115
- "*/navigation.md"
121116
- mkdocs-jupyter:
122117
ignore_h1_titles: True
118+
- section-index
123119
markdown_extensions:
124120
- attr_list
125121
- toc:
@@ -141,13 +137,12 @@ markdown_extensions:
141137
- pymdownx.inlinehilite
142138
- pymdownx.snippets
143139
- footnotes
144-
140+
- pymdownx.magiclink # Displays bare URLs as links
141+
- pymdownx.tasklist: # Renders check boxes in tasks lists
142+
custom_checkbox: true
145143
extra:
146144
PATCH_VERSION: !ENV PATCH_VERSION
147145
generator: false # Disable watermark
148-
analytics:
149-
provider: google
150-
property: !ENV GOOGLE_ANALYTICS_KEY
151146
version:
152147
provider: mike
153148
social:
@@ -182,4 +177,4 @@ extra_css:
182177
- assets/stylesheets/extra.css
183178

184179
extra_javascript:
185-
- https://js-na1.hs-scripts.com/23133402.js # HubSpot chatbot
180+
- https://js-na1.hs-scripts.com/23133402.js # HubSpot chatbot

docs/src/.overrides/assets/stylesheets/extra.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,22 @@ html a[title="YouTube"].md-social__link svg {
9191
/* previous/next text */
9292
/* --md-footer-fg-color: var(--dj-white); */
9393
}
94+
95+
table {
96+
border-collapse: collapse;
97+
}
98+
99+
tr {
100+
border-left: 1px solid var(--dj-black);
101+
border-right: 1px solid var(--dj-black);
102+
}
103+
104+
td, th {
105+
border-top: 1px solid var(--dj-black);
106+
border-bottom: 1px solid var(--dj-black);
107+
}
108+
109+
[data-md-color-scheme="slate"] td, th {
110+
background-color: var(--dj-white);
111+
color: var(--dj-black);
112+
}

docs/src/citation.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Citation
22

3-
If your work uses this Element, please cite the following manuscript and Research
4-
Resource Identifier (RRID):
3+
If your work uses the following resources, please cite the respective manuscript and/or Research Resource Identifier (RRID):
54

6-
+ Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D,
7-
Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for
8-
Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358
5+
+ DataJoint Element Array Electrophysiology - Version {{ PATCH_VERSION }}
6+
+ Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D,
7+
Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for
8+
Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358
99

10-
+ DataJoint Elements ([RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)) -
11-
Element Array Electrophysiology (version {{ PATCH_VERSION }})
10+
+ [RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)
11+
12+
+ Kilosort
13+
+ [Manuscripts](https://github.com/MouseLand/Kilosort#citation-requirement)
14+
15+
+ NWB
16+
+ [Manuscript](https://www.nwb.org/publications/)
17+
18+
+ DANDI
19+
+ [Citation options](https://www.dandiarchive.org/handbook/10_using_dandi/#citing-dandi)

docs/src/concepts.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ is a table within the Element or a table connected to the Element.
107107

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

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+
110114
### `subject` schema ([API docs](https://datajoint.com/docs/elements/element-animal/api/element_animal/subject))
111115

112116
Although not required, most choose to connect the `Session` table to a `Subject` table.
@@ -156,12 +160,15 @@ Tables for storing probe or unit-level visualization results.
156160
| --- | --- |
157161
| ProbeLevelReport | A table to store drift map figures generated from each recording probe. |
158162
| UnitLevelReport | A table to store figures (waveforms, autocorrelogram, peak waveform + neighbors) generated for each unit. |
163+
| QualityMetricCutoffs | A table to store cut-off values for cluster quality metrics. |
164+
| QualityMetricSet | A manual table to match a set of cluster quality metric values with desired cut-offs. |
165+
| QualityMetricReport | A table to store quality metric figures. |
159166

160167
## Element Development
161168

162169
Through our interviews and direct collaboration on the precursor projects, we identified
163170
the common motifs to create the
164-
[Array ElectrophysiologyElement](https://github.com/datajoint/element-array-ephys).
171+
[Array Electrophysiology Element](https://github.com/datajoint/element-array-ephys).
165172

166173
Major features of the Array Electrophysiology Element include:
167174

element_array_ephys/ephys_acute.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,14 +1353,20 @@ def make(self, key):
13531353
kilosort_dir = find_full_path(get_ephys_root_data_dir(), output_dir)
13541354

13551355
metric_fp = kilosort_dir / "metrics.csv"
1356+
rename_dict = {
1357+
"isi_viol": "isi_violation",
1358+
"num_viol": "number_violation",
1359+
"contam_rate": "contamination_rate",
1360+
}
13561361

13571362
if not metric_fp.exists():
13581363
raise FileNotFoundError(f"QC metrics file not found: {metric_fp}")
13591364

13601365
metrics_df = pd.read_csv(metric_fp)
13611366
metrics_df.set_index("cluster_id", inplace=True)
13621367
metrics_df.replace([np.inf, -np.inf], np.nan, inplace=True)
1363-
1368+
metrics_df.columns = metrics_df.columns.str.lower()
1369+
metrics_df.rename(columns=rename_dict, inplace=True)
13641370
metrics_list = [
13651371
dict(metrics_df.loc[unit_key["unit"]], **unit_key)
13661372
for unit_key in (CuratedClustering.Unit & key).fetch("KEY")

element_array_ephys/ephys_chronic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,14 +1282,20 @@ def make(self, key):
12821282
kilosort_dir = find_full_path(get_ephys_root_data_dir(), output_dir)
12831283

12841284
metric_fp = kilosort_dir / "metrics.csv"
1285+
rename_dict = {
1286+
"isi_viol": "isi_violation",
1287+
"num_viol": "number_violation",
1288+
"contam_rate": "contamination_rate",
1289+
}
12851290

12861291
if not metric_fp.exists():
12871292
raise FileNotFoundError(f"QC metrics file not found: {metric_fp}")
12881293

12891294
metrics_df = pd.read_csv(metric_fp)
12901295
metrics_df.set_index("cluster_id", inplace=True)
12911296
metrics_df.replace([np.inf, -np.inf], np.nan, inplace=True)
1292-
1297+
metrics_df.columns = metrics_df.columns.str.lower()
1298+
metrics_df.rename(columns=rename_dict, inplace=True)
12931299
metrics_list = [
12941300
dict(metrics_df.loc[unit_key["unit"]], **unit_key)
12951301
for unit_key in (CuratedClustering.Unit & key).fetch("KEY")

element_array_ephys/ephys_no_curation.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,9 @@ class Unit(dj.Part):
937937
938938
Attributes:
939939
CuratedClustering (foreign key): CuratedClustering primary key.
940-
unit (foreign key, int): Unique integer identifying a single unit.
941-
probe.ElectrodeConfig.Electrode (dict): probe.ElectrodeConfig.Electrode primary key.
942-
ClusteringQualityLabel (dict): CLusteringQualityLabel primary key.
940+
unit (int): Unique integer identifying a single unit.
941+
probe.ElectrodeConfig.Electrode (foreign key): probe.ElectrodeConfig.Electrode primary key.
942+
ClusteringQualityLabel (foreign key): CLusteringQualityLabel primary key.
943943
spike_count (int): Number of spikes in this recording for this unit.
944944
spike_times (longblob): Spike times of this unit, relative to start time of EphysRecording.
945945
spike_sites (longblob): Array of electrode associated with each spike.
@@ -1293,14 +1293,20 @@ def make(self, key):
12931293
kilosort_dir = find_full_path(get_ephys_root_data_dir(), output_dir)
12941294

12951295
metric_fp = kilosort_dir / "metrics.csv"
1296+
rename_dict = {
1297+
"isi_viol": "isi_violation",
1298+
"num_viol": "number_violation",
1299+
"contam_rate": "contamination_rate",
1300+
}
12961301

12971302
if not metric_fp.exists():
12981303
raise FileNotFoundError(f"QC metrics file not found: {metric_fp}")
12991304

13001305
metrics_df = pd.read_csv(metric_fp)
13011306
metrics_df.set_index("cluster_id", inplace=True)
13021307
metrics_df.replace([np.inf, -np.inf], np.nan, inplace=True)
1303-
1308+
metrics_df.columns = metrics_df.columns.str.lower()
1309+
metrics_df.rename(columns=rename_dict, inplace=True)
13041310
metrics_list = [
13051311
dict(metrics_df.loc[unit_key["unit"]], **unit_key)
13061312
for unit_key in (CuratedClustering.Unit & key).fetch("KEY")

element_array_ephys/ephys_precluster.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ def make(self, key):
616616
][recorded_site]
617617
electrode_keys.append(probe_electrodes[(shank, shank_col, shank_row)])
618618
elif acq_software == "Open Ephys":
619-
620619
session_dir = find_full_path(
621620
get_ephys_root_data_dir(), get_session_directory(key)
622621
)
@@ -1270,13 +1269,20 @@ def make(self, key):
12701269
kilosort_dir = find_full_path(get_ephys_root_data_dir(), output_dir)
12711270

12721271
metric_fp = kilosort_dir / "metrics.csv"
1272+
rename_dict = {
1273+
"isi_viol": "isi_violation",
1274+
"num_viol": "number_violation",
1275+
"contam_rate": "contamination_rate",
1276+
}
12731277

12741278
if not metric_fp.exists():
12751279
raise FileNotFoundError(f"QC metrics file not found: {metric_fp}")
12761280

12771281
metrics_df = pd.read_csv(metric_fp)
12781282
metrics_df.set_index("cluster_id", inplace=True)
1279-
1283+
metrics_df.replace([np.inf, -np.inf], np.nan, inplace=True)
1284+
metrics_df.columns = metrics_df.columns.str.lower()
1285+
metrics_df.rename(columns=rename_dict, inplace=True)
12801286
metrics_list = [
12811287
dict(metrics_df.loc[unit_key["unit"]], **unit_key)
12821288
for unit_key in (CuratedClustering.Unit & key).fetch("KEY")

0 commit comments

Comments
 (0)