Ephys
v0.5.1Read-only analysis of intracortical BCI recordings (NWB, DANDI, WAV): spikes, PSTHs, decoding, plots
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_sources
List the data source types this server can open, with their parameters and status.
open_session
Open a recording session and return its session_id and metadata. `params` overrides the source's default_params (see list_sources).
| Parameter | Type | Description |
|---|---|---|
params | ||
source | string |
close_session
Close a session and drop any decoder fitted on it.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
get_session_info
Metadata for a session: duration, channels, sampling rates, behaviour signals, licence, citation.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
get_signal_quality
Noise level, SNR and dead/noisy channels from a broadband snippet (max 10 s).
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
duration_s | number | |
t0 | number |
detect_spikes
Threshold-crossing spike detection on a broadband snippet (max 10 s). Where the session has ground-truth spikes, precision and recall are reported.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
duration_s | number | |
t0 | number | |
threshold_sigma | number |
set_probe_geometry
Tell the server where the recording's contacts are, for sessions whose file does not say. Named layouts: 'utah' (square grid, e.g. 96 contacts at 400 um), 'grid' with n_columns, 'linear' (one column at pitch_um, e.g. a laminar probe), 'tetrode_linear' (groups of four). 'explicit' takes positions_um as [[x, y], ...] in channel order. Geometry is used by sort_spikes and plot_probe. Contacts under 100 um apart are sorted jointly.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
layout | string | |
n_columns | integer | |
pitch_um | number | |
positions_um |
get_probe
Contact geometry and brain-area labels per channel, where known. Use the `channel` indices with the `units` argument of get_psth / fit_latent_factors to analyse one area.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
max_rows | integer |
plot_probe
Figure: the array map, each contact coloured by its firing rate over a window, with area labels and sorted units marked when a sort has been run. Needs geometry from the file or set_probe_geometry.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
duration_s | number | |
t0 | number |
sort_spikes
Spike-sort a broadband window (needs the sort extra). Afterwards the session's spike times are the sorted units, restricted to that window, so rates, PSTHs, rasters and decoders use them. Uses the session's probe geometry (from the file or set_probe_geometry) so nearby contacts are sorted jointly; without geometry each channel is treated as an independent electrode. Sorting takes seconds to a few minutes depending on duration and channel count.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
channels | ||
duration_s | number | |
sorter | string | |
t0 | number |
get_firing_rates
Population firing-rate summary over a time range (defaults to the whole session).
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
t0 | number | |
t1 |
fit_decoder
Fit a decoder from spike counts to a behaviour signal and score it on held-out data. The first `train_fraction` of the session trains; the remainder tests. With no `target`, the first velocity-like behaviour signal is used. Unrecorded gaps are skipped. `mask` names a boolean behaviour signal (such as FALCON's eval_mask); only bins where it is true are used for fitting and scoring.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
bin_s | number | |
kind | string | |
mask | ||
target | ||
train_fraction | number |
evaluate_cross_session
Fit a decoder on one session and score it, unchanged, on other sessions: the question benchmarks such as FALCON ask (does a decoder survive to a later day?). All sessions must be open and share the same units/channels. `mask` names a boolean behaviour signal restricting which bins are scored (FALCON files carry `eval_mask`; pass null when the sessions have none). Also reports same-session held-out R² for comparison.
| Parameter | Type | Description |
|---|---|---|
test_session_ids * | array | |
train_session_id * | string | |
bin_s | number | |
kind | string | |
mask | ||
target |
decode_window
Decode a window with the fitted decoder; returns a downsampled decoded-vs-true preview.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
t0 * | number | |
duration_s | number | |
max_points | integer |
get_psth
Peri-stimulus time histogram: firing aligned to a trial event and averaged over trials. `event` is one of the session's event_columns (default: movement onset if present). `group_by` splits trials by one of its group_columns, e.g. reach direction. `units` restricts the analysis to some units; tuning that cancels in the population average (such as direction preference) only shows up per unit. Unit numbers in the result index into `units` when it is given. Returns the population time course, its peak, and the units that change most.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
bin_s | number | |
event | ||
group_by | ||
t_after | number | |
t_before | number | |
units |
fit_latent_factors
Fit low-dimensional latent factors to trial-aligned population activity. GPFA (Yu et al. 2009) gives denoised single-trial trajectories and a timescale per factor; PCA is the fast, noisier baseline. Look for an elbow in variance_explained_per_factor to judge dimensionality. If the session has a velocity-like signal, reports how well the top factors explain it. Then plot_latent_factors draws the trajectories.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
bin_s | number | |
event | ||
group_by | ||
method | string | |
n_factors | integer | |
t_after | number | |
t_before | number | |
units |
plot_latent_factors
Figure: the top three latent factors over time (single trials thin, group means bold), the trajectory in the plane of the first two factors, and variance explained per factor. Requires fit_latent_factors first.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
max_trials_drawn | integer |
plot_psth
Figure: population PSTH per group (mean ± SEM over trials) above a unit-by-time heatmap of change from baseline. Same arguments as get_psth. Returns the PNG path and the image.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
bin_s | number | |
event | ||
group_by | ||
t_after | number | |
t_before | number | |
units |
plot_raster
Figure: spike raster for a time window (max 60 s), with unrecorded spans shaded.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
duration_s | number | |
max_units | integer | |
t0 | number |
plot_decoding
Figure: decoded against actual behaviour for a window (max 60 s), one panel per dimension. Requires fit_decoder first. Pick a window in the test split for an honest picture.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
t0 * | number | |
duration_s | number |
list_lsl_streams
Lab Streaming Layer streams visible on the local network (needs the lsl extra).
| Parameter | Type | Description |
|---|---|---|
wait_s | number |
get_stream_status
For a live session: how much signal is buffered, whether data is still arriving, and drops.
| Parameter | Type | Description |
|---|---|---|
session_id * | string |
search_datasets
Search the DANDI Archive for datasets. An empty query returns a short curated list of intracortical datasets that work well with this server.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
query | string |
list_dataset_files
Licence, citation and NWB files of a DANDI dataset. Pass a file's path to open_session(source='dandi').
| Parameter | Type | Description |
|---|---|---|
dandiset_id * | string | |
limit | integer | |
version | string |