phy parity
Sorrel aims to do everything phy’s TemplateGUI does. The target is cortex-lab/phy master (v2.1, 2026). This page lists every phy view, action and shortcut against its Sorrel equivalent. Each row has one of these statuses:
- done — available now. The test column names the check that covers it.
- planned — not built yet.
- excluded — deliberately left out; the row says why.
Views
| phy view | Sorrel | Status | Test |
|---|---|---|---|
| FeatureView | Features: phy’s 4×4 grid (best channels 0/1 × PC A/B, time on the diagonal), 2500 grey background spikes, 2500 shown per cluster | done | feature_view::tests, ui_states::features_grid_lasso_split |
FeatureView without pc_features.npy | phy hides the view. Sorrel fits two temporal PCs on raw peak-channel snippets and projects the shown spikes, then every lassoed spike before a split | done | ui_states::features_computed_pcs, linalg::tests::top_eigenvectors_recover_known_basis |
| TemplateFeatureView | Tmpl features: with two clusters selected, each spike projected on both clusters’ templates (template_features.npy / template_feature_ind.npy), grey background, Ctrl+click lasso and k | done | ui_states::template_features_two_clusters |
| WaveformView | Waveforms | planned | |
| AmplitudeView | Amplitudes: template, feature (the FeatureView’s Alt+clicked dimension) and raw types (a / Shift+a), grey background spikes on the peak channel, a per-cluster histogram, the polygon lasso, the v2.1 Alt+right-drag threshold split (orange preview), Alt+click to seek. The template-feature type comes with TemplateFeatureView. | done | amplitude_view::tests, ui_states::amplitudes_threshold_split |
| CorrelogramView | CCG | planned | |
| ISIView | ISI | planned | |
| FiringRateView | Rate: phy’s bin count (default 200, :frn, header field) and the v2.1 time unit (s, min, h) | done | |
| TraceView | Trace; shortcuts in the trace table below | done | app::tests::alt_pgdn_centres_the_trace_on_the_selections_next_spike |
| TraceImageView | Trace image (tab beside Trace): the trace window as a channels × pixels image of the signed voltage, following the Trace window, HP/CMR and origin | done | trace_image::tests, ui_states::spike_data_and_trace_image |
| ProbeView | Probe | done | |
| RasterView | Raster: click seeks the trace, Ctrl+click selects the row’s cluster, Shift+click adds or removes it | done | |
| TemplateView | Templates: every cluster’s template on its peak channel in table order, selection outlined; click selects, Ctrl/Shift+click adds | done | |
| ClusterScatterView | Scatter: one point per cluster; x / y / size from amp, depth, fr, n_spikes, ch (defaults amp × depth, size log fr) with log toggles; click selects, Shift+click adds, Ctrl+click lasso selects every cluster inside; :csx / :csy / :css. Shift+wheel cycles the colour scheme. Drag pans, the wheel zooms, double-click resets. | done | ui_states::cluster_scatter_dense, cluster_scatter::tests |
| Spike*View | Spike data: every spike_<name>.npy (phylib spike attributes), 1-D against time or 2-D as x vs y, grey background, Ctrl+click lasso and k | done | phy_parity::phy_spike_attributes_and_reorder, ui_states::spike_data_and_trace_image |
| ClusterView | Cluster table | planned | |
| SimilarityView | Similar; cluster similarity is phy’s max over both clusters’ templates | planned | phy_parity::phy_cluster_similarity_is_max_over_templates |
| HistogramView | Plugin base class; the built-in histograms are ISI and Rate | excluded: plugin API | |
| IPythonView | Scripting goes through sorrel-py and the sorrel mcp JSON-RPC API instead of an in-window console | excluded |
FeatureView behaviour
| phy | Sorrel | Status | Test |
|---|---|---|---|
Features read by real channel through pc_feature_ind[spike_template] | Session::pc_feature | done | phy_parity::phy_feature_view_channels_and_lookup |
| A selected spike whose template lacks the channel is drawn at 0 | same | done | |
| Channels: first cluster’s best, those shared by every selected cluster first | Session::best_channels | done | phy_parity::phy_feature_view_channels_and_lookup |
c toggles automatic channel selection | c, or the fixed checkbox in the header | done | |
| Ctrl+click (left/right) on a Waveforms channel sets channel 0/1 | FeatureViewState::edit_channels(SetA/SetB), called from the Ctrl+click on a Waveforms channel | done | |
ISI violators brush, split what-if and merge ghosts (Sorrel extra): clicking the ISI refractory band brushes both spikes of every pair under 1 ms; a lasso / k-means brush on one selected cluster previews its split (preview_split: ISI dashed inside / dotted outside, Quality “if split” delta rows, Waveforms dashed / dotted means); a hovered merge candidate adds a grey dashed mean in Waveforms and a ghost row and column in CCG | — | done | isi_view::tests::violators_include_both_members_once, isi_view::tests::split_target_needs_a_part_brush_and_a_remainder, preview::tests::preview_split_matches_an_applied_split, ui_states::xtalk_isi_whatif, ui_states::xtalk_isi_tooltip |
Polygon lasso: Ctrl+click adds points, Ctrl+right-click clears, k splits | same; Esc also clears. Sorrel extras: Ctrl+drag draws a freehand lasso (Ramer-Douglas-Peucker, at most 64 nodes), and on a closed lasso a node drags, a double-click on an edge inserts a node, a right-click on a node deletes it (min 3); hovering shows the node or a ghost “+” | done | lasso::tests, ui_states::features_lasso_freehand_and_edit |
k-means auto-lasso (Sorrel extra): the k-means button (or :km [k|auto]) clusters the first selected cluster in its 4 PC columns (rayon, off the UI thread; k: auto picks 2–5 by silhouette), wraps the lasso around the smallest part in the cell that separates it best, highlights the exact members, and shows a chip per part; auto-run refits whenever the features change unless you drew your own lasso. A live “N spikes · M nodes · K splits” badge sits under every closed lasso. | — | done | feature_view::tests::kmeans_auto_lasso_wraps_the_small_blob, ui_states::features_lasso_drawing_and_kmeans, kmeans::tests::parallel_runs_are_identical_on_large_inputs |
| k-means collision evidence (Sorrel extra): every projection counts the other parts’ and selected clusters’ spikes inside the previewed part’s hull (green 0, amber ≤ 15%, red above); the part’s hull is dashed in the other projections. Evidence is shown on the real plots, not a replacement projection navigator. | — | done | feature_view::tests::cell_hits_count_other_parts_and_clusters_inside_each_hull, feature_view::tests::collision_colours_follow_the_15_percent_rule, ui_states::features_kmeans_collision |
| Full Phy-style Features matrix: all 16 projections for A/B in a fixed 4×4 arrangement, fitted to the available width and height at narrow, default, wide and maximized sizes. No navigator or single-cell layout. 3D remains an explicit inspection mode. | — | done | ui_states::tetrode_feature_grid_is_complete_at_narrow_default_wide_and_maximized_sizes, ui_states::features_compact, ui_states::pane_maximized, ui_states::pane_popout |
Channel set (Sorrel extra): Features works on a set of up to 8 channels (default the selection’s best four; feature_view::MAX_SET), edited by Shift+click in Waveforms or the toolbar chips; A/B are the set’s first two and follow the best-separating channel pair unless fixed with c | FeatureViewState::edit_channels | done | feature_view::tests::edit_channels_keeps_two_to_max_and_swaps_like_phy, feature_view::tests::separation_ranks_the_separating_pair_first |
| Probe channel picker (Sorrel extra): set rings, A/B badges and highlight rings on the probe; Shift+click toggles a site in the Features set, Ctrl+click / Ctrl+right-click set A / B | — | done | views::probe_tests, ui_states::xtalk_probe_set |
Merge / history ghosts (Sorrel extra): hovering a Similar or Suggest merge row writes a merge ghost and shows the preview_merge delta; hovering a History row writes a history ghost | — | done | similarity_view::tests, ui_states::xtalk_features_ghost, ui_states::xtalk_history_ghost |
| Alternatives strip (Sorrel extra): the six best-separating pairs over the set’s dims as mini scatters; a click promotes one to A/B and focuses its grid cell, armed first when a lasso would be dropped | feature_view::alternatives | done | feature_view::tests::promotion_maps_every_pair_to_a_grid_cell, ui_states::features_alternatives |
Features 3D (Sorrel extra): the 3D toggle shows the points in any three dimensions of the channel set (time and PC1/PC2 per channel) behind an orbit camera, every triple ranked by silhouette (clusters, else k-means parts, else variance; top 20 and “show all”), the focused 2D plot’s pair pinned by default (chip, third-axis list), the chosen triple’s channels highlighted in Waveforms; convex hulls per cluster (filled for Auto, wireframe for Sorrel-made), a dashed parent hull for split children, the lasso extruded as a prism and the k-means part’s hull. Inspection only. | — | done | feature_view3d::tests::every_triple_of_the_set_is_scored_best_first, feature_view3d::tests::pinning_keeps_the_triples_holding_the_pair_and_ranks_the_third_axis, feature_view3d::tests::the_chosen_triple_survives_a_rerank_and_falls_back_when_its_dims_vanish, feature_view3d::tests::triple_channels_dedupe_and_leave_out_time, feature_view3d::tests::prism_needs_both_lasso_dims_in_the_triple, convex_hull_3d tests, ui_states::features_3d, ui_states::features_3d_kmeans_prism, ui_states::features_3d_pinned, ui_states::features_3d_maximized, wgpu_scene3d GPU tests |
| Features 2D cross-talk (Sorrel extra): a closed lasso or previewed k-means part writes the spike brush (only when it changes; clearing the lasso clears the brush only if Features wrote it); brushed spikes drawn in ink in every cell and mini; the 6 px hover pick writes the shared hover and every cell rings the hovered spike; Alt+click on a spike seeks the Trace (Alt+click elsewhere still picks the amplitude feature); spikes in the Trace window ringed (≤ 200 per cluster); Shift+drag a time cell sets the time brush (band on the axis, outside spikes fade to 0.2 alpha); ⚙ “colour by cluster / time / depth” with a ramp legend; Similar merge ghost as grey points “cN (ghost)” | — | done | feature_view::tests::brush_is_written_only_when_its_key_changes, feature_view::tests::nearest_spike_picks_the_closest_within_reach, feature_view::tests::time_brush_fades_or_hides_spikes_outside, feature_view::tests::colour_ramp_runs_viridis_end_to_end, feature_view::tests::trace_window_is_a_range_of_local_indices, ui_states::xtalk_features_brush, ui_states::xtalk_hover_spike, ui_states::xtalk_amplitudes_ink |
Features 3D cross-talk (Sorrel extra): brushed spikes in ink, the time brush fading or hiding spikes, hover ring and pointer pick (6 px), Similar ghost hull, History “before #n” hulls (Session::pre_edit_spikes), point colour by time or depth, and a depth space axis ranked with the PCs. | — | done | feature_view3d::tests::space_dims_join_the_triples_and_rank_by_separation, feature_view3d::tests::brushes_ink_fade_and_hide_spikes_in_the_scene, feature_view3d::tests::a_new_brush_or_time_range_changes_the_scene_key, feature_view3d::tests::the_nearest_candidate_within_reach_is_picked, session::tests::pre_edit_spikes_match_the_memberships_before_each_edit, ui_states::xtalk_3d_space, ui_states::xtalk_history_ghost |
| Time-axis cross-talk (Sorrel extra): the Amplitudes lasso or threshold, the Spike data lasso and the Tmpl features lasso are the app-wide spike brush (ink points in Amplitudes, Spike data, Tmpl features, Drift, ink ticks in Raster and Trace); hovering a spike in Amplitudes or Spike data rings it and draws its time as an accent line in Raster, Rate, Drift, Amplitudes and Trace; a plain click on a Trace tick picks that spike (sticky hover for Features); Shift+drag along Amplitudes, Rate, Drift or Raster sets the time range (band, outside points fade) | — | done | widgets::brush_tests, ui_states::xtalk_time_brush |
| Split loads every spike of the lassoed clusters | same, for computed PCs too | done | ui_states::features_computed_pcs |
| Feature scaling (Ctrl+wheel), marker size (Alt+wheel), pan/zoom, reset | same; double-click resets | done | |
| Alt+click a subplot sets the AmplitudeView feature dimension (left = x, right = y) | same | done | |
Custom grids (set_grid_dim) | — | excluded: plugin API |
Every view
| phy | Sorrel | Status | Test |
|---|---|---|---|
toggle_auto_update (freeze a view) | tab right-click → Freeze on this selection (🔒 in the title) | done | |
screenshot | tab right-click → Save screenshot, a PNG in <dataset>/.sorrel/screenshots/ (phy: ~/.phy/screenshots) | done | |
| pan / zoom / reset | drag, wheel, double-click on Features, Amplitudes, Scatter, Tmpl features and Spike data | done | panzoom::tests |
| pan / zoom on Raster, Rate, Templates | Raster: drag, wheel, double-click (time and rows). Rate: the same in time, re-binned over the visible span. Templates: the wheel scrolls, Ctrl+wheel or pinch zooms the boxes, double-click resets | done | ui_states::raster_and_rate_zoomed |
Supervisor actions
| phy action | Key (phy and Sorrel) | Status | Test |
|---|---|---|---|
| merge | g | done | intent::tests::phy_supervisor_keys |
| split | k | done | ui_states::features_grid_lasso_split |
label (custom label column, saved as cluster_<name>.tsv) | l, :l name value | done | save::tests::custom_labels_write_phy_tsvs_and_undo |
| move best / similar / all to good, mua, noise, unsorted | Alt / Ctrl / Ctrl+Alt + g m n u | done | intent::tests::phy_supervisor_keys |
advance after a move (_after_move) | — | done | |
| next / previous similar | Space / Shift+Space | done | selection::tests::similar_part_steps_and_resets_like_phy_wizard |
| skip noise and MUA while stepping (v2.1, default on) | always on | done | |
| next / previous best, first / last | ↓ / ↑, Home / End | done | |
| select first similar | Ctrl+Space (first 15) | done | |
| unselect similar | Backspace | done | |
| reset wizard | Ctrl+Alt+Space | done | |
| undo / redo (sorrel keeps undone edits as branches; see the History pane) | Ctrl+Z / Ctrl+Shift+Z, Ctrl+Y | done | session::tests::edit_after_undo_branches_and_checkout_crosses_branches |
save (also writes cluster_info.tsv) | Ctrl+S | done | save::tests::custom_labels_write_phy_tsvs_and_undo |
| split_init (split by original template) | Shift+Ctrl+K | done | phy_parity::phy_split_init_restores_one_cluster_per_template |
toggle_spike_reorder (spike_reorder.npy on the Feature, Amplitude and Spike-data time axes) | Ctrl+R | done | phy_parity::phy_spike_attributes_and_reorder |
| colour fields (none, cluster, group, depth, fr) for unselected clusters in Raster, Scatter and Templates | :cf name, Shift+wheel | done | theme::tests::colour_schemes_match_phy_fields |
| colormaps | :cm | excluded: one sequential map (viridis); diverging and rainbow on request | |
merge mode (v2.1): stage the selection, add similar candidates, G merges, V cancels and restores; labels blocked while active. Dragging rows between views and undo restoring the workspace are not built. | v | done | app::tests::merge_mode_stages_candidates_and_cancel_restores |
merge propositions (v2.1, curation.json merges) | the Proposals pane (Enter accepts, Delete rejects) | in progress (sorrel-f6 lane) | |
| cluster table filter / sort | :f expr, :s col | done | |
| help, quit | h (also ?, F1), Ctrl+Q | done |
Snippets
| phy snippet | Status | Test |
|---|---|---|
:g, :k, :c 1 2 3 (ranges 3-7) | done | snippets::tests::parses_phy_snippets |
:l name value (group moves the selection) | done | snippets::tests::parses_phy_snippets |
:tg time, :ts window | done | snippets::tests::parses_phy_snippets |
:csx, :csy, :css (ClusterScatter axes) | done | snippets::tests::parses_phy_snippets |
:f expr, :s col | done | |
:frn n, :cf field | done | snippets::tests::parses_phy_snippets |
:wn, :cb, :cw, :cr, :isi… | Waveforms / CCG / ISI lane (sorrel-f6) | |
:frb seconds (bin size) | done | snippets::tests::parses_phy_snippets |
:frmin, :frmax (x range, seconds; no value resets) | done | snippets::tests::parses_phy_snippets, prefs::tests::rate_x_range_clamps_and_falls_back_to_the_recording |
Trace shortcuts
| phy | Sorrel | Status |
|---|---|---|
Alt+← / Alt+→ previous / next window | same | done |
Alt+Home / Alt+End | same | done |
Alt++ / Alt+- narrow / widen | same | done |
Alt+PgDn / Alt+PgUp next / previous spike of the selection, Alt+T go to | same (Alt+T opens :tg) | done |
Alt+O origin, Alt+S every cluster’s spikes, Alt+L labels, Ctrl+Alt+↑/↓ gain | same | done |
| Ctrl+click a spike selects its cluster | nearest spike within 1 ms (phy also weighs the clicked channel) | done |
Command line
| phy | Sorrel | Status |
|---|---|---|
phy template-gui params.py | sorrel open <DATA_DIR> (Phy, SortingAnalyzer, NWB, MATLAB rez.mat) | done |
phy template-describe params.py | sorrel describe <DATA_DIR> | done |
--clear-cache | sorrel clear-cache | done |
kwik-gui, trace-gui, alf-convert | — | excluded: not template-gui |
Differences that stay
- SortingAnalyzer PCs. SpikeInterface’s
principal_componentsextension only holds therandom_spikessubset (at most 500 spikes per unit; on one real 0.105 analyzer, 32 425 of 210 884 spikes). A lasso split on it would leave every other spike behind. Sorrel therefore computes its own PCs for SortingAnalyzer folders, which covers every spike. - Missing PCs. phy shows no FeatureView without
pc_features.npy; Sorrel computes PCs instead. - Custom labels in
curation.json. These are written asname=valuetags, not as SpikeInterface label keys. - Plugins and the IPython console. Both are excluded. Scripting goes
through
sorrel-pyandsorrel mcp.