Reproducing Liu et al. (2026), Fig. 5a-c, from dandiset 001752¶

Paper. Liu, Huang, Shen, Shao, Jing et al. (2026), "An atlas of primate insular cortex reveals a signal-processing strategy in von Economo neurons", Nature Cell Biology 28, 1742-1757, doi:10.1038/s41556-026-02009-4. The claims file (claims/001752/10.1038-s41556-026-02009-4.yaml) was written from the version of record (Europe PMC, PMC13457102): main text, figure legends, Extended Data legends and Methods.

Dataset. DANDI:001752, "Electrophysiological Dataset of Neuronal Post-Synaptic Currents in the Primate Anterior Insular Cortex", version 0.260825.0222 (doi:10.48324/dandi.001752/0.260825.0222). The paper cites the dandiset without a version, and this is its only published version (the draft has the same 84 assets and size), so it is pinned.

Outside inputs (with_labels). The NWB files carry no cell type. The paper's code, github.com/RFLiu2021/AIC_proj at commit 44cd8a6dfbb1f1ce363d73742e4f3652086b0f9d, holds a table of the deposited files with their cell types (ephysio/data_ephy/rawdata_ephysio/metadata_PSC.csv) and the paper's per-cell frequencies and amplitudes (ephysio/data_ephy/sPSCs_Fig7ab.xlsx, ephysio/data_ephy/miniEPSCs_Fig7ab.xlsx). The table supplies the labels; the sheets are used only to check the link (claim psc-file-labels-link) and as the variant labelling of the mEPSC cells that the claims file asks for. All measurements are made here from the NWB traces.

claim tested here
psc-file-labels-link (link, added by this attempt) yes
fig5b-sepsc-frequency, fig5b-sipsc-frequency, fig5b-mepsc-frequency, fig5b-mipsc-frequency yes
fig5c-sepsc-amplitude, fig5c-sipsc-amplitude, fig5c-mepsc-amplitude, fig5c-mipsc-amplitude yes
the paper's other claims (data: elsewhere) not here: their data are in other archives; see elsewhere_liu_2026.ipynb and the attempt record
In [1]:
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
import hashlib

import psc

pd.set_option("display.width", 250)
pd.set_option("display.max_rows", 300)
pd.set_option("display.max_columns", 40)

meta = psc.version_metadata()
asset_list = psc.assets()
print("dandiset", psc.DANDISET, "version", psc.VERSION, "doi", meta.get("doi"))
print("name:", meta["name"])
print("description:", meta["description"])
print("related:", [(r.get("relation"), r.get("url")) for r in meta.get("relatedResource", [])])
print("assets:", len(asset_list), "total bytes:", sum(a["size"] for a in asset_list))
print("summary:", {k: meta["assetsSummary"].get(k) for k in ("numberOfSubjects", "numberOfFiles", "variableMeasured")})
dandiset 001752 version 0.260825.0222 doi 10.48324/dandi.001752/0.260825.0222
name: Electrophysiological Dataset of Neuronal Post-Synaptic Currents in the Primate Anterior Insular Cortex
description: This dataset includes intracellular recordings from neurons in the anterior insular cortex of macaque monkeys. Postsynaptic currents were measured, comprising miniature and spontaneous excitatory and inhibitory postsynaptic currents (E/IPSCs) recorded from von Economo neurons (VENs) and pyramidal cells (PCs).
related: [('dcite:IsSourceOf', 'https://doi.org/10.1038/s41556-026-02009-4')]
assets: 84 total bytes: 181662688
summary: {'numberOfSubjects': 5, 'numberOfFiles': 84, 'variableMeasured': ['VoltageClampSeries', 'VoltageClampStimulusSeries']}
In [2]:
recs = psc.read_all(asset_list)
info = pd.DataFrame([{k: v for k, v in r.items() if k != "trace_pA"} for r in recs])
info["obj"] = info.file.str.extract(r"obj-([a-z0-9]+)_")[0]
info["experiment"] = info.session_description.map(psc.experiment_of)
traces = {r["file"]: r["trace_pA"] for r in recs}
print(info[["obj", "subject", "session", "experiment", "cell_id", "rate", "unit", "n_samples", "sex", "age"]].to_string())
        obj    subject         session experiment     cell_id    rate     unit  n_samples sex      age
0   1h8uzvv  Mfa201023     sess_201023      sEPSC  Cell_AS007  1000.0  amperes     120000   M  P4Y/P6Y
1   1pa4y3o  Mfa201023     sess_201023      sEPSC  Cell_AS001  1000.0  amperes     180000   M  P4Y/P6Y
2   1igffau  Mfa201023     sess_201023      sEPSC  Cell_AS003  1000.0  amperes     120000   M  P4Y/P6Y
3   1eq93e8  Mfa201023     sess_201023      sEPSC  Cell_AS002  1000.0  amperes     120000   M  P4Y/P6Y
4    a8xj73  Mfa201023     sess_201023      sEPSC  Cell_AS008  1000.0  amperes     222097   M  P4Y/P6Y
5    b0ewiw  Mfa201023     sess_201023      sEPSC  Cell_AS004  1000.0  amperes     120000   M  P4Y/P6Y
6    meypbx  Mfa201023     sess_201023      sEPSC  Cell_AS005  1000.0  amperes     180000   M  P4Y/P6Y
7   1t919ap  Mfa201030     sess_201030      sIPSC  Cell_AS008  1000.0  amperes     240000   M  P4Y/P6Y
8    n29ivo  Mfa201030     sess_201030      sIPSC  Cell_AS018  1000.0  amperes     200000   M  P4Y/P6Y
9    mhbl1b  Mfa201030     sess_201030      sEPSC  Cell_AS003  1000.0  amperes     480000   M  P4Y/P6Y
10   x2i11w  Mfa201030     sess_201030      sIPSC  Cell_AS003  1000.0  amperes     240000   M  P4Y/P6Y
11   yd3b19  Mfa201030     sess_201030      sIPSC  Cell_AS006  1000.0  amperes     240000   M  P4Y/P6Y
12  15e3e16  Mfa201126  sess_201023126      sEPSC  Cell_AS002  1000.0  amperes     130963   M  P4Y/P6Y
13  1ap4tuj  Mfa201126  sess_201023126      sEPSC  Cell_AS005  1000.0  amperes     194817   M  P4Y/P6Y
14  1i9bc2s  Mfa201126  sess_201023126      sEPSC  Cell_AS012  1000.0  amperes     271933   M  P4Y/P6Y
15  16olqir  Mfa201126  sess_201023126      sEPSC  Cell_AS008  1000.0  amperes     211133   M  P4Y/P6Y
16  1n7bo55  Mfa201126  sess_201023126      sEPSC  Cell_AS010  1000.0  amperes     300000   M  P4Y/P6Y
17  1u56rnh  Mfa201126  sess_201023126      sEPSC  Cell_AS009  1000.0  amperes     160120   M  P4Y/P6Y
18   jgrzuw  Mfa201126  sess_201023126      sEPSC  Cell_AS003  1000.0  amperes     300000   M  P4Y/P6Y
19   uvslhx  Mfa201126  sess_201023126      sEPSC  Cell_AS007  1000.0  amperes     234322   M  P4Y/P6Y
20   t0bi1r  Mfa201126  sess_201023126      sEPSC  Cell_AS004  1000.0  amperes     242312   M  P4Y/P6Y
21   wn6cw2  Mfa201126  sess_201023126      sEPSC  Cell_AS011  1000.0  amperes     300000   M  P4Y/P6Y
22  11eyh5v  Mfa201126     sess_201126      sIPSC  Cell_AS010  1000.0  amperes     300000   M  P4Y/P6Y
23  12i0fre  Mfa201126     sess_201126      sIPSC  Cell_AS003  1000.0  amperes     300000   M  P4Y/P6Y
24  1qoizw2  Mfa201126     sess_201126      sIPSC  Cell_AS013  1000.0  amperes      95893   M  P4Y/P6Y
25  1tsbdsc  Mfa201126     sess_201126      sIPSC  Cell_AS002  1000.0  amperes     217625   M  P4Y/P6Y
26  1s3ysck  Mfa201126     sess_201126      sIPSC  Cell_AS011  1000.0  amperes     178786   M  P4Y/P6Y
27  1tuqzm9  Mfa201126     sess_201126      sIPSC  Cell_AS009  1000.0  amperes     300000   M  P4Y/P6Y
28   838ym4  Mfa201126     sess_201126      sIPSC  Cell_AS006  1000.0  amperes     300000   M  P4Y/P6Y
29   fwphyw  Mfa201126     sess_201126      sIPSC  Cell_AS011  1000.0  amperes     300000   M  P4Y/P6Y
30   t3fiuv  Mfa201126     sess_201126      sIPSC  Cell_AS007  1000.0  amperes     300000   M  P4Y/P6Y
31  123f7yh  Mfa210403    Sess250403AS      mEPSC  Cell_AS026  1000.0  amperes     300000   M  P4Y/P6Y
32   w9b4ds  Mfa201126     sess_201126      sIPSC  Cell_AS012  1000.0  amperes     293678   M  P4Y/P6Y
33  17bl3bi  Mfa210403    Sess250403AS      mEPSC  Cell_AS028  1000.0  amperes     300000   M  P4Y/P6Y
34   rlgjzz  Mfa201126     sess_201126      sIPSC  Cell_AS004  1000.0  amperes     300000   M  P4Y/P6Y
35  1nktpia  Mfa210403    Sess250403AS      mEPSC  Cell_AS011  1000.0  amperes     300000   M  P4Y/P6Y
36  1w2fe2k  Mfa210403    Sess250403AS      mEPSC  Cell_AS007  1000.0  amperes     300000   M  P4Y/P6Y
37  1liyekt  Mfa210403    Sess250403AS      mEPSC  Cell_AS020  1000.0  amperes     300000   M  P4Y/P6Y
38  1hy08yq  Mfa210403    Sess250403AS      mEPSC  Cell_AS019  1000.0  amperes     300000   M  P4Y/P6Y
39  1hq5666  Mfa210403    Sess250403AS      mEPSC  Cell_AS003  1000.0  amperes     300000   M  P4Y/P6Y
40  1wplqqi  Mfa210403    Sess250403AS      mEPSC  Cell_AS018  1000.0  amperes     300000   M  P4Y/P6Y
41   6dsg94  Mfa210403    Sess250403AS      mEPSC  Cell_AS025  1000.0  amperes     300000   M  P4Y/P6Y
42   ku2uls  Mfa210403    Sess250403AS      mEPSC  Cell_AS012  1000.0  amperes     300000   M  P4Y/P6Y
43   f3z9bv  Mfa210403    Sess250403AS      mEPSC  Cell_AS005  1000.0  amperes     300000   M  P4Y/P6Y
44   a13tyq  Mfa210403    Sess250403AS      mEPSC  Cell_AS015  1000.0  amperes     300000   M  P4Y/P6Y
45   mj6gor  Mfa210403    Sess250403AS      mEPSC  Cell_AS022  1000.0  amperes     300000   M  P4Y/P6Y
46   nfq9hp  Mfa210403    Sess250403AS      mEPSC  Cell_AS016  1000.0  amperes     300000   M  P4Y/P6Y
47  14j4kki  Mfa250904    Sess250904AS      mIPSC  Cell_AS012  1000.0  amperes     180959   M  P4Y/P6Y
48  1bcj2jv  Mfa250904    Sess250904AS      mIPSC  Cell_AS010  1000.0  amperes     180959   M  P4Y/P6Y
49    wudwj  Mfa210403    Sess250403AS      mEPSC  Cell_AS008  1000.0  amperes     300000   M  P4Y/P6Y
50  1f5h8p1  Mfa250904    Sess250904AS      mIPSC  Cell_AS005  1000.0  amperes     180959   M  P4Y/P6Y
51  1ky79xo  Mfa250904    Sess250904AS      mIPSC  Cell_AS009  1000.0  amperes     180959   M  P4Y/P6Y
52  1lkob2k  Mfa250904    Sess250904AS      mIPSC  Cell_AS014  1000.0  amperes     180959   M  P4Y/P6Y
53  1tmlevr  Mfa250904    Sess250904AS      mIPSC  Cell_AS002  1000.0  amperes     180959   M  P4Y/P6Y
54  1tnc09p  Mfa250904    Sess250904AS      mIPSC  Cell_AS011  1000.0  amperes     180959   M  P4Y/P6Y
55  1w6meet  Mfa250904    Sess250904AS      mIPSC  Cell_AS013  1000.0  amperes     180959   M  P4Y/P6Y
56  1ydhi4e  Mfa250904    Sess250904AS      mIPSC  Cell_AS008  1000.0  amperes     180959   M  P4Y/P6Y
57   22w7ba  Mfa250904    Sess250904AS      mIPSC  Cell_AS001  1000.0  amperes     180959   M  P4Y/P6Y
58   7j7uo6  Mfa250904    Sess250904AS      mIPSC  Cell_AS003  1000.0  amperes     180959   M  P4Y/P6Y
59   flbag1  Mfa250904    Sess250904AS      mIPSC  Cell_AS007  1000.0  amperes     180959   M  P4Y/P6Y
60   gf735e  Mfa250904    Sess250904AS      mIPSC  Cell_AS015  1000.0  amperes     180959   M  P4Y/P6Y
61   ceurdc  Mfa250904    Sess250904AS      mIPSC  Cell_AS014  1000.0  amperes     180959   M  P4Y/P6Y
62   opivqg  Mfa250904    Sess250904AS      mIPSC  Cell_AS015  1000.0  amperes     180959   M  P4Y/P6Y
63   t6xhex  Mfa250904    Sess250904AS      mIPSC  Cell_AS004  1000.0  amperes     180959   M  P4Y/P6Y
64  10il1l4  Mfa250904    Sess250904HS      mIPSC  Cell_HS022  1000.0  amperes     300959   M  P4Y/P6Y
65   x8p67c  Mfa250904    Sess250904AS      mIPSC  Cell_AS006  1000.0  amperes     180959   M  P4Y/P6Y
66  194xr8x  Mfa250904    Sess250904HS      mIPSC  Cell_HS017  1000.0  amperes     243477   M  P4Y/P6Y
67  1fpy6du  Mfa250904    Sess250904HS      mIPSC  Cell_HS018  1000.0  amperes     300959   M  P4Y/P6Y
68  17j2vbx  Mfa250904    Sess250904HS      mIPSC  Cell_HS026  1000.0  amperes     300959   M  P4Y/P6Y
69  1h8f0vp  Mfa250904    Sess250904HS      mIPSC  Cell_HS007  1000.0  amperes     300959   M  P4Y/P6Y
70  1hzamhk  Mfa250904    Sess250904HS      mIPSC  Cell_HS008  1000.0  amperes     243733   M  P4Y/P6Y
71  1t5vb83  Mfa250904    Sess250904HS      mIPSC  Cell_HS019  1000.0  amperes     300959   M  P4Y/P6Y
72  1s2txk3  Mfa250904    Sess250904HS      mIPSC  Cell_HS011  1000.0  amperes     207420   M  P4Y/P6Y
73  1j3066r  Mfa250904    Sess250904HS      mIPSC  Cell_HS016  1000.0  amperes     300959   M  P4Y/P6Y
74  1w51hrn  Mfa250904    Sess250904HS      mIPSC  Cell_HS013  1000.0  amperes     300959   M  P4Y/P6Y
75   81799o  Mfa250904    Sess250904HS      mIPSC  Cell_HS024  1000.0  amperes     300959   M  P4Y/P6Y
76   6nwydh  Mfa250904    Sess250904HS      mIPSC  Cell_HS014  1000.0  amperes     300959   M  P4Y/P6Y
77   3jwnce  Mfa250904    Sess250904HS      mIPSC  Cell_HS020  1000.0  amperes     300959   M  P4Y/P6Y
78   3wd62v  Mfa250904    Sess250904HS      mIPSC  Cell_HS009  1000.0  amperes     300959   M  P4Y/P6Y
79   diwa3z  Mfa250904    Sess250904HS      mIPSC  Cell_HS023  1000.0  amperes     300959   M  P4Y/P6Y
80   kv91hc  Mfa250904    Sess250904HS      mIPSC  Cell_HS025  1000.0  amperes     213653   M  P4Y/P6Y
81   lx27k4  Mfa250904    Sess250904HS      mIPSC  Cell_HS012  1000.0  amperes     276959   M  P4Y/P6Y
82   t8ygv1  Mfa250904    Sess250904HS      mIPSC  Cell_HS015  1000.0  amperes     300959   M  P4Y/P6Y
83   zt8i6q  Mfa250904    Sess250904HS      mIPSC  Cell_HS010  1000.0  amperes     300959   M  P4Y/P6Y

