Reproducing Luo, Jiang, Desai et al. (2024) from dandiset 001261¶

Paper. Luo F, Jiang L, Desai NS, Bai L, Watkins GV, Eldridge MAG, et al. (2024). Comparative physiology and morphology of BLA-projecting NBM/SI cholinergic neurons in mouse and macaque. J. Comp. Neurol. 532, e70001. doi:10.1002/cne.70001. The claims file was written from the version of record (open access, PMC11583843), with its supplement.

Dandiset. DANDI:001261, version 0.250917.2023. The paper cites no version (its Data Availability Statement gives only https://dandiarchive.org/). This is the only published version, so it is pinned. The draft holds the same 152 files (same checksums); it differs only in metadata (contributors, a related resource, and the like), none of which the analysis uses. Files are read over HTTP into memory, not to disk.

What the dandiset holds. One NWB file per neuron: whole-cell current-clamp responses to a family of current steps, at 10 kHz, from mice and macaques, with the group of the neuron (species, cholinergic or not) in session_description. It holds no morphology, no quality-control measures and no slice identifiers.

Code. The features follow the claims file, which takes them from Methods 2.5 and the paper's MATLAB code (github.com/nsdesai/patch_clamp_analysis, commit 17a3265, doi:10.5281/zenodo.10975327), re-implemented in Python in nbmsi.py; the UMAP is umap-learn in place of Meehan's MATLAB implementation, and the LDA is scikit-learn's in place of MATLAB's fitcdiscr.

Claim Tested or blocked
sample-sizes tested
fig2-mouse-c-nc-15-of-18 tested
fig2d-mouse-max-firing-rate tested
fig2d-mouse-threshold-rheobase tested
fig2d-mouse-ahp tested
fig2d-mouse-adaptation tested
fig2d-mouse-passive tested
figs2-2-mouse-amplitude-cv-sag tested
fig2c-mouse-umap-separation tested
fig5a-mouse-lda-electrophysiology tested
fig5b-mouse-lda-ahp-amplitude-top tested
fig7d-macaque-more-excitable tested
fig7d-macaque-threshold-ahp tested
fig7-macaque-spike-width tested
figs7-1-macaque-amplitude-cv-sag-upstroke tested
fig7-macaque-mouse-feature-count tested
fig7d-macaque-input-resistance tested
fig7c-macaque-mouse-umap-separation tested
fig4d-mouse-morphology-3-of-13 blocked, data missing (morphology)
figs4-1a-mouse-sholl-not-different blocked, data missing (morphology)
fig4c-mouse-morphology-umap-similar blocked, data missing (morphology)
fig5c-mouse-lda-morphology-fails blocked, data missing (morphology)
fig9-macaque-convex-hull blocked, data missing (morphology)
fig9-macaque-morphology-feature-count blocked, data missing (morphology)
fig9-macaque-fewer-branch-points blocked, data missing (morphology)
fig9c-morphology-umap-weak blocked, data missing (morphology)
fig10-combined-separation blocked, data missing (morphology)
fig10c-combined-lda-weights blocked, data missing (morphology)
figs9-1a-macaque-mouse-sholl-similar blocked, data missing (morphology)
In [1]:
import time
import warnings

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

import nbmsi

warnings.filterwarnings("ignore", category=RuntimeWarning)
pd.set_option("display.width", 220)
pd.set_option("display.max_columns", 40)
pd.set_option("display.max_rows", 200)
pd.set_option("display.max_colwidth", 70)

started = time.time()
cells = nbmsi.load_all()
print(f"loaded {len(cells)} files from dandiset {nbmsi.DANDISET_ID} version {nbmsi.DANDISET_VERSION} "
      f"in {time.time() - started:.0f} s")
loaded 152 files from dandiset 001261 version 0.250917.2023 in 13 s

Data check¶

Each check of the metadata against the values is stated under its output.

In [2]:
info = pd.DataFrame([{
    "i": i, "folder": c["path"].split("/")[0], "subject": c["subject"],
    "species": nbmsi.species_group(c["group"])[0], "grp": nbmsi.species_group(c["group"])[1],
    "sex": c["sex"], "age": c["age"], "identifier": c["identifier"].strip("'"), "n_sweeps": c["n_sweeps"],
    "sweep_s": c["sweep_s"], "rates": c["rates"], "units": c["units"], "bias": c["bias"], "hash": c["hash"],
    "notes": c["notes"]} for i, c in enumerate(cells)])
print("Files per group (session_description):")
print(info.groupby(["species", "grp"]).size().to_string())
print("\nSubjects per species:", info.groupby("species").subject.nunique().to_dict())
print("Subjects per group:", info.groupby(["species", "grp"]).subject.nunique().to_dict())
sexes = info.drop_duplicates("subject").groupby(["species", "sex"]).size()
print("Sex of subjects:", sexes.to_dict(), "(Table 1: mice 18 M, 9 F; macaques 7 M, 2 F)")
print("\nSampling rates:", sorted({r for x in info.rates for r in x}), "Hz;",
      "units (voltage, stimulus):", sorted({u for x in info.units for u in x}))
amp = pd.Series([a for c in cells for a in c["amplifier"]])
print("Amplifier fields", nbmsi.AMPLIFIER_FIELDS, "(A, Ohm, F, gain): distinct values over every sweep of every file,",
      "with the number of files holding each:", {str(a): int(sum(a in c["amplifier"] for c in cells)) for a in amp.unique()})
print("Sweeps per file:", info.n_sweeps.value_counts().sort_index().to_dict())
print("Sweep durations (s):", info.sweep_s.astype(str).value_counts().to_dict())
print("\nGroup labels (session_description):", info.assign(g=[c["group"] for c in cells]).g.value_counts().to_dict())
print("general/notes, the only free-text field per file; its values per species:")
print(info.groupby("species").notes.agg(lambda x: x.value_counts().to_dict()).to_string())
Files per group (session_description):
species  grp
macaque  C      46
         NC     12
mouse    C      48
         NC     46

Subjects per species: {'macaque': 9, 'mouse': 27}
Subjects per group: {('macaque', 'C'): 6, ('macaque', 'NC'): 7, ('mouse', 'C'): 21, ('mouse', 'NC'): 11}
Sex of subjects: {('macaque', 'F'): 2, ('macaque', 'M'): 7, ('mouse', 'F'): 9, ('mouse', 'M'): 18} (Table 1: mice 18 M, 9 F; macaques 7 M, 2 F)

Sampling rates: [10000.0] Hz; units (voltage, stimulus): [('volts', 'amperes')]
Amplifier fields ['bias_current', 'bridge_balance', 'capacitance_compensation', 'gain'] (A, Ohm, F, gain): distinct values over every sweep of every file, with the number of files holding each: {'(1e-11, 20000000.0, 1e-12, 1.0)': 152}
Sweeps per file: {12: 25, 13: 2, 14: 20, 15: 32, 16: 42, 17: 2, 18: 1, 19: 3, 20: 1, 21: 4, 22: 1, 24: 15, 27: 4}
Sweep durations (s): {'[2.0]': 73, '[5.0]': 48, '[6.0]': 20, '[4.0]': 5, '[10.0]': 3, '[1.5]': 3}

Group labels (session_description): {'Mouse BLA-projecting cholinergic NBM/SI neurons': 48, 'Mouse BLA-projecting noncholinergic NBM/SI neurons': 46, 'Macaque BLA-projecting cholinergic NBM/SI neurons': 46, 'Macaque BLA-projecting noncholinergic NBM/SI neurons': 12}
general/notes, the only free-text field per file; its values per species:
species
macaque    {'Bregma (mm) -7.1': 6, 'Bregma (mm) -6.85': 6, 'Bregma (mm) -4.95...
mouse      {'Bregma (mm) -0.7': 25, 'Bregma (mm) -0.82': 19, 'Bregma (mm) -0....

The dandiset holds 152 files, one neuron each, with the group of each neuron in session_description: 48 mouse cholinergic, 46 mouse noncholinergic, 46 macaque cholinergic and 12 macaque noncholinergic files, from 27 mice and 9 macaques, as in the paper (Table 1 and Results 3.1). Nothing in the files records the quality-control measures (access resistance, offset current), the slice, or the morphology. The amplifier fields hold one set of values in every sweep of every file (bias current 1e-11 A, bridge balance 2e7 Ohm, capacitance compensation 1e-12 F, gain 1), although the neurons were held at -65 mV by a bias current set per neuron (Methods 2.4); they are placeholders, not measurements. The one free-text field, general/notes, holds only a bregma position (for example "Bregma (mm) -0.7"); no field records a slice or a quality-control measure.

In [3]:
dups = info[info.duplicated("hash", keep=False)].sort_values("hash")
print("Files whose voltage traces are identical, sample for sample:")
print(dups[["i", "folder", "species", "grp", "identifier"]].to_string(index=False))
named = info.identifier.str.extract(r"(CG\d+)")[0]
other = info[named.notna() & (("sub-" + named) != info.folder)]
print("\nFiles whose identifier names another mouse than their folder:")
print(other[["i", "folder", "identifier"]].to_string(index=False))
Files whose voltage traces are identical, sample for sample:
  i           folder species grp                   identifier
 99 sub-M#12-Shahruk macaque  NC              NHP_20220420-03
101 sub-M#12-Shahruk macaque  NC              NHP_20220420-03
 70        sub-CG608   mouse  NC CG608_FL_S4C7_B+G+_-63mV.mat
 76        sub-CG608   mouse   C CG608_FL_S4C7_B+G+_-63mV.mat

Files whose identifier names another mouse than their folder:
 i    folder                    identifier
84 sub-CG608 CG609_FL_S7LC4_B+G+_-62mV.mat
85 sub-CG608 CG609_FL_S6RC1_B+G+_-67mV.mat

Two recordings are deposited twice, with the same traces sample for sample. One mouse neuron, CG608_FL_S4C7_B+G+_-63mV.mat, is filed once as cholinergic and once as noncholinergic; its name says G+ (GFP-positive, which marks the cholinergic neurons in ChAT-tau-GFP mice), so it is counted once, as cholinergic. One macaque noncholinergic neuron, NHP_20220420-03, is filed twice under two session names. Each is counted once below: 48 mouse cholinergic, 45 mouse noncholinergic and 11 macaque noncholinergic neurons. Two files in the folder of mouse CG608 are named for CG609.

In [4]:
pre, n = int(nbmsi.PRE_MS / nbmsi.DT), int(nbmsi.STEP_MS / nbmsi.DT)
rows = []
for i, c in enumerate(cells):
    for s in c["sweeps"]:
        rows.append({"i": i, "step_pA": s["step"], "duration_ms": s["duration_ms"], "onset_s": s["onset_s"],
                     "first_nonzero_s": s["first_nonzero_s"], "file_onset_s": c["onset_s"],
                     "pulse_to_step_ms": s["pulse_to_step_ms"], "test_pulse": s["test_pulse"],
                     "baseline_mV": s["baseline"]})
sw = pd.DataFrame(rows)
print("Stimulus values: the files label them amperes; the values are", sorted(float(x) for x in sw.step_pA.unique()))
print("Step durations (ms) and how many sweeps:", sw.duration_ms.value_counts(dropna=False).sort_index().to_dict())
print("Short pulses (< 200 ms): amplitudes", sorted(float(x) for x in sw[sw.test_pulse].step_pA.unique()), "in",
      sw[sw.test_pulse].i.nunique(), "files")
print("Files with steps above 200 pA:", sw[sw.step_pA > 200].i.nunique(), "; largest step per file (pA) and how many files:",
      sw[~sw.test_pulse].groupby("i").step_pA.max().value_counts().sort_index().to_dict())
steps = sw[~sw.test_pulse].groupby("i").step_pA.apply(lambda x: sorted(x.unique()))
incr = steps.apply(lambda s: sorted({float(b - a) for a, b in zip(s, s[1:]) if 0 <= a < b <= 200}))
print("Increments between positive steps up to 200 pA (pA), by file:", incr.astype(str).value_counts().to_dict())
has = steps.apply(lambda s: (-60.0 in s, -20.0 in s, 200.0 in s))
print("Files with a -60 pA, a -20 pA and a 200 pA step:", int(has.apply(all).sum()), "of", len(has))
base = sw.groupby("i").baseline_mV.median()
print("\nMedian potential 10 to 1 ms before the step, per file (mV): 5th, 50th, 95th percentiles",
      np.percentile(base, [5, 50, 95]).round(1), "; files outside -100 to 0 mV:", list(base[(base < -100) | (base > 0)].round(0).items()))
rel = pd.Series([x for r in sw.pulse_to_step_ms for x in r])
print("\nSweeps holding a step and a separate short pulse:", int((sw.pulse_to_step_ms.str.len() > 0).sum()),
      "; start of the pulse relative to the step onset (ms), and how many sweeps:", rel.round(0).value_counts().sort_index().to_dict())
steps_only = sw[~sw.test_pulse & sw.duration_ms.notna()]
print("Steps whose onset (start of the longest run of non-zero current) differs from the file's onset (largest step):",
      int(((steps_only.onset_s - steps_only.file_onset_s).abs() > 1e-9).sum()), "of", len(steps_only))
Stimulus values: the files label them amperes; the values are [-100.0, -80.0, -60.0, -40.0, -20.0, 0.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 85.0, 90.0, 95.0, 100.0, 110.0, 120.0, 130.0, 140.0, 150.0, 160.0, 180.0, 200.0, 220.0, 240.0, 250.0, 260.0, 280.0, 300.0, 400.0, 500.0, 600.0, 700.0, 800.0, 900.0, 1000.0, 1100.0, 1200.0]
Step durations (ms) and how many sweeps: {50.0: 65, 100.0: 61, 500.0: 1947, 1000.0: 362, nan: 26}
Short pulses (< 200 ms): amplitudes [-20.0] in 126 files
Files with steps above 200 pA: 23 ; largest step per file (pA) and how many files: {150.0: 2, 200.0: 127, 300.0: 22, 1200.0: 1}
Increments between positive steps up to 200 pA (pA), by file: {'[10.0, 50.0]': 73, '[10.0, 20.0, 50.0]': 30, '[5.0, 10.0, 20.0]': 14, '[10.0, 20.0]': 14, '[20.0]': 10, '[5.0, 20.0]': 10, '[100.0]': 1}
Files with a -60 pA, a -20 pA and a 200 pA step: 149 of 152

Median potential 10 to 1 ms before the step, per file (mV): 5th, 50th, 95th percentiles [-75.8 -65.7 -58.4] ; files outside -100 to 0 mV: [(114, -1557.0)]

Sweeps holding a step and a separate short pulse: 1780 ; start of the pulse relative to the step onset (ms), and how many sweeps: {-700.0: 170, 1300.0: 78, 1500.0: 857, 2500.0: 629, 5000.0: 46}
Steps whose onset (start of the longest run of non-zero current) differs from the file's onset (largest step): 0 of 2309
In [5]:
# Files whose sweeps start with a test pulse before the step: the step onset against the first non-zero sample
early = sw[(sw.first_nonzero_s < sw.onset_s - 1e-9)]
print("Sweeps whose first non-zero stimulus sample comes before the step (a test pulse first):", len(early), "in",
      early.i.nunique(), "files:", [info.identifier[i] for i in sorted(early.i.unique())])
print(early.groupby("i").agg(sweeps=("step_pA", "size"), first_nonzero_s=("first_nonzero_s", "median"),
                             step_onset_s=("onset_s", "median"), file_onset_s=("file_onset_s", "median"),
                             step_ms=("duration_ms", "median")).assign(identifier=lambda d: info.identifier[d.index].values).to_string())
allsw = sw[sw.i.isin(early.i.unique())].groupby("i").agg(sweeps_in_file=("step_pA", "size"),
                                                     step_sweeps=("test_pulse", lambda x: int((~x).sum())))
allsw["pulse_first"] = early.groupby("i").size()
allsw["pulse_first_of_step_sweeps"] = early[~early.test_pulse].groupby("i").size()
allsw[["species", "grp", "subject"]] = info.loc[allsw.index, ["species", "grp", "subject"]]
print("\nEvery sweep of these files: how many, how many hold a step, and in how many the pulse comes first:")
print(allsw.to_string())
ex = next(i for i in sorted(early.i.unique()) if info.species[i] == "mouse")
raw = nbmsi.raw_sweeps(cells[ex]["path"])
top = max(raw, key=lambda r: r["i"].max())
t = np.arange(len(top["v"])) / 1e4
fig, ax = plt.subplots(2, 1, figsize=(7, 4), sharex=True)
ax[0].plot(t, top["v"], lw=0.5); ax[0].set_ylabel("V (mV)")
ax[1].plot(t, top["i"], lw=0.8); ax[1].set_ylabel("I (pA)"); ax[1].set_xlabel("time in sweep (s)")
c0 = cells[ex]["sweeps"][[r["name"] for r in raw].index(top["name"])]
for a in ax:
    a.axvspan(c0["onset_s"], c0["onset_s"] + 0.5, color="0.85")
ax[0].set_title(f"{info.identifier[ex]}, {top['name']}: the analysed 500 ms shaded")
plt.show()
print(f"plotted: voltage {top['v'].min():.1f} to {top['v'].max():.1f} mV, current {top['i'].min():.0f} to {top['i'].max():.0f} pA, all inside the axes;",
      f"spikes in the analysed window: {len(nbmsi.peaks(c0['v'][int(nbmsi.PRE_MS / nbmsi.DT):]))},",
      f"in the 500 ms from the first non-zero sample: {len(nbmsi.peaks(top['v'][int(c0['first_nonzero_s'] * 1e4): int(c0['first_nonzero_s'] * 1e4) + 5000]))}")
Sweeps whose first non-zero stimulus sample comes before the step (a test pulse first): 170 in 8 files: ['20211115-05 BLA', '20211129-01 BLA', '20211202-01-BLA', '20211202-03-BLA', '20211202-02-BLA', '20220223-02 BLA', 'NHP_20220307-01', 'NHP_20220308-01']
    sweeps  first_nonzero_s  step_onset_s  file_onset_s  step_ms       identifier
i                                                                                
21      23           0.2999        0.9999        0.9999    500.0  20211115-05 BLA
22      23           0.2999        0.9999        0.9999    500.0  20211129-01 BLA
23      23           0.2999        0.9999        0.9999    500.0  20211202-01-BLA
24      15           0.2999        0.9999        0.9999    500.0  20211202-03-BLA
25      19           0.2999        0.9999        0.9999    500.0  20211202-02-BLA
26      23           0.2999        0.9999        0.9999   1000.0  20220223-02 BLA
94      23           0.2999        0.9999        0.9999    500.0  NHP_20220307-01
95      21           0.2999        0.9999        0.9999    500.0  NHP_20220308-01

Every sweep of these files: how many, how many hold a step, and in how many the pulse comes first:
    sweeps_in_file  step_sweeps  pulse_first  pulse_first_of_step_sweeps  species grp     subject
i                                                                                                
21              24           23           23                          23    mouse   C       CG250
22              24           23           23                          23    mouse   C       CG268
23              24           23           23                          23    mouse   C       CG269
24              16           15           15                          15    mouse   C       CG269
25              20           19           19                          19    mouse   C       CG269
26              24           23           23                          23    mouse   C       CG337
94              24           23           23                          23  macaque   C  M#11 Aamir
95              22           21           21                          21  macaque  NC  M#11 Aamir
No description has been provided for this image
plotted: voltage -66.4 to 27.5 mV, current -20 to 200 pA, all inside the axes; spikes in the analysed window: 3, in the 500 ms from the first non-zero sample: 0

In 8 files (six mouse cholinergic neurons of November 2021 to February 2022, and one cholinergic and one noncholinergic macaque neuron of M#11) a 100 ms, -20 pA test pulse starts at 0.3 s and the step at 1.0 s, in every sweep that holds a step (170 of 170); the one other sweep of each file holds no step. The step onset is taken as the start of the longest run of non-zero current in each sweep, which puts the analysed window on the step in these files, at the file's onset (the first sample of its largest step) in every step of every file. In every other sweep that holds both, the pulse starts 1.3 s or more after the step onset, outside the analysed window. In the plotted 200 pA sweep the analysed window holds 3 spikes, while the 500 ms from the first non-zero sample hold none. In the first round of this attempt the onset was the first non-zero sample, which put the window on the test pulse in these 8 files: they then seemed not to depolarise with positive steps and to fire no spike.

The stimulus values are in pA, not amperes as the files say. They run from -100 to 1200 pA: the largest step is 200 pA in 127 files, 150 pA in 2, 300 pA in 22 and 1200 pA in 1. The increments between positive steps up to 200 pA are 10 to 50 pA in most files, include 5 pA in 24 files, and are 100 pA in one, not the 10 pA increments of the Fig. S2-1 legend; the rheobase can only be as fine as the steps. Steps last 500 or 1000 ms; the first 500 ms are analysed, as the code does. Most files also hold a short -20 pA pulse (50 or 100 ms), in a sweep of its own or in the same sweep as a step, left out as not part of the family of steps. The potential before the steps is near -65 mV, as Methods 2.4 says, in all files but one: the macaque file 2023_03_06_0002 R+B+A2C1 RMP -78.abf sits near -1557 "mV", 20 times too large (its name gives -78 mV, and -1557 / 20 = -77.9). Its scale is wrong, and it is left out of the analysis.

In [6]:
oc = pd.DataFrame([nbmsi.onset_contrast(c) for c in cells], columns=["at_onset", "50_ms_earlier"])
oc[["species", "grp"]] = info[["species", "grp"]]
print("Change of potential at the onset of the -60 pA step (mean 5 to 25 ms after minus 20 to 0 ms before, mV),")
print("and the same windows 50 ms earlier:")
print(oc.groupby(["species", "grp"]).agg(["median", "min", "max"]).round(2).to_string())
resp = pd.Series([nbmsi.responsiveness(c) for c in cells])
print("\nSteady-state potential on the largest step (<= 200 pA) minus that on the most negative step (mV);")
print("the 12 smallest:")
print(pd.DataFrame({"i": resp.nsmallest(12).index, "mV": resp.nsmallest(12).round(1).values,
                    "group": info.loc[resp.nsmallest(12).index, ["species", "grp"]].agg(" ".join, axis=1).values,
                    "identifier": info.loc[resp.nsmallest(12).index, "identifier"].values}).to_string(index=False))
Change of potential at the onset of the -60 pA step (mean 5 to 25 ms after minus 20 to 0 ms before, mV),
and the same windows 50 ms earlier:
            at_onset               50_ms_earlier             
              median     min   max        median    min   max
species grp                                                  
macaque C      -9.28 -317.30 -5.35         -0.07 -11.26  3.15
        NC     -9.69  -25.32 -2.63          0.14  -0.39  1.04
mouse   C      -8.56  -15.36 -4.59         -0.04  -0.99  1.01
        NC    -11.75  -25.42 -5.01          0.02  -1.13  0.84

Steady-state potential on the largest step (<= 200 pA) minus that on the most negative step (mV);
the 12 smallest:
  i   mV      group                                           identifier
102 17.0 macaque NC                                      NHP_20220420-01
 34 19.5    mouse C                                          20220421-03
 27 24.0    mouse C                                      20220317-03 BLA
 37 27.0    mouse C                                          20220607-10
103 29.4 macaque NC                                      NHP_20220420-02
 18 30.9    mouse C                                      20210901-03 BLA
 36 31.1    mouse C                                          20220602-06
104 31.4  macaque C                 2022_09_06_0028 NSD L11C3 R+B+G+.abf
 55 32.9   mouse NC 2023_08_31_0002 CG590 NBM S1LC1 R+G- RMP -49.4mV.abf
 21 33.4    mouse C                                      20211115-05 BLA
 16 33.7    mouse C                                      20210901-09 BLA
  6 33.8    mouse C                                      20210707-06 BLA

The voltage and the stimulus of each sweep share one clock: at the onset of the -60 pA step the potential falls in every file, while the same windows 50 ms earlier show no change (group medians -0.07 to 0.14 mV). Every neuron depolarises with positive steps: the steady-state potential on the largest step lies 17.0 mV or more above that on the most negative step.

In [7]:
info["rmp_name"] = [nbmsi.rmp_from_name(c["identifier"]) for c in cells]
print("Resting potential written in the file name (the only record of F1), per group:")
print(info.groupby(["species", "grp"]).rmp_name.agg(["count", "size"]).rename(columns={"count": "with value", "size": "files"}).to_string())
Resting potential written in the file name (the only record of F1), per group:
             with value  files
species grp                   
macaque C            23     46
        NC            4     12
mouse   C             8     48
        NC           28     46

F1, the resting potential "measured in the absence of a current injection" (Methods 2.5), is not in the data: every sweep is recorded with the holding current. Some of the original file names, kept as the NWB identifier, carry a value (for example "RMP -49.4mV"): 8 of 48 mouse cholinergic, 28 of 46 mouse noncholinergic, 23 of 46 macaque cholinergic and 4 of 12 macaque noncholinergic files. F1 is therefore not computed for the paper's neurons, and the named values are shown only as a variant.

Features¶

The 18 features of Methods 2.5, as the claims file defines them (F1 to F18; see nbmsi.py for each choice and its source). The neurons analysed: every file, each duplicated recording once, without the file whose scale is wrong.

In [8]:
drop = set(info[info.duplicated("hash", keep="first")].i)
cg608 = info[info.identifier.str.contains("CG608_FL_S4C7")]
drop = (drop - set(cg608.i)) | set(cg608[cg608.grp == "NC"].i)  # the G+ copy is kept
drop |= set(base[(base < -100) | (base > 0)].index)
use = [i for i in range(len(cells)) if i not in drop]
print("left out:", sorted(drop), [info.identifier[i] for i in sorted(drop)])

def table(repeat):
    rows = []
    for i in use:
        r = nbmsi.features(cells[i], repeat=repeat)
        r.update(i=i, subject=info.subject[i], species=info.species[i], grp=info.grp[i])
        rows.append(r)
    return pd.DataFrame(rows).set_index("i")

t0 = time.time()
feat = table("first")
feat_last = table("last")
print(f"features computed in {time.time() - t0:.0f} s")
print(feat.groupby(["species", "grp"]).size().to_string())
F = nbmsi.FEATURES
print("\nMissing values per feature and group (no spike up to 200 pA leaves the spike features missing):")
print(feat.groupby(["species", "grp"])[F].agg(lambda x: int(x.isna().sum())).T.to_string())
print("\nRange of every feature over the neurons analysed:")
print(feat[F].describe().T[["count", "min", "50%", "max"]].round(3).to_string())
print("\nSag step used (pA), per group:", feat.groupby(["species", "grp"]).sag_step.agg(lambda x: x.value_counts(dropna=False).to_dict()).to_dict())
moved = feat[feat.sag_step != nbmsi.SAG_STEP]
for i in moved.index:
    one = nbmsi._step_traces(cells[i])[1]
    if nbmsi.SAG_STEP in one:
        v = one[nbmsi.SAG_STEP]["v"][pre: pre + n]
        flat = int(np.max(np.diff(np.flatnonzero(np.diff(np.concatenate([[1], np.diff(v) != 0, [1]]))))))
        print(f"  {info.identifier[i]} ({info.species[i]} {info.grp[i]}): -60 pA response minimum {v.min():.1f} mV, "
              f"longest run of identical samples {flat}; sag on the {moved.sag_step[i]:.0f} pA step")
    else:
        print(f"  {info.identifier[i]} ({info.species[i]} {info.grp[i]}): no -60 pA step, steps {sorted(one)}; sag on the {moved.sag_step[i]:.0f} pA step")

# Variant: the macaque file with the wrong scale, its voltage divided by 20, added to the macaque neurons
bad = sorted(set(base[(base < -100) | (base > 0)].index))
resc = []
for i in bad:
    c = dict(cells[i]); c["sweeps"] = [dict(s, v=s["v"] / 20.0) for s in cells[i]["sweeps"]]
    r = nbmsi.features(c); r.update(i=i, subject=info.subject[i], species=info.species[i], grp=info.grp[i])
    resc.append(r)
feat_resc = pd.concat([feat, pd.DataFrame(resc).set_index("i")])
print("\nVariant, the file with the wrong scale divided by 20:", {k: round(float(v), 3) for k, v in resc[0].items() if k in F})
left out: [70, 101, 114] ['CG608_FL_S4C7_B+G+_-63mV.mat', 'NHP_20220420-03', '2023_03_06_0002 R+B+A2C1 RMP -78.abf']
features computed in 2 s
species  grp
macaque  C      45
         NC     11
mouse    C      48
         NC     45

Missing values per feature and group (no spike up to 200 pA leaves the spike features missing):
species     macaque    mouse    
grp               C NC     C  NC
rmp              23  7    40  18
sag               0  0     0   0
rin               0  0     1   0
tau               0  0     1   0
rheobase          0  0     1   1
threshold         0  0     1   1
amplitude         0  0     1   1
width             0  0     1   1
latency           0  0     1   1
upstroke          0  0     1   1
downstroke        0  0     1   1
ahp_amp           0  0     1   1
ahp_latency       0  0     1   1
ahp_width         0  0     1   2
fi_slope          0  0     1   1
max_rate          0  0     0   0
adaptation        1  0     4   3
cv_isi            1  0     1   2

Range of every feature over the neurons analysed:
             count      min      50%       max
rmp           61.0  -76.800  -54.800   -41.900
sag          149.0    0.000    1.849    30.304
rin          148.0   91.186  395.081  2065.250
tau          148.0    5.179   34.769   364.291
rheobase     147.0   10.000   30.000   200.000
threshold    147.0  -52.246  -36.522   -19.815
amplitude    147.0   31.525   59.631    82.658
width        147.0    0.420    1.160     3.010
latency      147.0    3.800  184.200   492.310
upstroke     147.0   37.098  124.401   306.091
downstroke   147.0 -176.697  -57.068   -19.531
ahp_amp      147.0    0.000   20.474    44.741
ahp_latency  147.0    0.000   32.000    99.900
ahp_width    146.0    0.500  248.250   449.200
fi_slope     147.0    0.018    0.095     0.869
max_rate     149.0    0.000   14.000   112.000
adaptation   141.0    0.000    0.500     2.000
cv_isi       145.0    0.000    0.262     1.149

Sag step used (pA), per group: {('macaque', 'C'): {-60.0: 45}, ('macaque', 'NC'): {-60.0: 10, -40.0: 1}, ('mouse', 'C'): {-60.0: 45, -40.0: 2, -100.0: 1}, ('mouse', 'NC'): {-60.0: 40, -40.0: 4, -20.0: 1}}
  20210831-01 BLA (mouse C): no -60 pA step, steps [-100.0, 0.0, 100.0, 200.0]; sag on the -100 pA step
  2023_09_01_0037 CG596 NBM S1RC3 R+G+ RMP -46.6mV.abf (mouse C): -60 pA response minimum -100.0 mV, longest run of identical samples 4302; sag on the -40 pA step
  2023_09_20_0105 R+G- RMP-70.2mV.abf (mouse NC): -60 pA response minimum -100.0 mV, longest run of identical samples 4620; sag on the -40 pA step
  2023_09_20_0036 R+G- RMP -54.8mV.abf (mouse NC): -60 pA response minimum -100.0 mV, longest run of identical samples 1651; sag on the -40 pA step
  2023_09_20_0026 R+G- RMP-54.8mV.abf (mouse NC): -60 pA response minimum -100.0 mV, longest run of identical samples 4578; sag on the -40 pA step
  CG609_FL_S6RC1_B+G+_-67mV.mat (mouse C): -60 pA response minimum -105.5 mV, longest run of identical samples 1144; sag on the -40 pA step
  2023_09_21_0054 R+G- RMP-48.2mV.abf (mouse NC): -60 pA response minimum -100.0 mV, longest run of identical samples 4793; sag on the -20 pA step
  CG609_FL_S7LC4_B+G-_-76mV.mat (mouse NC): -60 pA response minimum -105.5 mV, longest run of identical samples 4488; sag on the -40 pA step
  M31_FL_P7C1 (macaque NC): -60 pA response minimum -105.5 mV, longest run of identical samples 4646; sag on the -40 pA step

Variant, the file with the wrong scale divided by 20: {'rmp': -78.0, 'sag': 2.686, 'rin': 1203.484, 'tau': 58.065, 'rheobase': 10.0, 'threshold': -51.895, 'amplitude': 63.034, 'width': 0.95, 'latency': 134.01, 'upstroke': 175.781, 'downstroke': -81.787, 'ahp_amp': 23.27, 'ahp_latency': 9.1, 'ahp_width': 363.7, 'fi_slope': 0.282, 'max_rate': 60.0, 'adaptation': 1.0, 'cv_isi': 0.04}

Readings. The main reading of each feature is the Methods' (claims file, F1 to F18): input resistance and tau on the -20 pA step, latency to the threshold crossing, downstroke reading (a) (first peak to 20 ms after it), AHP on the rheobase step within 100 ms of threshold, adaptation and CV on the 200 pA step (reading a); the AHP width with its crossings searched within the 100 ms window of F12, as the claims file's F14 says ("Window as in F12"). The other readings carry a suffix: downstroke_code (F11 b), adaptation_most and cv_isi_most (F17 and F18 b, the step with the most spikes); ahp_width_to_end (F14 with the crossings searched to the end of the step); and the code's variants rin_code, tau_code, latency_peak, ahp_*_code, rate_200 (the 200 pA reading of F16) and max_rate_code (the code's maximum over every step, including those above 200 pA). Sag is measured on the -60 pA step, or the closest step below it, and on the next step up when the response is saturated (claims file, F2, from sagpotential.m; saturated read as 1000 or more identical consecutive samples); sag_60, the -60 pA step whatever its response, is a variant. feat_last takes the last sweep of a repeated amplitude in place of the first, and feat_resc adds the macaque file with the wrong scale, its voltage divided by 20.

In [9]:
M = (feat.species == "mouse")
mC, mNC = M & (feat.grp == "C"), M & (feat.grp == "NC")
qC = (feat.species == "macaque") & (feat.grp == "C")
EXTRA = ["downstroke_code", "adaptation_most", "cv_isi_most", "rin_code", "tau_code", "latency_peak",
         "ahp_amp_code", "ahp_latency_code", "ahp_width_code", "rate_200", "max_rate_code", "ahp_width_to_end", "sag_60"]
mouse = nbmsi.ranksum_table(feat, mC, mNC, F + EXTRA).rename(columns=lambda c: c.replace("_a", "_C").replace("_b", "_NC"))
species = nbmsi.ranksum_table(feat, qC, mC, F + EXTRA).rename(columns=lambda c: c.replace("_a", "_macaque").replace("_b", "_mouse"))
mouse_last = nbmsi.ranksum_table(feat_last, mC, mNC, F + EXTRA)
species_last = nbmsi.ranksum_table(feat_last, qC, mC, F + EXTRA)
qCr = (feat_resc.species == "macaque") & (feat_resc.grp == "C")
mCr = (feat_resc.species == "mouse") & (feat_resc.grp == "C")
species_resc = nbmsi.ranksum_table(feat_resc, qCr, mCr, F + EXTRA)
def show(tab):
    """A rank-sum table with the p-values in scientific notation."""
    return tab.to_string(float_format=lambda x: f"{x:.4g}", formatters={"p": "{:.2e}".format})

rmp = info.set_index("i").loc[use, "rmp_name"]
feat["rmp_name"] = rmp
print("Mouse cholinergic (C) against noncholinergic (NC), rank-sum per feature:")
print(show(mouse))
Mouse cholinergic (C) against noncholinergic (NC), rank-sum per feature:
                  n_C  mean_C    sd_C  n_NC  mean_NC  sd_NC        p
feature                                                             
rmp                 8  -54.72   7.907    27   -58.53  8.618 3.56e-01
sag                48   1.859   1.798    45    3.185  2.231 1.78e-03
rin                47   355.5   163.7    45    470.9  229.4 1.26e-03
tau                47   39.92   26.67    45    28.59  19.85 3.23e-03
rheobase           47   62.45   36.31    44    42.05  34.05 1.13e-03
threshold          47  -33.12   4.547    44   -36.77  6.023 6.47e-04
amplitude          47   59.65   8.221    44    53.35  6.594 5.38e-05
width              47   1.157  0.4348    44    1.143 0.3724 7.36e-01
latency            47   283.1   133.1    44    142.5  94.25 3.57e-07
upstroke           47   120.5   27.67    44    113.8  25.65 2.75e-01
downstroke         47  -65.17   22.52    44   -60.36  21.44 2.58e-01
ahp_amp            47   31.26   7.843    44    16.35  4.498 2.51e-13
ahp_latency        47   34.83   23.15    44    34.91  30.92 6.17e-01
ahp_width          47   183.1   125.6    43    298.9  140.3 4.07e-05
fi_slope           47 0.05826 0.03081    44   0.2342 0.1466 4.02e-13
max_rate           48   6.917   4.227    45     34.8   23.1 1.89e-12
adaptation         44  0.6172  0.5444    42   0.5527 0.3308 8.62e-01
cv_isi             47  0.1832  0.2155    43   0.2745 0.1835 1.11e-02
downstroke_code    47  -65.17   22.52    44   -60.37  21.46 2.58e-01
adaptation_most    44  0.8748  0.5862    43   0.6062 0.2961 1.07e-02
cv_isi_most        47  0.1901  0.2072    44   0.3165 0.1739 1.27e-03
rin_code           47   335.1   138.2    45      369  120.4 8.57e-02
tau_code           47   34.88   14.52    45    22.04  10.19 2.68e-06
latency_peak       47     284   133.2    44    143.3  94.32 3.64e-07
ahp_amp_code       47   30.06   7.364    44    12.14  6.144 4.14e-14
ahp_latency_code   47   29.04    19.3    44    17.49  25.18 1.44e-04
ahp_width_code     47   184.3   87.84    44    77.38  92.85 5.20e-08
rate_200           47   6.809   4.327    43    34.47  23.55 3.13e-11
max_rate_code      48   7.042   4.125    45     34.8   23.1 2.14e-12
ahp_width_to_end   47     160   102.9    43    226.3    131 1.74e-02
sag_60             47     1.8   1.791    45    3.008  2.353 1.09e-02

Claims¶

Each section quotes the claim; the cells that show the result carry the tag claim:<id>.

sample-sizes¶

Electrophysiology was analysed for 48 BLA-projecting cholinergic and 46 BLA-projecting noncholinergic NBM/SI neurons from 27 mice (56 slices) and 46 BLA-projecting cholinergic neurons from nine macaques (38 slices); morphology for 31 mouse cholinergic and 44 mouse noncholinergic neurons.

In [10]:
files = info.groupby(["species", "grp"]).size().rename("files")
distinct = info.drop_duplicates("hash").copy()
distinct.loc[distinct.identifier.str.contains("CG608_FL_S4C7"), "grp"] = "C"
recs = distinct.groupby(["species", "grp"]).size().rename("distinct recordings")
analysed = feat.groupby(["species", "grp"]).size().rename("analysed")
print(pd.concat([files, recs, analysed], axis=1).to_string())
print("\nSubjects:", info.groupby("species").subject.nunique().to_dict(), "; with cholinergic neurons:",
      info[info.grp == "C"].groupby("species").subject.nunique().to_dict())
print("Sex of subjects:", sexes.to_dict())
print("Slices: not recorded in the files. Morphology: not in the dandiset.")
print("Group labels in session_description:", sorted(info.assign(g=[c["group"] for c in cells]).g.unique()),
      "; none marks neurons of unknown ChAT status, so the NC reading with them added (getindices.m) is the same count.")
             files  distinct recordings  analysed
species grp                                      
macaque C       46                   46        45
        NC      12                   11        11
mouse   C       48                   48        48
        NC      46                   45        45

Subjects: {'macaque': 9, 'mouse': 27} ; with cholinergic neurons: {'macaque': 6, 'mouse': 21}
Sex of subjects: {('macaque', 'F'): 2, ('macaque', 'M'): 7, ('mouse', 'F'): 9, ('mouse', 'M'): 18}
Slices: not recorded in the files. Morphology: not in the dandiset.
Group labels in session_description: ['Macaque BLA-projecting cholinergic NBM/SI neurons', 'Macaque BLA-projecting noncholinergic NBM/SI neurons', 'Mouse BLA-projecting cholinergic NBM/SI neurons', 'Mouse BLA-projecting noncholinergic NBM/SI neurons'] ; none marks neurons of unknown ChAT status, so the NC reading with them added (getindices.m) is the same count.

Result: partially reproduced. The dandiset has 48 mouse cholinergic files, 46 mouse noncholinergic files and 46 macaque cholinergic files, from 27 mice and 9 macaques, with the sexes of Table 1 (mice 18 M and 9 F, macaques 7 M and 2 F). One of the 46 mouse noncholinergic files repeats a recording also filed as cholinergic, so the dandiset holds 45 distinct noncholinergic recordings, one fewer than the 46 of the paper. The four group labels in session_description include none for neurons of unknown ChAT status, so the second reading of the noncholinergic group gives the same count. The macaque cholinergic neurons come from 6 of the 9 macaques. Slices and morphology are not in the dandiset.

fig2-mouse-c-nc-15-of-18¶

In mouse, BLA-projecting cholinergic and noncholinergic NBM/SI neurons differ in 15 of the 18 electrophysiological features; spike width, upstroke and downstroke do not differ.

The rank-sum table is printed under "Features" above.

In [11]:
SETS = {"F11 a, F17/F18 a (200 pA)": ["downstroke", "adaptation", "cv_isi"],
        "F11 a, F17/F18 b (most spikes)": ["downstroke", "adaptation_most", "cv_isi_most"],
        "F11 b, F17/F18 a (200 pA)": ["downstroke_code", "adaptation", "cv_isi"],
        "F11 b, F17/F18 b (most spikes)": ["downstroke_code", "adaptation_most", "cv_isi_most"]}
BASE = ["sag", "rin", "tau", "rheobase", "threshold", "amplitude", "width", "latency", "upstroke",
        "ahp_amp", "ahp_latency", "ahp_width", "fi_slope", "max_rate"]

# The direction the paper states (Results 3.1 and 3.3, Figs. S2-2 and S7-1): +1 when the first group
# (mouse C; macaque) is larger, -1 when smaller. Features whose direction the paper does not give are left out.
DIR_MOUSE = {"max_rate": -1, "threshold": 1, "rheobase": 1, "ahp_amp": 1, "ahp_width": 1, "adaptation": 1,
             "adaptation_most": 1, "tau": 1, "amplitude": 1, "cv_isi": -1, "cv_isi_most": -1, "sag": -1}
DIR_SPECIES = {"max_rate": 1, "rheobase": -1, "fi_slope": 1, "threshold": -1, "ahp_amp": -1, "ahp_width": -1,
               "width": 1, "amplitude": 1, "cv_isi": 1, "cv_isi_most": 1, "sag": 1, "upstroke": 1, "rin": 1}

def count(tab, extra_sets=SETS, direction=DIR_MOUSE):
    rows = []
    a, b = [c for c in tab.columns if c.startswith("mean_")]
    for name, ex in extra_sets.items():
        cols = BASE + ex
        sig = tab.loc[cols, "p"] < 0.05
        wrong = [c for c in cols if sig[c] and c in direction
                 and np.sign(tab.loc[c, a] - tab.loc[c, b]) != direction[c]]
        rows.append({"readings": name, "features": len(cols), "differing": int(sig.sum()),
                     "not differing": ", ".join(c for c in cols if not sig[c]),
                     "differing against the paper's direction": ", ".join(wrong)})
    return pd.DataFrame(rows)

print("Mouse C against NC, features differing at p < 0.05, F1 not computable (17 features):")
print(count(mouse).to_string(index=False))
print("\nThe same with the last sweep of a repeated amplitude:")
print(count(mouse_last).to_string(index=False))
code_sets = {"code variants (rin, tau, latency, AHP of the code)":
             ["downstroke", "adaptation", "cv_isi"]}
alt = mouse.copy()
for a, b in [("rin", "rin_code"), ("tau", "tau_code"), ("latency", "latency_peak"), ("ahp_amp", "ahp_amp_code"),
             ("ahp_latency", "ahp_latency_code"), ("ahp_width", "ahp_width_code")]:
    alt.loc[a] = mouse.loc[b]
print("\nVariant, the code's choices for rin, tau, latency and the AHP (not deciding):")
print(count(alt, {"F11 a, F17/F18 a, code variants": SETS["F11 a, F17/F18 a (200 pA)"],
                  "F11 b, F17/F18 b, code variants": SETS["F11 b, F17/F18 b (most spikes)"]}).to_string(index=False))
r = nbmsi.ranksum_table(feat, mC, mNC, ["rmp_name"])
print("\nVariant, F1 from the file names (subset):", r.round(4).to_dict("records"))
Mouse C against NC, features differing at p < 0.05, F1 not computable (17 features):
                      readings  features  differing                                             not differing differing against the paper's direction
     F11 a, F17/F18 a (200 pA)        17         12      width, upstroke, ahp_latency, downstroke, adaptation                               ahp_width
F11 a, F17/F18 b (most spikes)        17         13                  width, upstroke, ahp_latency, downstroke                               ahp_width
     F11 b, F17/F18 a (200 pA)        17         12 width, upstroke, ahp_latency, downstroke_code, adaptation                               ahp_width
F11 b, F17/F18 b (most spikes)        17         13             width, upstroke, ahp_latency, downstroke_code                               ahp_width

The same with the last sweep of a repeated amplitude:
                      readings  features  differing                                             not differing differing against the paper's direction
     F11 a, F17/F18 a (200 pA)        17         12      width, upstroke, ahp_latency, downstroke, adaptation                               ahp_width
F11 a, F17/F18 b (most spikes)        17         13                  width, upstroke, ahp_latency, downstroke                               ahp_width
     F11 b, F17/F18 a (200 pA)        17         12 width, upstroke, ahp_latency, downstroke_code, adaptation                               ahp_width
F11 b, F17/F18 b (most spikes)        17         13             width, upstroke, ahp_latency, downstroke_code                               ahp_width

Variant, the code's choices for rin, tau, latency and the AHP (not deciding):
                       readings  features  differing                                not differing differing against the paper's direction
F11 a, F17/F18 a, code variants        17         12 rin, width, upstroke, downstroke, adaptation                                        
F11 b, F17/F18 b, code variants        17         13        rin, width, upstroke, downstroke_code                                        

Variant, F1 from the file names (subset): [{'n_a': 8, 'mean_a': -54.725, 'sd_a': 7.9071, 'n_b': 27, 'mean_b': -58.5333, 'sd_b': 8.618, 'p': 0.3559}]

Result: reproduced. F1 cannot be computed, so the count is out of 17 and the criterion's range is 13 to 15. With the adaptation index and the CV on the step with the most spikes (F17 and F18 reading b), 13 of the 17 features differ at p < 0.05 under either downstroke reading; with the 200 pA step (reading a), 12. Spike width, upstroke and downstroke are among the features that do not differ, as the criterion requires, together with AHP latency. One of the 13, the AHP width, differs in the direction opposite to the paper's (noncholinergic neurons have the wider AHP; see fig2d-mouse-ahp), so counting only differences in the paper's direction would give 12. The last sweep of a repeated amplitude gives the same counts, and the code's variants for input resistance, tau, latency and the AHP give 12 or 13, none against the paper's direction.

fig2d-mouse-max-firing-rate¶

Mouse noncholinergic BLA-projecting neurons are more excitable than cholinergic ones, with a maximum firing rate about six times larger (39.0 +- 24.9 against 7.3 +- 4.3 Hz).

In [12]:
print(show(mouse.loc[['max_rate', 'rate_200', 'max_rate_code']]))

pa = feat[M].groupby(["grp", "subject"])[['max_rate']].agg(["count", "mean"]).round(2)
print("\nPer mouse (count of neurons, mean):")
print(pa.to_string())

fig, ax = plt.subplots(figsize=(4, 3))
for k, (m, lab) in enumerate([(mC, "C"), (mNC, "NC")]):
    v = feat.loc[m, "max_rate"]
    ax.plot(np.full(len(v), k) + np.random.default_rng(1).uniform(-0.15, 0.15, len(v)), v, "o", ms=3)
ax.set_xticks([0, 1], ["mouse C", "mouse NC"]); ax.set_ylabel("max firing rate (Hz)")
plt.show()
print("plotted range:", feat.loc[M, "max_rate"].min(), "to", feat.loc[M, "max_rate"].max(), "Hz; all points inside the axes")
               n_C  mean_C  sd_C  n_NC  mean_NC  sd_NC        p
feature                                                        
max_rate        48   6.917 4.227    45     34.8   23.1 1.89e-12
rate_200        47   6.809 4.327    43    34.47  23.55 3.13e-11
max_rate_code   48   7.042 4.125    45     34.8   23.1 2.14e-12

Per mouse (count of neurons, mean):
            max_rate       
               count   mean
grp subject                
C   CG134          2   6.00
    CG135          1   4.00
    CG154          4   6.00
    CG171          2   7.00
    CG180          3   4.67
    CG209          3   3.33
    CG211          6   6.00
    CG250          1   6.00
    CG268          1   2.00
    CG269          3   4.00
    CG337          1   8.00
    CG355          3   6.00
    CG381          4   7.00
    CG383          2   6.00
    CG398          1   6.00
    CG439          1  14.00
    CG440          1  10.00
    CG539          1  12.00
    CG590          2  15.00
    CG596          3  12.67
    CG608          3   7.33
NC  CG380          1  48.00
    CG398          3  43.33
    CG406          3  28.00
    CG440          1  92.00
    CG475          1  32.00
    CG543          1  16.00
    CG562          3  38.67
    CG590          7  17.71
    CG596          2  30.00
    CG608         15  43.87
    CG609          8  25.75
No description has been provided for this image
plotted range: 0.0 to 112.0 Hz; all points inside the axes

Result: partially reproduced. Noncholinergic neurons fire faster (rank-sum p = 1.9e-12): mean maximum rate 6.92 +- 4.23 Hz for cholinergic and 34.8 +- 23.1 Hz for noncholinergic neurons, against 7.3 +- 4.3 and 39.0 +- 24.9 in the paper. The cholinergic mean and both SDs are within tolerance; the noncholinergic mean is just below its tolerance (35.1 to 42.9 Hz). The 200 pA reading gives 6.81 and 34.47 Hz.

fig2d-mouse-threshold-rheobase¶

Mouse cholinergic BLA-projecting neurons have a more depolarized spike threshold (-33 +- 4.6 against -37.1 +- 6.3 mV) and a larger rheobase (64.3 +- 41.2 against 42.2 +- 33.2 pA) than noncholinergic ones.

In [13]:
print(show(mouse.loc[['threshold', 'rheobase']]))

pa = feat[M].groupby(["grp", "subject"])[['threshold', 'rheobase']].agg(["count", "mean"]).round(2)
print("\nPer mouse (count of neurons, mean):")
print(pa.to_string())

print("\nRheobase values (pA) by group:", {g: feat.loc[m, "rheobase"].value_counts().sort_index().to_dict() for g, m in [("C", mC), ("NC", mNC)]})
           n_C  mean_C  sd_C  n_NC  mean_NC  sd_NC        p
feature                                                    
threshold   47  -33.12 4.547    44   -36.77  6.023 6.47e-04
rheobase    47   62.45 36.31    44    42.05  34.05 1.13e-03

Per mouse (count of neurons, mean):
            threshold        rheobase        
                count   mean    count    mean
grp subject                                  
C   CG134           2 -29.80        2   35.00
    CG135           1 -29.54        1   55.00
    CG154           4 -30.79        4   60.00
    CG171           2 -33.21        2   50.00
    CG180           3 -33.34        3   61.67
    CG209           2 -32.40        2  100.00
    CG211           6 -32.23        6   72.50
    CG250           1 -31.14        1   50.00
    CG268           1 -35.95        1   80.00
    CG269           3 -30.03        3  110.00
    CG337           1 -37.51        1   30.00
    CG355           3 -32.10        3   53.33
    CG381           4 -35.09        4   75.00
    CG383           2 -33.26        2   45.00
    CG398           1 -38.09        1  100.00
    CG439           1 -30.18        1  140.00
    CG440           1 -27.40        1   30.00
    CG539           1 -40.70        1   40.00
    CG590           2 -36.71        2   35.00
    CG596           3 -34.14        3   23.33
    CG608           3 -36.60        3   53.33
NC  CG380           1 -47.13        1   15.00
    CG398           3 -36.39        3   48.33
    CG406           3 -40.34        3   23.33
    CG440           1 -46.18        1   30.00
    CG475           1 -50.19        1   30.00
    CG543           1 -45.52        1   20.00
    CG562           3 -38.63        3   36.67
    CG590           6 -36.01        6   83.33
    CG596           2 -34.12        2   45.00
    CG608          15 -36.44       15   32.67
    CG609           8 -31.49        8   43.75

Rheobase values (pA) by group: {'C': {20.0: 4, 25.0: 1, 30.0: 7, 40.0: 8, 45.0: 2, 50.0: 2, 55.0: 1, 60.0: 4, 80.0: 8, 85.0: 1, 100.0: 4, 120.0: 2, 130.0: 1, 140.0: 1, 180.0: 1}, 'NC': {10.0: 3, 15.0: 1, 20.0: 8, 30.0: 7, 35.0: 1, 40.0: 12, 50.0: 7, 60.0: 2, 100.0: 1, 150.0: 1, 200.0: 1}}

Result: partially reproduced. All four means are within tolerance: threshold -33.12 mV (cholinergic) and -36.77 mV (noncholinergic), rheobase 62.45 and 42.05 pA. The threshold test holds (p = 6.5e-4, cholinergic more depolarized). The rheobase is larger in cholinergic neurons, but p = 1.1e-3, just above the paper's 0.001. The SDs are 4.55 and 6.02 mV (paper 4.6 and 6.3) and 36.3 and 34.1 pA (paper 41.2 and 33.2). The rheobase can only take the step values of each file, which are 5 to 100 pA apart. One cholinergic and one noncholinergic neuron fire no spike up to 200 pA and have no rheobase.

fig2d-mouse-ahp¶

Mouse cholinergic BLA-projecting neurons have a larger AHP (28.9 +- 8.3 against 12.4 +- 6.1 mV) and a wider AHP (177.9 +- 89.3 against 85.0 +- 118.6 ms) than noncholinergic ones.

In [14]:
print(show(mouse.loc[['ahp_amp', 'ahp_width', 'ahp_width_to_end', 'ahp_amp_code', 'ahp_width_code']]))

pa = feat[M].groupby(["grp", "subject"])[['ahp_amp', 'ahp_width']].agg(["count", "mean"]).round(2)
print("\nPer mouse (count of neurons, mean):")
print(pa.to_string())

# AHP width (Methods' window) against the latency of the first spike, and whether the potential recrosses
# the half-amplitude level within the 100 ms window; without a recrossing the width runs to the end of the step
print("\nAHP width (Methods' window): neurons whose potential does not recross within 100 ms, and the width by recrossing:")
aw = feat.loc[M & feat.ahp_width.notna(), ["grp", "subject", "latency", "ahp_width", "ahp_width_recross", "ahp_width_code"]].copy()
aw["ahp_width_recross"] = aw.ahp_width_recross.astype(bool)
aw["latency_plus_width"] = aw.latency + aw.ahp_width
print(aw.groupby(["grp", "ahp_width_recross"]).agg(n=("ahp_width", "size"), width_mean=("ahp_width", "mean"),
      width_min=("ahp_width", "min"), width_max=("ahp_width", "max"), latency_mean=("latency", "mean"),
      latency_plus_width_mean=("latency_plus_width", "mean")).round(1).to_string())
from scipy.stats import spearmanr
for g in ["C", "NC"]:
    d = aw[(aw.grp == g) & ~aw.ahp_width_recross]
    print(f"{g}, not recrossing: Spearman correlation of AHP width with spike latency rho = {spearmanr(d.latency, d.ahp_width)[0]:.3f} (n = {len(d)})")
rc = aw.ahp_width_recross
print("\nVariant (not deciding), the neurons that recross within the window only:")
print(show(nbmsi.ranksum_table(feat.loc[aw[rc].index], mC[aw[rc].index], mNC[aw[rc].index], ["ahp_width"])))
print("\nPer neuron, sorted by group and latency (ms):")
print(aw.sort_values(["grp", "latency"]).assign(identifier=info.identifier[aw.sort_values(["grp", "latency"]).index].str[:28].values)
      .round(1).to_string())

print("\nLast sweep of a repeated amplitude:")
print(show(mouse_last.loc[["ahp_amp", "ahp_width", "ahp_amp_code", "ahp_width_code"]]))
                  n_C  mean_C  sd_C  n_NC  mean_NC  sd_NC        p
feature                                                           
ahp_amp            47   31.26 7.843    44    16.35  4.498 2.51e-13
ahp_width          47   183.1 125.6    43    298.9  140.3 4.07e-05
ahp_width_to_end   47     160 102.9    43    226.3    131 1.74e-02
ahp_amp_code       47   30.06 7.364    44    12.14  6.144 4.14e-14
ahp_width_code     47   184.3 87.84    44    77.38  92.85 5.20e-08

Per mouse (count of neurons, mean):
            ahp_amp        ahp_width        
              count   mean     count    mean
grp subject                                 
C   CG134         2  22.68         2  132.65
    CG135         1  29.35         1   35.50
    CG154         4  32.13         4  130.15
    CG171         2  38.30         2  219.25
    CG180         3  27.60         3  174.17
    CG209         2  31.97         2  337.70
    CG211         6  33.21         6  183.87
    CG250         1  38.38         1  129.50
    CG268         1  27.84         1  335.10
    CG269         3  34.68         3  242.87
    CG337         1  33.15         1   63.50
    CG355         3  36.32         3  264.73
    CG381         4  28.30         4  163.52
    CG383         2  27.07         2   42.60
    CG398         1  16.10         1    2.40
    CG439         1  28.54         1   18.50
    CG440         1  37.27         1  221.90
    CG539         1  22.20         1  238.80
    CG590         2  29.95         2  213.60
    CG596         3  33.47         3  294.13
    CG608         3  33.08         3  154.20
NC  CG380         1  14.70         1  344.50
    CG398         3  17.39         3  334.03
    CG406         3  16.24         3  209.27
    CG440         1  12.17         1  313.90
    CG475         1  12.73         1   82.10
    CG543         1  12.63         1  414.20
    CG562         3  17.98         3  270.33
    CG590         6  16.03         5  256.92
    CG596         2  18.14         2  358.90
    CG608        15  17.50        15  376.00
    CG609         8  14.67         8  201.82

AHP width (Methods' window): neurons whose potential does not recross within 100 ms, and the width by recrossing:
                        n  width_mean  width_min  width_max  latency_mean  latency_plus_width_mean
grp ahp_width_recross                                                                             
C   False              43       199.2        4.6      439.7         296.3                    495.5
    True                4         9.9        2.4       18.5         141.4                    151.3
NC  False              35       354.7       11.5      448.6         140.9                    495.6
    True                8        54.8        0.5       85.4         166.5                    221.3
C, not recrossing: Spearman correlation of AHP width with spike latency rho = -0.996 (n = 43)
NC, not recrossing: Spearman correlation of AHP width with spike latency rho = -0.990 (n = 35)

Variant (not deciding), the neurons that recross within the window only:
           n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                 
ahp_width    4   9.875 6.638    8   54.85 30.29 5.08e-02

Per neuron, sorted by group and latency (ms):
   grp subject  latency  ahp_width  ahp_width_recross  ahp_width_code  latency_plus_width                    identifier
i                                                                                                                      
32   C   CG381      8.0       10.1               True             6.4                18.1                   20220421-04
44   C   CG439     26.5       18.5               True            11.5                45.0                   20220719-03
24   C   CG269     58.8      439.7              False           178.4               498.5               20211202-03-BLA
37   C   CG398     87.7        2.4               True            28.2                90.1                   20220607-10
16   C   CG211    127.3      371.1              False           251.6               498.4               20210901-09 BLA
12   C   CG209    130.8      366.9              False           197.7               497.7               20210831-05 BLA
4    C   CG154    133.1      364.2              False           269.1               497.3               20210707-02 BLA
85   C   CG608    154.9      337.6              False           284.0               492.5  CG609_FL_S6RC1_B+G+_-67mV.ma
28   C   CG355    161.4      335.5              False           199.9               496.9               20220317-04 BLA
22   C   CG268    161.8      335.1              False            44.6               496.9               20211129-01 BLA
31   C   CG381    163.2      333.4              False           174.3               496.6                   20220421-05
66   C   CG596    185.1      312.8              False           171.0               497.9  2023_09_01_0012 CG596 NBM S1
64   C   CG596    185.7      310.7              False           289.9               496.4  2023_09_01_0037 CG596 NBM S1
13   C   CG209    189.3      308.5              False           252.1               497.8               20210831-03 BLA
1    C   CG134    191.8      256.8              False           375.2               448.6               20210520-02 BLA
19   C   CG211    206.8      280.2              False           147.7               487.0               20210901-02 BLA
59   C   CG590    206.8      286.8              False           132.8               493.6  2023_08_31_0018 CG590 NBM S1
7    C   CG171    214.6      282.9              False           161.2               497.5               20210804-01 BLA
27   C   CG355    216.0      282.0              False           246.3               498.0               20220317-03 BLA
63   C   CG596    234.1      258.9              False           151.0               493.0  2023_09_01_0023 CG596 NBM S1
11   C   CG180    251.6      246.5              False           170.2               498.1               20210814-06 BLA
48   C   CG539    256.6      238.8              False           171.1               495.4                20230628-05 FL
9    C   CG180    269.6      228.3              False            11.3               497.9               20210814-04 BLA
46   C   CG440    274.6      221.9              False           252.7               496.5                   20220720-01
15   C   CG211    287.8      210.5              False           188.6               498.3               20210901-10 BLA
29   C   CG355    321.1      176.7              False           178.3               497.8               20220317-02 BLA
33   C   CG381    327.6      169.9              False           134.0               497.5                   20220421-01
25   C   CG269    334.0      163.9              False           270.7               497.9               20211202-02-BLA
8    C   CG171    341.4      155.6              False           226.2               497.0               20210804-03 BLA
58   C   CG590    355.8      140.4              False           279.1               496.2  2023_08_31_0051 CG590 NBM S1
34   C   CG381    356.8      140.7              False           233.2               497.5                   20220421-03
21   C   CG250    366.6      129.5              False           232.6               496.1               20211115-05 BLA
23   C   CG269    370.4      125.0              False           301.2               495.4               20211202-01-BLA
20   C   CG211    373.9      124.0              False           187.5               497.9               20210901-07 BLA
18   C   CG211    386.0      111.7              False           214.8               497.7               20210901-03 BLA
76   C   CG608    409.8       87.2              False           109.9               497.0  CG608_FL_S4C7_B+G+_-63mV.mat
6    C   CG154    411.9       85.5              False           273.3               497.4               20210707-06 BLA
35   C   CG383    417.8       79.8              False           204.7               497.6                   20220602-07
5    C   CG154    432.0       66.3              False           174.0               498.3               20210707-07 BLA
26   C   CG337    434.6       63.5              False           223.1               498.1               20220223-02 BLA
0    C   CG134    443.5        8.5               True             9.7               452.0               20210520-03 BLA
10   C   CG180    450.3       47.7              False           121.7               498.0               20210814-03 BLA
84   C   CG608    458.7       37.8              False           158.4               496.5  CG609_FL_S7LC4_B+G+_-62mV.ma
2    C   CG135    460.2       35.5              False            19.9               495.7               20210518-02 BLA
3    C   CG154    484.5        4.6              False           224.5               489.1               20210707-03 BLA
17   C   CG211    492.3        5.7              False           261.0               498.0               20210901-06 BLA
36   C   CG383    492.3        5.4              False           256.9               497.7                   20220602-06
78  NC   CG608     48.3      448.6              False           101.7               496.9  2023_09_20_0056 R+G- RMP-61.
56  NC   CG590     49.4      448.6              False           131.9               498.0                     FL_S4R_C6
75  NC   CG608     50.3      448.0              False           121.8               498.3  2023_09_20_0036 R+G- RMP -54
57  NC   CG590     60.9       37.9               True             9.8                98.8                     FL_S4R_C3
53  NC   CG590     60.9      436.3              False             9.0               497.2                     FL_S4R_C4
93  NC   CG609     65.5        0.5               True             2.2                66.0  CG609_FL_S7RC3_B+G-_-57mV.ma
72  NC   CG608     68.2      429.7              False           185.1               497.9  CG608_FL_S3LC5_B+G-_-64mV.ma
52  NC   CG562     77.4       85.4               True            85.4               162.8                  20230801_001
49  NC   CG543     84.0      414.2              False           199.5               498.2                   20230705-01
83  NC   CG608     84.2      413.1              False            76.1               497.3  2023_09_20_0076 R+G- RMP-52.
69  NC   CG608     84.7      412.7              False           492.9               497.4  2023_09_20_0012 R+G- RMP-61.
88  NC   CG609     85.1       73.1               True            73.1               158.2  2023_09_21_0006 R+G- RMP-41.
80  NC   CG608     87.4      411.0              False             6.1               498.4  CG608_FL_S3LC3_B+G-_-56mV.ma
79  NC   CG608     88.6      408.2              False            84.3               496.8  2023_09_20_0116 R+G- RMP-50.
73  NC   CG608     93.7      403.6              False             4.9               497.3  2023_09_20_0105 R+G- RMP-70.
39  NC   CG398     95.3      402.6              False             3.9               497.9                   20220607-08
91  NC   CG609     95.6      401.4              False             3.4               497.0  2023_09_21_0038 R+G- RMP-62.
86  NC   CG609    102.7       74.4               True            74.4               177.1  2023_09_21_0051 R+G- RMP-60.
62  NC   CG596    107.9      388.5              False            94.3               496.4  2023_09_01_0054 CG596 NBM S1
51  NC   CG562    112.1      385.9              False            95.7               498.0                  20230801_003
50  NC   CG562    113.0      339.7              False             2.6               452.7                  20230801_002
40  NC   CG398    126.7      372.2              False           131.9               498.9                   20220607-09
77  NC   CG608    127.3      370.7              False             6.6               498.0  2023_09_20_0026 R+G- RMP-54.
92  NC   CG609    131.2      365.5              False             1.3               496.7  2023_09_21_0025 R+G- RMP-48.
67  NC   CG608    133.2      362.9              False             2.6               496.1  2023_09_20_0088 R+G- RMP-65.
89  NC   CG609    136.7      359.8              False           204.4               496.5  CG609_FL_S7LC4_B+G-_-76mV.ma
71  NC   CG608    140.8      356.0              False           121.8               496.8  2023_09_20_0124 R+G- RMP-61.
81  NC   CG608    148.0      348.9              False             2.0               496.9  2023_09_20_0131 R+G- RMP-61.
30  NC   CG380    153.8      344.5              False           186.2               498.3                   20220601-09
61  NC   CG590    160.7      334.8              False             1.8               495.5                     FL_S4R_C5
87  NC   CG609    168.6      328.4              False           270.4               497.0  2023_09_21_0054 R+G- RMP-48.
65  NC   CG596    168.8      329.3              False            13.5               498.1  2023_09_01_0074 CG596 NBM S2
68  NC   CG608    173.7      324.7              False           103.6               498.4  CG608_FL_S3LC2_B+G-_-44mV.ma
45  NC   CG440    184.2      313.9              False           100.1               498.1                   20220720-03
41  NC   CG406    198.4      298.5              False            84.4               496.9  2022_06_22_0009 NSD RB+G-.ab
43  NC   CG406    227.1      270.9              False            56.1               498.0  2022_06_22_0016 NSD RB+G-.ab
74  NC   CG608    234.4      264.3              False            53.3               498.7  2023_09_20_0041 R+G- RMP-56.
47  NC   CG475    239.5       82.1               True            30.6               321.6                   20220901-03
82  NC   CG608    240.3      237.6              False             6.9               477.9  2023_09_20_0000 R+G- RMP -63
42  NC   CG406    266.9       58.4               True            38.0               325.3                   20220622-01
38  NC   CG398    271.0      227.3              False            71.2               498.3                   20220607-07
54  NC   CG590    433.9       27.0               True            27.0               460.9                     FL_S4R_C1
90  NC   CG609    484.5       11.5              False            32.4               496.0  2023_09_21_0014 R+G- RMP-76.

Last sweep of a repeated amplitude:
                n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                      
ahp_amp          47   31.26 7.843   44   16.35 4.501 2.51e-13
ahp_width        47   183.1 125.6   43   298.8 140.3 4.07e-05
ahp_amp_code     47   30.06 7.364   44   12.14 6.144 4.14e-14
ahp_width_code   47   184.3 87.84   44   77.38 92.85 5.20e-08

Result: not reproduced. With the Methods' window (rheobase step, 100 ms after threshold) the AHP amplitude is larger in cholinergic neurons (31.26 against 16.35 mV, p = 2.5e-13), with the cholinergic mean within tolerance and the noncholinergic mean outside it (11.16 to 13.64 mV). The AHP width, with its crossings searched within the 100 ms window as F14 says, is longer in noncholinergic neurons (298.9 against 183.1 ms, p = 4.1e-5), the opposite of the paper; with the crossings searched to the end of the step it is 226.3 against 160.0 ms (p = 0.017), the same way. The width test does not hold, so the criterion's tests do not both hold. The code's window (the first step with two spikes) gives 30.06 and 12.14 mV and 184.3 and 77.4 ms, all four within tolerance, with p = 4.1e-14 and 5.2e-8: the paper's values match the code's window, not the Methods'. The reversal comes from how the width is measured: in 43 of 47 cholinergic and 35 of 43 noncholinergic neurons the potential does not recross the half-amplitude level within the 100 ms window, so the width runs to the end of the analysed 500 ms, and spike latency plus width is 495.5 and 495.6 ms on average; in these neurons the width falls with the latency of the first spike (Spearman rho = -0.996 and -0.990). Noncholinergic neurons fire their first spike earlier (mean latency 140.9 against 296.3 ms in these neurons), so they get the longer widths. In the 4 cholinergic and 8 noncholinergic neurons that recross within the window the width is 9.9 against 54.8 ms (p = 0.051). Whether the claims file should judge the AHP on the code's window, and what span F14 should use, is asked of a reader.

fig2d-mouse-adaptation¶

Mouse cholinergic BLA-projecting neurons have a higher adaptation index than noncholinergic ones (0.83 +- 0.56 against 0.64 +- 0.29).

In [15]:
print(show(mouse.loc[['adaptation', 'adaptation_most']]))

print("\nLast sweep of a repeated amplitude:")
print(show(mouse_last.loc[["adaptation", "adaptation_most"]]))
                 n_C  mean_C   sd_C  n_NC  mean_NC  sd_NC        p
feature                                                           
adaptation        44  0.6172 0.5444    42   0.5527 0.3308 8.62e-01
adaptation_most   44  0.8748 0.5862    43   0.6062 0.2961 1.07e-02

Last sweep of a repeated amplitude:
                 n_a  mean_a   sd_a  n_b  mean_b   sd_b        p
feature                                                         
adaptation        44  0.6185 0.5501   42  0.5161 0.3592 6.69e-01
adaptation_most   44  0.8748 0.5862   43  0.6062 0.2961 1.07e-02

Result: reproduced. On the step with the most spikes (reading b) the adaptation index is 0.875 +- 0.586 for cholinergic and 0.606 +- 0.296 for noncholinergic neurons (paper 0.83 and 0.64, both within tolerance), p = 0.011. On the 200 pA step (reading a) it is 0.617 against 0.553, p = 0.86, which does not hold.

fig2d-mouse-passive¶

Mouse cholinergic BLA-projecting neurons have a more depolarized resting potential (-54.4 +- 8.4 against -58.7 +- 8.2 mV) and a longer membrane time constant (34.6 +- 14.3 against 22.3 +- 9.8 ms) than noncholinergic ones.

In [16]:
print(show(mouse.loc[['tau', 'tau_code']]))

print("\nF1 from the file names (subset; not the paper's neurons as a whole):")
print(show(nbmsi.ranksum_table(feat, mC, mNC, ["rmp_name"])))

pa = feat[M].groupby(["grp", "subject"])[['tau']].agg(["count", "mean"]).round(2)
print("\nPer mouse (count of neurons, mean):")
print(pa.to_string())

# Quality of the tau fits: fraction of the variance of the trace (2 to 500 ms of the -20 pA step) the fit explains
print("\nFit R^2 of tau, per group: median, minimum; neurons with R^2 < 0.9:")
print(feat.groupby(["species", "grp"]).tau_r2.agg(["median", "min", lambda x: int((x < 0.9).sum())]).round(3).to_string())
good = feat.tau_r2 >= 0.9
print("\nVariant (not deciding), tau from the fits with R^2 >= 0.9 only:")
print(show(nbmsi.ranksum_table(feat[good], mC[good], mNC[good], ["tau"])))
out = feat[M & (feat.tau > 100)].sort_values("tau", ascending=False)
print("\nMouse neurons with tau above 100 ms:")
print(out[["grp", "subject", "tau", "tau_r2", "tau_code", "rin"]].assign(identifier=info.identifier[out.index].values).round(3).to_string())
pre_ = int(nbmsi.PRE_MS / nbmsi.DT)
show_i = list(out.index[:3])
if show_i:
    fig, ax = plt.subplots(1, len(show_i), figsize=(3.2 * len(show_i), 2.6), squeeze=False)
    for a, i in zip(ax[0], show_i):
        s20 = nbmsi._step_traces(cells[i])[1][-20.0]
        v = s20["v"]; tt = (np.arange(len(v)) - pre_) * nbmsi.DT
        a.plot(tt, v, lw=0.6)
        a.set_title(f"{info.identifier[i][:18]}\ntau {feat.tau[i]:.0f} ms, R2 {feat.tau_r2[i]:.2f}", fontsize=8)
        a.set_xlabel("ms from step onset")
        print(f"{info.identifier[i]}: -20 pA trace {v.min():.1f} to {v.max():.1f} mV, inside the axes")
    ax[0][0].set_ylabel("V (mV)")
    plt.show()
          n_C  mean_C  sd_C  n_NC  mean_NC  sd_NC        p
feature                                                   
tau        47   39.92 26.67    45    28.59  19.85 3.23e-03
tau_code   47   34.88 14.52    45    22.04  10.19 2.68e-06

F1 from the file names (subset; not the paper's neurons as a whole):
          n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                
rmp_name    8  -54.72 7.907   27  -58.53 8.618 3.56e-01

Per mouse (count of neurons, mean):
              tau        
            count    mean
grp subject              
C   CG134       2   43.16
    CG135       1  153.86
    CG154       4   48.22
    CG171       2   35.11
    CG180       3   44.32
    CG209       2   33.32
    CG211       6   54.74
    CG250       1   67.63
    CG268       1   10.59
    CG269       3   26.79
    CG337       1   19.40
    CG355       3   34.41
    CG381       4   23.07
    CG383       2   20.94
    CG398       1    5.18
    CG439       1    6.87
    CG440       1   27.22
    CG539       1   36.76
    CG590       2   46.53
    CG596       3   38.29
    CG608       3   48.46
NC  CG380       1   26.39
    CG398       3   23.67
    CG406       3   57.07
    CG440       1   15.38
    CG475       1   51.42
    CG543       1    9.78
    CG562       3   25.61
    CG590       7   29.94
    CG596       2   20.92
    CG608      15   21.99
    CG609       8   35.38

Fit R^2 of tau, per group: median, minimum; neurons with R^2 < 0.9:
             median    min  <lambda_0>
species grp                           
macaque C     0.946  0.146          13
        NC    0.815  0.192           7
mouse   C     0.837  0.094          33
        NC    0.909  0.148          21

Variant (not deciding), tau from the fits with R^2 >= 0.9 only:
         n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                               
tau       14   47.02    13   24   33.97 19.78 5.12e-03

Mouse neurons with tau above 100 ms:
   grp subject      tau  tau_r2  tau_code      rin       identifier
i                                                                  
2    C   CG135  153.855   0.827    59.545  496.668  20210518-02 BLA
18   C   CG211  116.552   0.837    57.097  303.291  20210901-03 BLA
20210518-02 BLA: -20 pA trace -67.3 to -56.3 mV, inside the axes
20210901-03 BLA: -20 pA trace -70.5 to -63.7 mV, inside the axes
No description has been provided for this image

Result: not reproduced. The resting potential is not in the data, so the claim is judged on tau. Tau on the -20 pA step is longer in cholinergic neurons (39.92 against 28.59 ms), but p = 3.2e-3, not below the paper's 0.0001, and both means are above their tolerance (31.14 to 38.06 and 20.07 to 24.53 ms), so tau does not hold. The code's step (the most negative unsaturated step from -50 to 0 pA) gives 34.88 against 22.04 ms, both within tolerance, p = 2.7e-6. The fits on the -20 pA step explain a median 84% (cholinergic) and 91% (noncholinergic) of the variance of the trace, and 33 cholinergic and 21 noncholinergic fits explain less than 90%; the two mouse neurons with tau above 100 ms (153.9 and 116.6 ms) have R^2 of 0.83 and 0.84. Keeping only the fits with R^2 of 0.9 or more (14 cholinergic and 24 noncholinergic neurons), tau is 47.02 against 33.97 ms, p = 5.1e-3, which does not hold either. For the 8 cholinergic and 27 noncholinergic neurons whose file name gives a resting potential, it is -54.72 against -58.53 mV, close to the paper's values, but not different (p = 0.36).

figs2-2-mouse-amplitude-cv-sag¶

In mouse, spike amplitude, the CV of interspike intervals and sag also differ between cholinergic and noncholinergic BLA-projecting neurons, with cholinergic neurons having larger spikes, a lower CV and a smaller sag.

In [17]:
print(show(mouse.loc[['amplitude', 'cv_isi', 'cv_isi_most', 'sag', 'sag_60']]))

print("\nLast sweep of a repeated amplitude:")
print(show(mouse_last.loc[["cv_isi", "cv_isi_most"]]))
             n_C  mean_C   sd_C  n_NC  mean_NC  sd_NC        p
feature                                                       
amplitude     47   59.65  8.221    44    53.35  6.594 5.38e-05
cv_isi        47  0.1832 0.2155    43   0.2745 0.1835 1.11e-02
cv_isi_most   47  0.1901 0.2072    44   0.3165 0.1739 1.27e-03
sag           48   1.859  1.798    45    3.185  2.231 1.78e-03
sag_60        47     1.8  1.791    45    3.008  2.353 1.09e-02

Last sweep of a repeated amplitude:
             n_a  mean_a   sd_a  n_b  mean_b   sd_b        p
feature                                                     
cv_isi        47  0.1822 0.2151   43    0.31 0.2233 2.56e-03
cv_isi_most   47  0.1901 0.2072   44  0.3165 0.1739 1.27e-03

Result: reproduced. Spike amplitude is larger in cholinergic neurons (59.65 against 53.35 mV, p = 5.4e-5, within the figure's p <= 0.001). The CV of the interspike intervals is lower in cholinergic neurons on the step with the most spikes (0.190 against 0.317, p = 1.3e-3, within p <= 0.01); on the 200 pA step p = 0.011. Sag is smaller in cholinergic neurons (1.86 against 3.19 mV, p = 1.8e-3, within p <= 0.01). The sag rests on the claims file's rule for a saturated -60 pA response: in two cholinergic and five noncholinergic mouse neurons that response is clipped at -100 or -105.5 mV for 1144 to 4793 samples, and the next step up is used. On the -60 pA step whatever its response the sag is 1.80 against 3.01 mV, p = 0.011. The reading of saturation as 1000 or more consecutive identical samples is an assumption, as the code's own test cannot fire as written, and the outcome rests on it: without it the sag misses the figure's 0.01.

fig2c-mouse-umap-separation¶

A UMAP of the 18 electrophysiological features separates mouse cholinergic from noncholinergic BLA-projecting neurons almost completely, with only two neurons on the wrong side of the boundary.

UMAP procedure U of the claims file on the 17 computable features (Methods readings), 10 seeds, 1000 label permutations per seed, under both readings of missing values.

In [18]:
U17 = ["sag", "rin", "tau", "rheobase", "threshold", "amplitude", "width", "latency", "upstroke", "downstroke", "ahp_amp", "ahp_latency", "ahp_width", "fi_slope", "max_rate", "adaptation", "cv_isi"]
def umap_runs(mask, ylab, seed):
    rng = np.random.default_rng(seed)
    X = feat.loc[mask, U17].to_numpy(float)
    y = (feat.loc[mask, "grp"] if ylab == "grp" else feat.loc[mask, "species"]).to_numpy()
    out = {}
    for miss in ["drop", "impute"]:
        out[miss] = nbmsi.umap_separation(X, y, miss, range(10), 1000, rng)
    return out

t0 = time.time()
u_mouse = umap_runs(M, "grp", 20)
for miss, r in u_mouse.items():
    print(f"missing values: {miss}; neurons {r.n[0]}, PCs kept {r.pcs[0]}")
    print(r.round(4).to_string(index=False))
    print("median misclassified over seeds:", r.misclassified.median(), "range", r.misclassified.min(), "to",
          r.misclassified.max(), "; seeds beating every permutation:", int((r.misclassified < r.null_min).sum()), "of 10")
print(f"{time.time() - t0:.0f} s")

# Sensitivity to the UMAP parameters (umap-learn), Methods readings, missing values dropped and imputed; 200 permutations
sens = []
for nn_, md_ in [(5, 0.3), (30, 0.3), (15, 0.1), (15, 0.5)]:
    for miss in ["drop", "impute"]:
        r = nbmsi.umap_separation(feat.loc[M, U17].to_numpy(float), feat.loc[M, "grp"].to_numpy(), miss, range(10), 200,
                                  np.random.default_rng(21), n_neighbors=nn_, min_dist=md_)
        sens.append({"n_neighbors": nn_, "min_dist": md_, "missing": miss, "median misclassified": r.misclassified.median(),
                     "range": f"{r.misclassified.min()} to {r.misclassified.max()}",
                     "seeds beating every permutation": int((r.misclassified < r.null_min).sum())})
print("\nSensitivity to the UMAP parameters:")
print(pd.DataFrame(sens).to_string(index=False))
/home/runner/work/_temp/executed/.venv/lib/python3.13/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
missing values: drop; neurons 85, PCs kept 14
 seed  n  pcs  misclassified  null_min  null_median  p_perm
    0 85   14              4        23         38.0   0.001
    1 85   14              4        26         37.0   0.001
    2 85   14              4        26         38.0   0.001
    3 85   14              6        27         38.0   0.001
    4 85   14              4        24         37.0   0.001
    5 85   14              5        24         38.0   0.001
    6 85   14              6        25         37.0   0.001
    7 85   14              4        26         38.0   0.001
    8 85   14              4        27         38.0   0.001
    9 85   14              5        26         37.0   0.001
median misclassified over seeds: 4.0 range 4 to 6 ; seeds beating every permutation: 10 of 10
missing values: impute; neurons 93, PCs kept 15
 seed  n  pcs  misclassified  null_min  null_median  p_perm
    0 93   15              8        28         41.0   0.001
    1 93   15              9        29         41.0   0.001
    2 93   15              9        29         41.0   0.001
    3 93   15              8        30         41.0   0.001
    4 93   15              8        26         41.0   0.001
    5 93   15              9        30         41.0   0.001
    6 93   15              8        30         42.0   0.001
    7 93   15              8        26         41.0   0.001
    8 93   15             10        31         41.0   0.001
    9 93   15             10        28         41.0   0.001
median misclassified over seeds: 8.5 range 8 to 10 ; seeds beating every permutation: 10 of 10
29 s
Sensitivity to the UMAP parameters:
 n_neighbors  min_dist missing  median misclassified   range  seeds beating every permutation
           5       0.3    drop                   7.0  6 to 9                               10
           5       0.3  impute                  10.5 8 to 12                               10
          30       0.3    drop                   4.0  3 to 6                               10
          30       0.3  impute                   8.0  7 to 9                               10
          15       0.1    drop                   5.0  4 to 6                               10
          15       0.1  impute                   9.0 8 to 12                               10
          15       0.5    drop                   4.5  3 to 6                               10
          15       0.5  impute                   8.0 6 to 10                               10

Result: not reproduced. The UMAP separates the groups better than every one of the 1000 label permutations for all 10 seeds, under both readings of missing values, but a linear boundary in the UMAP plane misclassifies a median of 4 neurons (range 4 to 6, of 85) when neurons with missing values are dropped and 8.5 (8 to 10, of 93) when they are imputed, not the paper's 2. With n_neighbors 5 or 30, or min_dist 0.1 or 0.5, the median is 4 to 7 (dropped) and 8 to 10.5 (imputed), never 2 or fewer.

fig5a-mouse-lda-electrophysiology¶

A linear discriminant analysis of the electrophysiological features clearly separates mouse cholinergic from noncholinergic BLA-projecting neurons.

LDA procedure L: resubstitution accuracy against 1000 shuffles of each kind, both scalings and both readings of missing values; 10-fold cross-validated accuracy as a variant.

In [19]:
def lda_runs(mask, ylab, seed):
    rng = np.random.default_rng(seed)
    X = feat.loc[mask, U17].to_numpy(float)
    y = (feat.loc[mask, "grp"] if ylab == "grp" else feat.loc[mask, "species"]).to_numpy()
    return pd.DataFrame([nbmsi.lda_separation(X, y, miss, scale, 1000, rng)
                         for miss in ["drop", "impute"] for scale in ["z", "raw"]])

l_mouse = lda_runs(M, "grp", 50)
print(l_mouse.round(4).to_string(index=False))
missing scale  n  accuracy  cv10_accuracy  label_shuffle_95  label_shuffle_max  p_label  feature_shuffle_95  feature_shuffle_max  p_feature
   drop     z 85    0.9882         0.9514            0.7529             0.8353    0.001              0.7647               0.8235      0.001
   drop   raw 85    0.9882         0.9514            0.7647             0.8235    0.001              0.7647               0.8235      0.001
 impute     z 93    0.9462         0.8922            0.7419             0.8065    0.001              0.7527               0.8172      0.001
 impute   raw 93    0.9462         0.9133            0.7419             0.8172    0.001              0.7527               0.8387      0.001

Result: reproduced. The LDA classifies 98.8% of the 85 neurons with every feature (missing values dropped) and 94.6% of all 93 (missing values imputed), for both scalings, above the 95th percentile (0.74 to 0.76) and the maximum (0.81 to 0.84) of 1000 shuffles of either kind (p = 0.001). The 10-fold cross-validated accuracy, with the imputation and the scaling fitted on the training folds only, is 0.89 to 0.95.

fig5b-mouse-lda-ahp-amplitude-top¶

AHP amplitude has the highest weight in the LDA separating mouse cholinergic from noncholinergic BLA-projecting neurons.

In [20]:
for miss in ["drop", "impute"]:
    w = nbmsi.lda_weights(feat.loc[M, U17].to_numpy(float), feat.loc[M, "grp"].to_numpy(), U17, miss)
    for col in w.columns:
        top = w[col].sort_values(ascending=False).head(5)
        print(f"missing {miss}, weights {col}: top five", top.round(3).to_dict())
missing drop, weights a_abs_coef: top five {'ahp_amp': 9.499, 'width': 7.489, 'fi_slope': 6.51, 'downstroke': 3.903, 'max_rate': 3.343}
missing drop, weights b_abs_coef_x_diff: top five {'ahp_amp': 14.277, 'fi_slope': 9.219, 'max_rate': 4.615, 'rheobase': 2.314, 'latency': 2.186}
missing impute, weights a_abs_coef: top five {'ahp_amp': 6.618, 'max_rate': 1.914, 'amplitude': 1.851, 'threshold': 1.411, 'ahp_latency': 1.406}
missing impute, weights b_abs_coef_x_diff: top five {'ahp_amp': 9.791, 'max_rate': 2.487, 'amplitude': 1.41, 'latency': 1.112, 'threshold': 0.9}

Result: reproduced. AHP amplitude has the largest weight under both readings of the weights and both readings of missing values (absolute coefficient 9.50 and 6.62, next 7.49 and 1.91; coefficient times mean difference 14.28 and 9.79, next 9.22 and 2.49).

fig7d-macaque-more-excitable¶

Macaque BLA-projecting cholinergic neurons are more excitable than mouse ones, with a maximum firing rate three times larger (26.3 +- 23.1 against 7.3 +- 4.3 Hz), a rheobase a third as large (23.3 +- 16.5 against 64.3 +- 41.2 pA) and an f-I slope twice as large (0.13 +- 0.10 against 0.06 +- 0.03 Hz/pA).

In [21]:
print(show(species.loc[['max_rate', 'rheobase', 'fi_slope', 'rate_200', 'max_rate_code']]))

pq = feat[feat.grp == "C"].groupby(["species", "subject"])[["max_rate", "rheobase", "fi_slope"]].agg(["count", "mean"]).round(3)
print("\nPer animal, cholinergic neurons (count, mean):")
print(pq.to_string())
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(show(species_resc.loc[['max_rate', 'rheobase', 'fi_slope']]))
               n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                                   
max_rate              45         21.47       19.16       48       6.917     4.227 7.16e-12
rheobase              45         22.33       12.14       47       62.45     36.31 6.07e-11
fi_slope              45        0.1217      0.1012       47     0.05826   0.03081 9.31e-06
rate_200              44         21.05       19.75       47       6.809     4.327 2.45e-09
max_rate_code         45         24.04       22.64       48       7.042     4.125 2.63e-12

Per animal, cholinergic neurons (count, mean):
                     max_rate         rheobase          fi_slope       
                        count    mean    count     mean    count   mean
species subject                                                        
macaque M#11 Aamir          4  11.000        4   28.750        4  0.047
        M#15 A11E083        7  26.857        7   28.571        7  0.158
        M#19_29511          2  48.000        2   15.000        2  0.229
        M#21                5  18.800        5   20.000        5  0.095
        M22                23  21.304       23   20.870       23  0.118
        M24                 4  13.500        4   20.000        4  0.131
mouse   CG134               2   6.000        2   35.000        2  0.049
        CG135               1   4.000        1   55.000        1  0.021
        CG154               4   6.000        4   60.000        4  0.037
        CG171               2   7.000        2   50.000        2  0.039
        CG180               3   4.667        3   61.667        3  0.048
        CG209               3   3.333        2  100.000        2  0.095
        CG211               6   6.000        6   72.500        6  0.046
        CG250               1   6.000        1   50.000        1  0.037
        CG268               1   2.000        1   80.000        1  0.100
        CG269               3   4.000        3  110.000        3  0.081
        CG337               1   8.000        1   30.000        1  0.051
        CG355               3   6.000        3   53.333        3  0.057
        CG381               4   7.000        4   75.000        4  0.057
        CG383               2   6.000        2   45.000        2  0.047
        CG398               1   6.000        1  100.000        1  0.054
        CG439               1  14.000        1  140.000        1  0.170
        CG440               1  10.000        1   30.000        1  0.050
        CG539               1  12.000        1   40.000        1  0.065
        CG590               2  15.000        2   35.000        2  0.098
        CG596               3  12.667        3   23.333        3  0.068
        CG608               3   7.333        3   53.333        3  0.039

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
          n_a  mean_a   sd_a  n_b  mean_b    sd_b        p
feature                                                   
max_rate   46    22.3  19.78   48   6.917   4.227 4.36e-12
rheobase   46   22.07  12.14   47   62.45   36.31 3.62e-11
fi_slope   46  0.1251 0.1028   47 0.05826 0.03081 5.59e-06

Result: partially reproduced. All three tests hold in the reported direction at p < 0.0001: maximum rate 21.47 against 6.92 Hz (p = 7.2e-12), rheobase 22.33 against 62.45 pA (p = 6.1e-11), f-I slope 0.122 against 0.058 Hz/pA (p = 9.3e-6). The rheobase and both f-I slopes are within tolerance; the macaque maximum rate, 21.47 Hz, is below the paper's 26.3 (tolerance 23.67 to 28.93). The code's maximum over every step, including steps above 200 pA, gives 24.04 Hz, and with the rescaled macaque file added the maximum rate is 22.3 Hz; these variants do not decide.

fig7d-macaque-threshold-ahp¶

Macaque BLA-projecting cholinergic neurons have a more hyperpolarized spike threshold (-39.7 +- 5.9 against -33.0 +- 4.6 mV), a smaller AHP (19.1 +- 8.8 against 28.9 +- 8.3 mV) and a narrower AHP (106.6 +- 71.9 against 177.9 +- 89.3 ms) than mouse ones.

In [22]:
print(show(species.loc[['threshold', 'ahp_amp', 'ahp_width', 'ahp_width_to_end', 'ahp_amp_code', 'ahp_width_code']]))

sp_aw = feat.loc[(qC | mC) & feat.ahp_width.notna()].assign(recross=lambda d: d.ahp_width_recross.astype(bool))
print("\nAHP width (Methods' window) by whether the potential recrosses within 100 ms:")
print(sp_aw.groupby(["species", "recross"]).agg(n=("ahp_width", "size"), width_mean=("ahp_width", "mean"),
      latency_mean=("latency", "mean")).round(1).to_string())
print("\nLast sweep of a repeated amplitude:")
print(show(species_last.loc[["ahp_amp", "ahp_width", "ahp_amp_code", "ahp_width_code"]]))
pq = feat[feat.grp == "C"].groupby(["species", "subject"])[["threshold", "ahp_amp", "ahp_width"]].agg(["count", "mean"]).round(2)
print("\nPer animal, cholinergic neurons (count, mean):")
print(pq.to_string())
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(show(species_resc.loc[['threshold', 'ahp_amp', 'ahp_width']]))
                  n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                                      
threshold                45        -39.42       5.632       47      -33.12     4.547 2.43e-07
ahp_amp                  45         20.76       6.378       47       31.26     7.843 6.81e-09
ahp_width                45         224.4       145.8       47       183.1     125.6 1.72e-01
ahp_width_to_end         45           187       121.2       47         160     102.9 3.21e-01
ahp_amp_code             45         19.64       7.905       47       30.06     7.364 2.34e-08
ahp_width_code           45         119.1       80.78       47       184.3     87.84 3.47e-04

AHP width (Methods' window) by whether the potential recrosses within 100 ms:
                  n  width_mean  latency_mean
species recross                              
macaque False    36       272.4         223.6
        True      9        32.5         183.0
mouse   False    43       199.2         296.3
        True      4         9.9         141.4

Last sweep of a repeated amplitude:
                n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                      
ahp_amp          45   20.76 6.378   47   31.26 7.843 6.81e-09
ahp_width        45   224.4 145.8   47   183.1 125.6 1.72e-01
ahp_amp_code     45   19.64 7.905   47   30.06 7.364 2.34e-08
ahp_width_code   45   119.1 80.78   47   184.3 87.84 3.47e-04

Per animal, cholinergic neurons (count, mean):
                     threshold        ahp_amp        ahp_width        
                         count   mean   count   mean     count    mean
species subject                                                       
macaque M#11 Aamir           4 -36.77       4  23.92         4  205.50
        M#15 A11E083         7 -38.67       7  19.01         7  332.69
        M#19_29511           2 -45.28       2  21.16         2  181.30
        M#21                 5 -37.60       5  22.75         5  152.24
        M22                 23 -40.76      23  19.41        23  225.85
        M24                  4 -35.04       4  25.79         4  157.75
mouse   CG134                2 -29.80       2  22.68         2  132.65
        CG135                1 -29.54       1  29.35         1   35.50
        CG154                4 -30.79       4  32.13         4  130.15
        CG171                2 -33.21       2  38.30         2  219.25
        CG180                3 -33.34       3  27.60         3  174.17
        CG209                2 -32.40       2  31.97         2  337.70
        CG211                6 -32.23       6  33.21         6  183.87
        CG250                1 -31.14       1  38.38         1  129.50
        CG268                1 -35.95       1  27.84         1  335.10
        CG269                3 -30.03       3  34.68         3  242.87
        CG337                1 -37.51       1  33.15         1   63.50
        CG355                3 -32.10       3  36.32         3  264.73
        CG381                4 -35.09       4  28.30         4  163.52
        CG383                2 -33.26       2  27.07         2   42.60
        CG398                1 -38.09       1  16.10         1    2.40
        CG439                1 -30.18       1  28.54         1   18.50
        CG440                1 -27.40       1  37.27         1  221.90
        CG539                1 -40.70       1  22.20         1  238.80
        CG590                2 -36.71       2  29.95         2  213.60
        CG596                3 -34.14       3  33.47         3  294.13
        CG608                3 -36.60       3  33.08         3  154.20

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
           n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                 
threshold   46  -39.69 5.865   47  -33.12 4.547 1.44e-07
ahp_amp     46   20.82 6.317   47   31.26 7.843 6.13e-09
ahp_width   46   227.5 145.6   47   183.1 125.6 1.35e-01

Result: partially reproduced. Two of the three tests hold: the macaque threshold is more hyperpolarized (-39.42 against -33.12 mV, p = 2.4e-7) and the AHP smaller (20.76 against 31.26 mV, p = 6.8e-9), both macaque means within tolerance. With the Methods' window the AHP width does not differ (224.4 against 183.1 ms, p = 0.17, macaque longer; 187.0 against 160.0 ms, p = 0.32, with the crossings searched to the end of the step). The code's window gives 119.1 against 184.3 ms (p = 3.5e-4), the macaque narrower, as in the paper, its mean just above the tolerance (95.9 to 117.3 ms). As in the mouse, the potential does not recross within the window in most neurons (36 of 45 macaque and 43 of 47 mouse), so the width mostly measures the time from the first spike to the end of the step.

fig7-macaque-spike-width¶

Macaque BLA-projecting cholinergic neurons have wider spikes than mouse ones (1.32 +- 0.45 against 1.15 +- 0.43 ms).

In [23]:
print(show(species.loc[['width']]))
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(show(species_resc.loc[['width']]))
         n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                             
width           45         1.314      0.4504       47       1.157    0.4348 1.28e-02

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
         n_a  mean_a   sd_a  n_b  mean_b   sd_b        p
feature                                                 
width     46   1.306 0.4485   47   1.157 0.4348 1.61e-02

Result: not reproduced. Spikes are wider in macaque (1.314 against 1.157 ms), both means within tolerance, but p = 0.013, not below the paper's 0.01, so the criterion's test does not hold. With the rescaled macaque file added, p = 0.016.

figs7-1-macaque-amplitude-cv-sag-upstroke¶

Macaque BLA-projecting cholinergic neurons also differ from mouse ones in spike amplitude, CV of interspike intervals, sag and upstroke, each larger in macaque, while the downstroke does not differ.

In [24]:
print(show(species.loc[['amplitude', 'cv_isi', 'cv_isi_most', 'sag', 'sag_60', 'upstroke', 'downstroke', 'downstroke_code']]))

print("\nLast sweep of a repeated amplitude:")
print(show(species_last.loc[["cv_isi", "cv_isi_most"]]))
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(show(species_resc.loc[['amplitude', 'cv_isi', 'cv_isi_most', 'sag', 'upstroke', 'downstroke', 'downstroke_code']]))
                 n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                                     
amplitude               45         65.31       10.76       47       59.65     8.221 1.83e-03
cv_isi                  44        0.4511      0.3064       47      0.1832    0.2155 1.05e-05
cv_isi_most             45         0.494       0.286       47      0.1901    0.2072 3.11e-07
sag                     45          3.64       5.315       48       1.859     1.798 9.00e-02
sag_60                  45          3.64       5.315       47         1.8     1.791 6.58e-02
upstroke                45         170.1       61.23       47       120.5     27.67 1.14e-05
downstroke              45        -54.38        25.5       47      -65.17     22.52 7.56e-03
downstroke_code         45        -54.38        25.5       47      -65.17     22.52 7.56e-03

Last sweep of a repeated amplitude:
             n_a  mean_a   sd_a  n_b  mean_b   sd_b        p
feature                                                     
cv_isi        44  0.4511 0.3064   47  0.1822 0.2151 1.05e-05
cv_isi_most   45   0.494  0.286   47  0.1901 0.2072 3.11e-07

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
                 n_a  mean_a   sd_a  n_b  mean_b   sd_b        p
feature                                                         
amplitude         46   65.26  10.65   47   59.65  8.221 1.74e-03
cv_isi            45  0.4419 0.3091   47  0.1832 0.2155 1.60e-05
cv_isi_most       46  0.4842 0.2906   47  0.1901 0.2072 6.01e-07
sag               46   3.619  5.258   48   1.859  1.798 7.49e-02
upstroke          46   170.2  60.55   47   120.5  27.67 7.08e-06
downstroke        46  -54.98  25.53   47  -65.17  22.52 1.13e-02
downstroke_code   46  -54.98  25.53   47  -65.17  22.52 1.13e-02

Result: partially reproduced. Three of the four differences hold in the stated direction at the figure's level: spike amplitude (65.31 against 59.65 mV, p = 1.8e-3), CV of the intervals (0.451 against 0.183 on the 200 pA step, p = 1.1e-5; 0.494 against 0.190 on the step with the most spikes, p = 3.1e-7) and upstroke (170.1 against 120.5 mV/ms, p = 1.1e-5). Sag does not differ (3.64 against 1.86 mV, p = 0.090; on the -60 pA step whatever its response, p = 0.066). The downstroke, which the claim says is shared, differs under both readings (-54.38 against -65.17 mV/ms, p = 7.6e-3), which also keeps the claim at most partially reproduced.

fig7-macaque-mouse-feature-count¶

Most of the 18 electrophysiological features differ between macaque and mouse BLA-projecting cholinergic neurons; the text gives the number as 15 of 18, and the figure legends imply 17.

In [25]:
print("Macaque C against mouse C, rank-sum per feature:")
print(show(species))
print("\nFeatures differing at p < 0.05 (17 features, F1 not computable):")
print(count(species, direction=DIR_SPECIES).to_string(index=False))
print("\nLast sweep of a repeated amplitude:")
print(count(species_last, direction=DIR_SPECIES).to_string(index=False))
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(count(species_resc, direction=DIR_SPECIES).to_string(index=False))
alt = species.copy()
for a_, b_ in [("rin", "rin_code"), ("tau", "tau_code"), ("latency", "latency_peak"), ("ahp_amp", "ahp_amp_code"),
               ("ahp_latency", "ahp_latency_code"), ("ahp_width", "ahp_width_code")]:
    alt.loc[a_] = species.loc[b_]
print("\nVariant, the code's choices for rin, tau, latency and the AHP (not deciding):")
print(count(alt, {"F11 a, F17/F18 a, code variants": SETS["F11 a, F17/F18 a (200 pA)"],
                  "F11 b, F17/F18 b, code variants": SETS["F11 b, F17/F18 b (most spikes)"]}, DIR_SPECIES).to_string(index=False))
Macaque C against mouse C, rank-sum per feature:
                  n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                                      
rmp                      22        -53.02       5.512        8      -54.72     7.907 9.81e-01
sag                      45          3.64       5.315       48       1.859     1.798 9.00e-02
rin                      45         593.2       357.1       47       355.5     163.7 2.93e-05
tau                      45         63.47       59.95       47       39.92     26.67 1.27e-02
rheobase                 45         22.33       12.14       47       62.45     36.31 6.07e-11
threshold                45        -39.42       5.632       47      -33.12     4.547 2.43e-07
amplitude                45         65.31       10.76       47       59.65     8.221 1.83e-03
width                    45         1.314      0.4504       47       1.157    0.4348 1.28e-02
latency                  45         215.5       125.8       47       283.1     133.1 1.65e-02
upstroke                 45         170.1       61.23       47       120.5     27.67 1.14e-05
downstroke               45        -54.38        25.5       47      -65.17     22.52 7.56e-03
ahp_amp                  45         20.76       6.378       47       31.26     7.843 6.81e-09
ahp_latency              45          43.2       31.55       47       34.83     23.15 4.87e-01
ahp_width                45         224.4       145.8       47       183.1     125.6 1.72e-01
fi_slope                 45        0.1217      0.1012       47     0.05826   0.03081 9.31e-06
max_rate                 45         21.47       19.16       48       6.917     4.227 7.16e-12
adaptation               44        0.4325      0.2988       44      0.6172    0.5444 2.29e-01
cv_isi                   44        0.4511      0.3064       47      0.1832    0.2155 1.05e-05
downstroke_code          45        -54.38        25.5       47      -65.17     22.52 7.56e-03
adaptation_most          45        0.5281      0.3478       44      0.8748    0.5862 1.61e-03
cv_isi_most              45         0.494       0.286       47      0.1901    0.2072 3.11e-07
rin_code                 45         394.4       308.3       47       335.1     138.2 3.73e-01
tau_code                 45         36.87        20.2       47       34.88     14.52 8.57e-01
latency_peak             45         216.3       125.8       47         284     133.2 1.61e-02
ahp_amp_code             45         19.64       7.905       47       30.06     7.364 2.34e-08
ahp_latency_code         45         19.19       14.88       47       29.04      19.3 1.13e-02
ahp_width_code           45         119.1       80.78       47       184.3     87.84 3.47e-04
rate_200                 44         21.05       19.75       47       6.809     4.327 2.45e-09
max_rate_code            45         24.04       22.64       48       7.042     4.125 2.63e-12
ahp_width_to_end         45           187       121.2       47         160     102.9 3.21e-01
sag_60                   45          3.64       5.315       47         1.8     1.791 6.58e-02

Features differing at p < 0.05 (17 features, F1 not computable):
                      readings  features  differing                           not differing differing against the paper's direction
     F11 a, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 a, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        
     F11 b, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 b, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        

Last sweep of a repeated amplitude:
                      readings  features  differing                           not differing differing against the paper's direction
     F11 a, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 a, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        
     F11 b, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 b, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
                      readings  features  differing                           not differing differing against the paper's direction
     F11 a, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 a, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        
     F11 b, F17/F18 a (200 pA)        17         13 sag, ahp_latency, ahp_width, adaptation                                        
F11 b, F17/F18 b (most spikes)        17         14             sag, ahp_latency, ahp_width                                        

Variant, the code's choices for rin, tau, latency and the AHP (not deciding):
                       readings  features  differing             not differing differing against the paper's direction
F11 a, F17/F18 a, code variants        17         13 sag, rin, tau, adaptation                                        
F11 b, F17/F18 b, code variants        17         14             sag, rin, tau                                        

Result: reproduced. With F1 not computable, 14 of the 17 features differ between macaque and mouse cholinergic neurons with the adaptation index and the CV on the step with the most spikes (either downstroke reading), and 13 with the 200 pA step. The criterion's range for the reading of 15 is 14 to 16, so the count of 14 is at its lower edge; the criterion does not lower the range when F1 is missing. Sag, AHP latency and AHP width do not differ under any of the four sets of readings of F11, F17 and F18; with the code's AHP window, AHP latency (p = 0.011) and AHP width (p = 3.5e-4) do differ. None of the differing features goes against the paper's direction. The last sweep of a repeated amplitude, the rescaled macaque file and the code's variants give 13 or 14. The resting potential from the file names (22 macaque and 8 mouse neurons) does not differ (p = 0.98); these subsets cannot show whether F1 would differ over all the neurons.

fig7d-macaque-input-resistance¶

Macaque BLA-projecting cholinergic neurons have a larger input resistance and a smaller rheobase than mouse ones, the opposite of what larger cells would show.

In [26]:
print(show(species.loc[['rin', 'rin_code', 'rheobase']]))
print("\nVariant (not deciding), the macaque file with the wrong scale divided by 20 and included:")
print(show(species_resc.loc[['rin', 'rheobase']]))
          n_macaque  mean_macaque  sd_macaque  n_mouse  mean_mouse  sd_mouse        p
feature                                                                              
rin              45         593.2       357.1       47       355.5     163.7 2.93e-05
rin_code         45         394.4       308.3       47       335.1     138.2 3.73e-01
rheobase         45         22.33       12.14       47       62.45     36.31 6.07e-11

Variant (not deciding), the macaque file with the wrong scale divided by 20 and included:
          n_a  mean_a  sd_a  n_b  mean_b  sd_b        p
feature                                                
rin        46   606.5 364.4   47   355.5 163.7 1.77e-05
rheobase   46   22.07 12.14   47   62.45 36.31 3.62e-11

Result: reproduced. On the -20 pA step the macaque input resistance is larger (593.2 against 355.5 MOhm, p = 2.9e-5) and the rheobase smaller (22.33 against 62.45 pA, p = 6.1e-11). The code's slope over the steps from -50 to 0 pA gives 394.4 against 335.1 MOhm, p = 0.37, which does not hold.

fig7c-macaque-mouse-umap-separation¶

A UMAP of the 18 electrophysiological features shows a strong separation between macaque and mouse BLA-projecting cholinergic neurons.

In [27]:
u_species = umap_runs(feat.grp == "C", "species", 30)
for miss, r in u_species.items():
    print(f"missing values: {miss}; neurons {r.n[0]}, PCs kept {r.pcs[0]}")
    print(r.round(4).to_string(index=False))
    print("median misclassified over seeds:", r.misclassified.median(), "range", r.misclassified.min(), "to",
          r.misclassified.max(), "; seeds beating every permutation:", int((r.misclassified < r.null_min).sum()), "of 10")
sens = []
for nn_, md_ in [(5, 0.3), (30, 0.3), (15, 0.1), (15, 0.5)]:
    for miss in ["drop", "impute"]:
        r = nbmsi.umap_separation(feat.loc[feat.grp == "C", U17].to_numpy(float), feat.loc[feat.grp == "C", "species"].to_numpy(),
                                  miss, range(10), 200, np.random.default_rng(31), n_neighbors=nn_, min_dist=md_)
        sens.append({"n_neighbors": nn_, "min_dist": md_, "missing": miss, "median misclassified": r.misclassified.median(),
                     "range": f"{r.misclassified.min()} to {r.misclassified.max()}",
                     "seeds beating every permutation": int((r.misclassified < r.null_min).sum())})
print("\nSensitivity to the UMAP parameters:")
print(pd.DataFrame(sens).to_string(index=False))
missing values: drop; neurons 88, PCs kept 14
 seed  n  pcs  misclassified  null_min  null_median  p_perm
    0 88   14             10        28         39.0   0.001
    1 88   14             10        24         39.0   0.001
    2 88   14              9        26         39.0   0.001
    3 88   14              9        27         39.0   0.001
    4 88   14              9        28         39.0   0.001
    5 88   14             10        27         39.0   0.001
    6 88   14              9        27         39.0   0.001
    7 88   14             10        26         39.0   0.001
    8 88   14              9        26         39.0   0.001
    9 88   14              9        25         39.0   0.001
median misclassified over seeds: 9.0 range 9 to 10 ; seeds beating every permutation: 10 of 10
missing values: impute; neurons 93, PCs kept 14
 seed  n  pcs  misclassified  null_min  null_median  p_perm
    0 93   14              9        27         41.0   0.001
    1 93   14              8        27         41.0   0.001
    2 93   14              9        30         42.0   0.001
    3 93   14              9        29         41.0   0.001
    4 93   14              9        29         41.0   0.001
    5 93   14             10        29         41.0   0.001
    6 93   14              9        27         41.0   0.001
    7 93   14             10        27         42.0   0.001
    8 93   14              9        27         41.0   0.001
    9 93   14              8        30         41.0   0.001
median misclassified over seeds: 9.0 range 8 to 10 ; seeds beating every permutation: 10 of 10
Sensitivity to the UMAP parameters:
 n_neighbors  min_dist missing  median misclassified   range  seeds beating every permutation
           5       0.3    drop                  10.0 9 to 12                               10
           5       0.3  impute                  10.5 7 to 12                               10
          30       0.3    drop                   8.5 7 to 10                               10
          30       0.3  impute                   9.0 7 to 11                               10
          15       0.1    drop                   9.5 9 to 11                               10
          15       0.1  impute                  10.0 7 to 11                               10
          15       0.5    drop                   9.0 9 to 11                               10
          15       0.5  impute                   9.0 8 to 10                               10

Result: blocked, methods underspecified. The separation is better than every one of the 1000 label permutations for all 10 seeds under both readings of missing values (reading b holds), but a linear boundary misclassifies a median of 9 (range 9 to 10, of 88) and 9 (8 to 10, of 93) of the neurons, not at most 2 (reading a fails). With n_neighbors 5 or 30, or min_dist 0.1 or 0.5, the median is 8.5 to 10.5. The criterion makes this case methods_underspecified: the paper does not say how strong a separation it calls strong.

Blocked claims¶

The eleven claims on morphology (Figs. 4, 5C, 9, 10, S4-1 and S9-1) need the reconstructions' features and Sholl counts. The dandiset holds only current-clamp recordings (its asset summary lists CurrentClampSeries and CurrentClampStimulusSeries, and no file holds a morphology table or image), and the paper's Data Availability Statement names only the DANDI Archive. They are blocked, data_missing.

Summary¶

Claim Outcome
sample-sizes partially reproduced
fig2-mouse-c-nc-15-of-18 reproduced
fig2d-mouse-max-firing-rate partially reproduced
fig2d-mouse-threshold-rheobase partially reproduced
fig2d-mouse-ahp not reproduced
fig2d-mouse-adaptation reproduced
fig2d-mouse-passive not reproduced
figs2-2-mouse-amplitude-cv-sag reproduced
fig2c-mouse-umap-separation not reproduced
fig5a-mouse-lda-electrophysiology reproduced
fig5b-mouse-lda-ahp-amplitude-top reproduced
fig7d-macaque-more-excitable partially reproduced
fig7d-macaque-threshold-ahp partially reproduced
fig7-macaque-spike-width not reproduced
figs7-1-macaque-amplitude-cv-sag-upstroke partially reproduced
fig7-macaque-mouse-feature-count reproduced
fig7d-macaque-input-resistance reproduced
fig7c-macaque-mouse-umap-separation blocked, methods underspecified
Eleven morphology claims (Figs. 4, 5C, 9, 10, S4-1, S9-1) blocked, data missing

A failure to reproduce here may be a failure of this attempt, not of the paper: see the reasoning and the differences from the paper's method.

How the analysis differs from the paper's. The features are re-implemented in Python from the claims file's definitions (Methods 2.5 and the paper's MATLAB code); the UMAP is umap-learn and the LDA scikit-learn's. The resting potential (F1) is not in the data, so the counts are out of 17 features. Where the Methods and the code differ, the Methods decide; the code's windows for the AHP and for tau match the paper's values much better than the Methods'. Steps above 200 pA and the short test pulses are left out, and the step onset is read from each sweep's longest run of current. Each duplicated recording is counted once, and one macaque file with a wrong scale is left out (shown rescaled as a variant). The paper's quality control cannot be repeated, as its measures are not in the files.

What was found about the dataset. The group labels in session_description give the paper's counts, but one mouse recording is deposited twice, once as cholinergic and once as noncholinergic, and one macaque recording twice. One macaque file is scaled 20 times too large. In 8 files a test pulse precedes the step in every sweep that holds a step, while in the others it follows the step. The -60 pA responses of 8 neurons are clipped at -100 or -105.5 mV. The stimulus is labelled amperes but holds pA. The amplifier fields (bias current, bridge balance, capacitance compensation, gain) hold one set of values in every file. The step amplitudes differ between files and are mostly not the 10 pA increments of the Fig. S2-1 legend. The resting potential is not recorded, except in some file names. Two files in the folder of mouse CG608 are named for CG609. The morphology is not in the dandiset.

In [28]:
print(f"notebook ran in {(time.time() - started) / 60:.1f} min")
notebook ran in 1.5 min