Reproducing Kussovska, Kim and Rungratsameetaweemana (2025) from dandiset 000469¶

Paper. Kussovska D, Kim R, Rungratsameetaweemana N (2025). Neural heterogeneity shapes the temporal structure of human working memory. bioRxiv, doi:10.1101/2025.10.31.684900. The claims file (claims/kussovska-2025.yaml) was written from the bioRxiv full text posted on 1 November 2025 (main text, figure legends and Methods; the Extended Data figures and their legends were not in the text read).

Dandiset. DANDI:000469, version 0.231213.2047 (Kyzar et al. 2024, human single neurons during a Sternberg working memory task). This is the version the paper cites (Methods, Participants and data source, and Data availability). The four published versions (0.231213.2047, 0.240122.1800, 0.240122.1812, 0.240123.1806) hold the same 41 assets with the same asset identifiers and sizes, which the data check below confirms, so the version the paper's code downloads (0.240123.1806) gives the same data.

Paper's code. github.com/dariakussovska/heterogeneitywm at commit 5144fe8, the commit the claims file read. Four of its shipped tables are outside inputs here: data/new_trial_info.xlsx (the 96 load-matched trials of the GLM), data/new_trial_final.xlsx (the 75 identity-matched trials of the pseudo-population decoding), both of which the claims file names as readings, and, for comparison only (no outcome rests on them), data/all_neuron_brain_regions_cleaned.xlsx (the code's concept-cell list) and data/cell_analysis/Cell_metrics.xlsx (the code's ACG features). The rodent validation claim uses data/cell_analysis/validation_data.xlsx, the features of the CellExplorer ground-truth cells (data: elsewhere).

Claim Tested here
units-by-region, behavior-accuracy, fig1c-accuracy-load1-vs-load3, behavior-rt, rt-in-vs-out-memory, rt-correct-vs-incorrect tested
fig1e-load-modulated-neurons, fig1f-rt-modulation-not-significant tested
concept-cells-count, fig2ab-single-cells-not-persistent, fig2c-population-persistence, ext1bc-persistence-by-load tested
fig2d-cross-temporal-localized, ext1de-cross-temporal-load23 tested
fig2e-maintenance-decoding-amy-mtl, ext1f-maintenance-decoding-load2 tested
fig2f-bin-width-decoding, fig2f-bin-width-pairwise, ext1g-bin-width-load2 tested
fig3abc-trajectory-complexity, fig3d-encoding-vs-maintenance-separability, fig3h-early-vs-late-maintenance tested in the second notebook, dpca_kussovska_2025.ipynb
fig4c-encoding-bursts-vs-poisson, fig4d-maintenance-bursts-vs-poisson, fig4-acg-group-differences, fig4f-all-cells-epochs, fig4hj-group-epochs, ext2-bursts-loads23 tested
acg-fit-yield, fig5c-cell-type-clusters, fig5dfh-cluster-features, fig5gh-burst-index-cv2, fig5kl-concept-cell-types tested
supp4-rodent-validation tested on the features shipped with the paper's code (data: elsewhere)
fig6ab-celltype-bursts-vs-null, fig6cd-celltype-epochs, ext5bd-in-load-dependence tested
fig6e-load-modulation-in, fig6f-rt-modulation-in-concept, fig6gh-in-concept-cv2, ext5gh-py-decay-preferred tested
fig6i-py-bin-width-decoding, fig6j-in-bin-width-decoding, fig6kl-cross-temporal-by-type, ext5ij-load2-decoding-by-type tested

Each claim's section quotes it, runs every reading its criterion names, and ends with a conclusion. Random generators are seeded per section.

In [1]:
import time
import warnings

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import requests
from scipy import stats
from scipy.stats import wilcoxon, mannwhitneyu, kruskal, binom, binomtest
from scipy import ndimage

import wm

warnings.filterwarnings("ignore")
pd.set_option("display.width", 220)
pd.set_option("display.max_columns", 40)
pd.set_option("display.max_rows", 300)
T0 = time.time()

sessions = wm.load_all()
BY = {s["sub"]: s for s in sessions}
NT = wm.neuron_table(sessions)
T = {s["sub"]: wm.trial_frame(s) for s in sessions}
SPK = [wm.spikes_of(BY, r) for _, r in NT.iterrows()]
FIX = [wm.fixation_stats(SPK[n], T[NT["sub"].iat[n]]) for n in range(len(NT))]
print(f"streamed {len(sessions)} Sternberg files of dandiset {wm.DANDISET_ID} version {wm.DANDISET_VERSION} "
      f"in {time.time() - T0:.0f} s")

# Outside inputs from the paper's code repository at the pinned commit.
INFO = wm.code_table("data/new_trial_info.xlsx")
FINAL = wm.code_table("data/new_trial_final.xlsx")
SHIP_REG = wm.code_table("data/all_neuron_brain_regions_cleaned.xlsx")
SHIP_CM = wm.code_table("data/cell_analysis/Cell_metrics.xlsx")
VALID = wm.code_table("data/cell_analysis/validation_data.xlsx")
print("code tables:", {k: v.shape for k, v in dict(INFO=INFO, FINAL=FINAL, SHIP_REG=SHIP_REG,
                                                  SHIP_CM=SHIP_CM, VALID=VALID).items()})
streamed 21 Sternberg files of dandiset 000469 version 0.231213.2047 in 23 s
code tables: {'INFO': (2056, 9), 'FINAL': (1575, 14), 'SHIP_REG': (902, 5), 'SHIP_CM': (902, 11), 'VALID': (343, 6)}

Data check¶

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

In [2]:
# Versions: the same assets in every published version.
vers = [v["version"] for v in requests.get(f"{wm.API}/dandisets/{wm.DANDISET_ID}/versions/").json()["results"]]
listing = {v: wm.list_assets(v) for v in vers}
sig = {v: sorted((a["path"], a["asset_id"], a["size"]) for a in listing[v]) for v in vers}
print("versions:", vers)
for v in vers:
    print(f"  {v}: {len(listing[v])} assets, {sum(a['size'] for a in listing[v]) / 1e9:.2f} GB, "
          f"same assets as {wm.DANDISET_VERSION}: {sig[v] == sig[wm.DANDISET_VERSION]}")
paths = [a["path"] for a in listing[wm.DANDISET_VERSION]]
print("files per session type:", pd.Series([p.split("_")[1] for p in paths]).value_counts().to_dict(),
      "; subjects:", len({p.split("/")[0] for p in paths}))
print("paper: 21 patients, 41 recording sessions")
versions: ['draft', '0.231213.2047', '0.240122.1800', '0.240122.1812', '0.240123.1806']
  draft: 41 assets, 9.79 GB, same assets as 0.231213.2047: True
  0.231213.2047: 41 assets, 9.79 GB, same assets as 0.231213.2047: True
  0.240122.1800: 41 assets, 9.79 GB, same assets as 0.231213.2047: True
  0.240122.1812: 41 assets, 9.79 GB, same assets as 0.231213.2047: True
  0.240123.1806: 41 assets, 9.79 GB, same assets as 0.231213.2047: True
files per session type: {'ses-2': 21, 'ses-1': 20} ; subjects: 21
paper: 21 patients, 41 recording sessions

The pinned version holds 41 files, a screening session (ses-1) and a Sternberg session (ses-2) for each of 21 subjects except sub-19, which has only ses-2: 41 sessions from 21 patients, as the paper says. Every published version holds the same assets. The analysis reads only the 21 Sternberg files, as the paper's code does.

In [3]:
subj = pd.DataFrame([{"sub": s["sub"], "age": s["subject"]["age"], "sex": s["subject"]["sex"],
                      "units": len(s["units"]), "trials": len(s["trials"]),
                      "description": s["session_description"][:30]} for s in sessions])
ages = subj.age.str.extract(r"P(\d+)Y")[0].astype(int)
print(subj.to_string(index=False))
print(f"\nage {ages.min()} to {ages.max()} years, mean {ages.mean():.2f} +/- {ages.std():.2f} (s.d.); "
      "paper: 17 to 71, 36.10 +/- 15.45 (over 41 sessions)")
print("trials per session:", subj.trials.value_counts().to_dict(), "; paper: 16 participants with 135 trials, 5 with 108")
print("units:", len(NT), "; by region:", NT.region.value_counts().to_dict())
print("location labels:", sorted(NT.location.unique()))
 sub  age sex  units  trials description
   1 P25Y   F     40     135     SBID: 1
   2 P42Y   F     32     135     SBID: 2
   3 P53Y   F     28     135     SBID: 3
   4 P32Y   M     76     135     SBID: 4
   5 P32Y   F     50     135     SBID: 5
   6 P32Y   M     35     108     SBID: 6
   7 P19Y   M     22     108     SBID: 7
   8 P44Y   F     74     108     SBID: 8
   9 P70Y   M     43     108     SBID: 9
  10 P63Y   M     28     135    SBID: 10
  11 P45Y   M     74     135    SBID: 11
  12 P33Y   F     22     135    SBID: 12
  13 P26Y   M     58     135    SBID: 13
  14 P26Y   M     65     135    SBID: 14
  15 P25Y   M     55     135    SBID: 15
  16 P54Y   M     33     108    SBID: 16
  17 P54Y   F     13     135    SBID: 17
  18 P24Y   M    118     135    SBID: 18
  19 P20Y   M     11     108    SBID: 19
  20 P24Y   F      5     135    SBID: 20
  21 P17Y   M     20     135    SBID: 21

age 17 to 70 years, mean 36.19 +/- 15.32 (s.d.); paper: 17 to 71, 36.10 +/- 15.45 (over 41 sessions)
trials per session: {135: 15, 108: 6} ; paper: 16 participants with 135 trials, 5 with 108
units: 902 ; by region: {'AMY': 259, 'preSMA': 250, 'HPC': 190, 'dACC': 171, 'vmPFC': 32}
location labels: [np.str_('amygdala_left'), np.str_('amygdala_right'), np.str_('dorsal_anterior_cingulate_cortex_left'), np.str_('dorsal_anterior_cingulate_cortex_right'), np.str_('hippocampus_left'), np.str_('hippocampus_right'), np.str_('pre_supplementary_motor_area_left'), np.str_('pre_supplementary_motor_area_right'), np.str_('ventral_medial_prefrontal_cortex_left'), np.str_('ventral_medial_prefrontal_cortex_right')]

The files hold 902 units (as the paper says) in five regions, each with a left and a right label. Fifteen sessions have 135 trials and six have 108 (subjects 6, 7, 8, 9, 16 and 19); the paper says sixteen and five, so the data disagree with the description there. The ages run from 17 to 70 (mean 36.19); the paper gives 17 to 71 and 36.10 over sessions, which one Sternberg file per subject cannot check.

In [4]:
tr = pd.concat(T.values())
rows = []
for sub, t in T.items():
    rows.append({"sub": sub, "n": len(t), "load1": (t.load == 1).sum(), "load2": (t.load == 2).sum(),
                 "load3": (t.load == 3).sum(), "images": sorted(set(t.img1)),
                 "fix_s": f"{(t.enc1 - t.fix_start).min():.3f}-{(t.enc1 - t.fix_start).max():.3f}",
                 "enc1_s": f"{(t.timestamps_Encoding1_end - t.enc1).min():.3f}-{(t.timestamps_Encoding1_end - t.enc1).max():.3f}",
                 "maint_s": f"{t.maint_dur.min():.3f}-{t.maint_dur.max():.3f}",
                 "rt_s": f"{t.rt.min():.2f}-{t.rt.max():.2f}",
                 "ordered": bool(((t.enc1 > t.fix_start) & (t.maint > t.enc1) & (t.probe > t.maint)
                                  & (t.timestamps_Response > t.probe)).all())})
print(pd.DataFrame(rows).to_string(index=False))
print("\nimage ids at encoding 2 and 3 on load 1 trials (unused positions):",
      sorted(set(tr[tr.load == 1].img2)), sorted(set(tr[tr.load == 1].img3)))
print("accuracy values:", sorted(tr.correct.unique()), "; probe_in_out values:", sorted(tr.in_memory.unique()))
print(f"maintenance duration over all trials {tr.maint_dur.min():.3f} to {tr.maint_dur.max():.3f} s "
      "(paper: 2.5 to 2.8 s); fixation "
      f"{(tr.enc1 - tr.fix_start).min():.3f} to {(tr.enc1 - tr.fix_start).max():.3f} s (paper: 0.9 to 1.0 s)")
# the second time unit check: spike times lie within the session's trial span
span = pd.DataFrame([{"sub": NT["sub"].iat[n], "first": SPK[n][0] if len(SPK[n]) else np.nan,
                      "last": SPK[n][-1] if len(SPK[n]) else np.nan} for n in range(len(NT))])
lim = pd.DataFrame([{"sub": s, "t0": t.start_time.min(), "t1": t.stop_time.max()} for s, t in T.items()])
m = span.groupby("sub").agg(first=("first", "min"), last=("last", "max")).join(lim.set_index("sub"))
print("spike times start before the first trial and end after the last in every session:",
      bool(((m["first"] <= m.t0 + 60) & (m["last"] >= m.t1 - 60)).all()),
      f"; session spans {((m['last'] - m['first']) / 60).min():.0f} to {((m['last'] - m['first']) / 60).max():.0f} min")
print("units with fewer than 2 spikes:", int((NT.n_spikes < 2).sum()))
# The two trials with a degenerate epoch (both in subject 9): which analyses they enter.
t9 = T[9]
for name, d in [("maintenance", t9.maint_dur.values), ("fixation", (t9.enc1 - t9.fix_start).values)]:
    j = int(np.argmin(d))
    print(f"subject 9, shortest {name}: trial {t9.trial.iat[j]}, load {t9.load.iat[j]}, {d[j]:.6f} s (next shortest {np.sort(d)[1]:.3f} s)")
j = int(np.argmin((t9.enc1 - t9.fix_start).values))
keep = np.arange(len(t9)) != j
dev = []
for n in NT.nid[NT["sub"] == 9]:
    r = wm.count_in(SPK[n], t9.fix_start.values, t9.enc1.values) / (t9.enc1 - t9.fix_start).values
    dev.append((int(wm.count_in(SPK[n], t9.fix_start.values[j:j + 1], t9.enc1.values[j:j + 1])[0]),
                abs(r[keep].mean() - FIX[n][0]), abs(r[keep].std(ddof=1) - FIX[n][1])))
dev = np.array(dev)
print(f"subject 9's neurons with a spike in the 31 us fixation: {int((dev[:, 0] > 0).sum())} of {len(dev)}; leaving that trial out "
      f"changes the fixation mean rate by at most {dev[:, 1].max():.3f} Hz and its s.d. by at most {dev[:, 2].max():.3f} Hz")
 sub   n  load1  load2  load3          images        fix_s      enc1_s     maint_s       rt_s  ordered
   1 135     45     45     45 [1, 2, 3, 4, 5]  0.942-1.195 1.002-1.004 2.555-2.817  0.59-4.41     True
   2 135     45     45     45 [1, 2, 3, 4, 5]  0.927-1.205 1.002-1.007 2.546-2.823  0.66-9.52     True
   3 135     45     45     45 [1, 2, 3, 4, 5]  0.922-1.204 1.002-1.005 2.547-2.813 0.57-17.43     True
   4 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.200 1.016-1.017 2.536-2.836  0.49-3.44     True
   5 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.550 1.016-1.017 2.554-2.836 0.66-30.83     True
   6 108     36     36     36 [1, 2, 3, 4, 5]  0.906-1.105 1.004-1.013 2.568-2.807  0.34-5.23     True
   7 108     36     36     36 [1, 2, 3, 4, 5]  0.906-1.103 1.004-1.013 2.573-2.829  0.67-3.65     True
   8 108     36     36     36 [1, 2, 3, 4, 5]  0.934-1.123 1.003-1.009 2.554-2.751  0.77-5.79     True
   9 108     36     36     36 [1, 2, 3, 4, 5]  0.000-1.180 2.504-2.507 0.000-2.826 1.01-18.04    False
  10 135     45     45     45 [1, 2, 3, 4, 5]  0.925-1.202 1.502-1.506 2.548-2.805  0.47-1.80     True
  11 135     45     45     45 [1, 2, 3, 4, 5]  0.930-1.202 1.502-1.505 2.543-2.804 0.50-16.06     True
  12 135     45     45     45 [1, 2, 3, 4, 5]  0.924-1.200 1.502-1.505 2.541-2.803 0.99-13.79     True
  13 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.200 1.016-1.017 2.539-2.820  0.63-6.32     True
  14 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.217 1.216-1.217 2.553-2.819 0.45-10.23     True
  15 135     45     45     45 [1, 2, 3, 4, 5]  0.919-1.196 1.202-1.205 2.551-2.818 0.82-17.44     True
  16 108     36     36     36 [1, 2, 3, 4, 5]  0.951-1.184 2.503-2.509 2.562-2.819  0.74-5.62     True
  17 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.200 1.216-1.217 2.534-2.818  0.60-4.61     True
  18 135     45     45     45 [1, 2, 3, 4, 5]  0.950-1.217 1.016-1.017 2.535-2.818  0.34-3.13     True
  19 108     36     36     36 [1, 2, 3, 4, 5]  0.927-1.122 1.004-1.007 2.563-2.811  0.40-4.05     True
  20 135     45     45     45 [1, 2, 3, 4, 5]  0.933-1.233 1.012-1.017 2.536-2.820  0.38-3.27     True
  21 135     45     45     45 [1, 2, 3, 4, 5] 0.950-14.070 1.013-1.017 2.537-2.823  0.49-3.63     True

image ids at encoding 2 and 3 on load 1 trials (unused positions): [0] [0]
accuracy values: [np.int64(0), np.int64(1)] ; probe_in_out values: [np.int64(0), np.int64(1)]
maintenance duration over all trials 0.000 to 2.836 s (paper: 2.5 to 2.8 s); fixation 0.000 to 14.070 s (paper: 0.9 to 1.0 s)
spike times start before the first trial and end after the last in every session: True ; session spans 13 to 27 min
units with fewer than 2 spikes: 0
subject 9, shortest maintenance: trial 29, load 1, 0.000000 s (next shortest 2.561 s)
subject 9, shortest fixation: trial 89, load 3, 0.000031 s (next shortest 0.946 s)
subject 9's neurons with a spike in the 31 us fixation: 0 of 43; leaving that trial out changes the fixation mean rate by at most 0.058 Hz and its s.d. by at most 0.029 Hz

Every session has equal numbers of trials per load and five images (ids 1 to 5) in its encoding periods. The epoch timestamps are ordered in every trial except one: in subject 9 (the session marked False above) one trial has a maintenance timestamp equal to its probe timestamp, a maintenance of 0 s (trial 29, load 1), and another (trial 89) has a fixation of 31 us. Apart from that trial, maintenance lasts about 2.53 to 2.84 s (paper: 2.5 to 2.8 s). Fixation lasts about 0.91 to 1.2 s in most sessions, longer than the paper's 0.9 to 1.0 s, with single long fixations (14.07 s in subject 21). The first encoding image lasts 1.0, 1.2, 1.5 or 2.5 s depending on the session (enc1_s); the paper does not state the image duration, and the code's 1 s encoding window is used throughout. No neuron of subject 9 fires in that fixation, and leaving it out changes the fixation statistics by at most the amounts printed. The 0 s trial is kept, as in the code: it adds an empty trial to the burst trains of the 2.8 s and 3 s windows and none to the own-maintenance reading, and its 2.5 s maintenance window in the decoding analyses holds the probe period. Spike times are in seconds and span each session's trials; the contrast below checks the clock.

In [5]:
# Clock check by contrast: image selectivity of each neuron 200 to 1000 ms after the first
# encoding onset (the concept-cell window) against the same test in windows shifted 1 s and 2 s
# earlier (fixation and the previous trial's probe), per session. With aligned clocks only the
# true window should hold image information beyond the false-positive rate.
rng = np.random.default_rng(1)
rows = []
for sub, t in T.items():
    nids = NT.nid[NT["sub"] == sub].values
    row = {"sub": sub, "neurons": len(nids)}
    for shift in [0.0, -1.0, -2.0]:
        k = 0
        for n in nids:
            r = wm.count_in(SPK[n], (t.enc1 + 0.2 + shift).values, (t.enc1 + 1.0 + shift).values) / 0.8
            k += wm.concept_test(r, t.img1.values, rng, reading="code")[2]
        row[f"selective_at_{shift:+.0f}s"] = k
    # evoked response: population rate 0-300 ms after onset over the 300 ms before
    pre = sum(wm.count_in(SPK[n], (t.enc1 - 0.3).values, t.enc1.values).sum() for n in nids)
    post = sum(wm.count_in(SPK[n], (t.enc1 + 0.2).values, (t.enc1 + 0.5).values).sum() for n in nids)
    row["rate_200_500ms_over_pre"] = round(post / max(pre, 1), 2)
    rows.append(row)
clk = pd.DataFrame(rows)
print(clk.to_string(index=False))
print("totals:", clk[[c for c in clk.columns if c.startswith("selective")]].sum().to_dict())
 sub  neurons  selective_at_+0s  selective_at_-1s  selective_at_-2s  rate_200_500ms_over_pre
   1       40                 0                 1                 0                     0.89
   2       32                 3                 0                 0                     1.03
   3       28                 0                 0                 0                     0.96
   4       76                 6                 0                 0                     1.07
   5       50                 1                 1                 1                     0.97
   6       35                 0                 0                 0                     1.07
   7       22                 3                 0                 1                     1.13
   8       74                 1                 1                 5                     1.01
   9       43                 4                 1                 0                     1.14
  10       28                 0                 2                 0                     0.99
  11       74                 3                 0                 1                     1.01
  12       22                 1                 0                 2                     1.10
  13       58                 9                 0                 1                     1.07
  14       65                14                 2                 2                     1.12
  15       55                 1                 0                 1                     0.95
  16       33                 4                 0                 0                     1.01
  17       13                 0                 0                 1                     0.90
  18      118                 5                 3                 1                     0.99
  19       11                 0                 0                 0                     1.08
  20        5                 0                 0                 0                     1.04
  21       20                 3                 0                 0                     1.00
totals: {'selective_at_+0s': 58, 'selective_at_-1s': 11, 'selective_at_-2s': 16}

Over all sessions, 58 neurons are image-selective in the window after the first encoding onset, against 11 and 16 in the windows shifted 1 s and 2 s earlier, so image information appears where the trials table puts the images. This is consistent with spike times and trials sharing a clock; it is shown per session only where selective neurons exist. Subjects 1, 3, 6, 10, 17, 19 and 20 have no selective neuron in the true window, and the population rate barely changes after image onset in any session (ratios 0.89 to 1.14), so for those seven sessions the alignment could not be established.

In [6]:
# Duplicate recordings: identical spike trains or identical trial tables across sessions.
keys = {}
dups = []
for n in range(len(NT)):
    s = SPK[n]
    k = (len(s), round(float(s[:5].sum()), 6) if len(s) else 0.0)
    if k in keys and NT["sub"].iat[keys[k]] != NT["sub"].iat[n]:
        dups.append((keys[k], n))
    keys.setdefault(k, n)
print("units with an identical spike train in another session:", len(dups))
tabs = {}
for sub, t in T.items():
    key = tuple(np.round(t.enc1.values[:10] - t.enc1.values[0], 4))
    tabs.setdefault(key, []).append(sub)
print("sessions with identical trial timing:", [v for v in tabs.values() if len(v) > 1])
seqs = {}
for sub, t in T.items():
    seqs.setdefault(tuple(t.img1.values) + tuple(t.load.values), []).append(sub)
print("sessions sharing the same trial sequence (loads and image ids):", [v for v in seqs.values() if len(v) > 1])
units with an identical spike train in another session: 0
sessions with identical trial timing: []
sessions sharing the same trial sequence (loads and image ids): [[1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 17, 18, 20, 21], [6, 7, 8, 19], [9, 16]]

No unit or trial timing is duplicated across sessions. Several sessions share one trial sequence (the same loads and image ids in the same order), which is expected if the task used a fixed pseudorandom list; their timings differ, so these are separate recordings.

In [7]:
# Link of the code's trial tables to the dataset's trials (needed by the readings that use them):
# trial_id is the row number, and their loads, image indices and reaction times agree.
rows = []
for sub, t in T.items():
    ti = t.set_index("trial")
    for name, tab, cols in [("new_trial_info", INFO, ("num_images_presented", "RT")),
                            ("new_trial_final", FINAL, ("num_images_presented", "RT "))]:
        x = tab[tab.subject_id == sub]
        m = ti.loc[x.trial_id.values]
        row = {"table": name, "sub": sub, "rows": len(x), "loads_agree": bool((x[cols[0]].values == m.load.values).all()),
               "rt_max_diff": float(np.abs(x[cols[1]].values - m.rt.values).max())}
        if name == "new_trial_final":
            mp = pd.DataFrame({"code": x.stimulus_index_enc1.values, "pic": m.img1.values})
            row["image_map_one_to_one"] = bool(mp.groupby("code").pic.nunique().max() == 1
                                               and mp.groupby("pic").code.nunique().max() == 1)
        rows.append(row)
lk = pd.DataFrame(rows)
print(lk.groupby("table").agg(sessions=("sub", "size"), rows_min=("rows", "min"), rows_max=("rows", "max"),
                              loads_agree=("loads_agree", "all"), rt_max_diff=("rt_max_diff", "max")).to_string())
print("image index of new_trial_final maps one to one onto the dataset's picture ids in every session:",
      bool(lk.image_map_one_to_one.dropna().all()))
f1 = FINAL[FINAL.num_images_presented == 1]
print("new_trial_final load-1 rows per session:", f1.groupby("subject_id").size().unique(),
      "; image index the same across sessions in every load-1 row:",
      bool((f1.groupby("trial_id_final").stimulus_index_enc1.nunique() == 1).all()))
for L in [2, 3]:
    fl = FINAL[FINAL.num_images_presented == L]
    print(f"load {L} rows per session: {fl.groupby('subject_id').size().unique()}; rows whose label image "
          f"(position {L}) has the same index in every session: "
          f"{(fl.groupby('trial_id_final')[f'stimulus_index_enc{L}'].nunique() == 1).mean():.2f}; "
          f"label counts in subject 14: {fl[fl.subject_id == 14][f'stimulus_index_enc{L}'].value_counts().sort_index().to_dict()}")
ids1 = INFO[INFO.subject_id == 1].new_trial_id.values
print("new_trial_info: rows per session", INFO.groupby("subject_id").size().unique(),
      "; subject 1's 96 ids present in every session:",
      all(set(ids1) <= set(INFO[INFO.subject_id == s].new_trial_id) for s in T),
      "; load the same across sessions for each id:",
      bool((INFO.groupby("new_trial_id").num_images_presented.nunique() == 1).all()))
ok = (SHIP_REG.subject_id.values == NT["sub"].values).all() and (SHIP_REG.Neuron_ID.values == NT.unit.values).all() \
     and (SHIP_REG.Location.values == NT.location.values).all()
print("the code's neuron table lists the dataset's 902 units in the same order, with the same locations:", bool(ok))
                 sessions  rows_min  rows_max  loads_agree  rt_max_diff
table                                                                  
new_trial_final        21        75        75         True     0.000005
new_trial_info         21        96       106         True     0.000005
image index of new_trial_final maps one to one onto the dataset's picture ids in every session: True
new_trial_final load-1 rows per session: [30] ; image index the same across sessions in every load-1 row: True
load 2 rows per session: [25]; rows whose label image (position 2) has the same index in every session: 1.00; label counts in subject 14: {0: 5, 1: 5, 2: 5, 3: 5, 4: 5}
load 3 rows per session: [20]; rows whose label image (position 3) has the same index in every session: 1.00; label counts in subject 14: {0: 4, 1: 4, 2: 4, 3: 4, 4: 4}
new_trial_info: rows per session [ 96 106] ; subject 1's 96 ids present in every session: True ; load the same across sessions for each id: True
the code's neuron table lists the dataset's 902 units in the same order, with the same locations: True

The code's tables match the dataset trial by trial: trial_id is the row of the trials table, and loads and reaction times agree exactly. In the identity-matched table the image index of every load-1 row is the same in all 21 sessions and maps one to one onto each session's picture ids, so its rows can align a pseudo-population; its load-2 and load-3 rows are aligned on the label image (second and third) in every session too. The code's neuron table lists the dataset's units in order, with the same locations. Several sessions share one trial sequence, and the subjects with 108 trials have 106 rows in new_trial_info.

units-by-region¶

Recordings from the 21 patients yielded 902 well-isolated units, 259 in the amygdala, 171 in the dACC, 190 in the hippocampus, 250 in the preSMA and 32 in the vmPFC.

In [8]:
cnt = NT.region.value_counts()
print("patients:", NT["sub"].nunique(), "; units:", len(NT))
print(pd.DataFrame({"dataset": cnt, "paper": pd.Series({"AMY": 259, "dACC": 171, "HPC": 190, "preSMA": 250, "vmPFC": 32})}).to_string())
print("\nunits by participant and region:")
print(pd.crosstab(NT["sub"], NT.region).to_string())
patients: 21 ; units: 902
        dataset  paper
AMY         259    259
HPC         190    190
dACC        171    171
preSMA      250    250
vmPFC        32     32

units by participant and region:
region  AMY  HPC  dACC  preSMA  vmPFC
sub                                  
1         6    2    11      21      0
2         3   15     0       0     14
3         1    4     9      14      0
4        42    0     1      18     15
5         6   13    20       8      3
6         0    1    10      24      0
7        16    0     0       6      0
8         2   25    33      14      0
9        34    6     0       3      0
10        4    8     0      16      0
11        6   20    20      28      0
12        4    0    11       7      0
13       25   11     6      16      0
14       19   17    10      19      0
15       20   15     8      12      0
16       27    6     0       0      0
17        6    0     3       4      0
18       31   33    19      35      0
19        5    6     0       0      0
20        1    0     1       3      0
21        1    8     9       2      0

Result: reproduced. 21 patients and 902 units, with exactly the paper's count in each of the five regions (left and right merged).

behavior-accuracy¶

Task accuracy was 88.73% ± 1.25%.

In [9]:
acc = tr.groupby("sub").correct.mean() * 100
print(acc.round(2).to_dict())
print(f"mean over the 21 participants {acc.mean():.2f}%, s.e.m. {acc.std(ddof=1) / np.sqrt(len(acc)):.2f}, "
      f"s.d. {acc.std(ddof=1):.2f}; range {acc.min():.2f} to {acc.max():.2f}")
print(f"variant, pooled over all {len(tr)} trials: {100 * tr.correct.mean():.2f}%")
print("paper: 88.73 +/- 1.25 (tolerance 87.48 to 89.98)")
{1: 76.3, 2: 91.11, 3: 91.85, 4: 94.07, 5: 85.93, 6: 75.0, 7: 95.37, 8: 88.89, 9: 87.04, 10: 88.89, 11: 90.37, 12: 91.11, 13: 84.44, 14: 91.11, 15: 83.7, 16: 94.44, 17: 95.56, 18: 93.33, 19: 94.44, 20: 85.19, 21: 85.19}
mean over the 21 participants 88.73%, s.e.m. 1.25, s.d. 5.74; range 75.00 to 95.56
variant, pooled over all 2673 trials: 88.70%
paper: 88.73 +/- 1.25 (tolerance 87.48 to 89.98)

Result: reproduced. The mean of the 21 participants' accuracies is 88.73% with s.e.m. 1.25, the paper's value and spread (the s.d. is 5.74); the pooled variant gives 88.70%.

fig1c-accuracy-load1-vs-load3¶

Accuracy was higher for load 1 than for load 3 trials across patients.

In [10]:
al = tr.groupby(["sub", "load"]).correct.mean().unstack()
print((100 * al).round(1).to_string())
print("median accuracy by load:", (100 * al.median()).round(2).to_dict())
H, pk = kruskal(al[1], al[2], al[3])
print(f"Kruskal-Wallis over loads H = {H:.3f}, p = {pk:.4g}")
for a, b in [(1, 2), (1, 3), (2, 3)]:
    u = mannwhitneyu(al[a], al[b], alternative="two-sided")
    print(f"load {a} vs {b}: rank-sum U = {u.statistic:.1f}, p raw = {u.pvalue:.4f}, Bonferroni x3 = {min(1, 3 * u.pvalue):.4f}")
w = wilcoxon(al[1], al[3])
print(f"variant, paired signed-rank load 1 vs 3: W = {w.statistic:.1f}, p = {w.pvalue:.4f}; "
      f"load 1 higher in {(al[1] > al[3]).sum()} of 21, equal in {(al[1] == al[3]).sum()}")
print("paper: rank-sum P = 0.027")
load      1     2     3
sub                    
1      68.9  77.8  82.2
2      91.1  91.1  91.1
3      93.3  93.3  88.9
4     100.0  88.9  93.3
5      95.6  77.8  84.4
6      83.3  69.4  72.2
7      97.2  94.4  94.4
8      94.4  91.7  80.6
9      88.9  83.3  88.9
10     97.8  84.4  84.4
11     93.3  86.7  91.1
12     95.6  95.6  82.2
13     88.9  86.7  77.8
14     95.6  91.1  86.7
15     82.2  88.9  80.0
16     97.2  91.7  94.4
17    100.0  91.1  95.6
18     95.6  95.6  88.9
19     94.4  97.2  91.7
20     77.8  95.6  82.2
21     84.4  88.9  82.2
median accuracy by load: {1: 94.44, 2: 91.11, 3: 86.67}
Kruskal-Wallis over loads H = 7.597, p = 0.02241
load 1 vs 2: rank-sum U = 283.5, p raw = 0.1143, Bonferroni x3 = 0.3429
load 1 vs 3: rank-sum U = 324.5, p raw = 0.0090, Bonferroni x3 = 0.0270
load 2 vs 3: rank-sum U = 275.5, p raw = 0.1687, Bonferroni x3 = 0.5061
variant, paired signed-rank load 1 vs 3: W = 24.0, p = 0.0042; load 1 higher in 17 of 21, equal in 2
paper: rank-sum P = 0.027

Result: reproduced. Load 1 accuracy (median 94.44%) is higher than load 3 (86.67%); the rank-sum p is 0.0090 raw and 0.0270 after the code's Bonferroni factor of 3, the paper's P = 0.027. The paired variant gives p = 0.0042.

behavior-rt¶

Reaction time for correct trials was 1.06 ± 0.28 s.

In [11]:
c = tr[tr.correct == 1]
med = c.groupby("sub").rt.median()
mean = c.groupby("sub").rt.mean()
q = c.rt.quantile([0.25, 0.75])
print(f"(a) mean of participants' median RT {med.mean():.3f} s (s.d. {med.std(ddof=1):.3f}); "
      f"(b) mean of participants' mean RT {mean.mean():.3f} s (s.d. {mean.std(ddof=1):.3f}); "
      f"(c) median over {len(c)} correct trials {c.rt.median():.3f} s (IQR {q.iloc[0]:.3f} to {q.iloc[1]:.3f}, half-IQR {(q.iloc[1] - q.iloc[0]) / 2:.3f}; trial s.d. {c.rt.std():.3f})")
print(f"RT range over correct trials {c.rt.min():.3f} to {c.rt.max():.3f} s")
print("paper: 1.06 +/- 0.28 s (tolerance 0.78 to 1.34)")
(a) mean of participants' median RT 1.120 s (s.d. 0.252); (b) mean of participants' mean RT 1.348 s (s.d. 0.369); (c) median over 2371 correct trials 1.097 s (IQR 0.862 to 1.455, half-IQR 0.297; trial s.d. 1.216)
RT range over correct trials 0.337 to 30.829 s
paper: 1.06 +/- 0.28 s (tolerance 0.78 to 1.34)

Result: reproduced. Readings (a), 1.120 s, and (c), 1.097 s, fall within 0.78 to 1.34 s; reading (b), 1.348 s, is just above it. The spreads are 0.252 s (s.d. of participant medians) and 0.297 s (half the IQR of trials), near the paper's 0.28.

rt-in-vs-out-memory¶

Reaction time was faster for probes held in memory than for probes not in memory.

In [12]:
rng = np.random.default_rng(11)


def paired_signflip(d, rng, n=1000):
    d = np.asarray(d)
    null = np.abs((rng.choice([-1, 1], (n, len(d))) * d).mean(1))
    return float((np.sum(null >= abs(d.mean())) + 1) / (n + 1))


def label_perm(x, lab, rng, n=1000):
    obs = x[lab].mean() - x[~lab].mean()
    null = np.array([(lambda p: x[p].mean() - x[~p].mean())(rng.permutation(lab)) for _ in range(n)])
    return obs, float((np.sum(np.abs(null) >= abs(obs)) + 1) / (n + 1))


for name, sel in [("correct trials", tr.correct == 1), ("all trials", tr.correct >= 0)]:
    x = tr[sel]
    d = x.groupby(["sub", "in_memory"]).rt.median().unstack()
    diff = d[1] - d[0]
    pa = paired_signflip(diff.values, rng)
    obs, pb = label_perm(x.rt.values, x.in_memory.values == 1, rng)
    print(f"{name}: (a) median RT in memory {d[1].median():.3f} s, not in memory {d[0].median():.3f} s; "
          f"per-participant difference mean {diff.mean():.3f} s, faster in {(diff < 0).sum()} of {len(diff)}; sign-flip p = {pa:.4f}")
    print(f"   (b) pooled mean difference in - out = {obs:.3f} s, label permutation p = {pb:.4f}")
print("paper: permutation test P = 0.001")
correct trials: (a) median RT in memory 1.041 s, not in memory 1.184 s; per-participant difference mean -0.109 s, faster in 17 of 21; sign-flip p = 0.0010
   (b) pooled mean difference in - out = -0.169 s, label permutation p = 0.0010
all trials: (a) median RT in memory 1.086 s, not in memory 1.179 s; per-participant difference mean -0.097 s, faster in 16 of 21; sign-flip p = 0.0020
   (b) pooled mean difference in - out = -0.173 s, label permutation p = 0.0020
paper: permutation test P = 0.001

Result: reproduced. Probes held in memory are answered faster (correct trials, medians 1.041 against 1.184 s, faster in 17 of 21 participants), with p at most 0.002 under every reading.

rt-correct-vs-incorrect¶

Correct decisions were faster than incorrect ones.

In [13]:
rng = np.random.default_rng(12)
d = tr.groupby(["sub", "correct"]).rt.median().unstack().dropna()
diff = d[1] - d[0]
pa = paired_signflip(diff.values, rng)
obs, pb = label_perm(tr.rt.values, tr.correct.values == 1, rng)
print(f"(a) {len(d)} participants with incorrect trials; median of correct {d[1].median():.3f} s, incorrect {d[0].median():.3f} s; "
      f"correct faster in {(diff < 0).sum()} of {len(diff)}; sign-flip p = {pa:.4f}")
print(f"(b) pooled mean difference correct - incorrect = {obs:.3f} s, label permutation p = {pb:.4f}")
print("incorrect trials per participant:", tr[tr.correct == 0].groupby("sub").size().to_dict())
print("paper: permutation test P = 0.002")
(a) 21 participants with incorrect trials; median of correct 1.084 s, incorrect 1.503 s; correct faster in 20 of 21; sign-flip p = 0.0010
(b) pooled mean difference correct - incorrect = -0.639 s, label permutation p = 0.0010
incorrect trials per participant: {1: 32, 2: 12, 3: 11, 4: 8, 5: 19, 6: 27, 7: 5, 8: 12, 9: 14, 10: 15, 11: 13, 12: 12, 13: 21, 14: 12, 15: 22, 16: 6, 17: 6, 18: 9, 19: 6, 20: 20, 21: 20}
paper: permutation test P = 0.002

Result: reproduced. Correct responses are faster than incorrect ones (medians 1.084 against 1.503 s, in 20 of 21 participants), p = 0.001 under both readings.

fig1e-load-modulated-neurons¶

During maintenance a significant proportion of neurons in the preSMA (19.6%), vmPFC (18.75%) and dACC (10.53%) was modulated by memory load.

Spike counts in the first 2.5 s of maintenance, a Poisson GLM on the z-scored predictor fitted by Newton's method (the same maximum-likelihood fit as the code's unpenalised PoissonRegressor; checked against sklearn below), 1,000 permutations with seed 17. Trial readings: (a) the code's 96 load-matched trials (new_trial_info.xlsx: subject 1's new_trial_ids, each neuron's count from its own session's trial with the same id), with the permutation shared over the trial vector (the code) or drawn within each participant (Methods); (b) all trials of each participant, permuted within participant.

In [14]:
REG = {g: NT.nid[NT.region == g].values for g in ["AMY", "HPC", "dACC", "preSMA", "vmPFC"]}
NP = 1000


def glm_design(pred, trials, perm, seed=17):
    rng = np.random.default_rng(seed)
    shared = np.array([rng.permutation(len(ids1)) for _ in range(NP)])
    subperm, Y, X, P = {}, [], [], []
    for n in range(len(NT)):
        sub = NT["sub"].iat[n]
        t = T[sub].set_index("trial")
        if trials == "matched":
            rows = INFO[INFO.subject_id == sub].set_index("new_trial_id").loc[ids1, "trial_id"].values
        else:
            rows = t.index.values
        tt = t.loc[rows]
        Y.append(wm.count_in(SPK[n], tt.maint.values, tt.maint.values + 2.5))
        if pred == "rt_code":
            X.append(INFO[INFO.subject_id == 1].set_index("new_trial_id").loc[ids1, "RT"].values)
        else:
            X.append(tt["load" if pred == "load" else "rt"].values)
        if perm == "shared":
            P.append(shared)
        else:
            if sub not in subperm:
                subperm[sub] = np.array([rng.permutation(len(rows)) for _ in range(NP)])
            P.append(subperm[sub])
    return Y, X, P


GLM = {}
for pred in ["load", "rt", "rt_code"]:
    for trials, perm in [("matched", "shared"), ("matched", "within"), ("all", "within")]:
        if pred == "rt_code" and trials == "all":
            continue
        Y, X, P = glm_design(pred, trials, perm)
        GLM[(pred, trials, perm)] = (wm.glm_fit(Y, X, P), Y, X)

# check of the fit against sklearn on 20 neurons
from sklearn.linear_model import PoissonRegressor
(real, null), Y, X = GLM[("load", "matched", "shared")]
dev = []
for n in range(0, 902, 45):
    x = (X[n] - X[n].mean()) / X[n].std()
    if Y[n].sum() > 0:
        dev.append(abs(PoissonRegressor(alpha=0, max_iter=1000).fit(x[:, None], Y[n]).coef_[0] - real[n]))
print(f"largest |slope - sklearn slope| over {len(dev)} neurons: {max(dev):.2e}")
print("neurons with no maintenance spikes in the matched trials:", int(sum(y.sum() == 0 for y in Y)))
for key in [("load", "matched", "shared"), ("load", "matched", "within"), ("load", "all", "within")]:
    (real, null), _, _ = GLM[key]
    df, _ = wm.glm_groups(real, null, REG)
    print(f"\nload, trials {key[1]}, permutation {key[2]}:")
    print(df.round(3).to_string(index=False))
print("\npaper: preSMA 19.6% (P = 0.001), vmPFC 18.75% (P = 0.009), dACC 10.53% (P = 0.026); tolerance 10% of each")
largest |slope - sklearn slope| over 21 neurons: 1.13e-04
neurons with no maintenance spikes in the matched trials: 0

load, trials matched, permutation shared:
 group   n  significant  percent  null_mean     p
   AMY 259           14    5.405     13.350 0.459
   HPC 190            9    4.737      9.696 0.594
  dACC 171           18   10.526      8.719 0.025
preSMA 250           51   20.400     12.768 0.000
 vmPFC  32            6   18.750      1.643 0.009

load, trials matched, permutation within:
 group   n  significant  percent  null_mean     p
   AMY 259           15    5.792     13.328 0.357
   HPC 190           10    5.263      9.697 0.495
  dACC 171           17    9.942      8.710 0.018
preSMA 250           48   19.200     12.749 0.000
 vmPFC  32            6   18.750      1.620 0.007

load, trials all, permutation within:
 group   n  significant  percent  null_mean     p
   AMY 259           12    4.633     13.274 0.669
   HPC 190           12    6.316      9.663 0.267
  dACC 171           22   12.865      8.670 0.000
preSMA 250           57   22.800     12.689 0.000
 vmPFC  32            7   21.875      1.623 0.003

paper: preSMA 19.6% (P = 0.001), vmPFC 18.75% (P = 0.009), dACC 10.53% (P = 0.026); tolerance 10% of each
In [15]:
# Stability check. The slope depends on the data only through sum(x * y), so a permutation of the
# three load levels often gives exactly the real slope, and a neuron can sit on its own threshold.
# The comparison '>=' is then decided by floating-point rounding, which can differ between machines
# and runs. 'raw' (above) compares the floats as the code does; 'in' counts values within a relative
# 1e-9 of the threshold as at it (the code's rule in exact arithmetic), 'out' as below it.
for key in [("load", "matched", "shared"), ("load", "matched", "within"), ("load", "all", "within"),
            ("rt", "matched", "shared"), ("rt", "all", "within")]:
    (real, null), _, _ = GLM[key]
    thr = np.quantile(np.abs(null), 0.95, axis=1, method="higher")
    at = np.abs(np.abs(real) - thr) <= 1e-9 * thr
    print(f"\n{key[0]}, trials {key[1]}, permutation {key[2]}: {int(at.sum())} neurons have |b1| within a relative 1e-9 "
          f"of their threshold {NT.region[at].value_counts().to_dict()}")
    tab = {ties: wm.glm_groups(real, null, REG, ties=ties)[0].set_index("group") for ties in ["raw", "in", "out"]}
    print(pd.DataFrame({f"{ties}_{c}": tab[ties][c] for ties in tab for c in ["significant", "percent", "p"]}).round(3).to_string())
load, trials matched, permutation shared: 8 neurons have |b1| within a relative 1e-9 of their threshold {'preSMA': 4, 'AMY': 3, 'vmPFC': 1}
        raw_significant  raw_percent  raw_p  in_significant  in_percent   in_p  out_significant  out_percent  out_p
group                                                                                                              
AMY                  14        5.405  0.459              16       6.178  0.355               13        5.019  0.372
HPC                   9        4.737  0.594               9       4.737  0.663                9        4.737  0.473
dACC                 18       10.526  0.025              18      10.526  0.030               18       10.526  0.021
preSMA               51       20.400  0.000              51      20.400  0.000               47       18.800  0.000
vmPFC                 6       18.750  0.009               7      21.875  0.003                6       18.750  0.005

load, trials matched, permutation within: 5 neurons have |b1| within a relative 1e-9 of their threshold {'AMY': 3, 'HPC': 1, 'preSMA': 1}
        raw_significant  raw_percent  raw_p  in_significant  in_percent   in_p  out_significant  out_percent  out_p
group                                                                                                              
AMY                  15        5.792  0.357              16       6.178  0.368               13        5.019  0.375
HPC                  10        5.263  0.495              10       5.263  0.554                9        4.737  0.491
dACC                 17        9.942  0.018              17       9.942  0.029               17        9.942  0.008
preSMA               48       19.200  0.000              48      19.200  0.000               47       18.800  0.000
vmPFC                 6       18.750  0.007               6      18.750  0.008                6       18.750  0.004

load, trials all, permutation within: 5 neurons have |b1| within a relative 1e-9 of their threshold {'AMY': 3, 'HPC': 2}
        raw_significant  raw_percent  raw_p  in_significant  in_percent   in_p  out_significant  out_percent  out_p
group                                                                                                              
AMY                  12        4.633  0.669              15       5.792  0.452               12        4.633  0.496
HPC                  12        6.316  0.267              13       6.842  0.226               11        5.789  0.260
dACC                 22       12.865  0.000              22      12.865  0.000               22       12.865  0.000
preSMA               57       22.800  0.000              57      22.800  0.000               57       22.800  0.000
vmPFC                 7       21.875  0.003               7      21.875  0.003                7       21.875  0.003

rt, trials matched, permutation shared: 0 neurons have |b1| within a relative 1e-9 of their threshold {}
        raw_significant  raw_percent  raw_p  in_significant  in_percent   in_p  out_significant  out_percent  out_p
group                                                                                                              
AMY                  23        8.880  0.020              23       8.880  0.020               23        8.880  0.017
HPC                  15        7.895  0.089              15       7.895  0.089               15        7.895  0.080
dACC                 17        9.942  0.029              17       9.942  0.029               17        9.942  0.026
preSMA               43       17.200  0.000              43      17.200  0.000               43       17.200  0.000
vmPFC                 2        6.250  0.460               2       6.250  0.460                2        6.250  0.447

rt, trials all, permutation within: 0 neurons have |b1| within a relative 1e-9 of their threshold {}
        raw_significant  raw_percent  raw_p  in_significant  in_percent   in_p  out_significant  out_percent  out_p
group                                                                                                              
AMY                  28       10.811  0.000              28      10.811  0.000               28       10.811  0.000
HPC                  18        9.474  0.017              18       9.474  0.017               18        9.474  0.013
dACC                 21       12.281  0.001              21      12.281  0.001               21       12.281  0.001
preSMA               35       14.000  0.000              35      14.000  0.000               35       14.000  0.000
vmPFC                 2        6.250  0.450               2       6.250  0.450                2        6.250  0.441

Result: reproduced. Under reading (a) with the code's shared permutation, preSMA (20.40%, 51 of 250, p = 0.000), vmPFC (18.75%, p = 0.009) and dACC (10.53%, p = 0.025) are each within tolerance with p < 0.05; the within-participant permutation gives 19.20%, 18.75% and 9.94%, also within tolerance. With all trials (reading b) the three regions stay significant with higher percentages (22.80%, 21.88%, 12.87%). The amygdala and hippocampus are not significant under any reading. The stability check shows why these counts moved between runs: with load as the predictor 8 neurons (4 in preSMA) have |b1| equal to their own null threshold up to rounding, so the counts depend on the last bits of the fit. Counting those ties as significant (in) or not (out), the shared permutation gives preSMA 51 or 47 neurons (20.40% or 18.80%) and vmPFC 21.88% or 18.75%, so vmPFC leaves the tolerance when ties count; the within-participant permutation stays within tolerance for all three regions under every tie rule (preSMA 18.80 to 19.20%, vmPFC 18.75%, dACC 9.94%, p at most 0.029). The outcome does not depend on the rounding. With reaction time as the predictor no neuron sits on its threshold, and the counts do not change.

fig1f-rt-modulation-not-significant¶

No region had a significant proportion of neurons whose maintenance firing covaried with reaction time after correction, although the amygdala (5.79%), preSMA (8.00%) and vmPFC (6.25%) showed elevated percentages.

The GLM of the previous section with RT as the predictor; Benjamini-Hochberg over the five regions. The main analysis uses each trial's own RT; the code's predictor, subject 1's RT vector for every neuron (main_1e,f.py:113), is the variant.

In [16]:
for key in [("rt", "matched", "shared"), ("rt", "matched", "within"), ("rt", "all", "within"),
            ("rt_code", "matched", "shared"), ("rt_code", "matched", "within")]:
    (real, null), _, _ = GLM[key]
    df, _ = wm.glm_groups(real, null, REG)
    df["p_BH"] = wm.bh(df.p)
    label = "each trial's own RT" if key[0] == "rt" else "variant, subject 1's RT vector (the code)"
    print(f"\n{label}; trials {key[1]}, permutation {key[2]}:")
    print(df.round(3).to_string(index=False))
print("\npaper: AMY 5.79%, preSMA 8.00%, vmPFC 6.25%, none significant after correction")
each trial's own RT; trials matched, permutation shared:
 group   n  significant  percent  null_mean     p  p_BH
   AMY 259           23    8.880      12.95 0.020 0.048
   HPC 190           15    7.895       9.50 0.089 0.111
  dACC 171           17    9.942       8.55 0.029 0.048
preSMA 250           43   17.200      12.50 0.000 0.000
 vmPFC  32            2    6.250       1.60 0.460 0.460

each trial's own RT; trials matched, permutation within:
 group   n  significant  percent  null_mean     p  p_BH
   AMY 259           23    8.880      12.95 0.023 0.038
   HPC 190           16    8.421       9.50 0.056 0.070
  dACC 171           18   10.526       8.55 0.020 0.038
preSMA 250           40   16.000      12.50 0.000 0.000
 vmPFC  32            2    6.250       1.60 0.464 0.464

each trial's own RT; trials all, permutation within:
 group   n  significant  percent  null_mean     p  p_BH
   AMY 259           28   10.811      12.95 0.000 0.000
   HPC 190           18    9.474       9.50 0.017 0.021
  dACC 171           21   12.281       8.55 0.001 0.002
preSMA 250           35   14.000      12.50 0.000 0.000
 vmPFC  32            2    6.250       1.60 0.450 0.450

variant, subject 1's RT vector (the code); trials matched, permutation shared:
 group   n  significant  percent  null_mean     p  p_BH
   AMY 259           15    5.792      12.95 0.326 0.699
   HPC 190            4    2.105       9.50 0.966 0.966
  dACC 171            8    4.678       8.55 0.559 0.699
preSMA 250           20    8.000      12.50 0.080 0.400
 vmPFC  32            2    6.250       1.60 0.463 0.699
variant, subject 1's RT vector (the code); trials matched, permutation within:
 group   n  significant  percent  null_mean     p  p_BH
   AMY 259           16    6.178      12.95 0.244 0.407
   HPC 190            3    1.579       9.50 0.993 0.993
  dACC 171            9    5.263       8.55 0.470 0.587
preSMA 250           21    8.400      12.50 0.039 0.195
 vmPFC  32            3    9.375       1.60 0.220 0.407

paper: AMY 5.79%, preSMA 8.00%, vmPFC 6.25%, none significant after correction

Result: not reproduced. With each trial's own reaction time, the claim's test finds regions with a significant proportion of RT-modulated neurons after BH correction (preSMA, the amygdala and dACC under reading (a); see the p_BH column), and the percentages are higher than the paper's. The code's predictor, subject 1's RT vector applied to every neuron, gives the paper's three percentages exactly (AMY 5.79%, preSMA 8.00%, vmPFC 6.25%) and no region significant after correction under the shared permutation, so the paper's numbers come from that predictor, which pairs each neuron's counts with another participant's reaction times.

concept-cells-count¶

Of 902 neurons, 58 (6.4%) were concept cells, 4 ± 4 across participants, 70.69% of them in the amygdala, 18.96% in the hippocampus, 1.72% in the dACC, 3.45% in the preSMA and 5.15% in the vmPFC.

Spike counts 200 to 1000 ms after first-encoding onset on all trials; the two images with the highest mean rate; bootstrap of the difference (1,000 resamples). Reading (a) is the Methods' bootstrap, (b) the code's; ten seeds each (the code sets none).

In [17]:
CCR = {}
rates = []
for n in range(len(NT)):
    t = T[NT["sub"].iat[n]]
    rates.append((wm.count_in(SPK[n], (t.enc1 + 0.2).values, (t.enc1 + 1.0).values) / 0.8, t.img1.values))
rows = []
for reading in ["methods", "code"]:
    for seed in range(10):
        rng = np.random.default_rng(seed)
        res = pd.DataFrame([wm.concept_test(r, im, rng, reading=reading) for r, im in rates], columns=["pref", "p", "sig"])
        CCR[(reading, seed)] = res
        reg = NT.region[res.sig.values].value_counts()
        rows.append({"reading": reading, "seed": seed, "concept": int(res.sig.sum()),
                     **{f"%{g}": round(100 * reg.get(g, 0) / max(res.sig.sum(), 1), 2) for g in ["AMY", "HPC", "dACC", "preSMA", "vmPFC"]}})
cc_tab = pd.DataFrame(rows)
print(cc_tab.to_string(index=False))
print("\nrange of counts:", cc_tab.groupby("reading").concept.agg(["min", "max"]).to_dict("index"))
CONCEPT = CCR[("code", 0)].sig.values
PREF = CCR[("code", 0)].pref.values
per = pd.Series(NT["sub"].values[CONCEPT]).value_counts()
print(f"\nset used downstream: reading (b), seed 0, {CONCEPT.sum()} cells; per participant with any: "
      f"{per.mean():.2f} +/- {per.std():.2f} over {len(per)} participants; over all 21: {per.reindex(range(1, 22), fill_value=0).mean():.2f} +/- {per.reindex(range(1, 22), fill_value=0).std():.2f}")
ship = (SHIP_REG.Signi == "Y").values
print(f"for comparison, the code's shipped list: {ship.sum()} cells, {int((ship & CONCEPT).sum())} shared with the set used here; "
      f"cells in the shipped list found in k of the 10 code-reading seeds: "
      f"{pd.Series(np.array([CCR[('code', s)].sig.values for s in range(10)]).sum(0)[ship]).value_counts().sort_index().to_dict()}")
print("paper: 58 (tolerance 52.2 to 63.8); AMY 70.69% (63.6 to 77.8), HPC 18.96% (17.06 to 20.86)")
reading  seed  concept  %AMY  %HPC  %dACC  %preSMA  %vmPFC
methods     0       50 74.00 18.00   2.00     2.00    4.00
methods     1       51 72.55 17.65   1.96     1.96    5.88
methods     2       51 70.59 19.61   1.96     3.92    3.92
methods     3       50 70.00 20.00   2.00     2.00    6.00
methods     4       49 73.47 18.37   2.04     2.04    4.08
methods     5       50 74.00 18.00   2.00     2.00    4.00
methods     6       51 74.51 17.65   1.96     1.96    3.92
methods     7       52 73.08 17.31   1.92     1.92    5.77
methods     8       54 72.22 18.52   1.85     3.70    3.70
methods     9       53 75.47 16.98   1.89     1.89    3.77
   code     0       58 70.69 18.97   1.72     3.45    5.17
   code     1       58 72.41 17.24   1.72     3.45    5.17
   code     2       58 70.69 18.97   1.72     3.45    5.17
   code     3       58 70.69 18.97   1.72     3.45    5.17
   code     4       59 71.19 18.64   1.69     3.39    5.08
   code     5       57 70.18 19.30   1.75     3.51    5.26
   code     6       57 70.18 19.30   1.75     3.51    5.26
   code     7       60 71.67 18.33   1.67     3.33    5.00
   code     8       59 71.19 18.64   1.69     3.39    5.08
   code     9       58 70.69 18.97   1.72     3.45    5.17

range of counts: {'code': {'min': 57, 'max': 60}, 'methods': {'min': 49, 'max': 54}}

set used downstream: reading (b), seed 0, 58 cells; per participant with any: 4.14 +/- 3.66 over 14 participants; over all 21: 2.76 +/- 3.56
for comparison, the code's shipped list: 58 cells, 57 shared with the set used here; cells in the shipped list found in k of the 10 code-reading seeds: {5: 1, 8: 1, 9: 1, 10: 55}
paper: 58 (tolerance 52.2 to 63.8); AMY 70.69% (63.6 to 77.8), HPC 18.96% (17.06 to 20.86)

Result: reproduced. Under the code's bootstrap (reading b) the count is 57 to 60 over ten seeds, all within tolerance, with the amygdala share 70.18 to 72.41% and the hippocampus share 17.24 to 19.30%; seed 0 gives regional shares within 0.02 points of the paper's (41, 11, 1, 2 and 3 cells; HPC 18.97% against 18.96%, vmPFC 5.17% against 5.15%). The Methods' bootstrap (reading a) finds 49 to 54 cells, within tolerance only for two seeds. The per-participant spread is 4.14 +/- 3.66 over the 14 participants with a concept cell, close to the paper's 4 +/- 4. The set used in later sections is reading (b), seed 0 (a standard choice of seed); it shares 57 of its 58 cells with the code's shipped list.

fig2ab-single-cells-not-persistent¶

Examined neuron by neuron, most concept cells did not maintain elevated firing for their preferred image throughout the maintenance epoch.

Per concept cell, load 1 trials, 50 ms bins of the first 2.5 s of maintenance, z-scored to fixation and smoothed (sigma one bin); preferred trials are those whose first image is the cell's preferred image. Reading (a): a permutation test per bin (1,000 shuffles of the preferred/nonpreferred labels), persistent when significantly higher on preferred trials in at least half the bins; reading (b): persistent when the spike count is significantly higher on preferred trials in each of the 1 s windows M1 to M3 (M3 ends at the end of maintenance).

In [18]:
CELLS_C = np.where(CONCEPT)[0]


def pref_mask(t, pref, load):
    if load == 1:
        return (t.img1 == pref).values
    return ((t.img1 == pref) | (t.img2 == pref) | (t.img3 == pref)).values


rows = []
for n in CELLS_C:
    rng = np.random.default_rng(int(n))
    t = T[NT["sub"].iat[n]]
    t = t[t.load == 1]
    pm = pref_mask(t, PREF[n], 1)
    Z = wm.psth_z(SPK[n], t.maint.values, 2.5, *FIX[n])
    obs = Z[pm].mean(0) - Z[~pm].mean(0)
    perms = [rng.permutation(pm) for _ in range(1000)]
    null = np.array([Z[q].mean(0) - Z[~q].mean(0) for q in perms])
    p = np.mean(np.abs(null) >= np.abs(obs), 0)
    frac = np.mean((p < 0.05) & (obs > 0))
    win = []
    for i in range(3):
        c = wm.count_in(SPK[n], t.maint.values + i, np.minimum(t.maint.values + i + 1, t.probe.values))
        o = c[pm].mean() - c[~pm].mean()
        nn = np.array([c[q].mean() - c[~q].mean() for q in perms])
        win.append(bool(o > 0 and np.mean(np.abs(nn) >= abs(o)) < 0.05))
    rows.append({"nid": n, "sub": NT["sub"].iat[n], "region": NT.region.iat[n], "pref_trials": int(pm.sum()),
                 "frac_bins_higher": frac, "M1": win[0], "M2": win[1], "M3": win[2]})
sc = pd.DataFrame(rows)
sc["persistent_a"] = sc.frac_bins_higher >= 0.5
sc["persistent_b"] = sc[["M1", "M2", "M3"]].all(1)
print(sc.round(2).to_string(index=False))
print(f"\n{len(sc)} concept cells; preferred load-1 trials per cell {sc.pref_trials.min()} to {sc.pref_trials.max()}")
print(f"persistent under (a): {sc.persistent_a.sum()}; not persistent: {(~sc.persistent_a).sum()}")
print(f"persistent under (b): {sc.persistent_b.sum()}; not persistent: {(~sc.persistent_b).sum()}")
print("cells significant in M1, M2, M3:", sc[["M1", "M2", "M3"]].sum().to_dict())
print("by participant (persistent a / cells):", sc.groupby("sub").agg(cells=("nid", "size"), pa=("persistent_a", "sum"), pb=("persistent_b", "sum")).T.to_dict())
for thr in [0.25, 0.75]:
    print(f"threshold variant, persistent when at least {thr:.0%} of bins are higher: {(sc.frac_bins_higher >= thr).sum()} of {len(sc)}")
 nid  sub region  pref_trials  frac_bins_higher    M1    M2    M3  persistent_a  persistent_b
  40    2    AMY            9              0.12 False False False         False         False
  41    2    AMY            9              0.40 False  True  True         False         False
  52    2    HPC            9              0.00 False False False         False         False
 103    4 preSMA            9              0.02 False False False         False         False
 120    4    AMY            9              0.00 False False False         False         False
 152    4    AMY            9              0.02 False False False         False         False
 159    4    AMY            9              0.06 False False False         False         False
 162    4  vmPFC            9              0.12 False  True False         False         False
 164    4  vmPFC            9              0.00 False False False         False         False
 223    5  vmPFC            9              0.10 False  True False         False         False
 266    7    AMY            6              0.14  True False False         False         False
 269    7    AMY            6              0.66  True  True  True          True          True
 276    7    AMY            8              0.10  True False False         False         False
 322    8    HPC            6              0.14 False False False         False         False
 357    9    AMY            8              0.08 False False False         False         False
 363    9    AMY            8              0.12 False False False         False         False
 368    9    AMY            8              0.00 False False False         False         False
 383    9    AMY            7              0.42  True  True False         False         False
 464   11    HPC            9              0.34  True  True False         False         False
 473   11    HPC            9              0.06 False False False         False         False
 489   11 preSMA            9              0.04 False False False         False         False
 514   12    AMY            9              0.58  True  True  True          True          True
 531   13    AMY            9              0.08  True False False         False         False
 536   13    AMY            9              0.04 False False False         False         False
 544   13    AMY            9              0.00 False False False         False         False
 546   13    AMY            9              0.44  True  True False         False         False
 548   13    AMY            9              0.40  True False False         False         False
 550   13    AMY            9              0.00 False False False         False         False
 552   13    AMY            9              0.24  True False False         False         False
 554   13    AMY            9              0.04 False False False         False         False
 558   13    HPC            9              0.12  True False False         False         False
 593   14    AMY            9              0.28  True False  True         False         False
 594   14    AMY            9              0.06 False False False         False         False
 595   14    AMY            9              0.86  True  True  True          True          True
 596   14    AMY            9              0.04 False False False         False         False
 597   14    AMY            9              0.50  True  True False          True         False
 598   14    AMY            9              0.58  True  True  True          True          True
 599   14    AMY            9              0.70  True  True  True          True          True
 601   14    AMY            9              0.42  True False False         False         False
 602   14    AMY            9              0.08 False False False         False         False
 606   14    AMY            9              0.18 False False False         False         False
 609   14    AMY            9              0.10 False False False         False         False
 616   14    HPC            9              0.66  True  True  True          True          True
 618   14    HPC            9              0.20  True False False         False         False
 620   14    HPC            9              0.14  True False False         False         False
 677   15    HPC            9              0.02 False False False         False         False
 702   16    AMY            7              0.30  True  True  True         False          True
 709   16    AMY            7              0.10 False False False         False         False
 715   16    AMY            7              0.00 False False False         False         False
 717   16    AMY            7              0.26  True  True  True         False          True
 732   16    HPC            7              0.00 False False False         False         False
 767   18    AMY            9              0.10 False  True False         False         False
 773   18    AMY            9              0.02 False False False         False         False
 781   18    AMY            9              0.32  True  True False         False         False
 783   18    AMY            9              0.40  True  True  True         False          True
 804   18    HPC            9              0.62  True  True  True          True          True
 883   21    AMY            9              0.10 False False False         False         False
 887   21   dACC            9              0.06 False False  True         False         False

58 concept cells; preferred load-1 trials per cell 6 to 9
persistent under (a): 8; not persistent: 50
persistent under (b): 10; not persistent: 48
cells significant in M1, M2, M3: {'M1': 25, 'M2': 19, 'M3': 13}
by participant (persistent a / cells): {2: {'cells': 3, 'pa': 0, 'pb': 0}, 4: {'cells': 6, 'pa': 0, 'pb': 0}, 5: {'cells': 1, 'pa': 0, 'pb': 0}, 7: {'cells': 3, 'pa': 1, 'pb': 1}, 8: {'cells': 1, 'pa': 0, 'pb': 0}, 9: {'cells': 4, 'pa': 0, 'pb': 0}, 11: {'cells': 3, 'pa': 0, 'pb': 0}, 12: {'cells': 1, 'pa': 1, 'pb': 1}, 13: {'cells': 9, 'pa': 0, 'pb': 0}, 14: {'cells': 14, 'pa': 5, 'pb': 4}, 15: {'cells': 1, 'pa': 0, 'pb': 0}, 16: {'cells': 5, 'pa': 0, 'pb': 2}, 18: {'cells': 5, 'pa': 1, 'pb': 2}, 21: {'cells': 2, 'pa': 0, 'pb': 0}}
threshold variant, persistent when at least 25% of bins are higher: 19 of 58
threshold variant, persistent when at least 75% of bins are higher: 1 of 58

Result: reproduced. 50 of 58 concept cells are not persistent under reading (a) and 48 under reading (b); with a 25% bin threshold 39 are not persistent.

fig2c-population-persistence¶

Averaged across the 58 concept cells, firing on preferred trials stayed higher than on nonpreferred trials across the maintenance epoch of load 1 trials, a pattern of persistent activity.

Per cell the trial-mean z-scored, smoothed rate (50 ms bins) on preferred and nonpreferred trials, in the first encoding second, the first 2.5 s of maintenance and the first second of the probe (the three panels); per bin a bootstrap over cells (1,000, seed 42) of the mean preferred minus nonpreferred difference, two-sided, BH over all bins of all panels (per-panel BH as a variant). Readings: (a) significant bins cover at least half the maintenance bins; (b) every 500 ms segment holds a significant bin.

In [19]:
def population_persistence(load, seed=42):
    D = {"enc": [], "maint": [], "probe": []}
    for n in CELLS_C:
        t = T[NT["sub"].iat[n]]
        t = t[t.load == load]
        pm = pref_mask(t, PREF[n], load)
        for ep, on, dur in [("enc", t.enc1.values, 1.0), ("maint", t.maint.values, 2.5), ("probe", t.probe.values, 1.0)]:
            Z = wm.psth_z(SPK[n], on, dur, *FIX[n])
            D[ep].append(np.c_[Z[pm].mean(0), Z[~pm].mean(0)])
    rng = np.random.default_rng(seed)
    idx = rng.integers(0, len(CELLS_C), (1000, len(CELLS_C)))
    out = {}
    for ep, arr in D.items():
        a = np.array(arr)  # cells x bins x (pref, nonpref)
        d = a[:, :, 0] - a[:, :, 1]
        b = d[idx].mean(1)
        p = np.minimum(1, 2 * np.minimum(np.mean(b <= 0, 0), np.mean(b >= 0, 0)))
        out[ep] = (a.mean(0), d.mean(0), p)
    allp = np.concatenate([out[e][2] for e in ["enc", "maint", "probe"]])
    q = wm.bh(allp)
    nb = {e: len(out[e][2]) for e in out}
    qm = q[nb["enc"]:nb["enc"] + nb["maint"]]
    sig = (qm < 0.05) & (out["maint"][1] > 0)
    sig_panel = (wm.bh(out["maint"][2]) < 0.05) & (out["maint"][1] > 0)
    return out, sig, sig_panel


PERSIST = {}
for load in [1, 2, 3]:
    out, sig, sigp = population_persistence(load)
    PERSIST[load] = (out, sig, sigp)
    seg = [bool(sig[i * 10:(i + 1) * 10].any()) for i in range(5)]
    m = out["maint"][0]
    print(f"load {load}: maintenance mean z preferred {m[:, 0].mean():.3f}, nonpreferred {m[:, 1].mean():.3f}; "
          f"preferred above nonpreferred in {np.mean(m[:, 0] > m[:, 1]):.2f} of bins; significant bins (BH all panels) "
          f"{sig.mean():.2f} (per-panel BH {sigp.mean():.2f}); 500 ms segments with a significant bin {seg}")
    print(f"   ranges: preferred {m[:, 0].min():.2f} to {m[:, 0].max():.2f}, nonpreferred {m[:, 1].min():.2f} to {m[:, 1].max():.2f}")
out = PERSIST[1][0]
fig, ax = plt.subplots(1, 3, figsize=(12, 3), sharey=True)
for a, ep, dur in zip(ax, ["enc", "maint", "probe"], [1.0, 2.5, 1.0]):
    x = np.arange(len(out[ep][1])) * 0.05
    a.plot(x, out[ep][0][:, 0], label="preferred")
    a.plot(x, out[ep][0][:, 1], label="nonpreferred")
    a.set_title(f"{ep}, load 1")
    a.set_xlabel("s from onset")
ax[0].set_ylabel("z-scored rate")
ax[0].legend()
plt.show()
load 1: maintenance mean z preferred 0.761, nonpreferred -0.013; preferred above nonpreferred in 1.00 of bins; significant bins (BH all panels) 1.00 (per-panel BH 1.00); 500 ms segments with a significant bin [True, True, True, True, True]
   ranges: preferred 0.43 to 1.26, nonpreferred -0.13 to 0.16
load 2: maintenance mean z preferred 0.495, nonpreferred 0.008; preferred above nonpreferred in 1.00 of bins; significant bins (BH all panels) 1.00 (per-panel BH 1.00); 500 ms segments with a significant bin [True, True, True, True, True]
   ranges: preferred 0.29 to 0.77, nonpreferred -0.13 to 0.18
load 3: maintenance mean z preferred 0.317, nonpreferred -0.008; preferred above nonpreferred in 0.92 of bins; significant bins (BH all panels) 0.60 (per-panel BH 0.62); 500 ms segments with a significant bin [True, True, True, True, True]
   ranges: preferred 0.10 to 0.59, nonpreferred -0.18 to 0.33
No description has been provided for this image

Result: reproduced. At load 1 the population's preferred trace (mean z 0.761) is above the nonpreferred one (-0.013) in every maintenance bin, and every bin is significant after BH, so both readings hold. No point of the plot falls outside its axes, whose ranges are printed.

ext1bc-persistence-by-load¶

The population-level persistence of concept cells was robust at loads 1 and 2 and attenuated at load 3.

Same analysis on load 2 and load 3 trials, a trial preferred when any encoded image is the preferred image; the measure is the fraction of significant maintenance bins.

In [20]:
for load in [1, 2, 3]:
    out, sig, sigp = PERSIST[load]
    seg = [bool(sig[i * 10:(i + 1) * 10].any()) for i in range(5)]
    print(f"load {load}: fraction of maintenance bins significant {sig.mean():.2f} (per-panel BH {sigp.mean():.2f}); "
          f"meets reading (a) {sig.mean() >= 0.5}, reading (b) {all(seg)}; mean difference {out['maint'][1].mean():.3f} z")
load 1: fraction of maintenance bins significant 1.00 (per-panel BH 1.00); meets reading (a) True, reading (b) True; mean difference 0.774 z
load 2: fraction of maintenance bins significant 1.00 (per-panel BH 1.00); meets reading (a) True, reading (b) True; mean difference 0.487 z
load 3: fraction of maintenance bins significant 0.60 (per-panel BH 0.62); meets reading (a) True, reading (b) True; mean difference 0.325 z

Result: reproduced. Loads 1 and 2 have all maintenance bins significant and load 3 has 0.60, smaller than either, with a smaller preferred minus nonpreferred difference (0.774, 0.487 and 0.325 z).

fig2d-cross-temporal-localized¶

In load 1 trials, decoders trained at specific times of encoding or early maintenance classified the image above chance at other times, but cross-time generalization clusters were sparse and temporally localized, so the information was not stably held across maintenance.

A pseudo-population of the concept cells on the code's identity-matched trials (load-1 rows of new_trial_final.xlsx, 30 trials, 6 per image; labels the first image), spike counts in 250 ms windows stepped by 100 ms from first-encoding onset over 5 s (the code's duration for load 1), z-scored with fixation; a linear SVM trained at each bin and tested at every bin with LOOCV. Per pair a binomial test against 20%, one-sided (P(X >= k)) or two-sided, BH over the grid. Cluster rules: (i) the code's, contours of the significance mask longer than 13 points (skimage.measure.find_contours); (ii) the Methods', a cluster-duration null from 1,000 label shuffles, a cluster kept when its temporal extent (the longer side of its bounding box, in bins, a choice of this attempt) exceeds the 95th percentile of the largest extent per shuffled map.

In [21]:
from skimage import measure


def ct_design(nids, load, label):
    subs = sorted(set(NT["sub"].values[nids]))
    rows, _ = wm.pseudo_rows(T, subs, load, "code", FINAL)
    f14 = FINAL[(FINAL.subject_id == 14) & (FINAL.num_images_presented == load)].sort_values("trial_id_final")
    y = f14["stimulus_index_enc1" if label == "first" else f"stimulus_index_enc{load}"].values
    dur = {1: 5, 2: 6, 3: 7}[load]
    st = wm.window_starts(0.25, 0.1, dur)
    X = np.zeros((len(y), len(nids), len(st)))
    for j, n in enumerate(nids):
        sub = NT["sub"].iat[n]
        t = T[sub].set_index("trial").loc[rows[sub]]
        X[:, j, :] = wm.zcounts(SPK[n], t.enc1.values, st, 0.25, *FIX[n])
    # epoch edges relative to first-encoding onset, mean over the participants' trials used
    rel = np.mean([(T[s].set_index("trial").loc[rows[s]].maint - T[s].set_index("trial").loc[rows[s]].enc1).mean() for s in subs])
    return X, y, st, rel


TWO_SIDED = {}


def sig_mask(acc, N, side):
    k = np.round(acc * N).astype(int)
    if side == "one":
        p = binom.sf(k - 1, N, 0.2)
    else:
        p = TWO_SIDED.setdefault(N, np.array([binomtest(kk, N, 0.2).pvalue for kk in range(N + 1)]))[k]
    q = wm.bh(p.ravel()).reshape(p.shape)
    return (q < 0.05) & (acc > 0.2)


def clusters(mask):
    lab, n = ndimage.label(mask)
    out = []
    for i, sl in enumerate(ndimage.find_objects(lab)):
        ext = max(sl[0].stop - sl[0].start, sl[1].stop - sl[1].start)
        out.append((i + 1, ext))
    return lab, out


def code_rule(mask):
    keep = np.zeros_like(mask)
    for c in measure.find_contours(mask.astype(float), 0.5):
        if len(c) > 13:
            r0, r1 = int(np.floor(c[:, 0].min())), int(np.ceil(c[:, 0].max()))
            c0, c1 = int(np.floor(c[:, 1].min())), int(np.ceil(c[:, 1].max()))
            keep[r0:r1 + 1, c0:c1 + 1] |= mask[r0:r1 + 1, c0:c1 + 1]
    return keep


def ct_analysis(nids, load, label, n_perm=1000, seed=0):
    X, y, st, rel = ct_design(nids, load, label)
    acc = wm.loo_cross_temporal(X, y)
    seeds = [wm.stable_seed("ct", load, label, len(nids), seed, i) for i in range(n_perm)]
    chunks = [seeds[i::4] for i in range(4)]
    perm_maps = sum(wm.pmap(wm.ct_perm_maps, [(X, y, c) for c in chunks]), [])
    res = {"acc": acc, "st": st, "rel": rel, "N": len(y)}
    for side in ["one", "two"]:
        m = sig_mask(acc, len(y), side)
        null_ext, null_sig = [], []
        for pm in perm_maps:
            pmask = sig_mask(pm, len(y), side)
            _, cl = clusters(pmask)
            null_ext.append(max([e for _, e in cl], default=0))
            null_sig.append(int(pmask.sum()))
        thr = np.percentile(null_ext, 95)
        lab, cl = clusters(m)
        keep_perm = np.isin(lab, [i for i, e in cl if e > thr])
        res[side] = {"mask": m, "null95": thr, "perm": keep_perm, "code": code_rule(m),
                     "null_ext_mean": float(np.mean(null_ext)), "obs_max_ext": max([e for _, e in cl], default=0),
                     "null_maps_with_sig": int(np.sum(np.array(null_sig) > 0)), "null_sig_max": int(max(null_sig)),
                     "n_perm": len(perm_maps)}
    return res


def summarize_ct(res, name):
    st, rel, acc = res["st"], res["rel"], res["acc"]
    enc_b = st + 0.25 <= rel
    mb = (st >= rel) & (st + 0.25 <= rel + 2.5)
    early = (st >= rel) & (st + 0.25 <= rel + 1.0)
    offdiag = ~np.eye(len(st), dtype=bool)
    rows = []
    for side in ["one", "two"]:
        for rule in ["code", "perm"]:
            k = res[side][rule]
            rows.append({"map": name, "binomial": side, "cluster_rule": rule,
                         "sig_pairs": int(res[side]["mask"].sum()), "kept_pairs": int(k.sum()),
                         "kept_offdiag": int((k & offdiag).sum()),
                         "train_bins_enc_or_early_with_offdiag": int(((k & offdiag)[enc_b | early]).any(1).sum()),
                         "max_frac_maint_test_bins_from_a_maint_train_bin": round(float(k[np.ix_(mb, mb)].mean(1).max()) if mb.any() else 0, 2),
                         "null95_extent": res[side]["null95"], "obs_largest_extent": res[side]["obs_max_ext"],
                         "shuffled_maps_with_sig_pairs": f"{res[side]['null_maps_with_sig']}/{res[side]['n_perm']}",
                         "most_sig_pairs_in_a_shuffled_map": res[side]["null_sig_max"]})
    return pd.DataFrame(rows)


CT = {}
CT[("all", 1, "first")] = ct_analysis(CELLS_C, 1, "first")
r = CT[("all", 1, "first")]
print(f"{len(CELLS_C)} concept cells, {r['N']} trials, {len(r['st'])} bins; maintenance starts {r['rel']:.2f} s after first-encoding onset")
print(f"accuracy: diagonal mean {np.diag(r['acc']).mean():.3f}, range {r['acc'].min():.3f} to {r['acc'].max():.3f}; "
      f"mean largest cluster extent in shuffled maps {r['one']['null_ext_mean']:.1f} bins")
print(summarize_ct(r, "load 1, all concept cells").to_string(index=False))
im = plt.imshow(r["acc"] * 100, origin="lower", vmin=0, vmax=100, cmap="viridis")
if r["one"]["code"].any():
    plt.contour(r["one"]["code"].astype(float), levels=[0.5], colors="r")
plt.xlabel("test bin")
plt.ylabel("train bin")
plt.colorbar(im, label="accuracy (%)")
plt.title("load 1 cross-temporal decoding (red: kept by the code's rule, one-sided)")
plt.show()
58 concept cells, 30 trials, 49 bins; maintenance starts 1.32 s after first-encoding onset
accuracy: diagonal mean 0.324, range 0.000 to 1.000; mean largest cluster extent in shuffled maps 0.0 bins
                      map binomial cluster_rule  sig_pairs  kept_pairs  kept_offdiag  train_bins_enc_or_early_with_offdiag  max_frac_maint_test_bins_from_a_maint_train_bin  null95_extent  obs_largest_extent shuffled_maps_with_sig_pairs  most_sig_pairs_in_a_shuffled_map
load 1, all concept cells      one         code        290         227           217                                    17                                             0.14            0.0                  26                       3/1000                                 1
load 1, all concept cells      one         perm        290         290           280                                    17                                             0.18            0.0                  26                       3/1000                                 1
load 1, all concept cells      two         code        290         227           217                                    17                                             0.14            0.0                  26                       3/1000                                 1
load 1, all concept cells      two         perm        290         290           280                                    17                                             0.18            0.0                  26                       3/1000                                 1
No description has been provided for this image

Result: reproduced. Under every reading, 17 training bins in encoding or early maintenance have off-diagonal pairs kept above chance, and no maintenance training bin generalizes to more than 0.18 of the maintenance test bins, so the clusters are localized. Only 3 of the 1,000 shuffled maps have a significant pair after BH, one pair each, so the 95th percentile of their extent is 0, while the largest real cluster spans 26 bins; the rule as run cannot remove any real cluster. The one- and two-sided binomial tests keep the same pairs, as only accuracies above 20% are kept and both tests then reject at the same counts.

ext1de-cross-temporal-load23¶

In load 2 and load 3 trials cross-time generalization was minimal.

The analysis of fig2d on load 2 (6 s) and load 3 (7 s) rows of the identity-matched table, labels the first image (Methods) or the last (the code); "minimal" read as fewer off-diagonal pairs in surviving clusters than at load 1 under the same rule.

In [22]:
for load in [2, 3]:
    for label in ["first", "last"]:
        CT[("all", load, label)] = ct_analysis(CELLS_C, load, label)
tabs = [summarize_ct(CT[("all", 1, "first")], "load 1")]
for load in [2, 3]:
    for label in ["first", "last"]:
        tabs.append(summarize_ct(CT[("all", load, label)], f"load {load}, label {label}"))
ct_tab = pd.concat(tabs)
print(ct_tab.to_string(index=False))
base = ct_tab[ct_tab["map"] == "load 1"].set_index(["binomial", "cluster_rule"]).kept_offdiag
for label in ["first", "last"]:
    for (side, rule), b in base.items():
        v = [int(ct_tab[(ct_tab["map"] == f"load {L}, label {label}") & (ct_tab.binomial == side) & (ct_tab.cluster_rule == rule)].kept_offdiag.iloc[0]) for L in [2, 3]]
        print(f"label {label}, {side}-sided, rule {rule}: off-diagonal kept pairs load 1 {b}, load 2 {v[0]}, load 3 {v[1]}; both fewer: {v[0] < b and v[1] < b}")
                map binomial cluster_rule  sig_pairs  kept_pairs  kept_offdiag  train_bins_enc_or_early_with_offdiag  max_frac_maint_test_bins_from_a_maint_train_bin  null95_extent  obs_largest_extent shuffled_maps_with_sig_pairs  most_sig_pairs_in_a_shuffled_map
             load 1      one         code        290         227           217                                    17                                             0.14            0.0                  26                       3/1000                                 1
             load 1      one         perm        290         290           280                                    17                                             0.18            0.0                  26                       3/1000                                 1
             load 1      two         code        290         227           217                                    17                                             0.14            0.0                  26                       3/1000                                 1
             load 1      two         perm        290         290           280                                    17                                             0.18            0.0                  26                       3/1000                                 1
load 2, label first      one         code         10           8             6                                     4                                             0.00            0.0                   4                       9/1000                                 1
load 2, label first      one         perm         10          10             8                                     6                                             0.00            0.0                   4                       9/1000                                 1
load 2, label first      two         code         10           8             6                                     4                                             0.00            0.0                   4                       9/1000                                 1
load 2, label first      two         perm         10          10             8                                     6                                             0.00            0.0                   4                       9/1000                                 1
 load 2, label last      one         code         14          11             8                                     4                                             0.00            0.0                   5                       3/1000                                 1
 load 2, label last      one         perm         14          14            10                                     5                                             0.04            0.0                   5                       3/1000                                 1
 load 2, label last      two         code         14          11             8                                     4                                             0.00            0.0                   5                       3/1000                                 1
 load 2, label last      two         perm         14          14            10                                     5                                             0.04            0.0                   5                       3/1000                                 1
load 3, label first      one         code          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
load 3, label first      one         perm          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
load 3, label first      two         code          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
load 3, label first      two         perm          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
 load 3, label last      one         code          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
 load 3, label last      one         perm          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
 load 3, label last      two         code          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
 load 3, label last      two         perm          0           0             0                                     0                                             0.00            0.0                   0                       0/1000                                 0
label first, one-sided, rule code: off-diagonal kept pairs load 1 217, load 2 6, load 3 0; both fewer: True
label first, one-sided, rule perm: off-diagonal kept pairs load 1 280, load 2 8, load 3 0; both fewer: True
label first, two-sided, rule code: off-diagonal kept pairs load 1 217, load 2 6, load 3 0; both fewer: True
label first, two-sided, rule perm: off-diagonal kept pairs load 1 280, load 2 8, load 3 0; both fewer: True
label last, one-sided, rule code: off-diagonal kept pairs load 1 217, load 2 8, load 3 0; both fewer: True
label last, one-sided, rule perm: off-diagonal kept pairs load 1 280, load 2 10, load 3 0; both fewer: True
label last, two-sided, rule code: off-diagonal kept pairs load 1 217, load 2 8, load 3 0; both fewer: True
label last, two-sided, rule perm: off-diagonal kept pairs load 1 280, load 2 10, load 3 0; both fewer: True

Result: reproduced. Under both labels and every rule, loads 2 (6 to 10 off-diagonal pairs) and 3 (none) keep far fewer off-diagonal pairs than load 1 (217 to 280).

fig2e-maintenance-decoding-amy-mtl¶

Concept cells in the amygdala and in the MTL carried significant stimulus information during load 1 maintenance (35.56% and 32.13% decoding accuracy, chance 20%).

Within each participant, its concept cells in the region group, all its trials of the load, labels the last image; z-scored counts in 1 s windows stepped by 250 ms over the first 2.5 s of maintenance, concatenated; linear SVM, LOOCV; accuracy the mean over participants; p from 1,000 label shuffles, (k + 1) / 1001 on the mean over participants, BH within the load over the six region groups of the code (main_2e,supp_1f.py:14-21). Participants need at least three (Methods) or more than three (the code) concept cells in the group.

In [23]:
GROUPS_WP = {"AMY": ["AMY"], "HPC": ["HPC"], "dACC": ["dACC"], "preSMA": ["preSMA"],
             "MTL": ["AMY", "HPC"], "dACC_preSMA": ["dACC", "preSMA"]}
ST_WP = wm.window_starts(1.0, 0.25, 2.5)


def wp_design(g, sub, load):
    nids = NT[(NT["sub"] == sub) & NT.region.isin(GROUPS_WP[g]) & CONCEPT[NT.nid]].nid.values
    t = T[sub][T[sub].load == load]
    X = np.concatenate([wm.zcounts(SPK[n], t.maint.values, ST_WP, 1.0, *FIX[n]) for n in nids], 1)
    return X @ X.T, t["last"].values


units, designs = [], []
for g, regs in GROUPS_WP.items():
    for sub in sorted(T):
        k = int((CONCEPT & (NT["sub"] == sub).values & NT.region.isin(regs).values).sum())
        if k >= 3:
            for load in [1, 2, 3]:
                units.append((g, sub, load, k))
                designs.append(wp_design(g, sub, load))
nulls = wm.pmap(wm.perm_null_loo, [(K, y, 1000, wm.stable_seed("wp", g, s, L)) for (g, s, L, _), (K, y) in zip(units, designs)])
WP = pd.DataFrame([{"group": g, "sub": s, "load": L, "cells": k, "acc": wm.loo_correct(K, y).mean(), "trials": len(y), "null": nl}
                   for (g, s, L, k), (K, y), nl in zip(units, designs, nulls)])
print(WP[WP.load == 1][["group", "sub", "cells", "acc"]].assign(acc=lambda d: (100 * d.acc).round(2)).to_string(index=False))


def wp_stats(min_cells, load):
    rows = []
    for g in GROUPS_WP:
        x = WP[(WP.group == g) & (WP.load == load) & (WP.cells >= min_cells)]
        if len(x) == 0:
            continue
        m = x.acc.mean()
        nm = np.mean(np.stack(x.null.values), 0)
        # the paper's chance level of 20%: correct counts pooled over participants' trials, one-sided binomial
        k_tot = int(np.sum([a * n_ for a, n_ in zip(x.acc, x.trials)]).round())
        rows.append({"group": g, "participants": len(x), "accuracy_%": round(100 * m, 2),
                     "null_mean_%": round(100 * nm.mean(), 2), "p": (np.sum(nm >= m) + 1) / 1001,
                     "p_binom20": binomtest(k_tot, int(x.trials.sum()), 0.2, alternative="greater").pvalue})
    df = pd.DataFrame(rows)
    df["p_BH"] = wm.bh(df.p)
    return df


for mc, name in [(3, "at least three cells (Methods)"), (4, "more than three cells (the code)")]:
    print(f"\nload 1, {name}:")
    print(wp_stats(mc, 1).to_string(index=False))
print("\npaper: AMY 35.56% (P = 0.001), MTL 32.13% (P = 0.001); tolerance 32.0 to 39.1 and 28.9 to 35.3")
group  sub  cells   acc
  AMY    4      3 22.22
  AMY    7      3 55.56
  AMY    9      4 22.22
  AMY   13      8 31.11
  AMY   14     11 62.22
  AMY   16      4 25.00
  AMY   18      4 31.11
  HPC   14      3 24.44
  MTL    2      3 26.67
  MTL    4      3 22.22
  MTL    7      3 55.56
  MTL    9      4 22.22
  MTL   13      9 24.44
  MTL   14     14 62.22
  MTL   16      5 22.22
  MTL   18      5 33.33

load 1, at least three cells (Methods):
group  participants  accuracy_%  null_mean_%        p    p_binom20     p_BH
  AMY             7       35.63        18.30 0.000999 3.762885e-10 0.001499
  HPC             1       24.44        17.74 0.182817 2.795293e-01 0.182817
  MTL             8       33.61        18.02 0.000999 3.986650e-09 0.001499

load 1, more than three cells (the code):
group  participants  accuracy_%  null_mean_%        p    p_binom20     p_BH
  AMY             5       34.33        18.19 0.000999 2.289276e-07 0.000999
  MTL             5       32.89        17.97 0.000999 2.290190e-06 0.000999

paper: AMY 35.56% (P = 0.001), MTL 32.13% (P = 0.001); tolerance 32.0 to 39.1 and 28.9 to 35.3

Result: reproduced. At load 1 the amygdala decodes at 35.63% and the MTL at 33.61% with at least three cells (p = 0.001 for both), and at 34.33% and 32.89% with more than three cells; all are within tolerance. Against the paper's 20% chance (one-sided binomial on the correct counts pooled over participants) p is below 1e-5 for all four (p_binom20). The label-shuffled nulls average about 17 to 18%, below 20%, as leave-one-out with shuffled labels is biased below chance; the p values against them are the code's.

ext1f-maintenance-decoding-load2¶

Amygdala and MTL concept cells also carried significant information about the last image during load 2 maintenance (23.56% and 28.89%).

In [24]:
for mc, name in [(3, "at least three cells (Methods)"), (4, "more than three cells (the code)")]:
    print(f"load 2, {name}:")
    print(wp_stats(mc, 2).to_string(index=False))
print("\npaper: AMY 23.56% (P = 0.031), MTL 28.89% (P = 0.002)")
load 2, at least three cells (Methods):
group  participants  accuracy_%  null_mean_%        p  p_binom20     p_BH
  AMY             7       26.43        18.18 0.001998   0.011172 0.002997
  HPC             1        8.89        17.91 0.946054   0.987114 0.946054
  MTL             8       26.67        18.30 0.001998   0.004028 0.002997
load 2, more than three cells (the code):
group  participants  accuracy_%  null_mean_%        p  p_binom20     p_BH
  AMY             5       27.89        18.07 0.001998   0.005582 0.001998
  MTL             5       29.56        18.21 0.001998   0.000744 0.001998

paper: AMY 23.56% (P = 0.031), MTL 28.89% (P = 0.002)

Result: partially reproduced. At load 2 both groups decode above the null (p = 0.002), and the MTL accuracy is within tolerance (26.67% and 29.56% under the two rules), but the amygdala accuracy (26.43% and 27.89%) is above its tolerance of 21.2 to 25.9%. Against 20% the binomial p is 0.011 or less.

fig2f-bin-width-decoding¶

In load 1 trials, pseudo-population decoding of the image during maintenance was above chance at every bin width and rose with bin width (250 ms 40.00%, 500 ms 56.67%, 750 ms 66.67%, 1000 ms 80.00%).

All concept cells, z-scored counts in windows of each width slid by 25 ms over the first 2.5 s of maintenance, concatenated; linear SVM, LOOCV; p from 1,000 label shuffles, (k + 1) / 1001; BH over the 12 tests of 4 widths and 3 loads. Trial readings: (a) the code's identity-matched rows (new_trial_final.xlsx), labels as the code takes them (subject 14's); (b) each participant's first six trials of each label image, aligned by image and rank. The fast SVM used here is checked against sklearn's SVC(kernel='linear').

In [25]:
WIDTHS = [0.25, 0.5, 0.75, 1.0]


def bw_design(nids, load, reading, width):
    subs = sorted(set(NT["sub"].values[nids]))
    rows, lab = wm.pseudo_rows(T, subs, load, reading, FINAL)
    st = wm.window_starts(width, 0.025, 2.5)
    B = []
    for n in nids:
        sub = NT["sub"].iat[n]
        t = T[sub].set_index("trial").loc[rows[sub]]
        B.append(wm.zcounts(SPK[n], t.maint.values, st, width, *FIX[n]))
    return np.concatenate(B, 1), np.asarray(lab)


for reading in ["code", "rank"]:
    X, y = bw_design(CELLS_C, 1, reading, 1.0)
    print(f"reading {reading}: fast SVM equals sklearn SVC(kernel='linear') in every LOOCV prediction:",
          bool((wm.loo_correct(X @ X.T, y) == wm.loo_correct_sklearn(X, y)).all()))


def bw_run(name, nids):
    keys = [(reading, load, w) for reading in ["code", "rank"] for load in [1, 2, 3] for w in WIDTHS]
    des = [bw_design(nids, L, r, w) for r, L, w in keys]
    Ks = [X @ X.T for X, _ in des]
    nulls = wm.pmap(wm.perm_null_loo, [(K, y, 1000, wm.stable_seed("bw", name, *k)) for k, K, (_, y) in zip(keys, Ks, des)])
    res = {k: (wm.loo_correct(K, y), nl, X.shape) for k, K, (X, y), nl in zip(keys, Ks, des, nulls)}
    rows = []
    for (reading, load, w), (real, null, shape) in res.items():
        rows.append({"reading": reading, "load": load, "width_ms": int(w * 1000), "trials": shape[0], "features": shape[1],
                     "accuracy_%": round(100 * real.mean(), 2), "null_mean_%": round(100 * null.mean(), 2),
                     "p": (np.sum(null >= real.mean()) + 1) / 1001,
                     # the paper's chance level: one-sided binomial test of the correct count against 20%
                     "p_binom20": binomtest(int(real.sum()), len(real), 0.2, alternative="greater").pvalue})
    df = pd.DataFrame(rows)
    df["p_BH"] = np.nan
    for reading in ["code", "rank"]:
        m = df.reading == reading
        df.loc[m, "p_BH"] = wm.bh(df.p[m])
    return res, df


BW = {}
BW["all"] = bw_run("all", CELLS_C)
print(BW["all"][1].to_string(index=False))
print("\npaper, load 1: 40.00, 56.67, 66.67, 80.00% (tolerance 10% of each), Pmax = 0.001")
reading code: fast SVM equals sklearn SVC(kernel='linear') in every LOOCV prediction: True
reading rank: fast SVM equals sklearn SVC(kernel='linear') in every LOOCV prediction: True
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p    p_binom20     p_BH
   code     1       250      30      5278       30.00         9.05 0.002997 1.286508e-01 0.008991
   code     1       500      30      4698       60.00        10.82 0.000999 1.842448e-06 0.003996
   code     1       750      30      4118       66.67        12.74 0.000999 3.830524e-08 0.003996
   code     1      1000      30      3538       76.67        13.52 0.000999 3.859013e-11 0.003996
   code     2       250      25      5278       28.00         6.85 0.004995 2.199647e-01 0.009990
   code     2       500      25      4698       20.00         8.71 0.088911 5.793257e-01 0.133367
   code     2       750      25      4118       28.00        10.28 0.027972 2.199647e-01 0.047952
   code     2      1000      25      3538       36.00        11.65 0.004995 4.677424e-02 0.009990
   code     3       250      20      5278       10.00         5.19 0.298701 9.308247e-01 0.325856
   code     3       500      20      4698       15.00         6.06 0.142857 7.939153e-01 0.190476
   code     3       750      20      4118       15.00         8.18 0.225774 7.939153e-01 0.270929
   code     3      1000      20      3538       10.00         9.62 0.554446 9.308247e-01 0.554446
   rank     1       250      30      5278       50.00         9.09 0.000999 2.312256e-04 0.002997
   rank     1       500      30      4698       66.67        11.46 0.000999 3.830524e-08 0.002997
   rank     1       750      30      4118       73.33        12.47 0.000999 4.504531e-10 0.002997
   rank     1      1000      30      3538       76.67        14.00 0.000999 3.859013e-11 0.002997
   rank     2       250      25      5278       20.00         7.32 0.051948 5.793257e-01 0.074592
   rank     2       500      25      4698       24.00        10.33 0.055944 3.833106e-01 0.074592
   rank     2       750      25      4118       20.00        11.53 0.186813 5.793257e-01 0.203796
   rank     2      1000      25      3538       24.00        12.53 0.097902 3.833106e-01 0.117483
   rank     3       250      20      5278        5.00         3.89 0.510490 9.884708e-01 0.510490
   rank     3       500      20      4698       25.00         7.12 0.024975 3.703517e-01 0.042814
   rank     3       750      20      4118       35.00         8.81 0.008991 8.669251e-02 0.021578
   rank     3      1000      20      3538       35.00        10.38 0.014985 8.669251e-02 0.029970

paper, load 1: 40.00, 56.67, 66.67, 80.00% (tolerance 10% of each), Pmax = 0.001
In [26]:
# Variant: how the decoding depends on which six trials of each image enter. 20 random draws of
# six load-1 trials per image in each participant (aligned by image and draw rank), 1000 ms width.
rng = np.random.default_rng(23)
subs = sorted(set(NT["sub"].values[CELLS_C]))
st = wm.window_starts(1.0, 0.025, 2.5)
accs = []
for d in range(20):
    rows = {}
    for s in subs:
        t = T[s][T[s].load == 1]
        rows[s] = np.concatenate([rng.permutation(t[t.img1 == im].trial.values)[:6] for im in range(1, 6)])
    B = []
    for n in CELLS_C:
        sub = NT["sub"].iat[n]
        t = T[sub].set_index("trial").loc[rows[sub]]
        B.append(wm.zcounts(SPK[n], t.maint.values, st, 1.0, *FIX[n]))
    Xr = np.concatenate(B, 1)
    accs.append(wm.loo_correct(Xr @ Xr.T, np.repeat(np.arange(1, 6), 6)).mean())
accs = 100 * np.array(accs)
print(f"random six-per-image draws, load 1, 1000 ms: accuracy median {np.median(accs):.1f}%, range {accs.min():.1f} to {accs.max():.1f}%")
real_code = 100 * BW["all"][0][("code", 1, 1.0)][0].mean()
print(f"the code's table gives {real_code:.2f}%; draws at or above it: {(accs >= real_code).sum()} of 20")
random six-per-image draws, load 1, 1000 ms: accuracy median 71.7%, range 56.7 to 86.7%
the code's table gives 76.67%; draws at or above it: 6 of 20

Result: partially reproduced. Under both trial readings load-1 accuracy is above chance at every width (BH p at most 0.009) and rises from 250 to 1000 ms, but not every value is within tolerance: reading (a) gives 30.00, 60.00, 66.67 and 76.67% (250 ms below its tolerance of 36 to 44%), reading (b) 50.00, 66.67, 73.33 and 76.67% (250 and 500 ms above theirs). Random draws of six trials per image give 56.7 to 86.7% at 1000 ms, so the values depend on which trials enter, and this spread is wider than the tolerances. The label-shuffled nulls average 9 to 14%, below the paper's 20% chance. Against 20% (one-sided binomial, p_binom20) reading (a) at 250 ms (30.0%) has p = 0.13, so with the paper's chance level that value is not above chance; every other width and reading has p below 0.001.

fig2f-bin-width-pairwise¶

Pairwise, accuracy was higher for 750 than 250 ms, for 1000 than 250 ms and for 1000 than 500 ms bins, while 500 against 250, 1000 against 750 and 750 against 500 ms did not differ after correction.

Readings: (a) a paired permutation over trials swapping each trial's LOOCV correctness between the two widths (1,000), two-sided; (b) the observed difference against the differences of the two widths' shuffled nulls (paired by shuffle index), two-sided; BH over the six pairs.

In [27]:
import itertools
rng = np.random.default_rng(31)
PAIRS = [(0.75, 0.25), (1.0, 0.25), (1.0, 0.5), (0.5, 0.25), (1.0, 0.75), (0.75, 0.5)]
for reading in ["code", "rank"]:
    res = BW["all"][0]
    rows = []
    for a, b in PAIRS:
        ca, na, _ = res[(reading, 1, a)]
        cb, nb, _ = res[(reading, 1, b)]
        obs = ca.mean() - cb.mean()
        sw = rng.random((1000, len(ca))) < 0.5
        nulla = (np.where(sw, cb, ca).mean(1) - np.where(sw, ca, cb).mean(1))
        pa = (np.sum(np.abs(nulla) >= abs(obs)) + 1) / 1001
        dn = na - nb
        pb = (np.sum(np.abs(dn - dn.mean()) >= abs(obs)) + 1) / 1001
        rows.append({"pair_ms": f"{int(a * 1000)} vs {int(b * 1000)}", "diff_%": round(100 * obs, 2), "p_a": pa, "p_b": pb})
    df = pd.DataFrame(rows)
    df["p_a_BH"] = wm.bh(df.p_a)
    df["p_b_BH"] = wm.bh(df.p_b)
    print(f"trial reading {reading}:")
    print(df.round(4).to_string(index=False))
print("paper: 750 vs 250 P = 0.026, 1000 vs 250 P = 0.004, 1000 vs 500 P = 0.032; the other three P > 0.05")
trial reading code:
    pair_ms  diff_%    p_a    p_b  p_a_BH  p_b_BH
 750 vs 250   36.67 0.0020 0.0010  0.0060  0.0020
1000 vs 250   46.67 0.0010 0.0010  0.0060  0.0020
1000 vs 500   16.67 0.0529 0.0929  0.0794  0.1394
 500 vs 250   30.00 0.0050 0.0010  0.0100  0.0020
1000 vs 750   10.00 0.2547 0.3027  0.3057  0.3632
 750 vs 500    6.67 0.4975 0.4805  0.4975  0.4805
trial reading rank:
    pair_ms  diff_%    p_a    p_b  p_a_BH  p_b_BH
 750 vs 250   23.33 0.0150 0.0160  0.0450  0.0480
1000 vs 250   26.67 0.0090 0.0060  0.0450  0.0360
1000 vs 500   10.00 0.2418 0.3217  0.3626  0.4825
 500 vs 250   16.67 0.0689 0.0709  0.1379  0.1419
1000 vs 750    3.33 1.0000 0.7193  1.0000  0.7193
 750 vs 500    6.67 0.4785 0.4935  0.5742  0.5922
paper: 750 vs 250 P = 0.026, 1000 vs 250 P = 0.004, 1000 vs 500 P = 0.032; the other three P > 0.05

Result: not reproduced. Under neither reading are exactly the three named pairs significant: with the code's table 750 vs 250 and 1000 vs 250 are significant but 1000 vs 500 is not (BH p 0.079 and 0.139) and 500 vs 250 is (0.010 and 0.002); with reading (b) 750 vs 250 and 1000 vs 250 are significant (BH p 0.036 to 0.048), the three pairs the paper calls not significant are not, and 1000 vs 500 is not significant (0.363 and 0.483).

ext1g-bin-width-load2¶

Bin width had little effect on decoding of the second image in load 2 trials, and load 2 accuracy was lower than load 1 accuracy.

In [28]:
df = BW["all"][1]
for reading in ["code", "rank"]:
    l1 = df[(df.reading == reading) & (df.load == 1)].set_index("width_ms")["accuracy_%"]
    l2 = df[(df.reading == reading) & (df.load == 2)].set_index("width_ms")["accuracy_%"]
    print(f"reading {reading}: load 2 accuracies {l2.to_dict()}; range {l2.max() - l2.min():.2f} points "
          f"(criterion: below half the load 1 range of 40.0, i.e. 20.0); below load 1 at every width: {bool((l2 < l1).all())}")
reading code: load 2 accuracies {250: 28.0, 500: 20.0, 750: 28.0, 1000: 36.0}; range 16.00 points (criterion: below half the load 1 range of 40.0, i.e. 20.0); below load 1 at every width: True
reading rank: load 2 accuracies {250: 20.0, 500: 24.0, 750: 20.0, 1000: 24.0}; range 4.00 points (criterion: below half the load 1 range of 40.0, i.e. 20.0); below load 1 at every width: True

Result: reproduced. The load 2 accuracies span 16.0 points with the code's table and 4.0 points with reading (b), below the 20-point threshold, and each is below the load 1 accuracy at the same width.

fig3abc-trajectory-complexity, fig3d-encoding-vs-maintenance-separability, fig3h-early-vs-late-maintenance¶

These three claims are tested in the second notebook of the entry, dpca_kussovska_2025.ipynb, which runs the 100 dPCA splits in parallel within the time limit.

acg-fit-yield¶

Fitting CellExplorer's triple-exponential model to each neuron's autocorrelogram and keeping well-fit units (R2 > 0.3) left 294 neurons for cell-type analysis.

A port of the code's MATLAB functions (calc_ACG_metrics.m, fit_ACG.m, Mean_ACG.m, normalize_acg_to_unit.m): narrow ACG (+/- 50 ms, 0.5 ms bins), the triple exponential fitted with CellExplorer's start point and bounds by bounded nonlinear least squares (scipy's trust-region reflective method in place of MATLAB's fit). Readings: (a) every spike of the unit; (b) only spikes within the trials (fixation onset to response).

In [29]:
FEAT = {}
for reading in ["a", "b"]:
    spikes = []
    for n in range(len(NT)):
        s = SPK[n]
        if reading == "b":
            t = T[NT["sub"].iat[n]]
            keep = np.zeros(len(s), bool)
            for a_, b_ in zip(t.fix_start.values, t.timestamps_Response.values):
                i, j = np.searchsorted(s, [a_, b_])
                keep[i:j] = True
            s = s[keep]
        spikes.append(s)
    rows = wm.pmap(wm.acg_features, [(s,) for s in spikes])  # 4 processes; each neuron's fit is independent
    if reading == "b":
        for n, f in enumerate(rows):
            f["firing_rate"] = len(SPK[n]) / (SPK[n][-1] - SPK[n][0])
    FEAT[reading] = pd.DataFrame(rows)
for reading in ["a", "b"]:
    F = FEAT[reading]
    print(f"reading ({reading}): R2 > 0.3: {(F.r2 > 0.3).sum()}, R2 >= 0.3: {(F.r2 >= 0.3).sum()}, "
          f"fits with no R2 (too few spikes): {F.r2.isna().sum()}; R2 median {F.r2.median():.3f}")
F = FEAT["a"]
cmp = pd.DataFrame({
    "feature": ["firing_rate", "acg_norm", "burst_royer", "cv_isi", "r2", "tau_rise", "tau_decay"],
    "shipped_column": ["firing_rate", "acg_norm", "Burst", "CV2", "R2", "tau_rise", "Decay"]})
cmp["max_abs_diff"] = [np.nanmax(np.abs(F[a].values - SHIP_CM[b].values)) for a, b in zip(cmp.feature, cmp.shipped_column)]
cmp["frac_within_1pct"] = [np.nanmean(np.abs(F[a].values - SHIP_CM[b].values) <= 0.01 * np.abs(SHIP_CM[b].values) + 1e-9)
                           for a, b in zip(cmp.feature, cmp.shipped_column)]
print("\nfor comparison, reading (a) against the code's shipped Cell_metrics.xlsx:")
print(cmp.round(4).to_string(index=False))
print(f"shipped table: R2 > 0.3 for {(SHIP_CM.R2 > 0.3).sum()}, R2 >= 0.3 for {(SHIP_CM.R2 >= 0.3).sum()}; "
      f"agreement on R2 > 0.3 with reading (a): {np.mean((F.r2 > 0.3) == (SHIP_CM.R2 > 0.3)):.3f}")
print("paper: 294 (tolerance 264.6 to 323.4)")
/home/runner/work/encore/encore/entries/kussovska-2025/wm.py:412: RuntimeWarning: invalid value encountered in scalar divide
  "acg_norm": np.nanmean(wn), "burst_royer": np.mean(wide[502:505]) / np.mean(wide[699:800]),
/home/runner/work/encore/encore/entries/kussovska-2025/wm.py:412: RuntimeWarning: invalid value encountered in scalar divide
  "acg_norm": np.nanmean(wn), "burst_royer": np.mean(wide[502:505]) / np.mean(wide[699:800]),
reading (a): R2 > 0.3: 317, R2 >= 0.3: 317, fits with no R2 (too few spikes): 4; R2 median 0.187
reading (b): R2 > 0.3: 298, R2 >= 0.3: 298, fits with no R2 (too few spikes): 6; R2 median 0.168

for comparison, reading (a) against the code's shipped Cell_metrics.xlsx:
    feature shipped_column  max_abs_diff  frac_within_1pct
firing_rate    firing_rate        0.0000            1.0000
   acg_norm       acg_norm        0.0355            0.9922
burst_royer          Burst        0.1154            0.9911
     cv_isi            CV2        0.0000            1.0000
         r2             R2        1.0352            0.4823
   tau_rise       tau_rise       48.3944            0.0698
  tau_decay          Decay      498.9955            0.1131
shipped table: R2 > 0.3 for 294, R2 >= 0.3 for 294; agreement on R2 > 0.3 with reading (a): 0.975
paper: 294 (tolerance 264.6 to 323.4)
In [30]:
# Stability check of the fit. The same fit is rerun with the start point scaled by 1 + 1e-9 and
# 1 - 1e-9 and with the ACG scaled by 1 + 1e-12, changes at the level of floating-point rounding.
# Each variant keeps the other features of reading (a) and replaces tau_decay, tau_rise and R2.
FEATV = {"main": FEAT["a"]}
for name, ss, ds in [("start x (1 + 1e-9)", 1 + 1e-9, 1.0), ("start x (1 - 1e-9)", 1 - 1e-9, 1.0), ("ACG x (1 + 1e-12)", 1.0, 1 + 1e-12)]:
    r = np.array(wm.pmap(wm.refit_acg, [(SPK[n], ss, ds) for n in range(len(NT))]))
    FEATV[name] = FEAT["a"].assign(tau_decay=r[:, 0], tau_rise=r[:, 1], r2=r[:, 2])
TYPESV = {}
rows = []
for name, F in FEATV.items():
    d = F[F.r2 > 0.3].dropna(subset=["firing_rate", "acg_norm", "tau_rise"])
    ty, _ = wm.spectral_types(d)
    types = np.array([None] * len(NT), dtype=object)
    types[d.index.values] = ty
    TYPESV[name] = types
    dr2 = np.abs(F.r2.values - FEAT["a"].r2.values)
    rows.append({"fit": name, "R2>0.3": int((F.r2 > 0.3).sum()),
                 "class changed": int(((F.r2 > 0.3).values != (FEAT["a"].r2 > 0.3).values).sum()),
                 "|dR2|>1e-3": int(np.nansum(dr2 > 1e-3)), "max |dR2|": round(float(np.nanmax(dr2)), 3),
                 "|d tau_decay|>1%": int(np.nansum(np.abs(F.tau_decay.values - FEAT["a"].tau_decay.values) > 0.01 * np.abs(FEAT["a"].tau_decay.values))),
                 "PY": int((types == "PY").sum()), "IN": int((types == "IN").sum()),
                 "PY concept": int(((types == "PY") & CONCEPT).sum()), "IN concept": int(((types == "IN") & CONCEPT).sum()),
                 "types changed": int((types != TYPESV["main"]).sum())})
print(pd.DataFrame(rows).to_string(index=False))
               fit  R2>0.3  class changed  |dR2|>1e-3  max |dR2|  |d tau_decay|>1%  PY  IN  PY concept  IN concept  types changed
              main     317              0           0      0.000                 0 102 215          11          16              0
start x (1 + 1e-9)     316              1          40      0.302               157 102 214          12          15              2
start x (1 - 1e-9)     316              1          38      0.171               149 101 215          11          16              1
 ACG x (1 + 1e-12)     315              2          37      0.309               169 103 212          12          15              5

Result: reproduced. 317 neurons have R2 > 0.3 under reading (a) and 298 under reading (b), both within tolerance. The firing rate and ISI CV of reading (a) equal the code's shipped table exactly, and the normalized mean ACG and Royer burst index agree within 1% for 99% of neurons, so the code used every spike of the unit. The fit itself is a limitation of this attempt: the fitted R2 agrees with the shipped MATLAB values within 1% for only 48% of neurons and the time constants for 7 to 11% (printed above), as scipy's optimizer finds other local optima than MATLAB's. Classification at R2 > 0.3 agrees for 97.5% of neurons, but tau_rise is a clustering feature, so the cell types of fig5c differ from the paper's, and tau_decay defines the decay groups of the burst analyses. The stability check shows that the fit is not stable at the level of rounding: changes of 1e-9 in the start point or 1e-12 in the ACG move R2 by more than 1e-3 for dozens of neurons and give 315 or 316 well-fit neurons against the main fit's 317 (the round-2 run of this notebook gave 316), with the reading (a) types of a few neurons changing. A run on another machine can therefore give any of these, and the cell-type counts and decay groups downstream move with them; the results that depend on them are checked under each variant (after ext2-bursts-loads23 and in fig6e).

fig5c-cell-type-clusters¶

Spectral clustering on firing rate, mean normalised ACG and ACG rise time constant split the 294 neurons into two clusters, 92 putative pyramidal neurons and 202 putative interneurons.

In [31]:
TYPES = {}
for reading in ["a", "b"]:
    F = FEAT[reading]
    d = F[F.r2 > 0.3].dropna(subset=["firing_rate", "acg_norm", "tau_rise"])
    ty, lab = wm.spectral_types(d)
    types = np.array([None] * len(NT), dtype=object)
    types[d.index.values] = ty
    TYPES[reading] = types
    print(f"reading ({reading}): {len(d)} neurons; PY {(ty == 'PY').sum()}, IN {(ty == 'IN').sum()}; "
          f"medians PY / IN: firing rate {d.firing_rate[ty == 'PY'].median():.2f} / {d.firing_rate[ty == 'IN'].median():.2f} Hz, "
          f"acg_norm {d.acg_norm[ty == 'PY'].median():.3f} / {d.acg_norm[ty == 'IN'].median():.3f}, "
          f"tau_rise {d.tau_rise[ty == 'PY'].median():.2f} / {d.tau_rise[ty == 'IN'].median():.2f} ms")
d = SHIP_CM[SHIP_CM.R2 >= 0.3].dropna(subset=["firing_rate", "acg_norm", "tau_rise"])
ty, lab = wm.spectral_types(d)
print(f"for comparison, the same clustering on the code's shipped features (R2 >= 0.3, {len(d)} neurons): PY {(ty == 'PY').sum()}, IN {(ty == 'IN').sum()}; "
      f"the code's own rule (cluster label 1 is PY) gives PY {(lab == 1).sum()}")
TY = TYPES["a"]
print("paper: PY 92 (82.8 to 101.2), IN 202 (181.8 to 222.2)")
reading (a): 317 neurons; PY 102, IN 215; medians PY / IN: firing rate 1.27 / 5.26 Hz, acg_norm 0.112 / 0.588, tau_rise 1.18 / 4.39 ms
reading (b): 298 neurons; PY 100, IN 198; medians PY / IN: firing rate 1.24 / 5.65 Hz, acg_norm 0.110 / 0.591, tau_rise 1.12 / 4.39 ms
for comparison, the same clustering on the code's shipped features (R2 >= 0.3, 294 neurons): PY 92, IN 202; the code's own rule (cluster label 1 is PY) gives PY 92
paper: PY 92 (82.8 to 101.2), IN 202 (181.8 to 222.2)

Result: reproduced. Under reading (b) the counts are PY 100 and IN 198, both within tolerance; under reading (a) IN (215) is within tolerance and PY (102) just above it. The clustering applied to the code's shipped features gives exactly 92 and 202, so the difference comes from the ACG fit. Later sections use the types of reading (a), the spikes the code used (see acg-fit-yield), and every later claim on cell types is also run with the types of reading (b), whose counts match the paper's (PY_b, IN_b and "types (b)" in the tables).

fig5dfh-cluster-features¶

Putative interneurons had higher firing rates, greater normalised mean ACG amplitude and larger tau_rise than putative pyramidal neurons.

In [32]:
def type_tests(F, types, cols):
    rows = []
    for c in cols:
        a, b = F[c][types == "IN"].dropna(), F[c][types == "PY"].dropna()
        u = mannwhitneyu(a, b, alternative="two-sided")
        rows.append({"feature": c, "IN_median": a.median(), "PY_median": b.median(), "U_IN_vs_PY": u.statistic, "p": u.pvalue})
    df = pd.DataFrame(rows)
    from statsmodels.stats.multitest import multipletests
    df["p_BY"] = multipletests(df.p, method="fdr_by")[1]
    return df


for reading in ["a", "b"]:
    df = type_tests(FEAT[reading], TYPES[reading], ["firing_rate", "acg_norm", "tau_rise", "burst_royer", "cv_isi"])
    print(f"reading ({reading}):")
    print(df.to_string(index=False))
print("paper: U = 17294, 18522, 13465 (IN vs PY), P = 1.42e-32, 2.16e-41, 2.58e-9")
reading (a):
    feature  IN_median  PY_median  U_IN_vs_PY            p         p_BY
firing_rate   5.261301   1.272105     20822.0 3.069570e-38 1.752213e-37
   acg_norm   0.587720   0.111817     21885.0 1.552200e-46 1.772095e-45
   tau_rise   4.389419   1.180479     14159.0 2.799494e-05 7.990222e-05
burst_royer   0.647436   0.801912      9469.5 4.977095e-02 1.136437e-01
     cv_isi   1.308042   1.592737      7674.0 1.586091e-05 6.035956e-05
reading (b):
    feature  IN_median  PY_median  U_IN_vs_PY            p         p_BY
firing_rate   5.646170   1.244178     19084.0 4.595671e-39 2.623362e-38
   acg_norm   0.590754   0.109890     19671.0 5.478077e-44 6.254138e-43
   tau_rise   4.389606   1.117811     13440.0 4.672308e-07 1.333554e-06
burst_royer   0.621600   0.947051      7928.0 4.984814e-03 1.138199e-02
     cv_isi   4.495824   2.507148     16990.0 5.907897e-24 2.248283e-23
paper: U = 17294, 18522, 13465 (IN vs PY), P = 1.42e-32, 2.16e-41, 2.58e-9

Result: reproduced. IN are higher on all three features under both readings, BY-corrected p at most 8.0e-05 (U = 20822, 21885 and 14159 under reading a); as the claims file notes, this follows from the clustering by construction.

fig5gh-burst-index-cv2¶

Putative pyramidal neurons had a higher burst index (0.985 against 0.622) and greater spike-train irregularity (CV2 1.673 against 1.319) than putative interneurons.

In [33]:
for reading in ["a", "b"]:
    F, ty = FEAT[reading], TYPES[reading]
    df = type_tests(F, ty, ["firing_rate", "acg_norm", "tau_rise", "burst_royer", "cv_isi"])
    dh = type_tests(F, ty, ["firing_rate", "acg_norm", "tau_rise", "burst_royer", "cv2_holt"])
    print(f"reading ({reading}):")
    for c, tab in [("burst_royer", df), ("cv_isi", df), ("cv2_holt", dh)]:
        r = tab[tab.feature == c].iloc[0]
        a, b = F[c][ty == "PY"], F[c][ty == "IN"]
        print(f"  {c}: PY mean {a.mean():.3f} median {a.median():.3f}; IN mean {b.mean():.3f} median {b.median():.3f}; "
              f"U(IN vs PY) = {r.U_IN_vs_PY:.0f}, BY-corrected p = {r.p_BY:.2e}")
# The claim takes CV2 from the session's interspike intervals, whichever spikes the ACG used:
# types and burst index of reading (b) with the ISI measures of all of each unit's spikes.
F, ty = FEAT["b"], TYPES["b"]
Fs = FEAT["a"]
from statsmodels.stats.multitest import multipletests
ps = [mannwhitneyu(F.burst_royer[ty == "IN"], F.burst_royer[ty == "PY"]).pvalue,
      mannwhitneyu(Fs.cv_isi[ty == "IN"], Fs.cv_isi[ty == "PY"]).pvalue,
      mannwhitneyu(Fs.cv2_holt[ty == "IN"], Fs.cv2_holt[ty == "PY"]).pvalue]
print("reading (b) types, session ISIs:")
for c, src, p in [("burst_royer", F, ps[0]), ("cv_isi", Fs, ps[1]), ("cv2_holt", Fs, ps[2])]:
    a, b = src[c][ty == "PY"], src[c][ty == "IN"]
    print(f"  {c}: PY mean {a.mean():.3f} median {a.median():.3f}; IN mean {b.mean():.3f} median {b.median():.3f}; p = {p:.2e}")
print("paper: burst index PY 0.985 vs IN 0.622, CV2 PY 1.673 vs IN 1.319; tolerance 10% of each")
reading (a):
  burst_royer: PY mean 5.129 median 0.802; IN mean 0.718 median 0.647; U(IN vs PY) = 9470, BY-corrected p = 1.14e-01
  cv_isi: PY mean 1.834 median 1.593; IN mean 1.676 median 1.308; U(IN vs PY) = 7674, BY-corrected p = 6.04e-05
  cv2_holt: PY mean 1.182 median 1.176; IN mean 0.933 median 0.956; U(IN vs PY) = 1147, BY-corrected p = 2.27e-37
reading (b):
  burst_royer: PY mean 5.561 median 0.947; IN mean 0.693 median 0.622; U(IN vs PY) = 7928, BY-corrected p = 1.14e-02
  cv_isi: PY mean 2.696 median 2.507; IN mean 5.079 median 4.496; U(IN vs PY) = 16990, BY-corrected p = 2.25e-23
  cv2_holt: PY mean 1.184 median 1.170; IN mean 0.935 median 0.955; U(IN vs PY) = 1125, BY-corrected p = 3.13e-35
reading (b) types, session ISIs:
  burst_royer: PY mean 5.561 median 0.947; IN mean 0.693 median 0.622; p = 4.98e-03
  cv_isi: PY mean 1.796 median 1.593; IN mean 1.711 median 1.322; p = 1.07e-04
  cv2_holt: PY mean 1.180 median 1.176; IN mean 0.932 median 0.952; p = 1.62e-35
paper: burst index PY 0.985 vs IN 0.622, CV2 PY 1.673 vs IN 1.319; tolerance 10% of each

Result: reproduced. With the types and burst index of reading (b) and the CV of each unit's session interspike intervals (the column the code feeds to Fig. 5h), the medians are burst index PY 0.947 and IN 0.622 and CV PY 1.593 and IN 1.322, all within tolerance, PY higher on both with p below 0.005 (printed above). The group means of the burst index are far from the paper's (PY 5.6, a few very large values), so the paper's numbers match medians. Under reading (a) the PY burst-index median (0.802) is outside tolerance and its corrected p is 0.114. Holt's CV2 is lower than the paper's values (PY 1.18, IN 0.93).

supp4-rodent-validation (data elsewhere)¶

Applied to a labelled rodent dataset of 44 pyramidal neurons and 299 PV and SST interneurons, the spectral-clustering classifier assigned 333 of 343 neurons correctly (97%).

Tested on the features of the CellExplorer ground-truth cells that the paper's code ships (validation_data.xlsx), clustered as in fig5c, each cluster labelled by its majority type.

In [34]:
v = VALID.copy()
print("cell types in the table:", v.cell_type.value_counts().to_dict(), "; rows:", len(v))
vv = v.rename(columns={"norm_acg": "acg_norm"}).dropna(subset=["firing_rate", "acg_norm", "tau_rise", "tau_decay", "cell_type"])
_, lab = wm.spectral_types(vv)
vv["cluster"] = lab
maj = vv.groupby("cluster").cell_type.agg(lambda s: s.mode().iat[0])
vv["match"] = vv.cell_type == vv.cluster.map(maj)
print(pd.crosstab(vv.cluster, vv.cell_type).to_string())
print(f"matched {vv.match.sum()} of {len(vv)}; misassigned by type: {vv[~vv.match].cell_type.value_counts().to_dict()}")
print("paper: 333 of 343, one pyramidal and nine interneurons misassigned")
cell types in the table: {'IN': 299, 'PY': 44} ; rows: 343
cell_type   IN  PY
cluster           
0          290   1
1            9  43
matched 333 of 343; misassigned by type: {'IN': 9, 'PY': 1}
paper: 333 of 343, one pyramidal and nine interneurons misassigned

Result: reproduced. The clustering assigns 333 of the 343 ground-truth cells to their cluster's majority type, with one pyramidal neuron and nine interneurons misassigned, as the paper reports. These are the features the paper's code ships, not the CellExplorer recordings.

fig4c-encoding-bursts-vs-poisson¶

During encoding, population bursting did not exceed a rate-matched Poisson null for most neuronal groups; it differed from the null only for all neurons and for the low mean ACG amplitude group.

Within each participant and group, load 1 trials, the first encoding second; pooled spikes of the group, trials concatenated, 70 ms bins, Gaussian smoothing (sigma 40 ms), peaks at least 2 bins apart; 100 rate-matched Poisson surrogates; paired two-sided Wilcoxon signed-rank over participants (the code's zero_method='pratt', asymptotic) and BH over the code's eight groups. Readings: peak rule (prominence, the code and Results; or height above the 90th percentile, the Methods), surrogate threshold (the real train's, the code; or each surrogate's own), group rule (the code's 6 lowest and highest; or the Methods' median split), all neurons (902 in participants with at least 10, or the well-fit neurons), and a 1-bin spacing variant.

In [35]:
EP = {}
for n in range(len(NT)):
    t_all = T[NT["sub"].iat[n]]
    for L in [1, 2, 3]:
        t = t_all[t_all.load == L]
        enc_on = {1: t.enc1, 2: t.timestamps_Encoding2, 3: t.timestamps_Encoding3}[L].values
        EP[(n, L, "enc")] = wm.epoch_spikes(SPK[n], enc_on, enc_on + 1.0, 1.0)
        EP[(n, L, "maint28")] = wm.epoch_spikes(SPK[n], t.maint.values, t.probe.values, 2.8)
        EP[(n, L, "maint3")] = wm.epoch_spikes(SPK[n], t.maint.values, t.probe.values, 3.0)
        EP[(n, L, "probe")] = wm.epoch_spikes(SPK[n], t.probe.values, t.probe.values + 1.0, 1.0)
GR = {g: wm.burst_groups(NT, FEAT["a"], CONCEPT, TY, g) for g in ["code", "methods"]}
# The PY and IN groups under the cell types of reading (b) of fig5c, as PY_b and IN_b (the same
# rule of at least 3 per participant under both group rules).
for g in GR:
    Gb = wm.burst_groups(NT, FEAT["a"], CONCEPT, TYPES["b"], g)
    GR[g]["PY_b"], GR[g]["IN_b"] = Gb["PY"], Gb["IN"]
# Each trial's own maintenance, at most 2.8 s (the criterion's own-maintenance reading of fig4d):
# real and surrogate spikes on [0, duration], trials concatenated with stride = duration.
MDUR = {sub: np.minimum(t[t.load == 1].maint_dur.values, 2.8) for sub, t in T.items()}
for g, G in GR.items():
    print(f"group rule {g}:", {k: f"{len(v)} participants, {sum(len(x) for x in v.values())} neurons" for k, v in G.items()})

FAM = ["All902", "LowACG", "HighACG", "ShortDecay", "LongDecay", "Concept", "PY", "IN"]
CONFIGS = [("prominence", 2, "real"), ("height", 2, "real"), ("prominence", 2, "own"), ("height", 2, "own"),
           ("prominence", 1, "real"), ("height", 1, "real")]
rows = []
for grule, G in GR.items():
    for rule, dist, thr in CONFIGS:
        for epoch, key, win in [("enc", "enc", 1.0), ("maint", "maint28", 2.8), ("maint_own", "maint28", 2.8)]:
            for g, subs in G.items():
                for sub, nids in subs.items():
                    rng = np.random.default_rng(wm.stable_seed(g, sub, epoch, rule, dist, thr, grule))
                    rc, scount, _, _ = wm.group_bursts([EP[(n, 1, key)] for n in nids], win, rng, rule, dist, thr,
                                                       durs=MDUR[sub] if epoch == "maint_own" else None)
                    rows.append(dict(grule=grule, rule=rule, dist=dist, thr=thr, epoch=epoch, group=g, sub=sub, real=rc, sur=scount))
BR = pd.DataFrame(rows)


FAM_B = ["All902", "LowACG", "HighACG", "ShortDecay", "LongDecay", "Concept", "PY_b", "IN_b"]


def real_vs_null(df, groups=FAM, extra=("AllFit",)):
    out = []
    for g in list(groups) + list(extra):
        x = df[df.group == g]
        if len(x) < 2:
            continue
        w = wilcoxon(x.real, x.sur, zero_method="pratt", method="asymptotic")
        out.append({"group": g, "n": len(x), "real_median": x.real.median(), "null_median": round(x.sur.median(), 1),
                    "real_above": int((x.real > x.sur).sum()), "W": w.statistic, "p": w.pvalue})
    o = pd.DataFrame(out)
    m = o.group.isin(groups)
    o.loc[m, "p_BH"] = wm.bh(o.p[m])
    o.loc[~m, "p_BH"] = np.nan
    return o


def show_bursts(epoch, groups=FAM):
    summ = []
    for (grule, rule, dist, thr), df in BR[BR.epoch == epoch].groupby(["grule", "rule", "dist", "thr"]):
        o = real_vs_null(df, groups)
        o.insert(0, "reading", f"{grule}/{rule}/d{dist}/{thr}")
        summ.append(o)
    return pd.concat(summ)


BURST_ENC = show_bursts("enc")
print(BURST_ENC.round(4).to_string(index=False))
group rule code: {'All902': '20 participants, 897 neurons', 'AllFit': '12 participants, 270 neurons', 'LowACG': '12 participants, 72 neurons', 'HighACG': '12 participants, 72 neurons', 'ShortDecay': '12 participants, 72 neurons', 'LongDecay': '12 participants, 72 neurons', 'Concept': '9 participants, 52 neurons', 'PY': '12 participants, 95 neurons', 'IN': '19 participants, 215 neurons', 'PY_b': '12 participants, 90 neurons', 'IN_b': '18 participants, 196 neurons'}
group rule methods: {'All902': '20 participants, 897 neurons', 'AllFit': '12 participants, 270 neurons', 'LowACG': '12 participants, 132 neurons', 'HighACG': '12 participants, 132 neurons', 'ShortDecay': '12 participants, 132 neurons', 'LongDecay': '12 participants, 132 neurons', 'Concept': '5 participants, 39 neurons', 'PY': '12 participants, 95 neurons', 'IN': '19 participants, 215 neurons', 'PY_b': '12 participants, 90 neurons', 'IN_b': '18 participants, 196 neurons'}
                   reading      group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real     All902 20         41.5         33.1          16 13.0 0.0006 0.0047
       code/height/d1/real     LowACG 12         42.5         42.4           6 28.0 0.3882 0.7764
       code/height/d1/real    HighACG 12         47.0         46.4           6 38.0 0.9375 0.9375
       code/height/d1/real ShortDecay 12         46.0         46.5           4 31.0 0.5303 0.7772
       code/height/d1/real  LongDecay 12         42.0         41.9           5 32.0 0.5829 0.7772
       code/height/d1/real    Concept  9         37.0         41.2           3 13.0 0.2604 0.6944
       code/height/d1/real         PY 12         41.0         34.6           8 11.0 0.0281 0.1122
       code/height/d1/real         IN 19         41.0         38.4          10 85.0 0.6874 0.7856
       code/height/d1/real     AllFit 12         43.0         38.7           9 13.0 0.0414    NaN
        code/height/d2/own     All902 20         41.5         43.0          10 83.0 0.4115 0.6583
        code/height/d2/own     LowACG 12         42.5         44.5           8 31.0 0.5303 0.6662
        code/height/d2/own    HighACG 12         47.0         45.4           8 16.0 0.0712 0.2848
        code/height/d2/own ShortDecay 12         46.0         44.8           9 21.0 0.1579 0.4212
        code/height/d2/own  LongDecay 12         42.0         44.5           3 25.0 0.2721 0.5442
        code/height/d2/own    Concept  9         37.0         37.2           5 22.0 0.9528 0.9528
        code/height/d2/own         PY 12         41.0         42.5           7 32.0 0.5829 0.6662
        code/height/d2/own         IN 19         41.0         44.3           5 49.0 0.0641 0.2848
        code/height/d2/own     AllFit 12         43.0         44.2           5 31.0 0.5303    NaN
       code/height/d2/real     All902 20         41.5         33.1          16 13.0 0.0006 0.0047
       code/height/d2/real     LowACG 12         42.5         42.2           6 26.0 0.3078 0.6857
       code/height/d2/real    HighACG 12         47.0         45.9           6 36.0 0.8139 0.8139
       code/height/d2/real ShortDecay 12         46.0         45.9           4 31.0 0.5303 0.7942
       code/height/d2/real  LongDecay 12         42.0         41.4           6 34.0 0.6949 0.7942
       code/height/d2/real    Concept  9         37.0         41.0           3 14.5 0.3428 0.6857
       code/height/d2/real         PY 12         41.0         34.6           9 11.0 0.0281 0.1122
       code/height/d2/real         IN 19         41.0         37.8          10 84.0 0.6580 0.7942
       code/height/d2/real     AllFit 12         43.0         39.5           9 13.0 0.0414    NaN
   code/prominence/d1/real     All902 20          6.0          2.9          18  9.0 0.0003 0.0027
   code/prominence/d1/real     LowACG 12         29.0         24.6          10  5.0 0.0076 0.0204
   code/prominence/d1/real    HighACG 12         11.5          9.6           8 25.0 0.2721 0.2721
   code/prominence/d1/real ShortDecay 12         19.0         18.5          10 13.0 0.0414 0.0552
   code/prominence/d1/real  LongDecay 12         15.5         13.1           7 22.0 0.1823 0.2084
   code/prominence/d1/real    Concept  9         27.0         24.6           8  4.0 0.0284 0.0454
   code/prominence/d1/real         PY 12         29.0         20.1          12  0.0 0.0022 0.0089
   code/prominence/d1/real         IN 19         11.0          6.9          14 34.5 0.0149 0.0298
   code/prominence/d1/real     AllFit 12          6.5          3.0          10  6.0 0.0096    NaN
    code/prominence/d2/own     All902 20          6.0          3.8          17 12.0 0.0005 0.0041
    code/prominence/d2/own     LowACG 12         29.0         23.8          11  3.0 0.0047 0.0126
    code/prominence/d2/own    HighACG 12         11.5         10.0           9 23.0 0.2094 0.2094
    code/prominence/d2/own ShortDecay 12         19.0         17.1          10  8.0 0.0150 0.0240
    code/prominence/d2/own  LongDecay 12         15.5         13.6           7 23.0 0.2094 0.2094
    code/prominence/d2/own    Concept  9         27.0         21.6           7  3.0 0.0209 0.0278
    code/prominence/d2/own         PY 12         29.0         23.3          11  1.0 0.0029 0.0115
    code/prominence/d2/own         IN 19         11.0          7.6          15 28.0 0.0070 0.0140
    code/prominence/d2/own     AllFit 12          6.5          3.5          10  6.0 0.0096    NaN
   code/prominence/d2/real     All902 20          6.0          2.9          18  9.0 0.0003 0.0027
   code/prominence/d2/real     LowACG 12         29.0         24.4          10  4.0 0.0060 0.0161
   code/prominence/d2/real    HighACG 12         11.5          9.4           8 27.0 0.3465 0.3465
   code/prominence/d2/real ShortDecay 12         19.0         18.5          10 13.0 0.0414 0.0552
   code/prominence/d2/real  LongDecay 12         15.5         12.9           8 22.0 0.1823 0.2084
   code/prominence/d2/real    Concept  9         27.0         24.6           8  4.0 0.0284 0.0454
   code/prominence/d2/real         PY 12         29.0         19.7          12  0.0 0.0022 0.0089
   code/prominence/d2/real         IN 19         11.0          7.2          14 31.0 0.0100 0.0200
   code/prominence/d2/real     AllFit 12          6.5          3.1          10  6.0 0.0096    NaN
    methods/height/d1/real     All902 20         41.5         33.4          16 14.0 0.0007 0.0054
    methods/height/d1/real     LowACG 12         43.5         35.5          10  6.0 0.0096 0.0385
    methods/height/d1/real    HighACG 12         47.0         44.1           4 31.0 0.5303 0.7772
    methods/height/d1/real ShortDecay 12         46.0         43.0           8 29.0 0.4328 0.7772
    methods/height/d1/real  LongDecay 12         42.0         44.1           5 32.0 0.5829 0.7772
    methods/height/d1/real    Concept  5         43.0         42.1           3  7.0 0.8927 0.8927
    methods/height/d1/real         PY 12         41.0         34.9           8 10.0 0.0229 0.0611
    methods/height/d1/real         IN 19         41.0         38.1          10 86.0 0.7172 0.8197
    methods/height/d1/real     AllFit 12         43.0         39.5           9 13.0 0.0414    NaN
     methods/height/d2/own     All902 20         41.5         43.1           8 79.0 0.3317 0.5176
     methods/height/d2/own     LowACG 12         43.5         44.1           7 30.0 0.4802 0.5488
     methods/height/d2/own    HighACG 12         47.0         45.5           8 28.0 0.3882 0.5176
     methods/height/d2/own ShortDecay 12         46.0         45.1           8 23.0 0.2094 0.5176
     methods/height/d2/own  LongDecay 12         42.0         45.0           4 24.0 0.2393 0.5176
     methods/height/d2/own    Concept  5         43.0         42.0           3  7.0 0.8927 0.8927
     methods/height/d2/own         PY 12         41.0         42.2           7 25.0 0.2721 0.5176
     methods/height/d2/own         IN 19         41.0         43.6           6 48.0 0.0586 0.4686
     methods/height/d2/own     AllFit 12         43.0         44.4           5 32.0 0.5829    NaN
    methods/height/d2/real     All902 20         41.5         33.6          16 14.0 0.0007 0.0054
    methods/height/d2/real     LowACG 12         43.5         35.5          10  7.0 0.0121 0.0483
    methods/height/d2/real    HighACG 12         47.0         43.2           4 32.0 0.5829 0.6662
    methods/height/d2/real ShortDecay 12         46.0         43.4           6 29.0 0.4328 0.6662
    methods/height/d2/real  LongDecay 12         42.0         44.2           4 31.0 0.5303 0.6662
    methods/height/d2/real    Concept  5         43.0         42.4           2  7.0 0.8927 0.8927
    methods/height/d2/real         PY 12         41.0         33.8           8 12.0 0.0342 0.0911
    methods/height/d2/real         IN 19         41.0         38.1          10 80.0 0.5461 0.6662
    methods/height/d2/real     AllFit 12         43.0         38.5          10  9.0 0.0186    NaN
methods/prominence/d1/real     All902 20          6.0          2.8          18 10.0 0.0004 0.0031
methods/prominence/d1/real     LowACG 12         21.0         14.7          12  0.0 0.0022 0.0044
methods/prominence/d1/real    HighACG 12          9.0          6.4           9 10.0 0.0229 0.0305
methods/prominence/d1/real ShortDecay 12         17.5         12.2          12  0.0 0.0022 0.0044
methods/prominence/d1/real  LongDecay 12         12.0          9.5          10 12.0 0.0342 0.0391
methods/prominence/d1/real    Concept  5         26.0         21.8           3  3.0 0.2249 0.2249
methods/prominence/d1/real         PY 12         29.0         19.8          12  0.0 0.0022 0.0044
methods/prominence/d1/real         IN 19         11.0          7.1          14 34.0 0.0141 0.0226
methods/prominence/d1/real     AllFit 12          6.5          3.0          10  5.0 0.0076    NaN
 methods/prominence/d2/own     All902 20          6.0          4.0          17 12.0 0.0005 0.0041
 methods/prominence/d2/own     LowACG 12         21.0         18.0          10  6.0 0.0096 0.0154
 methods/prominence/d2/own    HighACG 12          9.0          6.4           9 10.0 0.0229 0.0305
 methods/prominence/d2/own ShortDecay 12         17.5         12.4          12  0.0 0.0022 0.0077
 methods/prominence/d2/own  LongDecay 12         12.0          9.5           9 13.0 0.0414 0.0431
 methods/prominence/d2/own    Concept  5         26.0         21.5           5  0.0 0.0431 0.0431
 methods/prominence/d2/own         PY 12         29.0         22.7          11  1.0 0.0029 0.0077
 methods/prominence/d2/own         IN 19         11.0          8.0          15 28.0 0.0070 0.0140
 methods/prominence/d2/own     AllFit 12          6.5          3.6          10  6.0 0.0096    NaN
methods/prominence/d2/real     All902 20          6.0          3.0          18  9.0 0.0003 0.0027
methods/prominence/d2/real     LowACG 12         21.0         15.1          11  1.0 0.0029 0.0057
methods/prominence/d2/real    HighACG 12          9.0          6.2           8 13.0 0.0414 0.0473
methods/prominence/d2/real ShortDecay 12         17.5         12.4          12  0.0 0.0022 0.0057
methods/prominence/d2/real  LongDecay 12         12.0          9.6           9 13.0 0.0414 0.0473
methods/prominence/d2/real    Concept  5         26.0         21.5           4  2.0 0.1380 0.1380
methods/prominence/d2/real         PY 12         29.0         20.0          12  0.0 0.0022 0.0057
methods/prominence/d2/real         IN 19         11.0          6.9          14 35.0 0.0158 0.0252
methods/prominence/d2/real     AllFit 12          6.5          3.1          10  5.0 0.0076    NaN
In [36]:
def fig4c_rule(o, all_name="All902"):
    sig = dict(zip(o.group, o.p_BH < 0.05))
    if all_name == "AllFit":
        sig["All902"] = bool(o[o.group == "AllFit"].p.iloc[0] < 0.05)
    named = sig["All902"] and sig["LowACG"]
    others = [g for g in ["HighACG", "ShortDecay", "LongDecay", "Concept"] if sig[g]]
    return named, others


for reading, o in BURST_ENC.groupby("reading", sort=False):
    for alln in ["All902", "AllFit"]:
        named, others = fig4c_rule(o, alln)
        print(f"{reading}, all neurons as {alln}: all and low ACG differ {named}; other groups that differ {others}")
code/height/d1/real, all neurons as All902: all and low ACG differ False; other groups that differ []
code/height/d1/real, all neurons as AllFit: all and low ACG differ False; other groups that differ []
code/height/d2/own, all neurons as All902: all and low ACG differ False; other groups that differ []
code/height/d2/own, all neurons as AllFit: all and low ACG differ False; other groups that differ []
code/height/d2/real, all neurons as All902: all and low ACG differ False; other groups that differ []
code/height/d2/real, all neurons as AllFit: all and low ACG differ False; other groups that differ []
code/prominence/d1/real, all neurons as All902: all and low ACG differ True; other groups that differ ['Concept']
code/prominence/d1/real, all neurons as AllFit: all and low ACG differ True; other groups that differ ['Concept']
code/prominence/d2/own, all neurons as All902: all and low ACG differ True; other groups that differ ['ShortDecay', 'Concept']
code/prominence/d2/own, all neurons as AllFit: all and low ACG differ True; other groups that differ ['ShortDecay', 'Concept']
code/prominence/d2/real, all neurons as All902: all and low ACG differ True; other groups that differ ['Concept']
code/prominence/d2/real, all neurons as AllFit: all and low ACG differ True; other groups that differ ['Concept']
methods/height/d1/real, all neurons as All902: all and low ACG differ True; other groups that differ []
methods/height/d1/real, all neurons as AllFit: all and low ACG differ True; other groups that differ []
methods/height/d2/own, all neurons as All902: all and low ACG differ False; other groups that differ []
methods/height/d2/own, all neurons as AllFit: all and low ACG differ False; other groups that differ []
methods/height/d2/real, all neurons as All902: all and low ACG differ True; other groups that differ []
methods/height/d2/real, all neurons as AllFit: all and low ACG differ True; other groups that differ []
methods/prominence/d1/real, all neurons as All902: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay']
methods/prominence/d1/real, all neurons as AllFit: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay']
methods/prominence/d2/own, all neurons as All902: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay', 'Concept']
methods/prominence/d2/own, all neurons as AllFit: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay', 'Concept']
methods/prominence/d2/real, all neurons as All902: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay']
methods/prominence/d2/real, all neurons as AllFit: all and low ACG differ True; other groups that differ ['HighACG', 'ShortDecay', 'LongDecay']

Result: reproduced. Under the Methods' groups with the height rule and the real threshold, all neurons (BH p 0.0054) and the low ACG group differ from the Poisson null and the other four groups do not, both with the criterion's main spacing of 2 bins (low ACG BH p 0.0483, others 0.67 to 0.89) and with the 1-bin spacing of the Results' 70 ms, which the criterion runs as a variant (low ACG 0.0385, others 0.78 to 0.89). Under the code's groups with the prominence rule all neurons and low ACG differ but the concept group does too (BH p 0.045), the criterion's partial outcome. The Methods' groups with prominence make every group but concept cells differ; with the code's groups and the height rule the low ACG group does not differ. The reading this outcome rests on is the height rule, under which, in fig4-acg-group-differences, low ACG neurons burst less than high ACG neurons; the claims of Fig. 4 that hold under the prominence rule are not supported by the same rule as this one. How this result moves with the ACG fit is checked after ext2-bursts-loads23: with 2 bins one of the three rounding-level variants misses it (low ACG 0.0601), with 1 bin none does.

fig4d-maintenance-bursts-vs-poisson¶

During maintenance, bursting exceeded the Poisson null for all neurons pooled and for the low and high mean ACG and short and long tau decay groups, but not for concept cells.

Maintenance windows of 2.8 s from onset (the code's), each trial cut at the probe.

In [37]:
# The 2.8 s window of the code: trials concatenated with a stride of 2.8 s, real spikes cut at the
# probe (2.53 to 2.84 s), surrogate spikes uniform over the whole 2.8 s.
BURST_M = show_bursts("maint")
print(BURST_M.round(4).to_string(index=False))
for reading, o in BURST_M.groupby("reading", sort=False):
    ok = {g: bool((o[o.group == g].p_BH < 0.05).iloc[0] and (o[o.group == g].real_above > o[o.group == g].n / 2).iloc[0])
          for g in ["All902", "LowACG", "HighACG", "ShortDecay", "LongDecay"]}
    print(f"{reading}: five named groups above the null {all(ok.values())} {ok}; concept cells corrected p "
          f"{o[o.group == 'Concept'].p_BH.iloc[0]:.3f}")
                   reading      group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real     All902 20         95.0         55.8          20  0.0 0.0001 0.0007
       code/height/d1/real     LowACG 12         90.0         77.4          11  2.0 0.0037 0.0059
       code/height/d1/real    HighACG 12        101.5         83.2           9  6.0 0.0096 0.0128
       code/height/d1/real ShortDecay 12         96.5         86.8           8 13.0 0.0414 0.0473
       code/height/d1/real  LongDecay 12         96.5         78.6          12  0.0 0.0022 0.0044
       code/height/d1/real    Concept  9         79.0         79.7           3 16.0 0.4413 0.4413
       code/height/d1/real         PY 12         85.5         65.1          12  0.0 0.0022 0.0044
       code/height/d1/real         IN 19         92.0         69.7          16  9.0 0.0005 0.0022
       code/height/d1/real     AllFit 12         97.5         64.4          12  0.0 0.0022    NaN
        code/height/d2/own     All902 20         95.0        103.2           7 36.0 0.0100 0.0800
        code/height/d2/own     LowACG 12         90.0         88.1           6 36.0 0.8139 0.9302
        code/height/d2/own    HighACG 12        101.5        104.4           4 18.0 0.0995 0.1990
        code/height/d2/own ShortDecay 12         96.5         98.2           5 33.0 0.6379 0.9265
        code/height/d2/own  LongDecay 12         96.5         99.8           7 34.0 0.6949 0.9265
        code/height/d2/own    Concept  9         79.0         84.7           3  8.0 0.0858 0.1990
        code/height/d2/own         PY 12         85.5         88.9           5 38.0 0.9375 0.9375
        code/height/d2/own         IN 19         92.0         99.2           6 48.0 0.0586 0.1990
        code/height/d2/own     AllFit 12         97.5        104.1           3 16.0 0.0712    NaN
       code/height/d2/real     All902 20         95.0         55.5          20  0.0 0.0001 0.0007
       code/height/d2/real     LowACG 12         90.0         78.2          11  4.0 0.0060 0.0097
       code/height/d2/real    HighACG 12        101.5         83.9           9  6.0 0.0096 0.0128
       code/height/d2/real ShortDecay 12         96.5         87.4           8 12.0 0.0342 0.0391
       code/height/d2/real  LongDecay 12         96.5         79.4          12  0.0 0.0022 0.0044
       code/height/d2/real    Concept  9         79.0         80.3           3 17.0 0.5147 0.5147
       code/height/d2/real         PY 12         85.5         64.6          12  0.0 0.0022 0.0044
       code/height/d2/real         IN 19         92.0         69.8          17  8.0 0.0005 0.0019
       code/height/d2/real     AllFit 12         97.5         64.7          12  0.0 0.0022    NaN
   code/prominence/d1/real     All902 20         26.5          3.0          20  0.0 0.0001 0.0007
   code/prominence/d1/real     LowACG 12         56.0         44.3          11  1.0 0.0029 0.0038
   code/prominence/d1/real    HighACG 12         33.5         14.9          12  0.0 0.0022 0.0035
   code/prominence/d1/real ShortDecay 12         39.5         32.2          11  2.0 0.0037 0.0042
   code/prominence/d1/real  LongDecay 12         45.0         21.1          12  0.0 0.0022 0.0035
   code/prominence/d1/real    Concept  9         53.0         53.0           6 10.0 0.1386 0.1386
   code/prominence/d1/real         PY 12         62.5         43.8          12  0.0 0.0022 0.0035
   code/prominence/d1/real         IN 19         29.0          7.0          18  4.0 0.0003 0.0010
   code/prominence/d1/real     AllFit 12         25.0          4.5          12  0.0 0.0022    NaN
    code/prominence/d2/own     All902 20         26.5          5.7          20  0.0 0.0001 0.0007
    code/prominence/d2/own     LowACG 12         56.0         54.5           7 26.0 0.3078 0.3078
    code/prominence/d2/own    HighACG 12         33.5         18.0          12  0.0 0.0022 0.0059
    code/prominence/d2/own ShortDecay 12         39.5         35.6           9 12.0 0.0342 0.0456
    code/prominence/d2/own  LongDecay 12         45.0         28.2          11  3.0 0.0047 0.0095
    code/prominence/d2/own    Concept  9         53.0         52.3           7  8.0 0.0858 0.0981
    code/prominence/d2/own         PY 12         62.5         51.1          10  9.0 0.0186 0.0298
    code/prominence/d2/own         IN 19         29.0         13.2          16  6.0 0.0003 0.0014
    code/prominence/d2/own     AllFit 12         25.0          5.7          12  0.0 0.0022    NaN
   code/prominence/d2/real     All902 20         26.5          3.1          20  0.0 0.0001 0.0007
   code/prominence/d2/real     LowACG 12         56.0         44.6          11  1.0 0.0029 0.0038
   code/prominence/d2/real    HighACG 12         33.5         15.3          12  0.0 0.0022 0.0035
   code/prominence/d2/real ShortDecay 12         39.5         31.9          11  2.0 0.0037 0.0042
   code/prominence/d2/real  LongDecay 12         45.0         21.5          12  0.0 0.0022 0.0035
   code/prominence/d2/real    Concept  9         53.0         52.3           7  9.0 0.1097 0.1097
   code/prominence/d2/real         PY 12         62.5         43.6          12  0.0 0.0022 0.0035
   code/prominence/d2/real         IN 19         29.0          7.2          18  5.0 0.0003 0.0012
   code/prominence/d2/real     AllFit 12         25.0          4.4          12  0.0 0.0022    NaN
    methods/height/d1/real     All902 20         95.0         55.8          20  0.0 0.0001 0.0007
    methods/height/d1/real     LowACG 12         92.5         61.6          12  0.0 0.0022 0.0035
    methods/height/d1/real    HighACG 12        101.0         75.6          11  3.0 0.0047 0.0063
    methods/height/d1/real ShortDecay 12         95.5         73.2           9  7.0 0.0121 0.0138
    methods/height/d1/real  LongDecay 12         97.0         76.1          12  0.0 0.0022 0.0035
    methods/height/d1/real    Concept  5         88.0         87.6           2  7.0 0.8927 0.8927
    methods/height/d1/real         PY 12         85.5         65.0          12  0.0 0.0022 0.0035
    methods/height/d1/real         IN 19         92.0         69.4          17  9.0 0.0005 0.0022
    methods/height/d1/real     AllFit 12         97.5         64.7          12  0.0 0.0022    NaN
     methods/height/d2/own     All902 20         95.0        102.9           7 37.0 0.0111 0.0890
     methods/height/d2/own     LowACG 12         92.5         93.3           4 20.0 0.1361 0.1815
     methods/height/d2/own    HighACG 12        101.0        103.8           2 16.0 0.0711 0.1274
     methods/height/d2/own ShortDecay 12         95.5        100.6           1 11.0 0.0281 0.1122
     methods/height/d2/own  LongDecay 12         97.0        100.4           5 27.0 0.3465 0.3960
     methods/height/d2/own    Concept  5         88.0         86.7           1  1.0 0.0796 0.1274
     methods/height/d2/own         PY 12         85.5         89.5           5 37.0 0.8753 0.8753
     methods/height/d2/own         IN 19         92.0         99.2           8 49.0 0.0641 0.1274
     methods/height/d2/own     AllFit 12         97.5        105.0           3 14.0 0.0499    NaN
    methods/height/d2/real     All902 20         95.0         55.5          20  0.0 0.0001 0.0007
    methods/height/d2/real     LowACG 12         92.5         61.3          12  0.0 0.0022 0.0035
    methods/height/d2/real    HighACG 12        101.0         74.4          10  5.0 0.0076 0.0102
    methods/height/d2/real ShortDecay 12         95.5         72.7           9  6.0 0.0096 0.0110
    methods/height/d2/real  LongDecay 12         97.0         74.3          12  0.0 0.0022 0.0035
    methods/height/d2/real    Concept  5         88.0         87.7           2  7.0 0.8927 0.8927
    methods/height/d2/real         PY 12         85.5         64.3          12  0.0 0.0022 0.0035
    methods/height/d2/real         IN 19         92.0         70.1          17  8.0 0.0005 0.0019
    methods/height/d2/real     AllFit 12         97.5         63.8          12  0.0 0.0022    NaN
methods/prominence/d1/real     All902 20         26.5          3.1          20  0.0 0.0001 0.0007
methods/prominence/d1/real     LowACG 12         51.5         23.0          12  0.0 0.0022 0.0025
methods/prominence/d1/real    HighACG 12         28.0          9.6          12  0.0 0.0022 0.0025
methods/prominence/d1/real ShortDecay 12         38.0         19.8          12  0.0 0.0022 0.0025
methods/prominence/d1/real  LongDecay 12         35.5         13.5          12  0.0 0.0022 0.0025
methods/prominence/d1/real    Concept  5         53.0         53.9           4  2.0 0.1380 0.1380
methods/prominence/d1/real         PY 12         62.5         43.5          12  0.0 0.0022 0.0025
methods/prominence/d1/real         IN 19         29.0          6.9          18  5.0 0.0003 0.0012
methods/prominence/d1/real     AllFit 12         25.0          4.3          12  0.0 0.0022    NaN
 methods/prominence/d2/own     All902 20         26.5          5.8          20  0.0 0.0001 0.0007
 methods/prominence/d2/own     LowACG 12         51.5         38.1          12  0.0 0.0022 0.0030
 methods/prominence/d2/own    HighACG 12         28.0         12.1          12  0.0 0.0022 0.0030
 methods/prominence/d2/own ShortDecay 12         38.0         25.9          12  0.0 0.0022 0.0030
 methods/prominence/d2/own  LongDecay 12         35.5         18.7          12  0.0 0.0022 0.0030
 methods/prominence/d2/own    Concept  5         53.0         52.4           5  0.0 0.0431 0.0431
 methods/prominence/d2/own         PY 12         62.5         51.0          10  9.0 0.0186 0.0213
 methods/prominence/d2/own         IN 19         29.0         13.4          16  7.0 0.0004 0.0016
 methods/prominence/d2/own     AllFit 12         25.0          5.9          12  0.0 0.0022    NaN
methods/prominence/d2/real     All902 20         26.5          2.9          20  0.0 0.0001 0.0007
methods/prominence/d2/real     LowACG 12         51.5         23.2          12  0.0 0.0022 0.0025
methods/prominence/d2/real    HighACG 12         28.0          9.7          12  0.0 0.0022 0.0025
methods/prominence/d2/real ShortDecay 12         38.0         20.1          12  0.0 0.0022 0.0025
methods/prominence/d2/real  LongDecay 12         35.5         13.1          12  0.0 0.0022 0.0025
methods/prominence/d2/real    Concept  5         53.0         53.4           4  2.0 0.1380 0.1380
methods/prominence/d2/real         PY 12         62.5         43.7          12  0.0 0.0022 0.0025
methods/prominence/d2/real         IN 19         29.0          6.9          18  4.0 0.0003 0.0010
methods/prominence/d2/real     AllFit 12         25.0          4.5          12  0.0 0.0022    NaN
code/height/d1/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.441
code/height/d2/own: five named groups above the null False {'All902': False, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': False}; concept cells corrected p 0.199
code/height/d2/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.515
code/prominence/d1/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.139
code/prominence/d2/own: five named groups above the null False {'All902': True, 'LowACG': False, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.098
code/prominence/d2/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.110
methods/height/d1/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.893
methods/height/d2/own: five named groups above the null False {'All902': False, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': False}; concept cells corrected p 0.127
methods/height/d2/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.893
methods/prominence/d1/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.138
methods/prominence/d2/own: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.043
methods/prominence/d2/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.138
In [38]:
# The criterion's own-maintenance reading under every reading: each trial's own maintenance (at
# most 2.8 s) concatenated with stride = its duration, surrogate spikes drawn within it.
BURST_MO = show_bursts("maint_own")
print(BURST_MO.round(4).to_string(index=False))


def fig4d_rule(o):
    ok = {g: bool((o[o.group == g].p_BH < 0.05).iloc[0] and (o[o.group == g].real_above > o[o.group == g].n / 2).iloc[0])
          for g in ["All902", "LowACG", "HighACG", "ShortDecay", "LongDecay"]}
    return ok, float(o[o.group == "Concept"].p_BH.iloc[0])


for reading, o in BURST_MO.groupby("reading", sort=False):
    ok, pc = fig4d_rule(o)
    print(f"own maintenance, {reading}: five named groups above the null {all(ok.values())} {ok}; concept cells corrected p {pc:.3f}")

# Control for the 2.8 s window: spike trains with no bursts. For each participant and group, every
# neuron's spikes are replaced by a homogeneous Poisson train within each trial's own maintenance
# (the trial's count as its mean), then tested as in the 2.8 s reading (surrogates spread over the
# whole 2.8 s) and as in the own-maintenance reading.
rows = []
for grule in ["code", "methods"]:
    for rule in ["prominence", "height"]:
        for g, subs in GR[grule].items():
            if g not in FAM:
                continue
            for sub, nids in subs.items():
                rng = np.random.default_rng(wm.stable_seed("control", grule, rule, g, sub))
                fake = [[np.sort(rng.uniform(0, d, rng.poisson(len(s)))) for s, d in zip(EP[(n, 1, "maint28")], MDUR[sub])] for n in nids]
                for win_reading, durs in [("2.8 s window", None), ("own maintenance", MDUR[sub])]:
                    rc, sc, _, _ = wm.group_bursts(fake, 2.8, rng, rule, 2, "real", durs=durs)
                    rows.append(dict(grule=grule, rule=rule, window=win_reading, group=g, sub=sub, real=rc, sur=sc))
CTRL = pd.DataFrame(rows)
for (grule, rule, wr), df in CTRL.groupby(["grule", "rule", "window"], sort=False):
    o = real_vs_null(df, FAM, ())
    print(f"\ncontrol (Poisson trains, no bursts), {grule}/{rule}/real, {wr}:")
    print(o[["group", "n", "real_median", "null_median", "real_above", "p", "p_BH"]].round(4).to_string(index=False))
                   reading      group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real     All902 20        100.5         78.1          19  7.0 0.0003 0.0020
       code/height/d1/real     LowACG 12        103.5         83.2          11 12.0 0.0342 0.0547
       code/height/d1/real    HighACG 12        115.5        103.0           9 18.0 0.0995 0.1326
       code/height/d1/real ShortDecay 12        111.0        102.6           8 29.0 0.4328 0.4328
       code/height/d1/real  LongDecay 12        113.0         96.4           9 10.0 0.0229 0.0458
       code/height/d1/real    Concept  9         81.0         90.1           3 12.0 0.2135 0.2440
       code/height/d1/real         PY 12         91.5         69.2          11  2.0 0.0037 0.0148
       code/height/d1/real         IN 19         95.0         84.5          15 36.0 0.0176 0.0458
       code/height/d1/real     AllFit 12        109.0         85.0          10  4.0 0.0060    NaN
        code/height/d2/own     All902 20        100.5        106.1           6 38.0 0.0124 0.0495
        code/height/d2/own     LowACG 12        103.5        107.4           4 32.0 0.5829 0.5829
        code/height/d2/own    HighACG 12        115.5        122.9           5 30.5 0.5047 0.5768
        code/height/d2/own ShortDecay 12        111.0        123.2           7 29.0 0.4328 0.5768
        code/height/d2/own  LongDecay 12        113.0        121.3           4 27.0 0.3465 0.5544
        code/height/d2/own    Concept  9         81.0         88.2           4 10.0 0.1386 0.3697
        code/height/d2/own         PY 12         91.5         95.2           5 27.0 0.3465 0.5544
        code/height/d2/own         IN 19         95.0        105.0           5 27.0 0.0062 0.0495
        code/height/d2/own     AllFit 12        109.0        122.1           2  9.0 0.0186    NaN
       code/height/d2/real     All902 20        100.5         78.7          19  7.0 0.0003 0.0020
       code/height/d2/real     LowACG 12        103.5         83.4          11 12.0 0.0342 0.0547
       code/height/d2/real    HighACG 12        115.5        103.1           8 20.0 0.1361 0.1815
       code/height/d2/real ShortDecay 12        111.0        103.5           8 28.0 0.3882 0.3882
       code/height/d2/real  LongDecay 12        113.0         96.6           9 10.0 0.0229 0.0538
       code/height/d2/real    Concept  9         81.0         90.7           3 12.0 0.2135 0.2440
       code/height/d2/real         PY 12         91.5         69.7          11  1.0 0.0029 0.0115
       code/height/d2/real         IN 19         95.0         83.4          14 40.0 0.0269 0.0538
       code/height/d2/real     AllFit 12        109.0         83.7          11  3.0 0.0047    NaN
   code/prominence/d1/real     All902 20         12.5          4.8          19  3.0 0.0001 0.0011
   code/prominence/d1/real     LowACG 12         68.5         54.9          12  0.0 0.0022 0.0044
   code/prominence/d1/real    HighACG 12         22.5         16.6           8 16.0 0.0712 0.0814
   code/prominence/d1/real ShortDecay 12         44.5         40.4          10 16.0 0.0712 0.0814
   code/prominence/d1/real  LongDecay 12         43.0         25.1          12  0.0 0.0022 0.0044
   code/prominence/d1/real    Concept  9         52.0         50.6           5 22.0 0.9528 0.9528
   code/prominence/d1/real         PY 12         67.5         35.3          12  0.0 0.0022 0.0044
   code/prominence/d1/real         IN 19         24.0         10.6          14 44.0 0.0401 0.0642
   code/prominence/d1/real     AllFit 12         12.5          5.7          11  2.0 0.0037    NaN
    code/prominence/d2/own     All902 20         12.5          6.2          19  3.0 0.0001 0.0011
    code/prominence/d2/own     LowACG 12         68.5         62.3           8 17.0 0.0844 0.1125
    code/prominence/d2/own    HighACG 12         22.5         19.3           7 20.0 0.1361 0.1361
    code/prominence/d2/own ShortDecay 12         44.5         40.7           9 15.0 0.0597 0.0956
    code/prominence/d2/own  LongDecay 12         43.0         29.9          11  7.0 0.0121 0.0322
    code/prominence/d2/own    Concept  9         52.0         48.8           8  5.0 0.0382 0.0763
    code/prominence/d2/own         PY 12         67.5         48.8          11  5.0 0.0076 0.0306
    code/prominence/d2/own         IN 19         24.0         12.8          13 56.0 0.1165 0.1332
    code/prominence/d2/own     AllFit 12         12.5          7.0          11  2.0 0.0037    NaN
   code/prominence/d2/real     All902 20         12.5          4.7          19  3.0 0.0001 0.0011
   code/prominence/d2/real     LowACG 12         68.5         55.5          11  1.0 0.0029 0.0057
   code/prominence/d2/real    HighACG 12         22.5         16.7           8 16.0 0.0712 0.0814
   code/prominence/d2/real ShortDecay 12         44.5         40.2          10 16.0 0.0712 0.0814
   code/prominence/d2/real  LongDecay 12         43.0         25.3          12  0.0 0.0022 0.0057
   code/prominence/d2/real    Concept  9         52.0         51.1           5 22.0 0.9528 0.9528
   code/prominence/d2/real         PY 12         67.5         35.5          12  0.0 0.0022 0.0057
   code/prominence/d2/real         IN 19         24.0         10.8          14 42.0 0.0329 0.0527
   code/prominence/d2/real     AllFit 12         12.5          5.8          11  2.0 0.0037    NaN
    methods/height/d1/real     All902 20        100.5         78.2          19  7.0 0.0003 0.0020
    methods/height/d1/real     LowACG 12        102.0         71.6          12  0.0 0.0022 0.0077
    methods/height/d1/real    HighACG 12        118.0         99.9           7 16.0 0.0712 0.0814
    methods/height/d1/real ShortDecay 12        108.5         94.2           9  9.0 0.0186 0.0291
    methods/height/d1/real  LongDecay 12        114.0         93.2          11  4.0 0.0060 0.0121
    methods/height/d1/real    Concept  5         81.0         90.2           2  7.0 0.8927 0.8927
    methods/height/d1/real         PY 12         91.5         69.0          11  1.0 0.0029 0.0077
    methods/height/d1/real         IN 19         95.0         85.5          14 38.0 0.0218 0.0291
    methods/height/d1/real     AllFit 12        109.0         84.6          11  3.0 0.0047    NaN
     methods/height/d2/own     All902 20        100.5        105.5           7 42.0 0.0187 0.0498
     methods/height/d2/own     LowACG 12        102.0        120.6           2  7.0 0.0121 0.0483
     methods/height/d2/own    HighACG 12        118.0        123.3           3 22.0 0.1823 0.2084
     methods/height/d2/own ShortDecay 12        108.5        121.9           4 20.0 0.1361 0.1815
     methods/height/d2/own  LongDecay 12        114.0        123.5           2 12.0 0.0342 0.0683
     methods/height/d2/own    Concept  5         81.0         88.6           1  1.0 0.0796 0.1274
     methods/height/d2/own         PY 12         91.5         95.4           5 30.0 0.4802 0.4802
     methods/height/d2/own         IN 19         95.0        104.1           5 28.0 0.0070 0.0483
     methods/height/d2/own     AllFit 12        109.0        122.0           2  8.0 0.0150    NaN
    methods/height/d2/real     All902 20        100.5         78.5          19  7.0 0.0003 0.0020
    methods/height/d2/real     LowACG 12        102.0         71.7          12  0.0 0.0022 0.0089
    methods/height/d2/real    HighACG 12        118.0         99.7           8 14.0 0.0499 0.0570
    methods/height/d2/real ShortDecay 12        108.5         91.6           9  8.0 0.0150 0.0240
    methods/height/d2/real  LongDecay 12        114.0         93.2          10  4.0 0.0060 0.0121
    methods/height/d2/real    Concept  5         81.0         89.7           2  6.0 0.6858 0.6858
    methods/height/d2/real         PY 12         91.5         69.9          11  2.0 0.0037 0.0099
    methods/height/d2/real         IN 19         95.0         85.7          14 38.0 0.0218 0.0291
    methods/height/d2/real     AllFit 12        109.0         84.2          11  3.0 0.0047    NaN
methods/prominence/d1/real     All902 20         12.5          4.6          19  3.0 0.0001 0.0011
methods/prominence/d1/real     LowACG 12         55.0         28.5          12  0.0 0.0022 0.0035
methods/prominence/d1/real    HighACG 12         20.0         11.6           8 10.0 0.0229 0.0305
methods/prominence/d1/real ShortDecay 12         30.0         21.0          12  0.0 0.0022 0.0035
methods/prominence/d1/real  LongDecay 12         33.0         16.7          12  0.0 0.0022 0.0035
methods/prominence/d1/real    Concept  5         52.0         51.1           4  3.0 0.2249 0.2249
methods/prominence/d1/real         PY 12         67.5         35.5          12  0.0 0.0022 0.0035
methods/prominence/d1/real         IN 19         24.0         10.7          14 42.0 0.0329 0.0376
methods/prominence/d1/real     AllFit 12         12.5          5.7          11  2.0 0.0037    NaN
 methods/prominence/d2/own     All902 20         12.5          6.4          19  2.0 0.0001 0.0010
 methods/prominence/d2/own     LowACG 12         55.0         41.5          10  4.0 0.0060 0.0121
 methods/prominence/d2/own    HighACG 12         20.0         12.8           9  8.0 0.0150 0.0200
 methods/prominence/d2/own ShortDecay 12         30.0         26.2          12  0.0 0.0022 0.0059
 methods/prominence/d2/own  LongDecay 12         33.0         18.1          12  0.0 0.0022 0.0059
 methods/prominence/d2/own    Concept  5         52.0         48.8           4  1.0 0.0796 0.0910
 methods/prominence/d2/own         PY 12         67.5         49.7          11  5.0 0.0076 0.0122
 methods/prominence/d2/own         IN 19         24.0         12.9          13 58.0 0.1365 0.1365
 methods/prominence/d2/own     AllFit 12         12.5          6.9          11  2.0 0.0037    NaN
methods/prominence/d2/real     All902 20         12.5          4.7          19  3.0 0.0001 0.0011
methods/prominence/d2/real     LowACG 12         55.0         28.2          12  0.0 0.0022 0.0035
methods/prominence/d2/real    HighACG 12         20.0         11.7           8 10.0 0.0229 0.0305
methods/prominence/d2/real ShortDecay 12         30.0         21.0          12  0.0 0.0022 0.0035
methods/prominence/d2/real  LongDecay 12         33.0         16.1          12  0.0 0.0022 0.0035
methods/prominence/d2/real    Concept  5         52.0         50.8           4  4.0 0.3452 0.3452
methods/prominence/d2/real         PY 12         67.5         35.2          12  0.0 0.0022 0.0035
methods/prominence/d2/real         IN 19         24.0         10.9          14 43.0 0.0364 0.0416
methods/prominence/d2/real     AllFit 12         12.5          5.7          11  2.0 0.0037    NaN
own maintenance, code/height/d1/real: five named groups above the null False {'All902': True, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': True}; concept cells corrected p 0.244
own maintenance, code/height/d2/own: five named groups above the null False {'All902': False, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': False}; concept cells corrected p 0.370
own maintenance, code/height/d2/real: five named groups above the null False {'All902': True, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': False}; concept cells corrected p 0.244
own maintenance, code/prominence/d1/real: five named groups above the null False {'All902': True, 'LowACG': True, 'HighACG': False, 'ShortDecay': False, 'LongDecay': True}; concept cells corrected p 0.953
own maintenance, code/prominence/d2/own: five named groups above the null False {'All902': True, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': True}; concept cells corrected p 0.076
own maintenance, code/prominence/d2/real: five named groups above the null False {'All902': True, 'LowACG': True, 'HighACG': False, 'ShortDecay': False, 'LongDecay': True}; concept cells corrected p 0.953
own maintenance, methods/height/d1/real: five named groups above the null False {'All902': True, 'LowACG': True, 'HighACG': False, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.893
own maintenance, methods/height/d2/own: five named groups above the null False {'All902': False, 'LowACG': False, 'HighACG': False, 'ShortDecay': False, 'LongDecay': False}; concept cells corrected p 0.127
own maintenance, methods/height/d2/real: five named groups above the null False {'All902': True, 'LowACG': True, 'HighACG': False, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.686
own maintenance, methods/prominence/d1/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.225
own maintenance, methods/prominence/d2/own: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.091
own maintenance, methods/prominence/d2/real: five named groups above the null True {'All902': True, 'LowACG': True, 'HighACG': True, 'ShortDecay': True, 'LongDecay': True}; concept cells corrected p 0.345
control (Poisson trains, no bursts), code/prominence/real, 2.8 s window:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20         20.5          5.4          20 0.0001 0.0005
    LowACG 12         52.0         50.2           9 0.0150 0.0200
   HighACG 12         30.0         14.4          12 0.0022 0.0057
ShortDecay 12         43.5         36.8          11 0.0037 0.0059
 LongDecay 12         30.0         22.8          11 0.0029 0.0057
   Concept  9         52.0         53.1           5 0.3743 0.3743
        PY 12         55.5         53.0           9 0.0597 0.0683
        IN 19         25.0         11.2          19 0.0001 0.0005

control (Poisson trains, no bursts), code/prominence/real, own maintenance:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20          7.0          7.3          11 0.2627 0.7256
    LowACG 12         60.5         63.4           6 0.9375 0.9375
   HighACG 12         19.0         19.1           8 0.6379 0.9265
ShortDecay 12         40.0         39.0           6 0.8753 0.9375
 LongDecay 12         31.0         30.6           4 0.2721 0.7256
   Concept  9         48.0         49.5           6 0.3743 0.7485
        PY 12         53.0         50.5           6 0.6949 0.9265
        IN 19         16.0         12.6          11 0.0766 0.6127

control (Poisson trains, no bursts), code/height/real, 2.8 s window:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20        101.5         84.1          19 0.0001 0.0006
    LowACG 12         88.0         87.1           9 0.1823 0.2084
   HighACG 12        104.5         94.3          12 0.0022 0.0059
ShortDecay 12         97.5         94.5          10 0.0342 0.0456
 LongDecay 12         96.5         86.2          10 0.0047 0.0095
   Concept  9         89.0         85.5           8 0.0209 0.0334
        PY 12         86.5         86.0           6 0.7537 0.7537
        IN 19         96.0         87.4          18 0.0002 0.0006

control (Poisson trains, no bursts), code/height/real, own maintenance:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20        109.5        109.5           8 0.2322 0.4186
    LowACG 12        109.0        110.5           5 0.7537 0.7537
   HighACG 12        119.5        124.1           2 0.0167 0.1335
ShortDecay 12        120.5        126.6           3 0.0995 0.2653
 LongDecay 12        117.0        122.2           4 0.0712 0.2653
   Concept  9         89.0         92.8           4 0.3139 0.4186
        PY 12         93.0         95.0           6 0.6379 0.7290
        IN 19        107.0        104.2           8 0.2954 0.4186

control (Poisson trains, no bursts), methods/prominence/real, 2.8 s window:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20         20.5          5.1          20 0.0001 0.0006
    LowACG 12         45.0         37.0          10 0.0076 0.0102
   HighACG 12         24.0         11.0          12 0.0022 0.0035
ShortDecay 12         29.0         22.9          12 0.0022 0.0035
 LongDecay 12         27.0         16.6          12 0.0022 0.0035
   Concept  5         53.0         49.9           4 0.1380 0.1577
        PY 12         52.5         52.1           6 0.3882 0.3882
        IN 19         25.0         11.4          18 0.0002 0.0006

control (Poisson trains, no bursts), methods/prominence/real, own maintenance:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20          5.5          7.4           7 0.1454 0.2326
    LowACG 12         41.0         42.6           5 0.6379 0.7290
   HighACG 12         12.5         12.6           1 0.0121 0.0965
ShortDecay 12         25.5         25.5           4 0.9375 0.9375
 LongDecay 12         16.0         18.9           4 0.1167 0.2326
   Concept  5         52.0         46.8           4 0.0796 0.2326
        PY 12         50.0         53.6           4 0.0995 0.2326
        IN 19         12.0         11.9          10 0.6009 0.7290

control (Poisson trains, no bursts), methods/height/real, 2.8 s window:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20         99.5         86.4          17 0.0003 0.0025
    LowACG 12         97.5         88.4          11 0.0029 0.0076
   HighACG 12        100.5         93.8          10 0.0076 0.0122
ShortDecay 12         97.0         92.4          10 0.0121 0.0161
 LongDecay 12        100.5         89.6          10 0.0047 0.0095
   Concept  5         86.0         84.4           4 0.3452 0.3945
        PY 12         89.0         89.0           7 0.8753 0.8753
        IN 19         99.0         88.7          16 0.0006 0.0025

control (Poisson trains, no bursts), methods/height/real, own maintenance:
     group  n  real_median  null_median  real_above      p   p_BH
    All902 20        105.5        111.7           2 0.0007 0.0054
    LowACG 12        115.5        114.4           5 0.3465 0.6211
   HighACG 12        115.5        116.7           5 0.3882 0.6211
ShortDecay 12        118.0        120.2           5 0.6949 0.7942
 LongDecay 12        116.0        118.8           3 0.0844 0.3375
   Concept  5         89.0         86.8           2 0.3452 0.6211
        PY 12         99.5        101.3           6 0.4802 0.6402
        IN 19        107.0        108.0           7 0.9359 0.9359

Result: reproduced. The 2.8 s window of the code cannot decide this claim. Real spikes stop at the probe (2.53 to 2.84 s) while the surrogate spikes fill the whole 2.8 s, and the control above shows that this alone makes trains with no bursts exceed the null: Poisson trains confined to each trial's maintenance give all neurons above the null in 17 to 20 of 20 participants (BH p 0.0005 to 0.0025), and with the Methods' groups and the height rule all five named groups exceed it (BH p at most 0.016). With each trial's own maintenance the same control gives no group above the null (no BH p below 0.05 with more real than surrogate bursts). The outcome therefore rests on the own-maintenance reading of the criterion. Under it, the Methods' groups with the prominence rule give the paper's pattern with the real threshold (spacing 2 or 1 bin) and with each surrogate's own threshold: all five named groups exceed the null in most participants with BH p below 0.05, and concept cells do not (BH p 0.09 to 0.35). The code's groups and the height rule do not give it (high ACG or short tau decay fail). Under the 2.8 s window, for comparison, the real-threshold readings give the pattern too, which the control shows is expected without any bursts.

fig4-acg-group-differences¶

The low mean ACG group burst more than the high mean ACG group in both encoding and maintenance, whereas the short tau decay group exceeded the long tau decay group only during encoding.

Real burst counts of the two previous sections compared between groups within participant (paired two-sided Wilcoxon), BH over the code's 28 pairs of 8 groups, and over the four tests named here.

In [39]:
for (grule, rule, dist, thr), df in BR.groupby(["grule", "rule", "dist", "thr"]):
    if dist != 2 or thr != "real":
        continue
    res = {}
    for epoch in ["enc", "maint"]:
        x = df[df.epoch == epoch].pivot(index="sub", columns="group", values="real")
        pairs = list(itertools.combinations(FAM, 2))
        ps = {}
        for a, b in pairs:
            xx = x[[a, b]].dropna()
            try:
                ps[(a, b)] = wilcoxon(xx[b], xx[a], zero_method="wilcox").pvalue if len(xx) >= 2 else np.nan
            except ValueError:
                ps[(a, b)] = 1.0
        q28 = dict(zip(ps, wm.bh(np.nan_to_num(list(ps.values()), nan=1.0))))
        res[epoch] = (x, ps, q28)
    four = [("enc", "LowACG", "HighACG"), ("maint", "LowACG", "HighACG"), ("enc", "ShortDecay", "LongDecay"), ("maint", "ShortDecay", "LongDecay")]
    p4 = [res[e][1][(a, b)] for e, a, b in four]
    q4 = wm.bh(p4)
    print(f"reading {grule}/{rule}:")
    for (e, a, b), p, q in zip(four, p4, q4):
        x = res[e][0][[a, b]].dropna()
        print(f"  {e}: {a} median {x[a].median():.1f} vs {b} {x[b].median():.1f}, {a} higher in {(x[a] > x[b]).sum()} of {len(x)}; "
              f"p = {p:.4f}, BH over 28 pairs {res[e][2][(a, b)]:.4f}, over these four {q:.4f}")
reading code/height:
  enc: LowACG median 42.5 vs HighACG 47.0, LowACG higher in 3 of 12; p = 0.0625, BH over 28 pairs 0.3500, over these four 0.1250
  maint: LowACG median 90.0 vs HighACG 101.5, LowACG higher in 3 of 12; p = 0.0171, BH over 28 pairs 0.0684, over these four 0.0684
  enc: ShortDecay median 46.0 vs LongDecay 42.0, ShortDecay higher in 7 of 12; p = 0.1846, BH over 28 pairs 0.5742, over these four 0.2461
  maint: ShortDecay median 96.5 vs LongDecay 96.5, ShortDecay higher in 6 of 12; p = 1.0000, BH over 28 pairs 1.0000, over these four 1.0000
reading code/prominence:
  enc: LowACG median 29.0 vs HighACG 11.5, LowACG higher in 12 of 12; p = 0.0005, BH over 28 pairs 0.0014, over these four 0.0010
  maint: LowACG median 56.0 vs HighACG 33.5, LowACG higher in 12 of 12; p = 0.0005, BH over 28 pairs 0.0017, over these four 0.0010
  enc: ShortDecay median 19.0 vs LongDecay 15.5, ShortDecay higher in 7 of 12; p = 0.1401, BH over 28 pairs 0.1570, over these four 0.1868
  maint: ShortDecay median 39.5 vs LongDecay 45.0, ShortDecay higher in 6 of 12; p = 0.8677, BH over 28 pairs 0.8677, over these four 0.8677
reading methods/height:
  enc: LowACG median 43.5 vs HighACG 47.0, LowACG higher in 3 of 12; p = 0.2393, BH over 28 pairs 0.7292, over these four 0.2393
  maint: LowACG median 92.5 vs HighACG 101.0, LowACG higher in 2 of 12; p = 0.0801, BH over 28 pairs 0.2237, over these four 0.2393
  enc: ShortDecay median 46.0 vs LongDecay 42.0, ShortDecay higher in 9 of 12; p = 0.2021, BH over 28 pairs 0.7292, over these four 0.2393
  maint: ShortDecay median 95.5 vs LongDecay 97.0, ShortDecay higher in 5 of 12; p = 0.2246, BH over 28 pairs 0.3931, over these four 0.2393
reading methods/prominence:
  enc: LowACG median 21.0 vs HighACG 9.0, LowACG higher in 12 of 12; p = 0.0005, BH over 28 pairs 0.0012, over these four 0.0010
  maint: LowACG median 51.5 vs HighACG 28.0, LowACG higher in 12 of 12; p = 0.0005, BH over 28 pairs 0.0015, over these four 0.0010
  enc: ShortDecay median 17.5 vs LongDecay 12.0, ShortDecay higher in 8 of 12; p = 0.0859, BH over 28 pairs 0.0925, over these four 0.1146
  maint: ShortDecay median 38.0 vs LongDecay 35.5, ShortDecay higher in 4 of 12; p = 0.8125, BH over 28 pairs 0.8125, over these four 0.8125

Result: partially reproduced. Under the prominence rule the low ACG group bursts more than the high ACG group in both epochs, in all 12 participants (p = 0.0005, BH p at most 0.0017), and short and long tau decay do not differ in maintenance; but short tau decay does not exceed long tau decay in encoding (p 0.14 with the code's groups, 0.086 with the Methods'). Under the height rule the low ACG group bursts less than the high ACG group. The tau decay groups come from this attempt's fit; groups built from the code's shipped tau decay are tested after ext2-bursts-loads23.

Burst detection of fig4c per epoch (encoding and probe 1 s, maintenance up to 3 s); M1 to M3 are (a) the Methods' 1 s windows from maintenance onset (peaks counted by their time in the trial; M3 runs from 2 s to the end of maintenance, 0.5 to 0.8 s), (b) the code's thirds of the whole concatenated train, or (c) the first, second and final thirds of each trial's own maintenance (peaks counted by their time in the trial), the reading of the Fig. 6c legend ("the first, second, and final thirds of the maintenance epoch"), which the claims file does not list and which is run here as a variant (M-trial; see questions/kussovska-2025.yaml). Paired two-sided Wilcoxon, BH over the 10 pairs of periods, per group and load.

In [40]:
PER = ["enc", "M1", "M2", "M3", "probe"]
rows = []
for grule, G in GR.items():
    for rule in ["prominence", "height"]:
        for mr in ["methods", "code", "trial"]:
            for L in [1, 2, 3]:
                for g, subs in G.items():
                    for sub, nids in subs.items():
                        c = wm.epoch_burst_counts({"enc": [EP[(n, L, "enc")] for n in nids],
                                                   "maint": [EP[(n, L, "maint3")] for n in nids],
                                                   "probe": [EP[(n, L, "probe")] for n in nids]}, rule, 2, mr,
                                                  mdurs=T[sub][T[sub].load == L].maint_dur.values)
                        rows.append(dict(grule=grule, rule=rule, mread=mr, load=L, group=g, sub=sub, **c))
EPB = pd.DataFrame(rows)


def epoch_tests(x):
    ps, names = [], []
    for a, b in itertools.combinations(PER, 2):
        try:
            p = wilcoxon(x[a], x[b], zero_method="wilcox").pvalue
        except ValueError:
            p = 1.0
        ps.append(p)
        names.append(f"{a}-{b}")
    q = wm.bh(ps)
    return dict(zip(names, q)), dict(zip(names, ps))


MD_L = {(s, L): t[t.load == L].maint_dur.mean() for s, t in T.items() for L in [1, 2, 3]}


def epoch_table(group, load):
    out = []
    for (grule, rule, mr), x in EPB[(EPB.group == group) & (EPB.load == load)].groupby(["grule", "rule", "mread"]):
        q, _ = epoch_tests(x)
        med = x[PER].median()
        # Under the Methods' windows M3 runs from 2 s to the end of maintenance (0.5 to 0.8 s), so
        # its count is also given per second; M1 and M2 last 1 s.
        m3_rate = np.median(x.M3.values / (np.array([MD_L[(s, load)] for s in x["sub"]]) - 2.0)) if mr == "methods" else np.nan
        out.append({"reading": f"{grule}/{rule}/M-{mr}", "n": len(x), **{f"med_{k}": med[k] for k in PER},
                    "med_M3_per_s": round(float(m3_rate), 2), **{f"q_{k}": round(q[f"enc-{k}"], 4) for k in PER[1:]},
                    "min_q_other": round(min(v for k, v in q.items() if not k.startswith("enc-")), 4),
                    "q_M1-M2": round(q["M1-M2"], 4), "q_M1-M3": round(q["M1-M3"], 4)})
    return pd.DataFrame(out)


for g in ["All902", "AllFit"]:
    print(f"\n{g}, load 1 (medians are bursts per window; q is BH over the 10 pairs):")
    print(epoch_table(g, 1).to_string(index=False))
x = EPB[(EPB.group == "All902") & (EPB.load == 1) & (EPB.mread == "methods")]
dur = np.mean([T[s][T[s].load == 1].maint_dur.mean() for s in x["sub"].unique()]) - 2.0
print(f"\nM3 under reading (a) lasts {dur:.2f} s on average; its median rate per second, all neurons, prominence: "
      f"{(x[(x.grule == 'code') & (x.rule == 'prominence')].M3 / dur).median():.1f} against M1 {x[(x.grule == 'code') & (x.rule == 'prominence')].M1.median():.1f}")
All902, load 1 (medians are bursts per window; q is BH over the 10 pairs):
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 20     41.5    42.0    38.5    37.0       41.0           NaN 0.4377 0.6169 0.4377   0.6429       0.3632   0.4916   0.3632
       code/height/M-methods 20     41.5    46.5    44.5    28.0       41.0         43.18 0.0024 0.0038 0.0003   0.7117       0.0003   0.8089   0.0003
         code/height/M-trial 20     41.5    41.0    39.5    35.5       41.0           NaN 0.7836 0.9532 0.3489   0.9532       0.3489   1.0000   0.3489
      code/prominence/M-code 20      6.0    14.0    14.0    15.0        5.5           NaN 0.0003 0.0003 0.0003   0.6800       0.0003   0.8103   0.2073
   code/prominence/M-methods 20      6.0    17.0    14.0    11.5        5.5         16.61 0.0003 0.0003 0.0352   0.6120       0.0003   0.0551   0.0003
     code/prominence/M-trial 20      6.0    16.5    13.0    13.0        5.5           NaN 0.0006 0.0006 0.0007   0.6800       0.0006   0.0155   0.1348
       methods/height/M-code 20     41.5    42.0    38.5    37.0       41.0           NaN 0.4377 0.6169 0.4377   0.6429       0.3632   0.4916   0.3632
    methods/height/M-methods 20     41.5    46.5    44.5    28.0       41.0         43.18 0.0024 0.0038 0.0003   0.7117       0.0003   0.8089   0.0003
      methods/height/M-trial 20     41.5    41.0    39.5    35.5       41.0           NaN 0.7836 0.9532 0.3489   0.9532       0.3489   1.0000   0.3489
   methods/prominence/M-code 20      6.0    14.0    14.0    15.0        5.5           NaN 0.0003 0.0003 0.0003   0.6800       0.0003   0.8103   0.2073
methods/prominence/M-methods 20      6.0    17.0    14.0    11.5        5.5         16.61 0.0003 0.0003 0.0352   0.6120       0.0003   0.0551   0.0003
  methods/prominence/M-trial 20      6.0    16.5    13.0    13.0        5.5           NaN 0.0006 0.0006 0.0007   0.6800       0.0006   0.0155   0.1348

AllFit, load 1 (medians are bursts per window; q is BH over the 10 pairs):
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     43.0    44.0    40.5    34.0       45.0           NaN 0.7891 0.7891 0.1465   0.6892       0.0488   0.6892   0.1953
       code/height/M-methods 12     43.0    48.0    47.0    32.0       45.0         46.17 0.0889 0.3821 0.0016   0.5360       0.0016   0.2497   0.0016
         code/height/M-trial 12     43.0    43.5    40.0    40.0       45.0           NaN 0.5599 0.4241 0.1562   0.5599       0.1562   0.4241   0.3271
      code/prominence/M-code 12      6.5    14.0    14.5    14.0        5.5           NaN 0.0016 0.0016 0.0016   0.5151       0.0016   0.5328   0.5962
   code/prominence/M-methods 12      6.5    18.5    13.0     9.5        5.5         13.71 0.0016 0.0117 0.0846   0.4121       0.0016   0.0216   0.0016
     code/prominence/M-trial 12      6.5    16.5    12.5    12.0        5.5           NaN 0.0024 0.0342 0.0220   0.4579       0.0024   0.0446   0.0391
       methods/height/M-code 12     43.0    44.0    40.5    34.0       45.0           NaN 0.7891 0.7891 0.1465   0.6892       0.0488   0.6892   0.1953
    methods/height/M-methods 12     43.0    48.0    47.0    32.0       45.0         46.17 0.0889 0.3821 0.0016   0.5360       0.0016   0.2497   0.0016
      methods/height/M-trial 12     43.0    43.5    40.0    40.0       45.0           NaN 0.5599 0.4241 0.1562   0.5599       0.1562   0.4241   0.3271
   methods/prominence/M-code 12      6.5    14.0    14.5    14.0        5.5           NaN 0.0016 0.0016 0.0016   0.5151       0.0016   0.5328   0.5962
methods/prominence/M-methods 12      6.5    18.5    13.0     9.5        5.5         13.71 0.0016 0.0117 0.0846   0.4121       0.0016   0.0216   0.0016
  methods/prominence/M-trial 12      6.5    16.5    12.5    12.0        5.5           NaN 0.0024 0.0342 0.0220   0.4579       0.0024   0.0446   0.0391

M3 under reading (a) lasts 0.67 s on average; its median rate per second, all neurons, prominence: 17.1 against M1 17.0

Result: partially reproduced. Under the prominence rule all 902 neurons burst more in each of M1, M2 and M3 than in encoding (medians 6 against 14 to 17, BH p 0.0003 to 0.035) under both window readings, but the probe does not differ from encoding under any reading (BH p 0.61 to 0.71; medians 6.0 and 5.5). Three of the four comparisons hold. Under the Methods' windows M3 runs from 2 s to the end of maintenance (0.67 s on average), so its count is low; per second its median is 16.6 (prominence) and 43.2 (height), against 17 and 46.5 in M1 (med_M3_per_s). The M3 decreases of the height rule under these windows come from the shorter window. The outcome is decided on the code's thirds, where all three windows have the same length. The per-trial thirds of the Fig. 6c legend (M-trial, a variant) give the same: under the prominence rule M1, M2 and M3 are above encoding (BH p 0.0006 to 0.0007) and the probe is not (0.68).

fig4hj-group-epochs¶

The increase of bursting from encoding into maintenance was driven by neurons with high mean ACG amplitude (also increasing to the probe) and neurons with a long tau decay, while the low ACG, short tau decay and concept-cell groups showed no change across epochs.

In [41]:
for g in ["HighACG", "LongDecay", "LowACG", "ShortDecay", "Concept"]:
    print(f"\n{g}, load 1:")
    print(epoch_table(g, 1).to_string(index=False))
HighACG, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     47.0    47.0    39.5    39.0       46.0           NaN 0.4453 0.1636 0.0781   0.1636       0.1636   0.2079   0.2079
       code/height/M-methods 12     47.0    48.0    48.0    30.0       46.0         44.84 0.4968 0.5067 0.0049   0.1074       0.0049   0.9863   0.0122
         code/height/M-trial 12     47.0    43.5    42.0    40.0       46.0           NaN 0.6433 0.3198 0.2881   0.3198       0.3198   0.9261   0.5915
      code/prominence/M-code 12     11.5    17.5    14.5    14.0        9.5           NaN 0.0024 0.0098 0.0260   0.3789       0.0024   0.2686   0.1004
   code/prominence/M-methods 12     11.5    19.0    16.5    10.5        9.5         15.48 0.0134 0.0134 0.1746   0.4210       0.0049   0.4434   0.0137
     code/prominence/M-trial 12     11.5    17.0    15.5    13.0        9.5           NaN 0.0301 0.0301 0.0232   0.3789       0.0146   0.2686   0.2686
       methods/height/M-code 12     47.0    48.0    43.0    40.5       44.5           NaN 0.5542 0.3479 0.0781   0.3479       0.1562   0.3479   0.2962
    methods/height/M-methods 12     47.0    53.0    50.5    29.5       44.5         44.60 0.0171 0.0342 0.0012   0.2707       0.0012   0.6387   0.0012
      methods/height/M-trial 12     47.0    45.5    45.5    38.5       44.5           NaN 0.8290 0.4061 0.0684   0.4061       0.0684   0.6689   0.1888
   methods/prominence/M-code 12      9.0    16.0    14.0    14.0        6.0           NaN 0.0020 0.0020 0.0020   0.2398       0.0020   0.3750   0.0642
methods/prominence/M-methods 12      9.0    19.5    14.0     9.5        6.0         14.14 0.0012 0.0016 0.2930   0.2398       0.0012   0.0112   0.0012
  methods/prominence/M-trial 12      9.0    18.5    13.0    12.5        6.0           NaN 0.0024 0.0029 0.0195   0.2158       0.0024   0.0188   0.0024

LongDecay, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     42.0    46.0    43.0    37.5       42.5           NaN 0.1278 0.8954 0.1278   0.9829       0.1278   0.3432   0.1278
       code/height/M-methods 12     42.0    49.5    47.5    32.0       42.5         46.82 0.0195 0.1297 0.0033   0.9829       0.0024   0.4460   0.0024
         code/height/M-trial 12     42.0    45.5    40.5    41.0       42.5           NaN 0.8118 0.8118 0.8118   0.9829       0.8118   0.8118   0.8118
      code/prominence/M-code 12     15.5    21.5    18.0    19.0       16.5           NaN 0.0186 0.0186 0.0098   0.8594       0.0186   0.8594   0.8594
   code/prominence/M-methods 12     15.5    23.5    20.0    17.0       16.5         24.66 0.0049 0.0830 0.8027   0.8027       0.0098   0.1221   0.0195
     code/prominence/M-trial 12     15.5    20.5    17.0    20.0       16.5           NaN 0.0098 0.2100 0.0806   0.7188       0.0220   0.1123   0.4102
       methods/height/M-code 12     42.0    46.5    41.5    36.5       42.0           NaN 0.3460 0.5676 0.0911   0.8330       0.0635   0.3460   0.0911
    methods/height/M-methods 12     42.0    48.0    46.5    30.0       42.0         44.50 0.0698 0.0698 0.0024   0.8330       0.0024   0.5897   0.0061
      methods/height/M-trial 12     42.0    44.5    42.5    37.5       42.0           NaN 0.7780 0.7288 0.7780   0.8330       0.7288   0.7288   0.7490
   methods/prominence/M-code 12     12.0    19.0    16.0    15.5       12.0           NaN 0.0024 0.0024 0.0033   0.8672       0.0117   0.6554   0.1869
methods/prominence/M-methods 12     12.0    21.5    16.0    14.0       12.0         20.88 0.0024 0.0342 0.1587   0.8672       0.0024   0.1017   0.0130
  methods/prominence/M-trial 12     12.0    19.0    15.0    17.5       12.0           NaN 0.0049 0.1074 0.0098   0.8672       0.0049   0.0667   0.7064

LowACG, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     42.5    42.5    43.5    40.5       42.0           NaN 1.0000 0.9103 0.7471   1.0000       0.7471   0.9103   0.7471
       code/height/M-methods 12     42.5    47.5    45.0    30.5       42.0         45.82 0.0767 0.0252 0.0012   0.8979       0.0012   0.9160   0.0012
         code/height/M-trial 12     42.5    40.0    41.5    39.0       42.0           NaN 0.8687 0.8687 0.8687   0.8687       0.8687   0.8687   0.8687
      code/prominence/M-code 12     29.0    31.0    28.5    29.5       29.5           NaN 0.9512 0.9512 0.9512   0.9512       0.9512   0.9512   0.9512
   code/prominence/M-methods 12     29.0    31.5    33.0    24.5       29.5         35.58 0.1058 0.3760 0.0195   0.9551       0.0049   0.9551   0.0049
     code/prominence/M-trial 12     29.0    28.5    28.5    29.0       29.5           NaN 1.0000 1.0000 1.0000   1.0000       1.0000   1.0000   1.0000
       methods/height/M-code 12     43.5    43.0    44.5    34.5       45.5           NaN 0.7547 0.9248 0.2124   0.3506       0.0684   0.8295   0.3506
    methods/height/M-methods 12     43.5    50.5    42.5    31.0       45.5         46.84 0.0020 1.0000 0.0016   0.2124       0.0016   0.0893   0.0016
      methods/height/M-trial 12     43.5    45.5    38.5    42.0       45.5           NaN 0.2667 0.2667 0.2002   0.2667       0.0293   0.2090   0.0293
   methods/prominence/M-code 12     21.0    25.0    26.5    23.0       22.0           NaN 0.6013 0.6013 0.7747   0.6013       0.6013   0.9004   0.6013
methods/prominence/M-methods 12     21.0    30.5    23.0    18.0       22.0         27.01 0.0033 0.6478 0.0530   0.3198       0.0024   0.0252   0.0024
  methods/prominence/M-trial 12     21.0    28.0    20.0    24.5       22.0           NaN 0.0684 0.3461 0.3461   0.3461       0.0749   0.0749   0.2246

ShortDecay, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     46.0    42.5    42.5    41.5       42.5           NaN 0.8643 0.8643 0.3442   0.0977       0.8643   0.8643   0.8643
       code/height/M-methods 12     46.0    50.5    47.0    31.0       42.5         45.63 0.1318 0.3342 0.0098   0.0244       0.0244   0.8652   0.0322
         code/height/M-trial 12     46.0    43.5    45.0    43.0       42.5           NaN 0.7429 0.9104 0.4004   0.0977       0.4614   0.9531   0.4614
      code/prominence/M-code 12     19.0    19.5    21.0    19.5       17.0           NaN 0.5729 0.5547 0.5946   0.5946       0.5322   0.5946   0.6299
   code/prominence/M-methods 12     19.0    21.5    21.0    14.5       17.0         21.62 0.1001 0.1001 0.0674   0.5447       0.0674   0.8096   0.0674
     code/prominence/M-trial 12     19.0    19.5    20.5    18.0       17.0           NaN 0.6641 0.6641 0.7441   0.6641       0.6641   0.6755   0.6641
       methods/height/M-code 12     46.0    42.5    41.0    40.5       44.5           NaN 0.8328 0.6848 0.2002   0.8328       0.2002   0.9536   0.8328
    methods/height/M-methods 12     46.0    52.0    48.5    27.0       44.5         39.53 0.0057 0.0321 0.0012   0.7451       0.0012   0.3895   0.0012
      methods/height/M-trial 12     46.0    46.5    40.5    39.0       44.5           NaN 0.8295 0.4240 0.1758   0.8295       0.1758   0.3613   0.1758
   methods/prominence/M-code 12     17.5    18.0    17.5    17.0       13.5           NaN 0.2222 0.1113 0.2332   0.1074       0.0977   0.5312   0.4601
methods/prominence/M-methods 12     17.5    19.5    22.0    11.0       13.5         16.15 0.0078 0.0223 0.0223   0.0537       0.0024   0.9150   0.0024
  methods/prominence/M-trial 12     17.5    18.5    17.5    15.0       13.5           NaN 0.0716 0.2188 0.6567   0.1074       0.0391   0.5881   0.3320

Concept, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code  9     37.0    44.0    37.0    41.0       39.0           NaN 0.9297 0.9297 0.9297   0.9297       0.9297   0.9297   0.9297
       code/height/M-methods  9     37.0    53.0    42.0    24.0       39.0         37.52 0.0156 0.0521 0.0098   0.7578       0.0098   0.0781   0.0098
         code/height/M-trial  9     37.0    49.0    39.0    36.0       39.0           NaN 0.1562 0.6684 0.5908   0.7578       0.1172   0.1172   0.1172
      code/prominence/M-code  9     27.0    27.0    25.0    25.0       24.0           NaN 0.9375 0.9375 0.9375   0.9375       0.9375   0.9375   0.9375
   code/prominence/M-methods  9     27.0    34.0    25.0    16.0       24.0         23.06 0.0312 0.7639 0.0195   0.8438       0.0195   0.1395   0.0260
     code/prominence/M-trial  9     27.0    30.0    21.0    22.0       24.0           NaN 0.3516 0.3795 0.3516   0.8438       0.2930   0.2930   0.2930
       methods/height/M-code  5     43.0    44.0    34.0    41.0       40.0           NaN 0.9722 0.9722 0.9722   1.0000       0.9722   0.9722   0.9722
    methods/height/M-methods  5     43.0    51.0    42.0    27.0       40.0         40.44 0.2083 0.2083 0.1562   1.0000       0.1562   0.4464   0.1562
      methods/height/M-trial  5     43.0    45.0    40.0    38.0       40.0           NaN 0.6944 0.6944 0.6944   1.0000       0.6944   0.6944   0.6944
   methods/prominence/M-code  5     26.0    27.0    23.0    20.0       24.0           NaN 0.8333 0.8333 0.6250   1.0000       0.6250   0.8333   0.6250
methods/prominence/M-methods  5     26.0    26.0    24.0    14.0       24.0         20.26 0.5000 1.0000 0.3125   1.0000       0.3125   0.8333   0.3125
  methods/prominence/M-trial  5     26.0    22.0    21.0    21.0       24.0           NaN 1.0000 0.8750 0.8750   1.0000       0.6250   0.8750   0.8750
In [42]:
for (grule, rule, mr), _ in EPB.groupby(["grule", "rule", "mread"]):
    q = {g: epoch_tests(EPB[(EPB.group == g) & (EPB.load == 1) & (EPB.grule == grule) & (EPB.rule == rule) & (EPB.mread == mr)])[0]
         for g in ["HighACG", "LongDecay", "LowACG", "ShortDecay", "Concept"]}
    med = {g: EPB[(EPB.group == g) & (EPB.load == 1) & (EPB.grule == grule) & (EPB.rule == rule) & (EPB.mread == mr)][PER].median()
           for g in ["HighACG", "LongDecay"]}
    hi = {k: bool(q["HighACG"][f"enc-{k}"] < 0.05 and med["HighACG"][k] > med["HighACG"]["enc"]) for k in ["M1", "M2", "probe"]}
    lo = {k: bool(q["LongDecay"][f"enc-{k}"] < 0.05 and med["LongDecay"][k] > med["LongDecay"]["enc"]) for k in ["M1", "M2", "M3"]}
    none = {g: int(sum(v < 0.05 for v in q[g].values())) for g in ["LowACG", "ShortDecay", "Concept"]}
    print(f"{grule}/{rule}/M-{mr}: high ACG up at {hi}; long tau decay up at {lo}; significant pairs in low ACG, short tau decay, concept {none}")
code/height/M-code: high ACG up at {'M1': False, 'M2': False, 'probe': False}; long tau decay up at {'M1': False, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
code/height/M-methods: high ACG up at {'M1': False, 'M2': False, 'probe': False}; long tau decay up at {'M1': True, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 6, 'ShortDecay': 5, 'Concept': 5}
code/height/M-trial: high ACG up at {'M1': False, 'M2': False, 'probe': False}; long tau decay up at {'M1': False, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
code/prominence/M-code: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': True, 'M3': True}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
code/prominence/M-methods: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 4, 'ShortDecay': 0, 'Concept': 5}
code/prominence/M-trial: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
methods/height/M-code: high ACG up at {'M1': False, 'M2': False, 'probe': False}; long tau decay up at {'M1': False, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
methods/height/M-methods: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': False, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 6, 'ShortDecay': 7, 'Concept': 0}
methods/height/M-trial: high ACG up at {'M1': False, 'M2': False, 'probe': False}; long tau decay up at {'M1': False, 'M2': False, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 1, 'ShortDecay': 0, 'Concept': 0}
methods/prominence/M-code: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': True, 'M3': True}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 0, 'Concept': 0}
methods/prominence/M-methods: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': True, 'M3': False}; significant pairs in low ACG, short tau decay, concept {'LowACG': 6, 'ShortDecay': 7, 'Concept': 0}
methods/prominence/M-trial: high ACG up at {'M1': True, 'M2': True, 'probe': False}; long tau decay up at {'M1': True, 'M2': False, 'M3': True}; significant pairs in low ACG, short tau decay, concept {'LowACG': 0, 'ShortDecay': 2, 'Concept': 0}

Result: partially reproduced. With the prominence rule, the code's thirds and the code's groups, long tau decay neurons increase from encoding to M1, M2 and M3 and the low ACG, short tau decay and concept groups have no significant pair, but high ACG neurons increase at M1 and M2 and not at the probe (BH p 0.38). With the Methods' groups and thirds the low ACG and short tau decay groups have 6 and 7 significant pairs, and with the Methods' groups and the code's thirds none. The increases hold for one of the two groups. With the per-trial thirds (M-trial) and the code's groups, high ACG rise at M1 and M2 and long tau decay only at M1, and no reading makes high ACG rise to the probe.

ext2-bursts-loads23¶

The patterns of burst rates across epochs held for loads 2 and 3.

"Similar" read as all cells and the high ACG and long tau decay groups showing more bursts in each maintenance window than in encoding, in the median over participants, at each load (encoding from the last encoding image).

In [43]:
rows = []
for (grule, rule, mr), x0 in EPB.groupby(["grule", "rule", "mread"]):
    for L in [1, 2, 3]:
        ok = {}
        for g in ["All902", "HighACG", "LongDecay"]:
            x = x0[(x0.group == g) & (x0.load == L)]
            med = x[PER].median()
            ok[g] = bool(all(med[k] > med["enc"] for k in ["M1", "M2", "M3"]))
            q, _ = epoch_tests(x)
            ok[g + "_q"] = "/".join(f"{q[f'enc-{k}']:.3f}" for k in ["M1", "M2", "M3", "probe"])
        rows.append({"reading": f"{grule}/{rule}/M-{mr}", "load": L, **ok})
e2 = pd.DataFrame(rows)
print(e2.to_string(index=False))
                     reading  load  All902                All902_q  HighACG               HighACG_q  LongDecay             LongDecay_q
          code/height/M-code     1   False 0.438/0.617/0.438/0.643    False 0.445/0.164/0.078/0.164      False 0.128/0.895/0.128/0.983
          code/height/M-code     2   False 0.616/0.878/0.065/0.790    False 0.989/0.989/0.646/0.646      False 0.988/0.988/0.352/0.988
          code/height/M-code     3   False 0.139/0.847/0.002/0.814    False 0.376/0.844/0.369/0.844      False 0.168/0.168/0.168/0.749
       code/height/M-methods     1   False 0.002/0.004/0.000/0.712    False 0.497/0.507/0.005/0.107      False 0.020/0.130/0.003/0.983
       code/height/M-methods     2   False 0.179/0.178/0.000/0.718    False 0.106/0.070/0.003/0.249      False 0.113/0.113/0.010/0.650
       code/height/M-methods     3   False 0.023/0.012/0.000/0.651    False 0.023/0.156/0.002/0.760      False 0.087/0.411/0.001/0.713
         code/height/M-trial     1   False 0.784/0.953/0.349/0.953    False 0.643/0.320/0.288/0.320      False 0.812/0.812/0.812/0.983
         code/height/M-trial     2   False 0.702/0.316/0.084/0.702    False 0.947/0.947/0.560/0.560      False 0.717/0.717/0.529/0.717
         code/height/M-trial     3   False 0.865/0.952/0.344/0.930    False 0.558/0.339/0.368/0.760      False 1.000/0.863/0.863/0.863
      code/prominence/M-code     1    True 0.000/0.000/0.000/0.680     True 0.002/0.010/0.026/0.379       True 0.019/0.019/0.010/0.859
      code/prominence/M-code     2    True 0.000/0.000/0.000/0.115     True 0.016/0.007/0.007/0.394      False 0.540/0.420/0.667/0.578
      code/prominence/M-code     3    True 0.001/0.001/0.001/0.547     True 0.016/0.007/0.069/0.345      False 0.109/0.081/0.213/0.539
   code/prominence/M-methods     1    True 0.000/0.000/0.035/0.612    False 0.013/0.013/0.175/0.421       True 0.005/0.083/0.803/0.803
   code/prominence/M-methods     2    True 0.001/0.001/0.034/0.090     True 0.007/0.008/0.481/0.394      False 0.127/0.199/0.129/0.450
   code/prominence/M-methods     3    True 0.000/0.000/0.021/0.608     True 0.005/0.066/0.245/0.311      False 0.036/0.143/0.469/0.469
     code/prominence/M-trial     1    True 0.001/0.001/0.001/0.680     True 0.030/0.030/0.023/0.379       True 0.010/0.210/0.081/0.719
     code/prominence/M-trial     2    True 0.001/0.001/0.001/0.115     True 0.018/0.021/0.005/0.394      False 0.441/0.470/0.657/0.470
     code/prominence/M-trial     3    True 0.001/0.001/0.001/0.608     True 0.007/0.257/0.017/0.311      False 0.193/1.000/0.029/0.539
       methods/height/M-code     1   False 0.438/0.617/0.438/0.643    False 0.554/0.348/0.078/0.348      False 0.346/0.568/0.091/0.833
       methods/height/M-code     2   False 0.616/0.878/0.065/0.790    False 0.979/0.186/0.815/0.815      False 1.000/0.831/0.572/0.348
       methods/height/M-code     3   False 0.139/0.847/0.002/0.814    False 0.388/0.388/0.020/0.388      False 0.942/0.578/0.578/0.942
    methods/height/M-methods     1   False 0.002/0.004/0.000/0.712    False 0.017/0.034/0.001/0.271      False 0.070/0.070/0.002/0.833
    methods/height/M-methods     2   False 0.179/0.178/0.000/0.718    False 0.111/0.111/0.003/0.420      False 0.243/0.287/0.005/0.203
    methods/height/M-methods     3   False 0.023/0.012/0.000/0.651    False 0.073/0.530/0.002/0.252      False 0.080/0.125/0.012/0.848
      methods/height/M-trial     1   False 0.784/0.953/0.349/0.953    False 0.829/0.406/0.068/0.406      False 0.778/0.729/0.778/0.833
      methods/height/M-trial     2   False 0.702/0.316/0.084/0.702    False 0.947/0.440/0.244/0.472      False 0.925/0.759/0.685/0.339
      methods/height/M-trial     3   False 0.865/0.952/0.344/0.930    False 1.000/0.020/0.167/0.448      False 0.942/0.942/0.942/0.942
   methods/prominence/M-code     1    True 0.000/0.000/0.000/0.680     True 0.002/0.002/0.002/0.240       True 0.002/0.002/0.003/0.867
   methods/prominence/M-code     2    True 0.000/0.000/0.000/0.115     True 0.001/0.001/0.001/1.000       True 0.010/0.023/0.023/0.484
   methods/prominence/M-code     3    True 0.001/0.001/0.001/0.547     True 0.001/0.001/0.006/1.000       True 0.062/0.024/0.025/0.600
methods/prominence/M-methods     1    True 0.000/0.000/0.035/0.612     True 0.001/0.002/0.293/0.240       True 0.002/0.034/0.159/0.867
methods/prominence/M-methods     2    True 0.001/0.001/0.034/0.090     True 0.002/0.002/0.052/0.999      False 0.020/0.020/0.601/0.553
methods/prominence/M-methods     3    True 0.000/0.000/0.021/0.608     True 0.005/0.007/0.010/1.000       True 0.022/0.022/0.258/0.420
  methods/prominence/M-trial     1    True 0.001/0.001/0.001/0.680     True 0.002/0.003/0.020/0.216       True 0.005/0.107/0.010/0.867
  methods/prominence/M-trial     2    True 0.001/0.001/0.001/0.115     True 0.002/0.002/0.002/0.999       True 0.057/0.072/0.049/0.553
  methods/prominence/M-trial     3    True 0.001/0.001/0.001/0.608     True 0.005/0.013/0.003/1.000       True 0.135/0.322/0.024/0.467

Result: reproduced. Under the Methods' groups with the prominence rule, with the code's thirds and with the per-trial thirds, all cells, high ACG and long tau decay neurons have more bursts in each maintenance window than in encoding at loads 2 and 3, as at load 1; with the Methods' 1 s windows long tau decay does not at load 2. Under the code's groups the long tau decay group does not at loads 2 and 3; under the height rule the pattern does not hold.

Fit-dependent groups: stability, and decay groups from the shipped tau decay¶

The low and high ACG and short and long tau decay groups, and the PY and IN groups, are built from the ACG fit. The cell below rebuilds every group from each fit variant of the acg-fit-yield check, and from the main features with tau decay replaced by the code's shipped MATLAB value (Cell_metrics.xlsx, column Decay, an outside input used for comparison only), and reruns the encoding (fig4c), 2.8 s and own maintenance (fig4d, fig4-acg-group-differences) and epoch (fig4hj, ext2) analyses for the groups that change, with the real threshold, each group's seed unchanged.

In [44]:
VAR = {k: (F, TYPESV[k]) for k, F in FEATV.items() if k != "main"}
VAR["shipped tau decay"] = (FEAT["a"].assign(tau_decay=SHIP_CM["Decay"].values), TY)
GRV = {}
for vname, (F, ty) in VAR.items():
    for grule in ["code", "methods"]:
        G = wm.burst_groups(NT, F, CONCEPT, ty, grule)
        GRV[(vname, grule)] = G
        ov = {g: f"{sum(len(set(G[g].get(s, [])) & set(GR[grule][g].get(s, []))) for s in GR[grule][g])}/{sum(len(v) for v in GR[grule][g].values())}"
              for g in ["LowACG", "HighACG", "ShortDecay", "LongDecay", "PY", "IN"]}
        print(f"{vname}, {grule} groups: neurons shared with the main groups {ov}")
RCONF = [c for c in CONFIGS if c[2] == "real"]
jobs, keys = [], []
for (vname, grule), G in GRV.items():
    for g in FAM:
        if G[g] == GR[grule][g]:
            continue
        for rule, dist, thr in RCONF:
            for epoch, key, win in [("enc", "enc", 1.0), ("maint", "maint28", 2.8), ("maint_own", "maint28", 2.8)]:
                for sub, nids in G[g].items():
                    jobs.append(([EP[(n, 1, key)] for n in nids], win, wm.stable_seed(g, sub, epoch, rule, dist, thr, grule),
                                 rule, dist, thr, MDUR[sub] if epoch == "maint_own" else None))
                    keys.append(dict(variant=vname, grule=grule, rule=rule, dist=dist, thr=thr, epoch=epoch, group=g, sub=sub))
res = wm.pmap(wm.group_bursts_seeded, jobs)
NEW = pd.DataFrame([dict(**k, real=r[0], sur=r[1]) for k, r in zip(keys, res)])
print(f"{len(jobs)} group bursts rerun")


def variant_br(vname):
    """The burst table of a variant: rerun rows for the groups that change, the main rows otherwise."""
    new = NEW[NEW.variant == vname].drop(columns="variant")
    keep = BR[BR.thr == "real"].merge(new[["grule", "group"]].drop_duplicates(), how="left", indicator=True)
    return pd.concat([keep[keep._merge == "left_only"].drop(columns="_merge"), new], ignore_index=True)


def acg_four(df):
    out = {}
    for e in ["enc", "maint"]:
        x = df[df.epoch == e].pivot(index="sub", columns="group", values="real")
        for a, b in [("LowACG", "HighACG"), ("ShortDecay", "LongDecay")]:
            xx = x[[a, b]].dropna()
            out[(e, a)] = (xx[a].median(), xx[b].median(), wilcoxon(xx[b], xx[a], zero_method="wilcox").pvalue)
    return out


rows = []
for vname in ["main"] + list(VAR):
    df0 = BR[BR.thr == "real"] if vname == "main" else variant_br(vname)
    for (grule, rule, dist), df in df0.groupby(["grule", "rule", "dist"]):
        o = real_vs_null(df[df.epoch == "enc"], FAM, ())
        named, others = fig4c_rule(o)
        ok, pc = fig4d_rule(real_vs_null(df[df.epoch == "maint_own"], FAM, ()))
        r = {"variant": vname, "reading": f"{grule}/{rule}/d{dist}/real",
             "4c named": named, "4c others": ",".join(others) or "-",
             "4c LowACG q": round(float(o[o.group == "LowACG"].p_BH.iloc[0]), 4),
             "4d five": all(ok.values()), "4d fail": ",".join(k for k, v in ok.items() if not v) or "-",
             "4d concept q": round(pc, 3)}
        if dist == 2:
            a4 = acg_four(df)
            r.update({"low>high enc p": round(a4[("enc", "LowACG")][2], 4) if a4[("enc", "LowACG")][0] > a4[("enc", "LowACG")][1] else "lower",
                      "low>high maint p": round(a4[("maint", "LowACG")][2], 4) if a4[("maint", "LowACG")][0] > a4[("maint", "LowACG")][1] else "lower",
                      "short>long enc p": round(a4[("enc", "ShortDecay")][2], 4) if a4[("enc", "ShortDecay")][0] > a4[("enc", "ShortDecay")][1] else "lower",
                      "short-long maint p": round(a4[("maint", "ShortDecay")][2], 4)})
        rows.append(r)
print(pd.DataFrame(rows).to_string(index=False))

# Epoch analyses (fig4hj, ext2) for the variants' changed ACG and decay groups.
erows = []
for (vname, grule), G in GRV.items():
    for g in ["HighACG", "LongDecay", "LowACG", "ShortDecay"]:
        for rule in ["prominence", "height"]:
            for mr in ["methods", "code", "trial"]:
                for L in [1, 2, 3]:
                    for sub, nids in G[g].items():
                        c = wm.epoch_burst_counts({"enc": [EP[(n, L, "enc")] for n in nids],
                                                   "maint": [EP[(n, L, "maint3")] for n in nids],
                                                   "probe": [EP[(n, L, "probe")] for n in nids]}, rule, 2, mr,
                                                  mdurs=T[sub][T[sub].load == L].maint_dur.values)
                        erows.append(dict(variant=vname, grule=grule, rule=rule, mread=mr, load=L, group=g, sub=sub, **c))
EPV = pd.concat([EPB.assign(variant="main"), pd.DataFrame(erows)], ignore_index=True)
rows = []
for (vname, grule, rule, mr), x0 in EPV.groupby(["variant", "grule", "rule", "mread"], sort=False):
    q = {g: epoch_tests(x0[(x0.group == g) & (x0.load == 1)])[0] for g in ["HighACG", "LongDecay", "LowACG", "ShortDecay"]}
    med = {g: x0[(x0.group == g) & (x0.load == 1)][PER].median() for g in ["HighACG", "LongDecay"]}
    hi = [k for k in ["M1", "M2", "probe"] if q["HighACG"][f"enc-{k}"] < 0.05 and med["HighACG"][k] > med["HighACG"]["enc"]]
    lo = [k for k in ["M1", "M2", "M3"] if q["LongDecay"][f"enc-{k}"] < 0.05 and med["LongDecay"][k] > med["LongDecay"]["enc"]]
    e2 = {}
    for g in ["HighACG", "LongDecay"]:
        e2[g] = all(all(x0[(x0.group == g) & (x0.load == L)][k].median() > x0[(x0.group == g) & (x0.load == L)]["enc"].median()
                        for k in ["M1", "M2", "M3"]) for L in [1, 2, 3])
    rows.append({"variant": vname, "reading": f"{grule}/{rule}/M-{mr}", "4hj high ACG up at": ",".join(hi) or "-",
                 "4hj long decay up at": ",".join(lo) or "-",
                 "4hj sig pairs low ACG, short decay": f"{sum(v < 0.05 for v in q['LowACG'].values())}, {sum(v < 0.05 for v in q['ShortDecay'].values())}",
                 "ext2 high ACG": e2["HighACG"], "ext2 long decay": e2["LongDecay"]})
print(pd.DataFrame(rows).to_string(index=False))
start x (1 + 1e-9), code groups: neurons shared with the main groups {'LowACG': '71/72', 'HighACG': '72/72', 'ShortDecay': '70/72', 'LongDecay': '72/72', 'PY': '94/95', 'IN': '214/215'}
start x (1 + 1e-9), methods groups: neurons shared with the main groups {'LowACG': '131/132', 'HighACG': '132/132', 'ShortDecay': '131/132', 'LongDecay': '132/132', 'PY': '94/95', 'IN': '214/215'}
start x (1 - 1e-9), code groups: neurons shared with the main groups {'LowACG': '71/72', 'HighACG': '72/72', 'ShortDecay': '70/72', 'LongDecay': '72/72', 'PY': '94/95', 'IN': '215/215'}
start x (1 - 1e-9), methods groups: neurons shared with the main groups {'LowACG': '131/132', 'HighACG': '132/132', 'ShortDecay': '131/132', 'LongDecay': '132/132', 'PY': '94/95', 'IN': '215/215'}
ACG x (1 + 1e-12), code groups: neurons shared with the main groups {'LowACG': '70/72', 'HighACG': '72/72', 'ShortDecay': '69/72', 'LongDecay': '72/72', 'PY': '93/95', 'IN': '212/215'}
ACG x (1 + 1e-12), methods groups: neurons shared with the main groups {'LowACG': '130/132', 'HighACG': '132/132', 'ShortDecay': '130/132', 'LongDecay': '132/132', 'PY': '93/95', 'IN': '212/215'}
shipped tau decay, code groups: neurons shared with the main groups {'LowACG': '72/72', 'HighACG': '72/72', 'ShortDecay': '48/72', 'LongDecay': '49/72', 'PY': '95/95', 'IN': '215/215'}
shipped tau decay, methods groups: neurons shared with the main groups {'LowACG': '132/132', 'HighACG': '132/132', 'ShortDecay': '107/132', 'LongDecay': '110/132', 'PY': '95/95', 'IN': '215/215'}
4944 group bursts rerun
           variant                    reading  4c named                    4c others  4c LowACG q  4d five                             4d fail  4d concept q low>high enc p low>high maint p  short>long enc p  short-long maint p
              main        code/height/d1/real     False                            -       0.7764    False           LowACG,HighACG,ShortDecay         0.244            NaN              NaN               NaN                 NaN
              main        code/height/d2/real     False                            -       0.6857    False LowACG,HighACG,ShortDecay,LongDecay         0.244          lower            lower            0.1846              1.0000
              main    code/prominence/d1/real      True                      Concept       0.0204    False                  HighACG,ShortDecay         0.953            NaN              NaN               NaN                 NaN
              main    code/prominence/d2/real      True                      Concept       0.0161    False                  HighACG,ShortDecay         0.953         0.0005           0.0005            0.1401              0.8677
              main     methods/height/d1/real      True                            -       0.0385    False                             HighACG         0.893            NaN              NaN               NaN                 NaN
              main     methods/height/d2/real      True                            -       0.0483    False                             HighACG         0.686          lower            lower            0.2021              0.2246
              main methods/prominence/d1/real      True HighACG,ShortDecay,LongDecay       0.0044     True                                   -         0.225            NaN              NaN               NaN                 NaN
              main methods/prominence/d2/real      True HighACG,ShortDecay,LongDecay       0.0057     True                                   -         0.345         0.0005           0.0005            0.0859              0.8125
start x (1 + 1e-9)        code/height/d1/real     False                            -       0.7772    False           LowACG,HighACG,ShortDecay         0.244            NaN              NaN               NaN                 NaN
start x (1 + 1e-9)        code/height/d2/real     False                            -       0.7683    False LowACG,HighACG,ShortDecay,LongDecay         0.244          lower            lower            0.1748              1.0000
start x (1 + 1e-9)    code/prominence/d1/real      True                      Concept       0.0204    False                  HighACG,ShortDecay         0.953            NaN              NaN               NaN                 NaN
start x (1 + 1e-9)    code/prominence/d2/real      True                      Concept       0.0161    False                  HighACG,ShortDecay         0.953         0.0005           0.0005            0.1665              0.7334
start x (1 + 1e-9)     methods/height/d1/real      True                            -       0.0483    False                             HighACG         0.893            NaN              NaN               NaN                 NaN
start x (1 + 1e-9)     methods/height/d2/real     False                            -       0.0601    False                             HighACG         0.686          lower            lower            0.1792              0.3291
start x (1 + 1e-9) methods/prominence/d1/real      True HighACG,ShortDecay,LongDecay       0.0044     True                                   -         0.225            NaN              NaN               NaN                 NaN
start x (1 + 1e-9) methods/prominence/d2/real      True HighACG,ShortDecay,LongDecay       0.0057     True                                   -         0.345         0.0005           0.0005            0.0859              0.8125
start x (1 - 1e-9)        code/height/d1/real     False                            -       0.5208    False           LowACG,HighACG,ShortDecay         0.244            NaN              NaN               NaN                 NaN
start x (1 - 1e-9)        code/height/d2/real     False                            -       0.4786    False LowACG,HighACG,ShortDecay,LongDecay         0.244          lower            lower            0.0977              0.6904
start x (1 - 1e-9)    code/prominence/d1/real      True                      Concept       0.0099    False                  HighACG,ShortDecay         0.953            NaN              NaN               NaN                 NaN
start x (1 - 1e-9)    code/prominence/d2/real      True                      Concept       0.0077    False                  HighACG,ShortDecay         0.953         0.0005           0.0005            0.1172              0.8984
start x (1 - 1e-9)     methods/height/d1/real      True                            -       0.0385    False                             HighACG         0.893            NaN              NaN               NaN                 NaN
start x (1 - 1e-9)     methods/height/d2/real      True                            -       0.0385    False                             HighACG         0.686          lower            lower            0.3081              0.2256
start x (1 - 1e-9) methods/prominence/d1/real      True HighACG,ShortDecay,LongDecay       0.0044     True                                   -         0.225            NaN              NaN               NaN                 NaN
start x (1 - 1e-9) methods/prominence/d2/real      True HighACG,ShortDecay,LongDecay       0.0057     True                                   -         0.345         0.0005           0.0005            0.0615              0.6406
 ACG x (1 + 1e-12)        code/height/d1/real     False                            -       0.6924    False           LowACG,HighACG,ShortDecay         0.244            NaN              NaN               NaN                 NaN
 ACG x (1 + 1e-12)        code/height/d2/real     False                            -       0.5544    False LowACG,HighACG,ShortDecay,LongDecay         0.244          lower            lower            0.0977              0.7495
 ACG x (1 + 1e-12)    code/prominence/d1/real      True                      Concept       0.0099    False                  HighACG,ShortDecay         0.953            NaN              NaN               NaN                 NaN
 ACG x (1 + 1e-12)    code/prominence/d2/real      True                      Concept       0.0077    False                  HighACG,ShortDecay         0.953         0.0005           0.0005            0.1621              0.8311
 ACG x (1 + 1e-12)     methods/height/d1/real      True                            -       0.0483    False                             HighACG         0.893            NaN              NaN               NaN                 NaN
 ACG x (1 + 1e-12)     methods/height/d2/real      True                            -       0.0483    False                             HighACG         0.686          lower            lower            0.2510              0.3262
 ACG x (1 + 1e-12) methods/prominence/d1/real      True HighACG,ShortDecay,LongDecay       0.0044     True                                   -         0.225            NaN              NaN               NaN                 NaN
 ACG x (1 + 1e-12) methods/prominence/d2/real      True HighACG,ShortDecay,LongDecay       0.0057     True                                   -         0.345         0.0005           0.0005            0.0615              0.6406
 shipped tau decay        code/height/d1/real     False                            -       0.6211    False LowACG,HighACG,ShortDecay,LongDecay         0.214            NaN              NaN               NaN                 NaN
 shipped tau decay        code/height/d2/real     False                            -       0.5485    False LowACG,HighACG,ShortDecay,LongDecay         0.214          lower            lower            0.1289              0.9482
 shipped tau decay    code/prominence/d1/real      True                      Concept       0.0204    False                  HighACG,ShortDecay         0.953            NaN              NaN               NaN                 NaN
 shipped tau decay    code/prominence/d2/real      True                      Concept       0.0161    False                             HighACG         0.953         0.0005           0.0005            0.0078              0.0737
 shipped tau decay     methods/height/d1/real      True                            -       0.0385    False                             HighACG         0.893            NaN              NaN               NaN                 NaN
 shipped tau decay     methods/height/d2/real      True                            -       0.0483    False                             HighACG         0.686          lower            lower            0.2695              0.6626
 shipped tau decay methods/prominence/d1/real      True           HighACG,ShortDecay       0.0059     True                                   -         0.225            NaN              NaN               NaN                 NaN
 shipped tau decay methods/prominence/d2/real      True                   ShortDecay       0.0077     True                                   -         0.345         0.0005           0.0005            0.0156              0.3491
           variant                      reading 4hj high ACG up at 4hj long decay up at 4hj sig pairs low ACG, short decay  ext2 high ACG  ext2 long decay
              main    code/prominence/M-methods              M1,M2                   M1                               4, 0          False            False
              main       code/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True            False
              main      code/prominence/M-trial              M1,M2                   M1                               0, 0           True            False
              main        code/height/M-methods                  -                   M1                               6, 5          False            False
              main           code/height/M-code                  -                    -                               0, 0          False            False
              main          code/height/M-trial                  -                    -                               0, 0          False            False
              main methods/prominence/M-methods              M1,M2                M1,M2                               6, 7           True            False
              main    methods/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True             True
              main   methods/prominence/M-trial              M1,M2                M1,M3                               0, 2           True             True
              main     methods/height/M-methods              M1,M2                    -                               6, 7          False            False
              main        methods/height/M-code                  -                    -                               0, 0          False            False
              main       methods/height/M-trial                  -                    -                               1, 0          False            False
start x (1 + 1e-9)    code/prominence/M-methods              M1,M2                   M1                               6, 0          False            False
start x (1 + 1e-9)       code/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True            False
start x (1 + 1e-9)      code/prominence/M-trial              M1,M2                   M1                               0, 0           True            False
start x (1 + 1e-9)        code/height/M-methods                  -                   M1                               6, 5          False            False
start x (1 + 1e-9)           code/height/M-code                  -                    -                               0, 0          False            False
start x (1 + 1e-9)          code/height/M-trial                  -                    -                               0, 0          False            False
start x (1 + 1e-9) methods/prominence/M-methods              M1,M2                M1,M2                               6, 8           True            False
start x (1 + 1e-9)    methods/prominence/M-code              M1,M2             M1,M2,M3                               0, 4           True             True
start x (1 + 1e-9)   methods/prominence/M-trial              M1,M2                M1,M3                               0, 2           True             True
start x (1 + 1e-9)     methods/height/M-methods              M1,M2                    -                               6, 7          False            False
start x (1 + 1e-9)        methods/height/M-code                  -                    -                               0, 0          False            False
start x (1 + 1e-9)       methods/height/M-trial                  -                    -                               1, 0          False            False
start x (1 - 1e-9)    code/prominence/M-methods              M1,M2                   M1                               4, 0          False            False
start x (1 - 1e-9)       code/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True            False
start x (1 - 1e-9)      code/prominence/M-trial              M1,M2                   M1                               0, 0           True            False
start x (1 - 1e-9)        code/height/M-methods                  -                   M1                               4, 5          False            False
start x (1 - 1e-9)           code/height/M-code                  -                    -                               0, 0          False            False
start x (1 - 1e-9)          code/height/M-trial                  -                    -                               0, 0          False            False
start x (1 - 1e-9) methods/prominence/M-methods              M1,M2                M1,M2                               6, 7           True            False
start x (1 - 1e-9)    methods/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True             True
start x (1 - 1e-9)   methods/prominence/M-trial              M1,M2                M1,M3                               0, 2           True             True
start x (1 - 1e-9)     methods/height/M-methods              M1,M2                    -                               6, 6          False            False
start x (1 - 1e-9)        methods/height/M-code                  -                    -                               0, 0          False            False
start x (1 - 1e-9)       methods/height/M-trial                  -                    -                               2, 0          False            False
 ACG x (1 + 1e-12)    code/prominence/M-methods              M1,M2                   M1                               6, 0          False            False
 ACG x (1 + 1e-12)       code/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True            False
 ACG x (1 + 1e-12)      code/prominence/M-trial              M1,M2                   M1                               0, 0           True            False
 ACG x (1 + 1e-12)        code/height/M-methods                  -                   M1                               4, 5          False            False
 ACG x (1 + 1e-12)           code/height/M-code                  -                    -                               0, 0          False            False
 ACG x (1 + 1e-12)          code/height/M-trial                  -                    -                               0, 0          False            False
 ACG x (1 + 1e-12) methods/prominence/M-methods              M1,M2                M1,M2                               6, 8           True            False
 ACG x (1 + 1e-12)    methods/prominence/M-code              M1,M2             M1,M2,M3                               0, 1           True             True
 ACG x (1 + 1e-12)   methods/prominence/M-trial              M1,M2                M1,M3                               0, 2           True             True
 ACG x (1 + 1e-12)     methods/height/M-methods              M1,M2                    -                               6, 6          False            False
 ACG x (1 + 1e-12)        methods/height/M-code                  -                    -                               0, 0          False            False
 ACG x (1 + 1e-12)       methods/height/M-trial                  -                    -                               2, 0          False            False
 shipped tau decay    code/prominence/M-methods              M1,M2                   M1                               4, 4          False            False
 shipped tau decay       code/prominence/M-code              M1,M2             M1,M2,M3                               0, 0           True            False
 shipped tau decay      code/prominence/M-trial              M1,M2                    -                               0, 0           True            False
 shipped tau decay        code/height/M-methods                  -                    -                               6, 4          False            False
 shipped tau decay           code/height/M-code                  -                    -                               0, 0          False            False
 shipped tau decay          code/height/M-trial                  -                    -                               0, 0          False            False
 shipped tau decay methods/prominence/M-methods              M1,M2                M1,M2                               6, 6           True            False
 shipped tau decay    methods/prominence/M-code              M1,M2             M1,M2,M3                               0, 2           True             True
 shipped tau decay   methods/prominence/M-trial              M1,M2                M1,M3                               0, 3           True             True
 shipped tau decay     methods/height/M-methods              M1,M2                   M1                               6, 6          False            False
 shipped tau decay        methods/height/M-code                  -                    -                               0, 0          False            False
 shipped tau decay       methods/height/M-trial                  -                    -                               1, 0          False            False

Result (stability check). The fit variants change 0 to 3 neurons in each ACG, tau decay and cell-type group; the shipped tau decay changes the decay groups more (48 and 49 of 72 neurons kept in the code's short and long groups, 107 and 110 of 132 in the Methods'). fig4c: the Methods' groups with the height rule and a spacing of 1 bin give the paper's pattern under the main fit, under each of the three fit variants and with the shipped tau decay (low ACG BH p 0.0385 to 0.0483); with a spacing of 2 bins they give it under the main fit, two of the fit variants and the shipped tau decay (0.0385 to 0.0483) but not under the start point x (1 + 1e-9) (0.0601). So fig4c holds with the 1-bin spacing under every fit, and with the 2-bin spacing it depends on rounding. fig4d: with the Methods' groups and the prominence rule the five named groups exceed the null over each trial's own maintenance under every variant, and concept cells do not (BH p 0.225 and 0.345). fig4-acg-group-differences: with this attempt's tau decay, short does not exceed long in encoding under the prominence rule for any fit (p 0.06 to 0.17); with the shipped tau decay it does (p 0.0078 with the code's groups, 0.0156 with the Methods'), while low ACG exceeds high ACG in both epochs (p 0.0005) and short and long do not differ in maintenance (p 0.074 and 0.35). With the paper's own tau decay the claim's whole pattern appears, so its shortfall here may come from this attempt's fit; the shipped values are an outside input used for comparison only, and the outcome is not changed. fig4hj: under every variant high ACG never rise to the probe, and with the code's groups and thirds long tau decay rise at M1, M2 and M3 and low ACG and short tau decay have no significant pair. ext2: with the Methods' groups and the prominence rule high ACG and long tau decay exceed encoding at every load with the code's thirds and with the per-trial thirds under every variant; with the Methods' 1 s windows long tau decay fails under the main fit, the three fit variants and the shipped tau decay.

fig5kl-concept-cell-types¶

Of the classified concept cells, 11 were putative pyramidal and 14 putative interneurons; pyramidal concept cells showed pronounced bursting, interneuron concept cells smoother regular spiking.

In [45]:
for reading in ["a", "b"]:
    ty = TYPES[reading]
    F = FEAT[reading]
    py, inn = CONCEPT & (ty == "PY"), CONCEPT & (ty == "IN")
    print(f"reading ({reading}): concept cells PY {py.sum()}, IN {inn.sum()}, unclassified {CONCEPT.sum() - py.sum() - inn.sum()}; "
          f"Royer burst index median PY {F.burst_royer[py].median():.3f}, IN {F.burst_royer[inn].median():.3f}; "
          f"ISI CV median PY {F.cv_isi[py].median():.3f}, IN {F.cv_isi[inn].median():.3f}; "
          f"Holt CV2 median PY {F.cv2_holt[py].median():.3f}, IN {F.cv2_holt[inn].median():.3f}")
print("paper: PY 11 (9.9 to 12.1), IN 14 (12.6 to 15.4)")
reading (a): concept cells PY 11, IN 16, unclassified 31; Royer burst index median PY 0.992, IN 0.424; ISI CV median PY 1.773, IN 1.259; Holt CV2 median PY 1.198, IN 0.994
reading (b): concept cells PY 11, IN 14, unclassified 33; Royer burst index median PY 0.949, IN 0.390; ISI CV median PY 2.690, IN 4.617; Holt CV2 median PY 1.217, IN 0.991
paper: PY 11 (9.9 to 12.1), IN 14 (12.6 to 15.4)

Result: reproduced. Under reading (b) of the types, 11 concept cells are PY and 14 IN, the paper's counts, and PY concept cells have the higher Royer burst index (median 0.949 against 0.390) and Holt CV2 (1.217 against 0.991). Under reading (a) the counts are 11 and 16, IN just above tolerance (12.6 to 15.4), with the same ordering (burst index 0.992 against 0.424, CV2 1.198 against 0.994).

fig6ab-celltype-bursts-vs-null¶

Pyramidal populations showed elevated bursting over a null in both encoding and maintenance, whereas interneurons showed elevated bursting during maintenance but not during encoding.

Null readings: (a) the Poisson surrogates of fig4c (the PY and IN rows of its tables, BH over the code's eight groups); (b) shuffling the cell-type labels among each participant's classified neurons, group sizes kept (100 shuffles), BH over the two groups.

In [46]:
CT6 = []
for types_reading, fam, names in [("a", FAM, ["PY", "IN"]), ("b", FAM_B, ["PY_b", "IN_b"])]:
    for epoch in ["enc", "maint", "maint_own"]:
        tab = BURST_ENC if epoch == "enc" else (BURST_M if epoch == "maint" else BURST_MO)
        if types_reading == "b":
            tab = show_bursts(epoch, FAM_B)
        x = tab[tab.group.isin(names)]
        CT6.append(x.assign(types=types_reading, epoch=epoch))
        print(f"(a) Poisson null, types ({types_reading}), {epoch}:")
        print(x[["reading", "group", "n", "real_median", "null_median", "real_above", "W", "p", "p_BH"]].round(4).to_string(index=False))
CT6 = pd.concat(CT6)
for (types_reading, reading), x in CT6.groupby(["types", "reading"], sort=False):
    q = {(e, g[:2]): float(x[(x.epoch == e) & (x.group.str[:2] == g[:2])].p_BH.iloc[0]) for e in ["enc", "maint", "maint_own"] for g in ["PY", "IN"]}
    above = {(e, g[:2]): bool(x[(x.epoch == e) & (x.group.str[:2] == g[:2])].real_median.iloc[0] > x[(x.epoch == e) & (x.group.str[:2] == g[:2])].null_median.iloc[0])
             for e in ["enc", "maint", "maint_own"] for g in ["PY", "IN"]}
    for me in ["maint", "maint_own"]:
        ok = (q[("enc", "PY")] < 0.05 and above[("enc", "PY")] and q[(me, "PY")] < 0.05 and above[(me, "PY")]
              and q[(me, "IN")] < 0.05 and above[(me, "IN")] and q[("enc", "IN")] >= 0.05)
        print(f"types ({types_reading}), {reading}, maintenance as {me}: paper's pattern {ok}; BH p PY enc {q[('enc', 'PY')]:.4f}, "
              f"PY maint {q[(me, 'PY')]:.4f}, IN maint {q[(me, 'IN')]:.4f}, IN enc {q[('enc', 'IN')]:.4f}")
rows = []
for types_reading in ["a", "b"]:
    ty_r = TYPES[types_reading]
    for epoch, key, win in [("enc", "enc", 1.0), ("maint", "maint28", 2.8)]:
        subs = sorted(set(NT["sub"].values[[n for n in range(len(NT)) if ty_r[n] in ("PY", "IN")]]))
        for sub in subs:
            nids = NT.nid[NT["sub"] == sub].values
            pyn = [n for n in nids if ty_r[n] == "PY"]
            inn = [n for n in nids if ty_r[n] == "IN"]
            if len(pyn) == 0 or len(inn) == 0:
                continue
            rng = np.random.default_rng(wm.stable_seed("typeshuffle", epoch, sub) if types_reading == "a" else wm.stable_seed("typeshuffle", epoch, sub, "b"))
            npy, nin = wm.type_shuffle_null([EP[(n, 1, key)] for n in pyn], [EP[(n, 1, key)] for n in inn], win, rng)
            for g, nl, members in [("PY", npy, pyn), ("IN", nin, inn)]:
                if len(members) >= 3:
                    rc, _, _, _ = wm.group_bursts([EP[(n, 1, key)] for n in members], win, rng, "prominence", 2, "real", n_sur=0)
                    rows.append({"types": types_reading, "epoch": epoch, "group": g, "sub": sub, "real": rc, "sur": nl})
SH = pd.DataFrame(rows)
for types_reading in ["a", "b"]:
    for epoch in ["enc", "maint"]:
        o = real_vs_null(SH[(SH.epoch == epoch) & (SH.types == types_reading)], groups=["PY", "IN"], extra=())
        print(f"(b) label-shuffled null, types ({types_reading}), {epoch}:")
        print(o.round(4).to_string(index=False))
(a) Poisson null, types (a), enc:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real    PY 12         41.0         34.6           8 11.0 0.0281 0.1122
       code/height/d1/real    IN 19         41.0         38.4          10 85.0 0.6874 0.7856
        code/height/d2/own    PY 12         41.0         42.5           7 32.0 0.5829 0.6662
        code/height/d2/own    IN 19         41.0         44.3           5 49.0 0.0641 0.2848
       code/height/d2/real    PY 12         41.0         34.6           9 11.0 0.0281 0.1122
       code/height/d2/real    IN 19         41.0         37.8          10 84.0 0.6580 0.7942
   code/prominence/d1/real    PY 12         29.0         20.1          12  0.0 0.0022 0.0089
   code/prominence/d1/real    IN 19         11.0          6.9          14 34.5 0.0149 0.0298
    code/prominence/d2/own    PY 12         29.0         23.3          11  1.0 0.0029 0.0115
    code/prominence/d2/own    IN 19         11.0          7.6          15 28.0 0.0070 0.0140
   code/prominence/d2/real    PY 12         29.0         19.7          12  0.0 0.0022 0.0089
   code/prominence/d2/real    IN 19         11.0          7.2          14 31.0 0.0100 0.0200
    methods/height/d1/real    PY 12         41.0         34.9           8 10.0 0.0229 0.0611
    methods/height/d1/real    IN 19         41.0         38.1          10 86.0 0.7172 0.8197
     methods/height/d2/own    PY 12         41.0         42.2           7 25.0 0.2721 0.5176
     methods/height/d2/own    IN 19         41.0         43.6           6 48.0 0.0586 0.4686
    methods/height/d2/real    PY 12         41.0         33.8           8 12.0 0.0342 0.0911
    methods/height/d2/real    IN 19         41.0         38.1          10 80.0 0.5461 0.6662
methods/prominence/d1/real    PY 12         29.0         19.8          12  0.0 0.0022 0.0044
methods/prominence/d1/real    IN 19         11.0          7.1          14 34.0 0.0141 0.0226
 methods/prominence/d2/own    PY 12         29.0         22.7          11  1.0 0.0029 0.0077
 methods/prominence/d2/own    IN 19         11.0          8.0          15 28.0 0.0070 0.0140
methods/prominence/d2/real    PY 12         29.0         20.0          12  0.0 0.0022 0.0057
methods/prominence/d2/real    IN 19         11.0          6.9          14 35.0 0.0158 0.0252
(a) Poisson null, types (a), maint:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real    PY 12         85.5         65.1          12  0.0 0.0022 0.0044
       code/height/d1/real    IN 19         92.0         69.7          16  9.0 0.0005 0.0022
        code/height/d2/own    PY 12         85.5         88.9           5 38.0 0.9375 0.9375
        code/height/d2/own    IN 19         92.0         99.2           6 48.0 0.0586 0.1990
       code/height/d2/real    PY 12         85.5         64.6          12  0.0 0.0022 0.0044
       code/height/d2/real    IN 19         92.0         69.8          17  8.0 0.0005 0.0019
   code/prominence/d1/real    PY 12         62.5         43.8          12  0.0 0.0022 0.0035
   code/prominence/d1/real    IN 19         29.0          7.0          18  4.0 0.0003 0.0010
    code/prominence/d2/own    PY 12         62.5         51.1          10  9.0 0.0186 0.0298
    code/prominence/d2/own    IN 19         29.0         13.2          16  6.0 0.0003 0.0014
   code/prominence/d2/real    PY 12         62.5         43.6          12  0.0 0.0022 0.0035
   code/prominence/d2/real    IN 19         29.0          7.2          18  5.0 0.0003 0.0012
    methods/height/d1/real    PY 12         85.5         65.0          12  0.0 0.0022 0.0035
    methods/height/d1/real    IN 19         92.0         69.4          17  9.0 0.0005 0.0022
     methods/height/d2/own    PY 12         85.5         89.5           5 37.0 0.8753 0.8753
     methods/height/d2/own    IN 19         92.0         99.2           8 49.0 0.0641 0.1274
    methods/height/d2/real    PY 12         85.5         64.3          12  0.0 0.0022 0.0035
    methods/height/d2/real    IN 19         92.0         70.1          17  8.0 0.0005 0.0019
methods/prominence/d1/real    PY 12         62.5         43.5          12  0.0 0.0022 0.0025
methods/prominence/d1/real    IN 19         29.0          6.9          18  5.0 0.0003 0.0012
 methods/prominence/d2/own    PY 12         62.5         51.0          10  9.0 0.0186 0.0213
 methods/prominence/d2/own    IN 19         29.0         13.4          16  7.0 0.0004 0.0016
methods/prominence/d2/real    PY 12         62.5         43.7          12  0.0 0.0022 0.0025
methods/prominence/d2/real    IN 19         29.0          6.9          18  4.0 0.0003 0.0010
(a) Poisson null, types (a), maint_own:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real    PY 12         91.5         69.2          11  2.0 0.0037 0.0148
       code/height/d1/real    IN 19         95.0         84.5          15 36.0 0.0176 0.0458
        code/height/d2/own    PY 12         91.5         95.2           5 27.0 0.3465 0.5544
        code/height/d2/own    IN 19         95.0        105.0           5 27.0 0.0062 0.0495
       code/height/d2/real    PY 12         91.5         69.7          11  1.0 0.0029 0.0115
       code/height/d2/real    IN 19         95.0         83.4          14 40.0 0.0269 0.0538
   code/prominence/d1/real    PY 12         67.5         35.3          12  0.0 0.0022 0.0044
   code/prominence/d1/real    IN 19         24.0         10.6          14 44.0 0.0401 0.0642
    code/prominence/d2/own    PY 12         67.5         48.8          11  5.0 0.0076 0.0306
    code/prominence/d2/own    IN 19         24.0         12.8          13 56.0 0.1165 0.1332
   code/prominence/d2/real    PY 12         67.5         35.5          12  0.0 0.0022 0.0057
   code/prominence/d2/real    IN 19         24.0         10.8          14 42.0 0.0329 0.0527
    methods/height/d1/real    PY 12         91.5         69.0          11  1.0 0.0029 0.0077
    methods/height/d1/real    IN 19         95.0         85.5          14 38.0 0.0218 0.0291
     methods/height/d2/own    PY 12         91.5         95.4           5 30.0 0.4802 0.4802
     methods/height/d2/own    IN 19         95.0        104.1           5 28.0 0.0070 0.0483
    methods/height/d2/real    PY 12         91.5         69.9          11  2.0 0.0037 0.0099
    methods/height/d2/real    IN 19         95.0         85.7          14 38.0 0.0218 0.0291
methods/prominence/d1/real    PY 12         67.5         35.5          12  0.0 0.0022 0.0035
methods/prominence/d1/real    IN 19         24.0         10.7          14 42.0 0.0329 0.0376
 methods/prominence/d2/own    PY 12         67.5         49.7          11  5.0 0.0076 0.0122
 methods/prominence/d2/own    IN 19         24.0         12.9          13 58.0 0.1365 0.1365
methods/prominence/d2/real    PY 12         67.5         35.2          12  0.0 0.0022 0.0035
methods/prominence/d2/real    IN 19         24.0         10.9          14 43.0 0.0364 0.0416
(a) Poisson null, types (b), enc:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real  PY_b 12         41.0         38.0           7 21.0 0.1579 0.6318
       code/height/d1/real  IN_b 18         41.0         38.1           9 78.0 0.7439 0.8502
        code/height/d2/own  PY_b 12         41.0         40.4           6 30.0 0.4802 0.6060
        code/height/d2/own  IN_b 18         41.0         44.1           8 54.0 0.1701 0.4536
       code/height/d2/real  PY_b 12         41.0         37.5           8 20.0 0.1361 0.5444
       code/height/d2/real  IN_b 18         41.0         37.7           9 78.0 0.7439 0.8139
   code/prominence/d1/real  PY_b 12         28.5         21.1          11  1.0 0.0029 0.0115
   code/prominence/d1/real  IN_b 18         10.5          6.6          12 33.0 0.0222 0.0445
    code/prominence/d2/own  PY_b 12         28.5         24.0          12  0.0 0.0022 0.0089
    code/prominence/d2/own  IN_b 18         10.5          7.4          13 25.0 0.0084 0.0168
   code/prominence/d2/real  PY_b 12         28.5         20.8          11  1.0 0.0029 0.0115
   code/prominence/d2/real  IN_b 18         10.5          6.6          12 35.0 0.0279 0.0454
    methods/height/d1/real  PY_b 12         41.0         37.9           7 19.0 0.1167 0.3111
    methods/height/d1/real  IN_b 18         41.0         37.8           9 74.0 0.6165 0.7046
     methods/height/d2/own  PY_b 12         41.0         40.2           7 31.0 0.5303 0.6060
     methods/height/d2/own  IN_b 18         41.0         44.2           8 54.0 0.1701 0.6060
    methods/height/d2/real  PY_b 12         41.0         38.1           7 19.0 0.1167 0.3111
    methods/height/d2/real  IN_b 18         41.0         37.9           9 81.0 0.8446 0.8927
methods/prominence/d1/real  PY_b 12         28.5         21.0          11  1.0 0.0029 0.0057
methods/prominence/d1/real  IN_b 18         10.5          6.6          12 34.0 0.0249 0.0332
 methods/prominence/d2/own  PY_b 12         28.5         24.0          12  0.0 0.0022 0.0059
 methods/prominence/d2/own  IN_b 18         10.5          7.7          13 22.0 0.0057 0.0114
methods/prominence/d2/real  PY_b 12         28.5         21.3          11  1.0 0.0029 0.0057
methods/prominence/d2/real  IN_b 18         10.5          6.8          12 30.0 0.0156 0.0250
(a) Poisson null, types (b), maint:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real  PY_b 12         89.0         60.0          12  0.0 0.0022 0.0044
       code/height/d1/real  IN_b 18         89.5         70.1          16  6.0 0.0005 0.0021
        code/height/d2/own  PY_b 12         89.0         86.4           9 18.0 0.0995 0.1990
        code/height/d2/own  IN_b 18         89.5        102.0           8 51.0 0.1330 0.2128
       code/height/d2/real  PY_b 12         89.0         60.2          12  0.0 0.0022 0.0044
       code/height/d2/real  IN_b 18         89.5         70.7          17  7.0 0.0006 0.0025
   code/prominence/d1/real  PY_b 12         73.0         47.9          12  0.0 0.0022 0.0035
   code/prominence/d1/real  IN_b 18         31.0          7.8          17  3.0 0.0003 0.0013
    code/prominence/d2/own  PY_b 12         73.0         50.8          12  0.0 0.0022 0.0044
    code/prominence/d2/own  IN_b 18         31.0         13.0          15  7.0 0.0006 0.0025
   code/prominence/d2/real  PY_b 12         73.0         48.2          12  0.0 0.0022 0.0035
   code/prominence/d2/real  IN_b 18         31.0          7.8          17  3.0 0.0003 0.0013
    methods/height/d1/real  PY_b 12         89.0         59.5          12  0.0 0.0022 0.0035
    methods/height/d1/real  IN_b 18         89.5         70.5          17  6.0 0.0005 0.0021
     methods/height/d2/own  PY_b 12         89.0         86.7           9 18.0 0.0995 0.1492
     methods/height/d2/own  IN_b 18         89.5        102.2           7 49.0 0.1119 0.1492
    methods/height/d2/real  PY_b 12         89.0         59.9          12  0.0 0.0022 0.0035
    methods/height/d2/real  IN_b 18         89.5         70.4          16  7.0 0.0006 0.0025
methods/prominence/d1/real  PY_b 12         73.0         48.1          12  0.0 0.0022 0.0025
methods/prominence/d1/real  IN_b 18         31.0          7.9          17  3.0 0.0003 0.0013
 methods/prominence/d2/own  PY_b 12         73.0         50.3          12  0.0 0.0022 0.0025
 methods/prominence/d2/own  IN_b 18         31.0         13.2          15  9.0 0.0009 0.0025
methods/prominence/d2/real  PY_b 12         73.0         48.4          12  0.0 0.0022 0.0025
methods/prominence/d2/real  IN_b 18         31.0          7.9          17  3.0 0.0003 0.0013
(a) Poisson null, types (b), maint_own:
                   reading group  n  real_median  null_median  real_above    W      p   p_BH
       code/height/d1/real  PY_b 12         98.0         67.2          12  0.0 0.0022 0.0089
       code/height/d1/real  IN_b 18         95.0         84.7          13 31.0 0.0176 0.0458
        code/height/d2/own  PY_b 12         98.0         85.3           8 21.0 0.1579 0.3159
        code/height/d2/own  IN_b 18         95.0        104.7           6 38.0 0.0406 0.1625
       code/height/d2/real  PY_b 12         98.0         68.4          12  0.0 0.0022 0.0089
       code/height/d2/real  IN_b 18         95.0         84.8          13 31.0 0.0176 0.0458
   code/prominence/d1/real  PY_b 12         75.0         44.2          12  0.0 0.0022 0.0044
   code/prominence/d1/real  IN_b 18         24.5         10.8          15 23.0 0.0065 0.0104
    code/prominence/d2/own  PY_b 12         75.0         54.9          11  5.0 0.0076 0.0306
    code/prominence/d2/own  IN_b 18         24.5         12.1          14 34.0 0.0249 0.0498
   code/prominence/d2/real  PY_b 12         75.0         44.2          12  0.0 0.0022 0.0057
   code/prominence/d2/real  IN_b 18         24.5         10.6          15 23.0 0.0065 0.0104
    methods/height/d1/real  PY_b 12         98.0         67.2          12  0.0 0.0022 0.0059
    methods/height/d1/real  IN_b 18         95.0         84.0          14 24.0 0.0074 0.0118
     methods/height/d2/own  PY_b 12         98.0         85.6           8 21.0 0.1579 0.1805
     methods/height/d2/own  IN_b 18         95.0        104.1           6 41.0 0.0526 0.1052
    methods/height/d2/real  PY_b 12         98.0         67.3          12  0.0 0.0022 0.0059
    methods/height/d2/real  IN_b 18         95.0         84.3          14 28.0 0.0123 0.0196
methods/prominence/d1/real  PY_b 12         75.0         43.4          12  0.0 0.0022 0.0035
methods/prominence/d1/real  IN_b 18         24.5         10.4          15 23.0 0.0065 0.0087
 methods/prominence/d2/own  PY_b 12         75.0         53.8          11  3.0 0.0047 0.0095
 methods/prominence/d2/own  IN_b 18         24.5         11.8          14 35.0 0.0279 0.0318
methods/prominence/d2/real  PY_b 12         75.0         44.2          12  0.0 0.0022 0.0035
methods/prominence/d2/real  IN_b 18         24.5         11.0          15 23.0 0.0065 0.0087
types (a), code/height/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.1122, PY maint 0.0044, IN maint 0.0022, IN enc 0.7856
types (a), code/height/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.1122, PY maint 0.0148, IN maint 0.0458, IN enc 0.7856
types (a), code/height/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.6662, PY maint 0.9375, IN maint 0.1990, IN enc 0.2848
types (a), code/height/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.6662, PY maint 0.5544, IN maint 0.0495, IN enc 0.2848
types (a), code/height/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.1122, PY maint 0.0044, IN maint 0.0019, IN enc 0.7942
types (a), code/height/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.1122, PY maint 0.0115, IN maint 0.0538, IN enc 0.7942
types (a), code/prominence/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0035, IN maint 0.0010, IN enc 0.0298
types (a), code/prominence/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0044, IN maint 0.0642, IN enc 0.0298
types (a), code/prominence/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0298, IN maint 0.0014, IN enc 0.0140
types (a), code/prominence/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0306, IN maint 0.1332, IN enc 0.0140
types (a), code/prominence/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0035, IN maint 0.0012, IN enc 0.0200
types (a), code/prominence/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0057, IN maint 0.0527, IN enc 0.0200
types (a), methods/height/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0611, PY maint 0.0035, IN maint 0.0022, IN enc 0.8197
types (a), methods/height/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0611, PY maint 0.0077, IN maint 0.0291, IN enc 0.8197
types (a), methods/height/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.5176, PY maint 0.8753, IN maint 0.1274, IN enc 0.4686
types (a), methods/height/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.5176, PY maint 0.4802, IN maint 0.0483, IN enc 0.4686
types (a), methods/height/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0911, PY maint 0.0035, IN maint 0.0019, IN enc 0.6662
types (a), methods/height/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0911, PY maint 0.0099, IN maint 0.0291, IN enc 0.6662
types (a), methods/prominence/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0044, PY maint 0.0025, IN maint 0.0012, IN enc 0.0226
types (a), methods/prominence/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0044, PY maint 0.0035, IN maint 0.0376, IN enc 0.0226
types (a), methods/prominence/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.0077, PY maint 0.0213, IN maint 0.0016, IN enc 0.0140
types (a), methods/prominence/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0077, PY maint 0.0122, IN maint 0.1365, IN enc 0.0140
types (a), methods/prominence/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0025, IN maint 0.0010, IN enc 0.0252
types (a), methods/prominence/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0035, IN maint 0.0416, IN enc 0.0252
types (b), code/height/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.6318, PY maint 0.0044, IN maint 0.0021, IN enc 0.8502
types (b), code/height/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.6318, PY maint 0.0089, IN maint 0.0458, IN enc 0.8502
types (b), code/height/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.6060, PY maint 0.1990, IN maint 0.2128, IN enc 0.4536
types (b), code/height/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.6060, PY maint 0.3159, IN maint 0.1625, IN enc 0.4536
types (b), code/height/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.5444, PY maint 0.0044, IN maint 0.0025, IN enc 0.8139
types (b), code/height/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.5444, PY maint 0.0089, IN maint 0.0458, IN enc 0.8139
types (b), code/prominence/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0035, IN maint 0.0013, IN enc 0.0445
types (b), code/prominence/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0044, IN maint 0.0104, IN enc 0.0445
types (b), code/prominence/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0044, IN maint 0.0025, IN enc 0.0168
types (b), code/prominence/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0089, PY maint 0.0306, IN maint 0.0498, IN enc 0.0168
types (b), code/prominence/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0035, IN maint 0.0013, IN enc 0.0454
types (b), code/prominence/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0115, PY maint 0.0057, IN maint 0.0104, IN enc 0.0454
types (b), methods/height/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.3111, PY maint 0.0035, IN maint 0.0021, IN enc 0.7046
types (b), methods/height/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.3111, PY maint 0.0059, IN maint 0.0118, IN enc 0.7046
types (b), methods/height/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.6060, PY maint 0.1492, IN maint 0.1492, IN enc 0.6060
types (b), methods/height/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.6060, PY maint 0.1805, IN maint 0.1052, IN enc 0.6060
types (b), methods/height/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.3111, PY maint 0.0035, IN maint 0.0025, IN enc 0.8927
types (b), methods/height/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.3111, PY maint 0.0059, IN maint 0.0196, IN enc 0.8927
types (b), methods/prominence/d1/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0025, IN maint 0.0013, IN enc 0.0332
types (b), methods/prominence/d1/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0035, IN maint 0.0087, IN enc 0.0332
types (b), methods/prominence/d2/own, maintenance as maint: paper's pattern False; BH p PY enc 0.0059, PY maint 0.0025, IN maint 0.0025, IN enc 0.0114
types (b), methods/prominence/d2/own, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0059, PY maint 0.0095, IN maint 0.0318, IN enc 0.0114
types (b), methods/prominence/d2/real, maintenance as maint: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0025, IN maint 0.0013, IN enc 0.0250
types (b), methods/prominence/d2/real, maintenance as maint_own: paper's pattern False; BH p PY enc 0.0057, PY maint 0.0035, IN maint 0.0087, IN enc 0.0250
(b) label-shuffled null, types (a), enc:
group  n  real_median  null_median  real_above   W      p   p_BH
   PY 12         29.0         21.2          11 1.0 0.0029 0.0029
   IN 16         10.0         11.9           1 3.0 0.0008 0.0016
(b) label-shuffled null, types (a), maint:
group  n  real_median  null_median  real_above    W      p   p_BH
   PY 12         62.5         46.9          11  1.0 0.0029 0.0057
   IN 16         30.0         36.5           5 32.0 0.0627 0.0627
(b) label-shuffled null, types (b), enc:
group  n  real_median  null_median  real_above   W      p   p_BH
   PY 12         28.5         18.7          11 1.0 0.0029 0.0029
   IN 17         10.0         11.3           2 7.0 0.0010 0.0020
(b) label-shuffled null, types (b), maint:
group  n  real_median  null_median  real_above    W      p   p_BH
   PY 12         73.0         47.3          11  1.0 0.0029 0.0057
   IN 17         31.0         32.9           3 25.0 0.0148 0.0148

Result: partially reproduced. No reading gives the paper's full pattern, with either cell types (the paper's pattern lines above). Against the Poisson null with the prominence rule, PY exceed the null in encoding (BH p 0.0044 to 0.0115) and maintenance, and IN in maintenance, but IN also exceed it in encoding (BH p 0.011 to 0.045), where the paper finds no difference. With the height rule PY do not differ from the null in encoding (BH p 0.06 to 0.67). As in fig4d, the 2.8 s maintenance window inflates the real-to-null comparison; with each trial's own maintenance PY still exceed the null in maintenance under the real threshold, and IN do under some readings (BH p 0.009 to 0.16). Against the label-shuffled null, PY exceed it in both epochs (BH p 0.0029 to 0.0057), and IN fall below it in encoding (BH p 0.0016 and 0.0020) and in maintenance do not exceed it (types a, BH p 0.063) or fall below it (types b, 0.015). Elevated PY bursting in both epochs holds; IN maintenance bursting holds against the Poisson null only.

fig6cd-celltype-epochs¶

Pyramidal burst rates stayed stable across task epochs at every load, whereas interneuron burst rates changed from encoding to each maintenance window and to the probe in load 1 trials.

In [47]:
for g in ["PY", "IN", "PY_b", "IN_b"]:
    for L in [1, 2, 3]:
        print(f"\n{g}, load {L}:")
        print(epoch_table(g, L).to_string(index=False))
PY, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     41.0    39.0    45.0    43.0       44.5           NaN 0.3795 0.3795 0.3795   0.3795       0.3795   0.3795   0.3795
       code/height/M-methods 12     41.0    47.0    45.5    34.0       44.5         51.11 0.0456 0.0430 0.0024   0.2905       0.0016   0.7490   0.0016
         code/height/M-trial 12     41.0    43.5    41.0    42.5       44.5           NaN 0.7617 0.7661 0.7661   0.7617       0.7617   0.7617   0.7661
      code/prominence/M-code 12     29.0    29.0    30.0    29.5       29.0           NaN 0.9844 0.9844 0.9844   0.9844       0.9844   0.9844   0.9844
   code/prominence/M-methods 12     29.0    35.0    33.5    25.5       29.0         38.02 0.0155 0.2181 0.0065   0.9551       0.0065   0.2181   0.0065
     code/prominence/M-trial 12     29.0    31.5    27.0    31.5       29.0           NaN 0.4450 0.4450 0.4450   0.9551       0.4450   0.4450   0.9299
       methods/height/M-code 12     41.0    39.0    45.0    43.0       44.5           NaN 0.3795 0.3795 0.3795   0.3795       0.3795   0.3795   0.3795
    methods/height/M-methods 12     41.0    47.0    45.5    34.0       44.5         51.11 0.0456 0.0430 0.0024   0.2905       0.0016   0.7490   0.0016
      methods/height/M-trial 12     41.0    43.5    41.0    42.5       44.5           NaN 0.7617 0.7661 0.7661   0.7617       0.7617   0.7617   0.7661
   methods/prominence/M-code 12     29.0    29.0    30.0    29.5       29.0           NaN 0.9844 0.9844 0.9844   0.9844       0.9844   0.9844   0.9844
methods/prominence/M-methods 12     29.0    35.0    33.5    25.5       29.0         38.02 0.0155 0.2181 0.0065   0.9551       0.0065   0.2181   0.0065
  methods/prominence/M-trial 12     29.0    31.5    27.0    31.5       29.0           NaN 0.4450 0.4450 0.4450   0.9551       0.4450   0.4450   0.9299

PY, load 2:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     42.0    40.0    40.5    41.5       40.5           NaN 0.8242 0.9199 0.9199   0.9199       0.8242   0.8242   0.8242
       code/height/M-methods 12     42.0    41.5    45.5    33.0       40.5         48.31 0.5371 0.1099 0.0049   0.6719       0.0049   0.5371   0.0049
         code/height/M-trial 12     42.0    38.0    40.5    43.0       40.5           NaN 0.9258 0.9258 0.9258   0.9258       0.9258   0.9258   0.9258
      code/prominence/M-code 12     30.0    28.0    30.5    31.0       29.0           NaN 0.9902 0.9902 0.9902   0.9902       0.9902   0.9902   0.9902
   code/prominence/M-methods 12     30.0    32.0    32.0    23.5       29.0         34.27 0.2881 0.0625 0.0033   0.2881       0.0033   0.3244   0.0033
     code/prominence/M-trial 12     30.0    27.5    30.0    29.5       29.0           NaN 0.9766 0.9766 0.9766   0.9766       0.9766   0.9766   0.9766
       methods/height/M-code 12     42.0    40.0    40.5    41.5       40.5           NaN 0.8242 0.9199 0.9199   0.9199       0.8242   0.8242   0.8242
    methods/height/M-methods 12     42.0    41.5    45.5    33.0       40.5         48.31 0.5371 0.1099 0.0049   0.6719       0.0049   0.5371   0.0049
      methods/height/M-trial 12     42.0    38.0    40.5    43.0       40.5           NaN 0.9258 0.9258 0.9258   0.9258       0.9258   0.9258   0.9258
   methods/prominence/M-code 12     30.0    28.0    30.5    31.0       29.0           NaN 0.9902 0.9902 0.9902   0.9902       0.9902   0.9902   0.9902
methods/prominence/M-methods 12     30.0    32.0    32.0    23.5       29.0         34.27 0.2881 0.0625 0.0033   0.2881       0.0033   0.3244   0.0033
  methods/prominence/M-trial 12     30.0    27.5    30.0    29.5       29.0           NaN 0.9766 0.9766 0.9766   0.9766       0.9766   0.9766   0.9766

PY, load 3:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     41.5    37.5    42.5    40.5       40.0           NaN 0.5762 0.9277 0.9546   0.6152       0.5762   0.5762   0.6152
       code/height/M-methods 12     41.5    46.5    48.5    32.0       40.0         46.62 0.0529 0.3033 0.0061   0.4785       0.0049   0.7158   0.0061
         code/height/M-trial 12     41.5    40.5    42.0    39.0       40.0           NaN 0.9502 0.8551 0.8551   0.8551       0.8551   0.9502   0.8551
      code/prominence/M-code 12     31.0    27.0    30.0    30.5       30.0           NaN 0.6494 0.6494 0.6494   0.6494       0.6494   0.6494   0.6494
   code/prominence/M-methods 12     31.0    34.5    34.0    22.5       30.0         32.65 0.6173 0.6631 0.0049   0.6631       0.0049   0.6173   0.0049
     code/prominence/M-trial 12     31.0    31.0    28.5    28.5       30.0           NaN 0.6714 0.6714 0.6714   0.9277       0.6714   1.0000   0.9326
       methods/height/M-code 12     41.5    37.5    42.5    40.5       40.0           NaN 0.5762 0.9277 0.9546   0.6152       0.5762   0.5762   0.6152
    methods/height/M-methods 12     41.5    46.5    48.5    32.0       40.0         46.62 0.0529 0.3033 0.0061   0.4785       0.0049   0.7158   0.0061
      methods/height/M-trial 12     41.5    40.5    42.0    39.0       40.0           NaN 0.9502 0.8551 0.8551   0.8551       0.8551   0.9502   0.8551
   methods/prominence/M-code 12     31.0    27.0    30.0    30.5       30.0           NaN 0.6494 0.6494 0.6494   0.6494       0.6494   0.6494   0.6494
methods/prominence/M-methods 12     31.0    34.5    34.0    22.5       30.0         32.65 0.6173 0.6631 0.0049   0.6631       0.0049   0.6173   0.0049
  methods/prominence/M-trial 12     31.0    31.0    28.5    28.5       30.0           NaN 0.6714 0.6714 0.6714   0.9277       0.6714   1.0000   0.9326

IN, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 19     41.0    42.0    35.0    34.0       42.0           NaN 0.1585 0.1113 0.1113   0.4385       0.1113   0.1113   0.1113
       code/height/M-methods 19     41.0    46.0    45.0    28.0       42.0         41.96 0.0119 0.0577 0.0005   0.4385       0.0005   0.4442   0.0005
         code/height/M-trial 19     41.0    43.0    40.0    41.0       42.0           NaN 0.9037 0.8587 0.6578   0.6578       0.6578   0.6693   0.6578
      code/prominence/M-code 19     11.0    15.0    15.0    15.0        8.0           NaN 0.0047 0.0138 0.0047   0.7991       0.0047   0.7991   0.9171
   code/prominence/M-methods 19     11.0    20.0    19.0    13.0        8.0         19.02 0.0006 0.0016 0.8627   0.7308       0.0006   0.2397   0.0006
     code/prominence/M-trial 19     11.0    19.0    14.0    16.0        8.0           NaN 0.0073 0.0236 0.0379   0.6496       0.0073   0.0538   0.1652
       methods/height/M-code 19     41.0    42.0    35.0    34.0       42.0           NaN 0.1585 0.1113 0.1113   0.4385       0.1113   0.1113   0.1113
    methods/height/M-methods 19     41.0    46.0    45.0    28.0       42.0         41.96 0.0119 0.0577 0.0005   0.4385       0.0005   0.4442   0.0005
      methods/height/M-trial 19     41.0    43.0    40.0    41.0       42.0           NaN 0.9037 0.8587 0.6578   0.6578       0.6578   0.6693   0.6578
   methods/prominence/M-code 19     11.0    15.0    15.0    15.0        8.0           NaN 0.0047 0.0138 0.0047   0.7991       0.0047   0.7991   0.9171
methods/prominence/M-methods 19     11.0    20.0    19.0    13.0        8.0         19.02 0.0006 0.0016 0.8627   0.7308       0.0006   0.2397   0.0006
  methods/prominence/M-trial 19     11.0    19.0    14.0    16.0        8.0           NaN 0.0073 0.0236 0.0379   0.6496       0.0073   0.0538   0.1652

IN, load 2:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 19     41.0    39.0    40.0    37.0       44.0           NaN 0.8091 0.7788 0.3603   0.5098       0.2896   0.7788   0.8091
       code/height/M-methods 19     41.0    46.0    45.0    30.0       44.0         43.74 0.0506 0.0635 0.0010   0.3186       0.0010   0.6470   0.0016
         code/height/M-trial 19     41.0    41.0    40.0    39.0       44.0           NaN 0.6002 0.6827 0.5323   0.5323       0.5323   0.6002   0.5323
      code/prominence/M-code 19      9.0    14.0    15.0    15.0        8.0           NaN 0.0062 0.0031 0.0027   0.0727       0.0016   0.4729   0.3429
   code/prominence/M-methods 19      9.0    19.0    14.0    13.0        8.0         18.65 0.0023 0.0062 0.6718   0.0703       0.0014   0.1802   0.0023
     code/prominence/M-trial 19      9.0    18.0    13.0    15.0        8.0           NaN 0.0048 0.0459 0.0083   0.0691       0.0029   0.0691   0.2461
       methods/height/M-code 19     41.0    39.0    40.0    37.0       44.0           NaN 0.8091 0.7788 0.3603   0.5098       0.2896   0.7788   0.8091
    methods/height/M-methods 19     41.0    46.0    45.0    30.0       44.0         43.74 0.0506 0.0635 0.0010   0.3186       0.0010   0.6470   0.0016
      methods/height/M-trial 19     41.0    41.0    40.0    39.0       44.0           NaN 0.6002 0.6827 0.5323   0.5323       0.5323   0.6002   0.5323
   methods/prominence/M-code 19      9.0    14.0    15.0    15.0        8.0           NaN 0.0062 0.0031 0.0027   0.0727       0.0016   0.4729   0.3429
methods/prominence/M-methods 19      9.0    19.0    14.0    13.0        8.0         18.65 0.0023 0.0062 0.6718   0.0703       0.0014   0.1802   0.0023
  methods/prominence/M-trial 19      9.0    18.0    13.0    15.0        8.0           NaN 0.0048 0.0459 0.0083   0.0691       0.0029   0.0691   0.2461

IN, load 3:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 19     42.0    48.0    36.0    35.0       40.0           NaN 0.0550 0.0436 0.0223   0.3967       0.0223   0.0383   0.0223
       code/height/M-methods 19     42.0    43.0    45.0    32.0       40.0         46.38 0.0568 0.0762 0.0020   0.4408       0.0020   1.0000   0.0020
         code/height/M-trial 19     42.0    37.0    44.0    39.0       40.0           NaN 0.5611 0.6056 0.5611   0.5667       0.5611   0.5611   0.9198
      code/prominence/M-code 19      7.0    15.0    14.0    14.0        9.0           NaN 0.0026 0.0047 0.0071   0.2414       0.0026   0.1582   0.1147
   code/prominence/M-methods 19      7.0    16.0    16.0    13.0        9.0         19.26 0.0031 0.0031 0.0114   0.2414       0.0094   0.5519   0.0114
     code/prominence/M-trial 19      7.0    16.0    15.0    15.0        9.0           NaN 0.0185 0.0048 0.0029   0.3103       0.0035   0.5996   0.5996
       methods/height/M-code 19     42.0    48.0    36.0    35.0       40.0           NaN 0.0550 0.0436 0.0223   0.3967       0.0223   0.0383   0.0223
    methods/height/M-methods 19     42.0    43.0    45.0    32.0       40.0         46.38 0.0568 0.0762 0.0020   0.4408       0.0020   1.0000   0.0020
      methods/height/M-trial 19     42.0    37.0    44.0    39.0       40.0           NaN 0.5611 0.6056 0.5611   0.5667       0.5611   0.5611   0.9198
   methods/prominence/M-code 19      7.0    15.0    14.0    14.0        9.0           NaN 0.0026 0.0047 0.0071   0.2414       0.0026   0.1582   0.1147
methods/prominence/M-methods 19      7.0    16.0    16.0    13.0        9.0         19.26 0.0031 0.0031 0.0114   0.2414       0.0094   0.5519   0.0114
  methods/prominence/M-trial 19      7.0    16.0    15.0    15.0        9.0           NaN 0.0185 0.0048 0.0029   0.3103       0.0035   0.5996   0.5996

PY_b, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     41.0    38.5    40.5    42.5       43.5           NaN 0.8681 0.8681 0.7324   0.7324       0.7617   0.8681   0.7617
       code/height/M-methods 12     41.0    46.5    45.5    31.5       43.5         46.25 0.0029 0.1018 0.0024   0.1831       0.0024   0.4112   0.0024
         code/height/M-trial 12     41.0    43.5    40.0    40.5       43.5           NaN 0.4199 0.6988 0.6988   0.4199       0.4199   0.4199   0.4199
      code/prominence/M-code 12     28.5    32.5    31.0    32.5       31.5           NaN 0.9795 0.9795 0.9795   0.8203       0.9795   0.9795   0.9795
   code/prominence/M-methods 12     28.5    38.0    32.0    26.0       31.5         38.24 0.0098 0.3868 0.0146   0.1025       0.0098   0.1025   0.0098
     code/prominence/M-trial 12     28.5    35.0    27.5    33.0       31.5           NaN 0.1953 0.8086 0.2344   0.2051       0.1953   0.1953   0.8086
       methods/height/M-code 12     41.0    38.5    40.5    42.5       43.5           NaN 0.8681 0.8681 0.7324   0.7324       0.7617   0.8681   0.7617
    methods/height/M-methods 12     41.0    46.5    45.5    31.5       43.5         46.25 0.0029 0.1018 0.0024   0.1831       0.0024   0.4112   0.0024
      methods/height/M-trial 12     41.0    43.5    40.0    40.5       43.5           NaN 0.4199 0.6988 0.6988   0.4199       0.4199   0.4199   0.4199
   methods/prominence/M-code 12     28.5    32.5    31.0    32.5       31.5           NaN 0.9795 0.9795 0.9795   0.8203       0.9795   0.9795   0.9795
methods/prominence/M-methods 12     28.5    38.0    32.0    26.0       31.5         38.24 0.0098 0.3868 0.0146   0.1025       0.0098   0.1025   0.0098
  methods/prominence/M-trial 12     28.5    35.0    27.5    33.0       31.5           NaN 0.1953 0.8086 0.2344   0.2051       0.1953   0.1953   0.8086

PY_b, load 2:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     42.0    38.0    41.0    39.5       40.0           NaN 0.8830 0.8941 0.8941   0.8830       0.8830   0.8830   0.8830
       code/height/M-methods 12     42.0    43.0    47.0    32.0       40.0         46.64 0.2997 0.1590 0.0269   0.4277       0.0081   0.4277   0.0081
         code/height/M-trial 12     42.0    38.5    43.0    41.0       40.0           NaN 0.9688 0.9688 0.9688   0.9688       0.9688   0.9688   0.9688
      code/prominence/M-code 12     33.0    30.5    32.0    29.5       29.5           NaN 0.9224 0.9224 0.9224   0.9224       0.9224   0.9224   0.9224
   code/prominence/M-methods 12     33.0    33.5    33.0    24.0       29.5         34.93 0.8530 0.5957 0.0171   0.2832       0.0049   0.6456   0.0049
     code/prominence/M-trial 12     33.0    30.0    30.0    30.5       29.5           NaN 0.9248 0.9248 0.9248   0.9248       0.9248   0.9248   0.9248
       methods/height/M-code 12     42.0    38.0    41.0    39.5       40.0           NaN 0.8830 0.8941 0.8941   0.8830       0.8830   0.8830   0.8830
    methods/height/M-methods 12     42.0    43.0    47.0    32.0       40.0         46.64 0.2997 0.1590 0.0269   0.4277       0.0081   0.4277   0.0081
      methods/height/M-trial 12     42.0    38.5    43.0    41.0       40.0           NaN 0.9688 0.9688 0.9688   0.9688       0.9688   0.9688   0.9688
   methods/prominence/M-code 12     33.0    30.5    32.0    29.5       29.5           NaN 0.9224 0.9224 0.9224   0.9224       0.9224   0.9224   0.9224
methods/prominence/M-methods 12     33.0    33.5    33.0    24.0       29.5         34.93 0.8530 0.5957 0.0171   0.2832       0.0049   0.6456   0.0049
  methods/prominence/M-trial 12     33.0    30.0    30.0    30.5       29.5           NaN 0.9248 0.9248 0.9248   0.9248       0.9248   0.9248   0.9248

PY_b, load 3:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 12     42.5    40.0    41.5    41.0       42.0           NaN 0.6787 0.9922 0.9922   0.9922       0.5078   0.8325   0.8325
       code/height/M-methods 12     42.5    44.5    45.0    31.5       42.0         46.68 0.0586 0.2271 0.0098   0.8047       0.0073   0.7943   0.0073
         code/height/M-trial 12     42.5    38.5    39.0    38.5       42.0           NaN 1.0000 1.0000 1.0000   1.0000       1.0000   1.0000   1.0000
      code/prominence/M-code 12     28.5    29.5    30.0    31.0       30.5           NaN 0.9575 0.9575 0.9575   0.9575       0.9575   0.9575   0.9575
   code/prominence/M-methods 12     28.5    34.0    30.5    23.5       30.5         34.41 0.0391 0.4224 0.0098   0.8555       0.0024   0.4224   0.0024
     code/prominence/M-trial 12     28.5    29.5    29.5    29.0       30.5           NaN 0.8638 0.8638 0.8638   0.8638       0.8638   0.8638   0.8638
       methods/height/M-code 12     42.5    40.0    41.5    41.0       42.0           NaN 0.6787 0.9922 0.9922   0.9922       0.5078   0.8325   0.8325
    methods/height/M-methods 12     42.5    44.5    45.0    31.5       42.0         46.68 0.0586 0.2271 0.0098   0.8047       0.0073   0.7943   0.0073
      methods/height/M-trial 12     42.5    38.5    39.0    38.5       42.0           NaN 1.0000 1.0000 1.0000   1.0000       1.0000   1.0000   1.0000
   methods/prominence/M-code 12     28.5    29.5    30.0    31.0       30.5           NaN 0.9575 0.9575 0.9575   0.9575       0.9575   0.9575   0.9575
methods/prominence/M-methods 12     28.5    34.0    30.5    23.5       30.5         34.41 0.0391 0.4224 0.0098   0.8555       0.0024   0.4224   0.0024
  methods/prominence/M-trial 12     28.5    29.5    29.5    29.0       30.5           NaN 0.8638 0.8638 0.8638   0.8638       0.8638   0.8638   0.8638

IN_b, load 1:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 18     41.0    43.5    37.0    36.0       44.0           NaN 0.2329 0.2478 0.1333   0.2320       0.1333   0.2329   0.1333
       code/height/M-methods 18     41.0    45.0    46.0    27.5       44.0         40.52 0.0316 0.0293 0.0008   0.1289       0.0008   0.9811   0.0009
         code/height/M-trial 18     41.0    41.0    41.5    40.0       44.0           NaN 0.9622 0.9622 0.4608   0.4608       0.3098   0.9431   0.5815
      code/prominence/M-code 18     10.5    15.5    15.0    15.0        7.5           NaN 0.0074 0.0074 0.0058   1.0000       0.0074   0.4533   1.0000
   code/prominence/M-methods 18     10.5    18.5    18.0    12.5        7.5         18.29 0.0010 0.0010 0.9954   1.0000       0.0010   0.6164   0.0010
     code/prominence/M-trial 18     10.5    17.0    14.5    14.5        7.5           NaN 0.0159 0.0159 0.0279   1.0000       0.0159   0.4049   0.1494
       methods/height/M-code 18     41.0    43.5    37.0    36.0       44.0           NaN 0.2329 0.2478 0.1333   0.2320       0.1333   0.2329   0.1333
    methods/height/M-methods 18     41.0    45.0    46.0    27.5       44.0         40.52 0.0316 0.0293 0.0008   0.1289       0.0008   0.9811   0.0009
      methods/height/M-trial 18     41.0    41.0    41.5    40.0       44.0           NaN 0.9622 0.9622 0.4608   0.4608       0.3098   0.9431   0.5815
   methods/prominence/M-code 18     10.5    15.5    15.0    15.0        7.5           NaN 0.0074 0.0074 0.0058   1.0000       0.0074   0.4533   1.0000
methods/prominence/M-methods 18     10.5    18.5    18.0    12.5        7.5         18.29 0.0010 0.0010 0.9954   1.0000       0.0010   0.6164   0.0010
  methods/prominence/M-trial 18     10.5    17.0    14.5    14.5        7.5           NaN 0.0159 0.0159 0.0279   1.0000       0.0159   0.4049   0.1494

IN_b, load 2:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 18     40.0    38.0    41.5    36.0       42.5           NaN 0.8105 0.8090 0.2965   0.8090       0.2965   0.8090   0.8090
       code/height/M-methods 18     40.0    46.5    42.5    29.5       42.5         43.98 0.0294 0.2327 0.0022   0.4627       0.0022   0.2723   0.0023
         code/height/M-trial 18     40.0    42.0    39.5    37.5       42.5           NaN 0.4255 0.5247 0.4255   0.5273       0.4255   0.4255   0.4255
      code/prominence/M-code 18     10.0    14.0    15.0    15.5        7.0           NaN 0.0062 0.0035 0.0035   0.3434       0.0021   0.3737   0.6313
   code/prominence/M-methods 18     10.0    18.5    15.0    11.0        7.0         15.98 0.0024 0.0070 0.6689   0.2671       0.0024   0.1180   0.0045
     code/prominence/M-trial 18     10.0    17.5    14.0    15.0        7.0           NaN 0.0052 0.0309 0.0147   0.2671       0.0052   0.1047   0.1848
       methods/height/M-code 18     40.0    38.0    41.5    36.0       42.5           NaN 0.8105 0.8090 0.2965   0.8090       0.2965   0.8090   0.8090
    methods/height/M-methods 18     40.0    46.5    42.5    29.5       42.5         43.98 0.0294 0.2327 0.0022   0.4627       0.0022   0.2723   0.0023
      methods/height/M-trial 18     40.0    42.0    39.5    37.5       42.5           NaN 0.4255 0.5247 0.4255   0.5273       0.4255   0.4255   0.4255
   methods/prominence/M-code 18     10.0    14.0    15.0    15.5        7.0           NaN 0.0062 0.0035 0.0035   0.3434       0.0021   0.3737   0.6313
methods/prominence/M-methods 18     10.0    18.5    15.0    11.0        7.0         15.98 0.0024 0.0070 0.6689   0.2671       0.0024   0.1180   0.0045
  methods/prominence/M-trial 18     10.0    17.5    14.0    15.0        7.0           NaN 0.0052 0.0309 0.0147   0.2671       0.0052   0.1047   0.1848

IN_b, load 3:
                     reading  n  med_enc  med_M1  med_M2  med_M3  med_probe  med_M3_per_s   q_M1   q_M2   q_M3  q_probe  min_q_other  q_M1-M2  q_M1-M3
          code/height/M-code 18     41.0    43.5    37.0    33.5       40.0           NaN 0.1648 0.0454 0.0350   0.3622       0.0373   0.0554   0.0373
       code/height/M-methods 18     41.0    45.0    43.5    32.0       40.0         46.98 0.0675 0.1583 0.0018   0.4025       0.0018   0.5562   0.0021
         code/height/M-trial 18     41.0    37.5    41.0    39.0       40.0           NaN 0.9074 0.9074 0.9074   0.9074       0.9074   0.9245   0.9074
      code/prominence/M-code 18      7.0    14.5    14.5    14.0        9.5           NaN 0.0032 0.0032 0.0051   0.1354       0.0032   0.4141   0.3282
   code/prominence/M-methods 18      7.0    16.0    15.0    13.0        9.5         19.04 0.0041 0.0044 0.0056   0.1053       0.0044   0.3261   0.0058
     code/prominence/M-trial 18      7.0    14.5    14.5    16.5        9.5           NaN 0.0081 0.0113 0.0029   0.1354       0.0036   0.8759   0.4032
       methods/height/M-code 18     41.0    43.5    37.0    33.5       40.0           NaN 0.1648 0.0454 0.0350   0.3622       0.0373   0.0554   0.0373
    methods/height/M-methods 18     41.0    45.0    43.5    32.0       40.0         46.98 0.0675 0.1583 0.0018   0.4025       0.0018   0.5562   0.0021
      methods/height/M-trial 18     41.0    37.5    41.0    39.0       40.0           NaN 0.9074 0.9074 0.9074   0.9074       0.9074   0.9245   0.9074
   methods/prominence/M-code 18      7.0    14.5    14.5    14.0        9.5           NaN 0.0032 0.0032 0.0051   0.1354       0.0032   0.4141   0.3282
methods/prominence/M-methods 18      7.0    16.0    15.0    13.0        9.5         19.04 0.0041 0.0044 0.0056   0.1053       0.0044   0.3261   0.0058
  methods/prominence/M-trial 18      7.0    14.5    14.5    16.5        9.5           NaN 0.0081 0.0113 0.0029   0.1354       0.0036   0.8759   0.4032
In [48]:
for (grule, rule, mr), x0 in EPB.groupby(["grule", "rule", "mread"]):
    if grule != "code":
        continue
    for sfx, tlab in [("", "a"), ("_b", "b")]:
        qin = epoch_tests(x0[(x0.group == "IN" + sfx) & (x0.load == 1)])[0]
        py_sig = {L: int(sum(v < 0.05 for v in epoch_tests(x0[(x0.group == "PY" + sfx) & (x0.load == L)])[0].values())) for L in [1, 2, 3]}
        print(f"types ({tlab}), {rule}/M-{mr}: IN encoding vs M1, M2, M3, probe corrected p "
              f"{[round(qin[f'enc-{k}'], 4) for k in ['M1', 'M2', 'M3', 'probe']]}; PY pairs with corrected p < 0.05 by load {py_sig}")
types (a), height/M-code: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.1585), np.float64(0.1113), np.float64(0.1113), np.float64(0.4385)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (b), height/M-code: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.2329), np.float64(0.2478), np.float64(0.1333), np.float64(0.232)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (a), height/M-methods: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0119), np.float64(0.0577), np.float64(0.0005), np.float64(0.4385)]; PY pairs with corrected p < 0.05 by load {1: 6, 2: 4, 3: 5}
types (b), height/M-methods: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0316), np.float64(0.0293), np.float64(0.0008), np.float64(0.1289)]; PY pairs with corrected p < 0.05 by load {1: 6, 2: 4, 3: 4}
types (a), height/M-trial: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.9037), np.float64(0.8587), np.float64(0.6578), np.float64(0.6578)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (b), height/M-trial: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.9622), np.float64(0.9622), np.float64(0.4608), np.float64(0.4608)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (a), prominence/M-code: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0047), np.float64(0.0138), np.float64(0.0047), np.float64(0.7991)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (b), prominence/M-code: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0074), np.float64(0.0074), np.float64(0.0058), np.float64(1.0)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (a), prominence/M-methods: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0006), np.float64(0.0016), np.float64(0.8627), np.float64(0.7308)]; PY pairs with corrected p < 0.05 by load {1: 6, 2: 4, 3: 4}
types (b), prominence/M-methods: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.001), np.float64(0.001), np.float64(0.9954), np.float64(1.0)]; PY pairs with corrected p < 0.05 by load {1: 6, 2: 4, 3: 5}
types (a), prominence/M-trial: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0073), np.float64(0.0236), np.float64(0.0379), np.float64(0.6496)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}
types (b), prominence/M-trial: IN encoding vs M1, M2, M3, probe corrected p [np.float64(0.0159), np.float64(0.0159), np.float64(0.0279), np.float64(1.0)]; PY pairs with corrected p < 0.05 by load {1: 0, 2: 0, 3: 0}

Result: not reproduced. With the prominence rule and the code's thirds, PY have no pair of periods with BH p < 0.05 at any load, and IN burst more in M1, M2 and M3 than in encoding at load 1 (BH p 0.0047 to 0.014), but IN do not differ between encoding and the probe (0.80; 0.13 to 1.0 under every reading and both cell types). The criterion's partial outcome needs the whole pattern at load 1, which fails at the probe. The Methods' windows make PY differ. The IN change is an increase (medians 11 to 15). With the types of reading (b) the result is the same: under the prominence rule and the code's thirds PY have no significant pair at any load and IN rise at M1 to M3 (BH p 0.0058 to 0.0074) but not at the probe (1.0). The per-trial thirds of the Fig. 6c legend (M-trial) give the same: PY have no significant pair at any load, and IN rise at M1 to M3 (BH p 0.0073 to 0.038; types b 0.016 to 0.028) but not at the probe (0.65; types b 1.0).

ext5bd-in-load-dependence¶

Interneuron burst-rate differences across maintenance epochs increased with load.

Read as the median over participants of the absolute difference in bursts between encoding and each of M1 to M3, averaged over the three windows.

In [49]:
for g in ["IN", "IN_b"]:
    for (grule, rule, mr), x0 in EPB.groupby(["grule", "rule", "mread"]):
        vals = []
        for L in [1, 2, 3]:
            x = x0[(x0.group == g) & (x0.load == L)]
            vals.append(np.median(np.mean([np.abs(x[k] - x["enc"]) for k in ["M1", "M2", "M3"]], 0)))
        print(f"types ({'b' if g.endswith('_b') else 'a'}), {grule}/{rule}/M-{mr}: IN measure by load {np.round(vals, 2).tolist()}; rises from load 1 to 3: {vals[2] > vals[0]}")
types (a), code/height/M-code: IN measure by load [7.0, 5.67, 6.67]; rises from load 1 to 3: False
types (a), code/height/M-methods: IN measure by load [8.67, 9.67, 7.67]; rises from load 1 to 3: False
types (a), code/height/M-trial: IN measure by load [6.0, 7.0, 5.67]; rises from load 1 to 3: False
types (a), code/prominence/M-code: IN measure by load [3.67, 5.0, 6.33]; rises from load 1 to 3: True
types (a), code/prominence/M-methods: IN measure by load [6.67, 6.0, 6.33]; rises from load 1 to 3: False
types (a), code/prominence/M-trial: IN measure by load [4.67, 5.67, 6.33]; rises from load 1 to 3: True
types (a), methods/height/M-code: IN measure by load [7.0, 5.67, 6.67]; rises from load 1 to 3: False
types (a), methods/height/M-methods: IN measure by load [8.67, 9.67, 7.67]; rises from load 1 to 3: False
types (a), methods/height/M-trial: IN measure by load [6.0, 7.0, 5.67]; rises from load 1 to 3: False
types (a), methods/prominence/M-code: IN measure by load [3.67, 5.0, 6.33]; rises from load 1 to 3: True
types (a), methods/prominence/M-methods: IN measure by load [6.67, 6.0, 6.33]; rises from load 1 to 3: False
types (a), methods/prominence/M-trial: IN measure by load [4.67, 5.67, 6.33]; rises from load 1 to 3: True
types (b), code/height/M-code: IN measure by load [7.67, 6.5, 7.0]; rises from load 1 to 3: False
types (b), code/height/M-methods: IN measure by load [9.0, 10.5, 7.0]; rises from load 1 to 3: False
types (b), code/height/M-trial: IN measure by load [6.0, 7.17, 5.17]; rises from load 1 to 3: False
types (b), code/prominence/M-code: IN measure by load [4.33, 4.67, 6.83]; rises from load 1 to 3: True
types (b), code/prominence/M-methods: IN measure by load [6.5, 6.5, 6.83]; rises from load 1 to 3: True
types (b), code/prominence/M-trial: IN measure by load [4.83, 5.83, 6.83]; rises from load 1 to 3: True
types (b), methods/height/M-code: IN measure by load [7.67, 6.5, 7.0]; rises from load 1 to 3: False
types (b), methods/height/M-methods: IN measure by load [9.0, 10.5, 7.0]; rises from load 1 to 3: False
types (b), methods/height/M-trial: IN measure by load [6.0, 7.17, 5.17]; rises from load 1 to 3: False
types (b), methods/prominence/M-code: IN measure by load [4.33, 4.67, 6.83]; rises from load 1 to 3: True
types (b), methods/prominence/M-methods: IN measure by load [6.5, 6.5, 6.83]; rises from load 1 to 3: True
types (b), methods/prominence/M-trial: IN measure by load [4.83, 5.83, 6.83]; rises from load 1 to 3: True

Result: reproduced. With the prominence rule the measure rises from load 1 to load 3 with the code's thirds and the per-trial thirds under either group rule (3.67, 5.00 and 6.33; 4.67, 5.67 and 6.33), but not with the Methods' windows (6.67, 6.00 and 6.33); under the height rule it does not rise. With the types of reading (b) it rises under the prominence rule (4.33, 4.67 and 6.83 with the code's thirds) and not under the height rule.

fig6e-load-modulation-in¶

A significant portion of interneurons was modulated by memory load during maintenance (14.36%), including interneuron concept cells (21.42%), while pyramidal neurons showed minimal load modulation (5.43%; concept pyramidal 0.00%).

The GLM fits of fig1e (load, every trial reading), with the groups PY, IN, PY concept cells and IN concept cells (types of reading (a) of fig5c).

In [50]:
TG = {"IN": np.where(TY == "IN")[0], "IN concept": np.where((TY == "IN") & CONCEPT)[0],
      "PY": np.where(TY == "PY")[0], "PY concept": np.where((TY == "PY") & CONCEPT)[0]}
for key in [("load", "matched", "shared"), ("load", "matched", "within"), ("load", "all", "within")]:
    (real, null), _, _ = GLM[key]
    df, _ = wm.glm_groups(real, null, TG)
    print(f"load, trials {key[1]}, permutation {key[2]}:")
    print(df.round(3).to_string(index=False))
TGb = {"IN": np.where(TYPES["b"] == "IN")[0], "IN concept": np.where((TYPES["b"] == "IN") & CONCEPT)[0],
       "PY": np.where(TYPES["b"] == "PY")[0], "PY concept": np.where((TYPES["b"] == "PY") & CONCEPT)[0]}
for key in [("load", "matched", "shared"), ("load", "matched", "within"), ("load", "all", "within")]:
    (real, null), _, _ = GLM[key]
    print(f"types of reading (b), load, trials {key[1]}, permutation {key[2]}:")
    print(wm.glm_groups(real, null, TGb)[0].round(3).to_string(index=False))
print("paper: IN 14.36% (P = 0.002), IN concept 21.42% (P = 0.032), PY 5.43% and PY concept 0.00% (P > 0.05)")
load, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 215           30   13.953     10.839 0.001
IN concept  16            3   18.750      0.806 0.042
        PY 102            6    5.882      5.226 0.426
PY concept  11            0    0.000      0.561 1.000
load, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 215           28   13.023     10.832 0.000
IN concept  16            3   18.750      0.808 0.045
        PY 102            6    5.882      5.226 0.423
PY concept  11            0    0.000      0.558 1.000
load, trials all, permutation within:
     group   n  significant  percent  null_mean     p
        IN 215           37   17.209     10.814 0.000
IN concept  16            4   25.000      0.805 0.006
        PY 102            8    7.843      5.204 0.157
PY concept  11            0    0.000      0.562 1.000
types of reading (b), load, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 198           29   14.646      9.979 0.001
IN concept  14            2   14.286      0.705 0.150
        PY 100            7    7.000      5.126 0.276
PY concept  11            0    0.000      0.558 1.000
types of reading (b), load, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 198           27   13.636      9.972 0.000
IN concept  14            2   14.286      0.706 0.147
        PY 100            7    7.000      5.133 0.266
PY concept  11            0    0.000      0.555 1.000
types of reading (b), load, trials all, permutation within:
     group   n  significant  percent  null_mean     p
        IN 198           35   17.677      9.955 0.000
IN concept  14            3   21.429      0.704 0.032
        PY 100            9    9.000      5.124 0.075
PY concept  11            0    0.000      0.560 1.000
paper: IN 14.36% (P = 0.002), IN concept 21.42% (P = 0.032), PY 5.43% and PY concept 0.00% (P > 0.05)
In [51]:
# Stability check: the cell types of each fit variant of acg-fit-yield, and the tie rules of fig1e.
rows = []
for vname, ty in TYPESV.items():
    TGv = {"IN": np.where(ty == "IN")[0], "IN concept": np.where((ty == "IN") & CONCEPT)[0],
           "PY": np.where(ty == "PY")[0], "PY concept": np.where((ty == "PY") & CONCEPT)[0]}
    for key in [("load", "matched", "shared"), ("load", "matched", "within"), ("load", "all", "within")]:
        (real, null), _, _ = GLM[key]
        for ties in ["raw", "in", "out"]:
            df = wm.glm_groups(real, null, TGv, ties=ties)[0].set_index("group")
            rows.append({"fit": vname, "trials": key[1], "perm": key[2], "ties": ties,
                         **{f"{g} %": round(df.at[g, "percent"], 2) for g in TGv}, **{f"{g} p": round(df.at[g, "p"], 3) for g in TGv},
                         "IN concept n": int(df.at["IN concept", "n"])})
FE = pd.DataFrame(rows)
FE["criterion met"] = (FE["IN %"].between(14.36 - 1.436, 14.36 + 1.436) & (FE["IN p"] < 0.05)
                       & FE["IN concept %"].between(21.42 - 2.142, 21.42 + 2.142) & (FE["IN concept p"] < 0.05)
                       & (FE["PY p"] >= 0.05) & (FE["PY concept p"] >= 0.05))
print(FE.to_string(index=False))
print("\nfits under which the criterion is met by at least one reading:",
      FE[FE.ties == "raw"].groupby("fit")["criterion met"].any().to_dict())
               fit  trials   perm ties  IN %  IN concept %  PY %  PY concept %  IN p  IN concept p  PY p  PY concept p  IN concept n  criterion met
              main matched shared  raw 13.95         18.75  5.88           0.0 0.001         0.042 0.426           1.0            16          False
              main matched shared   in 13.95         18.75  5.88           0.0 0.001         0.044 0.477           1.0            16          False
              main matched shared  out 13.95         18.75  5.88           0.0 0.000         0.039 0.334           1.0            16          False
              main matched within  raw 13.02         18.75  5.88           0.0 0.000         0.045 0.423           1.0            16          False
              main matched within   in 13.02         18.75  5.88           0.0 0.000         0.047 0.477           1.0            16          False
              main matched within  out 12.56         18.75  5.88           0.0 0.000         0.037 0.316           1.0            16          False
              main     all within  raw 17.21         25.00  7.84           0.0 0.000         0.006 0.157           1.0            16          False
              main     all within   in 17.21         25.00  8.82           0.0 0.000         0.008 0.098           1.0            16          False
              main     all within  out 17.21         25.00  7.84           0.0 0.000         0.004 0.099           1.0            16          False
start x (1 + 1e-9) matched shared  raw 14.02         20.00  5.88           0.0 0.001         0.038 0.428           1.0            15           True
start x (1 + 1e-9) matched shared   in 14.02         20.00  5.88           0.0 0.001         0.040 0.478           1.0            15           True
start x (1 + 1e-9) matched shared  out 14.02         20.00  5.88           0.0 0.000         0.036 0.338           1.0            15           True
start x (1 + 1e-9) matched within  raw 13.08         20.00  5.88           0.0 0.000         0.039 0.422           1.0            15           True
start x (1 + 1e-9) matched within   in 13.08         20.00  5.88           0.0 0.000         0.040 0.474           1.0            15           True
start x (1 + 1e-9) matched within  out 12.62         20.00  5.88           0.0 0.000         0.032 0.315           1.0            15          False
start x (1 + 1e-9)     all within  raw 17.29         26.67  7.84           0.0 0.000         0.005 0.156           1.0            15          False
start x (1 + 1e-9)     all within   in 17.29         26.67  8.82           0.0 0.000         0.007 0.097           1.0            15          False
start x (1 + 1e-9)     all within  out 17.29         26.67  7.84           0.0 0.000         0.004 0.102           1.0            15          False
start x (1 - 1e-9) matched shared  raw 13.95         18.75  5.94           0.0 0.001         0.042 0.417           1.0            16          False
start x (1 - 1e-9) matched shared   in 13.95         18.75  5.94           0.0 0.001         0.044 0.472           1.0            16          False
start x (1 - 1e-9) matched shared  out 13.95         18.75  5.94           0.0 0.000         0.039 0.327           1.0            16          False
start x (1 - 1e-9) matched within  raw 13.02         18.75  5.94           0.0 0.000         0.045 0.417           1.0            16          False
start x (1 - 1e-9) matched within   in 13.02         18.75  5.94           0.0 0.000         0.047 0.466           1.0            16          False
start x (1 - 1e-9) matched within  out 12.56         18.75  5.94           0.0 0.000         0.037 0.308           1.0            16          False
start x (1 - 1e-9)     all within  raw 17.21         25.00  7.92           0.0 0.000         0.006 0.153           1.0            16          False
start x (1 - 1e-9)     all within   in 17.21         25.00  8.91           0.0 0.000         0.008 0.093           1.0            16          False
start x (1 - 1e-9)     all within  out 17.21         25.00  7.92           0.0 0.000         0.004 0.097           1.0            16          False
 ACG x (1 + 1e-12) matched shared  raw 14.15         20.00  5.83           0.0 0.001         0.038 0.437           1.0            15           True
 ACG x (1 + 1e-12) matched shared   in 14.15         20.00  5.83           0.0 0.001         0.040 0.489           1.0            15           True
 ACG x (1 + 1e-12) matched shared  out 14.15         20.00  5.83           0.0 0.000         0.036 0.347           1.0            15           True
 ACG x (1 + 1e-12) matched within  raw 13.21         20.00  5.83           0.0 0.000         0.039 0.432           1.0            15           True
 ACG x (1 + 1e-12) matched within   in 13.21         20.00  5.83           0.0 0.000         0.040 0.479           1.0            15           True
 ACG x (1 + 1e-12) matched within  out 12.74         20.00  5.83           0.0 0.000         0.032 0.329           1.0            15          False
 ACG x (1 + 1e-12)     all within  raw 17.45         26.67  7.77           0.0 0.000         0.005 0.163           1.0            15          False
 ACG x (1 + 1e-12)     all within   in 17.45         26.67  8.74           0.0 0.000         0.007 0.101           1.0            15          False
 ACG x (1 + 1e-12)     all within  out 17.45         26.67  7.77           0.0 0.000         0.004 0.112           1.0            15          False

fits under which the criterion is met by at least one reading: {'ACG x (1 + 1e-12)': True, 'main': False, 'start x (1 + 1e-9)': True, 'start x (1 - 1e-9)': False}

Result: partially reproduced. With the types of reading (a), matched trials and the shared permutation, IN are load-modulated (13.95%, 30 of 215, p = 0.001), within tolerance, and so are IN concept cells (18.75%, 3 of 16, p = 0.042), just below the tolerance of 19.28 to 23.56%, while PY (5.88%, p = 0.43) and PY concept cells (0%, p = 1.0) are not. With the within-participant permutation IN concept cells give 18.75% too, and with all trials 25.00% (4 of 16), above the tolerance; the tie rule of fig1e does not change the IN concept count. The cell types move with rounding: two of the four fits of the stability check (the start point x (1 + 1e-9) and the ACG x (1 + 1e-12)) give 15 IN concept cells, of which 3 are load-modulated with matched trials (20.00%, p 0.032 to 0.040, with IN 13.08 to 14.15%), and meet the criterion; the main fit and the start point x (1 - 1e-9) give 16 IN concept cells and 18.75% with matched trials under every permutation and tie rule. With reading (b) of the types (14 IN concept cells, the paper's number), matched trials, 2 are significant (14.29%, p = 0.15) under either permutation; with all trials 3 are (21.43%, p = 0.032, within tolerance), but then IN give 17.68%, above tolerance (PY 9.00%, p = 0.075). The load modulation of IN and IN concept cells, and its absence in PY, hold under every fit; the IN concept percentage that the criterion tests is within tolerance under two of the four fits but not under the main one, so the claim holds in part.

fig6f-rt-modulation-in-concept¶

Interneuron concept cells were modulated by reaction time during maintenance (35.71%), but not all interneurons, and pyramidal neurons showed no significant RT modulation in either the full population or the concept subset.

In [52]:
for key in [("rt", "matched", "shared"), ("rt", "matched", "within"), ("rt", "all", "within"),
            ("rt_code", "matched", "shared"), ("rt_code", "matched", "within")]:
    (real, null), _, _ = GLM[key]
    label = "own RT" if key[0] == "rt" else "variant, subject 1's RT vector"
    for tlab, groups in [("a", TG), ("b", TGb)]:
        df, _ = wm.glm_groups(real, null, groups)
        print(f"types ({tlab}), {label}, trials {key[1]}, permutation {key[2]}:")
        print(df.round(3).to_string(index=False))
print("paper: IN concept 35.71% (P = 0.002); IN, PY, PY concept P > 0.05")
types (a), own RT, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 215           32   14.884      10.75 0.000
IN concept  16            2   12.500       0.80 0.190
        PY 102           13   12.745       5.10 0.005
PY concept  11            0    0.000       0.55 1.000
types (b), own RT, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 198           32   16.162       9.90 0.000
IN concept  14            2   14.286       0.70 0.154
        PY 100           12   12.000       5.00 0.007
PY concept  11            0    0.000       0.55 1.000
types (a), own RT, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 215           31   14.419      10.75 0.000
IN concept  16            2   12.500       0.80 0.195
        PY 102           12   11.765       5.10 0.014
PY concept  11            0    0.000       0.55 1.000
types (b), own RT, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 198           31   15.657       9.90 0.000
IN concept  14            2   14.286       0.70 0.163
        PY 100           11   11.000       5.00 0.024
PY concept  11            0    0.000       0.55 1.000
types (a), own RT, trials all, permutation within:
     group   n  significant  percent  null_mean     p
        IN 215           33   15.349      10.75 0.000
IN concept  16            2   12.500       0.80 0.191
        PY 102           11   10.784       5.10 0.024
PY concept  11            0    0.000       0.55 1.000
types (b), own RT, trials all, permutation within:
     group   n  significant  percent  null_mean     p
        IN 198           32   16.162       9.90 0.000
IN concept  14            2   14.286       0.70 0.159
        PY 100           10   10.000       5.00 0.044
PY concept  11            0    0.000       0.55 1.000
types (a), variant, subject 1's RT vector, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 215           17    7.907      10.75 0.086
IN concept  16            5   31.250       0.80 0.001
        PY 102            6    5.882       5.10 0.402
PY concept  11            0    0.000       0.55 1.000
types (b), variant, subject 1's RT vector, trials matched, permutation shared:
     group   n  significant  percent  null_mean     p
        IN 198           18    9.091       9.90 0.030
IN concept  14            5   35.714       0.70 0.001
        PY 100            5    5.000       5.00 0.561
PY concept  11            0    0.000       0.55 1.000
types (a), variant, subject 1's RT vector, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 215           18    8.372      10.75 0.040
IN concept  16            4   25.000       0.80 0.007
        PY 102            7    6.863       5.10 0.268
PY concept  11            0    0.000       0.55 1.000
types (b), variant, subject 1's RT vector, trials matched, permutation within:
     group   n  significant  percent  null_mean     p
        IN 198           18    9.091       9.90 0.023
IN concept  14            4   28.571       0.70 0.005
        PY 100            6    6.000       5.00 0.374
PY concept  11            0    0.000       0.55 1.000
paper: IN concept 35.71% (P = 0.002); IN, PY, PY concept P > 0.05

Result: not reproduced. With each trial's own RT, IN concept cells give 12.50% (p 0.19 to 0.20) and PY are significant (p 0.005 to 0.024). With the types of reading (b) IN concept cells give 14.29% (p 0.15 to 0.16) and PY are significant (p 0.007 to 0.044). The code's predictor (subject 1's RT vector, outside the criterion) gives IN concept cells 31.25% (types a, p = 0.001), just below tolerance, with IN (p 0.086), PY (0.40) and PY concept cells not significant under the shared permutation, and 35.71% (types b), the paper's value, with all IN then significant (p 0.023 and 0.030).

fig6gh-in-concept-cv2¶

Interneuron concept cells had higher CV2 during maintenance than encoding on preferred load 1 trials but not on nonpreferred trials, while pyramidal concept cells showed stable CV2.

Holt's CV2 of the interspike intervals of each cell's spikes concatenated over preferred (or nonpreferred) trials, in encoding (first image, 1 s) and maintenance (2.5 s); trials of load 1 (Results) or of all loads (the code). Readings for PY: (a) encoding against maintenance within each trial type; (b) preferred against nonpreferred within each epoch.

In [53]:
def cv2_cell(n, loads, pref_flag, epoch, within=False):
    t = T[NT["sub"].iat[n]]
    t = t[t.load.isin(loads)]
    pm = pref_mask(t, PREF[n], 1) if loads == [1] else ((t.img1 == PREF[n]) | ((t.load >= 2) & (t.img2 == PREF[n])) | ((t.load == 3) & (t.img3 == PREF[n]))).values
    t = t[pm if pref_flag else ~pm]
    on, win = (t.enc1.values, 1.0) if epoch == "enc" else (t.maint.values, 2.5)
    sp = wm.epoch_spikes(SPK[n], on, on + win, win)
    if within:
        # only interspike intervals within a trial, pairs of consecutive intervals within a trial
        v = [2 * np.abs(np.diff(d)) / (d[1:] + d[:-1]) for d in (np.diff(x) for x in sp) if len(d) > 1]
        return float(np.mean(np.concatenate(v))) if v else np.nan
    return wm.cv2_holt(np.diff(wm.concat_trials(sp, win)))


for tlab, within, loads, lname in [("a", False, [1], "load 1"), ("a", False, [1, 2, 3], "all loads"),
                                    ("b", False, [1], "load 1"), ("b", False, [1, 2, 3], "all loads"),
                                    ("a", True, [1], "load 1"), ("a", True, [1, 2, 3], "all loads")]:
    print(f"\ntypes ({tlab}), {'intervals within trials only' if within else 'trials concatenated'}:")
    for ty_ in ["IN", "PY"]:
        cells = np.where(CONCEPT & (TYPES[tlab] == ty_))[0]
        vals = {(pf, ep): np.array([cv2_cell(n, loads, pf, ep, within) for n in cells]) for pf in [True, False] for ep in ["enc", "maint"]}
        for pf in [True, False]:
            a, b = vals[(pf, "enc")], vals[(pf, "maint")]
            ok = np.isfinite(a) & np.isfinite(b)
            w = wilcoxon(b[ok], a[ok])
            print(f"{lname}, {ty_} concept, {'preferred' if pf else 'nonpreferred'}: n {ok.sum()}, CV2 median encoding {np.median(a[ok]):.3f}, "
                  f"maintenance {np.median(b[ok]):.3f}, maintenance higher in {(b[ok] > a[ok]).sum()}; W = {w.statistic:.1f}, p = {w.pvalue:.4f}")
        if ty_ == "PY":
            for ep in ["enc", "maint"]:
                a, b = vals[(True, ep)], vals[(False, ep)]
                ok = np.isfinite(a) & np.isfinite(b)
                w = wilcoxon(a[ok], b[ok])
                print(f"   reading (b), PY {ep}: preferred vs nonpreferred W = {w.statistic:.1f}, p = {w.pvalue:.4f}")
print("paper: IN preferred W = 13.0, P = 0.032; IN nonpreferred W = 50.0, P > 0.05; PY all P > 0.05")
types (a), trials concatenated:
load 1, IN concept, preferred: n 16, CV2 median encoding 0.964, maintenance 0.969, maintenance higher in 7; W = 64.0, p = 0.8603
load 1, IN concept, nonpreferred: n 16, CV2 median encoding 1.008, maintenance 1.027, maintenance higher in 9; W = 63.0, p = 0.8209
load 1, PY concept, preferred: n 11, CV2 median encoding 1.343, maintenance 1.244, maintenance higher in 4; W = 25.0, p = 0.5195
load 1, PY concept, nonpreferred: n 10, CV2 median encoding 1.220, maintenance 1.257, maintenance higher in 4; W = 25.0, p = 0.8457
   reading (b), PY enc: preferred vs nonpreferred W = 19.0, p = 0.4316
   reading (b), PY maint: preferred vs nonpreferred W = 24.0, p = 0.4648

types (a), trials concatenated:
all loads, IN concept, preferred: n 16, CV2 median encoding 0.969, maintenance 1.005, maintenance higher in 11; W = 38.0, p = 0.1297
all loads, IN concept, nonpreferred: n 16, CV2 median encoding 1.027, maintenance 1.025, maintenance higher in 8; W = 67.0, p = 0.9799
all loads, PY concept, preferred: n 11, CV2 median encoding 1.254, maintenance 1.199, maintenance higher in 4; W = 20.0, p = 0.2783
all loads, PY concept, nonpreferred: n 10, CV2 median encoding 1.192, maintenance 1.251, maintenance higher in 4; W = 25.0, p = 0.8457
   reading (b), PY enc: preferred vs nonpreferred W = 25.0, p = 0.8457
   reading (b), PY maint: preferred vs nonpreferred W = 16.0, p = 0.1475

types (b), trials concatenated:
load 1, IN concept, preferred: n 14, CV2 median encoding 0.922, maintenance 0.956, maintenance higher in 7; W = 45.0, p = 0.6698
load 1, IN concept, nonpreferred: n 14, CV2 median encoding 1.008, maintenance 1.027, maintenance higher in 8; W = 50.0, p = 0.9032
load 1, PY concept, preferred: n 11, CV2 median encoding 1.343, maintenance 1.244, maintenance higher in 4; W = 29.0, p = 0.7646
load 1, PY concept, nonpreferred: n 10, CV2 median encoding 1.220, maintenance 1.203, maintenance higher in 4; W = 26.0, p = 0.9219
   reading (b), PY enc: preferred vs nonpreferred W = 22.0, p = 0.6250
   reading (b), PY maint: preferred vs nonpreferred W = 25.0, p = 0.5195

types (b), trials concatenated:
all loads, IN concept, preferred: n 14, CV2 median encoding 0.963, maintenance 1.000, maintenance higher in 9; W = 33.0, p = 0.2412
all loads, IN concept, nonpreferred: n 14, CV2 median encoding 1.027, maintenance 1.015, maintenance higher in 6; W = 42.0, p = 0.5416
all loads, PY concept, preferred: n 11, CV2 median encoding 1.254, maintenance 1.199, maintenance higher in 5; W = 21.0, p = 0.3203
all loads, PY concept, nonpreferred: n 10, CV2 median encoding 1.192, maintenance 1.251, maintenance higher in 4; W = 26.0, p = 0.9219
   reading (b), PY enc: preferred vs nonpreferred W = 26.0, p = 0.9219
   reading (b), PY maint: preferred vs nonpreferred W = 21.0, p = 0.3203

types (a), intervals within trials only:
load 1, IN concept, preferred: n 16, CV2 median encoding 0.912, maintenance 0.944, maintenance higher in 12; W = 37.0, p = 0.1167
load 1, IN concept, nonpreferred: n 16, CV2 median encoding 0.979, maintenance 1.017, maintenance higher in 9; W = 68.0, p = 1.0000
load 1, PY concept, preferred: n 10, CV2 median encoding 1.361, maintenance 1.145, maintenance higher in 4; W = 21.0, p = 0.5566
load 1, PY concept, nonpreferred: n 8, CV2 median encoding 1.019, maintenance 1.174, maintenance higher in 4; W = 12.0, p = 0.4609
   reading (b), PY enc: preferred vs nonpreferred W = 3.0, p = 0.0391
   reading (b), PY maint: preferred vs nonpreferred W = 15.0, p = 0.2324

types (a), intervals within trials only:
all loads, IN concept, preferred: n 16, CV2 median encoding 0.878, maintenance 0.977, maintenance higher in 13; W = 14.0, p = 0.0034
all loads, IN concept, nonpreferred: n 16, CV2 median encoding 0.977, maintenance 1.002, maintenance higher in 9; W = 48.0, p = 0.3225
all loads, PY concept, preferred: n 10, CV2 median encoding 1.082, maintenance 1.116, maintenance higher in 8; W = 7.0, p = 0.0371
all loads, PY concept, nonpreferred: n 9, CV2 median encoding 1.100, maintenance 1.059, maintenance higher in 4; W = 17.0, p = 0.5703
   reading (b), PY enc: preferred vs nonpreferred W = 18.0, p = 0.6523
   reading (b), PY maint: preferred vs nonpreferred W = 25.0, p = 0.8457
paper: IN preferred W = 13.0, P = 0.032; IN nonpreferred W = 50.0, P > 0.05; PY all P > 0.05

Result: not reproduced. IN concept cells do not have higher CV2 in maintenance than in encoding on preferred trials (load 1 p = 0.86; all loads p = 0.13). The PY and nonpreferred parts hold (no comparison with p < 0.05). With the types of reading (b) IN preferred p = 0.67 (load 1) and 0.24 (all loads). Concatenating trials adds intervals that cross trial boundaries; counting only intervals within trials (a variant outside the criterion's method) gives IN preferred maintenance above encoding with p = 0.12 at load 1 and 0.0034 over all loads, IN nonpreferred p 0.32 to 1.0, and PY preferred against nonpreferred p 0.039 to 0.85, and PY preferred encoding against maintenance p = 0.037 over all loads.

ext5gh-py-decay-preferred¶

Pyramidal concept cells showed increased decay time constants on preferred trials during encoding and maintenance, an effect absent in interneurons.

tau_decay of the CellExplorer fit (acg-fit-yield) to the narrow ACG of each concept cell's spikes in the epoch of preferred (or nonpreferred) trials, concatenated; preferred against nonpreferred by a two-sided Wilcoxon signed-rank test over cells (a paired t-test as a variant); load 1 or all loads. The claims file takes this reading of "decay time constants" and the outcome rests on it.

In [54]:
def decay_cell(n, loads, pref_flag, epoch):
    t = T[NT["sub"].iat[n]]
    t = t[t.load.isin(loads)]
    pm = ((t.img1 == PREF[n]) | ((t.load >= 2) & (t.img2 == PREF[n])) | ((t.load == 3) & (t.img3 == PREF[n]))).values
    if loads == [1]:
        pm = (t.img1 == PREF[n]).values
    t = t[pm if pref_flag else ~pm]
    on, win = (t.enc1.values, 1.0) if epoch == "enc" else (t.maint.values, 2.5)
    s = wm.concat_trials(wm.epoch_spikes(SPK[n], on, on + win, win), win)
    if len(s) < 3:
        return np.nan, len(s)
    f = wm.fit_acg(wm.acg(np.sort(s), 0.0005, 201))
    return f["tau_decay"], len(s)


for tlab, loads, lname in [("a", [1], "load 1"), ("a", [1, 2, 3], "all loads"), ("b", [1], "load 1"), ("b", [1, 2, 3], "all loads")]:
    for ty_ in ["PY", "IN"]:
        cells = np.where(CONCEPT & (TYPES[tlab] == ty_))[0]
        for ep in ["enc", "maint"]:
            a = np.array([decay_cell(n, loads, True, ep) for n in cells])
            b = np.array([decay_cell(n, loads, False, ep) for n in cells])
            ok = np.isfinite(a[:, 0]) & np.isfinite(b[:, 0])
            w = wilcoxon(a[ok, 0], b[ok, 0])
            tt = stats.ttest_rel(a[ok, 0], b[ok, 0])
            print(f"types ({tlab}), {lname}, {ty_} concept, {ep}: n {ok.sum()} (spikes per cell, preferred median {np.median(a[:, 1]):.0f}); "
                  f"tau_decay median preferred {np.median(a[ok, 0]):.2f} ms, nonpreferred {np.median(b[ok, 0]):.2f}; "
                  f"preferred larger in {(a[ok, 0] > b[ok, 0]).sum()}; Wilcoxon W = {w.statistic:.1f}, p = {w.pvalue:.4f}; paired t p = {tt.pvalue:.4f}")
print("paper: PY preferred larger in encoding and maintenance, Pmax = 0.029; IN all P > 0.05")
types (a), load 1, PY concept, enc: n 10 (spikes per cell, preferred median 25); tau_decay median preferred 13.38 ms, nonpreferred 12.25; preferred larger in 4; Wilcoxon W = 19.0, p = 0.7344; paired t p = 0.2994
types (a), load 1, PY concept, maint: n 11 (spikes per cell, preferred median 34); tau_decay median preferred 17.20 ms, nonpreferred 10.30; preferred larger in 7; Wilcoxon W = 17.0, p = 0.3223; paired t p = 0.4422
types (a), load 1, IN concept, enc: n 16 (spikes per cell, preferred median 62); tau_decay median preferred 24.52 ms, nonpreferred 23.72; preferred larger in 8; Wilcoxon W = 59.0, p = 0.6685; paired t p = 0.1755
types (a), load 1, IN concept, maint: n 16 (spikes per cell, preferred median 108); tau_decay median preferred 21.40 ms, nonpreferred 15.43; preferred larger in 6; Wilcoxon W = 50.0, p = 0.3755; paired t p = 0.1402
types (a), all loads, PY concept, enc: n 10 (spikes per cell, preferred median 90); tau_decay median preferred 16.23 ms, nonpreferred 4.85; preferred larger in 7; Wilcoxon W = 19.0, p = 0.4316; paired t p = 0.4350
types (a), all loads, PY concept, maint: n 11 (spikes per cell, preferred median 164); tau_decay median preferred 29.72 ms, nonpreferred 7.78; preferred larger in 6; Wilcoxon W = 12.0, p = 0.1309; paired t p = 0.0499
types (a), all loads, IN concept, enc: n 16 (spikes per cell, preferred median 269); tau_decay median preferred 45.40 ms, nonpreferred 13.22; preferred larger in 10; Wilcoxon W = 46.0, p = 0.2744; paired t p = 0.6612
types (a), all loads, IN concept, maint: n 16 (spikes per cell, preferred median 616); tau_decay median preferred 14.07 ms, nonpreferred 6.47; preferred larger in 11; Wilcoxon W = 31.0, p = 0.0577; paired t p = 0.3690
types (b), load 1, PY concept, enc: n 10 (spikes per cell, preferred median 25); tau_decay median preferred 27.63 ms, nonpreferred 10.46; preferred larger in 5; Wilcoxon W = 13.0, p = 0.3008; paired t p = 0.1314
types (b), load 1, PY concept, maint: n 11 (spikes per cell, preferred median 50); tau_decay median preferred 17.20 ms, nonpreferred 10.30; preferred larger in 6; Wilcoxon W = 19.0, p = 0.4316; paired t p = 0.4685
types (b), load 1, IN concept, enc: n 14 (spikes per cell, preferred median 64); tau_decay median preferred 19.21 ms, nonpreferred 31.90; preferred larger in 6; Wilcoxon W = 38.0, p = 0.3910; paired t p = 0.1383
types (b), load 1, IN concept, maint: n 14 (spikes per cell, preferred median 112); tau_decay median preferred 21.40 ms, nonpreferred 15.43; preferred larger in 6; Wilcoxon W = 44.0, p = 0.6257; paired t p = 0.2350
types (b), all loads, PY concept, enc: n 10 (spikes per cell, preferred median 95); tau_decay median preferred 17.91 ms, nonpreferred 6.75; preferred larger in 7; Wilcoxon W = 17.0, p = 0.3223; paired t p = 0.2327
types (b), all loads, PY concept, maint: n 11 (spikes per cell, preferred median 222); tau_decay median preferred 25.73 ms, nonpreferred 7.78; preferred larger in 5; Wilcoxon W = 16.0, p = 0.2754; paired t p = 0.0602
types (b), all loads, IN concept, enc: n 14 (spikes per cell, preferred median 294); tau_decay median preferred 34.73 ms, nonpreferred 13.84; preferred larger in 8; Wilcoxon W = 42.0, p = 0.5416; paired t p = 0.9663
types (b), all loads, IN concept, maint: n 14 (spikes per cell, preferred median 663); tau_decay median preferred 14.07 ms, nonpreferred 6.85; preferred larger in 10; Wilcoxon W = 24.0, p = 0.0785; paired t p = 0.3926
paper: PY preferred larger in encoding and maintenance, Pmax = 0.029; IN all P > 0.05

Result: not reproduced. Under the reading of the claims file (ACG tau_decay on preferred and nonpreferred spikes), PY concept cells show no preferred-trial increase in either epoch (Wilcoxon p 0.13 to 0.73), and no IN comparison has p < 0.05 (smallest 0.058, all loads, maintenance). With the types of reading (b) PY p are 0.28 to 0.43. The fits use 25 to 50 spikes per cell at load 1 (medians), which makes tau_decay per trial type a weak measure. The outcome rests on the claims file's reading.

fig6i-py-bin-width-decoding¶

Pyramidal concept cells did not decode the image above chance during load 1 maintenance with 250 and 500 ms bins (26.67%, 23.33%) but did with 750 and 1000 ms bins (40.00%, 43.33%).

The analysis of fig2f with the PY concept cells as the pseudo-population, BH over 12 tests.

In [55]:
CPY = np.where(CONCEPT & (TY == "PY"))[0]
CIN = np.where(CONCEPT & (TY == "IN"))[0]
BW["PY"] = bw_run("PY", CPY)
BW["IN"] = bw_run("IN", CIN)
CPY_B = np.where(CONCEPT & (TYPES["b"] == "PY"))[0]
CIN_B = np.where(CONCEPT & (TYPES["b"] == "IN"))[0]
BW["PY_b"] = bw_run("PY_b", CPY_B)
BW["IN_b"] = bw_run("IN_b", CIN_B)
print(f"PY concept cells {len(CPY)}, IN concept cells {len(CIN)}; types (b): PY {len(CPY_B)} ({len(set(CPY_B) & set(CPY))} shared), "
      f"IN {len(CIN_B)} ({len(set(CIN_B) & set(CIN))} shared)")
print(BW["PY"][1].to_string(index=False))
print("types (b):")
print(BW["PY_b"][1].to_string(index=False))
print("paper: 26.67, 23.33 (P > 0.05), 40.00, 43.33% (P = 0.030)")
PY concept cells 11, IN concept cells 16; types (b): PY 11 (10 shared), IN 14 (14 shared)
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p  p_binom20     p_BH
   code     1       250      30      1001       33.33        14.84 0.016983   0.061087 0.071928
   code     1       500      30       891       23.33        15.59 0.192807   0.393030 0.385614
   code     1       750      30       781       36.67        16.35 0.017982   0.025616 0.071928
   code     1      1000      30       671       43.33        17.13 0.004995   0.003111 0.059940
   code     2       250      25      1001       16.00        13.28 0.429570   0.766007 0.572761
   code     2       500      25       891       20.00        14.74 0.308691   0.579326 0.490010
   code     2       750      25       781       20.00        15.24 0.326673   0.579326 0.490010
   code     2      1000      25       671       16.00        16.22 0.566434   0.766007 0.679720
   code     3       250      20      1001       20.00        11.30 0.179820   0.588551 0.385614
   code     3       500      20       891       25.00        13.14 0.104895   0.370352 0.314685
   code     3       750      20       781       10.00        13.44 0.739261   0.930825 0.806466
   code     3      1000      20       671        5.00        15.10 0.946054   0.988471 0.946054
   rank     1       250      30      1001       33.33        14.81 0.015984   0.061087 0.131868
   rank     1       500      30       891       33.33        15.76 0.021978   0.061087 0.131868
   rank     1       750      30       781       23.33        16.67 0.242757   0.393030 0.717568
   rank     1      1000      30       671       23.33        17.06 0.266733   0.393030 0.717568
   rank     2       250      30      1001       10.00        14.92 0.810190   0.955821 0.995005
   rank     2       500      30       891        6.67        16.19 0.945055   0.989478 0.995005
   rank     2       750      30       781        6.67        16.46 0.943057   0.989478 0.995005
   rank     2      1000      30       671        3.33        16.87 0.995005   0.998762 0.995005
   rank     3       250      30      1001       16.67        14.20 0.418581   0.744767 0.717568
   rank     3       500      30       891       20.00        15.22 0.305694   0.572488 0.717568
   rank     3       750      30       781       20.00        16.48 0.382617   0.572488 0.717568
   rank     3      1000      30       671       16.67        16.90 0.568432   0.744767 0.852647
types (b):
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p  p_binom20     p_BH
   code     1       250      30      1001       30.00        15.10 0.042957   0.128651 0.171828
   code     1       500      30       891       23.33        16.10 0.188811   0.393030 0.483516
   code     1       750      30       781       36.67        16.90 0.017982   0.025616 0.107892
   code     1      1000      30       671       40.00        17.00 0.007992   0.009493 0.095904
   code     2       250      25      1001        8.00        13.54 0.826174   0.972610 0.826174
   code     2       500      25       891       20.00        14.12 0.283716   0.579326 0.483516
   code     2       750      25       781       20.00        15.76 0.362637   0.579326 0.483516
   code     2      1000      25       671       20.00        15.87 0.349650   0.579326 0.483516
   code     3       250      20      1001       20.00        11.66 0.219780   0.588551 0.483516
   code     3       500      20       891       20.00        12.97 0.243756   0.588551 0.483516
   code     3       750      20       781       15.00        13.87 0.523477   0.793915 0.628172
   code     3      1000      20       671       10.00        14.52 0.782218   0.930825 0.826174
   rank     1       250      30      1001       26.67        14.78 0.097902   0.239209 0.505894
   rank     1       500      30       891       23.33        15.38 0.181818   0.393030 0.505894
   rank     1       750      30       781       26.67        16.83 0.143856   0.239209 0.505894
   rank     1      1000      30       671       30.00        17.40 0.098901   0.128651 0.505894
   rank     2       250      30      1001        6.67        14.84 0.932068   0.989478 0.954046
   rank     2       500      30       891        6.67        15.63 0.954046   0.989478 0.954046
   rank     2       750      30       781        6.67        16.38 0.945055   0.989478 0.954046
   rank     2      1000      30       671       10.00        16.55 0.868132   0.955821 0.954046
   rank     3       250      30      1001       16.67        14.76 0.449550   0.744767 0.899101
   rank     3       500      30       891       23.33        15.47 0.210789   0.393030 0.505894
   rank     3       750      30       781       16.67        16.80 0.583417   0.744767 0.954046
   rank     3      1000      30       671       13.33        16.87 0.722278   0.877289 0.954046
paper: 26.67, 23.33 (P > 0.05), 40.00, 43.33% (P = 0.030)

Result: not reproduced. With the code's table PY concept cells (11) give 33.33, 23.33, 36.67 and 43.33%, but none survives BH (p 0.060 to 0.39), so the 750 and 1000 ms accuracies are not significant; reading (b) gives 33.33, 33.33, 23.33 and 23.33%, none significant. With the types of reading (b) (11 PY concept cells) the code's table gives 30.00, 23.33, 36.67 and 40.00% with BH p 0.096 to 0.48, so again no width is significant.

fig6j-in-bin-width-decoding¶

Interneuron concept cells decoded the image above chance during load 1 maintenance at all bin widths (53.33%, 50.00%, 46.67%, 53.33%), less sensitive to bin width than pyramidal cells.

In [56]:
print(BW["IN"][1].to_string(index=False))
print("types (b):")
print(BW["IN_b"][1].to_string(index=False))
print("paper: 53.33, 50.00, 46.67, 53.33% (P = 0.002)")
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p    p_binom20     p_BH
   code     1       250      30      1456       46.67        11.63 0.000999 9.018693e-04 0.001998
   code     1       500      30      1296       53.33        13.90 0.000999 5.238729e-05 0.001998
   code     1       750      30      1136       53.33        14.98 0.000999 5.238729e-05 0.001998
   code     1      1000      30       976       50.00        16.18 0.000999 2.312256e-04 0.001998
   code     2       250      25      1456       32.00        10.38 0.008991 1.091228e-01 0.013487
   code     2       500      25      1296       48.00        13.03 0.000999 1.540051e-03 0.001998
   code     2       750      25      1136       52.00        14.97 0.000999 3.690480e-04 0.001998
   code     2      1000      25       976       48.00        16.18 0.001998 1.540051e-03 0.003425
   code     3       250      20      1456        5.00         6.17 0.687313 9.884708e-01 0.687313
   code     3       500      20      1296       10.00        10.42 0.599401 9.308247e-01 0.653892
   code     3       750      20      1136       15.00        12.86 0.476523 7.939153e-01 0.607792
   code     3      1000      20       976       15.00        13.94 0.506494 7.939153e-01 0.607792
   rank     1       250      30      1456       50.00        12.08 0.000999 2.312256e-04 0.001998
   rank     1       500      30      1296       63.33        14.53 0.000999 2.843247e-07 0.001998
   rank     1       750      30      1136       56.67        15.48 0.000999 1.047205e-05 0.001998
   rank     1      1000      30       976       53.33        15.98 0.000999 5.238729e-05 0.001998
   rank     2       250      25      1456       44.00        10.97 0.001998 5.554920e-03 0.002997
   rank     2       500      25      1296       72.00        13.32 0.000999 2.905474e-08 0.001998
   rank     2       750      25      1136       60.00        14.28 0.000999 1.356484e-05 0.001998
   rank     2      1000      25       976       52.00        15.09 0.001998 3.690480e-04 0.002997
   rank     3       250      20      1456       15.00         6.68 0.179820 7.939153e-01 0.179820
   rank     3       500      20      1296       25.00        10.15 0.079920 3.703517e-01 0.087186
   rank     3       750      20      1136       30.00        11.79 0.035964 1.957922e-01 0.043157
   rank     3      1000      20       976       35.00        12.99 0.026973 8.669251e-02 0.035964
types (b):
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p    p_binom20     p_BH
   code     1       250      30      1274       56.67        12.36 0.000999 1.047205e-05 0.001713
   code     1       500      30      1134       60.00        14.67 0.000999 1.842448e-06 0.001713
   code     1       750      30       994       66.67        15.60 0.000999 3.830524e-08 0.001713
   code     1      1000      30       854       63.33        16.47 0.000999 2.843247e-07 0.001713
   code     2       250      25      1274       40.00        10.84 0.003996 1.733187e-02 0.005994
   code     2       500      25      1134       48.00        13.88 0.000999 1.540051e-03 0.001713
   code     2       750      25       994       52.00        14.92 0.000999 3.690480e-04 0.001713
   code     2      1000      25       854       52.00        15.56 0.000999 3.690480e-04 0.001713
   code     3       250      20      1274        5.00         7.87 0.772228 9.884708e-01 0.772228
   code     3       500      20      1134       15.00        11.32 0.393606 7.939153e-01 0.429389
   code     3       750      20       994       20.00        12.61 0.267732 5.885511e-01 0.356976
   code     3      1000      20       854       20.00        13.86 0.305694 5.885511e-01 0.366833
   rank     1       250      30      1274       43.33        12.74 0.000999 3.111049e-03 0.001713
   rank     1       500      30      1134       56.67        15.04 0.000999 1.047205e-05 0.001713
   rank     1       750      30       994       63.33        15.85 0.000999 2.843247e-07 0.001713
   rank     1      1000      30       854       60.00        16.76 0.000999 1.842448e-06 0.001713
   rank     2       250      25      1274       48.00        11.23 0.000999 1.540051e-03 0.001713
   rank     2       500      25      1134       64.00        13.63 0.000999 2.063915e-06 0.001713
   rank     2       750      25       994       60.00        14.53 0.001998 1.356484e-05 0.002664
   rank     2      1000      25       854       48.00        15.37 0.000999 1.540051e-03 0.001713
   rank     3       250      20      1274       15.00         7.34 0.192807 7.939153e-01 0.192807
   rank     3       500      20      1134       35.00        10.79 0.011988 8.669251e-02 0.013078
   rank     3       750      20       994       40.00        12.84 0.005994 3.214266e-02 0.007193
   rank     3      1000      20       854       50.00        13.20 0.001998 2.594827e-03 0.002664
paper: 53.33, 50.00, 46.67, 53.33% (P = 0.002)

Result: partially reproduced. IN concept cells decode above chance at every width under both trial readings (BH p at most 0.0020), less dependent on width than PY, but two of the four accuracies are outside tolerance under each reading (16 cells; code's table 46.67, 53.33, 53.33 and 50.00%). With the types of reading (b) (14 IN concept cells) every width is significant too (BH p 0.0017), with 56.67, 60.00, 66.67 and 63.33% (code's table) and 43.33, 56.67, 63.33 and 60.00% (reading b), again with two or more values outside tolerance.

fig6kl-cross-temporal-by-type¶

Cross-temporal decoding showed no above-chance generalization for the 11 pyramidal concept cells, while interneuron concept cells decoded above chance in cross-temporal maps.

In [57]:
CT[("PY", 1, "first")] = ct_analysis(CPY, 1, "first")
CT[("IN", 1, "first")] = ct_analysis(CIN, 1, "first")
# types (b), with 200 shuffles for the cluster null (the null of every map above is empty)
CT[("PY_b", 1, "first")] = ct_analysis(CPY_B, 1, "first", n_perm=200)
CT[("IN_b", 1, "first")] = ct_analysis(CIN_B, 1, "first", n_perm=200)
print(pd.concat([summarize_ct(CT[("PY", 1, "first")], "PY concept, load 1"),
                 summarize_ct(CT[("IN", 1, "first")], "IN concept, load 1"),
                 summarize_ct(CT[("PY_b", 1, "first")], "PY concept, types (b)"),
                 summarize_ct(CT[("IN_b", 1, "first")], "IN concept, types (b)")]).to_string(index=False))
                  map binomial cluster_rule  sig_pairs  kept_pairs  kept_offdiag  train_bins_enc_or_early_with_offdiag  max_frac_maint_test_bins_from_a_maint_train_bin  null95_extent  obs_largest_extent shuffled_maps_with_sig_pairs  most_sig_pairs_in_a_shuffled_map
   PY concept, load 1      one         code          0           0             0                                     0                                             0.00            0.0                   0                       2/1000                                 1
   PY concept, load 1      one         perm          0           0             0                                     0                                             0.00            0.0                   0                       2/1000                                 1
   PY concept, load 1      two         code          0           0             0                                     0                                             0.00            0.0                   0                       2/1000                                 1
   PY concept, load 1      two         perm          0           0             0                                     0                                             0.00            0.0                   0                       2/1000                                 1
   IN concept, load 1      one         code        240         170           162                                    18                                             0.23            0.0                  17                       3/1000                                 1
   IN concept, load 1      one         perm        240         240           230                                    18                                             0.27            0.0                  17                       3/1000                                 1
   IN concept, load 1      two         code        240         170           162                                    18                                             0.23            0.0                  17                       3/1000                                 1
   IN concept, load 1      two         perm        240         240           230                                    18                                             0.27            0.0                  17                       3/1000                                 1
PY concept, types (b)      one         code          3           0             0                                     0                                             0.00            0.0                   2                        0/200                                 0
PY concept, types (b)      one         perm          3           3             2                                     2                                             0.00            0.0                   2                        0/200                                 0
PY concept, types (b)      two         code          3           0             0                                     0                                             0.00            0.0                   2                        0/200                                 0
PY concept, types (b)      two         perm          3           3             2                                     2                                             0.00            0.0                   2                        0/200                                 0
IN concept, types (b)      one         code        249         154           149                                    20                                             0.13            0.0                  25                        1/200                                 1
IN concept, types (b)      one         perm        249         249           243                                    20                                             0.26            0.0                  25                        1/200                                 1
IN concept, types (b)      two         code        249         154           149                                    20                                             0.13            0.0                  25                        1/200                                 1
IN concept, types (b)      two         perm        249         249           243                                    20                                             0.26            0.0                  25                        1/200                                 1

Result: reproduced. The PY concept map has no significant pair, so none is kept off the diagonal by either cluster rule, and the IN concept map has 240 significant pairs and keeps 162 to 230 off-diagonal pairs. With the types of reading (b), and 200 shuffles for the cluster null, the PY map has 3 significant pairs, none kept off the diagonal by the code's rule, and the IN map keeps 149 to 243 off-diagonal pairs.

ext5ij-load2-decoding-by-type¶

Interneuron concept cells also decoded the second image in load 2 trials above chance at all bin widths, while pyramidal concept cells did not.

In [58]:
for g in ["IN", "PY", "IN_b", "PY_b"]:
    df = BW[g][1]
    print(f"{g} concept cells, load 2:")
    print(df[df.load == 2].to_string(index=False))
IN concept cells, load 2:
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p    p_binom20     p_BH
   code     2       250      25      1456        32.0        10.38 0.008991 1.091228e-01 0.013487
   code     2       500      25      1296        48.0        13.03 0.000999 1.540051e-03 0.001998
   code     2       750      25      1136        52.0        14.97 0.000999 3.690480e-04 0.001998
   code     2      1000      25       976        48.0        16.18 0.001998 1.540051e-03 0.003425
   rank     2       250      25      1456        44.0        10.97 0.001998 5.554920e-03 0.002997
   rank     2       500      25      1296        72.0        13.32 0.000999 2.905474e-08 0.001998
   rank     2       750      25      1136        60.0        14.28 0.000999 1.356484e-05 0.001998
   rank     2      1000      25       976        52.0        15.09 0.001998 3.690480e-04 0.002997
PY concept cells, load 2:
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p  p_binom20     p_BH
   code     2       250      25      1001       16.00        13.28 0.429570   0.766007 0.572761
   code     2       500      25       891       20.00        14.74 0.308691   0.579326 0.490010
   code     2       750      25       781       20.00        15.24 0.326673   0.579326 0.490010
   code     2      1000      25       671       16.00        16.22 0.566434   0.766007 0.679720
   rank     2       250      30      1001       10.00        14.92 0.810190   0.955821 0.995005
   rank     2       500      30       891        6.67        16.19 0.945055   0.989478 0.995005
   rank     2       750      30       781        6.67        16.46 0.943057   0.989478 0.995005
   rank     2      1000      30       671        3.33        16.87 0.995005   0.998762 0.995005
IN_b concept cells, load 2:
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p  p_binom20     p_BH
   code     2       250      25      1274        40.0        10.84 0.003996   0.017332 0.005994
   code     2       500      25      1134        48.0        13.88 0.000999   0.001540 0.001713
   code     2       750      25       994        52.0        14.92 0.000999   0.000369 0.001713
   code     2      1000      25       854        52.0        15.56 0.000999   0.000369 0.001713
   rank     2       250      25      1274        48.0        11.23 0.000999   0.001540 0.001713
   rank     2       500      25      1134        64.0        13.63 0.000999   0.000002 0.001713
   rank     2       750      25       994        60.0        14.53 0.001998   0.000014 0.002664
   rank     2      1000      25       854        48.0        15.37 0.000999   0.001540 0.001713
PY_b concept cells, load 2:
reading  load  width_ms  trials  features  accuracy_%  null_mean_%        p  p_binom20     p_BH
   code     2       250      25      1001        8.00        13.54 0.826174   0.972610 0.826174
   code     2       500      25       891       20.00        14.12 0.283716   0.579326 0.483516
   code     2       750      25       781       20.00        15.76 0.362637   0.579326 0.483516
   code     2      1000      25       671       20.00        15.87 0.349650   0.579326 0.483516
   rank     2       250      30      1001        6.67        14.84 0.932068   0.989478 0.954046
   rank     2       500      30       891        6.67        15.63 0.954046   0.989478 0.954046
   rank     2       750      30       781        6.67        16.38 0.945055   0.989478 0.954046
   rank     2      1000      30       671       10.00        16.55 0.868132   0.955821 0.954046

Result: reproduced. At load 2 IN concept cells decode above chance at all four widths under both readings (BH p at most 0.013) and PY concept cells at none (BH p at least 0.49). With the types of reading (b) the same holds (IN BH p at most 0.006, PY at least 0.48).

In [59]:
print(f"notebook ran in {(time.time() - T0) / 60:.1f} min")
notebook ran in 36.8 min

Summary¶

Claim Outcome
units-by-region reproduced
behavior-accuracy reproduced
fig1c-accuracy-load1-vs-load3 reproduced
behavior-rt reproduced
rt-in-vs-out-memory reproduced
rt-correct-vs-incorrect reproduced
fig1e-load-modulated-neurons reproduced
fig1f-rt-modulation-not-significant not reproduced
concept-cells-count reproduced
fig2ab-single-cells-not-persistent reproduced
fig2c-population-persistence reproduced
ext1bc-persistence-by-load reproduced
fig2d-cross-temporal-localized reproduced
ext1de-cross-temporal-load23 reproduced
fig2e-maintenance-decoding-amy-mtl reproduced
ext1f-maintenance-decoding-load2 partially reproduced
fig2f-bin-width-decoding partially reproduced
fig2f-bin-width-pairwise not reproduced
ext1g-bin-width-load2 reproduced
fig3abc-trajectory-complexity reproduced (in dpca_kussovska_2025.ipynb)
fig3d-encoding-vs-maintenance-separability reproduced (in dpca_kussovska_2025.ipynb)
fig3h-early-vs-late-maintenance reproduced (in dpca_kussovska_2025.ipynb)
fig4c-encoding-bursts-vs-poisson reproduced (Methods' groups, height rule)
fig4d-maintenance-bursts-vs-poisson reproduced (each trial's own maintenance; the 2.8 s window is confounded)
fig4-acg-group-differences partially reproduced
fig4f-all-cells-epochs partially reproduced
fig4hj-group-epochs partially reproduced
ext2-bursts-loads23 reproduced
acg-fit-yield reproduced
fig5c-cell-type-clusters reproduced
fig5dfh-cluster-features reproduced
fig5gh-burst-index-cv2 reproduced
supp4-rodent-validation reproduced (on the features the code ships)
fig5kl-concept-cell-types reproduced
fig6ab-celltype-bursts-vs-null partially reproduced
fig6cd-celltype-epochs not reproduced
ext5bd-in-load-dependence reproduced
fig6e-load-modulation-in partially reproduced (IN concept share within tolerance under two of four rounding-level fits, not under the main fit)
fig6f-rt-modulation-in-concept not reproduced
fig6gh-in-concept-cv2 not reproduced
ext5gh-py-decay-preferred not reproduced
fig6i-py-bin-width-decoding not reproduced
fig6j-in-bin-width-decoding partially reproduced
fig6kl-cross-temporal-by-type reproduced
ext5ij-load2-decoding-by-type reproduced

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 ACG fit is a Python port of the code's MATLAB functions, with scipy's optimizer, so R2 and the time constants differ for part of the neurons and the cell-type counts differ slightly (102 or 100 PY against 92); later analyses use these types, and each claim on cell types is also shown with the types of reading (b), whose counts match the paper's; no outcome differs between the two. The scipy fit is not stable at the level of rounding: changes of 1e-9 in its start point give 315 or 316 well-fit neurons against 317 and move the types and groups of a few neurons, which explains why counts changed between runs; the fit-dependent results are rerun under each variant, and only fig6e changes (its IN concept share is within tolerance under two of the four fits). The GLM's significance rule compares slopes that are often tied exactly with a null slope, so a few neurons sit on their threshold; the results are shown with ties counted in and out. M1 to M3 are also run as the per-trial thirds of the Fig. 6c legend, a reading the claims file does not list (asked in questions/kussovska-2025.yaml); no outcome changes with it. The concept-cell bootstrap is run with fixed seeds (the code sets none); the set used shares 57 of 58 cells with the code's list. The SVM is libsvm through sklearn's wrapper on a precomputed linear kernel, checked equal to SVC(kernel='linear'). The Poisson GLM is fitted by Newton's method, checked against sklearn. Many method details the paper leaves open were run under each reading the claims file names; outcomes that rest on one of several readings say so. The dPCA analyses are in the second notebook, with the code's design and 100 splits run in parallel. The maintenance burst comparison with the Poisson null uses each trial's own maintenance, as the 2.8 s window makes burst-free trains exceed the null. Decoding p values are the code's, against label-shuffled nulls whose means (9 to 18%) are below the paper's 20% chance; the binomial test against 20% is shown beside them.

What was found about the dataset. The dandiset holds all 902 units of the paper with the paper's region counts, and the paper's code tables link to its trials exactly. The paper's description differs from the files in the number of sessions with 108 trials (six, not five), the fixation durations (up to 1.2 s and longer, not 0.9 to 1.0 s), and the image duration, which varies by session (1.0 to 2.5 s) and is not stated. One trial (subject 9) has a maintenance of 0 s and another a fixation of 31 us. The paper's RT-modulation percentages (Fig. 1f) are reproduced exactly only with the code's predictor, which pairs every neuron with subject 1's reaction times.