Data check¶

What each file holds: one VoltageClampSeries (current in amperes, one sweep, starting at 0 s) and a VoltageClampStimulusSeries of three zeros (no stimulus). There are no trial tables, intervals or intracellular_recordings tables, and no cell type anywhere in the file. The holding potential is given only in the session description. The checks below are of the experiment, durations, sampling rate, holding current, padding, duplicates and noise.

In [3]:
print("Files by experiment, subject and session (from session_description):")
print(info.groupby(["experiment", "subject", "session"]).size().to_string())
print()
print("Session descriptions:")
print(info.groupby(["experiment", "session_description", "experiment_description", "stimulus_description"]).size().to_string())
print()
print("rates (Hz):", sorted(info.rate.unique()), " units:", sorted(info.unit.unique()),
      " stimulus values:", sorted({v for s in info.stimulus_values for v in s}))
print("sex:", info.sex.value_counts().to_dict(), " age:", info.age.value_counts().to_dict())
print("cell_id is unique within a session?",
      not info.duplicated(["session", "experiment", "cell_id"]).any())
dup_ids = info[info.duplicated(["session", "experiment", "cell_id"], keep=False)].sort_values("cell_id")
print(dup_ids[["obj", "session", "experiment", "cell_id"]].to_string())
Files by experiment, subject and session (from session_description):
experiment  subject    session       
mEPSC       Mfa210403  Sess250403AS      15
mIPSC       Mfa250904  Sess250904AS      17
                       Sess250904HS      19
sEPSC       Mfa201023  sess_201023        7
            Mfa201030  sess_201030        1
            Mfa201126  sess_201023126    10
sIPSC       Mfa201030  sess_201030        4
            Mfa201126  sess_201126       11

Session descriptions:
experiment  session_description                                             experiment_description                        stimulus_description                   
mEPSC       intracellular recording of miniature EPSC with TTX              miniature EPSC recording.                     No stimulus, miniature EPSC recording      15
mIPSC       intracellular recording of miniature IPSC with TTX              miniature IPSC recording.                     No stimulus, miniature IPSC recording      36
sEPSC       intracellular recording of spontaneous EPSC, holding at -70 mV  spontaneuos EPSC recording, holding at -70mV  No stimulus, spontaneous EPSC recording    18
sIPSC       intracellular recording of spontaneous IPSC, holding at +20mV   spontaneuos IPSC recording, holding at +20mV  No stimulus, spontaneous IPSC recording    15

rates (Hz): [np.float64(1000.0)]  units: ['amperes']  stimulus values: [0.0]
sex: {'M': 84}  age: {'P4Y/P6Y': 84}
cell_id is unique within a session? False
        obj       session experiment     cell_id
26  1s3ysck   sess_201126      sIPSC  Cell_AS011
29   fwphyw   sess_201126      sIPSC  Cell_AS011
52  1lkob2k  Sess250904AS      mIPSC  Cell_AS014
61   ceurdc  Sess250904AS      mIPSC  Cell_AS014
60   gf735e  Sess250904AS      mIPSC  Cell_AS015
62   opivqg  Sess250904AS      mIPSC  Cell_AS015
In [4]:
# Padding: trailing runs of exact zeros; holding current; duration; duplicates.
rows = []
for f, x in traces.items():
    xt, cut = psc.trim_padding(x)
    rate = info.set_index("file").rate[f]
    z = xt - psc.baseline(xt, rate)
    rows.append(dict(file=f, cut_zero_samples=cut, duration_s=len(xt) / rate,
                     holding_median_pA=np.median(xt), holding_p1=np.percentile(xt, 1), holding_p99=np.percentile(xt, 99),
                     noise_pA=psc.robust_sd(z),
                     md5=hashlib.md5(x.tobytes()).hexdigest(), seg_md5=hashlib.md5(xt[1000:6000].tobytes()).hexdigest()))
chk = pd.DataFrame(rows)
info = info.merge(chk, on="file")
print("files with trailing zero padding:", (info.cut_zero_samples > 0).sum(),
      "; samples cut per file:", sorted(info.cut_zero_samples[info.cut_zero_samples > 0].unique()))
print(info.groupby("experiment").agg(n=("file", "size"), dur_min=("duration_s", "min"), dur_median=("duration_s", "median"),
                                     dur_max=("duration_s", "max"), under_5min=("duration_s", lambda d: int((d < 300).sum())),
                                     hold_min=("holding_median_pA", "min"), hold_max=("holding_median_pA", "max"),
                                     noise_min=("noise_pA", "min"), noise_median=("noise_pA", "median"),
                                     noise_max=("noise_pA", "max"), noise_over_5pA=("noise_pA", lambda d: int((d > 5).sum())))
      .round(2).to_string())
print("identical traces (whole file):", int(info.md5.duplicated().sum()),
      "; identical 5 s segments at 1 s:", int(info.seg_md5.duplicated().sum()))
files with trailing zero padding: 22 ; samples cut per file: [np.int64(6795), np.int64(9407), np.int64(9445), np.int64(9663), np.int64(13028), np.int64(30167)]
             n  dur_min  dur_median  dur_max  under_5min  hold_min  hold_max  noise_min  noise_median  noise_max  noise_over_5pA
experiment                                                                                                                      
mEPSC       15   300.00      300.00   300.00           0   -119.40    -21.05       0.41          0.92       1.31               0
mIPSC       36   150.79      200.62   300.96          22    -86.62     -3.49       0.38          0.97       4.76               0
sEPSC       18   120.00      202.98   480.00          14   -406.26     36.92       0.94          1.79       8.17               2
sIPSC       15    95.89      293.68   300.00           8    107.12    979.41       3.64          6.12      37.51              11
identical traces (whole file): 0 ; identical 5 s segments at 1 s: 0
In [5]:
# Near-duplicates: correlation of the first 60 s, referred to the running median (so that the slow drift of
# the holding current, common to many files, does not dominate), between every pair of files of an experiment.
near = []
for exp, g in info.groupby("experiment"):
    fs = list(g.file)
    for i in range(len(fs)):
        for j in range(i + 1, len(fs)):
            a, b = traces[fs[i]][:60000], traces[fs[j]][:60000]
            a, b = a - psc.baseline(a, 1000.0), b - psc.baseline(b, 1000.0)
            n = min(len(a), len(b))
            r = np.corrcoef(a[:n], b[:n])[0, 1]
            near.append((exp, fs[i].split("obj-")[1][:8], fs[j].split("obj-")[1][:8], r))
near = pd.DataFrame(near, columns=["experiment", "a", "b", "r"])
print("pairs compared:", len(near), "; largest correlations:")
print(near.sort_values("r", ascending=False).head(5).round(3).to_string())
pairs compared: 993 ; largest correlations:
    experiment         a         b      r
