|
1 | 1 | # DataJoint Element - Array Electrophysiology Element
|
2 |
| -DataJoint Element for array electrophysiology. |
3 | 2 |
|
4 |
| -This repository features DataJoint pipeline design for extracellular array electrophysiology, |
5 |
| -with ***Neuropixels*** probe and ***kilosort*** spike sorting method. |
| 3 | ++ This repository features DataJoint pipeline design for extracellular array electrophysiology, |
| 4 | +with Neuropixels probe and Kilosort spike sorting method. |
6 | 5 |
|
7 |
| -The pipeline presented here is not a complete pipeline by itself, but rather a modular |
| 6 | ++ The pipeline presented here is not a complete pipeline by itself, but rather a modular |
8 | 7 | design of tables and dependencies specific to the extracellular electrophysiology workflow.
|
9 | 8 |
|
10 |
| -This modular pipeline element can be flexibly attached downstream |
| 9 | ++ This modular pipeline element can be flexibly attached downstream |
11 | 10 | to any particular design of experiment session, thus assembling a fully functional
|
12 | 11 | ephys pipeline.
|
13 | 12 |
|
14 |
| -See [Background](Background.md) for the background information and development timeline. |
| 13 | ++ See the [Element Array Electrophysiology documentation](https://elements.datajoint.org/description/array_ephys/) for the background information and development timeline. |
15 | 14 |
|
16 |
| -## The Pipeline Architecture |
| 15 | ++ For more information on the DataJoint Elements project, please visit https://elements.datajoint.org. This work is supported by the National Institutes of Health. |
17 | 16 |
|
18 |
| - |
| 17 | +## Element architecture |
19 | 18 |
|
20 |
| -As the diagram depicts, the array ephys element starts immediately downstream from ***Session***, |
21 |
| -and also requires some notion of ***Location*** as a dependency for ***InsertionLocation***. |
| 19 | +`element-array-ephys` is comprised of two schemas, `probe` and `ephys`. To handle |
| 20 | +several use cases of this pipeline, we have designed several `ephys` schemas, including |
| 21 | +`ephys_acute`, `ephys_chronic`, and `ephys_precluster`. |
22 | 22 |
|
23 |
| -### The design of probe |
| 23 | ++ `ephys_acute` - A probe(s) is inserted into a new location during each session. |
24 | 24 |
|
25 |
| -+ ***ProbeType*** - a lookup table specifying the type of Neuropixels probe (e.g. "neuropixels 1.0", "neuropixels 2.0 single-shank") |
26 |
| -+ ***ProbeType.Electrode*** - all electrode and their properties for a particular probe type |
| 25 | ++ `ephys_chronic` - A probe(s) is inserted once and used to record across multiple |
| 26 | +sessions. |
| 27 | + |
| 28 | ++ `ephys_precluster` - A probe(s) is inserted into a new location during each session. |
| 29 | +And pre-clustering steps (e.g. CatGT) are performed on the data from each probe prior |
| 30 | +to Kilosort analysis. |
| 31 | + |
| 32 | +### `ephys_acute` module |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +### `ephys_chronic` module |
| 37 | + |
| 38 | + |
| 39 | +### `ephys_precluster` module |
| 40 | + |
| 42 | + |
| 43 | + |
| 44 | +As the diagram depicts, the array ephys element starts immediately downstream from `Session`, |
| 45 | +and also requires some notion of `Location` as a dependency for `InsertionLocation`. We |
| 46 | +provide an [example workflow](https://github.com/datajoint/workflow-array-ephys/) with a |
| 47 | +[pipeline script](https://github.com/datajoint/workflow-array-ephys/blob/main/workflow_array_ephys/pipeline.py) |
| 48 | +that models (a) combining this Element with the corresponding [Element-Session](https://github.com/datajoint/element-session) |
| 49 | +, and (b) declaring a `SkullReference` table to provide Location. |
| 50 | + |
| 51 | +## Table descriptions |
| 52 | + |
| 53 | +### Probe & electrodes |
| 54 | + |
| 55 | +The `probe` schema contains information regarding the Neuropixels probe and electrode configuration. |
| 56 | + |
| 57 | +<details> |
| 58 | +<summary>Click to expand details</summary> |
| 59 | + |
| 60 | ++ `ProbeType` - a lookup table specifying the type of Neuropixels probe (e.g. "neuropixels 1.0", "neuropixels 2.0 single-shank") |
| 61 | + |
| 62 | ++ `ProbeType.Electrode` - all electrode and their properties for a particular probe type |
27 | 63 | + An electrode here refers to one recordable electrode site on the Neuropixels probe (e.g. for Neuropixels 1.0, there are 960 sites per shank)
|
28 |
| -+ ***Probe*** - record of an actual physical probe, identifiable by some unique ID (e.g. probe's serial number) |
29 |
| -+ ***ElectrodeConfig*** - particular electrode configuration to be used for ephys recording |
30 |
| -+ ***ElectrodeConfig.Electrode*** - corresponding electrodes in ***ProbeType.Electrode*** that are used for recording in this electrode configuration (e.g. for Neuropixels 1.0 or 2.0, there can be at most 384 electrodes usable for recording per probe) |
31 | 64 |
|
32 |
| -### Extracellular ephys recording |
| 65 | ++ `Probe` - record of an actual physical probe, identifiable by some unique ID (e.g. probe's serial number) |
| 66 | + |
| 67 | ++ `ElectrodeConfig` - particular electrode configuration to be used for ephys recording |
| 68 | + |
| 69 | ++ `ElectrodeConfig.Electrode` - corresponding electrodes in `ProbeType.Electrode` that are used for recording in this electrode configuration (e.g. for Neuropixels 1.0 or 2.0, there can be at most 384 electrodes usable for recording per probe) |
| 70 | + |
| 71 | +</details> |
| 72 | + |
| 73 | +### Extracellular electrophysiology recording |
| 74 | + |
| 75 | +The `ephys` schema stores information regarding the recording from a probe for a given session. |
| 76 | + |
| 77 | +<details> |
| 78 | +<summary>Click to expand details</summary> |
| 79 | + |
| 80 | ++ `ProbeInsertion` - a surgical insertion of a probe in the brain. Every experimental session consists of one or more entries in `ProbeInsertion` with a corresponding `InsertionLocation` each |
| 81 | + |
| 82 | ++ `EphysRecording` - each `ProbeInsertion` is accompanied by a corresponding `EphysRecording`, specifying the `ElectrodeConfig` used for the recording from the `Probe` defined in such `ProbeInsertion` |
| 83 | + |
| 84 | +</details> |
33 | 85 |
|
34 |
| -+ ***ProbeInsertion*** - a surgical insertion of a probe in the brain. Every experimental session consists of one or more entries in ***ProbeInsertion*** with a corresponding ***InsertionLocation*** each |
35 |
| -+ ***EphysRecording*** - each ***ProbeInsertion*** is accompanied by a corresponding ***EphysRecording***, specifying the ***ElectrodeConfig*** used for the recording from the ***Probe*** defined in such ***ProbeInsertion*** |
36 |
| - |
37 | 86 | ### Clusters and spikes
|
38 | 87 |
|
39 |
| -This ephys element features automatic ingestion for spike sorting results from the ***kilosort*** method. |
| 88 | +The `ephys` schema features automatic ingestion of spike sorting results from the `Kilosort` analysis method. |
| 89 | + |
| 90 | +<details> |
| 91 | +<summary>Click to expand details</summary> |
| 92 | + |
| 93 | ++ `Clustering` - specify instance(s) of clustering on an `EphysRecording`, by some `ClusteringMethod` |
40 | 94 |
|
41 |
| -+ ***Clustering*** - specify instance(s) of clustering on an ***EphysRecording***, by some ***ClusteringMethod*** |
42 |
| -+ ***Curation*** - specify instance(s) of curations performed on the output of a given ***Clustering*** |
43 |
| -+ ***CuratedClustering*** - set of results from a particular round of clustering/curation |
44 |
| - + ***CuratedClustering.Unit*** - Identified unit(s) from one ***Curation***, and the associated properties (e.g. cluster quality, spike times, spike depths, etc.) |
45 |
| - + ***WaveformSet*** - A set of spike waveforms for units from a given CuratedClustering |
| 95 | ++ `Curation` - specify instance(s) of curations performed on the output of a given `Clustering` |
| 96 | + |
| 97 | ++ `CuratedClustering` - set of results from a particular round of clustering/curation |
| 98 | + + `CuratedClustering.Unit` - Identified unit(s) from one `Curation`, and the associated properties (e.g. cluster quality, spike times, spike depths, etc.) |
| 99 | + + `WaveformSet` - A set of spike waveforms for units from a given CuratedClustering |
| 100 | + |
| 101 | +</details> |
46 | 102 |
|
47 | 103 | ## Installation
|
48 |
| -``` |
49 |
| -pip install element-array-ephys |
50 |
| -``` |
| 104 | +<details> |
| 105 | +<summary>Click to expand details</summary> |
| 106 | + |
| 107 | ++ Install `element-array-ephys` |
| 108 | + ``` |
| 109 | + pip install element-array-ephys |
| 110 | + ``` |
| 111 | +
|
| 112 | ++ Upgrade `element-array-ephys` previously installed with `pip` |
| 113 | + ``` |
| 114 | + pip install --upgrade element-array-ephys |
| 115 | + ``` |
| 116 | +
|
| 117 | ++ Install `element-interface` |
| 118 | + + `element-interface` is a dependency of `element-array-ephys`, however it is not contained within `requirements.txt`. |
| 119 | + ``` |
| 120 | + pip install "element-interface @ git+https://github.com/datajoint/element-interface" |
| 121 | + ``` |
51 | 122 |
|
52 |
| -If you already have an older version of ***element-array-ephys*** installed using `pip`, upgrade with |
53 |
| -``` |
54 |
| -pip install --upgrade element-array-ephys |
55 |
| -``` |
| 123 | +</details> |
56 | 124 |
|
57 | 125 | ## Usage
|
58 | 126 |
|
59 | 127 | ### Element activation
|
60 | 128 |
|
| 129 | +When using this Element, one needs to run `ephys.activate` to declare the schemas and tables on the database. |
| 130 | +
|
| 131 | +<details> |
| 132 | +<summary>Click to expand details</summary> |
| 133 | +
|
61 | 134 | To activate the `element-array-ephys`, ones need to provide:
|
62 | 135 |
|
63 | 136 | 1. Schema names
|
64 | 137 | + schema name for the probe module
|
65 | 138 | + schema name for the ephys module
|
66 | 139 |
|
67 | 140 | 2. Upstream tables
|
68 |
| - + Session table |
69 |
| - + SkullReference table (Reference table for InsertionLocation, specifying the skull reference) |
| 141 | + + Session table: A set of keys identifying a recording session (see [Element-Session](https://github.com/datajoint/element-session)). |
| 142 | + + SkullReference table: A reference table for InsertionLocation, specifying the skull reference (see [example pipeline](https://github.com/datajoint/workflow-array-ephys/blob/main/workflow_array_ephys/pipeline.py)). |
70 | 143 |
|
71 |
| -3. Utility functions |
72 |
| - + get_ephys_root_data_dir() |
73 |
| - + get_session_directory() |
| 144 | +3. Utility functions. See [example definitions here](https://github.com/datajoint/workflow-array-ephys/blob/main/workflow_array_ephys/paths.py) |
| 145 | + + get_ephys_root_data_dir(): Returns your root data directory. |
| 146 | + + get_session_directory(): Returns the path of the session data relative to the root. |
74 | 147 |
|
75 | 148 | For more detail, check the docstring of the `element-array-ephys`:
|
76 | 149 |
|
77 | 150 | help(probe.activate)
|
78 | 151 | help(ephys.activate)
|
79 | 152 |
|
| 153 | +</details> |
| 154 | +
|
80 | 155 | ### Example usage
|
81 | 156 |
|
82 | 157 | See [this project](https://github.com/datajoint/workflow-array-ephys) for an example usage of this Array Electrophysiology Element.
|
| 158 | +
|
| 159 | +## Citation |
| 160 | +
|
| 161 | ++ If your work uses DataJoint and DataJoint Elements, please cite the respective Research Resource Identifiers (RRIDs) and manuscripts. |
| 162 | +
|
| 163 | ++ DataJoint for Python or MATLAB |
| 164 | + + Yatsenko D, Reimer J, Ecker AS, Walker EY, Sinz F, Berens P, Hoenselaar A, Cotton RJ, Siapas AS, Tolias AS. DataJoint: managing big scientific data using MATLAB or Python. bioRxiv. 2015 Jan 1:031658. doi: https://doi.org/10.1101/031658 |
| 165 | +
|
| 166 | + + DataJoint ([RRID:SCR_014543](https://scicrunch.org/resolver/SCR_014543)) - DataJoint for `<Select Python or MATLAB>` (version `<Enter version number>`) |
| 167 | +
|
| 168 | ++ DataJoint Elements |
| 169 | + + Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D, Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358 |
| 170 | +
|
| 171 | + + DataJoint Elements ([RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)) - Element Array Electrophysiology (version `<Enter version number>`) |
0 commit comments