Funamizu, Kuhn & Doya (2016) on DANDI:001605¶
Paper: Funamizu A, Kuhn B, Doya K (2016). Neural substrate of dynamic Bayesian inference in the cerebral cortex. Nature Neuroscience 19, 1682-1689, doi:10.1038/nn.4390.
Dataset: DANDI:001605, version 0.251007.0553 (doi:10.48324/dandi.001605/0.251007.0553). The paper cites no dandiset version (it predates the dandiset). This is the only published version and the most recent one; the draft has the same 94 assets and size and was last modified at publication, so it is pinned.
Claims file: claims/001605/10.1038-nn.4390.yaml, written from the version of record (main
text, figure legends, Online Methods and the supplement). The claims file fixes every claim,
its expected values and its criterion; method details it lacks are taken from the paper and
cited where they are used. Readings named O1 to O9 are those of the claims file's header.
| Claim | Tested | Why not |
|---|---|---|
| session-counts, neuron-counts, behaviour-timing, lick-goal-correlation | yes | |
| fig1c-licking-without-sound, supp1-licking-speed | yes | |
| fig1d-muscimol-correlation, fig1e-muscimol-variance, fig1fg-muscimol-no-sound-licking, supp2d-muscimol-overrun, muscimol-locomotion | no | blocked, data missing: the muscimol mice are not in the dandiset |
| sound-responsive-layer3 | no | blocked, data missing: no sound-mapping trials in the files |
| neuron-classes, fig2d-task-relevant-proportions, fig2d-goal-distance-ppc-more, fig2d-after-vs-before, fig2d-layer-distance-preference | yes | |
| fig3b-distance-over-time | no | blocked, too large: the regressions with up to three Gaussian bases over 11 variable sets, estimated in the notebook at about 30 h per reading of O6 and 119 h for the four on one thread, 30 h over four workers |
| supp6-distance-not-sound, tuning-similar-ppc-pm | yes | |
| fig3c-continuous-ramp, fig3c-ppc-ramp-without-sound, supp8a-pm-no-sound, supp8b-slopes-lower-without-sound, supp8c-ppc-steeper-than-pm, supp9-preserved-representation | yes | |
| fig4-above-chance, fig4c-ppc-lower-error, fig4d-map-near-goal, fig4e-ppc-lower-uncertainty, supp11-sound-reduces-error | yes | |
| fig5a-map-follows-continuous, fig5a-map-decreases-without-sound, fig5b-map-slope-lower-without-sound, fig5-layer3-steeper-than-layer2, supp13-map-speed, fig5cd-uncertainty-updating, fig5c-uncertainty-decreases-with-sound, lognormal-decoder-better | yes | |
| svm-correlations | no | blocked, too large: leave-one-trial-out SVMs, estimated in the notebook at about 173 min over four workers for both readings and the four classification readings, and 43 min for one classification reading, against the 37 min the notebook has left |
Where the readings of a method detail that the claims file names give different outcomes, the claim is blocked as methods underspecified, as the claims file's header directs; the result of every reading is shown.
Method details used throughout and where they come from are in the docstring of funamizu.py.
Two choices forced by the data are standard ones: the files hold a lick frequency (1/inter-lick
interval, capped at 10 Hz, held between licks) instead of lick times, so a lick count is the
integral of that frequency and a lick onset is a change of it (its form is shown under
lick-goal-correlation); and distance-aligned activity is interpolated at 0.42 cm bin centres.
Loading¶
Each file is streamed once and reduced, in four worker processes, to its trial table, behaviour per trial, per-neuron statistics of the classification and the decoder's inputs (funamizu.process).
import multiprocessing as mp
from concurrent.futures import ProcessPoolExecutor
import time as _time
import numpy as np
import pandas as pd
import funamizu as F
NB_T0 = _time.time() # start of the run, for the time budget of the claims not run
ASSETS = F.assets()
print(f"dandiset {F.DANDISET} version {F.VERSION}: {len(ASSETS)} files, {sum(a[2] for a in ASSETS) / 1e9:.1f} GB")
import os
for _k in ("OMP_NUM_THREADS", "OPENBLAS_NUM_THREADS", "MKL_NUM_THREADS"):
os.environ[_k] = "1" # one linear-algebra thread per worker process; four would oversubscribe the cores
t0 = _time.time()
with ProcessPoolExecutor(4, mp_context=mp.get_context("spawn")) as ex:
R = list(ex.map(F.process, [a[0] for a in ASSETS], [a[1] for a in ASSETS]))
print(f"streamed and reduced {len(R)} sessions in {(_time.time() - t0) / 60:.1f} min")
dandiset 001605 version 0.251007.0553: 94 files, 35.0 GB
streamed and reduced 94 sessions in 18.6 min
import numpy as np, pandas as pd
from sklearn.cluster import KMeans
LT = np.log10(F.P_TASK)
sessions = pd.DataFrame([dict(i=i, **r["meta"]) for i, r in enumerate(R)])
sessions["group"] = sessions.area + " L" + sessions.layer.astype(str)
GROUPS = ["PPC L2", "PPC L3", "PPC L5", "PM L2", "PM L3", "PM L5"]
def neuron_table():
rows = []
for i, r in enumerate(R):
ns = r["neurons"]; n = len(ns["peak_after"])
d = dict(session=np.full(n, i), roi=np.arange(n), area=r["meta"]["area"], layer=r["meta"]["layer"],
peak_after=ns["peak_after"], dist_pref=ns["dist_pref"])
for k, v in ns.items():
if k.startswith("lp_"):
d[k] = v
rows.append(pd.DataFrame(d))
t = pd.concat(rows, ignore_index=True)
t["group"] = t.area + " L" + t.layer.astype(str)
return t
NT = neuron_table()
PRE16 = np.vstack([r["neurons"]["pre16"] for r in R])
COND = np.concatenate([r["neurons"]["cond"] for r in R]) # neurons x 3 conditions x 160 bins (goal distance ascending)
COND_PREF = np.vstack([r["neurons"]["cond_pref"] for r in R])
READINGS = [(b, s, k) for b in "ab" for s in ("67", "33") for k in "ab"] # O1 baseline, O2 start window, O3 k-means feature
def classify(base, sw, km, seed=0, per_session=False):
"""Classes under one reading of O1 (base), O2 (sw) and O3 (km). k-means runs once on the
after-reaching neurons pooled over sessions, or, with per_session, in each session apart
(a variant: the paper does not say which)."""
t = NT
goal_lp = np.minimum(t[f"lp_goal_{base}"], t[f"lp_dist_{base}"])
lick_lp = t[f"lp_lick_{base}"]
start_sig = (t[f"lp_start_{base}"] < LT) | (t[f"lp_sdist{sw}_{base}"] < LT)
goal_sig = goal_lp < LT
lick_sig = lick_lp < LT
goal_cls = goal_sig & ~(lick_sig & (lick_lp < goal_lp)) # the more significant alignment wins
lick_cls = lick_sig & ~goal_cls
task = start_sig | goal_sig | lick_sig
before = goal_cls & ~t.peak_after
aft = (goal_cls & t.peak_after).values
after = np.zeros(len(t), bool); reward = np.zeros(len(t), bool)
scopes = [aft] if not per_session else [aft & (t.session == i).values for i in range(len(R))]
for sc in scopes:
idx = np.flatnonzero(sc)
if len(idx) < 2:
after[idx] = True # one neuron cannot be split; kept as after-reaching
continue
feat = PRE16[idx] if km == "a" else PRE16[idx].mean(1, keepdims=True)
lab = KMeans(2, n_init=20, random_state=seed).fit_predict(np.nan_to_num(feat))
if len(set(lab)) < 2:
after[idx] = True; continue
hi = np.argmax([np.nanmean(PRE16[idx][lab == c]) for c in (0, 1)])
after[idx[lab == hi]] = True; reward[idx[lab != hi]] = True
return pd.DataFrame(dict(task=task.values, goal_sig=goal_sig.values, lick=lick_cls.values, before=before.values,
after=after, reward=reward, gd=before.values | after))
CLS = {rd: classify(*rd) for rd in READINGS}
CLS_GD = {rd: CLS[rd] for rd in READINGS if rd[1] == "67"} # O2 does not change goal-distance classes
# variant: k-means per session (verifier round 1), shown for the counts and the slope claims
CLS_V = {**CLS_GD, **{rd + ("per session",): classify(*rd, per_session=True) for rd in CLS_GD}}
def klab(rd):
return f"O1 {rd[0]} O3 {rd[2]}" + (", k-means per session" if len(rd) > 3 else "")
from scipy import stats
import pandas as pd
def valid(r):
return r["trials"]["valid"]
COND_NAMES = ["continuous", "intermittent 1", "intermittent 2"]
Data check¶
What was loaded, and each check of the description against the data. The trial table's
goal_distance_cm is the start-to-goal distance; VirtualMovement/move_scan column 0 is the
forward position within the trial in units of 36/430 cm (it starts at 0 in every trial and
reaches the trial's goal distance when the goal is reached); Speed/speed_x is forward speed
in m/s after its conversion factor; Licking/lick_rate is a lick frequency in Hz. Imaging and
behaviour share one 30.9 Hz clock: every series has the same number of frames, and the trial
table's frames sum to that number. The behaviour streams follow the trial clock: the reward
follows the frame where the position passes the goal by tens of milliseconds, and the trial
records end about 8 s after the reward (the paper's ITI is 7 s). The imaging follows it too:
the decoder, trained on dR/R against the goal distance of each frame, estimates distance far
better than the flat prior (claim fig4-above-chance), which an offset between the clocks would
prevent. The description says the files hold "sound on/off indicators"; the data hold only the
start tone. sound_on_off is 1 in exactly one frame per trial, the first, as is any speaker of
stimulus/presentation/speaker_on_matrix (printed below), and every row of
speaker_presentations starts at a trial start and lasts one frame; the table has several rows
per trial start, one per speaker id listed there, which is why it has 1,085 to 1,240 rows for
150 trials (the counts are printed below for every file). Sound and no-sound zones
are therefore computed from the condition and the distance, as the Methods define them.
print("files:", len(R), "| sessions per mouse:", sessions.groupby("subject").size().to_dict())
print("sessions per area and layer:", sessions.groupby("group").size().reindex(GROUPS).to_dict())
print("ROIs per area and layer:", sessions.groupby("group").n_rois.sum().reindex(GROUPS).to_dict(), "total", int(sessions.n_rois.sum()))
print("ROIs per session:", sessions.n_rois.min(), "to", sessions.n_rois.max(), "| frames per session:", sessions["T"].min(), "to", sessions["T"].max())
ntr = [len(r["trials"]["gd"]) for r in R]
print("trials per file:", set(ntr), "| valid trials (reward within 20 s):", sum(int(r["trials"]["valid"].sum()) for r in R), "of", sum(ntr))
st = np.array([np.bincount(r["trials"]["state"], minlength=3) for r in R]).sum(0)
print("trials per condition (continuous, intermittent 1, intermittent 2):", st.tolist(), "shares", np.round(st / st.sum(), 3).tolist(), "(paper 70, 15, 15%)")
gd = np.concatenate([r["trials"]["gd"] for r in R])
print(f"start-to-goal distance: {gd.min():.2f} to {gd.max():.2f} cm (paper 67 to 134 cm)")
print("dates unique per mouse:", sessions.groupby(["subject", "date"]).size().max() == 1)
# recordings deposited twice: identical trial sequences or identical frame and ROI counts
sig = [tuple(np.round(r["trials"]["gd"], 6)) for r in R]
print("distinct trial sequences:", len(set(sig)), "| distinct (frames, ROIs) pairs:", len(set(zip(sessions["T"], sessions.n_rois))))
rg = pd.DataFrame([dict(pos_min=r["ranges"]["pos"][0], pos_max=r["ranges"]["pos"][1], speed_p1=r["ranges"]["speed"][0], speed_p99=r["ranges"]["speed"][1],
lick_max=r["ranges"]["lick"][1], dff_p01=r["ranges"]["dff"][0], dff_p999=r["ranges"]["dff"][1],
dff_mean_absmax=r["ranges"]["dff_session_mean_absmax"]) for r in R])
print("ranges over sessions (cm, cm/s, Hz, dR/R):"); print(rg.describe().loc[["min", "max"]].round(4).to_string())
print("frames with sound_on_off = 1 per session:", sorted(set(r["sound_frames"] for r in R)), "| of these at a trial's first frame:", sorted(set(r["sound_at_start"] for r in R)))
print("speaker_presentations rows per session:", min(r["meta"]["n_speaker_rows"] for r in R), "to", max(r["meta"]["n_speaker_rows"] for r in R))
CK = pd.DataFrame([r["checks"] for r in R])
print("stimulus/presentation/speaker_on_matrix, all files: (frames, speakers)", sorted({(int(a), int(b)) for a, b in CK.speaker_matrix_shape})[:2], "...",
"| speakers per file", sorted({int(b) for a, b in CK.speaker_matrix_shape}),
"| frames with any speaker on per file", sorted(set(CK.speaker_matrix_on_frames)), "| of these at a trial's first frame", sorted(set(CK.speaker_matrix_on_at_trial_start)))
print("speaker_presentations, all files: largest distance of a row's start from the nearest trial start",
f"{CK.speaker_start_to_trial_start_max_s.max():.2g} s; durations (s)", sorted(set(sum(CK.speaker_durations_s, []))),
"| distinct start times per file", sorted(set(CK.speaker_unique_starts)),
"| rows per trial start", int(min(x[0] for x in CK.speaker_rows_per_trial)), "to", int(max(x[1] for x in CK.speaker_rows_per_trial)),
"| speaker ids", sorted(set(sum(CK.speaker_ids, []))))
print("trial frames sum to the series length in", int(CK.frames_sum_equals_T.sum()), "of", len(CK), "files; trial start_time steps",
f"equal frames / {F.FS} Hz to {CK.trial_start_vs_frames_max_s.max():.1e} s")
print("sampling rates stored in the files (Hz):", sorted({v for d in CK.rates for v in d.values()}),
"| reward_times timestamps per file:", int(CK.n_reward_timestamps.min()), "to", int(CK.n_reward_timestamps.max()))
# clock: reward follows reaching the goal by a few frames in every session (behaviour streams on the trial clock)
lag = np.concatenate([(r["trials"]["rew_f"] - r["trials"]["goal_f"])[r["trials"]["valid"]] for r in R]) / F.FS
print(f"reward minus goal-reaching time: median {np.median(lag) * 1000:.0f} ms, 5th to 95th percentile {np.percentile(lag, 5) * 1000:.0f} to {np.percentile(lag, 95) * 1000:.0f} ms")
iti = np.concatenate([((r["trials"]["s0"] + r["trials"]["nfr"]) - r["trials"]["rew_f"])[r["trials"]["valid"]] for r in R]) / F.FS
print(f"trial record end minus reward: {iti.min():.2f} to {iti.max():.2f} s (ITI 7 s in the paper)")
# dR/R against the ratio R in one file: dR/R = (R - mean R) / mean R over the session
p0, a0, _ = min(ASSETS, key=lambda a: a[2])
with F.open_asset(a0) as f:
Rr = f["processing/ophys/Fluorescence/RawFluorescence/data"][:]
Dd = f["processing/ophys/DfOverF/dF_over_F/data"][:]
print(f"{p0}: max |(R - mean R)/mean R - dF_over_F| = {np.abs((Rr - Rr.mean(0)) / Rr.mean(0) - Dd).max():.2e}; R mean {Rr.mean():.3f}")
del Rr, Dd
files: 94 | sessions per mouse: {'mouse1': 2, 'mouse2': 10, 'mouse3': 5, 'mouse4': 14, 'mouse5': 15, 'mouse6': 15, 'mouse7': 12, 'mouse8': 21}
sessions per area and layer: {'PPC L2': 17, 'PPC L3': 15, 'PPC L5': 14, 'PM L2': 16, 'PM L3': 15, 'PM L5': 17}
ROIs per area and layer: {'PPC L2': 8371, 'PPC L3': 7108, 'PPC L5': 4859, 'PM L2': 7788, 'PM L3': 7005, 'PM L5': 5900} total 41031
ROIs per session: 270 to 581 | frames per session: 71379 to 96025
trials per file: {150} | valid trials (reward within 20 s): 14032 of 14100
trials per condition (continuous, intermittent 1, intermittent 2): [9859, 2190, 2051] shares [0.699, 0.155, 0.145] (paper 70, 15, 15%)
start-to-goal distance: 66.98 to 133.94 cm (paper 67 to 134 cm)
dates unique per mouse: True
distinct trial sequences: 94 | distinct (frames, ROIs) pairs: 94
ranges over sessions (cm, cm/s, Hz, dR/R):
pos_min pos_max speed_p1 speed_p99 lick_max dff_p01 dff_p999 dff_mean_absmax
min -32.2123 133.1907 -2.6330 24.2532 10.0 -0.4659 0.4351 0.0
max -0.2177 333.2456 -0.1314 52.0299 10.0 -0.2577 1.3673 0.0
frames with sound_on_off = 1 per session: [150] | of these at a trial's first frame: [150]
speaker_presentations rows per session: 1085 to 1240
stimulus/presentation/speaker_on_matrix, all files: (frames, speakers) [(71379, 12), (71556, 12)] ... | speakers per file [12] | frames with any speaker on per file [150] | of these at a trial's first frame [150]
speaker_presentations, all files: largest distance of a row's start from the nearest trial start 0 s; durations (s) [0.03236] | distinct start times per file [150] | rows per trial start 6 to 26 | speaker ids [1, 4, 5, 6, 7, 10, 11, 12]
trial frames sum to the series length in 94 of 94 files; trial start_time steps equal frames / 30.9 Hz to 4.5e-13 s
sampling rates stored in the files (Hz): [30.9] | reward_times timestamps per file: 300 to 300
reward minus goal-reaching time: median 65 ms, 5th to 95th percentile 32 to 421 ms
trial record end minus reward: 7.86 to 8.22 s (ITI 7 s in the paper)
sub-mouse2/sub-mouse2_ses-20131224_behavior+ophys.nwb: max |(R - mean R)/mean R - dF_over_F| = 2.61e-05; R mean 0.928
session-counts¶
Imaging data come from 94 sessions of 8 mice (2, 10, 5, 14, 15, 15, 12 and 21 sessions for mice 1 to 8); PPC layers 2, 3 and 5 were imaged in 17, 15 and 14 sessions and PM layers 2, 3 and 5 in 16, 15 and 17.
Source: Online Methods, Behavioral analysis; Results, Goal-distance representation in PPC and PM, paragraph 1.
per_mouse = sessions.groupby("subject").size()
print("sessions:", len(sessions), "| mice:", sessions.subject.nunique())
print("sessions per mouse, sorted:", sorted(per_mouse.tolist()), "| paper, sorted:", sorted([2, 10, 5, 14, 15, 15, 12, 21]))
print("sessions per mouse by label:", per_mouse.to_dict())
print("sessions per area and layer:", {g: int((sessions.group == g).sum()) for g in GROUPS}, "| paper 17, 15, 14, 16, 15, 17")
sessions: 94 | mice: 8
sessions per mouse, sorted: [2, 5, 10, 12, 14, 15, 15, 21] | paper, sorted: [2, 5, 10, 12, 14, 15, 15, 21]
sessions per mouse by label: {'mouse1': 2, 'mouse2': 10, 'mouse3': 5, 'mouse4': 14, 'mouse5': 15, 'mouse6': 15, 'mouse7': 12, 'mouse8': 21}
sessions per area and layer: {'PPC L2': 17, 'PPC L3': 15, 'PPC L5': 14, 'PM L2': 16, 'PM L3': 15, 'PM L5': 17} | paper 17, 15, 14, 16, 15, 17
Result: Reproduced. 94 sessions of 8 mice; the sessions per mouse match the paper's list (2, 5, 10, 12, 14, 15, 15, 21, and the dataset's mouse labels follow the paper's numbering), and the sessions per area and layer are 17, 15, 14 (PPC) and 16, 15, 17 (PM), all as reported.
neuron-counts¶
41,031 neurons were imaged, 8,371, 7,108 and 4,859 in PPC layers 2, 3 and 5 and 7,788, 7,005 and 5,900 in PM; these are active cells, 99.6% of the manually selected ROIs.
Source: Results, Goal-distance representation in PPC and PM, paragraph 1; Supplementary Table 1.
Reading (a) of the criterion, all ROIs in the files. Reading (b) is not needed, since (a) decides the criterion ("under one reading").
cnt = {g: int(sessions.n_rois[sessions.group == g].sum()) for g in GROUPS}
print("reading (a), all ROIs:", cnt, "total", sum(cnt.values()))
print("paper: 8371, 7108, 4859, 7788, 7005, 5900, total 41031")
print("per-session means:", {g: round(sessions.n_rois[sessions.group == g].mean(), 1) for g in GROUPS}, "| Supplementary Table 1: 492, 474, 347, 487, 467, 347")
reading (a), all ROIs: {'PPC L2': 8371, 'PPC L3': 7108, 'PPC L5': 4859, 'PM L2': 7788, 'PM L3': 7005, 'PM L5': 5900} total 41031
paper: 8371, 7108, 4859, 7788, 7005, 5900, total 41031
per-session means: {'PPC L2': np.float64(492.4), 'PPC L3': np.float64(473.9), 'PPC L5': np.float64(347.1), 'PM L2': np.float64(486.8), 'PM L3': np.float64(467.0), 'PM L5': np.float64(347.1)} | Supplementary Table 1: 492, 474, 347, 487, 467, 347
Result: Reproduced. The files hold 41,031 ROIs, 8,371, 7,108 and 4,859 in PPC layers 2, 3, 5 and 7,788, 7,005 and 5,900 in PM, equal to the paper's counts of active neurons. The files hold the active ROIs only.
behaviour-timing¶
Mice got the reward 7.4 ± 0.1 s after the trial start and spent 860 ± 10 ms in each no-sound zone of the intermittent conditions (mean ± s.e.m. over 94 sessions).
Source: Online Methods, Behavioral training, paragraph 5.
Time from the trial start (the first frame of the trial record, where the start tone is marked) to the first reward edge, per valid trial, mean per session, mean over sessions. No-sound zone time under the criterion's two readings.
rs = np.array([np.mean(r["trials"]["reward_s"][valid(r)]) for r in R])
za = np.array([r["zone_a"].mean() for r in R]); zb = np.array([r["zone_b"].mean() for r in R])
print(f"start tone to reward: mean over 94 sessions {rs.mean():.3f} s, s.e.m. {stats.sem(rs):.3f} (expected 7.4 +- 0.1)")
print(f" per-session means range {rs.min():.2f} to {rs.max():.2f} s")
print(f"time per no-sound zone, reading (a) complete zones before the goal: {za.mean():.3f} +- {stats.sem(za):.3f} s")
print(f"time per no-sound zone, reading (b) every zone entered, to the reward: {zb.mean():.3f} +- {stats.sem(zb):.3f} s (expected 0.86 +- 0.01)")
# variants, shown only: start to goal, and from first movement (position > 0) to reward
tg = np.array([np.mean(((r["trials"]["goal_f"] - r["trials"]["s0"]) / F.FS)[valid(r)]) for r in R])
print(f"variant, start tone to reaching the goal: {tg.mean():.3f} +- {stats.sem(tg):.3f} s")
print(f"variant, end of the 970 ms start tone to reward: {(rs - 0.97).mean():.3f} s")
for subj, ix in sessions.groupby("subject").groups.items():
print(f" {subj}: reward {rs[ix].mean():.2f} s, zone (a) {za[ix].mean():.3f}, (b) {zb[ix].mean():.3f}, sessions {len(ix)}")
allrs = np.concatenate([r["trials"]["reward_s"][valid(r)] for r in R])
print("start tone to reward over all analysed trials, percentiles 5, 25, 50, 75, 95:", np.round(np.percentile(allrs, [5, 25, 50, 75, 95]), 2), "s;",
f"under 7.4 s: {100 * (allrs < 7.4).mean():.1f}% of trials")
print("the files store a rate of", sorted({v for d in CK.rates for v in d.values()}), "Hz for every frame series, the FS used here:", F.FS)
excl = np.array([1 - valid(r).mean() for r in R])
print(f"trials excluded (over 20 s to reward or no reward): {100 * excl.mean():.2f}% per session (paper 2.71% + 0.142%)")
start tone to reward: mean over 94 sessions 9.299 s, s.e.m. 0.108 (expected 7.4 +- 0.1) per-session means range 7.39 to 12.66 s time per no-sound zone, reading (a) complete zones before the goal: 1.009 +- 0.020 s time per no-sound zone, reading (b) every zone entered, to the reward: 0.896 +- 0.016 s (expected 0.86 +- 0.01) variant, start tone to reaching the goal: 9.182 +- 0.107 s variant, end of the 970 ms start tone to reward: 8.329 s mouse1: reward 8.83 s, zone (a) 0.898, (b) 0.876, sessions 2 mouse2: reward 8.36 s, zone (a) 0.887, (b) 0.747, sessions 10 mouse3: reward 7.74 s, zone (a) 0.731, (b) 0.669, sessions 5 mouse4: reward 9.93 s, zone (a) 1.153, (b) 1.012, sessions 14 mouse5: reward 8.93 s, zone (a) 0.923, (b) 0.856, sessions 15 mouse6: reward 9.94 s, zone (a) 1.098, (b) 0.951, sessions 15 mouse7: reward 9.65 s, zone (a) 1.112, (b) 0.987, sessions 12 mouse8: reward 9.35 s, zone (a) 0.987, (b) 0.883, sessions 21 start tone to reward over all analysed trials, percentiles 5, 25, 50, 75, 95: [ 6.18 7.54 8.83 10.55 13.98] s; under 7.4 s: 22.1% of trials the files store a rate of [30.9] Hz for every frame series, the FS used here: 30.9 trials excluded (over 20 s to reward or no reward): 0.48% per session (paper 2.71% + 0.142%)
Result: Not reproduced. The mean time from the start tone to the reward is 9.30 s (s.e.m. 0.11 s over 94 sessions; session means 7.39 to 12.66 s), against 7.4 +- 0.1 s. Measured to the goal it is 9.18 s, and from the end of the 970 ms start tone 8.33 s, so no simple change of the reference point brings it to 7.4 s. Over all analysed trials the median is 8.83 s and 22.1% of trials take less than 7.4 s. Every frame series of every file stores a rate of 30.9 Hz, the rate used here, and the trial start times step by the trial's frames at that rate, so the difference does not come from the clock. The time per no-sound zone is 1.009 +- 0.020 s under reading (a) and 0.896 +- 0.016 s under reading (b), both outside 0.86 +- 0.01 s. Only 0.48% of trials per session take over 20 s, against the paper's 2.71%.
lick-goal-correlation¶
In every session the start-to-first-lick distance correlated with the start-to-goal distance, with r from 0.258 to 0.822 over the 94 sessions (r = 0.798 in the example session).
Source: Results, Licking indicates action-dependent distance estimation, paragraph 2; Figure 1b; Online Methods, Behavioral analysis.
First lick: the first lick onset more than 33 cm from the start (Online Methods, Behavioral analysis), with the onset read from the lick frequency (header). A variant counts the first frame of non-zero frequency beyond 33 cm. Readings (a) Pearson and (b) Spearman.
rows = []
for i, r in enumerate(R):
for onset in ("change", "any", "bout"):
tr = r["trials"]
fl = {"change": r["first_lick_cm"], "any": r["first_lick_any_cm"], "bout": r["first_lick_bout_cm"]}[onset]
v = valid(r) & ~np.isnan(fl)
pr = stats.pearsonr(fl[v], tr["gd"][v]); sr = stats.spearmanr(fl[v], tr["gd"][v])
rows.append(dict(session=i, onset=onset, n=v.sum(), r_pearson=pr[0], p_pearson=pr[1], r_spearman=sr[0], p_spearman=sr[1]))
LC = pd.DataFrame(rows)
for onset, t in LC.groupby("onset"):
for kind in ("pearson", "spearman"):
rr, pp = t[f"r_{kind}"], t[f"p_{kind}"]
ok = (rr > 0).all() and (pp < 0.01).all() and rr.min() >= 0.232 and rr.max() <= 0.904
print(f"lick onset '{onset}', {kind}: r {rr.min():.3f} to {rr.max():.3f}, largest P {pp.max():.3g}, "
f"sessions with P >= 0.01: {(pp >= 0.01).sum()}, below r 0.232: {(rr < 0.232).sum()}; criterion met: {ok}")
print("lowest five Pearson r (onset 'change'):", np.round(np.sort(LC[LC.onset == "change"].r_pearson)[:5], 3))
# the form of the lick frequency (verifier round 1)
LF = pd.DataFrame([{k: v for k, v in r["lick_form"].items() if k != "sample"} for r in R])
print(f"frames at 0 Hz: {LF.zero_frac.min():.2f} to {LF.zero_frac.max():.2f} of each session; before 33 cm in analysed trials "
f"{LF.zero_frac_before33.min():.2f} to {LF.zero_frac_before33.max():.2f}")
print(f"analysed trials with a non-zero frequency at the frame that passes 33 cm: {LF.nonzero_at33_frac.min():.2f} to "
f"{LF.nonzero_at33_frac.max():.2f} per session (median {LF.nonzero_at33_frac.median():.2f})")
print("frames a non-zero value below the cap is held (5th, 50th, 95th percentile, median over sessions):",
np.round(np.median(np.vstack(LF.held_run_frames.values), axis=0), 1))
smp = R[0]["lick_form"]["sample"]
print(f"sample, {R[0]['meta']['path']}, first analysed trial, frames from the first lick onset ('change'):")
print(pd.DataFrame(smp).set_index("frame").loc[-10:20].T.to_string())
lick onset 'any', pearson: r 0.003 to 0.744, largest P 0.967, sessions with P >= 0.01: 14, below r 0.232: 18; criterion met: False
lick onset 'any', spearman: r -0.175 to 0.795, largest P 0.946, sessions with P >= 0.01: 23, below r 0.232: 30; criterion met: False
lick onset 'bout', pearson: r 0.196 to 0.853, largest P 0.465, sessions with P >= 0.01: 6, below r 0.232: 2; criterion met: False
lick onset 'bout', spearman: r 0.104 to 0.856, largest P 0.673, sessions with P >= 0.01: 6, below r 0.232: 4; criterion met: False
lick onset 'change', pearson: r 0.218 to 0.822, largest P 0.00791, sessions with P >= 0.01: 0, below r 0.232: 2; criterion met: False
lick onset 'change', spearman: r 0.151 to 0.843, largest P 0.0658, sessions with P >= 0.01: 5, below r 0.232: 8; criterion met: False
lowest five Pearson r (onset 'change'): [0.218 0.227 0.237 0.245 0.247]
frames at 0 Hz: 0.18 to 0.80 of each session; before 33 cm in analysed trials 0.35 to 0.99
analysed trials with a non-zero frequency at the frame that passes 33 cm: 0.02 to 0.90 per session (median 0.22)
frames a non-zero value below the cap is held (5th, 50th, 95th percentile, median over sessions): [ 3. 4. 15.]
sample, sub-mouse1/sub-mouse1_ses-20131009_behavior+ophys.nwb, first analysed trial, frames from the first lick onset ('change'):
frame -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
pos 29.33 29.73 30.46 30.62 30.64 30.64 30.97 31.39 31.76 32.31 33.16 33.89 34.39 34.61 34.61 34.65 34.67 34.74 34.91 35.31 35.75 36.29 36.96 37.54 37.54 37.57 37.57 37.58 37.60 37.65 37.67
lick 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 10.00 3.45 3.45 3.45 3.45 3.45 3.45 3.45 3.45 3.45 10.00 10.00 10.00 7.46 7.46 7.46 7.46 10.00 10.00
Result: Not reproduced. With Pearson's r and the lick onset taken where the frequency changes, every session has a positive correlation with P < 0.01 (largest P 0.0079), and r spans 0.218 to 0.822; the upper bound matches the paper's 0.822, but two sessions fall below the criterion's lower bound of 0.232 (0.218 and 0.227). Spearman's coefficient fails more widely (5 sessions with P >= 0.01, r down to 0.151). The criterion is not met under either reading. The onset variants do worse: the first non-zero frame ("any") gives r down to 0.003, and the first rise from 0 Hz ("bout") gives 6 sessions with P >= 0.01. The form of the series explains this. The frequency is held between licks (a value below the cap is held for a median of 4 frames, 95th percentile 15) and is still non-zero when the mouse passes 33 cm in a median 22% of trials per session (up to 90%), so a held value at 33 cm is not a new lick, which is why the "any" reading collapses. A change of the held value marks a new lick, as the sample trace shows (10 Hz held through the first lick frames, then 3.45, 10 and 7.46 Hz at the next licks), so the "change" onset is the reading the data support.
fig1c-licking-without-sound¶
Licking increased as mice approached the goal in all conditions, and in both intermittent conditions it increased even within the no-sound zones (41.9-25.1 and 8.4-0 cm in intermittent 1, 25.1-8.4 cm in intermittent 2).
Source: Figure 1c; Results, Licking indicates action-dependent distance estimation, paragraph 2.
Licks per trial in 4.2 cm bins of goal distance, from the start to reaching the goal, mean per session and condition; one-sided signed-rank test over the 94 sessions of each tested bin against the bin 8.4 cm farther from the goal (criterion). Per-mouse medians are shown.
LB = np.stack([np.nanmean(r["lick_bins"][valid(r) & (r["trials"]["state"] == c)], axis=0) for r in R for c in range(3)]).reshape(len(R), 3, -1)
edges = F.LICK_EDGES
def bin_of(hi):
return int(np.argmin(np.abs(edges[:-1] - hi)))
TESTED = [(29.4, 37.8), (21.0, 29.4), (12.6, 21.0), (4.2, 12.6)] # (upper edge of tested bin, upper edge of bin 8.4 cm farther)
silent = {1: [0, 3], 2: [1, 2]}
res = []
for c in range(3):
for j, (hi, far) in enumerate(TESTED):
a, b = LB[:, c, bin_of(hi)], LB[:, c, bin_of(far)]
p, z, n = F.wilcoxon_z(a, b, alternative="greater")
res.append(dict(condition=COND_NAMES[c], tested=f"{hi:.1f}-{hi - 4.2:.1f}", against=f"{far:.1f}-{far - 4.2:.1f}",
median_tested=np.median(a), median_far=np.median(b), z=z, p=p, n=n,
no_sound=(c > 0 and j in silent[c])))
FIG1C = pd.DataFrame(res); print(FIG1C.round(4).to_string())
ns = FIG1C[FIG1C.no_sound]; co = FIG1C[FIG1C.condition == "continuous"]
print("no-sound comparisons with P < 0.01:", int((ns.p < 0.01).sum()), "of", len(ns), "; continuous:", int((co.p < 0.01).sum()), "of 4")
for subj, ix in sessions.groupby("subject").groups.items():
d = [np.median(LB[ix, c, bin_of(hi)] - LB[ix, c, bin_of(far)]) for c in (1, 2) for j, (hi, far) in enumerate(TESTED) if j in silent[c]]
print(f" {subj}: median rise in the four no-sound comparisons", np.round(d, 3))
condition tested against median_tested median_far z p n no_sound 0 continuous 29.4-25.2 37.8-33.6 0.2969 0.1635 7.4155 0.0000 94 False 1 continuous 21.0-16.8 29.4-25.2 0.7335 0.2969 8.4186 0.0000 94 False 2 continuous 12.6-8.4 21.0-16.8 1.5115 0.7335 8.4186 0.0000 94 False 3 continuous 4.2-0.0 12.6-8.4 3.0085 1.5115 8.4186 0.0000 94 False 4 intermittent 1 29.4-25.2 37.8-33.6 0.5554 0.3386 7.3665 0.0000 94 True 5 intermittent 1 21.0-16.8 29.4-25.2 1.5827 0.5554 8.3017 0.0000 94 False 6 intermittent 1 12.6-8.4 21.0-16.8 2.0066 1.5827 5.7412 0.0000 94 False 7 intermittent 1 4.2-0.0 12.6-8.4 2.3526 2.0066 5.7865 0.0000 94 True 8 intermittent 2 29.4-25.2 37.8-33.6 0.4734 0.3799 3.2072 0.0007 94 False 9 intermittent 2 21.0-16.8 29.4-25.2 0.7592 0.4734 6.3220 0.0000 94 True 10 intermittent 2 12.6-8.4 21.0-16.8 0.9868 0.7592 5.4056 0.0000 94 True 11 intermittent 2 4.2-0.0 12.6-8.4 2.8590 0.9868 8.4148 0.0000 94 False no-sound comparisons with P < 0.01: 4 of 4 ; continuous: 4 of 4 mouse1: median rise in the four no-sound comparisons [ 0.175 0.246 0.334 -0.126] mouse2: median rise in the four no-sound comparisons [0.367 0.601 0.138 0.485] mouse3: median rise in the four no-sound comparisons [ 0.121 0.393 0.114 -0.047] mouse4: median rise in the four no-sound comparisons [0.149 0.772 0.416 0.147] mouse5: median rise in the four no-sound comparisons [0.236 0.195 0.22 0.097] mouse6: median rise in the four no-sound comparisons [ 0.2 -0.095 0.095 0.106] mouse7: median rise in the four no-sound comparisons [0.145 0.541 0.212 0.153] mouse8: median rise in the four no-sound comparisons [0.273 0.393 0.496 0.426]
/tmp/ipykernel_2777/759074160.py:1: RuntimeWarning: Mean of empty slice LB = np.stack([np.nanmean(r["lick_bins"][valid(r) & (r["trials"]["state"] == c)], axis=0) for r in R for c in range(3)]).reshape(len(R), 3, -1)
Result: Reproduced. Licking rises with P < 0.01 in all four no-sound comparisons (intermittent 1, 29.4-25.2 and 4.2-0 cm; intermittent 2, 21.0-16.8 and 12.6-8.4 cm; z 5.41 to 7.37) and in all four continuous comparisons (z 7.42 to 8.42). The bins are at multiples of 4.2 cm (the claims file writes 29.3-25.1). Five of eight mice show a rise in all four no-sound comparisons; mice 1, 3 and 6 each have one comparison without a rise.
supp1-licking-speed¶
During no-sound zones licking rose more steeply in fast-locomotion trials than in slow ones, in both intermittent conditions.
Source: Supplementary Figure 1; Results, Licking indicates action-dependent distance estimation, paragraph 2.
Slope of lick frequency on time within a no-sound zone, per trial; trials of each session split into halves by speed; mean slope of each half per session; signed-rank test over sessions. O9 names two readings of the zone, and both are run with both speed readings. The panel titles of Supplementary Fig. 1, drawn in the figure image, read "Intermittent 1: 8.4 cm to 0 cm from goal" and "Intermittent 2: 25 cm to 8.4 cm from goal", the no-sound zone nearest the goal, reading (b); whether O9 should be narrowed to it is asked of a reader.
def supp1(speed_reading, zone_reading):
out = []
for c in (1, 2):
fast_s, slow_s = [], []
for r in R:
tr = r["trials"]; m = valid(r) & (tr["state"] == c)
sl = r["lick_slope"][m]; spz = r["lick_slope_speed"][m]
if zone_reading == "a":
slope = np.nanmean(sl, axis=1); zsp = np.nanmean(spz, axis=1)
else:
zi = 3 if c == 1 else 2
slope = sl[:, zi]; zsp = spz[:, zi]
spd = r["trial_speed"][m] if speed_reading == "a" else zsp
ok = ~np.isnan(slope) & ~np.isnan(spd)
slope, spd = slope[ok], spd[ok]
if len(slope) < 2:
fast_s.append(np.nan); slow_s.append(np.nan); continue
med = np.median(spd)
order = np.argsort(spd); h = len(spd) // 2
slow_s.append(slope[order[:h]].mean()); fast_s.append(slope[order[-h:]].mean())
p, z, n = F.wilcoxon_z(np.array(fast_s), np.array(slow_s))
out.append(dict(condition=COND_NAMES[c], speed=speed_reading, zones=zone_reading, median_fast=np.nanmedian(fast_s),
median_slow=np.nanmedian(slow_s), z=z, p=p, n=n))
return out
S1 = pd.DataFrame([x for s in "ab" for zr in "ab" for x in supp1(s, zr)])
print(S1.round(5).to_string())
print("readings with fast > slow and P < 0.01 in both conditions:",
int(S1.groupby(["speed", "zones"]).apply(lambda t: ((t.z > 0) & (t.p < 0.01)).all()).sum()), "of 4")
condition speed zones median_fast median_slow z p n 0 intermittent 1 a a 0.61257 0.36418 1.75537 0.07920 94 1 intermittent 2 a a 0.56262 0.65167 0.69197 0.48896 94 2 intermittent 1 a b 0.42872 -0.48901 3.05634 0.00224 94 3 intermittent 2 a b 0.85020 0.53969 2.71696 0.00659 94 4 intermittent 1 b a 0.57293 0.19179 2.47185 0.01344 94 5 intermittent 2 b a 0.54501 0.76450 0.26585 0.79035 94 6 intermittent 1 b b 0.28058 -0.60481 3.21472 0.00131 94 7 intermittent 2 b b 0.81486 0.68875 2.92059 0.00349 94 readings with fast > slow and P < 0.01 in both conditions: 2 of 4
Result: Blocked, methods underspecified. In the zone nearest the goal (O9 zone reading b),
fast trials have steeper licking slopes than slow trials in both conditions under both speed
readings: speed over the trial, z = 3.06 (P = 0.0022) and 2.72 (P = 0.0066); speed in the zone,
z = 3.21 (P = 0.0013) and 2.92 (P = 0.0035). Averaged over every no-sound zone (zone reading a),
the difference is not significant (P 0.013 to 0.79). The criterion needs every reading of O9,
and the claims file's header blocks a claim whose readings disagree, so the claim is blocked.
The panel titles of Supplementary Fig. 1 ("Intermittent 1: 8.4 cm to 0 cm from goal" and
"Intermittent 2: 25 cm to 8.4 cm from goal", drawn in the figure image) name the zone of reading
(b); whether O9 should be narrowed to it is asked of a reader (questions/001605.yaml).
Per-session counts and the PPC against PM test used by the next claims.
def per_session(c, col):
s = pd.Series(c[col].values).groupby(NT.session.values).agg(["sum", "mean"])
return s.reindex(range(len(R)))
def ppc_vs_pm(vals, alternative="two-sided"):
out = []
for L in (2, 3, 5):
a = vals[(sessions.area == "PPC") & (sessions.layer == L)]; b = vals[(sessions.area == "PM") & (sessions.layer == L)]
p, z = F.mwu(a, b, alternative)
out.append(dict(layer=L, ppc=np.median(a), pm=np.median(b), z=z, p=p, n=f"{len(a)}, {len(b)}"))
return pd.DataFrame(out)
neuron-classes¶
Goal-distance neurons numbered 1,116, 1,054 and 483 in PPC layers 2, 3 and 5 and 601, 479 and 129 in PM; of these, 744, 854 and 367 in PPC and 193, 204 and 54 in PM were after-reaching neurons; per session, on average 65.6, 70.3 and 34.5 in PPC and 37.6, 31.9 and 7.59 in PM were goal-distance neurons.
Source: Figure 2d; Figure 3c legend; Supplementary Figure 6 legend; Results, Distance prediction with dynamic Bayesian inference, paragraph 2.
The classification of the claims file (Online Methods, Task-relevant neurons), under O1 (baseline zero or the inter-trial mean) and O3 (k-means on the normalized 16-frame pre-goal trace, or on its mean); O2 does not change these classes. The k-means is run once on the after-reaching group pooled over all sessions, with a fixed seed and 20 starts. The paper does not say whether it clustered per session or pooled; pooling is a standard choice.
EXP_GD = [1116, 1054, 483, 601, 479, 129]; EXP_AFTER = [744, 854, 367, 193, 204, 54]
rows = []
for rd, c in CLS_V.items():
g = NT.group
gd = [int(c.gd[g == x].sum()) for x in GROUPS]; af = [int(c.after[g == x].sum()) for x in GROUPS]
within = sum(abs(a - e) <= 0.1 * e for a, e in zip(gd + af, EXP_GD + EXP_AFTER))
rows.append(dict(reading=klab(rd), **{f"gd {x}": v for x, v in zip(GROUPS, gd)},
**{f"after {x}": v for x, v in zip(GROUPS, af)}, within_10pct=within))
print(f"{klab(rd)}: before", [int(c.before[g == x].sum()) for x in GROUPS], "reward", [int(c.reward[g == x].sum()) for x in GROUPS],
"lick", [int(c.lick[g == x].sum()) for x in GROUPS])
NC = pd.DataFrame(rows).set_index("reading")
print(NC.T.to_string())
print("expected gd", EXP_GD, "after", EXP_AFTER)
for rd, c in CLS_GD.items():
per = [c.gd[NT.group == x].sum() / (sessions.group == x).sum() for x in GROUPS]
print(f"O1 {rd[0]} O3 {rd[2]}: goal-distance neurons per session", np.round(per, 1), "(paper 65.6, 70.3, 34.5, 37.6, 31.9, 7.59)")
c0 = CLS_GD[("a", "67", "a")]
print("by mouse, reading O1 a O3 a, goal-distance neurons and share of ROIs:")
for subj in sorted(sessions.subject.unique()):
m = NT.session.isin(sessions.i[sessions.subject == subj])
print(f" {subj}: {int(c0.gd[m].sum())} of {int(m.sum())} ({100 * c0.gd[m].mean():.1f}%)")
O1 a O3 a: before [411, 231, 124, 434, 284, 82] reward [811, 410, 224, 583, 501, 166] lick [956, 736, 258, 298, 323, 50]
O1 a O3 b: before [411, 231, 124, 434, 284, 82] reward [811, 407, 225, 583, 500, 166] lick [956, 736, 258, 298, 323, 50] O1 b O3 a: before [746, 440, 323, 729, 507, 230] reward [673, 318, 165, 340, 297, 79] lick [1399, 1192, 494, 695, 685, 209]
O1 b O3 b: before [746, 440, 323, 729, 507, 230] reward [674, 314, 165, 340, 297, 79] lick [1399, 1192, 494, 695, 685, 209]
O1 a O3 a, k-means per session: before [411, 231, 124, 434, 284, 82] reward [831, 555, 261, 510, 502, 145] lick [956, 736, 258, 298, 323, 50]
O1 a O3 b, k-means per session: before [411, 231, 124, 434, 284, 82] reward [831, 552, 261, 510, 502, 146] lick [956, 736, 258, 298, 323, 50] O1 b O3 a, k-means per session: before [746, 440, 323, 729, 507, 230] reward [682, 434, 229, 308, 313, 82] lick [1399, 1192, 494, 695, 685, 209]
O1 b O3 b, k-means per session: before [746, 440, 323, 729, 507, 230] reward [676, 434, 230, 306, 313, 82] lick [1399, 1192, 494, 695, 685, 209] reading O1 a O3 a O1 a O3 b O1 b O3 a O1 b O3 b O1 a O3 a, k-means per session O1 a O3 b, k-means per session O1 b O3 a, k-means per session O1 b O3 b, k-means per session gd PPC L2 1353 1353 1650 1649 1333 1333 1641 1647 gd PPC L3 1292 1295 1402 1406 1147 1150 1286 1286 gd PPC L5 555 554 775 775 518 518 711 710 gd PM L2 659 659 961 961 732 732 993 995 gd PM L3 512 513 738 738 511 511 722 722 gd PM L5 158 158 304 304 179 178 301 301 after PPC L2 942 942 904 903 922 922 895 901 after PPC L3 1061 1064 962 966 916 919 846 846 after PPC L5 431 430 452 452 394 394 388 387 after PM L2 225 225 232 232 298 298 264 266 after PM L3 228 229 231 231 227 227 215 215 after PM L5 76 76 74 74 97 96 71 71 within_10pct 2 2 0 0 5 5 3 3 expected gd [1116, 1054, 483, 601, 479, 129] after [744, 854, 367, 193, 204, 54] O1 a O3 a: goal-distance neurons per session [79.6 86.1 39.6 41.2 34.1 9.3] (paper 65.6, 70.3, 34.5, 37.6, 31.9, 7.59) O1 a O3 b: goal-distance neurons per session [79.6 86.3 39.6 41.2 34.2 9.3] (paper 65.6, 70.3, 34.5, 37.6, 31.9, 7.59) O1 b O3 a: goal-distance neurons per session [97.1 93.5 55.4 60.1 49.2 17.9] (paper 65.6, 70.3, 34.5, 37.6, 31.9, 7.59) O1 b O3 b: goal-distance neurons per session [97. 93.7 55.4 60.1 49.2 17.9] (paper 65.6, 70.3, 34.5, 37.6, 31.9, 7.59) by mouse, reading O1 a O3 a, goal-distance neurons and share of ROIs: mouse1: 185 of 783 (23.6%)
mouse2: 55 of 3952 (1.4%) mouse3: 570 of 2228 (25.6%) mouse4: 402 of 6581 (6.1%) mouse5: 1143 of 6487 (17.6%) mouse6: 700 of 6722 (10.4%) mouse7: 906 of 5317 (17.0%) mouse8: 568 of 8961 (6.3%)
Result: Not reproduced. Under the zero baseline (O1 a) 2 of the 12 counts are within 10% (PM layers 2 and 3 goal-distance neurons, 659 and 512); the others are 12 to 41% higher than the paper's (PPC goal-distance 1,353, 1,292 and 555 against 1,116, 1,054 and 483; after-reaching 942, 1,061, 431 against 744, 854, 367). Under the inter-trial baseline (O1 b) none is within 10%. O3 changes no count by more than 4. With k-means run per session (a variant), 5 of 12 counts are within 10% under O1 a and 3 under O1 b, still short of the 6 of the partial outcome. The pattern is the paper's: PPC has more goal-distance and after-reaching neurons than PM, and layer 5 the fewest.
fig2d-task-relevant-proportions¶
Task-relevant neurons made up 41.3, 33.8 and 20.0% of active neurons in PPC layers 2, 3 and 5 and 19.6, 16.7 and 5.70% in PM, more in PPC than in PM in every layer.
Source: Results, Goal-distance representation in PPC and PM, paragraph 4; Figure 2d.
EXP_TR = [41.3, 33.8, 20.0, 19.6, 16.7, 5.70]
for rd in READINGS:
if rd[2] != "a":
continue # O3 does not change task relevance
c = CLS[rd]
ps = per_session(c, "task")
mean_ps = [100 * ps["mean"][sessions.group == x].mean() for x in GROUPS]
pooled = [100 * c.task[NT.group == x].mean() for x in GROUPS]
print(f"O1 {rd[0]}, O2 0-{rd[1]} cm: (a) mean of session %", np.round(mean_ps, 1),
"within:", sum(abs(a - e) <= 0.1 * e for a, e in zip(mean_ps, EXP_TR)),
"| (b) pooled %", np.round(pooled, 1), "within:", sum(abs(a - e) <= 0.1 * e for a, e in zip(pooled, EXP_TR)))
print(ppc_vs_pm(100 * ps["mean"]).round(5).to_string(index=False))
print("expected", EXP_TR)
O1 a, O2 0-67 cm: (a) mean of session % [47.6 38.5 24. 27.3 23.4 8.5] within: 0 | (b) pooled % [48.1 38.1 25.4 27.6 23.5 8.1] within: 0
layer ppc pm z p n
2 52.40000 26.92823 3.31402 0.00098 17, 16
3 40.83665 18.92523 1.97021 0.05124 15, 15
5 25.77434 6.86499 3.29462 0.00106 14, 17
O1 a, O2 0-33 cm: (a) mean of session % [47.5 38.5 24. 27.3 23.3 8.4] within: 0 | (b) pooled % [48.1 38.1 25.4 27.5 23.5 8. ] within: 0
layer ppc pm z p n
2 52.40000 26.92823 3.31402 0.00098 17, 16
3 40.83665 18.92523 1.97021 0.05124 15, 15
5 25.77434 6.86499 3.33431 0.00092 14, 17
O1 b, O2 0-67 cm: (a) mean of session % [52.7 44.5 32.1 33.1 28.9 12.7] within: 0 | (b) pooled % [53.4 44.6 34. 33.3 29.1 12.5] within: 0
layer ppc pm z p n
2 58.50622 31.65001 3.31402 0.00098 17, 16
3 49.29577 23.56688 2.26055 0.02510 15, 15
5 30.04800 10.17964 4.00912 0.00007 14, 17
O1 b, O2 0-33 cm: (a) mean of session % [52.7 44.5 32.1 33.1 28.9 12.6] within: 0 | (b) pooled % [53.4 44.6 34. 33.2 29.1 12.4] within: 0
layer ppc pm z p n
2 58.50622 31.65001 3.31402 0.00098 17, 16
3 49.09457 23.56688 2.30203 0.02253 15, 15
5 30.04800 10.17964 4.00912 0.00007 14, 17
expected [41.3, 33.8, 20.0, 19.6, 16.7, 5.7]
Result: Not reproduced. No percentage is within tolerance under any reading. Under O1 a the means of per-session percentages are 47.6, 38.5 and 24.0% (PPC) and 27.3, 23.4 and 8.5% (PM) against 41.3, 33.8, 20.0, 19.6, 16.7 and 5.70%. PPC exceeds PM in every layer; the Mann-Whitney test gives P < 0.05 in layers 2 and 5 under every reading, and in layer 3 P = 0.051 under O1 a and 0.023 to 0.025 under O1 b.
fig2d-goal-distance-ppc-more¶
PPC had more goal-distance neurons than PM in all three layers.
Source: Results, Goal-distance representation in PPC and PM, paragraph 4; Figure 2d.
for rd, c in CLS_GD.items():
ps = per_session(c, "gd")
for meas, vals in (("proportion", ps["mean"]), ("count", ps["sum"])):
t = ppc_vs_pm(vals)
print(f"O1 {rd[0]} O3 {rd[2]}, {meas}: PPC higher with P < 0.05 in", int(((t.z > 0) & (t.p < 0.05)).sum()), "of 3 layers")
print(t.round(5).to_string(index=False))
O1 a O3 a, proportion: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 0.16629 0.07049 2.98982 0.00296 17, 16
3 0.17303 0.02123 2.63386 0.00897 15, 15
5 0.11459 0.01333 3.49309 0.00051 14, 17
O1 a O3 a, count: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 74.0 31.0 3.02584 0.00262 17, 16
3 77.0 10.0 2.71681 0.00697 15, 15
5 36.0 5.0 3.49309 0.00050 14, 17
O1 a O3 b, proportion: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 0.16629 0.07049 2.98982 0.00296 17, 16
3 0.17303 0.02123 2.63386 0.00897 15, 15
5 0.11459 0.01333 3.49309 0.00051 14, 17
O1 a O3 b, count: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 74.0 31.0 3.02584 0.00262 17, 16
3 78.0 10.0 2.71681 0.00698 15, 15
5 36.0 5.0 3.49309 0.00050 14, 17
O1 b O3 a, proportion: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 0.18008 0.10413 2.62960 0.00901 17, 16
3 0.20800 0.05945 2.50942 0.01282 15, 15
5 0.12538 0.04059 3.73126 0.00021 14, 17
O1 b O3 a, count: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 86.0 48.5 2.91777 0.00372 17, 16
3 94.0 29.0 2.57164 0.01072 15, 15
5 41.5 13.0 3.59233 0.00035 14, 17
O1 b O3 b, proportion: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 0.17797 0.10413 2.62960 0.00901 17, 16
3 0.20800 0.05945 2.50942 0.01282 15, 15
5 0.12538 0.04059 3.73126 0.00021 14, 17
O1 b O3 b, count: PPC higher with P < 0.05 in 3 of 3 layers
layer ppc pm z p n
2 86.0 48.5 2.91777 0.00372 17, 16
3 94.0 29.0 2.59238 0.01010 15, 15
5 41.5 13.0 3.59233 0.00035 14, 17
Result: Reproduced. PPC has more goal-distance neurons than PM in all three layers, as counts and as proportions of active neurons, under all four readings of O1 and O3 (P 0.0002 to 0.013).
fig2d-after-vs-before¶
PPC had more after-reaching than before-reaching neurons in every layer, whereas PM tended the other way, significantly in layer 2.
Source: Results, Goal-distance representation in PPC and PM, paragraph 4; Figure 2d.
Both readings of the baseline (O1) are run for every claim that uses the classification; where they give different outcomes the claim is blocked, as the claims file's header directs. The zero baseline (O1 a) gives 91 of 94 sessions with goal-distance neurons, the paper's count ("sessions with 0 goal-distance neurons (3 sessions of 94) were excluded"), and the inter-trial baseline 94 of 94 (decoder cell, below), but neither reproduces the paper's class counts.
for rd, c in CLS_GD.items():
pa, pb = per_session(c, "after"), per_session(c, "before")
for meas in ("sum", "mean"):
out = []
for x in GROUPS:
m = (sessions.group == x).values
p, z, n = F.wilcoxon_z(pa[meas][m].values, pb[meas][m].values)
out.append(dict(group=x, after=np.median(pa[meas][m]), before=np.median(pb[meas][m]), z=z, p=p, n=int(m.sum())))
print(f"O1 {rd[0]} O3 {rd[2]}, {'counts' if meas == 'sum' else 'proportions'} (z > 0: after-reaching more)")
print(pd.DataFrame(out).round(5).to_string(index=False))
O1 a O3 a, counts (z > 0: after-reaching more) group after before z p n PPC L2 50.0 15.0 2.62726 0.00861 17 PPC L3 46.0 9.0 2.89661 0.00377 15 PPC L5 17.5 4.0 2.54951 0.01076 14 PM L2 9.5 22.0 -2.89661 0.00375 16 PM L3 7.0 4.0 -0.65316 0.51238 15 PM L5 2.0 3.0 -0.82369 0.40648 17 O1 a O3 a, proportions (z > 0: after-reaching more) group after before z p n PPC L2 0.10912 0.03371 2.62726 0.00861 17 PPC L3 0.10610 0.01883 2.89661 0.00377 15 PPC L5 0.05016 0.01272 2.74563 0.00604 14 PM L2 0.01782 0.04072 -2.83981 0.00451 16 PM L3 0.01525 0.00913 -0.56796 0.57006 15 PM L5 0.00467 0.00888 -0.86291 0.38819 17 O1 a O3 b, counts (z > 0: after-reaching more) group after before z p n PPC L2 50.0 15.0 2.62726 0.00861 17 PPC L3 47.0 9.0 2.89661 0.00377 15 PPC L5 17.5 4.0 2.51029 0.01203 14 PM L2 9.5 22.0 -2.89661 0.00375 16 PM L3 7.0 4.0 -0.56499 0.57065 15 PM L5 2.0 3.0 -0.82369 0.40648 17
O1 a O3 b, proportions (z > 0: after-reaching more) group after before z p n PPC L2 0.10912 0.03371 2.62726 0.00861 17 PPC L3 0.10875 0.01883 2.89661 0.00377 15 PPC L5 0.05000 0.01272 2.74563 0.00604 14 PM L2 0.01782 0.04072 -2.83981 0.00451 16 PM L3 0.01525 0.00913 -0.47082 0.63777 15 PM L5 0.00467 0.00888 -0.86291 0.38819 17 O1 b O3 a, counts (z > 0: after-reaching more) group after before z p n PPC L2 46.0 34.0 0.63906 0.52272 17 PPC L3 48.0 29.0 1.78908 0.07343 15 PPC L5 26.0 15.5 1.36277 0.17269 14 PM L2 10.0 37.5 -3.51620 0.00043 16 PM L3 7.0 24.0 -3.23299 0.00122 15 PM L5 2.0 11.0 -3.36101 0.00077 17 O1 b O3 a, proportions (z > 0: after-reaching more) group after before z p n PPC L2 0.09091 0.07143 0.68640 0.49246 17 PPC L3 0.09600 0.06017 1.64709 0.09954 15 PPC L5 0.07752 0.04928 1.36277 0.17295 14 PM L2 0.01838 0.08165 -3.51620 0.00044 16 PM L3 0.01525 0.04472 -3.23299 0.00123 15 PM L5 0.00489 0.02934 -3.29000 0.00100 17 O1 b O3 b, counts (z > 0: after-reaching more) group after before z p n PPC L2 46.0 34.0 0.63906 0.52272 17 PPC L3 48.0 29.0 1.78908 0.07349 15 PPC L5 26.0 15.5 1.36277 0.17269 14 PM L2 10.0 37.5 -3.51620 0.00043 16 PM L3 7.0 24.0 -3.23299 0.00122 15 PM L5 2.0 11.0 -3.36101 0.00077 17 O1 b O3 b, proportions (z > 0: after-reaching more) group after before z p n PPC L2 0.09091 0.07143 0.68640 0.49246 17 PPC L3 0.09600 0.06017 1.64709 0.09954 15 PPC L5 0.07752 0.04928 1.36277 0.17295 14 PM L2 0.01838 0.08165 -3.51620 0.00044 16 PM L3 0.01525 0.04472 -3.23299 0.00123 15 PM L5 0.00489 0.02934 -3.29000 0.00100 17
Result: Blocked, methods underspecified. The readings of O1 disagree. With the zero baseline (O1 a), PPC has more after-reaching than before-reaching neurons in every layer (counts P = 0.0086, 0.0038 and 0.011), PM layer 2 has more before-reaching neurons (P = 0.0038) and PM layers 3 and 5 do not differ (P 0.39 to 0.64), so the criterion holds. With the inter-trial baseline (O1 b), PPC does not differ in any layer (P 0.07 to 0.52), and the criterion fails. The claims file's header blocks a claim whose readings disagree.
fig2d-layer-distance-preference¶
In both PPC and PM, goal-distance neurons in layers 3 and 5 preferred distances closer to the goal than those in layer 2.
Source: Figure 2d insets and legend; Results, Goal-distance representation in PPC and PM, paragraph 4.
for rd, c in CLS_GD.items():
out = []
for area in ("PPC", "PM"):
pref = {L: NT.dist_pref[c.gd.values & (NT.area == area).values & (NT.layer == L).values].values for L in (2, 3, 5)}
for a, b in ((2, 3), (2, 5), (3, 5)):
p, z = F.mwu(pref[a], pref[b])
out.append(dict(area=area, pair=f"L{a} vs L{b}", median_a=np.median(pref[a]), median_b=np.median(pref[b]), z=z, p=p,
n=f"{len(pref[a])}, {len(pref[b])}"))
print(f"O1 {rd[0]} O3 {rd[2]} (z > 0: first layer prefers farther distances)")
print(pd.DataFrame(out).round(5).to_string(index=False))
O1 a O3 a (z > 0: first layer prefers farther distances) area pair median_a median_b z p n PPC L2 vs L3 0.63 0.21 7.92776 0.00000 1353, 1292 PPC L2 vs L5 0.63 0.21 4.59391 0.00000 1353, 555 PPC L3 vs L5 0.21 0.21 -1.33231 0.12734 1292, 555 PM L2 vs L3 11.97 8.61 4.19448 0.00002 659, 512 PM L2 vs L5 11.97 4.83 2.60816 0.00834 659, 158 PM L3 vs L5 8.61 4.83 -0.18220 0.85238 512, 158 O1 a O3 b (z > 0: first layer prefers farther distances) area pair median_a median_b z p n PPC L2 vs L3 0.63 0.21 7.92141 0.00000 1353, 1295 PPC L2 vs L5 0.63 0.21 4.56711 0.00000 1353, 554 PPC L3 vs L5 0.21 0.21 -1.34589 0.12370 1295, 554 PM L2 vs L3 11.97 8.61 4.19539 0.00002 659, 513 PM L2 vs L5 11.97 4.83 2.60816 0.00834 659, 158 PM L3 vs L5 8.61 4.83 -0.17461 0.85848 513, 158 O1 b O3 a (z > 0: first layer prefers farther distances) area pair median_a median_b z p n PPC L2 vs L3 4.41 0.21 9.45544 0.00000 1650, 1402 PPC L2 vs L5 4.41 1.47 3.18682 0.00101 1650, 775 PPC L3 vs L5 0.21 1.47 -4.34811 0.00000 1402, 775 PM L2 vs L3 14.91 14.28 3.01653 0.00242 961, 738 PM L2 vs L5 14.91 22.68 -0.87811 0.37766 961, 304 PM L3 vs L5 14.28 22.68 -3.34509 0.00077 738, 304
O1 b O3 b (z > 0: first layer prefers farther distances) area pair median_a median_b z p n PPC L2 vs L3 4.41 0.21 9.45846 0.00000 1649, 1406 PPC L2 vs L5 4.41 1.47 3.23766 0.00084 1649, 775 PPC L3 vs L5 0.21 1.47 -4.29688 0.00000 1406, 775 PM L2 vs L3 14.91 14.28 3.01653 0.00242 961, 738 PM L2 vs L5 14.91 22.68 -0.87811 0.37766 961, 304 PM L3 vs L5 14.28 22.68 -3.34509 0.00077 738, 304
Result: Blocked, methods underspecified. The readings of O1 disagree. With the zero baseline, layers 3 and 5 prefer distances nearer the goal than layer 2 in both areas with P < 0.01 (PPC z = 7.93 and 4.59; PM z = 4.19 and 2.61, P = 0.0083). With the inter-trial baseline, PM layer 5 does not differ from layer 2 (z = -0.88, P = 0.38; medians 14.91 and 22.68 cm), so the criterion fails there. Layer 3 against 5 differs only under O1 b.
Slopes of condition-averaged activity of each after-reaching neuron against approach, in the zones 25.1-8.4 and 8.4-0 cm (equation 5), under the two trace readings of the claims file.
from scipy.ndimage import uniform_filter1d
ZB = {"25.1-8.4": (F.DCENT > 8.4) & (F.DCENT <= 25.1), "8.4-0": F.DCENT <= 8.4}
def slopes_all(trace_reading):
"""Slope of each neuron's condition-averaged activity against approach (rise per cm toward the
goal, equation 5), per condition and zone. Reading (a) the 0.42 cm bins, (b) after the 8.37 cm
moving average of the classification."""
y = COND if trace_reading == "a" else uniform_filter1d(np.nan_to_num(COND), F.SMOOTH_D, axis=2, mode="nearest")
out = {}
for z, m in ZB.items():
x = F.DCENT[m]; yy = y[:, :, m]
xc = x - x.mean()
out[z] = -((yy - np.nanmean(yy, axis=2, keepdims=True)) * xc).sum(2) / (xc ** 2).sum() # neurons x conditions
return out
SLOPES = {tr: slopes_all(tr) for tr in "ab"}
SOUND_COND = {"25.1-8.4": 1, "8.4-0": 2} # condition with sound in the zone
SILENT_COND = {"25.1-8.4": 2, "8.4-0": 1}
def slope_tests(rd, tr, conds, areas=("PPC", "PM")):
c = CLS_V[rd]; out = []
for area in areas:
for L in (2, 3, 5):
m = c.after.values & (NT.area == area).values & (NT.layer == L).values
for cond in conds:
for z in ZB:
s = SLOPES[tr][z][m, cond]
p, zz, n = F.wilcoxon_z(s)
out.append(dict(area=area, layer=L, condition=COND_NAMES[cond], zone=z, sound=(cond == 0 or SOUND_COND[z] == cond),
median=np.nanmedian(s), z=zz, p=p, n=n))
return pd.DataFrame(out)
fig3c-continuous-ramp¶
In the continuous condition, after-reaching neurons increased their activity as mice approached the goal, in both PPC and PM.
Source: Figure 3c; Results, PPC represents goal distance estimated from action, paragraph 1.
for rd in CLS_GD:
for tr in "ab":
t = slope_tests(rd, tr, [0])
ok = ((t["median"] > 0) & (t.p < 0.01)).sum()
print(f"O1 {rd[0]} O3 {rd[2]}, trace reading {tr}: positive with P < 0.01 in {ok} of {len(t)}")
if rd == ("a", "67", "a"):
print(t.round(5).to_string(index=False))
O1 a O3 a, trace reading a: positive with P < 0.01 in 12 of 12 area layer condition zone sound median z p n PPC 2 continuous 25.1-8.4 True 0.00200 25.99103 0.0 942 PPC 2 continuous 8.4-0 True 0.00170 21.69701 0.0 942 PPC 3 continuous 25.1-8.4 True 0.00211 27.83286 0.0 1061 PPC 3 continuous 8.4-0 True 0.00232 25.46499 0.0 1061 PPC 5 continuous 25.1-8.4 True 0.00189 17.52812 0.0 431 PPC 5 continuous 8.4-0 True 0.00216 16.30107 0.0 431 PM 2 continuous 25.1-8.4 True 0.00229 12.66003 0.0 225 PM 2 continuous 8.4-0 True 0.00192 10.89434 0.0 225 PM 3 continuous 25.1-8.4 True 0.00161 12.88841 0.0 228 PM 3 continuous 8.4-0 True 0.00204 11.19249 0.0 228 PM 5 continuous 25.1-8.4 True 0.00213 7.36220 0.0 76 PM 5 continuous 8.4-0 True 0.00225 6.27495 0.0 76 O1 a O3 a, trace reading b: positive with P < 0.01 in 12 of 12 area layer condition zone sound median z p n PPC 2 continuous 25.1-8.4 True 0.00195 26.07040 0.0 942 PPC 2 continuous 8.4-0 True 0.00151 22.48190 0.0 942 PPC 3 continuous 25.1-8.4 True 0.00208 27.88384 0.0 1061 PPC 3 continuous 8.4-0 True 0.00201 25.84761 0.0 1061 PPC 5 continuous 25.1-8.4 True 0.00186 17.57952 0.0 431 PPC 5 continuous 8.4-0 True 0.00186 16.55652 0.0 431 PM 2 continuous 25.1-8.4 True 0.00221 12.74698 0.0 225 PM 2 continuous 8.4-0 True 0.00163 11.18999 0.0 225 PM 3 continuous 25.1-8.4 True 0.00165 12.93855 0.0 228 PM 3 continuous 8.4-0 True 0.00176 11.49436 0.0 228 PM 5 continuous 25.1-8.4 True 0.00214 7.39326 0.0 76 PM 5 continuous 8.4-0 True 0.00194 6.30602 0.0 76 O1 a O3 b, trace reading a: positive with P < 0.01 in 12 of 12 O1 a O3 b, trace reading b: positive with P < 0.01 in 12 of 12 O1 b O3 a, trace reading a: positive with P < 0.01 in 12 of 12 O1 b O3 a, trace reading b: positive with P < 0.01 in 12 of 12 O1 b O3 b, trace reading a: positive with P < 0.01 in 12 of 12 O1 b O3 b, trace reading b: positive with P < 0.01 in 12 of 12
Result: Reproduced. In the continuous condition the median slope is positive with P < 0.01 in all 12 area, layer and zone tests, under all four classification readings and both trace readings (z 6.3 to 27.9 in the reading shown).
fig3c-ppc-ramp-without-sound¶
In the intermittent conditions, PPC after-reaching neurons in all layers increased activity toward the goal both with and without sound.
Source: Figure 3c; Supplementary Figure 8a; Results, PPC represents goal distance estimated from action, paragraph 1.
for rd in CLS_GD:
for tr in "ab":
t = slope_tests(rd, tr, [1, 2], areas=("PPC",))
ok = ((t["median"] > 0) & (t.p < 0.01)).sum()
print(f"O1 {rd[0]} O3 {rd[2]}, trace reading {tr}: positive with P < 0.01 in {ok} of {len(t)}; "
f"no-sound tests {((t['median'] > 0) & (t.p < 0.01) & ~t.sound).sum()} of {(~t.sound).sum()}")
if rd == ("a", "67", "a"):
print(t.round(6).to_string(index=False))
O1 a O3 a, trace reading a: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 area layer condition zone sound median z p n PPC 2 intermittent 1 25.1-8.4 True 0.001924 22.247368 0.0 942 PPC 2 intermittent 1 8.4-0 False 0.000888 8.783357 0.0 942 PPC 2 intermittent 2 25.1-8.4 False 0.000634 12.624949 0.0 942 PPC 2 intermittent 2 8.4-0 True 0.002709 19.610044 0.0 942 PPC 3 intermittent 1 25.1-8.4 True 0.002439 25.054315 0.0 1061 PPC 3 intermittent 1 8.4-0 False 0.000815 9.339721 0.0 1061 PPC 3 intermittent 2 25.1-8.4 False 0.000691 15.435688 0.0 1061 PPC 3 intermittent 2 8.4-0 True 0.003529 24.313404 0.0 1061 PPC 5 intermittent 1 25.1-8.4 True 0.002113 16.800776 0.0 431 PPC 5 intermittent 1 8.4-0 False 0.000626 5.603093 0.0 431 PPC 5 intermittent 2 25.1-8.4 False 0.000748 10.941838 0.0 431 PPC 5 intermittent 2 8.4-0 True 0.003318 14.978553 0.0 431 O1 a O3 a, trace reading b: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 area layer condition zone sound median z p n PPC 2 intermittent 1 25.1-8.4 True 0.001852 22.782878 0.0 942 PPC 2 intermittent 1 8.4-0 False 0.000755 9.413925 0.0 942 PPC 2 intermittent 2 25.1-8.4 False 0.000564 14.325580 0.0 942 PPC 2 intermittent 2 8.4-0 True 0.002219 20.339022 0.0 942 PPC 3 intermittent 1 25.1-8.4 True 0.002228 25.349598 0.0 1061 PPC 3 intermittent 1 8.4-0 False 0.000716 9.511502 0.0 1061 PPC 3 intermittent 2 25.1-8.4 False 0.000746 18.376997 0.0 1061 PPC 3 intermittent 2 8.4-0 True 0.002695 24.708149 0.0 1061 PPC 5 intermittent 1 25.1-8.4 True 0.001998 17.050438 0.0 431 PPC 5 intermittent 1 8.4-0 False 0.000657 7.231306 0.0 431 PPC 5 intermittent 2 25.1-8.4 False 0.000708 11.962514 0.0 431 PPC 5 intermittent 2 8.4-0 True 0.002534 15.285027 0.0 431
O1 a O3 b, trace reading a: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 O1 a O3 b, trace reading b: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 O1 b O3 a, trace reading a: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 O1 b O3 a, trace reading b: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 O1 b O3 b, trace reading a: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6 O1 b O3 b, trace reading b: positive with P < 0.01 in 12 of 12; no-sound tests 6 of 6
Result: Reproduced. In both intermittent conditions PPC after-reaching neurons in all layers have positive median slopes with P < 0.01 in all 12 tests, including the 6 no-sound tests (z 5.6 to 15.4 without sound in the reading shown), under every reading.
supp8a-pm-no-sound¶
In PM, after-reaching neurons showed positive slopes in some no-sound zones, but in the intermittent 1 condition their slopes without sound were not significantly positive.
Source: Supplementary Figure 8a; Results, PPC represents goal distance estimated from action, paragraph 1.
The Methods define y(distance) as "the neural activity trace dR/R at a given goal distance binned every 0.42 cm" with no moving average, reading (a); the claims file names the moving average as reading (b), so both are run, with both readings of O1.
for rd in CLS_V:
for tr in "ab":
t = slope_tests(rd, tr, [1, 2], areas=("PM",))
t = t[~t.sound]
i2 = t[t.condition == "intermittent 2"]; i1 = t[t.condition == "intermittent 1"]
a = ((i2["median"] > 0) & (i2.p < 0.01)).sum(); b = ((i1["median"] > 0) & (i1.p < 0.01)).sum()
print(f"{klab(rd)}, trace {tr}: intermittent 2 (25.1-8.4) positive P < 0.01 in {a} of 3; intermittent 1 (8.4-0) in {b} of 3")
print(" ", t[["layer", "condition", "zone", "median", "z", "p", "n"]].round(5).to_string(index=False).replace("\n", "\n "))
O1 a O3 a, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 0 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00003 0.71456 0.47488 225
2 intermittent 2 25.1-8.4 0.00079 7.62180 0.00000 225
3 intermittent 1 8.4-0 0.00007 0.56664 0.57096 228
3 intermittent 2 25.1-8.4 0.00060 7.03943 0.00000 228
5 intermittent 1 8.4-0 0.00127 2.37640 0.01748 76
5 intermittent 2 25.1-8.4 0.00089 5.33785 0.00000 76
O1 a O3 a, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00032 1.71504 0.08634 225
2 intermittent 2 25.1-8.4 0.00076 8.11692 0.00000 225
3 intermittent 1 8.4-0 0.00007 0.69602 0.48642 228
3 intermittent 2 25.1-8.4 0.00056 7.11465 0.00000 228
5 intermittent 1 8.4-0 0.00109 3.00804 0.00263 76
5 intermittent 2 25.1-8.4 0.00085 5.60707 0.00000 76
O1 a O3 b, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 0 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00003 0.71456 0.47488 225
2 intermittent 2 25.1-8.4 0.00079 7.62180 0.00000 225
3 intermittent 1 8.4-0 0.00007 0.49968 0.61730 229
3 intermittent 2 25.1-8.4 0.00060 7.09261 0.00000 229
5 intermittent 1 8.4-0 0.00127 2.37640 0.01748 76
5 intermittent 2 25.1-8.4 0.00089 5.33785 0.00000 76
O1 a O3 b, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00032 1.71504 0.08634 225
2 intermittent 2 25.1-8.4 0.00076 8.11692 0.00000 225
3 intermittent 1 8.4-0 0.00007 0.61426 0.53904 229
3 intermittent 2 25.1-8.4 0.00058 7.16933 0.00000 229
5 intermittent 1 8.4-0 0.00109 3.00804 0.00263 76
5 intermittent 2 25.1-8.4 0.00085 5.60707 0.00000 76
O1 b O3 a, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00002 0.10162 0.91906 232
2 intermittent 2 25.1-8.4 0.00061 6.91132 0.00000 232
3 intermittent 1 8.4-0 -0.00003 -0.50846 0.61113 231
3 intermittent 2 25.1-8.4 0.00048 5.92645 0.00000 231
5 intermittent 1 8.4-0 0.00182 2.75018 0.00596 74
5 intermittent 2 25.1-8.4 0.00103 4.66265 0.00000 74
O1 b O3 a, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00007 0.91460 0.36040 232
2 intermittent 2 25.1-8.4 0.00061 7.23475 0.00000 232
3 intermittent 1 8.4-0 -0.00003 -0.57927 0.56241 231
3 intermittent 2 25.1-8.4 0.00041 5.99431 0.00000 231
5 intermittent 1 8.4-0 0.00141 3.24581 0.00117 74
5 intermittent 2 25.1-8.4 0.00086 4.84582 0.00000 74
O1 b O3 b, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00002 0.10162 0.91906 232
2 intermittent 2 25.1-8.4 0.00061 6.91132 0.00000 232
3 intermittent 1 8.4-0 -0.00003 -0.50846 0.61113 231
3 intermittent 2 25.1-8.4 0.00048 5.92645 0.00000 231
5 intermittent 1 8.4-0 0.00182 2.75018 0.00596 74
5 intermittent 2 25.1-8.4 0.00103 4.66265 0.00000 74
O1 b O3 b, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00007 0.91460 0.36040 232
2 intermittent 2 25.1-8.4 0.00061 7.23475 0.00000 232
3 intermittent 1 8.4-0 -0.00003 -0.57927 0.56241 231
3 intermittent 2 25.1-8.4 0.00041 5.99431 0.00000 231
5 intermittent 1 8.4-0 0.00141 3.24581 0.00117 74
5 intermittent 2 25.1-8.4 0.00086 4.84582 0.00000 74
O1 a O3 a, k-means per session, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00005 0.37985 0.70406 298
2 intermittent 2 25.1-8.4 0.00066 7.35678 0.00000 298
3 intermittent 1 8.4-0 0.00019 0.81267 0.41641 227
3 intermittent 2 25.1-8.4 0.00074 7.24439 0.00000 227
5 intermittent 1 8.4-0 0.00131 3.53886 0.00040 97
5 intermittent 2 25.1-8.4 0.00082 5.64023 0.00000 97
O1 a O3 a, k-means per session, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00012 1.26313 0.20654 298
2 intermittent 2 25.1-8.4 0.00056 7.79473 0.00000 298
3 intermittent 1 8.4-0 0.00015 0.73393 0.46299 227
3 intermittent 2 25.1-8.4 0.00067 7.58763 0.00000 227
5 intermittent 1 8.4-0 0.00108 4.24412 0.00002 97
5 intermittent 2 25.1-8.4 0.00061 5.86332 0.00000 97
O1 a O3 b, k-means per session, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00005 0.37985 0.70406 298
2 intermittent 2 25.1-8.4 0.00066 7.35678 0.00000 298
3 intermittent 1 8.4-0 0.00019 0.81267 0.41641 227
3 intermittent 2 25.1-8.4 0.00074 7.24439 0.00000 227
5 intermittent 1 8.4-0 0.00132 3.56661 0.00036 96
5 intermittent 2 25.1-8.4 0.00080 5.63129 0.00000 96
O1 a O3 b, k-means per session, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00012 1.26313 0.20654 298
2 intermittent 2 25.1-8.4 0.00056 7.79473 0.00000 298
3 intermittent 1 8.4-0 0.00015 0.73393 0.46299 227
3 intermittent 2 25.1-8.4 0.00067 7.58763 0.00000 227
5 intermittent 1 8.4-0 0.00110 4.24996 0.00002 96
5 intermittent 2 25.1-8.4 0.00067 5.92729 0.00000 96
O1 b O3 a, k-means per session, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00002 0.25689 0.79727 264
2 intermittent 2 25.1-8.4 0.00066 6.93839 0.00000 264
3 intermittent 1 8.4-0 0.00008 0.05256 0.95808 215
3 intermittent 2 25.1-8.4 0.00061 6.81320 0.00000 215
5 intermittent 1 8.4-0 0.00210 3.27747 0.00105 71
5 intermittent 2 25.1-8.4 0.00120 5.25999 0.00000 71
O1 b O3 a, k-means per session, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00006 0.62571 0.53150 264
2 intermittent 2 25.1-8.4 0.00059 7.10669 0.00000 264
3 intermittent 1 8.4-0 -0.00002 -0.20039 0.84118 215
3 intermittent 2 25.1-8.4 0.00059 7.01687 0.00000 215
5 intermittent 1 8.4-0 0.00140 3.81607 0.00014 71
5 intermittent 2 25.1-8.4 0.00102 5.38032 0.00000 71
O1 b O3 b, k-means per session, trace a: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 -0.00002 0.16841 0.86626 266
2 intermittent 2 25.1-8.4 0.00066 6.91338 0.00000 266
3 intermittent 1 8.4-0 0.00008 0.05256 0.95808 215
3 intermittent 2 25.1-8.4 0.00061 6.81320 0.00000 215
5 intermittent 1 8.4-0 0.00210 3.27747 0.00105 71
5 intermittent 2 25.1-8.4 0.00120 5.25999 0.00000 71
O1 b O3 b, k-means per session, trace b: intermittent 2 (25.1-8.4) positive P < 0.01 in 3 of 3; intermittent 1 (8.4-0) in 1 of 3
layer condition zone median z p n
2 intermittent 1 8.4-0 0.00006 0.55697 0.57755 266
2 intermittent 2 25.1-8.4 0.00059 7.12438 0.00000 266
3 intermittent 1 8.4-0 -0.00002 -0.20039 0.84118 215
3 intermittent 2 25.1-8.4 0.00059 7.01687 0.00000 215
5 intermittent 1 8.4-0 0.00140 3.81607 0.00014 71
5 intermittent 2 25.1-8.4 0.00102 5.38032 0.00000 71
Result: Blocked, methods underspecified. The readings disagree. With O1 a and trace reading (a), PM after-reaching neurons have positive slopes with P < 0.01 in intermittent 2 at 25.1-8.4 cm in all three layers, and in no layer in intermittent 1 at 8.4-0 cm (P = 0.47, 0.57 and 0.017), so the criterion holds there. With the moving average (trace b), or the inter-trial baseline, layer 5 in intermittent 1 reaches P < 0.01 (P = 0.0026 under O1 a with trace b), so the claim's absence part fails. With k-means per session (a variant) one intermittent 1 test is positive with P < 0.01 under every reading.
supp8b-slopes-lower-without-sound¶
Slopes of after-reaching activity were lower without sound than with sound.
Source: Supplementary Figure 8b.
for rd in CLS_V:
c = CLS_V[rd]
for tr in "ab":
out = []
for area in ("PPC", "PM"):
for L in (2, 3, 5):
m = c.after.values & (NT.area == area).values & (NT.layer == L).values
for z in ZB:
w, wo = SLOPES[tr][z][m, SOUND_COND[z]], SLOPES[tr][z][m, SILENT_COND[z]]
p, zz, n = F.wilcoxon_z(wo, w)
out.append(dict(area=area, layer=L, zone=z, with_sound=np.nanmedian(w), without=np.nanmedian(wo), z=zz, p=p, n=n))
t = pd.DataFrame(out)
low = (t.z < 0) & (t.p < 0.01)
print(f"{klab(rd)}, trace {tr}: without lower P < 0.01 in PPC {low[t.area == 'PPC'].sum()} of 6, PM {low[t.area == 'PM'].sum()} of 6")
if rd == ("a", "67", "a"):
print(t.round(5).to_string(index=False))
O1 a O3 a, trace a: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 area layer zone with_sound without z p n PPC 2 25.1-8.4 0.00192 0.00063 -15.57810 0.00000 942 PPC 2 8.4-0 0.00271 0.00089 -9.27098 0.00000 942 PPC 3 25.1-8.4 0.00244 0.00069 -19.42491 0.00000 1061 PPC 3 8.4-0 0.00353 0.00082 -16.52056 0.00000 1061 PPC 5 25.1-8.4 0.00211 0.00075 -12.79730 0.00000 431 PPC 5 8.4-0 0.00332 0.00063 -10.23807 0.00000 431 PM 2 25.1-8.4 0.00170 0.00079 -5.24539 0.00000 225 PM 2 8.4-0 0.00270 0.00003 -6.33794 0.00000 225 PM 3 25.1-8.4 0.00087 0.00060 -3.05286 0.00227 228 PM 3 8.4-0 0.00142 0.00007 -4.08887 0.00004 228 PM 5 25.1-8.4 0.00146 0.00089 -2.17967 0.02928 76 PM 5 8.4-0 0.00324 0.00127 -2.38676 0.01700 76 O1 a O3 a, trace b: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 area layer zone with_sound without z p n PPC 2 25.1-8.4 0.00185 0.00056 -16.09756 0.00000 942 PPC 2 8.4-0 0.00222 0.00075 -9.71035 0.00000 942 PPC 3 25.1-8.4 0.00223 0.00075 -19.47920 0.00000 1061 PPC 3 8.4-0 0.00269 0.00072 -17.13767 0.00000 1061 PPC 5 25.1-8.4 0.00200 0.00071 -13.25681 0.00000 431 PPC 5 8.4-0 0.00253 0.00066 -9.57875 0.00000 431 PM 2 25.1-8.4 0.00156 0.00076 -5.58502 0.00000 225 PM 2 8.4-0 0.00194 0.00032 -5.75279 0.00000 225 PM 3 25.1-8.4 0.00085 0.00056 -3.60546 0.00031 228 PM 3 8.4-0 0.00118 0.00007 -4.06580 0.00005 228 PM 5 25.1-8.4 0.00151 0.00085 -2.39194 0.01676 76 PM 5 8.4-0 0.00231 0.00109 -2.26768 0.02335 76 O1 a O3 b, trace a: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 a O3 b, trace b: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 b O3 a, trace a: without lower P < 0.01 in PPC 6 of 6, PM 3 of 6
O1 b O3 a, trace b: without lower P < 0.01 in PPC 6 of 6, PM 3 of 6 O1 b O3 b, trace a: without lower P < 0.01 in PPC 6 of 6, PM 3 of 6 O1 b O3 b, trace b: without lower P < 0.01 in PPC 6 of 6, PM 3 of 6
O1 a O3 a, k-means per session, trace a: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6
O1 a O3 a, k-means per session, trace b: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 a O3 b, k-means per session, trace a: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 a O3 b, k-means per session, trace b: without lower P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 b O3 a, k-means per session, trace a: without lower P < 0.01 in PPC 6 of 6, PM 2 of 6 O1 b O3 a, k-means per session, trace b: without lower P < 0.01 in PPC 6 of 6, PM 2 of 6
O1 b O3 b, k-means per session, trace a: without lower P < 0.01 in PPC 6 of 6, PM 2 of 6 O1 b O3 b, k-means per session, trace b: without lower P < 0.01 in PPC 6 of 6, PM 2 of 6
Result: Blocked, methods underspecified. The readings disagree. Slopes without sound are lower than with sound with P < 0.01 in all six PPC comparisons under every reading. PM reaches it in four of six under O1 a, as the criterion needs, but in three under O1 b. With k-means per session (a variant), PM has four of six under O1 a and two under O1 b.
supp8c-ppc-steeper-than-pm¶
Without sound, PPC after-reaching neurons in layers 2 and 3 had steeper slopes than PM, while slopes in PM were equal to or lower than in PPC.
Source: Supplementary Figure 8c; Results, PPC represents goal distance estimated from action, paragraph 1.
for rd in CLS_V:
c = CLS_V[rd]
for tr in "ab":
out = []
for L in (2, 3, 5):
for z in ZB:
sel = lambda area: c.after.values & (NT.area == area).values & (NT.layer == L).values
a, b = SLOPES[tr][z][sel("PPC"), SILENT_COND[z]], SLOPES[tr][z][sel("PM"), SILENT_COND[z]]
p, zz = F.mwu(a, b)
out.append(dict(layer=L, zone=z, ppc=np.nanmedian(a), pm=np.nanmedian(b), z=zz, p=p, n=f"{len(a)}, {len(b)}"))
t = pd.DataFrame(out)
hi = (t.z > 0) & (t.p < 0.05)
ok = hi[t.layer == 3].all() and hi[t.layer == 2].any() and not ((t.z < 0) & (t.p < 0.05)).any()
print(f"{klab(rd)}, trace {tr}: criterion met {ok}")
print(" ", t.round(5).to_string(index=False).replace("\n", "\n "))
O1 a O3 a, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00063 0.00079 -1.74350 0.08126 942, 225
2 8.4-0 0.00089 0.00003 3.28930 0.00100 942, 225
3 25.1-8.4 0.00069 0.00060 0.53691 0.59140 1061, 228
3 8.4-0 0.00082 0.00007 3.42777 0.00061 1061, 228
5 25.1-8.4 0.00075 0.00089 -0.79910 0.42448 431, 76
5 8.4-0 0.00063 0.00127 -0.76344 0.44546 431, 76
O1 a O3 a, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00056 0.00076 -1.47490 0.14027 942, 225
2 8.4-0 0.00075 0.00032 2.57353 0.01007 942, 225
3 25.1-8.4 0.00075 0.00056 1.63878 0.10128 1061, 228
3 8.4-0 0.00072 0.00007 3.38032 0.00072 1061, 228
5 25.1-8.4 0.00071 0.00085 -0.49594 0.62024 431, 76
5 8.4-0 0.00066 0.00109 -0.75749 0.44901 431, 76
O1 a O3 b, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00063 0.00079 -1.74350 0.08126 942, 225
2 8.4-0 0.00089 0.00003 3.28930 0.00100 942, 225
3 25.1-8.4 0.00069 0.00060 0.52148 0.60210 1064, 229
3 8.4-0 0.00080 0.00007 3.44607 0.00057 1064, 229
5 25.1-8.4 0.00077 0.00089 -0.77614 0.43792 430, 76
5 8.4-0 0.00062 0.00127 -0.77784 0.43691 430, 76
O1 a O3 b, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00056 0.00076 -1.47490 0.14027 942, 225
2 8.4-0 0.00075 0.00032 2.57353 0.01007 942, 225
3 25.1-8.4 0.00075 0.00058 1.60149 0.10929 1064, 229
3 8.4-0 0.00071 0.00007 3.40686 0.00066 1064, 229
5 25.1-8.4 0.00071 0.00085 -0.46977 0.63882 430, 76
5 8.4-0 0.00065 0.00109 -0.77444 0.43892 430, 76
O1 b O3 a, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00057 0.00061 -1.04626 0.29549 904, 232
2 8.4-0 0.00078 -0.00002 3.52755 0.00042 904, 232
3 25.1-8.4 0.00067 0.00048 1.41252 0.15783 962, 231
3 8.4-0 0.00070 -0.00003 4.12846 0.00004 962, 231
5 25.1-8.4 0.00065 0.00103 -1.43730 0.15075 452, 74
5 8.4-0 0.00049 0.00182 -1.89935 0.05757 452, 74
O1 b O3 a, trace b: criterion met True
layer zone ppc pm z p n
2 25.1-8.4 0.00052 0.00061 -0.78582 0.43204 904, 232
2 8.4-0 0.00063 0.00007 2.92590 0.00344 904, 232
3 25.1-8.4 0.00071 0.00041 2.48881 0.01282 962, 231
3 8.4-0 0.00057 -0.00003 4.09507 0.00004 962, 231
5 25.1-8.4 0.00064 0.00086 -1.19060 0.23397 452, 74
5 8.4-0 0.00044 0.00141 -1.86222 0.06263 452, 74
O1 b O3 b, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00057 0.00061 -0.98443 0.32496 903, 232
2 8.4-0 0.00078 -0.00002 3.50501 0.00046 903, 232
3 25.1-8.4 0.00067 0.00048 1.37270 0.16988 966, 231
3 8.4-0 0.00068 -0.00003 4.09458 0.00004 966, 231
5 25.1-8.4 0.00065 0.00103 -1.43730 0.15075 452, 74
5 8.4-0 0.00049 0.00182 -1.89935 0.05757 452, 74
O1 b O3 b, trace b: criterion met True
layer zone ppc pm z p n
2 25.1-8.4 0.00052 0.00061 -0.72597 0.46793 903, 232
2 8.4-0 0.00062 0.00007 2.90074 0.00372 903, 232
3 25.1-8.4 0.00070 0.00041 2.44518 0.01448 966, 231
3 8.4-0 0.00057 -0.00003 4.07594 0.00005 966, 231
5 25.1-8.4 0.00064 0.00086 -1.19060 0.23397 452, 74
5 8.4-0 0.00044 0.00141 -1.86222 0.06263 452, 74
O1 a O3 a, k-means per session, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00063 0.00066 -0.34422 0.73076 922, 298
2 8.4-0 0.00093 -0.00005 4.08671 0.00004 922, 298
3 25.1-8.4 0.00071 0.00074 0.17564 0.86066 916, 227
3 8.4-0 0.00082 0.00019 3.22149 0.00128 916, 227
5 25.1-8.4 0.00072 0.00082 -0.37706 0.70642 394, 97
5 8.4-0 0.00060 0.00131 -1.42917 0.15307 394, 97
O1 a O3 a, k-means per session, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00056 0.00056 0.15282 0.87862 922, 298
2 8.4-0 0.00077 0.00012 3.49114 0.00048 922, 298
3 25.1-8.4 0.00074 0.00067 0.95502 0.33963 916, 227
3 8.4-0 0.00074 0.00015 3.33087 0.00087 916, 227
5 25.1-8.4 0.00070 0.00061 0.17016 0.86520 394, 97
5 8.4-0 0.00064 0.00108 -1.37485 0.16930 394, 97
O1 a O3 b, k-means per session, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00063 0.00066 -0.34422 0.73076 922, 298
2 8.4-0 0.00093 -0.00005 4.08671 0.00004 922, 298
3 25.1-8.4 0.00072 0.00074 0.20950 0.83415 919, 227
3 8.4-0 0.00082 0.00019 3.17563 0.00150 919, 227
5 25.1-8.4 0.00072 0.00080 -0.36896 0.71246 394, 96
5 8.4-0 0.00060 0.00132 -1.50799 0.13166 394, 96
O1 a O3 b, k-means per session, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00056 0.00056 0.15282 0.87862 922, 298
2 8.4-0 0.00077 0.00012 3.49114 0.00048 922, 298
3 25.1-8.4 0.00075 0.00067 0.99599 0.31931 919, 227
3 8.4-0 0.00073 0.00015 3.29208 0.00099 919, 227
5 25.1-8.4 0.00070 0.00067 0.09324 0.92603 394, 96
5 8.4-0 0.00064 0.00110 -1.45172 0.14669 394, 96
O1 b O3 a, k-means per session, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00057 0.00066 -0.79658 0.42575 895, 264
2 8.4-0 0.00085 -0.00002 3.65880 0.00025 895, 264
3 25.1-8.4 0.00070 0.00061 0.21560 0.82940 846, 215
3 8.4-0 0.00068 0.00008 3.42610 0.00061 846, 215
5 25.1-8.4 0.00063 0.00120 -2.57390 0.01007 388, 71
5 8.4-0 0.00045 0.00210 -2.72182 0.00650 388, 71
O1 b O3 a, k-means per session, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00052 0.00059 -0.32119 0.74815 895, 264
2 8.4-0 0.00065 0.00006 3.44286 0.00058 895, 264
3 25.1-8.4 0.00072 0.00059 1.12284 0.26156 846, 215
3 8.4-0 0.00070 -0.00002 3.73641 0.00019 846, 215
5 25.1-8.4 0.00055 0.00102 -2.36566 0.01802 388, 71
5 8.4-0 0.00041 0.00140 -2.54276 0.01101 388, 71
O1 b O3 b, k-means per session, trace a: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00057 0.00066 -0.76628 0.44357 901, 266
2 8.4-0 0.00083 -0.00002 3.66698 0.00025 901, 266
3 25.1-8.4 0.00070 0.00061 0.21560 0.82940 846, 215
3 8.4-0 0.00068 0.00008 3.42610 0.00061 846, 215
5 25.1-8.4 0.00064 0.00120 -2.54931 0.01081 387, 71
5 8.4-0 0.00045 0.00210 -2.71513 0.00663 387, 71
O1 b O3 b, k-means per session, trace b: criterion met False
layer zone ppc pm z p n
2 25.1-8.4 0.00052 0.00059 -0.35156 0.72524 901, 266
2 8.4-0 0.00063 0.00006 3.39886 0.00068 901, 266
3 25.1-8.4 0.00072 0.00059 1.12284 0.26156 846, 215
3 8.4-0 0.00070 -0.00002 3.73641 0.00019 846, 215
5 25.1-8.4 0.00056 0.00102 -2.34349 0.01913 387, 71
5 8.4-0 0.00040 0.00140 -2.55516 0.01063 387, 71
Result: Blocked, methods underspecified. The readings disagree. Under O1 a with trace (a), PPC no-sound slopes exceed PM in layers 2 and 3 at 8.4-0 cm (P = 0.0010 and 0.0006) and PM is significantly steeper in no comparison, but layer 3 at 25.1-8.4 cm does not differ (P = 0.59), so the criterion fails. It holds under O1 b with trace (b) (layer 3 at 25.1-8.4 cm, P = 0.013), and fails under the other six classification and trace readings. With k-means per session it fails under every reading.
supp9-preserved-representation¶
PPC neurons kept the distance preference they had in the continuous condition in the intermittent conditions, especially near the goal, more than PM neurons did.
Source: Supplementary Figure 9b; Results, PPC represents goal distance estimated from action, paragraph 2.
The claims file, as amended after a reader's answer (questions/001605.yaml), tests the
signed difference, continuous minus intermittent, as Supplementary Fig. 9b plots it, and
judges the area that preserved more by the median nearer zero. The criterion needs both group
readings; the absolute difference, which the first run of this attempt tested, is shown as a
variant and not judged. Group sizes of both readings are printed against Supplementary Fig. 9a.
def supp9(rd, groups, measure="signed"):
"""PPC against PM per condition, layer and group. measure 'signed' is continuous minus
intermittent, as Supplementary Fig. 9b plots it (claims file); 'absolute' is the variant."""
c = CLS_GD[rd]; out = []
pc = COND_PREF[:, 0]
for ci in (1, 2):
diff = pc - COND_PREF[:, ci]
if measure == "absolute":
diff = np.abs(diff)
for L in (2, 3, 5):
for gname in list(groups) + ["after-reaching"]:
if gname == "after-reaching":
gm = c.after.values
else:
hi, lo = groups[gname]
gm = c.before.values & (pc <= hi) & (pc > lo)
sel = lambda area: gm & (NT.area == area).values & (NT.layer == L).values
a, b = diff[sel("PPC")], diff[sel("PM")]
p, z = F.mwu(a, b)
out.append(dict(condition=COND_NAMES[ci], layer=L, group=gname, ppc=np.nanmedian(a), pm=np.nanmedian(b), z=z, p=p,
n=f"{np.sum(~np.isnan(a))}, {np.sum(~np.isnan(b))}"))
t = pd.DataFrame(out)
# the area that preserved more is the one whose median is nearer zero (claims file)
t["nearer"] = np.where(t.ppc.abs() < t.pm.abs(), "PPC", np.where(t.pm.abs() < t.ppc.abs(), "PM", "tie"))
return t
G9 = {"a": {"67-50.25": (67.2, 50.25), "50.25-33.5": (50.25, 33.5), "33.5-16.75": (33.5, 16.75), "16.75-0": (16.75, 0)},
"b": {"67-58.6": (67.2, 58.6), "58.6-25.1": (58.6, 25.1), "25.1-8.4": (25.1, 8.4), "8.4-0": (8.4, 0)}}
S9 = {}
for measure in ("signed", "absolute"):
print(f"--- {measure} differences" + (" (criterion)" if measure == "signed" else " (variant, not judged)"))
for rd in CLS_GD:
ok_all = True
for gr in "ab":
t = supp9(rd, G9[gr], measure)
S9[(measure, rd, gr)] = t
sig = t.p < 0.05
af = t[(t.group == "after-reaching") & (t.condition == "intermittent 1")]
a = ((af.nearer == "PPC") & (af.p < 0.05)).sum()
pm_better = (sig & (t.nearer == "PM")).sum()
ppc_better = (sig & (t.nearer == "PPC")).sum()
ok = (a >= 1) and (pm_better == 0); ok_all &= ok
print(f"O1 {rd[0]} O3 {rd[2]}, groups {gr}: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in {a} of 3 layers; "
f"of {len(t)} comparisons {sig.sum()} have P < 0.05, PPC nearer zero in {ppc_better}, PM nearer zero in {pm_better}; "
f"criterion {'met' if ok else 'not met'}")
print(f"O1 {rd[0]} O3 {rd[2]}: criterion under both group readings {'met' if ok_all else 'not met'}")
for gr in "ab":
print(f"\nsigned differences, O1 a O3 a, groups {gr} (cm; ppc and pm are medians)")
print(S9[("signed", ("a", "67", "a"), gr)].round(5).to_string(index=False))
print("\nabsolute differences, O1 a O3 a, groups a (variant)")
print(S9[("absolute", ("a", "67", "a"), "a")].round(5).to_string(index=False))
# group sizes against Supplementary Fig. 9a (before-reaching groups; paper n per layer)
PAPER9 = {"PPC L2": [82, 53, 66, 171], "PPC L3": [14, 19, 22, 145], "PPC L5": [26, 8, 16, 66],
"PM L2": [60, 38, 87, 223], "PM L3": [23, 16, 76, 160], "PM L5": [17, 4, 18, 36]}
c = CLS_GD[("a", "67", "a")]; pc = COND_PREF[:, 0]
for gr in "ab":
err = 0
for g in GROUPS:
m = c.before.values & (NT.group == g).values
n = [int((m & (pc <= hi) & (pc > lo)).sum()) for hi, lo in G9[gr].values()]
frac = np.array(n) / max(sum(n), 1); pf = np.array(PAPER9[g]) / sum(PAPER9[g])
err += np.abs(frac - pf).sum()
print(f"groups {gr}, {g}: n {n} (paper {PAPER9[g]})")
print(f"groups {gr}: summed absolute difference of group shares from the paper's, {err:.2f}")
# range of the signed differences, against the axis of Supplementary Fig. 9b (-58.6 to 37.7 cm)
for ci in (1, 2):
d = COND_PREF[:, 0] - COND_PREF[:, ci]
m = c.gd.values
print(f"signed difference continuous minus {COND_NAMES[ci]}, goal-distance neurons (O1 a): range {np.nanmin(d[m]):.1f} to {np.nanmax(d[m]):.1f} cm, "
f"{int(np.sum(~np.isnan(d[m])))} neurons with a preference in both conditions")
# per mouse, intermittent 1 after-reaching, O1 a O3 a (signed)
d = COND_PREF[:, 0] - COND_PREF[:, 1]
MOUSE = sessions.subject.values[NT.session.values]
rows = []
for mouse in sorted(set(MOUSE)):
r = {"mouse": mouse}
for area in ("PPC", "PM"):
m = c.after.values & (NT.area == area).values & (MOUSE == mouse)
r[f"{area} median"] = np.nanmedian(d[m]) if m.any() else np.nan; r[f"{area} n"] = int(np.sum(~np.isnan(d[m])))
rows.append(r)
print("\nper mouse, intermittent 1 after-reaching, signed difference (cm)")
print(pd.DataFrame(rows).round(2).to_string(index=False))
--- signed differences (criterion)
O1 a O3 a, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 10 have P < 0.05, PPC nearer zero in 7, PM nearer zero in 2; criterion not met
O1 a O3 a, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 9 have P < 0.05, PPC nearer zero in 8, PM nearer zero in 0; criterion met O1 a O3 a: criterion under both group readings not met
O1 a O3 b, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 10 have P < 0.05, PPC nearer zero in 7, PM nearer zero in 2; criterion not met
O1 a O3 b, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 9 have P < 0.05, PPC nearer zero in 8, PM nearer zero in 0; criterion met O1 a O3 b: criterion under both group readings not met
O1 b O3 a, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 9, PM nearer zero in 2; criterion not met
O1 b O3 a, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 10 have P < 0.05, PPC nearer zero in 10, PM nearer zero in 0; criterion met O1 b O3 a: criterion under both group readings not met
O1 b O3 b, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 9, PM nearer zero in 2; criterion not met
O1 b O3 b, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 10 have P < 0.05, PPC nearer zero in 10, PM nearer zero in 0; criterion met O1 b O3 b: criterion under both group readings not met --- absolute differences (variant, not judged)
O1 a O3 a, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 3 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 11, PM nearer zero in 0; criterion met
O1 a O3 a, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 3 of 3 layers; of 30 comparisons 12 have P < 0.05, PPC nearer zero in 11, PM nearer zero in 1; criterion not met O1 a O3 a: criterion under both group readings not met
O1 a O3 b, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 3 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 11, PM nearer zero in 0; criterion met
O1 a O3 b, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 3 of 3 layers; of 30 comparisons 12 have P < 0.05, PPC nearer zero in 11, PM nearer zero in 1; criterion not met O1 a O3 b: criterion under both group readings not met
O1 b O3 a, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 10, PM nearer zero in 1; criterion not met
O1 b O3 a, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 12 have P < 0.05, PPC nearer zero in 12, PM nearer zero in 0; criterion met O1 b O3 a: criterion under both group readings not met
O1 b O3 b, groups a: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 11 have P < 0.05, PPC nearer zero in 10, PM nearer zero in 1; criterion not met
O1 b O3 b, groups b: intermittent 1 after-reaching P < 0.05 with PPC median nearer zero in 2 of 3 layers; of 30 comparisons 12 have P < 0.05, PPC nearer zero in 12, PM nearer zero in 0; criterion met
O1 b O3 b: criterion under both group readings not met
signed differences, O1 a O3 a, groups a (cm; ppc and pm are medians)
condition layer group ppc pm z p n nearer
intermittent 1 2 67-50.25 0.00 2.10 -2.39874 0.01608 110, 92 PPC
intermittent 1 2 50.25-33.5 -5.46 -4.20 -0.72986 0.46803 52, 36 PM
intermittent 1 2 33.5-16.75 -9.24 -9.24 0.37990 0.70523 69, 96 tie
intermittent 1 2 16.75-0 -1.26 -11.76 5.85062 0.00000 180, 210 PPC
intermittent 1 2 after-reaching -2.10 -5.04 2.70707 0.00660 942, 225 PPC
intermittent 1 3 67-50.25 2.52 0.00 2.48853 0.01265 31, 30 PM
intermittent 1 3 50.25-33.5 -9.24 -1.89 -2.10494 0.03655 20, 18 PM
intermittent 1 3 33.5-16.75 -10.08 -10.50 -0.71106 0.47967 26, 66 PPC
intermittent 1 3 16.75-0 -1.68 -15.54 10.30763 0.00000 154, 170 PPC
intermittent 1 3 after-reaching -2.52 -6.30 4.96792 0.00000 1061, 228 PPC
intermittent 1 5 67-50.25 1.89 0.00 1.61212 0.10775 34, 20 PM
intermittent 1 5 50.25-33.5 -2.10 -17.64 2.03810 0.05080 8, 4 PPC
intermittent 1 5 33.5-16.75 -7.56 -5.88 -0.80734 0.42770 17, 21 PM
intermittent 1 5 16.75-0 -0.84 -6.30 2.49171 0.01275 65, 37 PPC
intermittent 1 5 after-reaching -1.68 -2.52 1.27551 0.19785 431, 76 PPC
intermittent 2 2 67-50.25 0.21 1.26 -0.83986 0.39803 110, 92 PPC
intermittent 2 2 50.25-33.5 -5.04 -10.71 0.41161 0.68371 52, 36 PPC
intermittent 2 2 33.5-16.75 0.00 0.00 0.19656 0.84545 69, 96 tie
intermittent 2 2 16.75-0 -2.52 -4.62 1.14345 0.25282 180, 210 PPC
intermittent 2 2 after-reaching 0.00 0.00 1.65257 0.09105 942, 225 tie
intermittent 2 3 67-50.25 2.52 2.73 0.18754 0.85646 31, 30 PPC
intermittent 2 3 50.25-33.5 0.21 -1.26 0.29235 0.78120 20, 18 PPC
intermittent 2 3 33.5-16.75 0.00 0.63 0.01301 0.99308 26, 66 PPC
intermittent 2 3 16.75-0 0.00 -8.19 4.52529 0.00001 154, 170 PPC
intermittent 2 3 after-reaching 0.00 0.00 4.44120 0.00000 1061, 228 tie
intermittent 2 5 67-50.25 4.62 4.41 0.03582 0.97855 34, 20 PM
intermittent 2 5 50.25-33.5 -10.71 -20.79 1.01905 0.35024 8, 4 PPC
intermittent 2 5 33.5-16.75 -0.84 -6.30 0.38165 0.71361 17, 21 PPC
intermittent 2 5 16.75-0 -0.42 -2.52 -0.59509 0.55300 65, 37 PPC
intermittent 2 5 after-reaching 0.00 0.00 -0.82713 0.37856 431, 76 tie
signed differences, O1 a O3 a, groups b (cm; ppc and pm are medians)
condition layer group ppc pm z p n nearer
intermittent 1 2 67-58.6 0.00 2.94 -3.26173 0.00102 90, 71 PPC
intermittent 1 2 58.6-25.1 -7.98 -6.30 -0.86779 0.38598 127, 119 PM
intermittent 1 2 25.1-8.4 -10.08 -12.60 1.16901 0.24284 63, 155 PPC
intermittent 1 2 8.4-0 -0.84 -7.56 4.16398 0.00003 131, 89 PPC
intermittent 1 2 after-reaching -2.10 -5.04 2.70707 0.00660 942, 225 PPC
intermittent 1 3 67-58.6 4.62 0.00 1.75296 0.07880 28, 24 PM
intermittent 1 3 58.6-25.1 -9.66 -8.19 -0.78725 0.43323 39, 58 PM
intermittent 1 3 25.1-8.4 -1.68 -13.86 5.32684 0.00000 49, 145 PPC
intermittent 1 3 8.4-0 -2.52 -18.90 6.47668 0.00000 115, 57 PPC
intermittent 1 3 after-reaching -2.52 -6.30 4.96792 0.00000 1061, 228 PPC
intermittent 1 5 67-58.6 2.10 0.00 1.07222 0.28633 27, 14 PM
intermittent 1 5 58.6-25.1 -5.04 -6.30 0.60575 0.55090 28, 23 PPC
intermittent 1 5 25.1-8.4 0.00 -11.55 2.16998 0.03095 19, 22 PPC
intermittent 1 5 8.4-0 -1.47 -3.36 0.67093 0.50501 50, 23 PPC
intermittent 1 5 after-reaching -1.68 -2.52 1.27551 0.19785 431, 76 PPC
intermittent 2 2 67-58.6 0.42 2.52 -1.42318 0.14891 90, 71 PPC
intermittent 2 2 58.6-25.1 -3.36 -2.52 -0.07710 0.93926 127, 119 PM
intermittent 2 2 25.1-8.4 -4.62 -3.78 1.19862 0.23110 63, 155 PM
intermittent 2 2 8.4-0 -1.26 -4.62 1.02832 0.30322 131, 89 PPC
intermittent 2 2 after-reaching 0.00 0.00 1.65257 0.09105 942, 225 tie
intermittent 2 3 67-58.6 3.78 2.52 0.89942 0.37095 28, 24 PM
intermittent 2 3 58.6-25.1 0.00 0.21 0.27959 0.78260 39, 58 PPC
intermittent 2 3 25.1-8.4 -0.84 -5.04 1.49358 0.13565 49, 145 PPC
intermittent 2 3 8.4-0 0.00 -9.24 5.09416 0.00000 115, 57 PPC
intermittent 2 3 after-reaching 0.00 0.00 4.44120 0.00000 1061, 228 tie
intermittent 2 5 67-58.6 4.62 3.99 -0.10997 0.92326 27, 14 PM
intermittent 2 5 58.6-25.1 -1.47 -6.30 0.75719 0.45462 28, 23 PPC
intermittent 2 5 25.1-8.4 -7.14 -0.21 -1.69938 0.09169 19, 22 PM
intermittent 2 5 8.4-0 0.00 -5.46 0.71249 0.47701 50, 23 PPC
intermittent 2 5 after-reaching 0.00 0.00 -0.82713 0.37856 431, 76 tie
absolute differences, O1 a O3 a, groups a (variant)
condition layer group ppc pm z p n nearer
intermittent 1 2 67-50.25 2.52 5.04 -2.64647 0.00790 110, 92 PPC
intermittent 1 2 50.25-33.5 9.45 7.77 0.28006 0.78265 52, 36 PM
intermittent 1 2 33.5-16.75 9.66 10.08 -0.63923 0.52371 69, 96 PPC
intermittent 1 2 16.75-0 3.99 12.18 -6.30881 0.00000 180, 210 PPC
intermittent 1 2 after-reaching 3.78 6.30 -4.15499 0.00003 942, 225 PPC
intermittent 1 3 67-50.25 4.62 1.68 1.53640 0.12429 31, 30 PM
intermittent 1 3 50.25-33.5 10.50 5.25 1.53485 0.12824 20, 18 PM
intermittent 1 3 33.5-16.75 10.08 10.71 0.66770 0.50702 26, 66 PPC
intermittent 1 3 16.75-0 3.78 15.54 -10.27141 0.00000 154, 170 PPC
intermittent 1 3 after-reaching 4.20 7.56 -5.66691 0.00000 1061, 228 PPC
intermittent 1 5 67-50.25 4.62 3.57 0.27764 0.78747 34, 20 PM
intermittent 1 5 50.25-33.5 5.25 17.64 -1.52857 0.14884 8, 4 PPC
intermittent 1 5 33.5-16.75 8.40 11.34 -0.27890 0.79149 17, 21 PPC
intermittent 1 5 16.75-0 2.52 6.30 -3.20164 0.00137 65, 37 PPC
intermittent 1 5 after-reaching 2.52 4.62 -2.24785 0.02321 431, 76 PPC
intermittent 2 2 67-50.25 2.94 4.20 -1.41749 0.15347 110, 92 PPC
intermittent 2 2 50.25-33.5 9.66 11.76 -0.81473 0.41759 52, 36 PPC
intermittent 2 2 33.5-16.75 5.88 6.72 -0.12553 0.90139 69, 96 PPC
intermittent 2 2 16.75-0 5.88 6.72 -1.98595 0.04698 180, 210 PPC
intermittent 2 2 after-reaching 1.68 3.36 -1.65004 0.09151 942, 225 PPC
intermittent 2 3 67-50.25 3.78 4.62 0.64197 0.52429 31, 30 PPC
intermittent 2 3 50.25-33.5 8.82 9.24 -0.39468 0.70386 20, 18 PPC
intermittent 2 3 33.5-16.75 4.20 8.61 -3.18241 0.00148 26, 66 PPC
intermittent 2 3 16.75-0 3.57 11.76 -6.22769 0.00000 154, 170 PPC
intermittent 2 3 after-reaching 0.42 2.73 -4.45660 0.00000 1061, 228 PPC
intermittent 2 5 67-50.25 5.67 5.88 -0.21495 0.83670 34, 20 PPC
intermittent 2 5 50.25-33.5 10.71 20.79 -1.18889 0.26961 8, 4 PPC
intermittent 2 5 33.5-16.75 13.02 7.98 0.26422 0.80291 17, 21 PM
intermittent 2 5 16.75-0 5.88 6.30 -0.92221 0.35685 65, 37 PPC
intermittent 2 5 after-reaching 0.42 0.21 -0.13757 0.88384 431, 76 PM
groups a, PPC L2: n [110, 52, 69, 180] (paper [82, 53, 66, 171])
groups a, PPC L3: n [31, 20, 26, 154] (paper [14, 19, 22, 145])
groups a, PPC L5: n [34, 8, 17, 65] (paper [26, 8, 16, 66])
groups a, PM L2: n [92, 36, 96, 210] (paper [60, 38, 87, 223])
groups a, PM L3: n [30, 18, 66, 170] (paper [23, 16, 76, 160])
groups a, PM L5: n [20, 4, 21, 37] (paper [17, 4, 18, 36])
groups a: summed absolute difference of group shares from the paper's, 0.63
groups b, PPC L2: n [90, 127, 63, 131] (paper [82, 53, 66, 171])
groups b, PPC L3: n [28, 39, 49, 115] (paper [14, 19, 22, 145])
groups b, PPC L5: n [27, 28, 19, 50] (paper [26, 8, 16, 66])
groups b, PM L2: n [71, 119, 155, 89] (paper [60, 38, 87, 223])
groups b, PM L3: n [24, 58, 145, 57] (paper [23, 16, 76, 160])
groups b, PM L5: n [14, 23, 22, 23] (paper [17, 4, 18, 36])
groups b: summed absolute difference of group shares from the paper's, 3.09
signed difference continuous minus intermittent 1, goal-distance neurons (O1 a): range -66.8 to 66.8 cm, 4529 neurons with a preference in both conditions
signed difference continuous minus intermittent 2, goal-distance neurons (O1 a): range -66.8 to 66.8 cm, 4529 neurons with a preference in both conditions
per mouse, intermittent 1 after-reaching, signed difference (cm) mouse PPC median PPC n PM median PM n mouse1 -1.68 169 NaN 0 mouse2 NaN 0 0.00 17 mouse3 NaN 0 -10.08 190 mouse4 -0.84 264 -1.26 28 mouse5 -1.26 891 -1.05 66 mouse6 -6.72 352 NaN 0 mouse7 -3.57 540 -6.30 124 mouse8 -1.05 218 -2.31 104
Result: Not reproduced. On signed differences, continuous minus intermittent, as the amended claims file has it, intermittent 1 after-reaching neurons differ between PPC and PM with P < 0.05 in layers 2 and 3 (P = 0.0066 and P < 1e-5), with the PPC median nearer zero (-2.10 against -5.04 cm and -2.52 against -6.30 cm); layer 5 does not differ (P = 0.20). With the zone-border groups (b) none of the 9 significant comparisons has the PM median nearer zero, but with equal quarters (a) 2 of 10 do, both before-reaching groups of layer 3 in intermittent 1 far from the goal (67-50.25 cm, PPC 2.52 against PM 0.00 cm, P = 0.013; 50.25-33.5 cm, -9.24 against -1.89 cm, P = 0.037). The criterion needs both group readings, so it is not met, and this is so under all four O1 and O3 readings. In the groups nearest the goal (16.75-0 and 8.4-0 cm) every significant comparison has the PPC median nearer zero. On absolute differences, the variant that is not judged, PPC after-reaching neurons have the smaller change in all three layers of intermittent 1 under O1 a, and PM is significantly smaller in 0 of 30 comparisons with groups (a) and 1 of 30 with groups (b).
Decoder¶
The probabilistic decoder of the Methods for every session with goal-distance neurons, under the four classification readings and the two shifts of O7, with a Gaussian-likelihood decoder and a decoder trained on permuted distances for comparison. Each session has its own seeded generator for the permutation.
import time as _time
from concurrent.futures import ThreadPoolExecutor
DEC_CONFIGS = [(rd, sh) for rd in CLS_GD for sh in (0.01, 0.1)]
roi_index = {(s, r): i for i, (s, r) in enumerate(zip(NT.session, NT.roi))}
def decode_session(i):
r = R[i]; d = r["dec"]; out = {}
rng = np.random.default_rng(1000 + i)
for rd in CLS_GD:
gd = CLS_GD[rd].gd.values
keep = np.array([gd[roi_index[(i, n)]] for n in d["neurons"]], bool) if len(d["neurons"]) else np.zeros(0, bool)
if keep.sum() == 0:
continue
dd = dict(d, n=d["n"][:, keep], min_all=d["min_all"][keep])
for sh in (0.01, 0.1):
out[(rd, sh, "lognormal")] = F.decode(dd, sh)
out[(rd, 0.01, "permuted")] = F.decode(dd, 0.01, permute=True, rng=rng)
out[(rd, None, "gaussian")] = F.decode(dd, likelihood="gaussian")
out[(rd, "n")] = int(keep.sum())
return out
t0 = _time.time()
with ThreadPoolExecutor(4) as ex:
DEC = list(ex.map(decode_session, range(len(R))))
print(f"decoding took {_time.time() - t0:.0f} s")
FR = pd.concat([pd.DataFrame(dict(session=i, area=R[i]["meta"]["area"], layer=R[i]["meta"]["layer"], trial=R[i]["dec"]["trial"],
state=R[i]["dec"]["state"], x=R[i]["dec"]["x"], time=R[i]["dec"]["time"])) for i in range(len(R))],
ignore_index=True)
FR["group"] = FR.area + " L" + FR.layer.astype(str)
FR["flat"] = F.flat_rmse(FR.x.values)
def col(key, k):
"""Concatenate one decoder output (0 RMSE, 1 MAP, 2 uncertainty) over sessions; NaN where a
session has no goal-distance neuron under the reading."""
return np.concatenate([DEC[i][key][k] if key in DEC[i] else np.full(len(R[i]["dec"]["x"]), np.nan) for i in range(len(R))])
for rd in CLS_GD:
n_ok = sum((rd, "n") in DEC[i] for i in range(len(R)))
print(f"O1 {rd[0]} O3 {rd[2]}: sessions decoded {n_ok} of {len(R)}; neurons per session median "
f"{np.median([DEC[i].get((rd, 'n'), 0) for i in range(len(R))]):.0f}")
MAIN = (("a", "67", "a"), 0.01)
print("frames", len(FR), "range of x", FR.x.min().round(2), FR.x.max().round(2))
print(f"median RMSE, main reading: continuous {np.nanmedian(col((*MAIN, 'lognormal'), 0)[FR.state == 0]):.2f} cm, "
f"flat prior {FR.flat.median():.2f} cm")
decoding took 138 s
O1 a O3 a: sessions decoded 91 of 94; neurons per session median 34 O1 a O3 b: sessions decoded 91 of 94; neurons per session median 34 O1 b O3 a: sessions decoded 94 of 94; neurons per session median 47 O1 b O3 b: sessions decoded 94 of 94; neurons per session median 48 frames 1861937 range of x 0.0 67.2 median RMSE, main reading: continuous 15.64 cm, flat prior 26.97 cm
fig4-above-chance¶
Decoders built from goal-distance neurons estimated goal distance above chance in both PPC and PM.
Source: Results, Distance prediction with dynamic Bayesian inference, paragraph 2; Figure 4b.
Both readings of chance are run: (a) the flat prior's RMSE at each frame, and (b) a decoder trained with the distances of the training trials permuted across trials. Reading (b) keeps the fall of distance through every trial, so its decoder still decodes distance; whether it is a chance level is asked of a reader.
def label(rd, sh):
return f"O1 {rd[0]} O3 {rd[2]}, shift {sh}"
for rd, sh in DEC_CONFIGS:
rm = col((rd, sh, "lognormal"), 0)
for chance in ("flat", "permuted"):
ch = FR.flat.values if chance == "flat" else col((rd, 0.01, "permuted"), 0)
out = []
for gname in GROUPS:
for c in range(3):
m = ((FR.group == gname) & (FR.state == c)).values & ~np.isnan(rm)
p, z, n = F.wilcoxon_z(rm[m], ch[m])
out.append(dict(group=gname, condition=COND_NAMES[c], rmse=np.median(rm[m]), chance=np.median(ch[m]), z=z, p=p, n=n))
t = pd.DataFrame(out)
print(f"{label(rd, sh)}, chance {chance}: decoder lower with P < 0.01 in {((t.z < 0) & (t.p < 0.01)).sum()} of 18; "
f"z {t.z.min():.1f} to {t.z.max():.1f}")
if (rd, sh) == MAIN:
print(t.round(4).to_string(index=False))
O1 a O3 a, shift 0.01, chance flat: decoder lower with P < 0.01 in 18 of 18; z -356.0 to -88.7 group condition rmse chance z p n PPC L2 continuous 11.0550 27.0762 -356.0257 0.0 239595 PPC L2 intermittent 1 12.3824 26.8837 -155.4017 0.0 60121 PPC L2 intermittent 2 13.9895 26.2728 -131.1545 0.0 51445 PPC L3 continuous 14.0547 27.1015 -289.8334 0.0 220018 PPC L3 intermittent 1 15.1288 26.6805 -125.2593 0.0 52190 PPC L3 intermittent 2 15.9808 26.4399 -111.3999 0.0 47125 PPC L5 continuous 14.9563 27.1743 -316.6682 0.0 209605 PPC L5 intermittent 1 15.9134 26.7032 -144.0851 0.0 53650 PPC L5 intermittent 2 16.9440 26.5032 -122.5496 0.0 44217 PM L2 continuous 14.6486 27.3078 -323.2524 0.0 200636 PM L2 intermittent 1 15.2603 27.0247 -137.5268 0.0 47189 PM L2 intermittent 2 16.6106 26.8603 -116.6435 0.0 37961 PM L3 continuous 19.2202 27.0924 -271.3831 0.0 187752 PM L3 intermittent 1 19.9005 26.8017 -118.7006 0.0 47118 PM L3 intermittent 2 20.5855 26.6397 -94.0826 0.0 40281 PM L5 continuous 20.5012 27.1210 -235.3149 0.0 180708 PM L5 intermittent 1 21.0185 26.8372 -105.3962 0.0 45505 PM L5 intermittent 2 21.6195 26.6410 -88.7019 0.0 41406
O1 a O3 a, shift 0.01, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -100.9 to 13.6 group condition rmse chance z p n PPC L2 continuous 11.0550 11.5618 -100.9500 0.0 239595 PPC L2 intermittent 1 12.3824 12.5475 -21.7660 0.0 60121 PPC L2 intermittent 2 13.9895 14.1404 -20.9494 0.0 51445 PPC L3 continuous 14.0547 14.3291 -47.8570 0.0 220018 PPC L3 intermittent 1 15.1288 14.8434 13.6446 0.0 52190 PPC L3 intermittent 2 15.9808 15.8490 -4.1640 0.0 47125 PPC L5 continuous 14.9563 15.2507 -61.8873 0.0 209605 PPC L5 intermittent 1 15.9134 16.1451 -28.8717 0.0 53650 PPC L5 intermittent 2 16.9440 17.0067 -23.1053 0.0 44217 PM L2 continuous 14.6486 15.1064 -76.4457 0.0 200636 PM L2 intermittent 1 15.2603 15.6450 -28.1488 0.0 47189 PM L2 intermittent 2 16.6106 16.9967 -32.5574 0.0 37961 PM L3 continuous 19.2202 19.4312 -59.0091 0.0 187752 PM L3 intermittent 1 19.9005 19.9541 -24.0435 0.0 47118 PM L3 intermittent 2 20.5855 20.6301 -24.6688 0.0 40281 PM L5 continuous 20.5012 20.5629 -42.8397 0.0 180708 PM L5 intermittent 1 21.0185 21.4420 -21.3164 0.0 45505 PM L5 intermittent 2 21.6195 22.1944 -22.7931 0.0 41406
O1 a O3 a, shift 0.1, chance flat: decoder lower with P < 0.01 in 18 of 18; z -357.4 to -87.6
O1 a O3 a, shift 0.1, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -112.9 to 7.1
O1 a O3 b, shift 0.01, chance flat: decoder lower with P < 0.01 in 18 of 18; z -356.0 to -88.7
O1 a O3 b, shift 0.01, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -83.5 to 13.0
O1 a O3 b, shift 0.1, chance flat: decoder lower with P < 0.01 in 18 of 18; z -357.4 to -87.6
O1 a O3 b, shift 0.1, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -97.4 to 6.4
O1 b O3 a, shift 0.01, chance flat: decoder lower with P < 0.01 in 18 of 18; z -364.7 to -92.0
O1 b O3 a, shift 0.01, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -79.3 to 6.9
O1 b O3 a, shift 0.1, chance flat: decoder lower with P < 0.01 in 18 of 18; z -365.9 to -90.5
O1 b O3 a, shift 0.1, chance permuted: decoder lower with P < 0.01 in 17 of 18; z -91.6 to 1.6
O1 b O3 b, shift 0.01, chance flat: decoder lower with P < 0.01 in 18 of 18; z -364.7 to -92.0
O1 b O3 b, shift 0.01, chance permuted: decoder lower with P < 0.01 in 18 of 18; z -78.2 to -3.1
O1 b O3 b, shift 0.1, chance flat: decoder lower with P < 0.01 in 18 of 18; z -365.9 to -90.5
O1 b O3 b, shift 0.1, chance permuted: decoder lower with P < 0.01 in 18 of 18; z -85.0 to -8.9
Result: Blocked, methods underspecified. The two readings of chance disagree. Decoder RMSE is
below the flat prior's (reading a) with P < 0.01 in all 18 settings under every classification
and shift reading (z -87.6 to -365.9; median RMSE 15.64 cm for continuous trials in the main
reading against 26.97 cm). Against permuted-distance decoders (reading b), 17 of 18 settings are
lower in six of the eight readings and 18 of 18 in two; in the main reading the exception is
PPC layer 3 in intermittent 1 (z = +13.6, worse than the permuted decoder). Reading (b) keeps
the fall of distance within each trial, so its decoder still decodes distance and does not
measure chance; this is asked of a reader (questions/001605.yaml).
Per-trial means in goal-distance bins, PPC against PM, used by the next three claims.
def trial_bins(v, width):
"""Per trial mean of a per-frame value v in goal-distance bins of the given width (cm)."""
b = np.floor(FR.x.values / width).astype(int)
df = pd.DataFrame(dict(session=FR.session, trial=FR.trial, state=FR.state, group=FR.group, b=b, v=v, x=FR.x))
return df.groupby(["session", "trial", "state", "group", "b"], as_index=False)[["v", "x"]].mean()
def ppc_pm_bins(v, width, layer=2, conds=(0, 1, 2), err=None):
tb = trial_bins(v, width)
tb = tb[tb.group.isin([f"PPC L{layer}", f"PM L{layer}"]) & tb.state.isin(conds)]
tb = tb[tb.v.notna()] # trials of sessions without goal-distance neurons under the reading
grp = {k: g.v.values for k, g in tb.groupby(["state", "b", "group"])}
out = []
for c in conds:
for b in sorted(tb.b.unique()):
a = grp.get((c, b, f"PPC L{layer}"), np.zeros(0)); m = grp.get((c, b, f"PM L{layer}"), np.zeros(0))
p, z = F.mwu(a, m)
out.append(dict(condition=COND_NAMES[c], bin=f"{(b + 1) * width:.2f}-{b * width:.2f}", lo=b * width,
ppc=np.median(a) if len(a) else np.nan, pm=np.median(m) if len(m) else np.nan, z=z, p=p, n=f"{len(a)}, {len(m)}"))
return pd.DataFrame(out)
fig4c-ppc-lower-error¶
The decoding error (RMSE) from layer 2 neurons was lower in PPC than in PM.
Source: Figure 4c; Results, Distance prediction with dynamic Bayesian inference, paragraph 2.
for rd, sh in DEC_CONFIGS:
for width in (4.2, 0.42):
t = ppc_pm_bins(col((rd, sh, "lognormal"), 0), width)
line = []
ok = True
for c in COND_NAMES:
tc = t[t.condition == c]
lower = (tc.ppc < tc.pm).mean(); sig = ((tc.z < 0) & (tc.p < 0.01)).sum(); pm_sig = ((tc.z > 0) & (tc.p < 0.01)).sum()
ok &= lower > 0.5 and sig >= 1 and pm_sig == 0
line.append(f"{c}: PPC lower in {100 * lower:.0f}% of {len(tc)} bins, sig {sig}, PM sig {pm_sig}")
print(f"{label(rd, sh)}, bins {width} cm: criterion met {ok}; " + "; ".join(line))
if (rd, sh) == MAIN and width == 4.2:
print(t.round(5).to_string(index=False))
for L in (3, 5):
t = ppc_pm_bins(col((*MAIN, "lognormal"), 0), 4.2, layer=L)
print(f"layer {L}, main reading: PPC lower in {(t.ppc < t.pm).mean() * 100:.0f}% of bins, significant (P < 0.01) {((t.z < 0) & (t.p < 0.01)).sum()}, PM significant {((t.z > 0) & (t.p < 0.01)).sum()} of {len(t)}")
O1 a O3 a, shift 0.01, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 88% of 16 bins, sig 8, PM sig 0; intermittent 2: PPC lower in 88% of 16 bins, sig 8, PM sig 0
condition bin lo ppc pm z p n
continuous 4.20-0.00 0.0 4.86982 9.71315 -16.78961 0.00000 1779, 1708
continuous 8.40-4.20 4.2 5.13660 9.43270 -14.53062 0.00000 1779, 1708
continuous 12.60-8.40 8.4 7.66169 11.37209 -11.11829 0.00000 1779, 1708
continuous 16.80-12.60 12.6 10.79419 14.77008 -8.00682 0.00000 1778, 1709
continuous 21.00-16.80 16.8 13.86271 17.08666 -5.77209 0.00000 1778, 1708
continuous 25.20-21.00 21.0 16.04960 17.66334 -3.14737 0.00165 1777, 1707
continuous 29.40-25.20 25.2 16.48400 17.38955 0.00042 0.99968 1777, 1709
continuous 33.60-29.40 29.4 15.96045 16.53858 1.44317 0.14898 1779, 1708
continuous 37.80-33.60 33.6 15.87374 16.23512 1.26281 0.20666 1778, 1708
continuous 42.00-37.80 37.8 15.36384 15.62067 0.44544 0.65601 1777, 1709
continuous 46.20-42.00 42.0 14.15267 14.70087 -3.28435 0.00102 1778, 1708
continuous 50.40-46.20 46.2 13.06214 14.31699 -6.84049 0.00000 1779, 1706
continuous 54.60-50.40 50.4 11.23958 14.85471 -11.00324 0.00000 1777, 1704
continuous 58.80-54.60 54.6 10.14566 16.07013 -12.66673 0.00000 1777, 1708
continuous 63.00-58.80 58.8 11.26626 18.44485 -12.81887 0.00000 1779, 1705
continuous 67.20-63.00 63.0 13.10403 20.66523 -12.51139 0.00000 1778, 1707
intermittent 1 4.20-0.00 0.0 4.14833 7.27279 -7.26147 0.00000 397, 360
intermittent 1 8.40-4.20 4.2 4.81577 5.69363 -3.80580 0.00014 397, 360
intermittent 1 12.60-8.40 8.4 8.06986 8.28274 -2.22324 0.02621 397, 360
intermittent 1 16.80-12.60 12.6 11.15761 11.78098 -2.62029 0.00879 397, 360
intermittent 1 21.00-16.80 16.8 14.64442 14.72333 -1.38020 0.16757 397, 360
intermittent 1 25.20-21.00 21.0 17.06451 16.40788 0.52885 0.59702 397, 360
intermittent 1 29.40-25.20 25.2 17.79583 17.50875 0.73620 0.46171 397, 360
intermittent 1 33.60-29.40 29.4 17.93410 17.98777 0.87232 0.38312 397, 360
intermittent 1 37.80-33.60 33.6 17.44533 17.76762 0.25328 0.80018 397, 360
intermittent 1 42.00-37.80 37.8 16.47619 16.92405 -1.02009 0.30776 397, 360
intermittent 1 46.20-42.00 42.0 15.36239 16.37964 -1.65079 0.09882 397, 360
intermittent 1 50.40-46.20 46.2 14.52365 16.75684 -2.71614 0.00661 397, 360
intermittent 1 54.60-50.40 50.4 12.95475 18.74007 -4.07405 0.00005 397, 360
intermittent 1 58.80-54.60 54.6 12.85984 20.51085 -4.12264 0.00004 397, 360
intermittent 1 63.00-58.80 58.8 13.37180 21.59695 -4.81125 0.00000 397, 360
intermittent 1 67.20-63.00 63.0 14.33546 23.37051 -5.27852 0.00000 397, 359
intermittent 2 4.20-0.00 0.0 7.70681 14.27419 -6.30130 0.00000 364, 315
intermittent 2 8.40-4.20 4.2 9.79076 15.34370 -3.03531 0.00240 364, 315
intermittent 2 12.60-8.40 8.4 8.99071 15.06144 -1.79016 0.07346 363, 315
intermittent 2 16.80-12.60 12.6 11.17995 14.50361 -2.49776 0.01251 364, 314
intermittent 2 21.00-16.80 16.8 13.65612 16.06720 -3.98195 0.00007 364, 315
intermittent 2 25.20-21.00 21.0 14.70839 16.19337 -2.77364 0.00555 364, 315
intermittent 2 29.40-25.20 25.2 16.43042 17.37299 -1.12475 0.26078 364, 315
intermittent 2 33.60-29.40 29.4 17.14528 18.67993 -0.28599 0.77503 364, 315
intermittent 2 37.80-33.60 33.6 19.08742 19.06568 0.42958 0.66764 364, 315
intermittent 2 42.00-37.80 37.8 18.88846 18.52400 -0.27815 0.78105 364, 315
intermittent 2 46.20-42.00 42.0 17.30564 17.88971 -0.96289 0.33570 364, 313
intermittent 2 50.40-46.20 46.2 15.00557 17.58743 -2.04159 0.04121 364, 315
intermittent 2 54.60-50.40 50.4 13.25269 16.98173 -2.70893 0.00675 363, 315
intermittent 2 58.80-54.60 54.6 12.55431 17.93554 -3.48960 0.00048 364, 315
intermittent 2 63.00-58.80 58.8 13.93199 20.42096 -3.34327 0.00083 364, 315
intermittent 2 67.20-63.00 63.0 15.76331 23.37853 -3.07955 0.00207 363, 314
O1 a O3 a, shift 0.01, bins 0.42 cm: criterion met True; continuous: PPC lower in 100% of 160 bins, sig 108, PM sig 0; intermittent 1: PPC lower in 74% of 160 bins, sig 38, PM sig 0; intermittent 2: PPC lower in 83% of 160 bins, sig 32, PM sig 0
O1 a O3 a, shift 0.1, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 88% of 16 bins, sig 7, PM sig 0; intermittent 2: PPC lower in 94% of 16 bins, sig 8, PM sig 0
O1 a O3 a, shift 0.1, bins 0.42 cm: criterion met True; continuous: PPC lower in 99% of 160 bins, sig 108, PM sig 0; intermittent 1: PPC lower in 74% of 160 bins, sig 37, PM sig 0; intermittent 2: PPC lower in 82% of 160 bins, sig 28, PM sig 0
O1 a O3 b, shift 0.01, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 88% of 16 bins, sig 8, PM sig 0; intermittent 2: PPC lower in 88% of 16 bins, sig 8, PM sig 0
O1 a O3 b, shift 0.01, bins 0.42 cm: criterion met True; continuous: PPC lower in 100% of 160 bins, sig 108, PM sig 0; intermittent 1: PPC lower in 74% of 160 bins, sig 38, PM sig 0; intermittent 2: PPC lower in 83% of 160 bins, sig 32, PM sig 0
O1 a O3 b, shift 0.1, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 88% of 16 bins, sig 7, PM sig 0; intermittent 2: PPC lower in 94% of 16 bins, sig 8, PM sig 0
O1 a O3 b, shift 0.1, bins 0.42 cm: criterion met True; continuous: PPC lower in 99% of 160 bins, sig 108, PM sig 0; intermittent 1: PPC lower in 74% of 160 bins, sig 37, PM sig 0; intermittent 2: PPC lower in 82% of 160 bins, sig 28, PM sig 0
O1 b O3 a, shift 0.01, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 81% of 16 bins, sig 9, PM sig 0; intermittent 2: PPC lower in 100% of 16 bins, sig 8, PM sig 0
O1 b O3 a, shift 0.01, bins 0.42 cm: criterion met True; continuous: PPC lower in 99% of 160 bins, sig 111, PM sig 0; intermittent 1: PPC lower in 79% of 160 bins, sig 40, PM sig 0; intermittent 2: PPC lower in 84% of 160 bins, sig 21, PM sig 0
O1 b O3 a, shift 0.1, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 81% of 16 bins, sig 9, PM sig 0; intermittent 2: PPC lower in 94% of 16 bins, sig 8, PM sig 0
O1 b O3 a, shift 0.1, bins 0.42 cm: criterion met False; continuous: PPC lower in 99% of 160 bins, sig 111, PM sig 0; intermittent 1: PPC lower in 82% of 160 bins, sig 39, PM sig 0; intermittent 2: PPC lower in 81% of 160 bins, sig 19, PM sig 1
O1 b O3 b, shift 0.01, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 81% of 16 bins, sig 9, PM sig 0; intermittent 2: PPC lower in 100% of 16 bins, sig 8, PM sig 0
O1 b O3 b, shift 0.01, bins 0.42 cm: criterion met True; continuous: PPC lower in 99% of 160 bins, sig 111, PM sig 0; intermittent 1: PPC lower in 79% of 160 bins, sig 40, PM sig 0; intermittent 2: PPC lower in 84% of 160 bins, sig 20, PM sig 0
O1 b O3 b, shift 0.1, bins 4.2 cm: criterion met True; continuous: PPC lower in 100% of 16 bins, sig 12, PM sig 0; intermittent 1: PPC lower in 81% of 16 bins, sig 9, PM sig 0; intermittent 2: PPC lower in 94% of 16 bins, sig 8, PM sig 0
O1 b O3 b, shift 0.1, bins 0.42 cm: criterion met False; continuous: PPC lower in 99% of 160 bins, sig 111, PM sig 0; intermittent 1: PPC lower in 82% of 160 bins, sig 39, PM sig 0; intermittent 2: PPC lower in 82% of 160 bins, sig 19, PM sig 1
layer 3, main reading: PPC lower in 83% of bins, significant (P < 0.01) 32, PM significant 3 of 48
layer 5, main reading: PPC lower in 94% of bins, significant (P < 0.01) 40, PM significant 1 of 48
Result: Blocked, methods underspecified. The readings disagree. In layer 2 and the main reading, PPC has the lower median RMSE in 100%, 88% and 88% of the 4.2 cm bins of the three conditions, significantly lower (P < 0.01) in 12, 8 and 8 bins, and PM is significantly lower in none. The criterion is met in 14 of the 16 configurations of classification, shift and bin width; under the inter-trial baseline with shift 0.1 and 0.42 cm bins, one intermittent 2 bin favours PM with P < 0.01, so it fails there. Layers 3 and 5, with trials of sessions without goal-distance neurons left out, have PPC lower in 83% and 94% of the 48 bins and PM significantly lower in 3 and 1.
fig4d-map-near-goal¶
PPC and PM gave similar MAP estimates, but near the goal PPC estimates were better than PM.
Source: Figure 4d; Results, Distance prediction with dynamic Bayesian inference, paragraph 2.
Both bin widths of O8 are run, 4.2 cm (the decoder's bin width and the tick spacing of Fig. 4c-e) and 0.42 cm.
for rd, sh in DEC_CONFIGS:
for width in (4.2, 0.42):
mp = col((rd, sh, "lognormal"), 1)
t = ppc_pm_bins(mp, width, conds=(0,))
t["centre"] = t.lo + width / 2
t["ppc_closer"] = np.abs(t.ppc - t.centre) < np.abs(t.pm - t.centre)
near = t[t.lo < 8.4 - 1e-9]
a = (near.ppc_closer & (near.p < 0.01)).sum(); b = (~near.ppc_closer & (near.p < 0.01)).sum()
print(f"{label(rd, sh)}, bins {width} cm: bins in 8.4-0 cm with PPC closer P < 0.01: {a}, PM closer P < 0.01: {b}, of {len(near)}; "
f"all bins differing P < 0.01: {(t.p < 0.01).sum()} of {len(t)}")
if (rd, sh) == MAIN and width == 4.2:
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 9 of 16 condition bin lo ppc pm z p n centre ppc_closer continuous 4.20-0.00 0.0 2.64000 5.52621 -6.42532 0.00000 1779, 1708 2.1 True continuous 8.40-4.20 4.2 7.18667 10.17231 -6.35580 0.00000 1779, 1708 6.3 True continuous 12.60-8.40 8.4 11.28000 13.87105 -5.75101 0.00000 1779, 1708 10.5 True continuous 16.80-12.60 12.6 16.27500 18.31200 -4.56938 0.00000 1778, 1709 14.7 True continuous 21.00-16.80 16.8 22.76018 25.07782 -3.00395 0.00266 1778, 1708 18.9 True continuous 25.20-21.00 21.0 29.93455 30.78000 -1.57108 0.11616 1777, 1707 23.1 True continuous 29.40-25.20 25.2 34.54500 33.88000 -0.10626 0.91539 1777, 1709 27.3 False continuous 33.60-29.40 29.4 36.96000 35.62800 0.77389 0.43899 1779, 1708 31.5 False continuous 37.80-33.60 33.6 40.02250 37.63200 1.26291 0.20659 1778, 1708 35.7 False continuous 42.00-37.80 37.8 43.68000 41.16000 1.82885 0.06738 1777, 1709 39.9 False continuous 46.20-42.00 42.0 47.32903 43.97750 2.07979 0.03747 1778, 1708 44.1 False continuous 50.40-46.20 46.2 50.96000 48.60369 1.12155 0.26170 1779, 1706 48.3 False continuous 54.60-50.40 50.4 53.59200 50.21100 2.66694 0.00759 1777, 1704 52.5 True continuous 58.80-54.60 54.6 56.28000 52.92000 3.39625 0.00067 1777, 1708 56.7 True continuous 63.00-58.80 58.8 57.12000 55.34667 2.85083 0.00425 1779, 1705 60.9 True continuous 67.20-63.00 63.0 58.32667 56.95200 2.65966 0.00754 1778, 1707 65.1 True
O1 a O3 a, shift 0.01, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 12, PM closer P < 0.01: 8, of 20; all bins differing P < 0.01: 52 of 160
O1 a O3 a, shift 0.1, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 8 of 16
O1 a O3 a, shift 0.1, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 10, PM closer P < 0.01: 8, of 20; all bins differing P < 0.01: 48 of 160
O1 a O3 b, shift 0.01, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 9 of 16
O1 a O3 b, shift 0.01, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 12, PM closer P < 0.01: 8, of 20; all bins differing P < 0.01: 52 of 160
O1 a O3 b, shift 0.1, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 8 of 16
O1 a O3 b, shift 0.1, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 10, PM closer P < 0.01: 8, of 20; all bins differing P < 0.01: 48 of 160
O1 b O3 a, shift 0.01, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 11 of 16
O1 b O3 a, shift 0.01, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 17, PM closer P < 0.01: 3, of 20; all bins differing P < 0.01: 46 of 160
O1 b O3 a, shift 0.1, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 11 of 16
O1 b O3 a, shift 0.1, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 16, PM closer P < 0.01: 4, of 20; all bins differing P < 0.01: 43 of 160
O1 b O3 b, shift 0.01, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 11 of 16
O1 b O3 b, shift 0.01, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 16, PM closer P < 0.01: 4, of 20; all bins differing P < 0.01: 46 of 160
O1 b O3 b, shift 0.1, bins 4.2 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 2, PM closer P < 0.01: 0, of 2; all bins differing P < 0.01: 11 of 16
O1 b O3 b, shift 0.1, bins 0.42 cm: bins in 8.4-0 cm with PPC closer P < 0.01: 16, PM closer P < 0.01: 4, of 20; all bins differing P < 0.01: 44 of 160
Result: Blocked, methods underspecified. The readings of the bin width (O8) disagree. With 4.2 cm bins, in the continuous condition both bins between 8.4 and 0 cm have PPC MAP closer to the actual distance with P < 0.01 and PM is closer in none, under every classification and shift reading; 8 to 11 of 16 bins differ overall. With 0.42 cm bins, PM is closer with P < 0.01 in 3 to 8 of the 20 bins near the goal under every reading, so the criterion fails.
fig4e-ppc-lower-uncertainty¶
The uncertainty (posterior s.d.) of distance estimates was lower in PPC than in PM at every goal distance and in every condition.
Source: Figure 4e; Results, Distance prediction with dynamic Bayesian inference, paragraph 2.
for rd, sh in DEC_CONFIGS:
for width in (4.2, 0.42):
t = ppc_pm_bins(col((rd, sh, "lognormal"), 2), width)
sig = (t.z < 0) & (t.p < 0.01)
print(f"{label(rd, sh)}, bins {width} cm: PPC lower with P < 0.01 in {sig.sum()} of {len(t)} bins ({100 * sig.mean():.1f}%)")
if (rd, sh) == MAIN and width == 4.2:
print(t.round(5).to_string(index=False))
for L in (3, 5):
t = ppc_pm_bins(col((*MAIN, "lognormal"), 2), 4.2, layer=L)
print(f"layer {L}, main reading: PPC lower with P < 0.01 in {((t.z < 0) & (t.p < 0.01)).sum()} of {len(t)}, PM lower in {((t.z > 0) & (t.p < 0.01)).sum()}")
O1 a O3 a, shift 0.01, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
condition bin lo ppc pm z p n
continuous 4.20-0.00 0.0 3.92298 6.46748 -22.75912 0.0 1779, 1708
continuous 8.40-4.20 4.2 4.13531 7.46837 -22.21397 0.0 1779, 1708
continuous 12.60-8.40 8.4 4.49100 8.63946 -21.38853 0.0 1779, 1708
continuous 16.80-12.60 12.6 5.22549 10.30238 -20.21305 0.0 1778, 1709
continuous 21.00-16.80 16.8 6.34450 11.21636 -20.28936 0.0 1778, 1708
continuous 25.20-21.00 21.0 7.08717 11.62735 -21.19184 0.0 1777, 1707
continuous 29.40-25.20 25.2 7.51194 11.55423 -21.35561 0.0 1777, 1709
continuous 33.60-29.40 29.4 7.65694 11.92238 -21.71617 0.0 1779, 1708
continuous 37.80-33.60 33.6 7.86348 12.26608 -21.63319 0.0 1778, 1708
continuous 42.00-37.80 37.8 8.05164 12.50824 -21.75159 0.0 1777, 1709
continuous 46.20-42.00 42.0 8.20377 12.75762 -22.21068 0.0 1778, 1708
continuous 50.40-46.20 46.2 8.17448 12.83621 -22.04295 0.0 1779, 1706
continuous 54.60-50.40 50.4 8.07137 12.95008 -22.49973 0.0 1777, 1704
continuous 58.80-54.60 54.6 8.02023 12.97624 -22.06530 0.0 1777, 1708
continuous 63.00-58.80 58.8 7.85857 12.81959 -22.20684 0.0 1779, 1705
continuous 67.20-63.00 63.0 7.74862 12.63258 -21.64691 0.0 1778, 1707
intermittent 1 4.20-0.00 0.0 3.77286 5.92580 -9.10929 0.0 397, 360
intermittent 1 8.40-4.20 4.2 3.95252 5.59364 -8.51320 0.0 397, 360
intermittent 1 12.60-8.40 8.4 4.19857 6.48667 -7.96605 0.0 397, 360
intermittent 1 16.80-12.60 12.6 4.64470 8.37926 -8.05691 0.0 397, 360
intermittent 1 21.00-16.80 16.8 5.62677 10.81220 -7.57698 0.0 397, 360
intermittent 1 25.20-21.00 21.0 6.43203 11.04168 -7.34667 0.0 397, 360
intermittent 1 29.40-25.20 25.2 6.74399 11.61039 -7.49245 0.0 397, 360
intermittent 1 33.60-29.40 29.4 7.04369 11.48326 -7.36864 0.0 397, 360
intermittent 1 37.80-33.60 33.6 7.03503 11.53344 -8.14011 0.0 397, 360
intermittent 1 42.00-37.80 37.8 7.69480 11.79032 -8.68294 0.0 397, 360
intermittent 1 46.20-42.00 42.0 7.64192 12.81869 -8.90094 0.0 397, 360
intermittent 1 50.40-46.20 46.2 7.51600 12.85762 -9.25306 0.0 397, 360
intermittent 1 54.60-50.40 50.4 7.66352 12.67178 -8.88397 0.0 397, 360
intermittent 1 58.80-54.60 54.6 7.54922 12.77652 -8.93489 0.0 397, 360
intermittent 1 63.00-58.80 58.8 7.15470 12.53128 -9.58788 0.0 397, 360
intermittent 1 67.20-63.00 63.0 7.05767 12.72599 -9.81184 0.0 397, 359
intermittent 2 4.20-0.00 0.0 4.38212 8.55059 -9.14869 0.0 364, 315
intermittent 2 8.40-4.20 4.2 4.73496 9.39355 -8.23970 0.0 364, 315
intermittent 2 12.60-8.40 8.4 4.96792 9.97541 -8.57065 0.0 363, 315
intermittent 2 16.80-12.60 12.6 5.07648 9.62625 -8.68750 0.0 364, 314
intermittent 2 21.00-16.80 16.8 5.40869 11.08218 -9.39937 0.0 364, 315
intermittent 2 25.20-21.00 21.0 5.76291 11.54527 -9.45547 0.0 364, 315
intermittent 2 29.40-25.20 25.2 6.29732 11.42548 -8.69361 0.0 364, 315
intermittent 2 33.60-29.40 29.4 6.95894 11.41996 -7.94037 0.0 364, 315
intermittent 2 37.80-33.60 33.6 7.54118 11.40154 -6.97725 0.0 364, 315
intermittent 2 42.00-37.80 37.8 7.91200 11.51983 -6.75245 0.0 364, 315
intermittent 2 46.20-42.00 42.0 7.84450 11.37159 -7.07919 0.0 364, 313
intermittent 2 50.40-46.20 46.2 7.84605 12.07493 -7.92742 0.0 364, 315
intermittent 2 54.60-50.40 50.4 8.11917 11.96029 -7.38533 0.0 363, 315
intermittent 2 58.80-54.60 54.6 8.06719 12.47859 -8.04786 0.0 364, 315
intermittent 2 63.00-58.80 58.8 7.72941 11.98870 -7.91134 0.0 364, 315
intermittent 2 67.20-63.00 63.0 7.94635 11.60476 -7.27624 0.0 363, 314
O1 a O3 a, shift 0.01, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 a O3 a, shift 0.1, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 a O3 a, shift 0.1, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 a O3 b, shift 0.01, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 a O3 b, shift 0.01, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 a O3 b, shift 0.1, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 a O3 b, shift 0.1, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 b O3 a, shift 0.01, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 b O3 a, shift 0.01, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 b O3 a, shift 0.1, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 b O3 a, shift 0.1, bins 0.42 cm: PPC lower with P < 0.01 in 479 of 480 bins (99.8%)
O1 b O3 b, shift 0.01, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 b O3 b, shift 0.01, bins 0.42 cm: PPC lower with P < 0.01 in 480 of 480 bins (100.0%)
O1 b O3 b, shift 0.1, bins 4.2 cm: PPC lower with P < 0.01 in 48 of 48 bins (100.0%)
O1 b O3 b, shift 0.1, bins 0.42 cm: PPC lower with P < 0.01 in 479 of 480 bins (99.8%)
layer 3, main reading: PPC lower with P < 0.01 in 48 of 48, PM lower in 0
layer 5, main reading: PPC lower with P < 0.01 in 48 of 48, PM lower in 0
Result: Partially reproduced. In layer 2 the posterior s.d. is lower in PPC than PM with P < 0.01 in all 48 bins of 4.2 cm and all 480 of 0.42 cm in 14 of the 16 configurations; under the inter-trial baseline with shift 0.1 and 0.42 cm bins, in 479 of 480 (99.8%). The criterion needs every bin under every reading for reproduced and at least 90% for partial. Layers 3 and 5 are lower in PPC in all 48 bins of 4.2 cm.
Per-trial slopes of MAP and uncertainty within each zone (equation 10), decrease per cm of approach. Frames within 33 cm of the start, where sound always plays, are left out of zones that are silent in their condition.
ZONE_OF = np.full(len(FR), -1)
for zi, (hi, lo) in enumerate(F.ZONES):
ZONE_OF[(FR.x.values <= hi) & (FR.x.values > lo)] = zi
FR["zone"] = ZONE_OF
FR["silent"] = ~F.sound_zone(FR.x.values, np.concatenate([R[i]["dec"]["sdist"] for i in range(len(R))]), FR.state.values)
ZN = ["58.6-41.9", "41.9-25.1", "25.1-8.4", "8.4-0"]
def zone_slopes(v, against="x"):
"""Per trial and zone, slope of v on goal distance (decrease per cm of approach, equation 10),
or on time (b1 of y = b0 + b1 t) when against='time'. Frames of a zone whose sound state
differs from the zone's (the first 33 cm from the start) are left out."""
df = pd.DataFrame(dict(session=FR.session, trial=FR.trial, state=FR.state, group=FR.group, zone=FR.zone, silent=FR.silent,
u=FR[against].values, v=v))
df = df[(df.zone >= 0) & ~np.isnan(df.v)]
zs = np.array([0, 1, 0, 1]); exp_silent = np.where(df.state == 1, zs[df.zone] == 1, np.where(df.state == 2, zs[df.zone] == 0, False))
df = df[df.silent.values == exp_silent]
df["uv"] = df.u * df.v; df["uu"] = df.u ** 2
g = df.groupby(["session", "trial", "state", "group", "zone"])
s = g.agg(n=("v", "size"), su=("u", "sum"), sv=("v", "sum"), suv=("uv", "sum"), suu=("uu", "sum")).reset_index()
s = s[s.n >= 3]
den = s.suu - s.su ** 2 / s.n
s["slope"] = (s.suv - s.su * s.sv / s.n) / den.where(den > 1e-9)
s["silent"] = np.where(s.state == 1, zs[s.zone] == 1, np.where(s.state == 2, zs[s.zone] == 0, False))
return s
ZS = {}
for rd, sh in DEC_CONFIGS:
ZS[(rd, sh, "map")] = zone_slopes(col((rd, sh, "lognormal"), 1))
ZS[(rd, sh, "unc")] = zone_slopes(col((rd, sh, "lognormal"), 2))
print("trial-zone slopes per reading:", len(ZS[(*MAIN, 'map')]))
trial-zone slopes per reading: 54018
fig5a-map-follows-continuous¶
In the continuous condition, decoded MAP distances followed the actual distance in all layers of PPC and PM.
Source: Figure 5a; Results, Distance prediction with dynamic Bayesian inference, paragraph 3.
def against_zero(s, conds):
out = []
for gname in GROUPS:
for c in conds:
for z in range(4):
v = s[(s.group == gname) & (s.state == c) & (s.zone == z)].slope
p, zz, n = F.wilcoxon_z(v.values)
out.append(dict(group=gname, condition=COND_NAMES[c], zone=ZN[z], silent=bool(c > 0 and ((c == 1) == (z % 2 == 1))),
median=np.nanmedian(v), z=zz, p=p, n=n))
return pd.DataFrame(out)
for rd, sh in DEC_CONFIGS:
t = against_zero(ZS[(rd, sh, "map")], [0])
print(f"{label(rd, sh)}: positive with P < 0.01 in {((t['median'] > 0) & (t.p < 0.01)).sum()} of {len(t)}")
if (rd, sh) == MAIN:
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01: positive with P < 0.01 in 24 of 24 group condition zone silent median z p n PPC L2 continuous 58.6-41.9 False 0.22907 20.65557 0.0 1721 PPC L2 continuous 41.9-25.1 False 0.32646 21.71240 0.0 1765 PPC L2 continuous 25.1-8.4 False 1.18193 33.93931 0.0 1754 PPC L2 continuous 8.4-0 False 0.43655 25.10567 0.0 1460 PPC L3 continuous 58.6-41.9 False 0.09095 8.93036 0.0 1538 PPC L3 continuous 41.9-25.1 False 0.15833 13.31803 0.0 1552 PPC L3 continuous 25.1-8.4 False 1.28149 30.06176 0.0 1548 PPC L3 continuous 8.4-0 False 0.41870 20.47844 0.0 1321 PPC L5 continuous 58.6-41.9 False 0.11537 11.23008 0.0 1397 PPC L5 continuous 41.9-25.1 False 0.27283 17.37965 0.0 1421 PPC L5 continuous 25.1-8.4 False 1.21937 30.09980 0.0 1414 PPC L5 continuous 8.4-0 False 0.55354 22.46328 0.0 1206 PM L2 continuous 58.6-41.9 False 0.21996 16.82075 0.0 1661 PM L2 continuous 41.9-25.1 False 0.30980 20.00221 0.0 1687 PM L2 continuous 25.1-8.4 False 1.10516 31.41983 0.0 1694 PM L2 continuous 8.4-0 False 0.48613 22.13205 0.0 1449 PM L3 continuous 58.6-41.9 False 0.12031 7.67746 0.0 1542 PM L3 continuous 41.9-25.1 False 0.22398 12.11968 0.0 1551 PM L3 continuous 25.1-8.4 False 0.90143 26.33587 0.0 1548 PM L3 continuous 8.4-0 False 0.48727 17.84724 0.0 1366 PM L5 continuous 58.6-41.9 False 0.06425 7.29154 0.0 1391 PM L5 continuous 41.9-25.1 False 0.11486 10.70976 0.0 1393 PM L5 continuous 25.1-8.4 False 0.76603 23.72373 0.0 1389 PM L5 continuous 8.4-0 False 0.26396 13.93424 0.0 1240 O1 a O3 a, shift 0.1: positive with P < 0.01 in 24 of 24
O1 a O3 b, shift 0.01: positive with P < 0.01 in 24 of 24
O1 a O3 b, shift 0.1: positive with P < 0.01 in 24 of 24 O1 b O3 a, shift 0.01: positive with P < 0.01 in 24 of 24
O1 b O3 a, shift 0.1: positive with P < 0.01 in 24 of 24
O1 b O3 b, shift 0.01: positive with P < 0.01 in 24 of 24 O1 b O3 b, shift 0.1: positive with P < 0.01 in 24 of 24
Result: Reproduced. In the continuous condition the median MAP slope is positive with P < 0.01 in all 24 area, layer and zone tests under every reading.
fig5a-map-decreases-without-sound¶
In the intermittent conditions, MAPs decreased with and without sound in most zones, and in every zone in PPC layers 3 and 5.
Source: Figure 5a; Results, Distance prediction with dynamic Bayesian inference, paragraph 3; Discussion, paragraph 3.
for rd, sh in DEC_CONFIGS:
t = against_zero(ZS[(rd, sh, "map")], [1, 2])
pos = (t["median"] > 0) & (t.p < 0.01)
l35 = t.group.isin(["PPC L3", "PPC L5"])
print(f"{label(rd, sh)}: PPC L3 and L5 positive P < 0.01 in {pos[l35].sum()} of {l35.sum()}; all groups {pos.sum()} of {len(t)}; "
f"no-sound {pos[t.silent].sum()} of {t.silent.sum()}")
if (rd, sh) == MAIN:
print(t.round(5).to_string(index=False))
# MAP in intermittent 1 at 8.4-0 cm (verifier round 1): its values, and the trials where it does not change
mp = col((*MAIN, "lognormal"), 1)
z3 = ((FR.state == 1) & (FR.zone == 3)).values & ~np.isnan(mp)
print("main reading, intermittent 1, 8.4-0 cm: MAP over frames, percentiles 5, 25, 50, 75, 95 (cm):",
np.round(np.percentile(mp[z3], [5, 25, 50, 75, 95]), 2), f"| at the grid's lower end (0 cm): {100 * (mp[z3] == 0).mean():.1f}% of frames")
dz = pd.DataFrame(dict(group=FR.group[z3].values, session=FR.session[z3].values, trial=FR.trial[z3].values, m=mp[z3], x=FR.x[z3].values))
tz = dz.groupby(["group", "session", "trial"]).agg(n=("m", "size"), lo=("m", "min"), hi=("m", "max"), first=("m", "first"))
tz["constant"] = tz.lo == tz.hi
for gname in GROUPS:
if gname not in tz.index.get_level_values(0):
continue
t = tz.loc[gname]
print(f" {gname}: trials {len(t)}, MAP constant over the zone in {100 * t.constant.mean():.1f}% (of these at 0 cm {100 * (t[t.constant].lo == 0).mean():.0f}%), "
f"median frames in the zone {t.n.median():.0f}, median MAP range within a trial {np.median(t.hi - t.lo):.2f} cm")
for zi in range(3):
zz = ((FR.state == 1) & (FR.zone == zi)).values & ~np.isnan(mp)
d2 = pd.DataFrame(dict(group=FR.group[zz].values, session=FR.session[zz].values, trial=FR.trial[zz].values, m=mp[zz]))
g2 = d2.groupby(["group", "session", "trial"]).m.agg(["min", "max"])
print(f" intermittent 1, {ZN[zi]} cm: MAP constant in {100 * (g2['min'] == g2['max']).mean():.1f}% of trial zones, all groups")
O1 a O3 a, shift 0.01: PPC L3 and L5 positive P < 0.01 in 13 of 16; all groups 39 of 48; no-sound 18 of 24 group condition zone silent median z p n PPC L2 intermittent 1 58.6-41.9 False 0.22750 7.20927 0.00000 390 PPC L2 intermittent 1 41.9-25.1 True 0.38634 9.72272 0.00000 390 PPC L2 intermittent 1 25.1-8.4 False 1.04961 15.81411 0.00000 384 PPC L2 intermittent 1 8.4-0 True 0.00000 1.84081 0.06565 284 PPC L2 intermittent 2 58.6-41.9 True 0.42126 9.30842 0.00000 302 PPC L2 intermittent 2 41.9-25.1 False 0.33809 9.12813 0.00000 356 PPC L2 intermittent 2 25.1-8.4 True 0.19420 7.17872 0.00000 342 PPC L2 intermittent 2 8.4-0 False 0.81574 12.73241 0.00000 308 PPC L3 intermittent 1 58.6-41.9 False 0.00288 2.16397 0.03047 313 PPC L3 intermittent 1 41.9-25.1 True 0.28940 7.87578 0.00000 319 PPC L3 intermittent 1 25.1-8.4 False 0.94999 12.56197 0.00000 318 PPC L3 intermittent 1 8.4-0 True 0.00000 2.73078 0.00632 241 PPC L3 intermittent 2 58.6-41.9 True 0.13399 5.34698 0.00000 268 PPC L3 intermittent 2 41.9-25.1 False 0.18399 6.01119 0.00000 332 PPC L3 intermittent 2 25.1-8.4 True 0.23250 6.29474 0.00000 323 PPC L3 intermittent 2 8.4-0 False 0.85943 11.43675 0.00000 300 PPC L5 intermittent 1 58.6-41.9 False 0.22067 6.88694 0.00000 338 PPC L5 intermittent 1 41.9-25.1 True 0.19737 6.20834 0.00000 338 PPC L5 intermittent 1 25.1-8.4 False 1.29708 14.73122 0.00000 333 PPC L5 intermittent 1 8.4-0 True 0.00000 3.97892 0.00007 276 PPC L5 intermittent 2 58.6-41.9 True 0.33042 7.29316 0.00000 253 PPC L5 intermittent 2 41.9-25.1 False 0.29686 7.41855 0.00000 299 PPC L5 intermittent 2 25.1-8.4 True 0.26362 6.99831 0.00000 297 PPC L5 intermittent 2 8.4-0 False 1.09583 11.31585 0.00000 280 PM L2 intermittent 1 58.6-41.9 False 0.08975 4.97706 0.00000 356 PM L2 intermittent 1 41.9-25.1 True 0.48512 10.97774 0.00000 356 PM L2 intermittent 1 25.1-8.4 False 0.86522 13.49942 0.00000 351 PM L2 intermittent 1 8.4-0 True 0.00000 2.39904 0.01644 287 PM L2 intermittent 2 58.6-41.9 True 0.23964 7.75019 0.00000 238 PM L2 intermittent 2 41.9-25.1 False 0.14595 5.90399 0.00000 308 PM L2 intermittent 2 25.1-8.4 True 0.35564 9.92269 0.00000 311 PM L2 intermittent 2 8.4-0 False 0.65750 10.41086 0.00000 293 PM L3 intermittent 1 58.6-41.9 False 0.09151 3.49522 0.00047 341 PM L3 intermittent 1 41.9-25.1 True 0.27825 7.50449 0.00000 341 PM L3 intermittent 1 25.1-8.4 False 0.86451 11.82801 0.00000 337 PM L3 intermittent 1 8.4-0 True 0.00000 1.29006 0.19703 285 PM L3 intermittent 2 58.6-41.9 True 0.35745 5.57747 0.00000 274 PM L3 intermittent 2 41.9-25.1 False 0.06098 2.32325 0.02017 325 PM L3 intermittent 2 25.1-8.4 True 0.21559 4.76288 0.00000 323 PM L3 intermittent 2 8.4-0 False 0.75742 8.93137 0.00000 310 PM L5 intermittent 1 58.6-41.9 False 0.00922 1.42667 0.15368 319 PM L5 intermittent 1 41.9-25.1 True 0.24735 7.73578 0.00000 316 PM L5 intermittent 1 25.1-8.4 False 0.40810 9.31975 0.00000 317 PM L5 intermittent 1 8.4-0 True 0.00000 0.97875 0.32770 275 PM L5 intermittent 2 58.6-41.9 True 0.39718 7.62269 0.00000 271 PM L5 intermittent 2 41.9-25.1 False 0.08556 3.72073 0.00020 319 PM L5 intermittent 2 25.1-8.4 True 0.23300 7.38531 0.00000 311 PM L5 intermittent 2 8.4-0 False 0.21436 5.65476 0.00000 295 O1 a O3 a, shift 0.1: PPC L3 and L5 positive P < 0.01 in 13 of 16; all groups 39 of 48; no-sound 18 of 24
O1 a O3 b, shift 0.01: PPC L3 and L5 positive P < 0.01 in 13 of 16; all groups 39 of 48; no-sound 18 of 24 O1 a O3 b, shift 0.1: PPC L3 and L5 positive P < 0.01 in 13 of 16; all groups 39 of 48; no-sound 18 of 24
O1 b O3 a, shift 0.01: PPC L3 and L5 positive P < 0.01 in 14 of 16; all groups 42 of 48; no-sound 18 of 24 O1 b O3 a, shift 0.1: PPC L3 and L5 positive P < 0.01 in 14 of 16; all groups 42 of 48; no-sound 18 of 24
O1 b O3 b, shift 0.01: PPC L3 and L5 positive P < 0.01 in 14 of 16; all groups 42 of 48; no-sound 18 of 24 O1 b O3 b, shift 0.1: PPC L3 and L5 positive P < 0.01 in 14 of 16; all groups 42 of 48; no-sound 18 of 24 main reading, intermittent 1, 8.4-0 cm: MAP over frames, percentiles 5, 25, 50, 75, 95 (cm): [ 0. 0. 0. 10.92 55.44] | at the grid's lower end (0 cm): 51.6% of frames PPC L2: trials 397, MAP constant over the zone in 28.7% (of these at 0 cm 99%), median frames in the zone 23, median MAP range within a trial 6.72 cm PPC L3: trials 331, MAP constant over the zone in 26.9% (of these at 0 cm 97%), median frames in the zone 24, median MAP range within a trial 6.72 cm PPC L5: trials 346, MAP constant over the zone in 20.2% (of these at 0 cm 97%), median frames in the zone 25, median MAP range within a trial 8.40 cm PM L2: trials 360, MAP constant over the zone in 20.6% (of these at 0 cm 91%), median frames in the zone 22, median MAP range within a trial 6.72 cm PM L3: trials 346, MAP constant over the zone in 17.9% (of these at 0 cm 97%), median frames in the zone 24, median MAP range within a trial 10.92 cm
PM L5: trials 327, MAP constant over the zone in 17.7% (of these at 0 cm 76%), median frames in the zone 22, median MAP range within a trial 11.76 cm intermittent 1, 58.6-41.9 cm: MAP constant in 3.7% of trial zones, all groups intermittent 1, 41.9-25.1 cm: MAP constant in 2.5% of trial zones, all groups intermittent 1, 25.1-8.4 cm: MAP constant in 3.5% of trial zones, all groups
Result: Not reproduced. In the intermittent conditions most zones have a positive median MAP slope with P < 0.01 (39 of 48 tests under O1 a, 42 under O1 b), but PPC layers 3 and 5 reach it in 13 (O1 a) or 14 (O1 b) of their 16 tests, and the criterion needs all 16. The failures include the no-sound zone 8.4-0 cm of intermittent 1, where the median slope is 0. There the MAP is at the lower end of the decoded range, 0 cm, in 51.6% of frames, and constant over the whole zone in 18 to 29% of trials per group, almost all of them at 0 cm (91 to 99% in five groups, 76% in PM layer 5); in the other zones of intermittent 1 it is constant in 2.5 to 3.7% of trials. So the zero slopes come from the decoder estimating the goal as reached before the zone ends, not from the 0.84 cm grid.
Sound against no-sound trials, per zone, Mann-Whitney U over trials.
def sound_vs_silent(s, larger="sound"):
out = []
for gname in GROUPS:
for z, zname in ((2, "25.1-8.4"), (3, "8.4-0")):
snd = s[(s.group == gname) & (s.zone == z) & (s.state == (1 if z == 2 else 2))].slope
sil = s[(s.group == gname) & (s.zone == z) & (s.state == (2 if z == 2 else 1))].slope
p, zz = F.mwu(snd, sil)
out.append(dict(group=gname, zone=zname, sound=np.nanmedian(snd), no_sound=np.nanmedian(sil), z=zz, p=p,
n=f"{snd.notna().sum()}, {sil.notna().sum()}"))
return pd.DataFrame(out)
fig5b-map-slope-lower-without-sound¶
MAP slopes were shallower without sound than with sound.
Source: Figure 5b; Results, Distance prediction with dynamic Bayesian inference, paragraph 3.
for rd, sh in DEC_CONFIGS:
t = sound_vs_silent(ZS[(rd, sh, "map")])
ok = (t.z > 0) & (t.p < 0.01)
print(f"{label(rd, sh)}: no-sound lower with P < 0.01 in PPC {ok[t.group.str.startswith('PPC')].sum()} of 6, PM {ok[t.group.str.startswith('PM')].sum()} of 6")
if (rd, sh) == MAIN:
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01: no-sound lower with P < 0.01 in PPC 6 of 6, PM 5 of 6 group zone sound no_sound z p n PPC L2 25.1-8.4 1.04961 0.19420 11.21736 0.00000 397, 364 PPC L2 8.4-0 0.81574 0.00000 11.09786 0.00000 364, 397 PPC L3 25.1-8.4 0.94999 0.23250 7.59232 0.00000 331, 334 PPC L3 8.4-0 0.85943 0.00000 9.64214 0.00000 334, 331 PPC L5 25.1-8.4 1.29708 0.26362 10.62057 0.00000 346, 306 PPC L5 8.4-0 1.09583 0.00000 9.47758 0.00000 306, 346 PM L2 25.1-8.4 0.86522 0.35564 5.69696 0.00000 360, 315 PM L2 8.4-0 0.65750 0.00000 8.92309 0.00000 315, 360 PM L3 25.1-8.4 0.86451 0.21559 6.67648 0.00000 346, 329 PM L3 8.4-0 0.75742 0.00000 7.55374 0.00000 329, 346 PM L5 25.1-8.4 0.40810 0.23300 1.62839 0.10348 327, 326 PM L5 8.4-0 0.21436 0.00000 4.15831 0.00003 326, 327
O1 a O3 a, shift 0.1: no-sound lower with P < 0.01 in PPC 6 of 6, PM 5 of 6 O1 a O3 b, shift 0.01: no-sound lower with P < 0.01 in PPC 6 of 6, PM 5 of 6
O1 a O3 b, shift 0.1: no-sound lower with P < 0.01 in PPC 6 of 6, PM 5 of 6
O1 b O3 a, shift 0.01: no-sound lower with P < 0.01 in PPC 6 of 6, PM 4 of 6 O1 b O3 a, shift 0.1: no-sound lower with P < 0.01 in PPC 6 of 6, PM 4 of 6
O1 b O3 b, shift 0.01: no-sound lower with P < 0.01 in PPC 6 of 6, PM 4 of 6
O1 b O3 b, shift 0.1: no-sound lower with P < 0.01 in PPC 6 of 6, PM 4 of 6
Result: Reproduced. MAP slopes are lower without sound with P < 0.01 in all six PPC comparisons and in five (O1 a) or four (O1 b) of the six PM comparisons.
fig5-layer3-steeper-than-layer2¶
In intermittent 1, without sound between 8.4 and 0 cm, MAPs decreased more steeply in PPC layer 3 than layer 2, while the s.d. of the estimates did not differ between these layers.
Source: Results, Distance prediction with dynamic Bayesian inference, paragraph 3.
for rd, sh in DEC_CONFIGS:
res = []
for kind in ("map", "unc"):
s = ZS[(rd, sh, kind)]
sel = lambda g: s[(s.group == g) & (s.state == 1) & (s.zone == 3)].slope
p, z = F.mwu(sel("PPC L3"), sel("PPC L2"))
res.append(f"{kind}: L3 median {np.nanmedian(sel('PPC L3')):.4f}, L2 {np.nanmedian(sel('PPC L2')):.4f}, z {z:.2f}, P {p:.4g}, n {sel('PPC L3').notna().sum()}, {sel('PPC L2').notna().sum()}")
print(f"{label(rd, sh)}: " + "; ".join(res))
O1 a O3 a, shift 0.01: map: L3 median 0.0000, L2 0.0000, z 1.48, P 0.1356, n 331, 397; unc: L3 median -0.0034, L2 0.0178, z -1.76, P 0.07863, n 331, 397 O1 a O3 a, shift 0.1: map: L3 median 0.0000, L2 0.0000, z 1.73, P 0.08127, n 331, 397; unc: L3 median 0.0002, L2 0.0179, z -1.45, P 0.1479, n 331, 397 O1 a O3 b, shift 0.01: map: L3 median 0.0000, L2 0.0000, z 1.50, P 0.1293, n 331, 397; unc: L3 median -0.0043, L2 0.0178, z -1.86, P 0.063, n 331, 397
O1 a O3 b, shift 0.1: map: L3 median 0.0000, L2 0.0000, z 1.77, P 0.07427, n 331, 397; unc: L3 median -0.0019, L2 0.0179, z -1.52, P 0.1273, n 331, 397 O1 b O3 a, shift 0.01: map: L3 median 0.0000, L2 0.0000, z 0.64, P 0.517, n 331, 397; unc: L3 median 0.0021, L2 0.0085, z -0.58, P 0.5614, n 331, 397
O1 b O3 a, shift 0.1: map: L3 median 0.0000, L2 0.0000, z 1.21, P 0.2241, n 331, 397; unc: L3 median 0.0055, L2 0.0092, z -0.44, P 0.661, n 331, 397
O1 b O3 b, shift 0.01: map: L3 median 0.0000, L2 0.0000, z 0.59, P 0.5553, n 331, 397; unc: L3 median 0.0005, L2 0.0138, z -0.74, P 0.4595, n 331, 397 O1 b O3 b, shift 0.1: map: L3 median 0.0000, L2 0.0000, z 0.83, P 0.4057, n 331, 397; unc: L3 median 0.0052, L2 0.0092, z -0.52, P 0.6041, n 331, 397
Result: Not reproduced. In intermittent 1 at 8.4-0 cm the MAP slope of PPC layer 3 trials is not steeper than layer 2 (z = 1.48, P = 0.14 in the main reading; P 0.07 to 0.56 over all readings), so the first part fails. The s.d. slopes do not differ (P 0.06 to 0.66), as the paper reports. Median MAP slopes in this zone are 0 in both layers, because the MAP sits at 0 cm through the zone in 29% (layer 2) and 27% (layer 3) of trials (shown under fig5a-map-decreases-without-sound).
fig5cd-uncertainty-updating¶
In all PPC layers, between 25.1 and 0 cm, uncertainty of the estimated distance fell more steeply with sound than without, the updating step of dynamic Bayesian inference.
Source: Figure 5c,d; Results, Distance prediction with dynamic Bayesian inference, paragraph 3; Discussion, paragraph 3.
for rd, sh in DEC_CONFIGS:
t = sound_vs_silent(ZS[(rd, sh, "unc")])
ok = (t.z > 0) & (t.p < 0.05)
print(f"{label(rd, sh)}: decrease larger with sound P < 0.05 in PPC {ok[t.group.str.startswith('PPC')].sum()} of 6, PM {ok[t.group.str.startswith('PM')].sum()} of 6")
if (rd, sh) == MAIN:
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 3 of 6 group zone sound no_sound z p n PPC L2 25.1-8.4 0.10038 0.01159 6.24613 0.00000 397, 364 PPC L2 8.4-0 0.06135 0.01781 3.64151 0.00027 364, 397 PPC L3 25.1-8.4 0.09789 0.02466 3.62085 0.00029 331, 334 PPC L3 8.4-0 0.09447 -0.00343 5.34750 0.00000 334, 331 PPC L5 25.1-8.4 0.17483 0.01078 6.52378 0.00000 346, 306 PPC L5 8.4-0 0.11503 0.03098 4.20198 0.00003 306, 346 PM L2 25.1-8.4 0.09038 0.02374 2.52939 0.01143 360, 315 PM L2 8.4-0 0.03163 0.01880 0.54995 0.58249 315, 360 PM L3 25.1-8.4 0.03037 -0.00689 2.87483 0.00404 346, 329 PM L3 8.4-0 0.08306 -0.01842 3.04661 0.00232 329, 346 PM L5 25.1-8.4 0.00940 0.03437 -0.12737 0.89881 327, 326 PM L5 8.4-0 0.03998 0.07154 -0.86543 0.38692 326, 327
O1 a O3 a, shift 0.1: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 3 of 6
O1 a O3 b, shift 0.01: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 3 of 6
O1 a O3 b, shift 0.1: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 3 of 6
O1 b O3 a, shift 0.01: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 2 of 6
O1 b O3 a, shift 0.1: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 2 of 6
O1 b O3 b, shift 0.01: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 2 of 6
O1 b O3 b, shift 0.1: decrease larger with sound P < 0.05 in PPC 6 of 6, PM 2 of 6
Result: Reproduced. Between 25.1 and 0 cm the decrease of uncertainty is larger with sound than without with P < 0.05 in all six PPC comparisons under every reading (P <= 0.0003 in the main reading). PM is significant in three (O1 a) or two (O1 b) of six.
fig5c-uncertainty-decreases-with-sound¶
In all PPC layers, the uncertainty of the decoded distance (s.d. of the posterior) decreased during sound presentation between 8.4 and 0 cm.
Source: Figure 5c and legend.
for rd, sh in DEC_CONFIGS:
t = against_zero(ZS[(rd, sh, "unc")], [0, 1, 2])
t = t[t.zone == "8.4-0"]
key = t.group.str.startswith("PPC") & t.condition.isin(["continuous", "intermittent 2"])
ok = (t["median"] > 0) & (t.p < 0.01)
print(f"{label(rd, sh)}: PPC continuous and intermittent 2, decrease P < 0.01 in {ok[key].sum()} of 6; other tests {ok[~key].sum()} of {(~key).sum()}")
if (rd, sh) == MAIN:
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 5 of 12 group condition zone silent median z p n PPC L2 continuous 8.4-0 False 0.03593 9.88829 0.00000 1779 PPC L2 intermittent 1 8.4-0 True 0.01781 2.18050 0.02922 397 PPC L2 intermittent 2 8.4-0 False 0.06135 5.86046 0.00000 364 PPC L3 continuous 8.4-0 False 0.04850 8.18252 0.00000 1581 PPC L3 intermittent 1 8.4-0 True -0.00343 -0.49875 0.61795 331 PPC L3 intermittent 2 8.4-0 False 0.09447 5.64622 0.00000 334 PPC L5 continuous 8.4-0 False 0.06370 10.08280 0.00000 1440 PPC L5 intermittent 1 8.4-0 True 0.03098 2.50734 0.01216 346 PPC L5 intermittent 2 8.4-0 False 0.11503 6.08291 0.00000 306 PM L2 continuous 8.4-0 False 0.05456 7.04621 0.00000 1708 PM L2 intermittent 1 8.4-0 True 0.01880 1.48843 0.13664 360 PM L2 intermittent 2 8.4-0 False 0.03163 1.96076 0.04991 315 PM L3 continuous 8.4-0 False 0.09097 8.72328 0.00000 1567 PM L3 intermittent 1 8.4-0 True -0.01842 -0.18986 0.84942 346 PM L3 intermittent 2 8.4-0 False 0.08306 3.89407 0.00010 329 PM L5 continuous 8.4-0 False 0.05121 4.29185 0.00002 1428 PM L5 intermittent 1 8.4-0 True 0.07154 3.08200 0.00206 327 PM L5 intermittent 2 8.4-0 False 0.03998 1.38837 0.16502 326
O1 a O3 a, shift 0.1: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 6 of 12
O1 a O3 b, shift 0.01: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 6 of 12
O1 a O3 b, shift 0.1: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 6 of 12
O1 b O3 a, shift 0.01: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 4 of 12
O1 b O3 a, shift 0.1: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 4 of 12
O1 b O3 b, shift 0.01: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 4 of 12
O1 b O3 b, shift 0.1: PPC continuous and intermittent 2, decrease P < 0.01 in 6 of 6; other tests 4 of 12
Result: Reproduced. At 8.4-0 cm the uncertainty decreases with P < 0.01 in all six PPC tests of the continuous and intermittent 2 conditions under every reading (z 5.6 to 10.1 in the main reading).
supp11-sound-reduces-error¶
Decoding errors decreased with sound and increased without it. Within zones, the change per cm of the RMSE difference (intermittent minus continuous) was lower in sound zones than in no-sound zones, in all PPC layers and in PM layers 2 and 3.
Source: Supplementary Figure 11b,c; Results, Distance prediction with dynamic Bayesian inference, paragraph 2.
def supp11(rmse, zone_reading):
b = np.floor(FR.x.values / 0.42).astype(int)
df = pd.DataFrame(dict(session=FR.session, state=FR.state, group=FR.group, b=b, v=rmse, zone=FR.zone, silent=FR.silent))
# frames whose sound differs from their zone's in the condition (the first 33 cm, always with sound) are left out
zs = np.array([0, 1, 0, 1]); zi_ = df.zone.clip(lower=0).values
exp_silent = np.where(df.state == 1, zs[zi_] == 1, np.where(df.state == 2, zs[zi_] == 0, False))
df = df[(df.zone < 0) | (df.silent.values == exp_silent)].drop(columns=["zone", "silent"]).dropna()
med = df.groupby(["session", "group", "state", "b"]).v.median().unstack("state")
out = []
for c in (1, 2):
d = (med[c] - med[0]).dropna().reset_index()
d.columns = ["session", "group", "b", "d"]
d["x"] = (d.b + 0.5) * 0.42
for zi, (hi, lo) in enumerate(F.ZONES):
if zone_reading == "b" and zi < 2:
continue
m = (d.x <= hi) & (d.x > lo)
for (sess, g), dd in d[m].groupby(["session", "group"]):
if len(dd) >= 3:
b1 = -np.polyfit(dd.x, dd.d, 1)[0]
silent = (c == 1) == (zi % 2 == 1)
out.append(dict(session=sess, group=g, condition=c, zone=zi, silent=silent, b1=b1))
return pd.DataFrame(out)
for rd, sh in DEC_CONFIGS:
for zr in "ab":
t = supp11(col((rd, sh, "lognormal"), 0), zr)
out = []
for g in GROUPS:
a, b = t[(t.group == g) & ~t.silent].b1, t[(t.group == g) & t.silent].b1
p, z = F.mwu(a, b)
out.append(dict(group=g, sound=np.median(a), no_sound=np.median(b), z=z, p=p, n=f"{len(a)}, {len(b)}"))
o = pd.DataFrame(out)
ok = (o.z < 0) & (o.p < 0.01)
print(f"{label(rd, sh)}, zones {zr}: b1 lower with sound P < 0.01 in PPC {ok[o.group.str.startswith('PPC')].sum()} of 3, PM {ok[o.group.str.startswith('PM')].sum()} of 3")
if (rd, sh) == MAIN:
print(o.round(5).to_string(index=False))
O1 a O3 a, shift 0.01, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3 group sound no_sound z p n PPC L2 -0.20613 -0.01770 -3.33388 0.00086 68, 68 PPC L3 -0.28340 0.07876 -4.08869 0.00004 60, 60 PPC L5 -0.10206 0.01467 -3.45661 0.00055 56, 56 PM L2 -0.15710 0.00821 -3.16911 0.00154 64, 64 PM L3 -0.10960 0.05603 -3.28565 0.00103 60, 60 PM L5 -0.04095 -0.02558 -1.27441 0.20355 56, 56
O1 a O3 a, shift 0.01, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3 group sound no_sound z p n PPC L2 -0.09498 0.14486 -2.94373 0.00331 34, 34 PPC L3 -0.14920 0.21417 -3.51869 0.00045 30, 30 PPC L5 -0.14461 0.28480 -3.31014 0.00096 28, 28 PM L2 -0.07194 0.08200 -2.06778 0.03930 32, 32 PM L3 -0.10202 0.19932 -2.08460 0.03778 30, 30 PM L5 0.03139 0.05268 -0.83573 0.40793 28, 28
O1 a O3 a, shift 0.1, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 a O3 a, shift 0.1, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3
O1 a O3 b, shift 0.01, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 a O3 b, shift 0.01, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3
O1 a O3 b, shift 0.1, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 a O3 b, shift 0.1, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3
O1 b O3 a, shift 0.01, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 b O3 a, shift 0.01, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3
O1 b O3 a, shift 0.1, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 b O3 a, shift 0.1, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 1 of 3
O1 b O3 b, shift 0.01, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 b O3 b, shift 0.01, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 0 of 3
O1 b O3 b, shift 0.1, zones a: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 2 of 3
O1 b O3 b, shift 0.1, zones b: b1 lower with sound P < 0.01 in PPC 3 of 3, PM 1 of 3
Result: Reproduced. The change per cm of the RMSE difference is lower in sound zones than in no-sound zones with P < 0.01 in all three PPC layers under both zone readings and every decoder reading. Frames whose sound differs from their zone's in the condition (the first 33 cm from the start) are now left out under zone reading (a) as well. PM reaches it in two layers with four zones and in none or one with two zones.
supp13-map-speed¶
During no-sound zones, decoded MAPs fell faster in fast-locomotion trials than in slow ones.
Source: Supplementary Figure 13; Results, Distance prediction with dynamic Bayesian inference, paragraph 3.
FR["speed"] = np.concatenate([R[i]["dec"]["speed"] for i in range(len(R))])
TRIAL_SPEED = {i: R[i]["trial_speed"] for i in range(len(R))}
def supp13(s_time, speed_reading, zone_reading):
s = s_time[s_time.silent]
if zone_reading == "b":
s = s[((s.state == 1) & (s.zone == 3)) | ((s.state == 2) & (s.zone == 2))]
s = s.groupby(["session", "trial", "state", "group"], as_index=False).slope.mean()
if speed_reading == "a":
s["spd"] = [TRIAL_SPEED[a][b] for a, b in zip(s.session.values, s.trial.values)]
else:
df = FR[(FR.zone >= 0) & FR.silent]
if zone_reading == "b":
df = df[((df.state == 1) & (df.zone == 3)) | ((df.state == 2) & (df.zone == 2))]
zsp = df.groupby(["session", "trial"]).speed.mean().rename("spd").reset_index()
s = s.merge(zsp, on=["session", "trial"], how="left")
s["fast"] = s.spd > s.groupby(["session", "state"]).spd.transform("median")
out = []
for g in GROUPS:
for c in (1, 2):
f_ = s[(s.group == g) & (s.state == c) & s.fast].slope; sl = s[(s.group == g) & (s.state == c) & ~s.fast].slope
p, z = F.mwu(f_, sl)
out.append(dict(group=g, condition=COND_NAMES[c], fast=np.nanmedian(f_), slow=np.nanmedian(sl), z=z, p=p, n=f"{f_.notna().sum()}, {sl.notna().sum()}"))
return pd.DataFrame(out)
for rd, sh in DEC_CONFIGS:
st_ = zone_slopes(col((rd, sh, "lognormal"), 1), against="time")
for spr in "ab":
for zr in "ab":
t = supp13(st_, spr, zr)
key = t.group.isin(["PPC L2", "PPC L3"])
ok = (t.z < 0) & (t.p < 0.05) # MAP falls faster (more negative slope on time) in fast trials
print(f"{label(rd, sh)}, speed {spr}, zones {zr}: fast steeper P < 0.05 in PPC L2/L3 {ok[key].sum()} of 4; others {ok[~key].sum()} of 8")
if (rd, sh) == MAIN and spr == "a" and zr == "a":
print(t.round(5).to_string(index=False))
O1 a O3 a, shift 0.01, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 1 of 8 group condition fast slow z p n PPC L2 intermittent 1 -6.04914 -2.72134 -2.47577 0.01331 196, 201 PPC L2 intermittent 2 -9.24223 -6.18778 -1.99975 0.04558 177, 187 PPC L3 intermittent 1 -4.53742 -2.84222 -1.27640 0.20202 163, 168 PPC L3 intermittent 2 -8.85045 -4.31983 -2.01618 0.04384 163, 171 PPC L5 intermittent 1 -3.82062 -2.97061 -1.57480 0.11543 172, 174 PPC L5 intermittent 2 -6.52124 -4.78011 -0.25074 0.80252 150, 156 PM L2 intermittent 1 -6.68348 -4.50329 -1.49409 0.13528 175, 185 PM L2 intermittent 2 -9.74382 -7.71478 -0.82670 0.40876 154, 161 PM L3 intermittent 1 -5.11373 -2.22643 -2.60471 0.00921 169, 177 PM L3 intermittent 2 -6.60413 -6.46227 -0.63424 0.52630 161, 168 PM L5 intermittent 1 -5.09756 -3.16057 -1.41783 0.15641 159, 168 PM L5 intermittent 2 -8.85122 -7.36364 -1.03488 0.30100 161, 165 O1 a O3 a, shift 0.01, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8 O1 a O3 a, shift 0.01, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 2 of 8 O1 a O3 a, shift 0.01, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8
O1 a O3 a, shift 0.1, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 1 of 8 O1 a O3 a, shift 0.1, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 2 of 8 O1 a O3 a, shift 0.1, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 1 of 8 O1 a O3 a, shift 0.1, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 1 of 8
O1 a O3 b, shift 0.01, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 1 of 8 O1 a O3 b, shift 0.01, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8 O1 a O3 b, shift 0.01, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 2 of 8 O1 a O3 b, shift 0.01, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8
O1 a O3 b, shift 0.1, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 1 of 8 O1 a O3 b, shift 0.1, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 2 of 8 O1 a O3 b, shift 0.1, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 1 of 8 O1 a O3 b, shift 0.1, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 1 of 8
O1 b O3 a, shift 0.01, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 4 of 8 O1 b O3 a, shift 0.01, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 4 of 8 O1 b O3 a, shift 0.01, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 5 of 8 O1 b O3 a, shift 0.01, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 2 of 8
O1 b O3 a, shift 0.1, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 3 of 8 O1 b O3 a, shift 0.1, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 4 of 8 O1 b O3 a, shift 0.1, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 5 of 8 O1 b O3 a, shift 0.1, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8
O1 b O3 b, shift 0.01, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 4 of 8 O1 b O3 b, shift 0.01, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 4 of 8 O1 b O3 b, shift 0.01, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 5 of 8 O1 b O3 b, shift 0.01, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 2 of 8
O1 b O3 b, shift 0.1, speed a, zones a: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 3 of 8 O1 b O3 b, shift 0.1, speed a, zones b: fast steeper P < 0.05 in PPC L2/L3 3 of 4; others 4 of 8 O1 b O3 b, shift 0.1, speed b, zones a: fast steeper P < 0.05 in PPC L2/L3 1 of 4; others 5 of 8 O1 b O3 b, shift 0.1, speed b, zones b: fast steeper P < 0.05 in PPC L2/L3 2 of 4; others 2 of 8
Result: Not reproduced. Fast trials have significantly steeper MAP decreases (P < 0.05) in at most three of the four PPC layer 2 and 3 tests under any reading, and in one or two under most; the criterion needs all four under every reading.
lognormal-decoder-better¶
The decoder with a log-normal likelihood estimated goal distance better than one with a Gaussian likelihood in 17 of 18 settings, all but PM layer 5 in the continuous condition.
Source: Online Methods, Probabilistic decoding of goal distance, paragraph 3.
for rd, sh in DEC_CONFIGS:
ln = col((rd, sh, "lognormal"), 0), np.abs(col((rd, sh, "lognormal"), 1) - FR.x.values)
ga = col((rd, None, "gaussian"), 0), np.abs(col((rd, None, "gaussian"), 1) - FR.x.values)
for k, name in ((0, "RMSE"), (1, "absolute MAP error")):
out = []
for g in GROUPS:
for c in range(3):
m = ((FR.group == g) & (FR.state == c)).values & ~np.isnan(ln[k])
p, z, n = F.wilcoxon_z(ln[k][m], ga[k][m])
out.append(dict(group=g, condition=COND_NAMES[c], lognormal=np.median(ln[k][m]), gaussian=np.median(ga[k][m]), z=z, p=p, n=n))
t = pd.DataFrame(out)
ok = (t.z < 0) & (t.p < 0.01)
print(f"{label(rd, sh)}, {name}: log-normal better with P < 0.01 in {ok.sum()} of 18; Gaussian better with P < 0.01 in {((t.z > 0) & (t.p < 0.01)).sum()}")
if (rd, sh) == MAIN:
print(t.round(4).to_string(index=False))
O1 a O3 a, shift 0.01, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 17 group condition lognormal gaussian z p n PPC L2 continuous 11.0550 10.6030 47.6561 0.0000 239595 PPC L2 intermittent 1 12.3824 12.0207 28.7399 0.0000 60121 PPC L2 intermittent 2 13.9895 13.4845 29.7677 0.0000 51445 PPC L3 continuous 14.0547 13.7183 26.2029 0.0000 220018 PPC L3 intermittent 1 15.1288 14.7898 22.8503 0.0000 52190 PPC L3 intermittent 2 15.9808 15.6705 15.6003 0.0000 47125 PPC L5 continuous 14.9563 14.6501 6.6609 0.0000 209605 PPC L5 intermittent 1 15.9134 15.5070 7.8750 0.0000 53650 PPC L5 intermittent 2 16.9440 16.5374 2.1207 0.0339 44217 PM L2 continuous 14.6486 14.2033 42.0031 0.0000 200636 PM L2 intermittent 1 15.2603 14.4877 31.4426 0.0000 47189 PM L2 intermittent 2 16.6106 16.0588 22.2245 0.0000 37961 PM L3 continuous 19.2202 18.8618 42.3917 0.0000 187752 PM L3 intermittent 1 19.9005 19.5734 28.0867 0.0000 47118 PM L3 intermittent 2 20.5855 20.3386 20.0025 0.0000 40281 PM L5 continuous 20.5012 20.3412 37.7798 0.0000 180708 PM L5 intermittent 1 21.0185 20.7739 30.0410 0.0000 45505 PM L5 intermittent 2 21.6195 21.5084 13.8568 0.0000 41406
O1 a O3 a, shift 0.01, absolute MAP error: log-normal better with P < 0.01 in 11 of 18; Gaussian better with P < 0.01 in 6 group condition lognormal gaussian z p n PPC L2 continuous 8.8027 8.7654 11.5260 0.0000 147243 PPC L2 intermittent 1 10.7965 10.7625 16.2979 0.0000 35884 PPC L2 intermittent 2 12.4414 12.1063 19.1252 0.0000 32897 PPC L3 continuous 10.6233 10.7478 18.9779 0.0000 132712 PPC L3 intermittent 1 12.6785 12.5766 19.8645 0.0000 29354 PPC L3 intermittent 2 13.4951 13.4953 10.5583 0.0000 29543 PPC L5 continuous 9.8329 10.4263 -33.0533 0.0000 130305 PPC L5 intermittent 1 11.4468 11.9527 -7.3661 0.0000 32102 PPC L5 intermittent 2 12.6157 12.9523 -8.7869 0.0000 28055 PM L2 continuous 9.0574 9.3707 -24.1928 0.0000 119734 PM L2 intermittent 1 10.8544 10.8646 -1.1139 0.2650 26370 PM L2 intermittent 2 11.9155 12.2075 -6.9722 0.0000 22790 PM L3 continuous 10.7651 11.2354 -34.6672 0.0000 109322 PM L3 intermittent 1 12.2664 12.4226 -2.7344 0.0062 26010 PM L3 intermittent 2 14.1570 14.5052 -4.9537 0.0000 23922 PM L5 continuous 12.8375 13.4738 -44.6288 0.0000 97904 PM L5 intermittent 1 13.7569 14.0840 -11.7439 0.0000 23514 PM L5 intermittent 2 15.0922 16.0936 -21.7867 0.0000 23012
O1 a O3 a, shift 0.1, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 16
O1 a O3 a, shift 0.1, absolute MAP error: log-normal better with P < 0.01 in 12 of 18; Gaussian better with P < 0.01 in 6
O1 a O3 b, shift 0.01, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 17
O1 a O3 b, shift 0.01, absolute MAP error: log-normal better with P < 0.01 in 11 of 18; Gaussian better with P < 0.01 in 6
O1 a O3 b, shift 0.1, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 16
O1 a O3 b, shift 0.1, absolute MAP error: log-normal better with P < 0.01 in 12 of 18; Gaussian better with P < 0.01 in 6
O1 b O3 a, shift 0.01, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 18
O1 b O3 a, shift 0.01, absolute MAP error: log-normal better with P < 0.01 in 11 of 18; Gaussian better with P < 0.01 in 6
O1 b O3 a, shift 0.1, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 15
O1 b O3 a, shift 0.1, absolute MAP error: log-normal better with P < 0.01 in 12 of 18; Gaussian better with P < 0.01 in 5
O1 b O3 b, shift 0.01, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 18
O1 b O3 b, shift 0.01, absolute MAP error: log-normal better with P < 0.01 in 11 of 18; Gaussian better with P < 0.01 in 5
O1 b O3 b, shift 0.1, RMSE: log-normal better with P < 0.01 in 0 of 18; Gaussian better with P < 0.01 in 15
O1 b O3 b, shift 0.1, absolute MAP error: log-normal better with P < 0.01 in 12 of 18; Gaussian better with P < 0.01 in 5
Result: Not reproduced. The Gaussian-likelihood decoder has the lower RMSE with P < 0.01 in 15 to 18 of 18 settings, and the log-normal decoder in none. By absolute MAP error the log-normal decoder is better in 11 or 12 of 18 settings and the Gaussian in 5 or 6, short of 16.
Single-basis regressions¶
For every neuron significant in goal-aligned activity under either baseline, unfiltered dR/R
is fitted as y = b0 + b1 phi(variable), phi the Gaussian basis of equation (3) centred at the
value of maximal averaged activity (Online Methods, Regression analysis). The width is
profiled over a grid of 25 values from 0.5 to 200 (cm or dB), the least-squares fit at each,
and the best grid value is then refined by a bounded scalar optimizer between its two
neighbouring grid values, in place of an optimizer started from four initial values; the grid
covers the four initial values of either reading of O6. Frames are those of O6, (a) and (b). The fits run in the
loading step (funamizu.regressions).
def reg_col(model, fr_reading, k):
"""One output of the single-basis fits (0 RMSE, 1 width, 2 b1) as an array over all neurons;
NaN for neurons that were not fitted (not goal-aligned significant under either baseline)."""
out = np.full(len(NT), np.nan)
for i, r in enumerate(R):
if r.get("reg"):
idx = [roi_index[(i, n)] for n in r["dec"]["neurons"]]
out[idx] = r["reg"][(model, fr_reading)][k]
return out
print("neurons fitted:", int(np.isfinite(reg_col("distance", "a", 0)).sum()))
neurons fitted: 12724
supp6-distance-not-sound¶
Goal-distance and after-reaching neurons were fit better by goal distance than by a distance held constant during no-sound zones or by the sound intensity.
Source: Supplementary Figure 6; Results, Goal-distance representation in PPC and PM, paragraph 6.
for rd in CLS_GD:
c = CLS_GD[rd]
for fr in "ab":
for snd in ("sound_a", "sound_b"):
out = []
dist = reg_col("distance", fr, 0)
for alt in ("step", snd):
other = reg_col(alt, fr, 0)
for cls in ("gd", "after"):
for g in GROUPS:
m = c[cls].values & (NT.group == g).values
p, z, n = F.wilcoxon_z(dist[m], other[m])
out.append(dict(against=alt, neurons=cls, group=g, distance=np.nanmedian(dist[m]), other=np.nanmedian(other[m]), z=z, p=p, n=n))
t = pd.DataFrame(out)
ok = (t.z < 0) & (t.p < 0.05)
print(f"O1 {rd[0]} O3 {rd[2]}, frames {fr}, {snd}: Distance lower RMSE with P < 0.05 in {ok.sum()} of {len(t)}")
if rd == ("a", "67", "a") and fr == "a" and snd == "sound_a":
print(t.round(6).to_string(index=False))
O1 a O3 a, frames a, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24 against neurons group distance other z p n step gd PPC L2 0.119840 0.119819 -17.638089 0.000000 1345 step gd PPC L3 0.118120 0.118071 -11.345639 0.000000 1282 step gd PPC L5 0.114223 0.114095 -8.277247 0.000000 550 step gd PM L2 0.113793 0.113859 -10.554859 0.000000 657 step gd PM L3 0.094072 0.094133 -10.182452 0.000000 511 step gd PM L5 0.114166 0.114336 -4.028380 0.000056 158 step after PPC L2 0.114378 0.114548 -16.679496 0.000000 936 step after PPC L3 0.117201 0.117221 -10.596141 0.000000 1053 step after PPC L5 0.111249 0.111310 -7.848789 0.000000 427 step after PM L2 0.111707 0.111654 -4.067844 0.000047 224 step after PM L3 0.097431 0.097466 -5.173845 0.000000 227 step after PM L5 0.102688 0.102702 -1.615334 0.106238 76 sound_a gd PPC L2 0.119840 0.121195 -28.027465 0.000000 1353 sound_a gd PPC L3 0.118120 0.118839 -29.720879 0.000000 1292 sound_a gd PPC L5 0.114223 0.114878 -18.523574 0.000000 555 sound_a gd PM L2 0.113793 0.114755 -17.378148 0.000000 659 sound_a gd PM L3 0.094072 0.094528 -17.150013 0.000000 512 sound_a gd PM L5 0.114166 0.115332 -9.408234 0.000000 158 sound_a after PPC L2 0.114378 0.115799 -25.539323 0.000000 942 sound_a after PPC L3 0.117201 0.117946 -27.682713 0.000000 1061 sound_a after PPC L5 0.111249 0.112599 -17.407926 0.000000 431 sound_a after PM L2 0.111707 0.112475 -12.561820 0.000000 225 sound_a after PM L3 0.097431 0.098372 -12.356865 0.000000 228 sound_a after PM L5 0.102688 0.102850 -6.984249 0.000000 76 O1 a O3 a, frames a, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
O1 a O3 a, frames b, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24
O1 a O3 a, frames b, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24 O1 a O3 b, frames a, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24
O1 a O3 b, frames a, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
O1 a O3 b, frames b, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24 O1 a O3 b, frames b, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 a, frames a, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 a, frames a, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24 O1 b O3 a, frames b, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 a, frames b, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 b, frames a, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24 O1 b O3 b, frames a, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 b, frames b, sound_a: Distance lower RMSE with P < 0.05 in 23 of 24
O1 b O3 b, frames b, sound_b: Distance lower RMSE with P < 0.05 in 23 of 24
Result: Partially reproduced. Distance has the lower RMSE with P < 0.05 in 23 of the 24 comparisons under every reading (frames, sound below 25 cm, classification). The exception is PM layer 5 after-reaching neurons against Step (P = 0.11, n = 76 in the reading shown). The differences of median RMSE are small, below 0.002 dR/R.
tuning-similar-ppc-pm¶
The distance tuning curves of goal-distance neurons, as fitted coefficients, did not differ between PPC and PM.
Source: Results, Goal-distance representation in PPC and PM, paragraph 6.
A claim of absence; the coefficient compared is open (claims file), readings (a) the width s and (b) b1 of the distance fit, the distance-only set of equation (2).
for rd in CLS_GD:
c = CLS_GD[rd]
for fr in "ab":
for k, name in ((1, "width s"), (2, "coefficient b1")):
v = reg_col("distance", fr, k)
out = []
for L in (2, 3, 5):
a = v[c.gd.values & (NT.area == "PPC").values & (NT.layer == L).values]
b = v[c.gd.values & (NT.area == "PM").values & (NT.layer == L).values]
p, z = F.mwu(a, b)
out.append(f"L{L} PPC {np.nanmedian(a):.4g} PM {np.nanmedian(b):.4g} z {z:.2f} P {p:.3g}")
print(f"O1 {rd[0]} O3 {rd[2]}, frames {fr}, {name}: " + "; ".join(out))
O1 a O3 a, frames a, width s: L2 PPC 20.52 PM 23.7 z -3.40 P 0.000669; L3 PPC 17.04 PM 22.6 z -6.31 P 2.79e-10; L5 PPC 17.51 PM 22.94 z -3.70 P 0.000214 O1 a O3 a, frames a, coefficient b1: L2 PPC 0.06859 PM 0.067 z 0.17 P 0.869; L3 PPC 0.06561 PM 0.04758 z 6.71 P 2.01e-11; L5 PPC 0.06615 PM 0.0819 z -2.69 P 0.00722 O1 a O3 a, frames b, width s: L2 PPC 21.88 PM 18.92 z 1.66 P 0.0977; L3 PPC 17.13 PM 14.46 z 1.72 P 0.0862; L5 PPC 18.6 PM 19.61 z -1.26 P 0.209 O1 a O3 a, frames b, coefficient b1: L2 PPC 0.06506 PM 0.07463 z -2.63 P 0.00848; L3 PPC 0.06321 PM 0.04492 z 6.25 P 4.17e-10; L5 PPC 0.06491 PM 0.08494 z -3.32 P 0.000903 O1 a O3 b, frames a, width s: L2 PPC 20.52 PM 23.7 z -3.40 P 0.000669; L3 PPC 17.05 PM 22.57 z -6.30 P 2.93e-10; L5 PPC 17.39 PM 22.94 z -3.73 P 0.000191 O1 a O3 b, frames a, coefficient b1: L2 PPC 0.06859 PM 0.067 z 0.17 P 0.869; L3 PPC 0.0655 PM 0.04757 z 6.69 P 2.19e-11; L5 PPC 0.06633 PM 0.0819 z -2.67 P 0.00758 O1 a O3 b, frames b, width s: L2 PPC 21.88 PM 18.92 z 1.66 P 0.0977; L3 PPC 17.14 PM 14.4 z 1.73 P 0.0831; L5 PPC 18.6 PM 19.61 z -1.26 P 0.206
O1 a O3 b, frames b, coefficient b1: L2 PPC 0.06506 PM 0.07463 z -2.63 P 0.00848; L3 PPC 0.06309 PM 0.0449 z 6.25 P 4.24e-10; L5 PPC 0.06496 PM 0.08494 z -3.30 P 0.000952 O1 b O3 a, frames a, width s: L2 PPC 23.52 PM 25.42 z -2.26 P 0.0237; L3 PPC 19.4 PM 26 z -6.99 P 2.75e-12; L5 PPC 21.63 PM 29.11 z -5.38 P 7.49e-08 O1 b O3 a, frames a, coefficient b1: L2 PPC 0.06643 PM 0.05838 z 2.44 P 0.0145; L3 PPC 0.06443 PM 0.046 z 6.57 P 4.89e-11; L5 PPC 0.0604 PM 0.07383 z -2.40 P 0.0163 O1 b O3 a, frames b, width s: L2 PPC 24.15 PM 21.85 z 0.40 P 0.691; L3 PPC 18.53 PM 17.03 z -0.15 P 0.881; L5 PPC 20.6 PM 24.12 z -2.79 P 0.00524
O1 b O3 a, frames b, coefficient b1: L2 PPC 0.06773 PM 0.07772 z -1.96 P 0.0506; L3 PPC 0.06421 PM 0.04825 z 4.41 P 1.05e-05; L5 PPC 0.06375 PM 0.08529 z -3.18 P 0.00147
O1 b O3 b, frames a, width s: L2 PPC 23.49 PM 25.42 z -2.29 P 0.0221; L3 PPC 19.48 PM 26 z -6.95 P 3.5e-12; L5 PPC 21.63 PM 29.11 z -5.38 P 7.49e-08 O1 b O3 b, frames a, coefficient b1: L2 PPC 0.06655 PM 0.05838 z 2.45 P 0.0142; L3 PPC 0.0643 PM 0.046 z 6.50 P 7.92e-11; L5 PPC 0.0604 PM 0.07383 z -2.40 P 0.0163 O1 b O3 b, frames b, width s: L2 PPC 24.27 PM 21.85 z 0.43 P 0.665; L3 PPC 18.53 PM 17.03 z -0.18 P 0.861; L5 PPC 20.6 PM 24.12 z -2.79 P 0.00524 O1 b O3 b, frames b, coefficient b1: L2 PPC 0.06771 PM 0.07772 z -1.95 P 0.0506; L3 PPC 0.06401 PM 0.04825 z 4.36 P 1.28e-05; L5 PPC 0.06375 PM 0.08529 z -3.18 P 0.00147
Result: Blocked, methods underspecified. The readings disagree. The widths are now fitted by a bounded optimizer between the grid values, so they are not quantized. With frames from start to goal (O6 a), PPC and PM differ in the width in all three layers under every classification reading (P 3e-12 to 0.024) and in b1 in layers 3 and 5 (P 2e-11 to 0.016), and in layer 2 under O1 b (P = 0.014). With frames to 3 s after the goal (O6 b) and the zero baseline, the widths do not differ in any layer (P 0.083 to 0.21), while b1 differs in all three (P 4e-10 to 0.0085); under O1 b with these frames the width differs in layer 5 (P = 0.0052). As the criterion directs, the claim is blocked.
Claims not run: fig3b-distance-over-time and svm-correlations¶
In PPC and PM, more goal-distance neurons were best fit by goal distance than by the time to reach the goal. (fig3b)
An SVM decoder trained on recorded data did not estimate distance better than one trained on trial-shuffled data, except in one setting. (svm-correlations)
Both are blocked because their computation does not fit the notebook's limit of 60 minutes; the data they need are in the files. One fit of each is timed here on a session of the dataset, and the whole is estimated from it. For fig3b the timed fit is the largest model of equation (2), three Gaussian bases with fixed centres and free widths (goal distance, time from the start and speed, from the decoder's start-to-goal frames of one neuron), by nonlinear least squares from one initial value; the claim needs 11 variable sets and four initial values per neuron, over the frames of O6, under each of its four readings. For svm-correlations the timed fit is one linear multiclass SVM over the 4.2 cm bins (reading a) on the continuous frames of one session, which leave-one-trial-out training repeats once per continuous trial, for the recorded and the shuffled decoder, in every decoded session.
from scipy.optimize import least_squares
from sklearn.svm import LinearSVC, LinearSVR
gd_main = CLS_GD[("a", "67", "a")].gd.values
n_gd = {i: int(sum(gd_main[roi_index[(i, n)]] for n in R[i]["dec"]["neurons"])) for i in range(len(R))}
i0 = sorted(range(len(R)), key=lambda i: len(R[i]["dec"]["x"]))[len(R) // 2] # the session of median size
d0 = R[i0]["dec"]; keep0 = np.array([gd_main[roi_index[(i0, n)]] for n in d0["neurons"]], bool)
V = np.column_stack([d0["x"], d0["time"], d0["speed"]]); y0 = d0["n"][:, keep0][:, 0].astype(float)
mu0 = V[np.argmax(y0)]
def resid(p):
b0, b, s = p[0], p[1:4], np.exp(p[4:7])
return b0 + (b[None] * np.exp(-(V - mu0[None]) ** 2 / (2 * s[None] ** 2))).sum(1) - y0
p0 = np.r_[y0.mean(), np.zeros(3), np.log(np.ptp(V, 0) / 4)]
t0 = _time.time(); fit = least_squares(resid, p0); t_fit = _time.time() - t0
N_GD = sum(n_gd.values())
NW = 4 # worker processes, as in the loading step
print(f"fig3b: session {R[i0]['meta']['path']}, {len(y0)} frames; one three-basis fit {t_fit:.2f} s ({fit.nfev} evaluations)")
h3 = t_fit * 44 * N_GD / 3600
print(f" goal-distance neurons (O1 a O3 a) {N_GD}; 44 fits per neuron: {h3:.1f} h per reading, "
f"{4 * h3:.1f} h over the four readings of O6 on one thread, {4 * h3 / NW:.1f} h over {NW} workers "
f"(an upper bound per fit, since most sets have fewer bases)")
# the SVM's cost grows with the number of neurons, so it is timed on the session of median goal-distance neuron count
i1 = sorted([i for i in range(len(R)) if n_gd[i] > 0], key=lambda i: n_gd[i])[sum(n > 0 for n in n_gd.values()) // 2]
d1 = R[i1]["dec"]; keep1 = np.array([gd_main[roi_index[(i1, n)]] for n in d1["neurons"]], bool)
m0 = d1["state"] == 0
Xs, yb = d1["n"][m0][:, keep1], np.clip((d1["x"][m0] / F.XB).astype(int), 0, F.NXB - 1)
t0 = _time.time(); LinearSVC().fit(Xs, yb); t_svm = _time.time() - t0
t0 = _time.time(); LinearSVR().fit(Xs, d1["x"][m0]); t_svr = _time.time() - t0
folds = sum(len(np.unique(R[i]["dec"]["trial"][R[i]["dec"]["state"] == 0])) + 1 for i in range(len(R)) if n_gd[i] > 0)
print(f"svm-correlations: session {R[i1]['meta']['path']}, {m0.sum()} continuous frames of {keep1.sum()} goal-distance neurons "
f"(median over sessions {int(np.median([n for n in n_gd.values() if n > 0]))}, mean {np.mean([n for n in n_gd.values() if n > 0]):.0f}); one linear multiclass SVM (reading a) {t_svm:.2f} s, "
f"one linear SVM regression (reading b) {t_svr:.2f} s; {folds} folds over {sum(n > 0 for n in n_gd.values())} sessions, two decoders")
ha, hb = 2 * folds * t_svm / 3600, 2 * folds * t_svr / 3600
n_cls = len(CLS_GD) # readings of O1 and O3, as for the decoder claims
print(f" one thread, one classification reading: {ha:.2f} h for reading (a), {hb:.2f} h for reading (b)")
print(f" over {NW} workers and the {n_cls} classification readings of the goal-distance neurons: "
f"{n_cls * ha / NW * 60:.0f} min for (a), {n_cls * hb / NW * 60:.0f} min for (b), {n_cls * (ha + hb) / NW * 60:.0f} min in all; "
f"under the one reading O1 a O3 a, {(ha + hb) / NW * 60:.0f} min")
print(f" this notebook has run {(_time.time() - NB_T0) / 60:.0f} min so far, of its limit of 60")
fig3b: session sub-mouse6/sub-mouse6_ses-20140311_behavior+ophys.nwb, 19586 frames; one three-basis fit 0.72 s (21 evaluations) goal-distance neurons (O1 a O3 a) 4529; 44 fits per neuron: 39.7 h per reading, 158.7 h over the four readings of O6 on one thread, 39.7 h over 4 workers (an upper bound per fit, since most sets have fewer bases)
svm-correlations: session sub-mouse1/sub-mouse1_ses-20131009_behavior+ophys.nwb, 13664 continuous frames of 37 goal-distance neurons (median over sessions 37, mean 50); one linear multiclass SVM (reading a) 0.50 s, one linear SVM regression (reading b) 0.01 s; 9596 folds over 91 sessions, two decoders one thread, one classification reading: 2.67 h for reading (a), 0.05 h for reading (b) over 4 workers and the 4 classification readings of the goal-distance neurons: 160 min for (a), 3 min for (b), 163 min in all; under the one reading O1 a O3 a, 41 min this notebook has run 23 min so far, of its limit of 60
Result: Blocked, too large (both claims). For fig3b one three-basis fit on 19,586 frames took 0.54 s, so 44 fits for each of 4,529 goal-distance neurons need about 29.7 h per reading of O6, 118.9 h for the four on one thread and 29.7 h over the notebook's 4 workers. For svm-correlations, timed on the session of median goal-distance neuron count (37 neurons, 13,664 continuous frames), one linear multiclass SVM (reading a) took 0.53 s and one linear SVM regression (reading b) 0.01 s. The 9,596 leave-one-out folds of 91 sessions for two decoders then need 2.83 h for reading (a) and 0.06 h for reading (b) on one thread, under one classification reading. Over 4 workers and the 4 classification readings of the goal-distance neurons (O1 and O3, as for the decoder claims) that is about 173 min, and under the one reading O1 a O3 a alone 43 min. The notebook had run 23 min when this cell ran, so 37 min of its limit of 60 were left: neither claim fits, even in parallel and for svm-correlations even under one classification reading, so neither is run. The data they need are in the files.
Summary¶
| Claim | Outcome |
|---|---|
| session-counts | reproduced |
| neuron-counts | reproduced |
| behaviour-timing | not reproduced |
| lick-goal-correlation | not reproduced |
| fig1c-licking-without-sound | reproduced |
| supp1-licking-speed | blocked, methods underspecified (O9 zone readings disagree; asked of a reader) |
| fig1d-muscimol-correlation, fig1e-muscimol-variance, fig1fg-muscimol-no-sound-licking, supp2d-muscimol-overrun, muscimol-locomotion | blocked, data missing |
| sound-responsive-layer3 | blocked, data missing |
| neuron-classes | not reproduced |
| fig2d-task-relevant-proportions | not reproduced |
| fig2d-goal-distance-ppc-more | reproduced |
| fig2d-after-vs-before, fig2d-layer-distance-preference | blocked, methods underspecified (O1 readings disagree) |
| fig3b-distance-over-time | blocked, too large |
| supp6-distance-not-sound | partially reproduced |
| tuning-similar-ppc-pm | blocked, methods underspecified (readings disagree) |
| fig3c-continuous-ramp, fig3c-ppc-ramp-without-sound | reproduced |
| supp8a-pm-no-sound, supp8b-slopes-lower-without-sound, supp8c-ppc-steeper-than-pm | blocked, methods underspecified (O1 or trace readings disagree) |
| supp9-preserved-representation | not reproduced |
| fig4-above-chance | blocked, methods underspecified (chance readings disagree; asked of a reader) |
| fig4c-ppc-lower-error | blocked, methods underspecified (fails under O1 b with shift 0.1 and 0.42 cm bins) |
| fig4d-map-near-goal | blocked, methods underspecified (O8 bin readings disagree) |
| fig4e-ppc-lower-uncertainty | partially reproduced |
| supp11-sound-reduces-error | reproduced |
| fig5a-map-follows-continuous | reproduced |
| fig5a-map-decreases-without-sound | not reproduced |
| fig5b-map-slope-lower-without-sound, fig5cd-uncertainty-updating, fig5c-uncertainty-decreases-with-sound | reproduced |
| fig5-layer3-steeper-than-layer2, supp13-map-speed, lognormal-decoder-better | not reproduced |
| svm-correlations | blocked, too large |
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: lick counts and onsets come from a lick frequency, not lick times; the task-relevance baseline (O1), the k-means feature (O3), the shift (O7) and the bins (O8) are readings, all run, and a claim whose readings disagree is blocked; k-means is pooled over sessions, with a per-session variant shown for the counts and the slope claims; the multi-basis regression (fig3b) and the SVM claims are not run, and the single-basis fits profile the width over a grid and refine it with a bounded optimizer.
What was found about the dataset: it holds the paper's 94 imaging sessions of 8 mice, with
the session counts per mouse, area and layer and the 41,031 active ROIs exactly as reported,
dR/R as defined in the Methods, and the first 150 trials of each session. It does not hold the
muscimol experiment or the sound-mapping trials. The sound streams hold only the start tone,
not the task sound the description implies; speaker_presentations lists the speakers on at
each trial start, 6 to 26 rows per trial. Licks are stored as a capped, held frequency, not as
events. The start-to-reward times (9.3 s) and the share of slow trials (0.48%) differ from the
Methods (7.4 s, 2.71%).