605      mIPSC  1fpy6du_  1w51hrn_  0.145
680      mIPSC  1j3066r_  1w51hrn_  0.141
690      mIPSC  1w51hrn_  81799o_i  0.119
604      mIPSC  1fpy6du_  1j3066r_  0.111
542      mIPSC  t6xhex_i  lx27k4_i  0.103
In [6]:
fig, axes = plt.subplots(2, 2, figsize=(12, 6))
for ax, (exp, g) in zip(axes.ravel(), info.groupby("experiment")):
    f = g.sort_values("noise_pA").file.iloc[len(g) // 2]
    x, _ = psc.trim_padding(traces[f])
    t = np.arange(len(x)) / 1000.0
    s = slice(60000, 62000)
    ax.plot(t[s], x[s], lw=0.6)
    ax.set_title(f"{exp}  {f.split('obj-')[1][:8]} (median-noise file)")
    ax.set_xlabel("s"); ax.set_ylabel("pA")
plt.tight_layout(); plt.show()
print("plotted: 2 s of one file per experiment; y ranges:",
      {exp: (round(float(psc.trim_padding(traces[g.sort_values('noise_pA').file.iloc[len(g)//2]])[0][60000:62000].min()), 1),
             round(float(psc.trim_padding(traces[g.sort_values('noise_pA').file.iloc[len(g)//2]])[0][60000:62000].max()), 1))
       for exp, g in info.groupby("experiment")})
No description has been provided for this image
plotted: 2 s of one file per experiment; y ranges: {'mEPSC': (-131.4, -117.6), 'mIPSC': (-35.5, -11.7), 'sEPSC': (-48.5, -30.5), 'sIPSC': (278.4, 312.8)}

Events, under every reading¶

For each file, events are detected (helper psc.detect) in the direction set by the holding potential: outward for the sIPSC files, held at +20 mV by their description, and inward for the others. Each file is run with the two threshold readings of the claims file, (a) 5 pA and (b) the recording's RMS noise, over the whole recording and over its first 30 s (the code's window). A third threshold, three times the recording's noise, is a variant added here (a common practice in event detection, not the paper's) to show how far the outcomes depend on detection; it decides nothing.

In [7]:
SIGN = {"sEPSC": -1, "mEPSC": -1, "mIPSC": -1, "sIPSC": +1}
READINGS = {"5pA_whole": (5.0, None), "rms_whole": (None, None), "5pA_30s": (5.0, 30.0), "rms_30s": (None, 30.0),
            "3rms_whole": ("3rms", None)}
det_rows, detections = [], {}
for _, r in info.iterrows():
    x, _ = psc.trim_padding(traces[r.file])
    for name, (thr, win) in READINGS.items():
        if thr == "3rms":  # variant: three times the recording's noise, a common practice, not the paper's
            thr = 3 * psc.robust_sd(x - psc.baseline(x, r.rate))
        d = psc.detect(x, r.rate, SIGN[r.experiment], thr, win)
        detections[(r.file, name)] = d
        det_rows.append(dict(file=r.file, reading=name, n_events=d["n_events"], n_artifacts=d["n_artifacts"],
                             duration_s=d["duration_s"], freq=d["frequency_hz"], amp=d["amplitude_pa"],
                             threshold=d["threshold_pa"]))
det = pd.DataFrame(det_rows)
wide = det.pivot(index="file", columns="reading", values=["freq", "amp", "n_events", "n_artifacts", "threshold"])
wide.columns = [f"{a}_{b}" for a, b in wide.columns]
wide = wide.reset_index()
info = info.merge(wide, on="file")
print("events left out as artefacts (> 500 pA), whole recording, 5 pA:",
      info[info.n_artifacts_5pA_whole > 0][["obj", "experiment", "n_artifacts_5pA_whole"]].to_dict("records"))
print("files with fewer than 200 events (5 pA, whole):", int((info.n_events_5pA_whole < 200).sum()), "of", len(info))
print(info.groupby("experiment")[["freq_5pA_whole", "amp_5pA_whole", "freq_rms_whole", "amp_rms_whole", "threshold_rms_whole"]]
      .describe().T.round(2).to_string())
events left out as artefacts (> 500 pA), whole recording, 5 pA: [{'obj': 'mhbl1b', 'experiment': 'sEPSC', 'n_artifacts_5pA_whole': 2.0}, {'obj': 'yd3b19', 'experiment': 'sIPSC', 'n_artifacts_5pA_whole': 1.0}, {'obj': '12i0fre', 'experiment': 'sIPSC', 'n_artifacts_5pA_whole': 10.0}, {'obj': '838ym4', 'experiment': 'sIPSC', 'n_artifacts_5pA_whole': 5.0}, {'obj': 'fwphyw', 'experiment': 'sIPSC', 'n_artifacts_5pA_whole': 1.0}]
files with fewer than 200 events (5 pA, whole): 18 of 84
experiment                 mEPSC  mIPSC  sEPSC   sIPSC
freq_5pA_whole      count  15.00  36.00  18.00   15.00
                    mean    0.94   2.97   8.88   19.08
                    std     0.64   4.97   8.80   11.12
                    min     0.15   0.22   0.43    5.45
                    25%     0.45   0.97   2.34   10.80
                    50%     0.73   1.63   5.23   18.46
                    75%     1.42   2.68  13.40   27.38
                    max     2.26  25.44  31.97   37.52
amp_5pA_whole       count  15.00  36.00  18.00   15.00
                    mean    8.09   9.83   9.80   17.26
                    std     1.28   1.63   3.01   11.22
                    min     6.21   6.68   6.63    9.06
                    25%     7.38   8.59   7.95   11.51
                    50%     7.83  10.01   8.51   12.70
                    75%     8.58  10.83  11.45   15.38
                    max    11.28  13.87  17.89   45.13
freq_rms_whole      count  15.00  36.00  18.00   15.00
                    mean   27.97  24.51  28.89   11.88
                    std     6.73  11.71   8.23    3.01
                    min    17.43   4.09  14.17    8.02
                    25%    24.93  15.94  23.23    9.50
                    50%    27.26  25.90  29.39   10.84
                    75%    31.62  35.06  34.53   13.28
                    max    43.54  42.70  42.76   17.62
amp_rms_whole       count  15.00  36.00  18.00   15.00
                    mean    1.72   2.87   5.72   26.85
                    std     0.48   1.93   5.24   28.55
                    min     0.78   0.76   1.78    7.72
                    25%     1.34   1.66   2.85   10.81
                    50%     1.67   2.30   3.90   15.86
                    75%     2.05   3.52   5.86   23.39
                    max     2.55   9.84  23.19  104.36
threshold_rms_whole count  15.00  36.00  18.00   15.00
                    mean    0.89   1.13   2.52   10.20
                    std     0.22   0.89   1.91    9.22
                    min     0.41   0.38   0.94    3.64
                    25%     0.80   0.65   1.18    4.62
                    50%     0.92   0.97   1.79    6.12
                    75%     0.98   1.11   2.89   10.84
                    max     1.31   4.76   8.17   37.51
In [8]:
# Time base: the decay of the average isolated event (peak to 37%), at the stated 1000 Hz.
dec = []
for _, r in info.iterrows():
    x, _ = psc.trim_padding(traces[r.file])
    d = detections[(r.file, "5pA_whole")]
    dec.append(psc.decay_time_ms(x, r.rate, SIGN[r.experiment], d["peaks"], d["amplitudes"]))
info["decay_ms"] = dec
print("decay time of the average event (ms), by experiment:")
print(info.groupby("experiment").decay_ms.describe().round(1).to_string())
decay time of the average event (ms), by experiment:
            count  mean  std   min   25%   50%   75%   max
experiment                                                
mEPSC        15.0   9.1  2.8   5.0   7.0   9.0  11.5  13.0
mIPSC        35.0  16.3  5.3   8.0  12.5  16.0  21.0  25.0
sEPSC        18.0   8.7  4.4   3.0   6.0   7.0  10.5  18.0
sIPSC        15.0  15.1  4.4  10.0  11.5  14.0  18.0  23.0

Detector checks¶

Two checks of the detector, asked for by the verifier. (1) A null from the data: peaks of the opposite polarity. Noise is symmetric about the baseline and synaptic events are not, so the rate of peaks detected in the wrong direction estimates how many false events each threshold admits (it overestimates a little, as the decay of a real event can make an opposite peak against the baseline before it). (2) A positive control: synthetic events of known times and amplitudes (psc.inject_events, 2 Hz, log-normal amplitudes of median 10 pA, the experiment's decay) are added to every real trace, and the share each reading recovers within 3 ms is counted. Neither decides an outcome.

In [9]:
# Detector checks. (1) A null from the data: events of the opposite polarity. Noise is symmetric about the
# baseline and synaptic events are not, so peaks detected in the wrong direction estimate the false events
# each reading admits. (2) A positive control: synthetic events of known times and amplitudes (helper
# psc.inject_events) added to every real trace, and the share of them each reading recovers.
rng_check = np.random.default_rng(20261103)
decay_by_exp = info.groupby("experiment").decay_ms.median()
chk_rows = []
for _, r in info.iterrows():
    x, _ = psc.trim_padding(traces[r.file])
    s = SIGN[r.experiment]
    y, t_inj, a_inj = psc.inject_events(x, r.rate, s, decay_by_exp[r.experiment], rng_check)
    row = dict(file=r.file, experiment=r.experiment, noise_pA=r.noise_pA, n_injected=len(t_inj))
    for name, thr in (("5pA", 5.0), ("rms", None)):
        row[f"opp_freq_{name}"] = psc.detect(x, r.rate, -s, thr)["frequency_hz"]
        d = psc.detect(y, r.rate, s, thr)
        hit = psc.recovered(d["peaks"], t_inj, int(0.003 * r.rate))
        row[f"hit_{name}"] = hit.mean()
        row[f"added_freq_{name}"] = d["frequency_hz"] - r[f"freq_{name}_whole"]
        row[f"hit_over10pA_{name}"] = hit[a_inj >= 10].mean()
    chk_rows.append(row)
chk2 = pd.DataFrame(chk_rows)
info = info.merge(chk2.drop(columns=["experiment", "noise_pA"]), on="file")
print(f"injected: {psc.INJECT_RATE_HZ} Hz, amplitudes log-normal, median {psc.INJECT_MEDIAN_PA} pA "
      f"(5 to 95%: {psc.INJECT_MEDIAN_PA*np.exp(-1.645*psc.INJECT_SIGMA):.1f} to {psc.INJECT_MEDIAN_PA*np.exp(1.645*psc.INJECT_SIGMA):.1f} pA)")
info["noise_bin"] = pd.cut(info.noise_pA, [0, 2, 4, 6, 100], labels=["<2", "2-4", "4-6", ">6"])
summ = info.groupby(["experiment", "noise_bin"], observed=True).agg(
    files=("file", "size"), freq_5pA=("freq_5pA_whole", "median"), opposite_5pA=("opp_freq_5pA", "median"),
    freq_rms=("freq_rms_whole", "median"), opposite_rms=("opp_freq_rms", "median"),
    recovered_5pA=("hit_5pA", "median"), recovered_10pA_up_5pA=("hit_over10pA_5pA", "median"),
    added_5pA=("added_freq_5pA", "median"), recovered_rms=("hit_rms", "median"))
print("medians per experiment and noise (pA): frequency (Hz) detected in the events' direction and in the opposite one,")
print("share of injected events recovered (all, and those of 10 pA or more), and the frequency added by the injection:")
print(summ.round(2).to_string())
for name in ("5pA", "rms"):
    r_ = stats.spearmanr(info.noise_pA, info[f"opp_freq_{name}"])
    print(f"{name}: opposite-polarity frequency against noise, Spearman rho {r_[0]:.2f}; its share of the frequency "
          f"in the events' direction, median {np.median(info[f'opp_freq_{name}'] / info[f'freq_{name}_whole']):.2f}")
injected: 2.0 Hz, amplitudes log-normal, median 10.0 pA (5 to 95%: 5.2 to 19.3 pA)
medians per experiment and noise (pA): frequency (Hz) detected in the events' direction and in the opposite one,
share of injected events recovered (all, and those of 10 pA or more), and the frequency added by the injection:
                      files  freq_5pA  opposite_5pA  freq_rms  opposite_rms  recovered_5pA  recovered_10pA_up_5pA  added_5pA  recovered_rms
experiment noise_bin                                                                                                                       
mEPSC      <2            15      0.73          0.06     27.26         28.22           0.94                   0.99       1.80           0.98
mIPSC      <2            34      1.60          0.11     25.90         27.20           0.91                   0.97       1.77           0.97
           4-6            2     22.43         32.30     28.53         35.80           0.71                   0.79       0.57           0.73
sEPSC      <2            10      2.43          0.44     29.99         31.57           0.92                   0.98       1.70           0.97
           2-4            5     13.24          7.29     34.19         29.92           0.82                   0.93       1.10           0.87
           4-6            2     18.51         14.82     18.57         15.02           0.77                   0.90       0.94           0.77
           >6             1     31.97         31.90     21.85         16.30           0.57                   0.66       0.28           0.47
sIPSC      2-4            2      8.57          9.13     13.34         16.99           0.80                   0.92       1.28           0.84
           4-6            5      9.90         11.69     10.84         12.33           0.80                   0.91       1.21           0.79
           >6             8     27.38         33.96     11.14          6.37           0.63                   0.74       0.37           0.44
5pA: opposite-polarity frequency against noise, Spearman rho 0.86; its share of the frequency in the events' direction, median 0.13
rms: opposite-polarity frequency against noise, Spearman rho -0.59; its share of the frequency in the events' direction, median 1.05

What the checks show. At 5 pA, in the files with noise below 2 pA (all 15 mEPSC files, 34 of 36 mIPSC, 10 of 18 sEPSC), opposite-polarity peaks are rare (medians 0.06 to 0.44 Hz, against 0.73 to 2.43 Hz in the events' direction) and 91 to 94% of the injected events are recovered. In noisier files the opposite rate grows with the noise. In the sEPSC files with noise of 2 to 4 pA it is about half the forward one (7.3 against 13.2 Hz; per-file ratio median 0.56), so a large part of what is detected there is noise. In the sIPSC files it is close to or above the forward one (per-file ratio median 0.94 at 2 to 4 pA, 1.09 at 4 to 6 pA and 1.24 above 6 pA, where the rates are 34.0 against 27.4 Hz), except in two files, w9b4ds (0.43) and 1tsbdsc (0.59), where it is about half (cell after the fig5b-sipsc-frequency table); no sIPSC file has noise below 2 pA. At the RMS threshold, reading (b), the opposite rate equals the forward one in every experiment (median ratio 1.05; mEPSC 28.2 against 27.3 Hz), so that reading counts noise, not events.

psc-file-labels-link¶

The dandiset's NWB files are the recordings of Fig. 5a-c, and the code's table of deposited files gives each its cell type, consistent with the per-cell values of the code's analysis sheets.

Records are matched by NWB file name (rawFileName of metadata_PSC.csv); the table's original file names are matched to the cell names of the sheets by date, slice and cell (psc.name_key).

In [10]:
lab = psc.labels()
lab["key"] = [psc.name_key(n, e) for n, e in zip(lab.filename_original, lab.Experiment)]
files = set(info.file)
print("table rows:", len(lab), "; distinct files named:", lab.rawFileName.nunique(),
      "; rows naming a dandiset file:", int(lab.rawFileName.isin(files).sum()))
print("dandiset files the table does not name:", sorted(files - set(lab.rawFileName)))
print("files named by more than one row:")
print(lab[lab.rawFileName.duplicated(keep=False)][["filename_original", "rawFileName", "cellType", "Experiment"]].to_string())
x = lab.merge(info[["file", "experiment", "subject"]], left_on="rawFileName", right_on="file", how="left")
print("table experiment equals the file's own description:", bool((x.Experiment == x.experiment).all()),
      "; table subject equals the file's:", bool((x.Subject == x.subject).all()))
counts = lab.groupby(["Experiment", "cellType"]).size().unstack()
counts["paper_VEN"] = pd.Series({"sEPSC": 8, "sIPSC": 7, "mEPSC": 8, "mIPSC": 15})
counts["paper_PC"] = pd.Series({"sEPSC": 11, "sIPSC": 8, "mEPSC": 8, "mIPSC": 21})
print("rows per experiment and cell type, against the Fig. 5b legend:")
print(counts.to_string())
table rows: 85 ; distinct files named: 83 ; rows naming a dandiset file: 85
dandiset files the table does not name: ['sub-Mfa201126_ses-sess-201126_obj-fwphyw_icephys.nwb']
files named by more than one row:
      filename_original                                               rawFileName cellType Experiment
2     20201126s1c2-70mV  sub-Mfa201126_ses-sess-201023126_obj-15e3e16_icephys.nwb       PC      sEPSC
4     20201126s1c2-70mV  sub-Mfa201126_ses-sess-201023126_obj-15e3e16_icephys.nwb       PC      sEPSC
21  20201126s5c11a+20mV     sub-Mfa201126_ses-sess-201126_obj-1s3ysck_icephys.nwb       PC      sIPSC
28  20201126s5c11b+20mV     sub-Mfa201126_ses-sess-201126_obj-1s3ysck_icephys.nwb      VEN      sIPSC
table experiment equals the file's own description: True ; table subject equals the file's: True
rows per experiment and cell type, against the Fig. 5b legend:
cellType    PC  VEN  paper_VEN  paper_PC
Experiment                              
mEPSC        8    7          8         8
mIPSC       21   15         15        21
sEPSC       11    8          8        11
sIPSC        8    7          7         8
In [11]:
# The rows of the code's sheets that psc.code_tables reads, as they are in the sheets (header rows and the first entries).
for name, sh, rr, cc in ((psc.SPSC_SHEET, "summary", slice(0, 5), slice(0, 14)), (psc.SPSC_SHEET, "summary", slice(18, 23), slice(0, 14)),
                         (psc.MINI_SHEET, "mEPSC_sum", slice(0, 4), slice(0, 8)), (psc.MINI_SHEET, "mIPSC_sum", slice(0, 4), slice(0, 8))):
    s = psc.sheet(name, sh)
    print(f"{name} / {sh}, rows {rr.start} to {rr.stop - 1} (of {len(s)}), columns {cc.start} to {cc.stop - 1} (of {s.shape[1]}):")
    print(s.iloc[rr, cc].to_string(), "\n")
data_ephy/sPSCs_Fig7ab.xlsx / summary, rows 0 to 4 (of 32), columns 0 to 13 (of 13):
                          0    1         2          3   4   5   6   7             8    9                             10        11         12
0                        NaN  NaN       NaN        NaN NaN NaN NaN NaN           NaN  NaN                           NaN       NaN        NaN
1                        NaN  NaN      freq  Amplitude NaN NaN NaN NaN           NaN  NaN                           NaN      freq  Amplitude
2                EPSCs:- PCs  NaN       NaN        NaN NaN NaN NaN NaN  EPSCs:- VENs  NaN                           NaN       NaN        NaN
3  1126s4c8_Trace_1_6_1_2-70   PC  4.590576   0.189214 NaN NaN NaN NaN           NaN  VEN  1126s5c11b_Trace_1_10_1_2-70  0.655702    0.21939
4  1126s2c4_Trace_1_2_1_2-70   PC  3.332654   0.288201 NaN NaN NaN NaN           NaN  VEN     1126s4c9_Trace_1_3_1_2-70  2.327677   0.118996 

data_ephy/sPSCs_Fig7ab.xlsx / summary, rows 18 to 22 (of 32), columns 0 to 13 (of 13):
                            0    1         2          3   4   5   6   7             8    9                             10        11         12
18                         NaN  NaN       NaN        NaN NaN NaN NaN NaN           NaN  NaN                           NaN       NaN        NaN
19                         NaN  NaN      freq  Amplitude NaN NaN NaN NaN           NaN  NaN                           NaN      freq  Amplitude
20                  IPSCs:_PCs  NaN       NaN        NaN NaN NaN NaN NaN  IPSCs:- VENs  NaN                           NaN       NaN        NaN
21   1126s2c4_Trace_1_4_1_2+20   PC  6.319237   1.026448 NaN NaN NaN NaN           NaN  VEN     1126s4c7_Trace_1_8_1_2+20  1.245192   0.305589
22  1126s5c12_Trace_1_8_1_2+20   PC      1.36   0.271937 NaN NaN NaN NaN           NaN  VEN  1126s5c11b_Trace_1_11_1_2+20  2.200464   0.376214 

data_ephy/miniEPSCs_Fig7ab.xlsx / mEPSC_sum, rows 0 to 3 (of 14), columns 0 to 7 (of 7):
        0          1          2    3         4          5          6
0    VENs  frequency  amplitude  NaN       PCs  frequency  amplitude
1  S02C05   1.399514    0.07413  NaN  S02C0321   1.575191   0.091668
2  S02C07     1.0228    0.06926  NaN   S020322   1.613116   0.079958
3  S02C08    1.39939   0.090327  NaN    S02C11   1.974316   0.093775 

data_ephy/miniEPSCs_Fig7ab.xlsx / mIPSC_sum, rows 0 to 3 (of 37), columns 0 to 7 (of 6):
        0         1        2              3         4           5
0     NaN  cellType  nEvents  duration(sec)  Freqency  aveAmp(pA)
1  AS1C12        PC       91             30  3.033333       12.33
2  AS1C13        PC      130             30  4.333333     21.3395
3  AS1C14        PC       35             30  1.166667    12.35089 

In [12]:
tab = psc.code_tables().rename(columns={"experiment": "Experiment"})
print("sheet entries per experiment and sheet cell type:")
print(tab.groupby(["Experiment", "sheet_type"]).size().unstack().to_string())
lab1 = lab.drop_duplicates(["key", "Experiment"])
link = tab.merge(lab1[["key", "Experiment", "rawFileName", "cellType", "filename_original"]], on=["key", "Experiment"], how="left")
print("sheet entries with no table row:", link[link.rawFileName.isna()][["Experiment", "sheet_name", "sheet_type"]].to_dict("records"))
link = link.dropna(subset=["rawFileName"])
link["same_type"] = link.sheet_type == link.cellType
print("sheet type equals table type, by experiment:")
print(link.groupby("Experiment").same_type.agg(["sum", "size"]).to_string())
print(link[~link.same_type][["Experiment", "sheet_name", "sheet_type", "filename_original", "cellType"]].to_string())
sheet entries per experiment and sheet cell type:
sheet_type  PC  VEN
Experiment         
mEPSC        8    8
mIPSC       21   15
sEPSC       11    8
sIPSC        8    7
sheet entries with no table row: [{'Experiment': 'mEPSC', 'sheet_name': 'S02C0321', 'sheet_type': 'PC'}]
sheet type equals table type, by experiment:
            sum  size
Experiment           
mEPSC         0    15
mIPSC        36    36
sEPSC        19    19
sIPSC        15    15
   Experiment sheet_name sheet_type filename_original cellType
34      mEPSC     S02C05        VEN   20210403AS02C05       PC
36      mEPSC     S02C07        VEN   20210403AS02C07       PC
37      mEPSC    S020322         PC  20210403AS020322      VEN
38      mEPSC     S02C08        VEN   20210403AS02C08       PC
39      mEPSC     S02C11         PC   20210403AS02C11      VEN
40      mEPSC     S04C16        VEN   20210403AS04C16       PC
41      mEPSC     S02C12         PC   20210403AS02C12      VEN
42      mEPSC     S04C18        VEN   20210403AS04C18       PC
43      mEPSC     S04C15         PC   20210403AS04C15      VEN
44      mEPSC     S04C19        VEN   20210403AS04C19       PC
45      mEPSC     S04C20         PC   20210403AS04C20      VEN
46      mEPSC     S04C22        VEN   20210403AS04C22       PC
47      mEPSC     S05C25         PC   20210403AS05C25      VEN
48      mEPSC    S05C26#        VEN  20210403AS05C26#       PC
49      mEPSC     S05C28         PC   20210403AS05C28      VEN
In [13]:
link = link.merge(info[["file", "obj", "subject", "freq_5pA_whole", "amp_5pA_whole", "n_events_5pA_30s", "freq_5pA_30s",
                        "noise_pA"]], left_on="rawFileName", right_on="file")
print("Per experiment: Spearman correlation of the frequency and amplitude measured here (5 pA, whole recording)")
print("with the sheet's, and the median ratio here/sheet:")
agree = []
for exp, g in link.groupby("Experiment"):
    rf = stats.spearmanr(g.freq_5pA_whole, g.sheet_freq); ra = stats.spearmanr(g.amp_5pA_whole, g.sheet_amp)
    agree.append(dict(experiment=exp, n=len(g), rho_freq=rf[0], p_freq=rf[1], rho_amp=ra[0], p_amp=ra[1],
                      ratio_freq=np.median(g.freq_5pA_whole / g.sheet_freq), ratio_amp=np.median(g.amp_5pA_whole / g.sheet_amp)))
agree = pd.DataFrame(agree)
print(agree.round(3).to_string())
print()
print("by subject (median ratio of frequency here/sheet, and median noise):")
print(link.groupby(["Experiment", "subject"]).apply(lambda g: pd.Series(dict(
    n=len(g), ratio_freq=np.median(g.freq_5pA_whole / g.sheet_freq), ratio_amp=np.median(g.amp_5pA_whole / g.sheet_amp),
    noise=np.median(g.noise_pA)))).round(2).to_string())
mi = link[link.Experiment == "mIPSC"]
r30 = stats.spearmanr(mi.n_events_5pA_30s, mi.sheet_n_events)
print(f"\nmIPSC, events in the first 30 s here against the sheet's nEvents over 30 s: rho = {r30[0]:.2f} (p = {r30[1]:.2g}), "
      f"median ratio {np.median(mi.n_events_5pA_30s / mi.sheet_n_events):.2f}")
Per experiment: Spearman correlation of the frequency and amplitude measured here (5 pA, whole recording)
with the sheet's, and the median ratio here/sheet:
  experiment   n  rho_freq  p_freq  rho_amp  p_amp  ratio_freq  ratio_amp
0      mEPSC  15     0.507   0.054    0.771  0.001       0.539      1.295
1      mIPSC  36     0.728   0.000    0.637  0.000       0.670      0.569
2      sEPSC  19     0.341   0.154    0.224  0.357       3.229      0.622
3      sIPSC  15     0.191   0.495    0.736  0.002       5.665      0.403

by subject (median ratio of frequency here/sheet, and median noise):
                         n  ratio_freq  ratio_amp  noise
Experiment subject                                      
mEPSC      Mfa210403  15.0        0.54       1.29   0.92
mIPSC      Mfa250904  36.0        0.67       0.57   0.97
sEPSC      Mfa201023   7.0        0.77       1.08   1.16
           Mfa201030   1.0        8.20       0.55   1.65
           Mfa201126  11.0        4.56       0.52   2.92
sIPSC      Mfa201030   4.0       15.18       0.21  10.84
           Mfa201126  11.0        5.05       0.40   5.16

mIPSC, events in the first 30 s here against the sheet's nEvents over 30 s: rho = 0.57 (p = 0.00026), median ratio 0.65
In [14]:
fig, axes = plt.subplots(1, 4, figsize=(16, 3.6))
for ax, (exp, g) in zip(axes, link.groupby("Experiment")):
    ax.scatter(g.sheet_freq, g.freq_5pA_whole, c=np.where(g.cellType == "VEN", "tab:red", "tab:blue"), s=18)
    lim = max(g.sheet_freq.max(), g.freq_5pA_whole.max()) * 1.05
    ax.plot([0, lim], [0, lim], "k:", lw=0.8)
    ax.set_title(exp); ax.set_xlabel("sheet frequency (Hz)"); ax.set_ylabel("here, 5 pA, whole (Hz)")
plt.tight_layout(); plt.show()
print("axes span every point (0 to the larger maximum); red VEN, blue PC by the table")
No description has been provided for this image
axes span every point (0 to the larger maximum); red VEN, blue PC by the table
In [15]:
# Per file: noise against the frequency detected in the events' direction and in the opposite one, the
# positive control, and the sheet's frequency (where the file is linked to a sheet entry).
pf = info.merge(link[["file", "sheet_freq", "cellType"]].drop_duplicates("file"), on="file", how="left")
cols = ["experiment", "obj", "subject", "cellType", "noise_pA", "duration_s", "freq_5pA_whole", "opp_freq_5pA", "freq_rms_whole",
        "opp_freq_rms", "hit_5pA", "sheet_freq"]
print(pf.sort_values(["experiment", "noise_pA"])[cols].round(2).to_string(index=False))
for exp, g in pf.dropna(subset=["sheet_freq"]).groupby("experiment"):
    lo = g[g.noise_pA < 2]
    r_all = stats.spearmanr(g.freq_5pA_whole, g.sheet_freq)[0]
    r_lo = stats.spearmanr(lo.freq_5pA_whole, lo.sheet_freq)[0] if len(lo) > 3 else np.nan
    print(f"{exp}: rho with the sheet's frequency, all {len(g)} files {r_all:.2f}; files with noise < 2 pA ({len(lo)}) {r_lo:.2f}")
experiment     obj   subject cellType  noise_pA  duration_s  freq_5pA_whole  opp_freq_5pA  freq_rms_whole  opp_freq_rms  hit_5pA  sheet_freq
     mEPSC  nfq9hp Mfa210403       PC      0.41      300.00            0.17          0.00           43.54         43.80     0.94        0.39
     mEPSC 1w2fe2k Mfa210403       PC      0.63      300.00            0.66          0.06           35.98         36.64     0.92        1.02
     mEPSC  a13tyq Mfa210403      VEN      0.69      300.00            0.32          0.00           33.55         35.07     0.93        1.63
     mEPSC 17bl3bi Mfa210403      VEN      0.74      300.00            0.58          0.05           33.03         33.24     0.93        1.07
     mEPSC  mj6gor Mfa210403       PC      0.85      300.00            0.15          0.00           17.56         17.32     0.94        0.96
     mEPSC  ku2uls Mfa210403      VEN      0.86      300.00            0.32          0.08           27.70         28.22     0.95        1.99
     mEPSC 123f7yh Mfa210403       PC      0.91      300.00            0.73          0.14           25.50         27.26     0.94        1.39
     mEPSC  f3z9bv Mfa210403       PC      0.92      300.00            1.17          0.04           24.21         27.40     0.93        1.40
     mEPSC 1hy08yq Mfa210403       PC      0.93      300.00            0.58          0.01           25.27         26.04     0.94        1.67
     mEPSC 1liyekt Mfa210403      VEN      0.94      300.00            2.26          0.22           28.38         31.27     0.94        3.01
     mEPSC 1hq5666 Mfa210403      VEN      0.96      300.00            1.49          0.20           30.21         31.57     0.93        1.61
     mEPSC 1nktpia Mfa210403      VEN      1.00      300.00            1.56          0.12           27.26         28.54     0.92        1.97
     mEPSC 1wplqqi Mfa210403       PC      1.11      300.00            1.36          0.06           17.43         18.61     0.94        1.78
     mEPSC  6dsg94 Mfa210403      VEN      1.12      300.00            0.92          0.04           25.40         25.30     0.94        2.21
     mEPSC   wudwj Mfa210403       PC      1.31      300.00            1.79          0.23           24.60         24.25     0.92        1.40
     mIPSC  lx27k4 Mfa250904      VEN      0.38      267.51            0.35          0.00           35.12         38.51     0.93        1.50
     mIPSC 1ydhi4e Mfa250904       PC      0.48      150.79            0.56          0.01           33.76         33.07     0.96        1.73
     mIPSC  ceurdc Mfa250904       PC      0.51      150.79            0.59          0.05           29.97         27.79     0.95        1.17
     mIPSC  6nwydh Mfa250904      VEN      0.53      300.96            0.41          0.01           42.41         44.94     0.95        0.63
     mIPSC  81799o Mfa250904       PC      0.62      300.96            1.55          0.05           35.83         40.78     0.92        2.27
     mIPSC  3wd62v Mfa250904      VEN      0.62      300.96            0.22          0.00           17.02         17.40     0.93        2.47
     mIPSC  kv91hc Mfa250904       PC      0.63      200.62            1.57          0.09           28.90         36.22     0.92        2.70
     mIPSC 17j2vbx Mfa250904       PC      0.64      300.96            0.74          0.01           42.70         45.35     0.93        1.03
     mIPSC  diwa3z Mfa250904       PC      0.65      300.96            2.99          0.37           29.54         36.52     0.90        5.73
     mIPSC 10il1l4 Mfa250904       PC      0.65      300.96            2.04          0.24           37.13         41.06     0.90        3.00
     mIPSC 194xr8x Mfa250904      VEN      0.67      234.07            0.78          0.06           32.62         40.16     0.92        2.43
     mIPSC 14j4kki Mfa250904       PC      0.78      150.79            1.89          0.02           18.95         21.09     0.92        3.03
     mIPSC  22w7ba Mfa250904      VEN      0.82      150.79            1.51          0.05            7.81         10.13     0.90        2.77
     mIPSC 1s2txk3 Mfa250904      VEN      0.84      200.62            1.63          0.11           19.00         24.69     0.91        2.77
     mIPSC 1t5vb83 Mfa250904       PC      0.84      300.96            2.79          0.32           36.84         47.06     0.90        3.07
     mIPSC 1bcj2jv Mfa250904       PC      0.92      150.79            2.64          0.21           27.11         30.52     0.89        4.07
     mIPSC 1j3066r Mfa250904      VEN      0.93      300.96            1.02          0.12           31.63         37.35     0.91        1.70
     mIPSC  gf735e Mfa250904      VEN      0.96      150.79            0.82          0.01            9.60          9.60     0.95        1.23
     mIPSC  x8p67c Mfa250904       PC      0.98      150.79            3.62          0.31           17.55         22.81     0.92        4.83
     mIPSC 1ky79xo Mfa250904       PC      1.00      150.79            2.63          0.08            8.97          8.65     0.90        5.57
     mIPSC 1lkob2k Mfa250904       PC      1.01      150.79            2.35          0.05           16.39         17.73     0.91        2.73
     mIPSC 1tnc09p Mfa250904       PC      1.01      150.79            1.62          0.16           24.70         25.96     0.91        2.40
     mIPSC  7j7uo6 Mfa250904      VEN      1.01      150.79            1.91          0.28           14.58         17.56     0.92        2.50
     mIPSC 1fpy6du Mfa250904       PC      1.03      300.96            1.21          0.79           36.17         37.15     0.91        1.00
     mIPSC 1w51hrn Mfa250904      VEN      1.05      300.96            1.58          0.23           42.70         46.51     0.89        2.30
     mIPSC 1tmlevr Mfa250904      VEN      1.06      150.79            0.56          0.01            4.68          3.79     0.95        1.83
     mIPSC  t6xhex Mfa250904      VEN      1.07      150.79            2.16          0.13            9.78         11.94     0.88        3.60
     mIPSC  zt8i6q Mfa250904       PC      1.23      300.96            1.78          0.32           35.04         35.29     0.90        2.77
     mIPSC 1w6meet Mfa250904       PC      1.28      150.79            3.79          0.34           11.53         13.75     0.89        4.33
     mIPSC  flbag1 Mfa250904       PC      1.29      150.79            3.37          0.70           21.33         24.54     0.88        3.77
     mIPSC  t8ygv1 Mfa250904      VEN      1.30      300.96            1.49          0.20           32.09         34.61     0.92        1.57
     mIPSC  3jwnce Mfa250904       PC      1.45      300.96            4.83          0.49           21.04         26.61     0.88        6.80
     mIPSC 1h8f0vp Mfa250904       PC      1.61      300.96            3.85          0.28            8.73          8.92     0.88        3.67
     mIPSC  opivqg Mfa250904      VEN      1.89      150.79            1.23          0.03            4.09          1.66     0.89        1.33
     mIPSC 1hzamhk Mfa250904       PC      4.18      234.07           25.44         42.61           35.69         47.24     0.61        2.70
     mIPSC 1f5h8p1 Mfa250904      VEN      4.76      150.79           19.42         21.99           21.37         24.36     0.82        1.23
     sEPSC  a8xj73 Mfa201023      VEN      0.94      222.10            1.20          0.12           33.12         34.89     0.94        1.90
     sEPSC  meypbx Mfa201023      VEN      0.97      180.00            0.43          0.04           25.68         27.06     0.94        0.63
     sEPSC 1h8uzvv Mfa201023       PC      1.12      120.00            6.72          0.85           22.58         27.30     0.87        7.12
     sEPSC 1igffau Mfa201023       PC      1.16      120.00            3.02          0.53           34.64         36.10     0.94        3.45
     sEPSC  b0ewiw Mfa201023      VEN      1.18      120.00            0.75          0.13           31.09         31.69     0.92        1.23
     sEPSC 1pa4y3o Mfa201023      VEN      1.19      180.00            1.87          0.12           28.88         31.44     0.92        2.41
     sEPSC 1i9bc2s Mfa201126       PC      1.46      271.93            3.74          1.34           39.12         34.50     0.90        0.61
     sEPSC 1eq93e8 Mfa201023       PC      1.59      120.00            2.61          0.34           24.86         24.95     0.92        3.25
     sEPSC  mhbl1b Mfa201030      VEN      1.65      480.00            3.67          1.63           42.76         35.93     0.90        0.45
     sEPSC  uvslhx Mfa201126      VEN      1.92      234.32            2.25          0.64           24.02         23.51     0.90        1.19
     sEPSC 1u56rnh Mfa201126      VEN      2.10      160.12            9.91          5.53           39.02         34.83     0.87        2.33
     sEPSC 1n7bo55 Mfa201126       PC      2.29      300.00           15.02          7.53           36.82         30.60     0.81        2.70
     sEPSC 16olqir Mfa201126       PC      2.80      211.13           13.24          7.29           29.89         24.42     0.80        4.59
     sEPSC  wn6cw2 Mfa201126      VEN      2.92      300.00           17.00         12.39           34.19         29.92     0.84        0.66
     sEPSC 15e3e16 Mfa201126       PC      3.99      130.96            9.36          5.74           14.28         11.80     0.82        2.90
     sEPSC  t0bi1r Mfa201126       PC      4.81      242.31           13.45          7.92           14.17          8.98     0.78        3.33
     sEPSC  jgrzuw Mfa201126       PC      5.10      300.00           23.56         21.73           22.97         21.06     0.77        1.61
     sEPSC 1ap4tuj Mfa201126       PC      8.17      194.82           31.97         31.90           21.85         16.30     0.57        6.44
     sIPSC 1tsbdsc Mfa201126       PC      3.64      217.62            5.45          3.23            9.05          9.97     0.82        2.84
     sIPSC 1s3ysck Mfa201126      VEN      3.89      178.79           11.70         15.03           17.62         24.00     0.78        2.20
     sIPSC  w9b4ds Mfa201126       PC      4.06      293.68            6.28          2.70            8.02          6.85     0.83        1.36
     sIPSC 1tuqzm9 Mfa201126      VEN      4.10      300.00            7.63          6.66           10.84         12.33     0.83        1.35
     sIPSC  fwphyw Mfa201126      NaN      5.15      300.00            9.90         11.69            9.40         10.78     0.80         NaN
     sIPSC  t3fiuv Mfa201126      VEN      5.16      300.00           13.57         15.12           12.99         14.26     0.80        1.25
     sIPSC  x2i11w Mfa201030      VEN      5.75      240.00           19.87         21.71           17.08         15.89     0.77        1.89
     sIPSC 12i0fre Mfa201126       PC      6.12      300.00           12.44         12.88            9.60          6.91     0.76        2.84
     sIPSC 1qoizw2 Mfa201126      VEN      7.94       95.89           22.68         28.69           13.00         10.43     0.69        1.77
     sIPSC 11eyh5v Mfa201126       PC      8.58      300.00           18.46         22.45           10.80          4.95     0.71        3.65
     sIPSC 1t919ap Mfa201030      VEN      9.40      240.00           36.02         39.23           15.50         16.79     0.64        1.49
     sIPSC  yd3b19 Mfa201030      VEN     12.27      240.00           37.52         43.84           13.56         13.05     0.61        1.89
     sIPSC  n29ivo Mfa201030       PC     18.23      200.00           34.14         48.14           11.48          5.83     0.54        4.03
     sIPSC  rlgjzz Mfa201126       PC     21.20      300.00           18.53         28.58            8.71          1.42     0.57        6.32
     sIPSC  838ym4 Mfa201126       PC     37.51      300.00           32.09         47.41           10.62          1.70     0.44        7.36
mEPSC: rho with the sheet's frequency, all 15 files 0.51; files with noise < 2 pA (15) 0.51
mIPSC: rho with the sheet's frequency, all 36 files 0.73; files with noise < 2 pA (34) 0.87
sEPSC: rho with the sheet's frequency, all 18 files 0.34; files with noise < 2 pA (10) 0.16
sIPSC: rho with the sheet's frequency, all 14 files 0.22; files with noise < 2 pA (0) nan

Result: partially reproduced. All 85 rows of metadata_PSC.csv name a file of the dandiset, the table's experiment and subject agree with every file's own metadata, and its counts per experiment and cell type equal the Fig. 5b legend except mEPSC VENs (7 rows against 8). Three parts fail. (1) One file, fwphyw (sIPSC, Cell_AS011 of session 201126), is named by no row, while 1s3ysck is named twice, once as PC 20201126s5c11a and once as VEN 20201126s5c11b; and the sEPSC PC 20201126s1c2 is one file counted twice, as the code's sheet does. (2) For mEPSC the sheet's cell type differs from the table's for all 15 matched cells, and the sheet's PC S02C0321 has no row; for sEPSC, sIPSC and mIPSC the types agree (19, 15 and 36 of 36). (3) The frequencies measured here correlate with the sheet's for mIPSC (rho 0.73; 0.87 in its 34 files with noise below 2 pA) but not significantly for mEPSC (rho 0.51, p 0.054), sEPSC (0.34) or sIPSC (0.19). The frequencies here are near the sheet's in the low-noise sEPSC files of Mfa201023 (median ratio 0.77, amplitude ratio 1.08) and 4.6 to 15 times the sheet's in the noisier sEPSC and sIPSC files of Mfa201126 and Mfa201030, where the detector check finds opposite-polarity peaks at half the rate of the events or more (about half in the sEPSC files of 2 to 4 pA noise, about as many in most sIPSC files); so much of the disagreement is in detection, not in which recording is which. In the 10 sEPSC files with noise below 2 pA the correlation is still weak (rho 0.16), so detection does not explain all of it. The mIPSC counts over the first 30 s correlate with the sheet's 30 s counts (rho 0.57, median ratio 0.65).

Group comparisons: shared code¶

Per cell, frequency (Hz) and mean amplitude (pA) under each reading. The cell groups are the table's rows (the dataset's labels, as the claims file asks). The readings the claims file and the data require:

  • threshold (a) 5 pA, (b) the recording's RMS noise, over the whole recording (both decide); the first 30 s (the code's window) is a variant;
  • sEPSC: the PC group as (a) the paper's 11 entries, which count file 15e3e16 (cell 20201126s1c2) twice, and (b) the 10 distinct cells;
  • sIPSC: the table gives PC 20201126s5c11a and VEN 20201126s5c11b the same file (1s3ysck) and names no row for fwphyw, the other file of cell Cell_AS011 in that session. Readings: (A) the table as it is, one file in both groups; (B) 1s3ysck is 11a (PC) and fwphyw 11b (VEN); (C) the reverse;
  • mEPSC: the table's labels decide; the sheet's labelling (the other way round) is a variant.

The test is the two-tailed Wilcoxon rank-sum test as MATLAB's ranksum computes it by default, the function Fig5ab_ana_sPSC.m and Fig5ab_ana_mPSC.m call (helper psc.ranksum): exact when the smaller group has fewer than 10 cells and both together fewer than 20 (sEPSC, sIPSC, mEPSC), otherwise the normal approximation (mIPSC). The column test says which.

Each claim also shows robust(...): variants at 5 pA over the whole recording that bear on the recordings' quality and decide nothing (files with noise below 2 pA; files of at least 5 min and with at least 200 events, the Methods' minimums; and the frequency minus that of opposite-polarity peaks, the noise null of the detector check).

In [16]:
def groups(exp, reading_rows="table", s11=None, sheet_labels=False):
    """The rows (file, cell type) of one experiment under a reading."""
    g = lab[lab.Experiment == exp][["filename_original", "rawFileName", "cellType", "key"]].copy()
    if reading_rows == "distinct":
        g = g.drop_duplicates("rawFileName")
    if exp == "sIPSC" and s11 in ("B", "C"):
        other = [f for f in files - set(lab.rawFileName) if "fwphyw" in f][0]
        tgt = "20201126s5c11b+20mV" if s11 == "B" else "20201126s5c11a+20mV"
        g.loc[g.filename_original == tgt, "rawFileName"] = other
    if sheet_labels:
        st = tab[tab.Experiment == exp].set_index("key").sheet_type
        g["cellType"] = g.key.map(st)
        g = g.dropna(subset=["cellType"])
    return g.merge(info, left_on="rawFileName", right_on="file")

def compare(g, col):
    v, p = g[g.cellType == "VEN"][col].dropna(), g[g.cellType == "PC"][col].dropna()
    if len(v) < 2 or len(p) < 2:
        return dict(n_VEN=len(v), n_PC=len(p))
    u, pval, method = psc.ranksum(v, p)
    return dict(n_VEN=len(v), n_PC=len(p), VEN_median=v.median(), PC_median=p.median(),
                VEN_range=f"{v.min():.2f}-{v.max():.2f}", PC_range=f"{p.min():.2f}-{p.max():.2f}",
                diff=v.median() - p.median(), U=u, p=pval, test=method)

def table(exp, measure, extra=()):
    rows = []
    for rd in ("5pA_whole", "rms_whole", "5pA_30s", "rms_30s", "3rms_whole"):
        for opt in extra or [dict()]:
            g = groups(exp, **opt)
            rows.append(dict(reading=rd, **{k: str(v) for k, v in opt.items()}, **compare(g, f"{measure}_{rd}")))
    return pd.DataFrame(rows)

def robust(exp, measure, **opt):
    """Variants at 5 pA over the whole recording that bear on the recordings' quality (they decide nothing):
    all files; files with noise below 2 pA; files of at least 5 min; files with at least 200 events; and,
    for frequency, the frequency minus that of opposite-polarity peaks (the noise null of the detector check)."""
    g = groups(exp, **opt)
    col = f"{measure}_5pA_whole"
    sets = [("all files", g, col), ("noise < 2 pA", g[g.noise_pA < 2], col),
            ("at least 5 min", g[g.duration_s >= 300], col), ("at least 200 events", g[g.n_events_5pA_whole >= 200], col)]
    if measure == "freq":
        g = g.assign(freq_net=g.freq_5pA_whole - g.opp_freq_5pA)
        sets.append(("minus opposite-polarity rate", g, "freq_net"))
    return pd.DataFrame([dict(variant=name, **compare(s, c)) for name, s, c in sets])

def by_subject(exp, col, **opt):
    g = groups(exp, **opt)
    return g.groupby(["subject", "cellType"])[col].agg(["size", "median", "min", "max"]).round(2)

The paper's own per-cell values¶

The code's sheets hold the paper's per-cell frequencies and amplitudes. Tested as the figure tests them, with the sheet's labels and with the table's (the dataset's), they show what the paper's analysis gives and how far the labels alone change it, apart from any detection. They decide no outcome.

In [17]:
# The paper's own per-cell values (the code's sheets), tested as the paper's figure tests them, with the
# sheet's labels and with the table's labels (the dataset's). This separates the labels from the detection;
# it decides no outcome.
rows = []
for exp, g in tab.groupby("Experiment"):
    g = g.merge(lab.drop_duplicates(["key", "Experiment"])[["key", "Experiment", "cellType"]], on=["key", "Experiment"], how="left")
    for labelling, col in (("sheet", "sheet_type"), ("table", "cellType")):
        gg = g.dropna(subset=[col]).assign(cellType=lambda d: d[col])
        for m in ("sheet_freq", "sheet_amp"):
            rows.append(dict(experiment=exp, labels=labelling, measure=m, **compare(gg, m)))
sheet_tests = pd.DataFrame(rows)
print(sheet_tests.round(4).to_string())
   experiment labels     measure  n_VEN  n_PC  VEN_median  PC_median    VEN_range      PC_range    diff      U       p        test
0       mEPSC  sheet  sheet_freq      8     8      1.3935     1.8034    0.39-1.78     1.07-3.01 -0.4099   11.0  0.0281       exact
1       mEPSC  sheet   sheet_amp      8     8      6.5587     7.3261    3.89-9.03     3.18-9.38 -0.7674   26.0  0.5737       exact
2       mEPSC  table  sheet_freq      7     8      1.9743     1.3935    1.07-3.01     0.39-1.78  0.5808   47.0  0.0289       exact
3       mEPSC  table   sheet_amp      7     8      6.6564     6.5587    3.18-9.38     3.89-9.03  0.0977   30.0  0.8665       exact
4       mIPSC  sheet  sheet_freq     15    21      1.8333     3.0000    0.63-3.60     1.00-6.80 -1.1667   77.0  0.0102  asymptotic
5       mIPSC  sheet   sheet_amp     15    21     15.3496    19.6801   7.48-28.43    6.97-28.76 -4.3305  111.0  0.1399  asymptotic
6       mIPSC  table  sheet_freq     15    21      1.8333     3.0000    0.63-3.60     1.00-6.80 -1.1667   77.0  0.0102  asymptotic
7       mIPSC  table   sheet_amp     15    21     15.3496    19.6801   7.48-28.43    6.97-28.76 -4.3305  111.0  0.1399  asymptotic
8       sEPSC  sheet  sheet_freq      8    11      1.2107     3.2480    0.45-2.41     0.61-7.12 -2.0372   12.0  0.0068       exact
9       sEPSC  sheet   sheet_amp      8    11     11.6325    13.5528   7.15-21.94    7.92-49.11 -1.9202   24.0  0.1087       exact
10      sEPSC  table  sheet_freq      8    11      1.2107     3.2480    0.45-2.41     0.61-7.12 -2.0372   12.0  0.0068       exact
11      sEPSC  table   sheet_amp      8    11     11.6325    13.5528   7.15-21.94    7.92-49.11 -1.9202   24.0  0.1087       exact
12      sIPSC  sheet  sheet_freq      7     8      1.7739     3.2473    1.25-2.20     1.36-7.36 -1.4735    6.0  0.0093       exact
13      sIPSC  sheet   sheet_amp      7     8     37.6214    35.9134  19.99-77.78  25.19-136.70  1.7081   24.0  0.6943       exact
14      sIPSC  table  sheet_freq      7     8      1.7739     3.2473    1.25-2.20     1.36-7.36 -1.4735    6.0  0.0093       exact
15      sIPSC  table   sheet_amp      7     8     37.6214    35.9134  19.99-77.78  25.19-136.70  1.7081   24.0  0.6943       exact

fig5b-sepsc-frequency¶

The frequency of spontaneous EPSCs is lower in VENs than in neighbouring PCs.

Criterion: reproduced when, under every combination of the readings (threshold 5 pA or RMS noise; PC group of 11 entries or 10 cells), the VEN median is below the PC median with p < 0.05; blocked as methods_underspecified when the readings disagree.

In [18]:
t = table("sEPSC", "freq", [dict(reading_rows="table"), dict(reading_rows="distinct")])
print(t.round(4).to_string())
print("\nby subject (5 pA, whole, table rows):")
print(by_subject("sEPSC", "freq_5pA_whole").to_string())
print("\nby subject (RMS, whole, table rows):")
print(by_subject("sEPSC", "freq_rms_whole").to_string())
g = groups("sEPSC")
print("\nnoise (pA) by subject and cell type:")
print(g.groupby(["subject", "cellType"]).noise_pA.agg(["median", "min", "max"]).round(2).to_string())
print("\nquality variants (5 pA, whole), 11 PC entries:")
print(robust("sEPSC", "freq").round(4).to_string())
print("10 distinct PCs:")
print(robust("sEPSC", "freq", reading_rows="distinct").round(4).to_string())
      reading reading_rows  n_VEN  n_PC  VEN_median  PC_median    VEN_range     PC_range     diff     U       p   test
0   5pA_whole        table      8    11      2.0600     9.3614   0.43-17.00   2.61-31.97  -7.3014  17.0  0.0259  exact
1   5pA_whole     distinct      8    10      2.0600    11.3021   0.43-17.00   2.61-31.97  -9.2421  15.0  0.0266  exact
2   rms_whole        table      8    11     32.1062    22.9700  24.02-42.76  14.17-39.12   9.1362  65.0  0.0908  exact
3   rms_whole     distinct      8    10     32.1062    23.9142  24.02-42.76  14.17-39.12   8.1920  57.0  0.1457  exact
4     5pA_30s        table      8    11      3.4833    12.9333   0.40-18.37   5.23-34.03  -9.4500  10.5  0.0050  exact
5     5pA_30s     distinct      8    10      3.4833    15.6500   0.40-18.37   5.23-34.03 -12.1667   9.5  0.0062  exact
6     rms_30s        table      8    11     30.5000    24.8000  20.87-41.53  13.40-42.20   5.7000  63.0  0.1288  exact
7     rms_30s     distinct      8    10     30.5000    25.4833  20.87-41.53  13.40-42.20   5.0167  55.0  0.2031  exact
8  3rms_whole        table      8    11      2.8227     3.5712    1.57-4.91    1.37-7.83  -0.7485  31.0  0.3100  exact
9  3rms_whole     distinct      8    10      2.8227     3.8064    1.57-4.91    1.37-7.83  -0.9837  23.0  0.1457  exact

by subject (5 pA, whole, table rows):
                    size  median   min    max
subject   cellType                           
Mfa201023 PC           3    3.02  2.61   6.72
          VEN          4    0.98  0.43   1.87
Mfa201030 VEN          1    3.67  3.67   3.67
Mfa201126 PC           8   13.35  3.74  31.97
          VEN          3    9.91  2.25  17.00

by subject (RMS, whole, table rows):
                    size  median    min    max
subject   cellType                            
Mfa201023 PC           3   24.86  22.58  34.64
          VEN          4   29.99  25.68  33.12
Mfa201030 VEN          1   42.76  42.76  42.76
Mfa201126 PC           8   22.41  14.17  39.12
          VEN          3   34.19  24.02  39.02

noise (pA) by subject and cell type:
                    median   min   max
subject   cellType                    
Mfa201023 PC          1.16  1.12  1.59
          VEN         1.07  0.94  1.19
Mfa201030 VEN         1.65  1.65  1.65
Mfa201126 PC          3.99  1.46  8.17
          VEN         2.10  1.92  2.92

quality variants (5 pA, whole), 11 PC entries:
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0                     all files      8    11      2.0600     9.3614  0.43-17.00   2.61-31.97 -7.3014  17.0  0.0259  exact
1                  noise < 2 pA      6     4      1.5344     3.3783   0.43-3.67    2.61-6.72 -1.8439   2.0  0.0381  exact
2                at least 5 min      2     2     10.3381    19.2900  3.67-17.00  15.02-23.56 -8.9519   1.0  0.6667  exact
3           at least 200 events      6    11      2.9631     9.3614  1.20-17.00   2.61-31.97 -6.3983  17.0  0.1215  exact
4  minus opposite-polarity rate      8    11      1.6816     3.6193   0.39-4.62    0.07-7.49 -1.9378  21.0  0.0620  exact
10 distinct PCs:
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0                     all files      8    10      2.0600    11.3021  0.43-17.00   2.61-31.97 -9.2421  15.0  0.0266  exact
1                  noise < 2 pA      6     4      1.5344     3.3783   0.43-3.67    2.61-6.72 -1.8439   2.0  0.0381  exact
2                at least 5 min      2     2     10.3381    19.2900  3.67-17.00  15.02-23.56 -8.9519   1.0  0.6667  exact
3           at least 200 events      6    10      2.9631    11.3021  1.20-17.00   2.61-31.97 -8.3390  15.0  0.1179  exact
4  minus opposite-polarity rate      8    10      1.6816     3.0513   0.39-4.62    0.07-7.49 -1.3698  19.0  0.0676  exact

Result: blocked (methods_underspecified). The two threshold readings the criterion names disagree. At 5 pA the VEN median is below the PC median (2.06 against 9.36 Hz, exact rank-sum p = 0.026 with 11 PC entries; 2.06 against 11.30 Hz, p = 0.027 with 10 cells). At the recording's RMS noise the VEN median is above the PC median (32.1 against 23.0 Hz, p = 0.091; 10 cells p = 0.146), but the detector check shows that this reading counts noise: opposite-polarity peaks are as frequent as the events (sEPSC files with noise below 2 pA, 31.6 against 30.0 Hz). The 30 s window gives the same split (5 pA p = 0.005, RMS VEN higher). With three times the noise, a variant, VEN 2.82 against PC 3.57 Hz, p = 0.31. The 5 pA difference rests partly on noise: 8 of the 11 PC rows come from the noisier subject Mfa201126 (median PC noise 3.99 pA). In the files with noise below 2 pA VENs are still lower (1.53 against 3.38 Hz, 6 and 4 cells, p = 0.038), and after the opposite-polarity rate is subtracted p = 0.062; only 2 VEN and 2 PC files last 5 min or more (p = 0.67). The paper's own sheet values give VEN 1.21 against PC 3.25 Hz, p = 0.0068.

fig5b-sipsc-frequency¶

The frequency of spontaneous IPSCs is lower in VENs than in neighbouring PCs.

Events are outward: the files are described as held at +20 mV, and their holding currents are positive (data check). Criterion as for sEPSC, with no duplicate reading; the 11a/11b readings (A, B, C) come from the table.

In [19]:
t = table("sIPSC", "freq", [dict(s11="A"), dict(s11="B"), dict(s11="C")])
print(t.round(4).to_string())
print("\nby subject (5 pA, whole, reading B):")
print(by_subject("sIPSC", "freq_5pA_whole", s11="B").to_string())
print("\nby subject (RMS, whole, reading B):")
print(by_subject("sIPSC", "freq_rms_whole", s11="B").to_string())
for s in "ABC":
    print(f"\nquality variants (5 pA, whole), reading {s}:")
    print(robust("sIPSC", "freq", s11=s).round(4).to_string())
       reading s11  n_VEN  n_PC  VEN_median  PC_median    VEN_range    PC_range    diff     U       p   test
0    5pA_whole   A      7     8     19.8667    15.4500   7.63-37.52  5.45-34.14  4.4167  36.5  0.3969  exact
1    5pA_whole   B      7     8     19.8667    15.4500   7.63-37.52  5.45-34.14  4.4167  36.0  0.3969  exact
2    5pA_whole   C      7     8     19.8667    15.4500   7.63-37.52  5.45-34.14  4.4167  37.0  0.3357  exact
3    rms_whole   A      7     8     13.5583    10.1117  10.84-17.62  8.02-17.62  3.4467  48.5  0.0205  exact
4    rms_whole   B      7     8     13.0041    10.1117   9.40-17.08  8.02-17.62  2.8924  44.0  0.0721  exact
5    rms_whole   C      7     8     13.5583     9.5000  10.84-17.62  8.02-11.47  4.0583  55.0  0.0006  exact
6      5pA_30s   A      7     8     22.7000    19.8000  13.93-42.80  6.57-35.57  2.9000  36.5  0.3969  exact
7      5pA_30s   B      7     8     22.7000    19.8000  13.93-42.80  6.57-35.57  2.9000  35.0  0.4634  exact
8      5pA_30s   C      7     8     22.7000    19.3000  13.93-42.80  6.57-35.57  3.4000  37.0  0.3357  exact
9      rms_30s   A      7     8     17.7333    11.0500  13.17-25.20  6.97-25.20  6.6833  47.5  0.0289  exact
10     rms_30s   B      7     8     17.4333    11.0500  13.17-21.77  6.97-25.20  6.3833  47.0  0.0289  exact
11     rms_30s   C      7     8     17.7333    11.0500  13.17-25.20  6.97-17.43  6.6833  51.0  0.0059  exact
12  3rms_whole   A      7     8      1.8833     2.5476    1.26-4.75   1.50-4.75 -0.6643  20.5  0.4634  exact
13  3rms_whole   B      7     8      1.8833     2.5476    1.26-3.18   1.50-4.75 -0.6643  17.0  0.2319  exact
14  3rms_whole   C      7     8      1.8833     2.2726    1.26-4.75   1.50-4.07 -0.3893  22.0  0.5358  exact

by subject (5 pA, whole, reading B):
                    size  median    min    max
subject   cellType                            
Mfa201030 PC           1   34.14  34.14  34.14
          VEN          3   36.02  19.87  37.52
Mfa201126 PC           7   12.44   5.45  32.09
          VEN          4   11.74   7.63  22.68

by subject (RMS, whole, reading B):
                    size  median    min    max
subject   cellType                            
Mfa201030 PC           1   11.48  11.48  11.48
          VEN          3   15.50  13.56  17.08
Mfa201126 PC           7    9.60   8.02  17.62
          VEN          4   11.91   9.40  13.00

quality variants (5 pA, whole), reading A:
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0                     all files      7     8     19.8667    15.4500  7.63-37.52   5.45-34.14  4.4167  36.5  0.3969  exact
1                  noise < 2 pA      0     0         NaN        NaN         NaN          NaN     NaN   NaN     NaN    NaN
2                at least 5 min      2     4     10.6017    18.4967  7.63-13.57  12.44-32.09 -7.8950   1.0  0.2667  exact
3           at least 200 events      7     8     19.8667    15.4500  7.63-37.52   5.45-34.14  4.4167  36.5  0.3969  exact
4  minus opposite-polarity rate      7     8     -3.2167    -3.6601  -6.31-0.97  -15.33-3.58  0.4435  31.5  0.7789  exact

quality variants (5 pA, whole), reading B:
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0                     all files      7     8     19.8667    15.4500  7.63-37.52   5.45-34.14  4.4167  36.0  0.3969  exact
1                  noise < 2 pA      0     0         NaN        NaN         NaN          NaN     NaN   NaN     NaN    NaN
2                at least 5 min      3     4      9.8967    18.4967  7.63-13.57  12.44-32.09 -8.6000   1.0  0.1143  exact
3           at least 200 events      7     8     19.8667    15.4500  7.63-37.52   5.45-34.14  4.4167  36.0  0.3969  exact
4  minus opposite-polarity rate      7     8     -1.8417    -3.6601  -6.31-0.97  -15.33-3.58  1.8185  32.0  0.6943  exact

quality variants (5 pA, whole), reading C:
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0                     all files      7     8     19.8667      15.45  7.63-37.52   5.45-34.14  4.4167  37.0  0.3357  exact
1                  noise < 2 pA      0     0         NaN        NaN         NaN          NaN     NaN   NaN     NaN    NaN
2                at least 5 min      2     5     10.6017      18.46  7.63-13.57   9.90-32.09 -7.8583   2.0  0.3810  exact
3           at least 200 events      7     8     19.8667      15.45  7.63-37.52   5.45-34.14  4.4167  37.0  0.3357  exact
4  minus opposite-polarity rate      7     8     -3.2167      -2.89  -6.31-0.97  -15.33-3.58 -0.3267  29.0  0.9551  exact
In [20]:
# Detection in the sIPSC files, the analysis behind the block of the sIPSC claims:
# per file, the noise, the frequency detected at 5 pA in the events' direction and in the opposite one and
# their ratio, the share of injected events recovered, and the frequency and amplitude here over the sheet's.
q = pf.merge(link[["file", "sheet_amp"]].drop_duplicates("file"), on="file", how="left")
q = q.assign(opp_ratio=q.opp_freq_5pA / q.freq_5pA_whole, freq_over_sheet=q.freq_5pA_whole / q.sheet_freq,
             amp_over_sheet=q.amp_5pA_whole / q.sheet_amp)
si = q[q.experiment == "sIPSC"].sort_values("noise_pA")
print(si[["obj", "cellType", "noise_pA", "freq_5pA_whole", "opp_freq_5pA", "opp_ratio", "hit_5pA", "hit_over10pA_5pA",
          "freq_over_sheet", "amp_over_sheet"]].round(2).to_string(index=False))
print(f"\nsIPSC files: {len(si)}; noise below 2 pA: {int((si.noise_pA < 2).sum())}; opposite/forward ratio median "
      f"{si.opp_ratio.median():.2f} ({si.opp_ratio.min():.2f} to {si.opp_ratio.max():.2f}), 0.5 or more in "
      f"{int((si.opp_ratio >= 0.5).sum())}; injected events recovered {si.hit_5pA.min():.2f} to {si.hit_5pA.max():.2f}")
print("\nfor comparison, opposite/forward ratio at 5 pA, median per experiment and noise (pA):")
print(q.groupby(["experiment", "noise_bin"], observed=True).agg(files=("file", "size"), opp_ratio=("opp_ratio", "median"),
      recovered=("hit_5pA", "median")).round(2).to_string())
    obj cellType  noise_pA  freq_5pA_whole  opp_freq_5pA  opp_ratio  hit_5pA  hit_over10pA_5pA  freq_over_sheet  amp_over_sheet
1tsbdsc       PC      3.64            5.45          3.23       0.59     0.82              0.94             1.92            0.50
1s3ysck      VEN      3.89           11.70         15.03       1.29     0.78              0.90             5.32            0.40
 w9b4ds       PC      4.06            6.28          2.70       0.43     0.83              0.91             4.62            0.40
1tuqzm9      VEN      4.10            7.63          6.66       0.87     0.83              0.93             5.66            0.45
 fwphyw      NaN      5.15            9.90         11.69       1.18     0.80              0.92              NaN             NaN
 t3fiuv      VEN      5.16           13.57         15.12       1.11     0.80              0.90            10.90            0.32
 x2i11w      VEN      5.75           19.87         21.71       1.09     0.77              0.89            10.50            0.42
12i0fre       PC      6.12           12.44         12.88       1.04     0.76              0.86             4.38            0.53
1qoizw2      VEN      7.94           22.68         28.69       1.26     0.69              0.80            12.79            0.30
11eyh5v       PC      8.58           18.46         22.45       1.22     0.71              0.82             5.05            0.44
1t919ap      VEN      9.40           36.02         39.23       1.09     0.64              0.76            24.19            0.19
 yd3b19      VEN     12.27           37.52         43.84       1.17     0.61              0.71            19.86            0.20
 n29ivo       PC     18.23           34.14         48.14       1.41     0.54              0.64             8.48            0.22
 rlgjzz       PC     21.20           18.53         28.58       1.54     0.57              0.68             2.93            0.41
 838ym4       PC     37.51           32.09         47.41       1.48     0.44              0.53             4.36            0.33

sIPSC files: 15; noise below 2 pA: 0; opposite/forward ratio median 1.17 (0.43 to 1.54), 0.5 or more in 14; injected events recovered 0.44 to 0.83

for comparison, opposite/forward ratio at 5 pA, median per experiment and noise (pA):
                      files  opp_ratio  recovered
experiment noise_bin                             
mEPSC      <2            15       0.08       0.94
mIPSC      <2            34       0.07       0.91
           4-6            2       1.40       0.71
sEPSC      <2            10       0.15       0.92
           2-4            5       0.56       0.82
           4-6            2       0.76       0.77
           >6             1       1.00       0.57
sIPSC      2-4            2       0.94       0.80
           4-6            5       1.09       0.80
           >6             8       1.24       0.63

Result: blocked, methods_underspecified. In these recordings a detector at the Methods' 5 pA threshold does not separate events from noise, and the paper gives no other detection setting (miniAnalysis's amplitude and area thresholds, filtering) that would; the RMS reading counts noise in every experiment. So no measurement of sIPSC frequency here has a defensible basis. The third verification round agreed. As written, the criterion would give not reproduced: under neither threshold reading is the VEN median below the PC median. At 5 pA VEN 19.9 against PC 15.4 Hz (p = 0.34 to 0.40 under the three assignments of file fwphyw); at the RMS noise VEN 13.0 to 13.6 against PC 9.5 to 10.1 Hz (p = 0.0006 to 0.072, VEN higher). With three times the noise, a variant, VEN 1.88 against PC 2.27 to 2.55 Hz, lower but not significantly (p = 0.23 to 0.54). These frequencies largely measure noise (cell above): no sIPSC file has noise below 2 pA; in 13 of the 15 files opposite-polarity peaks are 0.87 to 1.54 times as frequent as the events, and about half as frequent in the other two (w9b4ds 0.43, 1tsbdsc 0.59); subtracting them leaves medians below zero (p = 0.69 to 0.96); 44 to 83% of injected events are recovered per file; and the 5 pA frequencies are 1.9 to 24 times the code's sheet values (median 5.5). In the files of at least 5 min VENs are lower (9.9 to 10.6 against 18.5 Hz, 2 or 3 VENs and 4 or 5 PCs, p = 0.11 to 0.38). The paper's own sheet values give VEN 1.77 against PC 3.25 Hz, p = 0.0093.

fig5b-mepsc-frequency¶

The frequency of miniature EPSCs (in tetrodotoxin) is lower in VENs than in neighbouring PCs.

Criterion: both threshold readings with the table's labels decide; the sheet's labels are a variant.

In [21]:
t = table("mEPSC", "freq", [dict(sheet_labels=False), dict(sheet_labels=True)])
print(t.round(4).to_string())
print("\nby cell, 5 pA, whole recording (table label, sheet label):")
g = groups("mEPSC").merge(tab[tab.Experiment == "mEPSC"][["key", "sheet_type", "sheet_freq"]], on="key", how="left")
print(g[["filename_original", "obj", "cellType", "sheet_type", "freq_5pA_whole", "sheet_freq", "noise_pA"]].round(2).to_string())
print("\nquality variants (5 pA, whole), table labels:")
print(robust("mEPSC", "freq").round(4).to_string())
print("sheet labels:")
print(robust("mEPSC", "freq", sheet_labels=True).round(4).to_string())
      reading sheet_labels  n_VEN  n_PC  VEN_median  PC_median    VEN_range     PC_range    diff     U       p   test
0   5pA_whole        False      7     8      0.9233     0.6933    0.32-2.26    0.15-1.79  0.2300  33.0  0.6126  exact
1   5pA_whole         True      8     7      0.6933     0.9233    0.15-1.79    0.32-2.26 -0.2300  23.0  0.6126  exact
2   rms_whole        False      7     8     28.3800    24.9317  25.40-33.55  17.43-43.54  3.4483  41.0  0.1520  exact
3   rms_whole         True      8     7     24.9317    28.3800  17.43-43.54  25.40-33.55 -3.4483  15.0  0.1520  exact
4     5pA_30s        False      7     8      0.9333     0.4667    0.27-2.13    0.17-2.23  0.4667  37.0  0.3357  exact
5     5pA_30s         True      8     7      0.4667     0.9333    0.17-2.23    0.27-2.13 -0.4667  19.0  0.3357  exact
6     rms_30s        False      7     8     32.3333    27.6500  25.60-36.27  19.33-46.53  4.6833  34.0  0.5358  exact
7     rms_30s         True      8     7     27.6500    32.3333  19.33-46.53  25.60-36.27 -4.6833  22.0  0.5358  exact
8  3rms_whole        False      7     8      2.6700     2.2033    1.80-4.17    1.00-2.91  0.4667  38.0  0.2810  exact
9  3rms_whole         True      8     7      2.2033     2.6700    1.00-2.91    1.80-4.17 -0.4667  18.0  0.2810  exact

by cell, 5 pA, whole recording (table label, sheet label):
   filename_original      obj cellType sheet_type  freq_5pA_whole  sheet_freq  noise_pA
0    20210403AS02C05   f3z9bv       PC        VEN            1.17        1.40      0.92
1    20210403AS02C07  1w2fe2k       PC        VEN            0.66        1.02      0.63
2    20210403AS02C08    wudwj       PC        VEN            1.79        1.40      1.31
3    20210403AS04C16   nfq9hp       PC        VEN            0.17        0.39      0.41
4    20210403AS04C18  1wplqqi       PC        VEN            1.36        1.78      1.11
5    20210403AS04C19  1hy08yq       PC        VEN            0.58        1.67      0.93
6    20210403AS04C22   mj6gor       PC        VEN            0.15        0.96      0.85
7   20210403AS05C26#  123f7yh       PC        VEN            0.73        1.39      0.91
8   20210403AS020322  1hq5666      VEN         PC            1.49        1.61      0.96
9    20210403AS02C11  1nktpia      VEN         PC            1.56        1.97      1.00
10   20210403AS02C12   ku2uls      VEN         PC            0.32        1.99      0.86
11   20210403AS04C15   a13tyq      VEN         PC            0.32        1.63      0.69
12   20210403AS04C20  1liyekt      VEN         PC            2.26        3.01      0.94
13   20210403AS05C25   6dsg94      VEN         PC            0.92        2.21      1.12
14   20210403AS05C28  17bl3bi      VEN         PC            0.58        1.07      0.74

quality variants (5 pA, whole), table labels:
                        variant  n_VEN  n_PC  VEN_median  PC_median  VEN_range   PC_range    diff     U       p   test
0                     all files      7     8      0.9233     0.6933  0.32-2.26  0.15-1.79  0.2300  33.0  0.6126  exact
1                  noise < 2 pA      7     8      0.9233     0.6933  0.32-2.26  0.15-1.79  0.2300  33.0  0.6126  exact
2                at least 5 min      7     8      0.9233     0.6933  0.32-2.26  0.15-1.79  0.2300  33.0  0.6126  exact
3           at least 200 events      4     4      1.5233     1.2667  0.92-2.26  0.73-1.79  0.2567  11.0  0.4857  exact
4  minus opposite-polarity rate      7     8      0.8800     0.5917  0.25-2.04  0.15-1.55  0.2883  32.0  0.6943  exact
sheet labels:
                        variant  n_VEN  n_PC  VEN_median  PC_median  VEN_range   PC_range    diff     U       p   test
0                     all files      8     7      0.6933     0.9233  0.15-1.79  0.32-2.26 -0.2300  23.0  0.6126  exact
1                  noise < 2 pA      8     7      0.6933     0.9233  0.15-1.79  0.32-2.26 -0.2300  23.0  0.6126  exact
2                at least 5 min      8     7      0.6933     0.9233  0.15-1.79  0.32-2.26 -0.2300  23.0  0.6126  exact
3           at least 200 events      4     4      1.2667     1.5233  0.73-1.79  0.92-2.26 -0.2567   5.0  0.4857  exact
4  minus opposite-polarity rate      8     7      0.5917     0.8800  0.15-1.55  0.25-2.04 -0.2883  24.0  0.6943  exact

Result: not reproduced. With the table's labels (the dataset's) the VEN median is above the PC median under both threshold readings (5 pA, 0.92 against 0.69 Hz, p = 0.61; RMS, 28.4 against 24.9 Hz, p = 0.15) and over 30 s (p = 0.34). All mEPSC files have noise below 2 pA, where the detector check recovers 94% of injected events and finds 0.06 Hz of opposite-polarity peaks, so detection is not in doubt at 5 pA. With the sheet's labels, the variant, the order reverses (0.69 against 0.92 Hz) but is not significant (p = 0.61). The paper's own sheet frequencies give VEN 1.39 against PC 1.80 Hz (p = 0.028) with the sheet's labels and the reverse (VEN 1.97 against PC 1.39 Hz, p = 0.029) with the table's: the paper's result follows from its labelling, and the dataset's labels reverse it. The two labellings are opposite for every mEPSC cell, and the dandiset cannot tell which is right.

fig5b-mipsc-frequency¶

The frequency of miniature IPSCs (in tetrodotoxin) is lower in VENs than in neighbouring PCs.

In [22]:
t = table("mIPSC", "freq")
print(t.round(4).to_string())
print("\nby session (AS and HS in the file names; one subject):")
g = groups("mIPSC")
g["sess"] = g.session
print(g.groupby(["sess", "cellType"]).freq_5pA_whole.agg(["size", "median", "min", "max"]).round(2).to_string())
print("\nfiles whose whole-recording frequency exceeds 10 Hz (5 pA):",
      g[g.freq_5pA_whole > 10][["filename_original", "obj", "cellType", "freq_5pA_whole", "noise_pA"]].round(2).to_dict("records"))
print("\nquality variants (5 pA, whole):")
print(robust("mIPSC", "freq").round(4).to_string())
      reading  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff      U       p        test
0   5pA_whole     15    21      1.2335     2.3476  0.22-19.42   0.56-25.44 -1.1141   73.5  0.0074  asymptotic
1   rms_whole     15    21     19.0006    28.8997  4.09-42.70   8.73-42.70 -9.8991  120.0  0.2351  asymptotic
2     5pA_30s     15    21      1.0333     1.9000  0.37-25.03   0.20-31.97 -0.8667  101.5  0.0748  asymptotic
3     rms_30s     15    21     21.0667    26.3000  3.63-43.40  10.00-42.57 -5.2333  132.0  0.4224  asymptotic
4  3rms_whole     15    21      2.1830     3.6806   1.09-3.54    1.68-5.50 -1.4975   48.0  0.0005  asymptotic

by session (AS and HS in the file names; one subject):
                       size  median   min    max
sess         cellType                           
Sess250904AS PC          10    2.49  0.56   3.79
             VEN          7    1.51  0.56  19.42
Sess250904HS PC          11    2.04  0.74  25.44
             VEN          8    0.90  0.22   1.63

files whose whole-recording frequency exceeds 10 Hz (5 pA): [{'filename_original': '20250904AS2C5', 'obj': '1f5h8p1', 'cellType': 'VEN', 'freq_5pA_whole': 19.42, 'noise_pA': 4.76}, {'filename_original': '20250904HS2C8', 'obj': '1hzamhk', 'cellType': 'PC', 'freq_5pA_whole': 25.44, 'noise_pA': 4.18}]

quality variants (5 pA, whole):
                        variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p        test
0                     all files     15    21      1.2335     2.3476  0.22-19.42   0.56-25.44 -1.1141  73.5  0.0074  asymptotic
1                  noise < 2 pA     14    20      1.1284     2.1939   0.22-2.16    0.56-4.83 -1.0654  53.5  0.0026  asymptotic
2                at least 5 min      5     9      1.0234     2.0401   0.22-1.58    0.74-4.83 -1.0167   6.0  0.0290       exact
3           at least 200 events      8    19      1.6066     2.6328  1.02-19.42   0.74-25.44 -1.0262  47.0  0.1302  asymptotic
4  minus opposite-polarity rate     15    21      0.9038     1.8701  -2.57-2.03  -17.17-4.34 -0.9663  72.0  0.0064  asymptotic

Result: blocked (methods_underspecified). The two threshold readings disagree. At 5 pA the VEN median is below the PC median (1.23 against 2.35 Hz, p = 0.0074); at the RMS noise it is lower but not significantly (19.0 against 28.9 Hz, p = 0.24), and the detector check shows that this reading counts noise (mIPSC files with noise below 2 pA, 27.2 Hz of opposite-polarity peaks against 25.9 Hz). Over the first 30 s, 5 pA gives p = 0.075. With three times the noise, a variant, VEN 2.18 against PC 3.68 Hz, p = 0.0005. At 5 pA the difference holds in the 34 files with noise below 2 pA (p = 0.0026), in the 14 files of at least 5 min (p = 0.029) and after the opposite-polarity rate is subtracted (p = 0.0064), but not in the 27 files with at least 200 events (p = 0.13). VENs are lower in both sessions (AS 1.51 against 2.49 Hz, HS 0.90 against 2.04 Hz). The paper's own sheet values give VEN 1.83 against PC 3.00 Hz, p = 0.010.

fig5c-sepsc-amplitude¶

The amplitude of spontaneous EPSCs does not differ significantly between VENs and PCs.

Claim of absence: judged on the two-tailed rank-sum test at 5 pA, whole recording, 8 VEN and 11 PC entries; reproduced when p >= 0.05. RMS threshold, 10 cells and 30 s are variants.

In [23]:
t = table("sEPSC", "amp", [dict(reading_rows="table"), dict(reading_rows="distinct")])
print(t.round(4).to_string())
print("\nby subject (5 pA, whole):")
print(by_subject("sEPSC", "amp_5pA_whole").to_string())
print("\nquality variants (5 pA, whole), 11 PC entries:")
print(robust("sEPSC", "amp").round(4).to_string())
      reading reading_rows  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff     U       p   test
0   5pA_whole        table      8    11      8.2035     8.5119  6.85-14.68  6.63-17.89 -0.3084  29.0  0.2375  exact
1   5pA_whole     distinct      8    10      8.2035     9.3128  6.85-14.68  6.63-17.89 -1.1093  26.0  0.2370  exact
2   rms_whole        table      8    11      2.7704     5.8644   1.78-5.84  2.79-23.19 -3.0940  14.0  0.0121  exact
3   rms_whole     distinct      8    10      2.7704     5.6026   1.78-5.84  2.79-23.19 -2.8323  14.0  0.0205  exact
4     5pA_30s        table      8    11      8.2293     9.5203   7.06-9.46  6.67-18.82 -1.2911  18.0  0.0328  exact
5     5pA_30s     distinct      8    10      8.2293     9.8769   7.06-9.46  6.67-18.82 -1.6476  16.0  0.0343  exact
6     rms_30s        table      8    11      3.3339     7.6417   1.98-5.29  3.55-21.41 -4.3078  12.0  0.0068  exact
7     rms_30s     distinct      8    10      3.3339     7.4929   1.98-5.29  3.55-21.41 -4.1590  12.0  0.0117  exact
8  3rms_whole        table      8    11      6.8732    14.4949  5.91-13.02  5.84-45.09 -7.6217  15.0  0.0157  exact
9  3rms_whole     distinct      8    10      6.8732    12.8895  5.91-13.02  5.84-45.09 -6.0163  15.0  0.0266  exact

by subject (5 pA, whole):
                    size  median   min    max
subject   cellType                           
Mfa201023 PC           3   11.90  8.50  12.44
          VEN          4    8.72  7.92  14.68
Mfa201030 VEN          1    6.85  6.85   6.85
Mfa201126 PC           8    8.51  6.63  17.89
          VEN          3    7.81  7.40   8.88

quality variants (5 pA, whole), 11 PC entries:
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff     U       p   test
0            all files      8    11      8.2035     8.5119  6.85-14.68  6.63-17.89 -0.3084  29.0  0.2375  exact
1         noise < 2 pA      6     4      8.6861    10.2012  6.85-14.68  6.63-12.44 -1.5152  11.0  0.9143  exact
2       at least 5 min      2     2      7.3335     9.0749   6.85-7.81  8.04-10.11 -1.7414   0.0  0.3333  exact
3  at least 200 events      6    11      8.1518     8.5119   6.85-8.95  6.63-17.89 -0.3601  18.0  0.1490  exact

Result: reproduced. At 5 pA over the whole recording, VEN 8.20 against PC 8.51 pA (difference -0.31 pA), exact p = 0.24 with the 11 PC entries (10 cells, p = 0.24). The variants differ: the RMS threshold gives p = 0.012 (VEN 2.77 against 5.86 pA), the 30 s window p = 0.033, and three times the noise p = 0.016, all with VEN smaller, while the files with noise below 2 pA give p = 0.91. The absence holds under the paper's 5 pA test as the criterion fixes it, and depends on the window and the threshold. The paper's sheet amplitudes do not differ (p = 0.11).

fig5c-sipsc-amplitude¶

The amplitude of spontaneous IPSCs does not differ significantly between VENs and PCs.

The decisive test uses the table as it is (reading A), the dataset's labels; B and C are shown.

In [24]:
t = table("sIPSC", "amp", [dict(s11="A"), dict(s11="B"), dict(s11="C")])
print(t.round(4).to_string())
print("\nby subject (5 pA, whole, reading A):")
print(by_subject("sIPSC", "amp_5pA_whole", s11="A").to_string())
for s in "ABC":
    print(f"\nquality variants (5 pA, whole), reading {s}:")
    print(robust("sIPSC", "amp", s11=s).round(4).to_string())
       reading s11  n_VEN  n_PC  VEN_median  PC_median    VEN_range      PC_range     diff     U       p   test
0    5pA_whole   A      7     8     11.8362    14.3564   9.06-15.54   10.97-45.13  -2.5201  12.5  0.0939  exact
1    5pA_whole   B      7     8     11.8362    14.3564   9.06-15.54   10.97-45.13  -2.5201  12.0  0.0721  exact
2    5pA_whole   C      7     8     11.8362    13.9474   9.06-15.54   10.97-45.13  -2.1112  13.0  0.0939  exact
3    rms_whole   A      7     8     12.1327    16.4689   7.72-28.59   9.29-104.36  -4.3362  21.5  0.5358  exact
4    rms_whole   B      7     8     14.8946    16.4689   7.72-28.59   9.29-104.36  -1.5743  22.0  0.5358  exact
5    rms_whole   C      7     8     12.1327    16.4689   7.72-28.59   9.29-104.36  -4.3362  20.0  0.3969  exact
6      5pA_30s   A      7     8     11.2201    12.4164   8.05-17.33   10.81-41.23  -1.1963  11.5  0.0721  exact
7      5pA_30s   B      7     8     11.2201    12.4164   8.05-17.33   10.81-41.23  -1.1963  11.0  0.0541  exact
8      5pA_30s   C      7     8     11.2201    12.4164   8.05-17.33    9.66-41.23  -1.1963  12.0  0.0721  exact
9      rms_30s   A      7     8     12.3306    15.3803   7.26-29.62    8.50-98.90  -3.0498  18.5  0.3357  exact
10     rms_30s   B      7     8     12.3306    15.3803   7.26-29.62    8.50-98.90  -3.0498  18.0  0.2810  exact
11     rms_30s   C      7     8     12.3306    15.3803   7.26-29.62    8.50-98.90  -3.0498  20.0  0.3969  exact
12  3rms_whole   A      7     8     27.4922    38.2025  17.18-70.50  18.67-195.57 -10.7103  19.5  0.3969  exact
13  3rms_whole   B      7     8     31.0695    38.2025  17.18-70.50  18.67-195.57  -7.1330  20.0  0.3969  exact
14  3rms_whole   C      7     8     27.4922    38.2025  17.18-70.50  18.67-195.57 -10.7103  19.0  0.3357  exact

by subject (5 pA, whole, reading A):
                    size  median    min    max
subject   cellType                            
Mfa201030 PC           1   22.80  22.80  22.80
          VEN          3   11.84  11.18  15.54
Mfa201126 PC           7   13.49  10.97  45.13
          VEN          4   10.84   9.06  15.22

quality variants (5 pA, whole), reading A:
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range     diff     U       p   test
0            all files      7     8     11.8362    14.3564  9.06-15.54  10.97-45.13  -2.5201  12.5  0.0939  exact
1         noise < 2 pA      0     0         NaN        NaN         NaN          NaN      NaN   NaN     NaN    NaN
2       at least 5 min      2     4      9.4431    27.8918   9.06-9.83  12.70-45.13 -18.4487   0.0  0.1333  exact
3  at least 200 events      7     8     11.8362    14.3564  9.06-15.54  10.97-45.13  -2.5201  12.5  0.0939  exact

quality variants (5 pA, whole), reading B:
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range     diff     U       p   test
0            all files      7     8     11.8362    14.3564  9.06-15.54  10.97-45.13  -2.5201  12.0  0.0721  exact
1         noise < 2 pA      0     0         NaN        NaN         NaN          NaN      NaN   NaN     NaN    NaN
2       at least 5 min      3     4      9.8259    27.8918  9.06-14.40  12.70-45.13 -18.0660   2.0  0.2286  exact
3  at least 200 events      7     8     11.8362    14.3564  9.06-15.54  10.97-45.13  -2.5201  12.0  0.0721  exact

quality variants (5 pA, whole), reading C:
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range     PC_range    diff     U       p   test
0            all files      7     8     11.8362    13.9474  9.06-15.54  10.97-45.13 -2.1112  13.0  0.0939  exact
1         noise < 2 pA      0     0         NaN        NaN         NaN          NaN     NaN   NaN     NaN    NaN
2       at least 5 min      2     5      9.4431    14.4014   9.06-9.83  12.70-45.13 -4.9583   0.0  0.0952  exact
3  at least 200 events      7     8     11.8362    13.9474  9.06-15.54  10.97-45.13 -2.1112  13.0  0.0939  exact

Result: blocked, methods_underspecified, for the reason given under fig5b-sipsc-frequency, as the third verification round agreed. The amplitudes come from the same detection, which does not separate events from noise in these files; noise peaks just above the 5 pA threshold pull every cell's mean amplitude towards the same value, which biases the test towards no difference. At 5 pA, whole recording, the table's labels (reading A): VEN 11.8 against PC 14.4 pA, p = 0.094 (B 0.072, C 0.094). The RMS threshold (p = 0.40 to 0.54), the 30 s window (p = 0.054 to 0.072) and three times the noise (p = 0.34 to 0.40) also find no difference. No sIPSC file has noise below 2 pA, and the amplitudes are 0.21 to 0.40 times the sheet's (median per subject, link claim; 0.19 to 0.53 per file, cell after the fig5b-sipsc-frequency table), so the detection here does not measure the paper's amplitudes; the paper's sheet amplitudes do not differ either (37.6 against 35.9 pA, p = 0.69).

fig5c-mepsc-amplitude¶

The amplitude of miniature EPSCs does not differ significantly between VENs and PCs.

In [25]:
t = table("mEPSC", "amp", [dict(sheet_labels=False), dict(sheet_labels=True)])
print(t.round(4).to_string())
print("\nquality variants (5 pA, whole), table labels:")
print(robust("mEPSC", "amp").round(4).to_string())
      reading sheet_labels  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff     U       p   test
0   5pA_whole        False      7     8      8.5519     7.8127  6.84-10.11  6.21-11.28  0.7392  33.0  0.6126  exact
1   5pA_whole         True      8     7      7.8127     8.5519  6.21-11.28  6.84-10.11 -0.7392  23.0  0.6126  exact
2   rms_whole        False      7     8      1.9963     1.6518   1.25-2.26   0.78-2.55  0.3445  32.0  0.6943  exact
3   rms_whole         True      8     7      1.6518     1.9963   0.78-2.55   1.25-2.26 -0.3445  24.0  0.6943  exact
4     5pA_30s        False      7     8      7.1419     7.6445   5.84-9.53  5.72-11.17 -0.5026  20.0  0.3969  exact
5     5pA_30s         True      8     7      7.6445     7.1419  5.72-11.17   5.84-9.53  0.5026  36.0  0.3969  exact
6     rms_30s        False      7     8      1.5912     1.5156   1.34-2.72   0.81-3.33  0.0756  34.0  0.5358  exact
7     rms_30s         True      8     7      1.5156     1.5912   0.81-3.33   1.34-2.72 -0.0756  22.0  0.5358  exact
8  3rms_whole        False      7     8      5.5372     4.7208   3.56-7.18   2.51-6.51  0.8163  34.0  0.5358  exact
9  3rms_whole         True      8     7      4.7208     5.5372   2.51-6.51   3.56-7.18 -0.8163  22.0  0.5358  exact

quality variants (5 pA, whole), table labels:
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff     U       p   test
0            all files      7     8      8.5519     7.8127  6.84-10.11  6.21-11.28  0.7392  33.0  0.6126  exact
1         noise < 2 pA      7     8      8.5519     7.8127  6.84-10.11  6.21-11.28  0.7392  33.0  0.6126  exact
2       at least 5 min      7     8      8.5519     7.8127  6.84-10.11  6.21-11.28  0.7392  33.0  0.6126  exact
3  at least 200 events      4     4      8.6411     7.8127  7.35-10.11   7.75-7.87  0.8284  12.0  0.3429  exact

Result: reproduced. VEN 8.55 against PC 7.81 pA at 5 pA, p = 0.61, with the table's labels; with the sheet's labels the same p; every variant has p of 0.34 or more. The paper's sheet amplitudes do not differ either (p = 0.57 with its labels, 0.87 with the table's).

fig5c-mipsc-amplitude¶

The amplitude of miniature IPSCs does not differ significantly between VENs and PCs.

In [26]:
t = table("mIPSC", "amp")
print(t.round(4).to_string())
g = groups("mIPSC")
print("\nby session (5 pA, whole):")
print(g.groupby(["session", "cellType"]).amp_5pA_whole.agg(["size", "median", "min", "max"]).round(2).to_string())
print("\nquality variants (5 pA, whole):")
print(robust("mIPSC", "amp").round(4).to_string())
      reading  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff      U       p        test
0   5pA_whole     15    21      9.5710    10.1958  6.68-11.55  7.85-13.87 -0.6248  134.0  0.4605  asymptotic
1   rms_whole     15    21      2.2281     2.3102   0.76-9.84   0.96-7.46 -0.0822  145.0  0.7002  asymptotic
2     5pA_30s     15    21      9.2604    10.3607  6.84-11.80  5.92-13.19 -1.1003  134.0  0.4605  asymptotic
3     rms_30s     15    21      1.9519     2.7479  0.78-10.29  1.00-11.92 -0.7960  155.0  0.9488  asymptotic
4  3rms_whole     15    21      6.6207     8.1103  2.81-39.38  4.24-28.61 -1.4896  128.0  0.3521  asymptotic

by session (5 pA, whole):
                       size  median   min    max
session      cellType                           
Sess250904AS PC          10   10.22  8.00  13.87
             VEN          7   10.32  8.20  11.24
Sess250904HS PC          11    9.99  7.85  12.96
             VEN          8    9.53  6.68  11.55

quality variants (5 pA, whole):
               variant  n_VEN  n_PC  VEN_median  PC_median   VEN_range    PC_range    diff      U       p        test
0            all files     15    21      9.5710    10.1958  6.68-11.55  7.85-13.87 -0.6248  134.0  0.4605  asymptotic
1         noise < 2 pA     14    20      9.5343    10.2231  6.68-11.55  7.85-13.87 -0.6888  112.0  0.3359  asymptotic
2       at least 5 min      5     9      9.4976    10.6430  6.68-10.03  8.38-12.96 -1.1454   10.0  0.1119       exact
3  at least 200 events      8    19     10.1844    10.1958  8.20-11.55  7.85-13.87 -0.0114   80.0  0.8526  asymptotic

Result: reproduced. VEN 9.57 against PC 10.20 pA at 5 pA, p = 0.46; RMS p = 0.70, 30 s p = 0.46, three times the noise p = 0.35; files with noise below 2 pA p = 0.34, of at least 5 min p = 0.11, with at least 200 events p = 0.85. The paper's sheet amplitudes do not differ (p = 0.14).

Summary¶

claim outcome numbers
psc-file-labels-link partially reproduced 85 of 85 rows name a file; 1 file unnamed, 1 named twice; mEPSC labels opposite to the sheet's (0 of 15 agree); frequency agrees with the sheet for mIPSC only
fig5b-sepsc-frequency blocked, methods_underspecified 5 pA: VEN 2.06 < PC 9.36 Hz, p = 0.026; RMS: VEN 32.1 > PC 23.0 Hz, p = 0.091
fig5b-sipsc-frequency blocked, methods_underspecified 5 pA: VEN 19.9 > PC 15.4 Hz, p = 0.34 to 0.40; RMS: VEN higher, p = 0.0006 to 0.072; mostly noise
fig5b-mepsc-frequency not reproduced table labels, 5 pA: VEN 0.92 > PC 0.69 Hz, p = 0.61; RMS VEN higher, p = 0.15
fig5b-mipsc-frequency blocked, methods_underspecified 5 pA: VEN 1.23 < PC 2.35 Hz, p = 0.0074; RMS: p = 0.24
fig5c-sepsc-amplitude reproduced 8.20 against 8.51 pA, p = 0.24
fig5c-sipsc-amplitude blocked, methods_underspecified 11.8 against 14.4 pA, p = 0.094
fig5c-mepsc-amplitude reproduced 8.55 against 7.81 pA, p = 0.61
fig5c-mipsc-amplitude reproduced 9.57 against 10.20 pA, p = 0.46

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 paper detected events in miniAnalysis and measured them in Clampfit, with settings it does not give beyond a 5 pA threshold; here a detector of the same scheme with standard parameters is used (helper docstring). The detector check shows where it can be trusted: in files with noise below 2 pA (all mEPSC, 34 of 36 mIPSC, 10 of 18 sEPSC files) it recovers 91 to 94% of injected events and finds few opposite-polarity peaks; in the sEPSC files with noise of 2 to 4 pA the opposite-polarity peaks are about half as frequent as the events (0.76 to 1.00 in the three sEPSC files above 4 pA), and in 13 of the 15 sIPSC files 0.87 to 1.54 times as frequent (about half in the other two), so a large part of the 5 pA frequencies there is noise, and they are several times the code's sheets. For this reason the two sIPSC claims are blocked (methods_underspecified). The threshold at the recording's RMS noise, reading (b) of the claims file, finds as many opposite-polarity peaks as events in every experiment; a question to a reader asks whether the claims file misreads the Methods there. The analysed stretch is the whole deposited recording (the code's mIPSC sheet used 30 s, shown as a variant). Cell types come from the code's table, not from the dataset. The paper's own sheet values, tested as the figure tests them, give VEN lower in all four frequencies (p = 0.0068 to 0.028) with the sheet's labels; with the dataset's labels the mEPSC order reverses.

What was found about the dataset.

  • The NWB files carry no cell type; the type of each file is only in the paper's code (metadata_PSC.csv).
  • That table names one sIPSC file twice (as a PC and as a VEN) and does not name fwphyw; and for every mEPSC cell its label is the opposite of the paper's analysis sheet. The dandiset holds 15 mEPSC files where the paper reports 16 cells.
  • The spontaneous IPSC files are described as held at +20 mV and their holding currents are positive (107 to 979 pA), where the Methods state IPSCs were held at -60 mV.
  • 22 of 36 mIPSC files end in runs of exact zeros (6,795 to 30,167 samples); 44 of 84 files are shorter than the 5 min the Methods give as the minimum (sEPSC 14 of 18, sIPSC 8 of 15, mIPSC 22 of 36 after the padding is cut).
  • The noise of 11 of 15 sIPSC files and 2 sEPSC files exceeds the 5 pA the Methods give as the largest RMS noise; no sIPSC file has noise below 2 pA.
  • All files have rate 1000 Hz; the decay times of the average events (sEPSC median 7 ms, sIPSC 14 ms, mEPSC 9 ms, mIPSC 16 ms) are consistent with it. There are no trial tables or stimuli, so no other clock check applies.
  • No two files are identical, and no pair correlates above 0.15 after the drift is removed.
  • cell_id is not unique within a session (three pairs), so it does not identify a cell.