arista.viz.nompc_dosage
Phase 7d headline figure — |gain| (or signed gain) vs NompC dosage.
For every thermal_step protocol we already have per-recording gains
(arista.processing.gain.compute_recording_gain). This module pools
gains across protocols, canonicalises strain names through
arista.constants.STRAIN_SYNONYMS, looks up the functional
NompC dosage per strain via arista.constants.NOMPC_DOSAGE,
and draws one raincloud per strain at its dosage x-position. One
panel per cell type.
Strains sharing the same dosage tier (CantonS / white / 641 at 2.0,
NompCRescue / UASnompC… also at 2.0 — though the latter alias is
canonicalised to NompCRescue before plotting) get small symmetric
x-offsets so their rainclouds don’t overlap; their colours come from
arista.constants.STRAIN_COLOURS so the legend disambiguates.
Recordings whose strain is not in NOMPC_DOSAGE are dropped with a
console-visible message; the dosage figure is by definition only
meaningful for strains with a defined functional level.
Module Attributes
Default stimulus protocols pooled together for the headline figure. |
Functions
|
Per-recording gains pooled across stimuli, canonicalised + dosage-tagged. |
|
One panel per cell type, raincloud per strain at its NompC dosage. |
Classes
|
Callable wrapper for batch reuse. |
- arista.viz.nompc_dosage.DEFAULT_DOSAGE_STIMULI: tuple[str, ...] = ('ascAmp', 'descAmp', 'ascAmpFlip', 'descAmpFlip')
Default stimulus protocols pooled together for the headline figure.
- class arista.viz.nompc_dosage.NompCDosage(cell_types=('CC', 'HC'), stimulus_names=('ascAmp', 'descAmp', 'ascAmpFlip', 'descAmpFlip'), abs_gain=True, figsize=(12, 5.5), dpi=200, rng_seed=23, connect_tiers=True)[source]
Bases:
objectCallable wrapper for batch reuse.
- Parameters:
- plot(data, *, title=None, **overrides)[source]
- Parameters:
data (pd.DataFrame | sqlite3.Connection)
title (str | None)
- Return type:
Figure
- arista.viz.nompc_dosage.fetch_dosage_gains(conn, *, stimulus_names=('ascAmp', 'descAmp', 'ascAmpFlip', 'descAmpFlip'), cell_types=('CC', 'HC'))[source]
Per-recording gains pooled across stimuli, canonicalised + dosage-tagged.
- Parameters:
conn (Connection) – Open SQLite connection to a populated
arista.db.stimulus_names (tuple[str, ...]) – Thermal_step protocols to pool. Defaults to all four ramp stimuli.
- Returns:
DataFrame with one row per (recording, stimulus) carrying the original gain columns plus
canonical_strainanddosage. Rows whose strain has no entry inNOMPC_DOSAGEare dropped.- Return type:
- arista.viz.nompc_dosage.plot_nompc_dosage(data, *, stimulus_names=('ascAmp', 'descAmp', 'ascAmpFlip', 'descAmpFlip'), cell_types=('CC', 'HC'), abs_gain=True, figsize=(12, 5.5), title=None, rng_seed=23, connect_tiers=True)[source]
One panel per cell type, raincloud per strain at its NompC dosage.
- Parameters:
data (pd.DataFrame | sqlite3.Connection) – Either an already-fetched dosage-gain frame (output of
fetch_dosage_gains()) or a live SQLite connection.stimulus_names (tuple[str, ...]) – Thermal-step protocols to pool when fetching from a connection.
cell_types (tuple[str, ...]) – Cell types to plot, one panel per.
abs_gain (bool) – Plot
|slope|(default, makes CC and HC comparable and reads as “how much does the cell care about temperature change”). SetFalseto preserve sign.title (str | None) – Optional suptitle.
rng_seed (int) – Seed for the raincloud jitter RNG.
connect_tiers (bool) – When
True, overlays a thin median-vs-dosage line connecting tier centres so the dose-response trend is visible at a glance.
- Returns:
matplotlib.figure.Figure. Caller owns I/O.- Return type:
Figure