Aery Jones et al. (2021) from dandiset 000165: linear track (run) sessions¶
Paper. Aery Jones EA, Rao A, Zilberter M, Djukic B, Bant JS, Gillespie AK, Koutsodendris N, Nelson M,
Yoon SY, Huang K, Yuan H, Gill TM, Huang Y, Frank LM (2021). Dentate gyrus and CA3 GABAergic
interneurons bidirectionally modulate signatures of internal and external drive to CA1. Cell
Reports 37, 110159. doi:10.1016/j.celrep.2021.110159.
The claims file (claims/jones-2021.yaml) was written from the accepted author manuscript in PubMed
Central (PMC9069800) with its main supplement; Table S7 was not available to the reader.
Dandiset. DANDI:000165, version 0.211118.1526 (doi:10.48324/dandi.000165/0.211118.1526). The paper links the draft, not a version. This is the only published version, and the draft has the same 572 assets and size, so the most recent published version is pinned. Files are streamed with remfile and h5py; nothing is written to disk.
Notebooks. rest_home_cage.ipynb tests the claims on the home cage (rest) sessions;
run_linear_track.ipynb tests those on the linear track (run) sessions; csd_cohort1.ipynb tests
the CSD claim on the single-shank home cage sessions of cohort 1. Methods are in the helper
jones2021.py, whose docstring says where each parameter comes from.
Common method (Method M of the claims file). For each feature, a linear mixed model feature ~ treatment + (treatment|animal), fitted by maximum likelihood, with an F test of the treatment coefficient (CNO minus vehicle); the model is fitted exactly from per-mouse, per-treatment sufficient statistics (cell counts, means and sums of squares), which gives the same likelihood as fitting every observation. The genotype test is the likelihood ratio of feature ~ treatment + (treatment|animal) against feature ~ treatment:genotype + (treatment:genotype|animal) on the pooled data, with 9 degrees of freedom as Table S3 gives. Two readings of the log transform are run: (a) log when the within-cell residuals have skewness above 1 (assumption: the Methods log right-skewed features without a rule); (b) log for every feature (the code). Significance is Holm-Bonferroni at 0.05 over the paper's family (24 rest or 36 run comparisons per group or pair), with comparisons not computed here ranked after those computed.
| Claim | Tested in | Status |
|---|---|---|
| fig1-tables1-expression | none | blocked: data_missing (histology not deposited) |
| figs1ef-exvivo-cno | none | blocked: data_missing (slice recordings not deposited) |
| fig2ef-csd-sr | csd | tested (cohort 1, csd_cohort1.ipynb) |
| fig3b-mua-during-swr | rest | tested |
| fig3c-swr-rate-bidirectional | rest | tested |
| fig3d-swr-chains | rest | tested |
| fig3e-swr-length-sst | rest | tested |
| swr-longer-100ms-sst | rest | tested |
| fig3f-swr-frequency-pv | rest | tested |
| fig3g-sw-amplitude-pv | rest | tested |
| figs2a-swr-size-pv | rest | tested |
| tables2-fast-ripples-pv | none | blocked: data_missing (LFP filtered at 300 Hz, sampled at 1 kHz) |
| tables2-detection-unchanged | rest | tested |
| tables2-rest-sg-pv | rest | tested |
| fig4d-swr-sg-power-pv | rest | tested |
| fig4e-swr-sg-coherence-pv | rest | tested |
| figs2cd-sg-predicts-sw-frequency | rest | tested |
| ca3-swr-overlap | rest | tested |
| figs3-ca3-swr-pv | rest | tested |
| figs3c-ca3-swr-rate-sst | rest | tested |
| figs3-dentate-spikes | rest | tested |
| fig5b-mua-run to figs5-theta-coherence-frequency (14 claims) | run | tested |
| running-speed-unchanged | run | tested |
| tables4-genotype-baseline | run | tested |
| tables6-sex-swr-size | rest and run | tested |
| sex-stratified-effects | rest and run | tested |
| figs6-double-like-pv, figs6-double-unlike-sst, figs6-empty-vector-control | rest and run | tested |
import time
import warnings
import numpy as np
import pandas as pd
from scipy import stats
import jones2021 as J
warnings.filterwarnings("ignore", category=RuntimeWarning)
pd.set_option("display.width", 220)
pd.set_option("display.max_columns", 40)
pd.set_option("display.max_rows", 400)
started = time.time()
assets = J.list_assets()
lt_assets = assets[assets.kind == "LinearTrack"]
print(f"dandiset {J.DANDISET_ID} version {J.DANDISET_VERSION}: {len(lt_assets)} linear track files of {len(assets)}")
results = J.process_many(lt_assets.asset_id.tolist(), "LinearTrack", workers=4)
errors = [r for r in results if "error" in r]
print(f"processed in {(time.time() - started) / 60:.1f} min; failed: {len(errors)}")
for e in errors:
print(" ", e)
dandiset 000165 version 0.211118.1526: 170 linear track files of 572
processed in 4.9 min; failed: 0
Data check¶
S = J.session_table(results)
S = S[S.animal.notna()].reset_index(drop=True)
chk = pd.DataFrame([dict(session=r["meta"]["session_id"], probe=r["meta"]["probe"], lfp_min=r["lfp_range"][0],
lfp_max=r["lfp_range"][1], conversion=r["conv"], pos_hz=r["pos"]["pos_hz"], lfp_t0=r["pos"]["lfp_t0"], pos_t0=r["pos"]["pos_t0"],
pos_end_minus_lfp_end=r["pos"]["pos_t1"] - r["n_samples"] / 1000,
x_range=np.ptp(r["pos"]["x_range"]), y_range=np.ptp(r["pos"]["y_range"]),
run_min=r["run_s"] / 60, bins_1s=r["n_bins"], speed_run=r["speed_run"], speed_all=r["speed_all"],
zero_spikes=r["n_zero_spikes"], n_ca1_pyr=len(r["regions"]["ca1_pyr"]), n_ca3=len(r["regions"]["ca3"]),
n_dg=len(r["regions"]["dg"]), clock_m30=r["clock"][-30], clock_0=r["clock"][0], clock_p30=r["clock"][30],
track_swr=r.get("track_swr_n", 0), track_lag=r.get("track_mua_lag", np.nan),
track_lag_ratio=r.get("track_mua_lag_ratio", np.nan),
seconds=r["seconds"], maxrss_gb=r["maxrss_kb"] / 1e6)
for r in (results[i] for i in S.i)])
print("Probes:", chk.probe.unique())
print("Mice and sessions by group and treatment:")
print(S.groupby(["group", "treatment"]).agg(sessions=("session", "size"), mice=("animal", "nunique"),
minutes=("minutes", "median")).round(1).to_string())
seq = S.assign(n=S.session.str.extract(r"(\d+)_")[0].astype(int)).sort_values(["animal", "n"]).groupby("animal").agg(
group=("group", "first"), sequence=("treatment", lambda t: "".join("C" if x == "CNO" else "v" for x in t)),
sessions=("n", lambda s: ",".join(map(str, s))))
print("\nTreatment sequence per mouse (v vehicle, C CNO):")
print(seq.to_string())
print("\nPer-session values:")
print(chk.drop(columns=["session", "probe"]).describe().round(3).T.to_string())
st = S.assign(start=[pd.Timestamp(results[i]["meta"]["start"]) for i in S.i]).sort_values(["animal", "start"])
gap = st.groupby("animal").start.apply(lambda t: t.diff().min().total_seconds() / 60)
print("\nShortest gap between the starts of two track sessions of one mouse (min):")
print(gap.describe().round(1).to_string())
print("Mice with two session starts less than 30 min apart:", int((gap < 30).sum()), "of", len(gap))
print("\nSessions without CA1-pyr, CA3 or DG sites:", int((chk.n_ca1_pyr == 0).sum()), int((chk.n_ca3 == 0).sum()), int((chk.n_dg == 0).sum()))
print("LFP starting_time (s) over sessions:", sorted(set(chk.lfp_t0)), "; first position timestamp (s):", sorted(set(chk.pos_t0.round(3)))[:5])
Probes: <StringArray>
['A4x8-5mm-400-200-703-CM32']
Length: 1, dtype: str
Mice and sessions by group and treatment:
sessions mice minutes
group treatment
EV CNO 23 8 24.9
Vehicle 22 8 24.9
PS CNO 21 7 24.9
Vehicle 19 7 23.8
PV CNO 24 8 25.0
Vehicle 21 8 24.3
SST CNO 21 7 25.0
Vehicle 19 7 24.9
Treatment sequence per mouse (v vehicle, C CNO):
group sequence sessions
animal
Adobo PV vvCCC 2,3,4,5,6
Anise EV vvvCCC 1,2,3,4,5,6
Baharat SST vvvCCC 1,2,3,4,5,6
Basil PS vvvCCC 1,2,3,4,5,6
Caraway PV vvvCCC 1,2,3,4,5,6
Cardamom SST vvvCCC 1,2,3,4,5,6
Chives PV vvvCCC 1,2,3,4,5,6
Cinnamon PV vvvCCC 1,2,3,4,5,6
Coriander PV vvCCC 2,3,4,5,6
Cumin PS vvvCCC 1,2,3,4,5,6
Dill PS vvCCC 2,3,4,5,6
Fenugreek PV vvvCCC 1,2,3,4,5,6
GaramMasala PV vvCCC 2,3,4,5,6
Jerk SST vvvCCC 1,2,3,4,5,6
Mace SST vvCCC 2,3,4,5,6
Mustard SST vvCCC 2,3,4,5,6
Nutmeg PS vvvCCC 1,2,3,4,5,6
OldBay EV vvCCC 1,2,4,5,6
Paprika PS vvvCCC 1,2,3,4,5,6
Parsley PS vvCCC 1,2,4,5,6
Pepper EV vvCCC 2,3,4,5,6
Provence EV vvvCCC 1,2,3,4,5,6
Rosemary EV vvvCC 1,2,3,5,6
Saffron EV vvvCCC 1,2,3,4,5,6
Sage EV vvvCCC 1,2,3,4,5,6
Salt PV vvvCCC 1,2,3,4,5,6
Sumac PS vvvCCC 1,2,3,4,5,6
Tarragon SST vvvCCC 1,2,3,4,5,6
Thyme EV vvvCCC 1,2,3,4,5,6
Vanilla SST vvvCCC 1,2,3,4,5,6
Per-session values:
count mean std min 25% 50% 75% max
lfp_min 170.0 -3644.194 1551.955 -12256.000 -3887.250 -3151.000 -2770.500 -1283.000
lfp_max 170.0 3146.806 1945.667 1284.000 2093.250 2422.000 3101.750 12501.000
conversion 170.0 1.000 0.000 1.000 1.000 1.000 1.000 1.000
pos_hz 170.0 19.305 0.000 19.305 19.305 19.305 19.305 19.305
lfp_t0 170.0 0.000 0.000 0.000 0.000 0.000 0.000 0.000
pos_t0 170.0 0.000 0.000 0.000 0.000 0.000 0.000 0.000
pos_end_minus_lfp_end 170.0 14.047 120.370 -92.722 -1.902 -0.122 0.100 1229.034
x_range 170.0 37.726 1.140 35.439 36.935 37.533 38.411 40.748
y_range 170.0 5.852 1.381 3.364 4.935 5.533 6.430 10.243
run_min 170.0 5.079 2.883 0.416 2.601 4.912 7.154 12.881
bins_1s 170.0 204.653 121.410 13.000 99.500 197.500 294.000 540.000
speed_run 170.0 4.977 1.162 2.477 4.207 4.780 5.716 7.967
speed_all 170.0 1.240 0.695 0.131 0.658 1.187 1.823 3.261
zero_spikes 170.0 31.006 0.077 31.000 31.000 31.000 31.000 32.000
n_ca1_pyr 170.0 3.259 0.779 1.000 3.000 3.000 4.000 4.000
n_ca3 170.0 3.729 0.947 1.000 3.000 4.000 4.000 6.000
n_dg 170.0 3.512 1.284 1.000 3.000 4.000 4.000 7.000
clock_m30 170.0 0.052 0.064 -0.084 0.012 0.048 0.080 0.252
clock_0 170.0 0.030 0.177 -0.510 -0.066 0.049 0.161 0.355
clock_p30 170.0 0.037 0.064 -0.099 -0.007 0.025 0.070 0.240
track_swr 170.0 313.406 113.829 70.000 228.000 293.500 371.750 640.000
track_lag 170.0 -0.144 1.142 -1.985 -1.107 -0.180 0.775 1.985
track_lag_ratio 170.0 2.340 2.460 1.013 1.119 1.619 2.086 14.500
seconds 170.0 6.827 1.042 2.477 6.208 6.854 7.520 9.562
maxrss_gb 170.0 0.738 0.028 0.665 0.732 0.742 0.745 0.777
Shortest gap between the starts of two track sessions of one mouse (min):
count 30.0
mean 2.8
std 1.0
min 0.9
25% 2.1
50% 2.8
75% 3.7
max 4.6
Mice with two session starts less than 30 min apart: 30 of 30
Sessions without CA1-pyr, CA3 or DG sites: 0 0 0
LFP starting_time (s) over sessions: [0.0] ; first position timestamp (s): [0.0]
Checks of the data:
- 170 linear track files from 30 mice (8 PV-Cre, 7 SST-Cre, 7 PV-Cre/SST-Cre, 8 empty vector), all on the 4-shank probe, as the paper's cohort 3. Sessions last about 25 min; the Methods say 30 min.
- Every mouse has vehicle sessions first and CNO sessions after them (sequence column); the Methods say the treatments alternated. Treatment is confounded with session order.
- The session start times put the track sessions of each mouse minutes apart (shortest gap above), which cannot be right for 25 min sessions; the start times are wrong.
- The track is about 37 cm long in x (x_range), as the Methods' 36 cm track. Position is at 19.3 Hz.
- LFP values stay within about +-12500 file units on the track. As in the home cage notebook, the unit attribute says microvolts.
# Clock of position against the LFP and the spikes: correlation over 1 s bins of the whole session between speed
# shifted by k s (positive: speed later) and CA1 log theta power, log theta/delta (1-4 Hz) power ratio, and CA1 MUA rate
scan = pd.concat([results[i]["clock_scan"].assign(session=results[i]["meta"]["session_id"]) for i in S.i])
mean_scan = scan.groupby("lag_s")[["theta", "theta_delta", "mua_ca1", "mua_theta"]].mean()
print("Mean correlation over sessions, lags -60 to +60 s (every 5 s, and -3 to +3 s):")
print(mean_scan.loc[sorted(set(range(-60, 61, 5)) | set(range(-3, 4)))].round(3).to_string())
peaks = scan.groupby("session").apply(lambda g: pd.Series({c: g.lag_s.values[np.nanargmax(g[c].values)] for c in ("theta_delta", "theta", "mua_ca1")}))
print("\nLag of each session's maximum correlation (s): sessions within 2 s of zero, of", len(peaks))
for c in ("theta_delta", "theta", "mua_ca1"):
print(f" {c}: {int((peaks[c].abs() <= 2).sum())}; median {peaks[c].median():.0f} s; quartiles {peaks[c].quantile(0.25):.0f} to {peaks[c].quantile(0.75):.0f} s")
z0 = scan[scan.lag_s == 0].set_index("session").theta_delta
far = scan[scan.lag_s.abs() >= 30].groupby("session").theta_delta.mean()
print(f"theta/delta correlation at zero lag: mean {z0.mean():.3f}, positive in {int((z0 > 0).sum())} of {len(z0)} sessions; "
f"mean over |lag| >= 30 s {far.mean():.3f}; zero lag above that in {int((z0 > far.reindex(z0.index)).sum())} sessions")
print("\nSpike clock on the track: CA1 MUA cross-correlogram around SWRs detected in still periods (speed < 1 cm/s), +-2 s")
print(f" sessions with at least 20 SWRs: {int(chk.track_lag.notna().sum())} of {len(chk)}; SWRs per session median {chk.track_swr.median():.0f}")
okl = chk.track_lag_ratio >= J.LAG_MIN_RATIO
print(f" sessions with a peak at least {J.LAG_MIN_RATIO} times the median: {int(okl.sum())}; their lag (s):")
print(chk.track_lag[okl].describe().round(3).to_string())
print(" sessions with |lag| <= 20 ms among them:", int((chk.track_lag[okl].abs() <= 0.02).sum()))
print("Peak memory of the workers (GB):", round(chk.maxrss_gb.max(), 2), "; mean seconds per file:", round(chk.seconds.mean(), 1))
Mean correlation over sessions, lags -60 to +60 s (every 5 s, and -3 to +3 s):
theta theta_delta mua_ca1 mua_theta
lag_s
-60 0.040 0.003 0.005 0.023
-55 0.039 0.006 0.005 0.020
-50 0.044 0.007 0.005 0.029
-45 0.038 0.005 0.007 0.022
-40 0.041 0.007 0.007 0.025
-35 0.043 0.007 0.004 0.028
-30 0.052 0.011 0.008 0.029
-25 0.056 0.015 0.009 0.025
-20 0.049 0.015 0.007 0.028
-15 0.054 0.021 0.008 0.027
-10 0.068 0.033 0.015 0.033
-5 0.058 0.009 0.004 0.034
-3 0.013 0.025 -0.003 0.043
-2 -0.007 0.058 0.007 0.052
-1 -0.002 0.099 0.028 0.058
0 0.030 0.134 0.052 0.067
1 0.073 0.154 0.066 0.050
2 0.105 0.161 0.070 0.045
3 0.125 0.149 0.064 0.044
5 0.118 0.105 0.040 0.039
10 0.047 0.030 0.013 0.045
15 0.046 0.035 0.014 0.036
20 0.041 0.020 0.013 0.037
25 0.034 0.016 0.010 0.031
30 0.037 0.015 0.010 0.036
35 0.033 0.012 0.009 0.028
40 0.036 0.010 0.006 0.030
45 0.033 0.014 0.005 0.030
50 0.035 0.010 0.008 0.029
55 0.031 0.008 0.007 0.026
60 0.033 0.006 0.004 0.031
Lag of each session's maximum correlation (s): sessions within 2 s of zero, of 170
theta_delta: 122; median 0 s; quartiles -1 to 2 s
theta: 69; median 2 s; quartiles -1 to 4 s
mua_ca1: 52; median 2 s; quartiles -3 to 5 s
theta/delta correlation at zero lag: mean 0.134, positive in 141 of 170 sessions; mean over |lag| >= 30 s 0.009; zero lag above that in 141 sessions
Spike clock on the track: CA1 MUA cross-correlogram around SWRs detected in still periods (speed < 1 cm/s), +-2 s
sessions with at least 20 SWRs: 170 of 170; SWRs per session median 294
sessions with a peak at least 3.0 times the median: 24; their lag (s):
count 24.000
mean -0.340
std 0.551
min -1.795
25% -0.515
50% -0.245
75% -0.022
max 0.985
sessions with |lag| <= 20 ms among them: 5
Peak memory of the workers (GB): 0.78 ; mean seconds per file: 6.8
Clock checks. Over 1 s bins of the whole session, the log theta/delta power ratio at the CA1 SWR site correlates with speed at zero lag (mean r = 0.134, positive in 141 of 170 sessions) and hardly with speed shifted by 30 s or more (mean 0.009); 122 of 170 sessions have their maximum within 2 s of zero lag (median 0 s). Theta power alone peaks with speed 2 to 3 s later (mean 0.125 at +3 s against 0.030 at 0 s), consistent with theta rising before running. Every file gives the LFP a starting_time of 0 s and its position timestamps start at 0 s. Position and LFP are therefore consistent with one clock to within about 2 s, the resolution of this check, and the run periods are taken as deposited. CA1 MUA rate also follows speed, with its maximum at +1 to +2 s (mean 0.070 at +2 s), so the spikes are on the position clock to within a few seconds. A finer spike-clock check, CA1 MUA around SWRs in still periods of the track, gives a clear peak in only 24 of 170 sessions (median lag -0.245 s, 5 within 20 ms), so the sub-second spike offset on the track is not established for most sessions; run MUA (fig5b) is a rate over 100 ms bins wholly in run, which such an offset changes only at the edges of run periods.
GROUPS = ("PV", "SST", "PS", "EV")
PAIRS = (("PV", "SST"), ("PV", "PS"), ("SST", "PS"))
t0 = time.time()
TAB = J.build_tables(results, S, {**J.RUN_FEATURES, **{k: g for k, (_, g) in J.RUN_VARIANTS.items()}})
res = J.test_all(TAB, groups=GROUPS, pairs=PAIRS)
counter = {k: m for k, (m, _) in J.RUN_VARIANTS.items()}
res = J.add_decisions(res, J.RUN_FAMILY, list(J.RUN_FEATURES), counter)
print(f"Run comparisons: {len(J.RUN_FEATURES)} features (the paper's {J.RUN_FAMILY}); tests run: {len(res)} ({time.time() - t0:.0f} s)")
print("Observations per feature:", {k: len(v) for k, v in TAB.items()})
print(res[(res.reading == "a") & res.feature.isin(list(J.RUN_FEATURES))].pivot_table(index="feature", columns="test", values="p", aggfunc="first").map(lambda v: f"{v:.2g}").to_string())
def part_table(parts, r=None):
t = J.show_parts(res if r is None else r, parts)
print(t.to_string(index=False, float_format=lambda v: f"{v:.3g}"))
Run comparisons: 36 features (the paper's 36); tests run: 660 (510 s)
Observations per feature: {'mua_ca1': 499153, 'theta_pow_ca1': 34791, 'theta_freq_ca1': 1385390, 'sg_pow_ca1': 34791, 'sg_freq_ca1': 6467401, 'fg_pow_ca1': 34791, 'fg_freq_ca1': 13038540, 'sgfg_ca1': 34791, 'sg_mi_ca1': 34791, 'fg_mi_ca1': 34791, 'mua_ca3': 499153, 'theta_pow_ca3': 34791, 'theta_freq_ca3': 1623105, 'sg_pow_ca3': 34791, 'sg_freq_ca3': 7204176, 'fg_pow_ca3': 34791, 'fg_freq_ca3': 14886147, 'sgfg_ca3': 34791, 'sg_mi_ca3': 34791, 'fg_mi_ca3': 34791, 'mua_dg': 499153, 'theta_pow_dg': 34791, 'theta_freq_dg': 1475290, 'sg_pow_dg': 34791, 'sg_freq_dg': 6596960, 'fg_pow_dg': 34791, 'fg_freq_dg': 13387087, 'sgfg_dg': 34791, 'sg_mi_dg': 34791, 'fg_mi_dg': 34791, 'theta_coh_ca3': 34791, 'sg_coh_ca3': 34791, 'fg_coh_ca3': 34791, 'theta_coh_dg': 34791, 'sg_coh_dg': 34791, 'fg_coh_dg': 34791, 'theta_freq1_ca1': 420955, 'sg_freq1_ca1': 1976394, 'fg_freq1_ca1': 3933132, 'mua_ca1_aligned': 57190, 'theta_freq1_ca3': 423584, 'sg_freq1_ca3': 1884448, 'fg_freq1_ca3': 3903724, 'mua_ca3_aligned': 57190, 'theta_freq1_dg': 429581, 'sg_freq1_dg': 1931022, 'fg_freq1_dg': 3898446, 'mua_dg_aligned': 57190}
test EV PS PV PV vs PS PV vs SST SST SST vs PS
feature
fg_coh_ca3 0.15 0.39 0.36 0.061 0.61 0.2 0.29
fg_coh_dg 0.98 0.64 0.5 0.21 0.86 0.23 0.55
fg_freq_ca1 0.16 0.72 0.7 1 0.95 0.013 0.11
fg_freq_ca3 0.0041 8.5e-07 0.3 0.77 0.91 1.4e-08 0.33
fg_freq_dg 4.5e-10 1.8e-08 0.032 0.78 1 2.2e-11 0.27
fg_mi_ca1 0.07 0.92 0.067 0.35 0.15 0.085 0.41
fg_mi_ca3 0.12 0.00024 0.0098 0.16 0.029 0.065 0.94
fg_mi_dg 5.5e-07 0.0014 2.1e-06 0.15 0.17 0.078 0.96
fg_pow_ca1 0.28 0.81 0.48 0.47 0.54 0.08 0.98
fg_pow_ca3 0.58 3.1e-06 0.2 0.018 0.11 0.0012 0.93
fg_pow_dg 7.8e-05 5.1e-05 0.0099 0.65 0.69 1.1e-05 0.98
mua_ca1 0.45 0.07 0.14 0.75 0.23 0.046 0.078
mua_ca3 0.16 6.9e-05 0.089 0.2 1 0.82 0.18
mua_dg 0.34 0.3 0.15 0.0016 0.82 0.53 0.0001
sg_coh_ca3 0.73 0.0047 0.0023 0.42 0.094 0.12 0.36
sg_coh_dg 0.094 0.017 0.00011 0.32 0.18 0.22 0.62
sg_freq_ca1 0.51 0.063 0.43 1 0.11 0.48 0.13
sg_freq_ca3 0.88 0.58 0.0087 1 1 0.75 0.011
sg_freq_dg 0.64 0.4 0.033 0.92 0.95 0.3 1
sg_mi_ca1 0.021 0.16 0.11 0.21 0.24 0.56 0.92
sg_mi_ca3 0.92 0.0053 0.018 0.6 0.51 0.18 0.11
sg_mi_dg 1.5e-06 3.3e-05 0.00098 0.52 0.51 0.58 0.6
sg_pow_ca1 0.89 0.76 0.71 0.5 0.19 0.028 0.6
sg_pow_ca3 0.088 0.34 0.84 0.91 0.45 0.00064 0.76
sg_pow_dg 2e-14 0.047 0.46 0.93 0.44 1.2e-06 0.5
sgfg_ca1 0.44 0.28 0.32 0.59 0.17 0.14 0.28
sgfg_ca3 0.042 0.63 0.00055 0.24 0.04 0.099 0.044
sgfg_dg 0.0089 0.44 0.00087 0.49 0.051 0.54 0.11
theta_coh_ca3 0.6 0.52 0.47 0.75 0.046 0.015 0.016
theta_coh_dg 0.0014 0.024 0.029 0.84 0.3 0.26 0.038
theta_freq_ca1 0.013 0.0044 0.0086 0.88 0.6 0.55 1
theta_freq_ca3 0.047 0.1 0.0071 0.65 0.072 0.19 0.92
theta_freq_dg 3.7e-05 0.025 0.00049 0.98 0.46 0.14 0.97
theta_pow_ca1 0.32 0.15 0.34 0.26 0.32 0.8 0.39
theta_pow_ca3 0.00073 0.024 0.042 0.003 0.13 0.061 0.012
theta_pow_dg 6.4e-08 0.0019 0.0019 0.0013 0.5 0.0015 0.0046
running-speed-unchanged¶
Running speed does not differ between vehicle and CNO sessions (4.8 against 5.1 cm/s).
Paired t test across the track mice of each mouse's mean speed per treatment (mean over sessions). Readings: (a) smoothed speed over run (above 1 cm/s); (b) over the whole session.
D = pd.DataFrame([dict(animal=a, group=g, cno=int(tr == "CNO"), run=results[i]["speed_run"], whole=results[i]["speed_all"])
for i, a, g, tr in zip(S.i, S.animal, S.group, S.treatment)])
for col, name in (("run", "(a) run periods"), ("whole", "(b) whole session")):
m = D.groupby(["animal", "cno"])[col].mean().unstack().dropna()
tt = stats.ttest_rel(m[1], m[0])
print(f"{name}: {len(m)} mice, vehicle {m[0].mean():.2f} cm/s, CNO {m[1].mean():.2f} cm/s, "
f"t({len(m) - 1}) = {tt.statistic:.2f}, p = {tt.pvalue:.3g}; "
f"within tolerance: {abs(m[0].mean() - 4.8) <= 0.48 and abs(m[1].mean() - 5.1) <= 0.51}")
print("Range of mouse means (a):", round(D.run.min(), 2), "to", round(D.run.max(), 2), "cm/s")
(a) run periods: 30 mice, vehicle 4.70 cm/s, CNO 5.24 cm/s, t(29) = 2.69, p = 0.0116; within tolerance: True (b) whole session: 30 mice, vehicle 0.96 cm/s, CNO 1.51 cm/s, t(29) = 5.40, p = 8.45e-06; within tolerance: False Range of mouse means (a): 2.48 to 7.97 cm/s
Result: not reproduced. Running speed during run is 4.70 cm/s on vehicle days and 5.24 cm/s on CNO days, both within tolerance of 4.8 and 5.1, but the paired t test across 30 mice is significant (t(29) = 2.69, p = 0.012), where the paper found p = 0.2. Over the whole session the difference is larger (0.96 against 1.51 cm/s, p = 8.4e-06). With vehicle days always first, this can be an effect of practice.
fig5b-mua-run¶
During movement, suppressing either class increases MUA in DG and CA3 but not in CA1.
MUA rate in 100 ms bins wholly in run, at each region's MUA site. Reading (a) logs right-skewed features; (b) logs all.
part_table([("mua_ca1", "PV", "ns"), ("mua_ca1", "SST", "ns"), ("mua_ca3", "PV", "up"), ("mua_ca3", "SST", "up"),
("mua_dg", "PV", "up"), ("mua_dg", "SST", "up")])
print("\nVariant: spike times shifted by the session's track spike-clock lag (sessions with a clear peak only):")
part_table([("mua_ca1_aligned", "PV", "ns"), ("mua_ca1_aligned", "SST", "ns"), ("mua_ca3_aligned", "PV", "up"), ("mua_ca3_aligned", "SST", "up"),
("mua_dg_aligned", "PV", "up"), ("mua_dg_aligned", "SST", "up")])
print("Mice with shifted spike times, by group and treatment (0 vehicle, 1 CNO); a test needs 2 or more mice and both treatments:")
print(TAB["mua_ca1_aligned"].groupby(["group", "cno"]).animal.nunique().unstack(fill_value=0).to_string())
feature test expected reading log coef stat p significant holds animals n
mua_ca1 PV ns a False -30.6 2.21 0.137 False True 8 89537
mua_ca1 PV ns b True -2.08 6.31 0.012 False True 8 89537
mua_ca1 SST ns a False -16.8 3.97 0.0463 False True 7 139632
mua_ca1 SST ns b True -2.96 15.5 8.16e-05 True False 7 139632
mua_ca3 PV up a False -29.4 2.9 0.0885 False False 8 89537
mua_ca3 PV up b True -1.31 2.22 0.136 False False 8 89537
mua_ca3 SST up a False -5.29 0.0494 0.824 False False 7 139632
mua_ca3 SST up b True 0.279 0.0479 0.827 False False 7 139632
mua_dg PV up a False -26.1 2.08 0.149 False False 8 89537
mua_dg PV up b True -1.26 1.61 0.204 False False 8 89537
mua_dg SST up a False -11.9 0.391 0.532 False False 7 139632
mua_dg SST up b True -0.746 0.48 0.488 False False 7 139632
Variant: spike times shifted by the session's track spike-clock lag (sessions with a clear peak only):
feature test expected reading holds
mua_ca1_aligned PV ns a None
mua_ca1_aligned PV ns b None
mua_ca1_aligned SST ns a None
mua_ca1_aligned SST ns b None
mua_ca3_aligned PV up a None
mua_ca3_aligned PV up b None
mua_ca3_aligned SST up a None
mua_ca3_aligned SST up b None
mua_dg_aligned PV up a None
mua_dg_aligned PV up b None
mua_dg_aligned SST up a None
mua_dg_aligned SST up b None
Mice with shifted spike times, by group and treatment (0 vehicle, 1 CNO); a test needs 2 or more mice and both treatments:
cno 0 1
group
EV 4 1
PS 3 1
PV 2 0
SST 0 2
Result: not reproduced. MUA during run does not change in CA1 (p = 0.14 and 0.046, not significant after correction) and does not increase in CA3 or DG in either genotype; all four CA3 and DG coefficients are negative (p from 0.09 to 0.82). Reading (b) gives the same CA3 and DG result and makes the SST-Cre CA1 decrease significant. The variant with spike times shifted by the track lag gives no test: only 24 of 170 sessions have a clear lag, and the PV-Cre mice have such sessions only under vehicle (2 mice) and the SST-Cre mice only under CNO (2 mice), so neither group can be tested.
fig5d-sg-power-run¶
During movement, suppressing PV+ interneurons amplifies SG power in CA1 with no effect in DG and CA3, while suppressing SST+ interneurons dampens SG power in DG and CA3 with no effect in CA1; all these effects differ between genotypes.
part_table([("sg_pow_ca1", "PV", "up"), ("sg_pow_ca3", "PV", "ns"), ("sg_pow_dg", "PV", "ns"),
("sg_pow_ca1", "SST", "ns"), ("sg_pow_ca3", "SST", "down"), ("sg_pow_dg", "SST", "down"),
("sg_pow_ca1", "PV vs SST", "sig"), ("sg_pow_ca3", "PV vs SST", "sig"), ("sg_pow_dg", "PV vs SST", "sig")])
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 sg_pow_ca1 PV up a True -0.102 0.136 0.712 False False 8 6133 NaN NaN sg_pow_ca1 PV up b True -0.102 0.136 0.712 False False 8 6133 NaN NaN sg_pow_ca3 PV ns a True -0.0368 0.0425 0.837 False True 8 6133 NaN NaN sg_pow_ca3 PV ns b True -0.0368 0.0425 0.837 False True 8 6133 NaN NaN sg_pow_dg PV ns a True -0.0961 0.538 0.463 False True 8 6133 NaN NaN sg_pow_dg PV ns b True -0.0961 0.538 0.463 False True 8 6133 NaN NaN sg_pow_ca1 SST ns a True -0.332 4.85 0.0277 False True 7 9828 NaN NaN sg_pow_ca1 SST ns b True -0.332 4.85 0.0277 False True 7 9828 NaN NaN sg_pow_ca3 SST down a True -0.258 11.7 0.000642 True True 7 9828 NaN NaN sg_pow_ca3 SST down b True -0.258 11.7 0.000642 True True 7 9828 NaN NaN sg_pow_dg SST down a True -0.251 23.6 1.23e-06 True True 7 9828 NaN NaN sg_pow_dg SST down b True -0.251 23.6 1.23e-06 True True 7 9828 NaN NaN sg_pow_ca1 PV vs SST sig a True -0.23 12.4 0.191 False False 15 15961 0.0296 False sg_pow_ca1 PV vs SST sig b True -0.23 12.4 0.191 False False 15 15961 0.0296 False sg_pow_ca3 PV vs SST sig a True -0.221 8.86 0.45 False False 15 15961 0.115 False sg_pow_ca3 PV vs SST sig b True -0.221 8.86 0.45 False False 15 15961 0.115 False sg_pow_dg PV vs SST sig a True -0.155 8.97 0.44 False False 15 15961 0.11 False sg_pow_dg PV vs SST sig b True -0.155 8.97 0.44 False False 15 15961 0.11 False
Result: not reproduced. SST+ suppression dampens SG power in CA3 (p = 0.00064) and DG (p = 1.2e-06) and leaves CA1 unchanged (p = 0.028, not significant after correction), and PV+ suppression leaves CA3 and DG unchanged, as claimed. But PV+ suppression does not amplify SG power in CA1 (coefficient -0.10, p = 0.71), and no genotype test is significant (p = 0.19, 0.45, 0.44). Five of nine parts hold; the partial rule needs the CA1 PV-Cre increase.
fig5e-sg-coherence-run¶
During movement, suppressing PV+ interneurons enhances SG coherence between CA1 and CA3.
Readings of the bins: (a) coherence per 1 s bin (the main table); (b) one coherence per session over all run, tested with the same LMM on session values.
part_table([("sg_coh_ca3", "PV", "up")])
print("\nReported: SST-Cre and genotype test")
part_table([("sg_coh_ca3", "SST", "ns"), ("sg_coh_ca3", "PV vs SST", "ns")])
SESS = {}
for k in ("theta_coh_ca3", "sg_coh_ca3", "fg_coh_ca3", "theta_coh_dg", "sg_coh_dg", "fg_coh_dg"):
SESS[k] = J.long_table(results, S, lambda r, k=k: [r["coh_session"].get(k, np.nan)])
res_sess = J.add_decisions(J.test_all(SESS, groups=("PV", "SST"), pairs=(("PV", "SST"),)), J.RUN_FAMILY, list(SESS))
print("\nReading (b), session coherence (decisions with these six as the computed family):")
part_table([("sg_coh_ca3", "PV", "up"), ("sg_coh_ca3", "SST", "ns")], res_sess)
feature test expected reading log coef stat p significant holds animals n sg_coh_ca3 PV up a False -0.0336 9.26 0.00235 False False 8 6133 sg_coh_ca3 PV up b True -0.0583 10.5 0.00119 True False 8 6133 Reported: SST-Cre and genotype test feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 sg_coh_ca3 SST ns a False 0.0381 2.36 0.125 False True 7 9828 NaN NaN sg_coh_ca3 SST ns b True 0.0657 2.22 0.136 False True 7 9828 NaN NaN sg_coh_ca3 PV vs SST ns a False 0.0716 14.9 0.0944 False True 15 15961 0.0109 False sg_coh_ca3 PV vs SST ns b True 0.124 13.8 0.131 False True 15 15961 0.0171 False
Reading (b), session coherence (decisions with these six as the computed family): feature test expected reading log coef stat p significant holds animals n sg_coh_ca3 PV up a False -0.0771 16.1 0.000238 True False 8 45 sg_coh_ca3 PV up b True -0.233 13.5 0.000659 True False 8 45 sg_coh_ca3 SST ns a False 0.0718 3.21 0.0813 False True 7 40 sg_coh_ca3 SST ns b True 0.157 2.84 0.1 False True 7 40
Result: not reproduced. SG coherence between CA1 and CA3 decreases with PV+ suppression (per 1 s bin -0.034, p = 0.0024, not significant after Holm untransformed and significant logged; over the session -0.077, p = 0.00024). The claim is an increase.
fig5f-sg-frequency-pv¶
Suppressing PV+, but not SST+, interneurons reduces SG frequency during movement in CA1, CA3 and DG, and the genotypes differ.
part_table([("sg_freq_ca1", "PV", "down"), ("sg_freq_ca3", "PV", "down"), ("sg_freq_dg", "PV", "down"),
("sg_freq_ca1", "SST", "ns"), ("sg_freq_ca3", "SST", "ns"), ("sg_freq_dg", "SST", "ns")])
print("\nGenotype tests, reported:")
part_table([("sg_freq_ca1", "PV vs SST", "sig"), ("sg_freq_ca3", "PV vs SST", "sig"), ("sg_freq_dg", "PV vs SST", "sig")])
print("\nVariant (b): one site per region:")
part_table([("sg_freq1_ca1", "PV", "down"), ("sg_freq1_ca3", "PV", "down"), ("sg_freq1_dg", "PV", "down"),
("sg_freq1_ca1", "SST", "ns"), ("sg_freq1_ca3", "SST", "ns"), ("sg_freq1_dg", "SST", "ns")])
print("\nMice per region with frequency values (pooled reading):",
{f: TAB[f].groupby("group").animal.nunique().to_dict() for f in ("sg_freq_ca1", "sg_freq_ca3", "sg_freq_dg")})
feature test expected reading log coef stat p significant holds animals n
sg_freq_ca1 PV down a True -0.0124 0.61 0.435 False False 8 980169
sg_freq_ca1 PV down b True -0.0124 0.61 0.435 False False 8 980169
sg_freq_ca3 PV down a True -0.0341 6.89 0.00869 False False 8 1206877
sg_freq_ca3 PV down b True -0.0341 6.89 0.00869 False False 8 1206877
sg_freq_dg PV down a True -0.0273 4.55 0.0329 False False 8 1237469
sg_freq_dg PV down b True -0.0273 4.55 0.0329 False False 8 1237469
sg_freq_ca1 SST ns a True -0.00326 0.497 0.481 False True 7 1950187
sg_freq_ca1 SST ns b True -0.00326 0.497 0.481 False True 7 1950187
sg_freq_ca3 SST ns a True -0.00133 0.105 0.746 False True 7 1809136
sg_freq_ca3 SST ns b True -0.00133 0.105 0.746 False True 7 1809136
sg_freq_dg SST ns a True -0.00216 1.09 0.297 False True 7 1881565
sg_freq_dg SST ns b True -0.00216 1.09 0.297 False True 7 1881565
Genotype tests, reported:
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5
sg_freq_ca1 PV vs SST sig a True 0.00928 14.5 0.106 False False 15 2930356 0.0128 False
sg_freq_ca1 PV vs SST sig b True 0.00928 14.5 0.106 False False 15 2930356 0.0128 False
sg_freq_ca3 PV vs SST sig a True 0.0327 1.35 0.998 False False 15 3016013 0.929 False
sg_freq_ca3 PV vs SST sig b True 0.0327 1.35 0.998 False False 15 3016013 0.929 False
sg_freq_dg PV vs SST sig a True 0.0249 3.36 0.948 False False 15 3119034 0.645 False
sg_freq_dg PV vs SST sig b True 0.0249 3.36 0.948 False False 15 3119034 0.645 False
Variant (b): one site per region:
feature test expected reading log coef stat p significant holds animals n
sg_freq1_ca1 PV down a True -0.0137 1.1 0.295 False False 8 347369
sg_freq1_ca1 PV down b True -0.0137 1.1 0.295 False False 8 347369
sg_freq1_ca3 PV down a True -0.0259 10.9 0.000985 True True 8 327694
sg_freq1_ca3 PV down b True -0.0259 10.9 0.000985 True True 8 327694
sg_freq1_dg PV down a True -0.012 2.31 0.128 False False 8 337731
sg_freq1_dg PV down b True -0.012 2.31 0.128 False False 8 337731
sg_freq1_ca1 SST ns a True -0.00864 0.457 0.499 False True 7 561867
sg_freq1_ca1 SST ns b True -0.00864 0.457 0.499 False True 7 561867
sg_freq1_ca3 SST ns a True -0.00255 0.231 0.631 False True 7 542543
sg_freq1_ca3 SST ns b True -0.00255 0.231 0.631 False True 7 542543
sg_freq1_dg SST ns a True 0.00603 2.54 0.111 False True 7 553149
sg_freq1_dg SST ns b True 0.00603 2.54 0.111 False True 7 553149
Mice per region with frequency values (pooled reading): {'sg_freq_ca1': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}, 'sg_freq_ca3': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}, 'sg_freq_dg': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}}
Result: not reproduced. With peaks pooled over the sites of each region (the main reading), PV+ suppression lowers SG frequency in CA3 (p = 0.0087) and DG (p = 0.033), neither passing Holm, and not in CA1 (p = 0.44); SST+ suppression changes it nowhere (p from 0.30 to 0.75). With one site per region (variant b) the PV-Cre CA3 decrease is significant (p = 0.00099), CA1 (p = 0.30) and DG (p = 0.13) are not. The partial rule needs the CA1 decrease under either reading. No genotype test is significant (p from 0.11 to 0.998; with 5 degrees of freedom from 0.013 to 0.93). Refitted to the likelihood maximum (fit check below), the PV-Cre decreases in CA3 (p = 0.00066) and DG (p = 0.0015) pass Holm and the DG genotype test passes with 5 degrees of freedom (p = 0.00019), but CA1 still does not change (p = 0.14), so the outcome is the same. All 8 PV-Cre and 7 SST-Cre mice have frequency values in every region.
fig5g-sg-theta-modulation¶
Suppressing PV+ interneurons increases theta modulation of SG locally in DG and CA3 but not in CA1, while suppressing SST+ interneurons reduces theta modulation of SG in CA1, and these effects differ between genotypes.
part_table([("sg_mi_ca3", "PV", "up"), ("sg_mi_dg", "PV", "up"), ("sg_mi_ca1", "SST", "down"), ("sg_mi_ca1", "PV", "ns"),
("sg_mi_ca3", "PV vs SST", "sig"), ("sg_mi_dg", "PV vs SST", "sig")])
print("\nCA1 genotype test, reported:")
part_table([("sg_mi_ca1", "PV vs SST", "ns")])
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 sg_mi_ca3 PV up a True -0.135 5.61 0.0178 False False 8 6133 NaN NaN sg_mi_ca3 PV up b True -0.135 5.61 0.0178 False False 8 6133 NaN NaN sg_mi_dg PV up a True -0.155 10.9 0.000985 True False 8 6133 NaN NaN sg_mi_dg PV up b True -0.155 10.9 0.000985 True False 8 6133 NaN NaN sg_mi_ca1 SST down a True 0.0245 0.344 0.558 False False 7 9828 NaN NaN sg_mi_ca1 SST down b True 0.0245 0.344 0.558 False False 7 9828 NaN NaN sg_mi_ca1 PV ns a True -0.108 2.56 0.11 False True 8 6133 NaN NaN sg_mi_ca1 PV ns b True -0.108 2.56 0.11 False True 8 6133 NaN NaN sg_mi_ca3 PV vs SST sig a True 0.095 8.24 0.51 False False 15 15961 0.143 False sg_mi_ca3 PV vs SST sig b True 0.095 8.24 0.51 False False 15 15961 0.143 False sg_mi_dg PV vs SST sig a True 0.133 8.25 0.509 False False 15 15961 0.143 False sg_mi_dg PV vs SST sig b True 0.133 8.25 0.509 False False 15 15961 0.143 False CA1 genotype test, reported: feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 sg_mi_ca1 PV vs SST ns a True 0.131 11.6 0.235 False True 15 15961 0.0403 False sg_mi_ca1 PV vs SST ns b True 0.131 11.6 0.235 False True 15 15961 0.0403 False
Result: not reproduced. Theta modulation of SG decreases with PV+ suppression in CA3 (p = 0.018) and DG (p = 0.00099, significant), the opposite of the claim, and does not decrease in CA1 with SST+ suppression (coefficient +0.02, p = 0.56). The PV-Cre CA1 effect is not significant (p = 0.11), as claimed, and the CA3 and DG genotype tests are not (p = 0.51 and 0.51).
fig6b-fg-power-sst¶
Suppressing SST+ interneurons amplifies FG power in CA1 and DG during movement, an effect specific to this class.
part_table([("fg_pow_ca1", "SST", "up"), ("fg_pow_dg", "SST", "up"), ("fg_pow_ca1", "PV", "ns"), ("fg_pow_dg", "PV", "ns"),
("fg_pow_ca1", "PV vs SST", "sig"), ("fg_pow_dg", "PV vs SST", "sig")])
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 fg_pow_ca1 SST up a True -0.223 3.06 0.0804 False False 7 9828 NaN NaN fg_pow_ca1 SST up b True -0.223 3.06 0.0804 False False 7 9828 NaN NaN fg_pow_dg SST up a True -0.243 19.3 1.13e-05 True False 7 9828 NaN NaN fg_pow_dg SST up b True -0.243 19.3 1.13e-05 True False 7 9828 NaN NaN fg_pow_ca1 PV ns a True -0.181 0.495 0.482 False True 8 6133 NaN NaN fg_pow_ca1 PV ns b True -0.181 0.495 0.482 False True 8 6133 NaN NaN fg_pow_dg PV ns a True -0.277 6.65 0.00993 False True 8 6133 NaN NaN fg_pow_dg PV ns b True -0.277 6.65 0.00993 False True 8 6133 NaN NaN fg_pow_ca1 PV vs SST sig a True -0.0425 7.94 0.54 False False 15 15961 0.16 False fg_pow_ca1 PV vs SST sig b True -0.0425 7.94 0.54 False False 15 15961 0.16 False fg_pow_dg PV vs SST sig a True 0.0345 6.51 0.688 False False 15 15961 0.26 False fg_pow_dg PV vs SST sig b True 0.0345 6.51 0.688 False False 15 15961 0.26 False
Result: not reproduced. FG power does not rise with SST+ suppression: it falls in CA1 (p = 0.080) and falls significantly in DG (p = 1.1e-05). PV-Cre effects are not significant (p = 0.48 and 0.0099 in CA1 and DG), and neither genotype test is (p = 0.54 and 0.69).
figs4e-sg-fg-inverse¶
In DG and CA3 of SST-Cre mice, the CNO-induced change in SG power predicts the change in FG power, animals with the greatest SG suppression showing the greatest FG enhancement.
Per SST-Cre mouse, CNO minus vehicle; (a) difference of the mouse's means (log scale where the feature is logged under reading (a) of the log transform, and raw); (b) difference of the LMM fitted conditional responses. Pearson correlation across mice. Expected R2 0.81 (CA3) and 0.84 (DG), tolerance 10%.
rows = []
for reg in ("ca3", "dg"):
for scale in ("raw", "log"):
dsg, dfg = TAB[f"sg_pow_{reg}"].copy(), TAB[f"fg_pow_{reg}"].copy()
if scale == "log":
dsg["value"], dfg["value"] = J.log_values(dsg.value), J.log_values(dfg.value)
for reading, fn in (("a mean difference", J.mean_changes), ("b LMM conditional", J.blup_changes)):
x, y = fn(dsg, "SST"), fn(dfg, "SST")
x, y = x.align(y, join="inner")
r, p = stats.pearsonr(x, y)
rows.append(dict(region=reg, scale=scale, reading=reading, mice=len(x), r=r, R2=r * r, p=p,
sg_change_range=f"{x.min():.3g} to {x.max():.3g}", fg_change_range=f"{y.min():.3g} to {y.max():.3g}"))
print(pd.DataFrame(rows).to_string(index=False, float_format=lambda v: f"{v:.3g}"))
region scale reading mice r R2 p sg_change_range fg_change_range
ca3 raw a mean difference 7 0.919 0.845 0.00339 -210 to 1.31 -34.8 to 2.57
ca3 raw b LMM conditional 7 0.918 0.842 0.00359 -202 to -0.776 -34.3 to 2.35
ca3 log a mean difference 7 0.833 0.694 0.0199 -0.673 to 0.059 -0.46 to 0.0619
ca3 log b LMM conditional 7 0.832 0.692 0.0203 -0.661 to 0.0535 -0.454 to 0.0584
dg raw a mean difference 7 0.81 0.655 0.0274 -359 to -28.5 -86.5 to -0.778
dg raw b LMM conditional 7 0.808 0.653 0.0278 -355 to -32.3 -86.4 to -1.53
dg log a mean difference 7 0.667 0.445 0.102 -0.477 to -0.0649 -0.391 to 0.00828
dg log b LMM conditional 7 0.672 0.451 0.0983 -0.464 to -0.0722 -0.389 to 0.0042
Result: not reproduced. Across the 7 SST-Cre mice the CNO-induced changes in SG and FG power are positively correlated, not negatively: in CA3 r = 0.92 (raw mean differences, p = 0.0034; logged r = 0.83, p = 0.020) and in DG r = 0.81 (p = 0.027; logged r = 0.67, p = 0.10). Both readings of a mouse's change give the same values. The mice with the largest SG decrease have the largest FG decrease.
fig6e-sg-fg-ratio¶
SST+ suppression decreases the SG/FG power ratio in CA1, PV+ suppression increases it throughout the hippocampus, and these effects differ between genotypes across the hippocampus.
part_table([("sgfg_ca1", "SST", "down"), ("sgfg_ca1", "PV", "up"), ("sgfg_ca3", "PV", "up"), ("sgfg_dg", "PV", "up"),
("sgfg_ca1", "PV vs SST", "sig"), ("sgfg_ca3", "PV vs SST", "sig"), ("sgfg_dg", "PV vs SST", "sig")])
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 sgfg_ca1 SST down a True -0.101 2.22 0.137 False False 7 9828 NaN NaN sgfg_ca1 SST down b True -0.101 2.22 0.137 False False 7 9828 NaN NaN sgfg_ca1 PV up a True 0.0952 1.01 0.315 False False 8 6133 NaN NaN sgfg_ca1 PV up b True 0.0952 1.01 0.315 False False 8 6133 NaN NaN sgfg_ca3 PV up a True 0.216 11.9 0.000554 True True 8 6133 NaN NaN sgfg_ca3 PV up b True 0.216 11.9 0.000554 True True 8 6133 NaN NaN sgfg_dg PV up a True 0.198 11.1 0.000869 True True 8 6133 NaN NaN sgfg_dg PV up b True 0.198 11.1 0.000869 True True 8 6133 NaN NaN sgfg_ca1 PV vs SST sig a True -0.196 12.9 0.166 False False 15 15961 0.0242 False sgfg_ca1 PV vs SST sig b True -0.196 12.9 0.166 False False 15 15961 0.0242 False sgfg_ca3 PV vs SST sig a True -0.283 17.6 0.0402 False False 15 15961 0.0035 False sgfg_ca3 PV vs SST sig b True -0.283 17.6 0.0402 False False 15 15961 0.0035 False sgfg_dg PV vs SST sig a True -0.222 16.8 0.0512 False False 15 15961 0.0048 False sgfg_dg PV vs SST sig b True -0.222 16.8 0.0512 False False 15 15961 0.0048 False
Result: not reproduced. PV+ suppression raises the SG/FG ratio in CA3 (p = 0.00055) and DG (p = 0.00087), as claimed, but not in CA1 (p = 0.32), and SST+ suppression does not lower it in CA1 (p = 0.14). No genotype test is significant (p = 0.17, 0.040 and 0.051). The partial rule needs the CA1 parts.
fig6f-fg-coherence-unchanged¶
FG coherence between CA1 and CA3 and between CA1 and DG does not change with either suppression.
part_table([("fg_coh_ca3", "PV", "ns"), ("fg_coh_ca3", "SST", "ns"), ("fg_coh_dg", "PV", "ns"), ("fg_coh_dg", "SST", "ns")])
print("\nReading (b), session coherence:")
part_table([("fg_coh_ca3", "PV", "ns"), ("fg_coh_ca3", "SST", "ns"), ("fg_coh_dg", "PV", "ns"), ("fg_coh_dg", "SST", "ns")], res_sess)
feature test expected reading log coef stat p significant holds animals n fg_coh_ca3 PV ns a False -0.0207 0.833 0.361 False True 8 6133 fg_coh_ca3 PV ns b True -0.0369 0.818 0.366 False True 8 6133 fg_coh_ca3 SST ns a False 0.0315 1.65 0.2 False True 7 9828 fg_coh_ca3 SST ns b True 0.0561 1.47 0.226 False True 7 9828 fg_coh_dg PV ns a False -0.017 0.457 0.499 False True 8 6133 fg_coh_dg PV ns b True -0.0253 0.31 0.578 False True 8 6133 fg_coh_dg SST ns a False 0.0309 1.42 0.234 False True 7 9828 fg_coh_dg SST ns b True 0.0547 1.29 0.256 False True 7 9828 Reading (b), session coherence: feature test expected reading log coef stat p significant holds animals n fg_coh_ca3 PV ns a False -0.0249 0.425 0.518 False True 8 45 fg_coh_ca3 PV ns b True -0.0976 0.703 0.406 False True 8 45 fg_coh_ca3 SST ns a False 0.0629 1.5 0.229 False True 7 40 fg_coh_ca3 SST ns b True 0.153 0.924 0.342 False True 7 40 fg_coh_dg PV ns a False -0.00512 0.0148 0.904 False True 8 45 fg_coh_dg PV ns b True 0.017 0.0197 0.889 False True 8 45 fg_coh_dg SST ns a False 0.0628 1.35 0.252 False True 7 40 fg_coh_dg SST ns b True 0.158 0.922 0.343 False True 7 40
Result: reproduced. FG coherence does not change between CA1 and CA3 or CA1 and DG with either suppression: per 1 s bin p from 0.20 to 0.50, and over each session p from 0.23 to 0.90, with both log readings. The coefficients are -0.02 to +0.03.
fig6g-fg-frequency-sst¶
Suppressing SST+ interneurons increases FG frequency throughout the hippocampus.
part_table([("fg_freq_ca1", "SST", "up"), ("fg_freq_ca3", "SST", "up"), ("fg_freq_dg", "SST", "up")])
print("\nVariant (b): one site per region:")
part_table([("fg_freq1_ca1", "SST", "up"), ("fg_freq1_ca3", "SST", "up"), ("fg_freq1_dg", "SST", "up")])
print("\nMice per region with frequency values (pooled reading):",
{f: TAB[f].groupby("group").animal.nunique().to_dict() for f in ("fg_freq_ca1", "fg_freq_ca3", "fg_freq_dg")})
feature test expected reading log coef stat p significant holds animals n
fg_freq_ca1 SST up a True 0.0161 6.17 0.013 False False 7 3870968
fg_freq_ca1 SST up b True 0.0161 6.17 0.013 False False 7 3870968
fg_freq_ca3 SST up a True 0.03 32.2 1.36e-08 True True 7 3597659
fg_freq_ca3 SST up b True 0.03 32.2 1.36e-08 True True 7 3597659
fg_freq_dg SST up a True 0.0295 44.8 2.17e-11 True True 7 3714052
fg_freq_dg SST up b True 0.0295 44.8 2.17e-11 True True 7 3714052
Variant (b): one site per region:
feature test expected reading log coef stat p significant holds animals n
fg_freq1_ca1 SST up a True 0.00475 0.0599 0.807 False False 7 1104034
fg_freq1_ca1 SST up b True 0.00475 0.0599 0.807 False False 7 1104034
fg_freq1_ca3 SST up a True 0.0309 1.39 0.239 False False 7 1090042
fg_freq1_ca3 SST up b True 0.0309 1.39 0.239 False False 7 1090042
fg_freq1_dg SST up a True 0.0285 31.4 2.15e-08 True True 7 1090661
fg_freq1_dg SST up b True 0.0285 31.4 2.15e-08 True True 7 1090661
Mice per region with frequency values (pooled reading): {'fg_freq_ca1': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}, 'fg_freq_ca3': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}, 'fg_freq_dg': {'EV': 8, 'PS': 7, 'PV': 8, 'SST': 7}}
Result: partially reproduced. With peaks pooled over each region's sites, FG frequency rises with SST+ suppression in CA3 (p = 1.4e-08) and DG (p = 2.2e-11) but not significantly in CA1 (p = 0.013, short of Holm). With one site per region the main fit gives DG only in this run (p = 2.2e-08; CA1 p = 0.81, CA3 0.24); in the run the verifier reviewed it gave no region (DG p = 0.33), because for these features L-BFGS-B stops short of the maximum at points that differ from run to run (fit check below). Refitted to the maximum, both readings give CA3 and DG (pooled p = 2.8e-07 and 2.4e-09; one site p = 3.5e-06 and 7.1e-09) and not CA1 (p = 0.0093 and 0.58). All 7 SST-Cre mice are included, and pooled FG frequency rises in each of them in CA3 and DG (t test of the per-mouse changes p = 0.0031 and 0.0015). The outcome rests on the pooled reading of frequency and on fitting to the maximum, assumptions.
fig6h-fg-theta-modulation-sst¶
Suppressing SST+ interneurons increases theta modulation of FG in CA1, an effect specific to SST+ interneurons.
part_table([("fg_mi_ca1", "SST", "up"), ("fg_mi_ca1", "PV vs SST", "sig")])
print("\nPV-Cre, reported with its sign:")
part_table([("fg_mi_ca1", "PV", "down")])
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5 fg_mi_ca1 SST up a True 0.073 2.97 0.0849 False False 7 9828 NaN NaN fg_mi_ca1 SST up b True 0.073 2.97 0.0849 False False 7 9828 NaN NaN fg_mi_ca1 PV vs SST sig a True 0.21 13.2 0.154 False False 15 15961 0.0215 False fg_mi_ca1 PV vs SST sig b True 0.21 13.2 0.154 False False 15 15961 0.0215 False PV-Cre, reported with its sign: feature test expected reading log coef stat p significant holds animals n fg_mi_ca1 PV down a True -0.138 3.36 0.0668 False False 8 6133 fg_mi_ca1 PV down b True -0.138 3.36 0.0668 False False 8 6133
Result: not reproduced. Theta modulation of FG in CA1 does not increase significantly with SST+ suppression (coefficient 0.073, p = 0.085), and the genotype test is not significant (p = 0.15). The PV-Cre effect is negative (-0.14, p = 0.067).
figs4h-fg-theta-modulation-pv¶
Suppressing PV+ interneurons dampens theta modulation of FG during movement.
part_table([("fg_mi_ca3", "PV", "down"), ("fg_mi_dg", "PV", "down")])
print("\nCA1, reported with its sign:")
part_table([("fg_mi_ca1", "PV", "down")])
feature test expected reading log coef stat p significant holds animals n fg_mi_ca3 PV down a True -0.228 6.67 0.00985 False False 8 6133 fg_mi_ca3 PV down b True -0.228 6.67 0.00985 False False 8 6133 fg_mi_dg PV down a True -0.306 22.6 2.07e-06 True True 8 6133 fg_mi_dg PV down b True -0.306 22.6 2.07e-06 True True 8 6133 CA1, reported with its sign: feature test expected reading log coef stat p significant holds animals n fg_mi_ca1 PV down a True -0.138 3.36 0.0668 False False 8 6133 fg_mi_ca1 PV down b True -0.138 3.36 0.0668 False False 8 6133
Result: partially reproduced. PV+ suppression dampens theta modulation of FG in DG (p = 2.1e-06) and in CA3 with p = 0.0098, which does not pass Holm; in CA1 the effect is negative too (p = 0.067). The claim holds in one of the two required regions.
figs5-theta-power-ca1¶
Suppressing either PV+ or SST+ interneurons increases theta power in CA1 but not in CA3 or DG during movement.
part_table([("theta_pow_ca1", "PV", "up"), ("theta_pow_ca1", "SST", "up"), ("theta_pow_ca3", "PV", "ns"),
("theta_pow_ca3", "SST", "ns"), ("theta_pow_dg", "PV", "ns"), ("theta_pow_dg", "SST", "ns")])
feature test expected reading log coef stat p significant holds animals n theta_pow_ca1 PV up a True -0.339 0.924 0.337 False False 8 6133 theta_pow_ca1 PV up b True -0.339 0.924 0.337 False False 8 6133 theta_pow_ca1 SST up a True -0.0666 0.0636 0.801 False False 7 9828 theta_pow_ca1 SST up b True -0.0666 0.0636 0.801 False False 7 9828 theta_pow_ca3 PV ns a True -0.512 4.12 0.0424 False True 8 6133 theta_pow_ca3 PV ns b True -0.512 4.12 0.0424 False True 8 6133 theta_pow_ca3 SST ns a True -0.269 3.51 0.0611 False True 7 9828 theta_pow_ca3 SST ns b True -0.269 3.51 0.0611 False True 7 9828 theta_pow_dg PV ns a True -0.633 9.65 0.0019 False True 8 6133 theta_pow_dg PV ns b True -0.633 9.65 0.0019 False True 8 6133 theta_pow_dg SST ns a True -0.391 10.1 0.00151 True False 7 9828 theta_pow_dg SST ns b True -0.391 10.1 0.00151 True False 7 9828
Result: not reproduced. Theta power in CA1 does not rise with either suppression (PV-Cre -0.34 on the log scale, p = 0.34; SST-Cre -0.07, p = 0.80). In DG it falls with SST+ suppression (p = 0.0015, significant) and with PV+ suppression (p = 0.0019, not significant after Holm).
figs5-theta-coherence-frequency¶
Neither interneuron type modifies theta coherence or theta frequency, except for an increase in theta frequency in DG of PV-Cre mice.
parts = [("theta_freq_dg", "PV", "up")] + [(f, g, "ns") for f in ("theta_coh_ca3", "theta_coh_dg", "theta_freq_ca1", "theta_freq_ca3", "theta_freq_dg")
for g in ("PV", "SST") if not (f == "theta_freq_dg" and g == "PV")]
part_table(parts)
print("\nCoherence reading (b), session coherence:")
part_table([(f, g, "ns") for f in ("theta_coh_ca3", "theta_coh_dg") for g in ("PV", "SST")], res_sess)
print("\nFrequency variant (b): one site per region:")
part_table([("theta_freq1_dg", "PV", "up")] + [(f, g, "ns") for f in ("theta_freq1_ca1", "theta_freq1_ca3", "theta_freq1_dg")
for g in ("PV", "SST") if not (f == "theta_freq1_dg" and g == "PV")])
feature test expected reading log coef stat p significant holds animals n
theta_freq_dg PV up a True 0.0395 12.2 0.000486 True True 8 286418
theta_freq_dg PV up b True 0.0395 12.2 0.000486 True True 8 286418
theta_coh_ca3 PV ns a False -0.0175 0.533 0.465 False True 8 6133
theta_coh_ca3 PV ns b True -0.0201 0.351 0.553 False True 8 6133
theta_coh_ca3 SST ns a False 0.0808 5.95 0.0147 False True 7 9828
theta_coh_ca3 SST ns b True 0.128 4.88 0.0272 False True 7 9828
theta_coh_dg PV ns a False -0.0577 4.78 0.0288 False True 8 6133
theta_coh_dg PV ns b True -0.0788 4.41 0.0357 False True 8 6133
theta_coh_dg SST ns a False 0.0433 1.26 0.262 False True 7 9828
theta_coh_dg SST ns b True 0.0797 1.51 0.219 False True 7 9828
theta_freq_ca1 PV ns a True 0.0287 6.91 0.00856 False True 8 215300
theta_freq_ca1 PV ns b True 0.0287 6.91 0.00856 False True 8 215300
theta_freq_ca1 SST ns a True 0.00736 0.366 0.545 False True 7 408142
theta_freq_ca1 SST ns b True 0.00736 0.366 0.545 False True 7 408142
theta_freq_ca3 PV ns a True 0.0353 7.24 0.00714 False True 8 282715
theta_freq_ca3 PV ns b True 0.0353 7.24 0.00714 False True 8 282715
theta_freq_ca3 SST ns a True 0.0153 1.68 0.194 False True 7 391299
theta_freq_ca3 SST ns b True 0.0153 1.68 0.194 False True 7 391299
theta_freq_dg SST ns a True 0.0183 2.23 0.136 False True 7 408716
theta_freq_dg SST ns b True 0.0183 2.23 0.136 False True 7 408716
Coherence reading (b), session coherence:
feature test expected reading log coef stat p significant holds animals n
theta_coh_ca3 PV ns a False 0.00467 0.0103 0.92 False True 8 45
theta_coh_ca3 PV ns b True 0.033 0.17 0.682 False True 8 45
theta_coh_ca3 SST ns a False 0.149 5.17 0.0287 False True 7 40
theta_coh_ca3 SST ns b True 0.309 3.49 0.0694 False True 7 40
theta_coh_dg PV ns a False -0.0634 1.4 0.243 False True 8 45
theta_coh_dg PV ns b True -0.0676 0.463 0.5 False True 8 45
theta_coh_dg SST ns a False 0.101 1.84 0.183 False True 7 40
theta_coh_dg SST ns b True 0.26 2.05 0.16 False True 7 40
Frequency variant (b): one site per region:
feature test expected reading log coef stat p significant holds animals n
theta_freq1_dg PV up a True 0.0484 28.1 1.13e-07 True True 8 77914
theta_freq1_dg PV up b True 0.0484 28.1 1.13e-07 True True 8 77914
theta_freq1_ca1 PV ns a True 0.0297 6.3 0.0121 False True 8 76244
theta_freq1_ca1 PV ns b True 0.0297 6.3 0.0121 False True 8 76244
theta_freq1_ca1 SST ns a True 0.00123 0.0106 0.918 False True 7 117684
theta_freq1_ca1 SST ns b True 0.00123 0.0106 0.918 False True 7 117684
theta_freq1_ca3 PV ns a True 0.0394 10.7 0.0011 True False 8 76850
theta_freq1_ca3 PV ns b True 0.0394 10.7 0.0011 True False 8 76850
theta_freq1_ca3 SST ns a True 0.0186 2.17 0.141 False True 7 117845
theta_freq1_ca3 SST ns b True 0.0186 2.17 0.141 False True 7 117845
theta_freq1_dg SST ns a True 0.0216 3.3 0.0693 False True 7 119711
theta_freq1_dg SST ns b True 0.0216 3.3 0.0693 False True 7 119711
Result: reproduced, under the pooled reading of frequency (an assumption). With peaks pooled over each region's sites, theta frequency rises in DG with PV+ suppression (+0.040 log units, p = 0.00049), the stated exception, and none of the other nine tests is significant (theta coherence p from 0.015 to 0.47; theta frequency p from 0.0071 to 0.55, the smallest, PV-Cre CA3 and CA1, short of Holm). With one site per region (variant b) PV-Cre CA3 theta frequency is significant (p = 0.0011), which the claim excludes, so the outcome rests on the pooled reading; Method M averages a region over its sites, and Table S3's counts of data points imply peaks from several sites. Refitted to the maximum, the pooled results are the same (fit check). DG theta frequency rises in all 8 PV-Cre mice (t test of the per-mouse changes p = 0.014); referred to the number of mice, the F test gives p = 0.010, which would not pass Holm over 36. The per-peak p-value rests on the per-peak degrees of freedom of the paper's code.
tables4-genotype-baseline¶
During vehicle treatment, PV-Cre mice differ from SST-Cre mice in DG and CA3 SG frequency (lower) and SG/FG ratios (higher).
Vehicle sessions of PV-Cre and SST-Cre mice; LMM feature ~ genotype + (genotype|animal) with an F test (the same fit as the treatment test, with genotype in place of treatment); group means are means over mice of each mouse's mean. Holm over the 36 run features.
rows = []
for f in J.RUN_FEATURES:
d = TAB[f]
d = d[d.group.isin(("PV", "SST")) & d.session.isin(S[S.treatment == "Vehicle"].session)].copy()
d["cno"] = (d.group == "SST").astype(int) # coefficient is SST minus PV
log = J.within_skew(d) > J.SKEW_LOG
dd = d.copy()
if log:
dd["value"] = J.log_values(dd.value)
r = J.treatment_test(J.cell_stats(dd, "value"))
m = d.groupby(["group", "animal"]).value.mean().groupby(level=0).mean()
rows.append(dict(feature=f, log=log, sst_minus_pv=r["coef"], p=r["p"], PV=m["PV"], SST=m["SST"]))
G4 = pd.DataFrame(rows)
G4["holm_36"] = J.holm(G4.p.values, 36)
rows = []
for f in ("sg_freq1_ca3", "sg_freq1_dg"):
d = TAB[f]
d = d[d.group.isin(("PV", "SST")) & d.session.isin(S[S.treatment == "Vehicle"].session)].copy()
d["cno"] = (d.group == "SST").astype(int)
r = J.treatment_test(J.cell_stats(d, "value"))
m = d.groupby(["group", "animal"]).value.mean().groupby(level=0).mean()
rows.append(dict(feature=f, sst_minus_pv=r["coef"], p=r["p"], PV=m["PV"], SST=m["SST"],
mice=d.animal.nunique(), significant_at_0_05_over_36=r["p"] < 0.05 / 36))
print("Variant (b) of frequency, one site per region (untransformed):")
print(pd.DataFrame(rows).to_string(index=False, float_format=lambda v: f"{v:.4g}"))
show = G4[G4.feature.isin(["sg_freq_ca3", "sg_freq_dg", "sgfg_ca3", "sgfg_dg"])].copy()
exp = {"sg_freq_ca3": (40.54, 41.9), "sg_freq_dg": (41.06, 42.4), "sgfg_ca3": (6.2, 3.99), "sgfg_dg": (5.16, 3.4)}
show["expected_PV"] = show.feature.map(lambda f: exp[f][0])
show["expected_SST"] = show.feature.map(lambda f: exp[f][1])
print(show.to_string(index=False, float_format=lambda v: f"{v:.4g}"))
print("\nOther run features with a vehicle genotype difference under Holm:", G4[G4.holm_36 & ~G4.feature.isin(list(exp))].feature.tolist())
Variant (b) of frequency, one site per region (untransformed):
feature sst_minus_pv p PV SST mice significant_at_0_05_over_36
sg_freq1_ca3 1.505 0.3144 39.5 41.01 15 False
sg_freq1_dg 1.115 0.4441 40.26 41.38 15 False
feature log sst_minus_pv p PV SST holm_36 expected_PV expected_SST
sg_freq_ca3 True 0.0371 0.0005607 39.66 40.95 True 40.54 41.9
sgfg_ca3 True -0.4319 0.000536 6.078 3.892 True 6.2 3.99
sg_freq_dg True 0.03829 0.0003425 40.16 41.48 True 41.06 42.4
sgfg_dg True -0.4265 0.0002641 5.089 3.267 True 5.16 3.4
Other run features with a vehicle genotype difference under Holm: ['sg_freq_ca1']
Result: reproduced, under the pooled reading of frequency (an assumption). In vehicle sessions PV-Cre mice have lower SG frequency in CA3 (39.66 against 40.95 Hz, p = 0.00056) and DG (40.16 against 41.48 Hz, p = 0.00034), and higher SG/FG ratios in CA3 (6.08 against 3.89, p = 0.00054) and DG (5.09 against 3.27, p = 0.00026), each passing Holm over 36. All eight group means are within tolerance of Table S4. With one site per region (variant b, untransformed) neither frequency difference is significant (CA3 p = 0.31, DG p = 0.44, 15 mice); logged, as the pooled values are, CA3 is significant (p = 0.00052) and DG is not (p = 0.0063) (fit check). The outcome rests on the pooled reading. The refit leaves the four p-values as they are. Referred to the number of mice they would be 0.0029 to 0.0044, and Welch t tests of the per-mouse means give 0.0051 to 0.0070, none below 0.05/36.
tables6-sex-swr-size and sex-stratified-effects (run features)¶
Run features for the two sex claims: the vehicle sex difference (all track mice) and, per group, the treatment by sex likelihood ratio test.
rows, rows2 = [], []
Sv = S[S.treatment == "Vehicle"]
for f in J.RUN_FEATURES:
d = TAB[f][TAB[f].session.isin(Sv.session)].copy()
d["cno"] = (d.sex == "F").astype(int)
log = J.within_skew(d) > J.SKEW_LOG
if log:
d["value"] = J.log_values(d.value)
r = J.treatment_test(J.cell_stats(d, "value"))
rows.append(dict(feature=f, log=log, female_minus_male=r["coef"], p=r["p"]))
for g in ("PV", "SST", "PS"):
d = TAB[f][TAB[f].group == g].copy()
if J.within_skew(d) > J.SKEW_LOG:
d["value"] = J.log_values(d.value)
csF, csM = J.cell_stats(d[d.sex == "F"], "value"), J.cell_stats(d[d.sex == "M"], "value")
if csF.animal.nunique() < 2 or csM.animal.nunique() < 2:
continue
gt = J.genotype_test(csF, csM)
rows2.append(dict(group=g, feature=f, coef_F=gt["coef_a"], coef_M=gt["coef_b"], p=gt["p_df9"],
mice_F=csF.animal.nunique(), mice_M=csM.animal.nunique()))
SEXR = pd.DataFrame(rows)
SEXR["holm_36"] = J.holm(SEXR.p.values, 36)
SEXR["p<0.05"] = SEXR.p < 0.05
print("Vehicle sex differences, run features:")
print(SEXR.sort_values("p").to_string(index=False, float_format=lambda v: f"{v:.3g}"))
SXI = pd.DataFrame(rows2)
SXI["holm"] = False
for g, d in SXI.groupby("group"):
SXI.loc[d.index, "holm"] = J.holm(d.p.values, len(d))
print("\nTreatment by sex interaction, run features (Holm per group over the 36):")
print(SXI[SXI.holm | SXI.feature.isin(["fg_pow_ca1", "fg_pow_ca3", "fg_pow_dg", "mua_ca3", "mua_dg"])]
.to_string(index=False, float_format=lambda v: f"{v:.3g}"))
print("Significant interactions per group:", SXI.groupby("group").holm.sum().to_dict())
print("Mice by group and sex on the track (an interaction needs 2 or more of each sex):")
print(S.groupby(["group", "sex"]).animal.nunique().unstack().to_string())
Vehicle sex differences, run features:
feature log female_minus_male p holm_36 p<0.05
theta_pow_dg True 0.446 0.0111 False True
mua_dg True 2.96 0.012 False True
sg_coh_dg False 0.0489 0.029 False True
mua_ca3 False 132 0.0362 False True
sg_coh_ca3 False 0.0414 0.0492 False True
fg_coh_ca3 False 0.0381 0.0506 False False
fg_coh_dg False 0.0561 0.0589 False False
fg_freq_ca3 True 0.0124 0.0686 False False
theta_pow_ca3 True 0.342 0.0699 False False
sg_pow_ca1 True 0.298 0.0912 False False
sg_pow_dg True 0.221 0.163 False False
theta_pow_ca1 True 0.334 0.178 False False
theta_freq_ca3 True 0.0126 0.195 False False
fg_pow_ca3 True 0.178 0.205 False False
fg_freq_ca1 True 0.00732 0.222 False False
sg_pow_ca3 True 0.214 0.222 False False
sgfg_ca1 True 0.101 0.273 False False
fg_pow_ca1 True 0.184 0.301 False False
sg_freq_ca1 True -0.00753 0.309 False False
fg_pow_dg True 0.145 0.316 False False
sg_freq_dg True -0.0114 0.326 False False
fg_mi_dg True 0.0526 0.411 False False
theta_freq_ca1 True 0.00664 0.431 False False
sg_mi_dg True 0.0337 0.452 False False
theta_coh_dg False 0.0208 0.53 False False
sgfg_dg True 0.0709 0.537 False False
sg_freq_ca3 True -0.00643 0.595 False False
fg_mi_ca1 True -0.0348 0.635 False False
sgfg_ca3 True 0.0413 0.734 False False
fg_freq_dg True 0.00499 0.792 False False
mua_ca1 False 12.6 0.821 False False
fg_mi_ca3 True -0.0136 0.86 False False
theta_freq_dg True 0.00134 0.898 False False
sg_mi_ca3 True 0.00325 0.956 False False
sg_mi_ca1 True -0.00168 0.972 False False
theta_coh_ca3 False -0.00025 0.994 False False
Treatment by sex interaction, run features (Holm per group over the 36):
group feature coef_F coef_M p mice_F mice_M holm
PV fg_pow_ca1 -0.366 0.00833 0.485 4 4 False
SST fg_pow_ca1 -0.0282 -8.81 0.0604 3 4 False
PV fg_freq_ca1 -0.0222 0.00339 0.000137 4 4 True
PV mua_ca3 -53.8 -4.77 0.349 4 4 False
SST mua_ca3 -23 7.96 0.343 3 4 False
PV fg_pow_ca3 -0.477 -0.0274 0.254 4 4 False
SST fg_pow_ca3 -0.14 -0.225 0.171 3 4 False
PV mua_dg -59.8 7.57 0.0534 4 4 False
SST mua_dg -45.5 13.3 0.0214 3 4 False
PV fg_pow_dg -0.455 -0.0974 0.781 4 4 False
SST fg_pow_dg -41.2 -45.1 0.854 3 4 False
SST theta_coh_ca3 0.101 0.0652 0.00118 3 4 True
Significant interactions per group: {'PV': 1, 'SST': 1}
Mice by group and sex on the track (an interaction needs 2 or more of each sex):
sex F M
group
EV 4 4
PS 6 1
PV 4 4
SST 3 4
Result (run part). No run feature differs by sex in vehicle sessions after Holm over 36 (smallest p = 0.011, DG theta power); five have p < 0.05 uncorrected. Two run features have a significant sex interaction, PV-Cre CA1 FG frequency (p = 0.00014) and SST-Cre CA1-CA3 theta coherence (p = 0.0012), neither a named exception; the named FG power and MUA interactions are not significant (p from 0.021 to 0.85). The P/S group has 6 female and 1 male track mice, so its interaction is not tested and the claim's 'either or both' MUA exception is untested for P/S. With the rest part, tables6-sex-swr-size is not reproduced (SWR size does not differ, p = 0.52) and sex-stratified-effects is not reproduced (no named exception holds).
Session order (cohort 3)¶
Every track mouse had its three vehicle sessions before its three CNO sessions (data check). If the run features drift with session order, the drift appears as a treatment effect. Within the vehicle sessions alone, where treatment cannot act, the LMM compares the third vehicle session with the first (feature ~ session + (session|animal), F test), per group, under reading (a) of the log transform; the sign is compared with that of the treatment effect.
S["order"] = S.session.str.extract(r"(\d+)_")[0].astype(int)
S["rank"] = S.groupby("animal").order.rank()
rows = []
for f in J.RUN_FEATURES:
for g in GROUPS:
d = TAB[f][TAB[f].group == g]
d = d.merge(S[["session", "rank"]], on="session")
d = d[d["rank"].isin((1, 3))].assign(cno=lambda x: (x["rank"] == 3).astype(int))
if d.animal.nunique() < 2 or d.cno.nunique() < 2:
continue
lg = bool(res[(res.feature == f) & (res.reading == "a")].log.iloc[0])
if lg:
d = d.assign(value=J.log_values(d.value))
t = J.treatment_test(J.cell_stats(d, "value"))
tr = res[(res.feature == f) & (res.reading == "a") & (res.test == g)].iloc[0]
rows.append(dict(feature=f, group=g, veh3_minus_veh1=t["coef"], p=t["p"], cno_coef=tr.coef, cno_p=tr.p,
same_sign=np.sign(t["coef"]) == np.sign(tr.coef), mice=t["n_animals"]))
ORD = pd.DataFrame(rows)
ORD["holm"] = False
for g, dd in ORD.groupby("group"):
ORD.loc[dd.index, "holm"] = J.holm(dd.p.values, J.RUN_FAMILY)
print("Vehicle session 3 against vehicle session 1, per group: features with a significant drift (Holm over 36):")
print(ORD[ORD.holm].to_string(index=False, float_format=lambda v: f"{v:.3g}"))
print("\nDrifts with p < 0.05 per group:", ORD[ORD.p < 0.05].groupby("group").size().to_dict())
print("Share of features whose drift has the sign of the treatment effect, per group:",
ORD.groupby("group").same_sign.mean().round(2).to_dict())
ev_sig = res[(res.test == "EV") & (res.reading == "a") & res.significant & res.feature.isin(list(J.RUN_FEATURES))].feature
print("\nEmpty vector features that change with CNO, and their drift within vehicle sessions:")
print(ORD[(ORD.group == "EV") & ORD.feature.isin(ev_sig)].to_string(index=False, float_format=lambda v: f"{v:.3g}"))
m = pd.DataFrame([dict(animal=a, group=g, rank=rk, speed=results[i]["speed_run"]) for i, a, g, rk in zip(S.i, S.animal, S.group, S["rank"])])
print("\nRun speed (cm/s) by session rank, mean over mice (ranks 1-3 vehicle, 4-6 CNO):")
print(m.groupby(["group", "rank"]).speed.mean().unstack().round(2).to_string())
Vehicle session 3 against vehicle session 1, per group: features with a significant drift (Holm over 36):
feature group veh3_minus_veh1 p cno_coef cno_p same_sign mice holm
theta_freq_ca1 EV 0.0293 0.000166 0.0228 0.0134 True 8 True
sg_freq_ca1 SST -0.015 0.000506 -0.00326 0.481 True 7 True
sg_freq_ca1 PS -0.0213 7.51e-05 -0.0206 0.0631 True 7 True
sgfg_ca1 PS 0.164 6.06e-05 0.135 0.283 True 7 True
sg_mi_ca1 EV -0.134 0.000135 -0.0877 0.0213 True 8 True
theta_freq_ca3 EV 0.0327 0.000139 0.0216 0.0475 True 8 True
fg_pow_ca3 PS -0.128 0.000816 -0.175 3.11e-06 True 7 True
fg_freq_ca3 PS 0.0141 0.000153 0.0172 8.48e-07 True 7 True
theta_pow_dg PV -1.13 0.00108 -0.633 0.0019 True 8 True
theta_freq_dg EV 0.0305 0.000208 0.0329 3.75e-05 True 8 True
fg_pow_dg PV -0.473 8.36e-05 -0.277 0.00993 True 8 True
fg_pow_dg PS -0.152 0.000266 -0.263 5.1e-05 True 7 True
fg_freq_dg PS 0.0149 0.000337 0.0197 1.75e-08 True 7 True
Drifts with p < 0.05 per group: {'EV': 8, 'PS': 12, 'PV': 12, 'SST': 4}
Share of features whose drift has the sign of the treatment effect, per group: {'EV': 0.61, 'PS': 0.69, 'PV': 0.92, 'SST': 0.81}
Empty vector features that change with CNO, and their drift within vehicle sessions:
feature group veh3_minus_veh1 p cno_coef cno_p same_sign mice holm
theta_pow_ca3 EV -0.126 0.554 -0.521 0.000725 True 8 False
theta_pow_dg EV -0.0418 0.853 -0.727 6.35e-08 True 8 False
theta_freq_dg EV 0.0305 0.000208 0.0329 3.75e-05 True 8 True
sg_pow_dg EV 0.0453 0.725 -0.214 2.02e-14 False 8 False
fg_pow_dg EV 0.156 0.22 -0.148 7.77e-05 False 8 False
fg_freq_dg EV 0.019 0.115 0.0211 4.46e-10 True 8 False
sg_mi_dg EV -0.047 0.171 -0.077 1.46e-06 True 8 False
fg_mi_dg EV 0.0422 0.644 -0.188 5.48e-07 False 8 False
theta_coh_dg EV 0.00396 0.927 -0.102 0.00139 False 8 False
Run speed (cm/s) by session rank, mean over mice (ranks 1-3 vehicle, 4-6 CNO):
rank 1.0 2.0 3.0 4.0 5.0 6.0
group
EV 4.28 4.71 5.39 6.07 6.20 5.58
PS 5.14 4.72 5.75 4.79 5.03 5.29
PV 4.52 4.57 4.97 5.37 5.20 4.86
SST 4.43 4.38 4.55 4.94 4.53 3.88
Result (session order). Within the vehicle sessions alone, 13 run features drift significantly from the first to the third vehicle session (Holm over 36 per group), among them DG theta and FG power in PV-Cre mice and CA1, CA3 and DG theta frequency in empty vector mice; 61 to 92% of the drifts per group have the sign of the group's treatment effect. Of the nine run features that change with CNO in empty vector mice, DG theta frequency also drifts within the vehicle sessions (p = 0.00021); the other eight do not (p from 0.115 to 0.93). Run speed rises from the first to the third vehicle session in every group (empty vector 4.28 to 5.39, PV-Cre 4.52 to 4.97, SST-Cre 4.43 to 4.55, P/S 5.14 to 5.75 cm/s). Session order can thus explain part of the CNO effects, the speed difference among them, but this check does not explain most of the empty vector changes.
figs6 claims (run features)¶
Double suppression (PS) against PV-Cre and SST-Cre, and the empty vector group, over the 36 run features.
a = res[(res.reading == "a") & res.feature.isin(list(J.RUN_FEATURES))]
tab = pd.DataFrame({
"PS coef": a[a.test == "PS"].set_index("feature").coef, "PS p": a[a.test == "PS"].set_index("feature").p,
"PS sig": a[a.test == "PS"].set_index("feature").significant,
"PV vs PS p": a[a.test == "PV vs PS"].set_index("feature").p, "PV vs PS sig": a[a.test == "PV vs PS"].set_index("feature").significant,
"PV coef": a[a.test == "PV"].set_index("feature").coef,
"SST vs PS p": a[a.test == "SST vs PS"].set_index("feature").p, "SST vs PS sig": a[a.test == "SST vs PS"].set_index("feature").significant,
"SST coef": a[a.test == "SST"].set_index("feature").coef,
"EV coef": a[a.test == "EV"].set_index("feature").coef, "EV p": a[a.test == "EV"].set_index("feature").p,
"EV sig": a[a.test == "EV"].set_index("feature").significant})
print("Reading (a):")
print(tab.to_string(float_format=lambda v: f"{v:.3g}"))
b = res[(res.reading == "b") & res.feature.isin(list(J.RUN_FEATURES))]
for t in ("PV vs PS", "SST vs PS", "EV", "PS"):
print(f"Significant, reading (a) / (b), {t}:", a[(a.test == t) & a.significant].feature.tolist(), "/",
b[(b.test == t) & b.significant].feature.tolist())
print("Mice: PS", S[S.group == "PS"].animal.nunique(), " EV", S[S.group == "EV"].animal.nunique())
Reading (a):
PS coef PS p PS sig PV vs PS p PV vs PS sig PV coef SST vs PS p SST vs PS sig SST coef EV coef EV p EV sig
feature
mua_ca1 -46.4 0.0703 False 0.75 False -30.6 0.0776 False -16.8 3.21 0.446 False
theta_pow_ca1 0.278 0.146 False 0.263 False -0.339 0.392 False -0.0666 -0.259 0.321 False
theta_freq_ca1 0.0192 0.00436 False 0.878 False 0.0287 1 False 0.00736 0.0228 0.0134 False
sg_pow_ca1 0.0608 0.755 False 0.503 False -0.102 0.601 False -0.332 -0.0179 0.889 False
sg_freq_ca1 -0.0206 0.0631 False 1 False -0.0124 0.135 False -0.00326 -0.00604 0.51 False
fg_pow_ca1 -0.0279 0.807 False 0.469 False -0.181 0.983 False -0.223 0.0751 0.278 False
fg_freq_ca1 -0.00137 0.722 False 1 False -0.00936 0.114 False 0.0161 0.00616 0.158 False
sgfg_ca1 0.135 0.283 False 0.587 False 0.0952 0.279 False -0.101 -0.0669 0.444 False
sg_mi_ca1 -0.0368 0.159 False 0.211 False -0.108 0.916 False 0.0245 -0.0877 0.0213 False
fg_mi_ca1 -0.00826 0.92 False 0.349 False -0.138 0.41 False 0.073 -0.0708 0.0704 False
mua_ca3 -132 6.9e-05 True 0.2 False -29.4 0.181 False -5.29 -20.7 0.161 False
theta_pow_ca3 -0.16 0.0239 False 0.00296 False -0.512 0.0122 False -0.269 -0.521 0.000725 True
theta_freq_ca3 0.0216 0.103 False 0.646 False 0.0353 0.925 False 0.0153 0.0216 0.0475 False
sg_pow_ca3 -0.12 0.345 False 0.907 False -0.0368 0.759 False -0.258 -0.128 0.0881 False
sg_freq_ca3 -0.0106 0.576 False 1 False -0.0341 0.0115 False -0.00133 0.00183 0.882 False
fg_pow_ca3 -0.175 3.11e-06 True 0.0184 False -0.254 0.933 False -0.191 -0.0337 0.577 False
fg_freq_ca3 0.0172 8.48e-07 True 0.771 False 0.00906 0.328 False 0.03 0.0124 0.00414 False
sgfg_ca3 0.0527 0.631 False 0.24 False 0.216 0.0441 False -0.0668 -0.0933 0.0423 False
sg_mi_ca3 -0.112 0.00533 False 0.595 False -0.135 0.114 False -0.0401 -0.00555 0.918 False
fg_mi_ca3 -0.11 0.000236 True 0.159 False -0.228 0.944 False -0.0659 -0.0537 0.116 False
mua_dg -3.67 0.301 False 0.0016 False -26.1 0.000103 True -11.9 -21.3 0.343 False
theta_pow_dg -0.298 0.00194 False 0.0013 True -0.633 0.00461 False -0.391 -0.727 6.35e-08 True
theta_freq_dg 0.0239 0.025 False 0.984 False 0.0395 0.974 False 0.0183 0.0329 3.75e-05 True
sg_pow_dg -0.218 0.0466 False 0.934 False -0.0961 0.498 False -0.251 -0.214 2.02e-14 True
sg_freq_dg -0.00927 0.399 False 0.916 False -0.0273 1 False -0.00216 0.00256 0.635 False
fg_pow_dg -0.263 5.1e-05 True 0.653 False -0.277 0.981 False -0.243 -0.148 7.77e-05 True
fg_freq_dg 0.0197 1.75e-08 True 0.778 False 0.0155 0.274 False 0.0295 0.0211 4.46e-10 True
sgfg_dg 0.0677 0.444 False 0.493 False 0.198 0.106 False -0.024 -0.094 0.00892 False
sg_mi_dg -0.0805 3.29e-05 True 0.525 False -0.155 0.596 False -0.0224 -0.077 1.46e-06 True
fg_mi_dg -0.156 0.00142 True 0.155 False -0.306 0.964 False -0.0899 -0.188 5.48e-07 True
theta_coh_ca3 -0.0079 0.523 False 0.746 False -0.0175 0.016 False 0.0808 -0.0178 0.604 False
sg_coh_ca3 -0.0568 0.00465 False 0.421 False -0.0336 0.355 False 0.0381 -0.0087 0.73 False
fg_coh_ca3 -0.00733 0.389 False 0.0608 False -0.0207 0.293 False 0.0315 0.0124 0.154 False
theta_coh_dg -0.0506 0.0237 False 0.839 False -0.0577 0.0382 False 0.0433 -0.102 0.00139 True
sg_coh_dg -0.0553 0.0166 False 0.319 False -0.0373 0.62 False 0.0262 -0.0421 0.0942 False
fg_coh_dg -0.00763 0.643 False 0.206 False -0.017 0.553 False 0.0309 0.000281 0.978 False
Significant, reading (a) / (b), PV vs PS: ['theta_pow_dg'] / ['theta_pow_dg']
Significant, reading (a) / (b), SST vs PS: ['mua_dg'] / []
Significant, reading (a) / (b), EV: ['theta_pow_ca3', 'theta_pow_dg', 'theta_freq_dg', 'sg_pow_dg', 'fg_pow_dg', 'fg_freq_dg', 'sg_mi_dg', 'fg_mi_dg', 'theta_coh_dg'] / ['theta_pow_ca3', 'theta_pow_dg', 'theta_freq_dg', 'sg_pow_dg', 'fg_pow_dg', 'fg_freq_dg', 'sg_mi_dg', 'fg_mi_dg']
Significant, reading (a) / (b), PS: ['mua_ca3', 'fg_pow_ca3', 'fg_freq_ca3', 'fg_mi_ca3', 'fg_pow_dg', 'fg_freq_dg', 'sg_mi_dg', 'fg_mi_dg'] / ['mua_ca3', 'fg_pow_ca3', 'fg_freq_ca3', 'fg_mi_ca3', 'fg_pow_dg', 'fg_freq_dg', 'sg_mi_dg', 'fg_mi_dg']
Mice: PS 7 EV 8
Result (run part). Double suppression against PV-Cre: of 36 run features only DG theta power differs; theta modulation of SG in CA3 and DG, the claimed exceptions, does not (p = 0.60 and 0.52). Double suppression against SST-Cre: only DG MUA differs (reading a); none of the five run tests the claim needs to differ is significant (CA1 FG theta modulation p = 0.41, DG FG power 0.98, CA3 FG power 0.93, DG SG frequency 1.0, CA1 SG/FG ratio 0.28). The P/S treatment raises FG frequency in CA3 (p = 8.5e-07) and DG (p = 1.8e-08) but not CA1 (p = 0.72), and does not change CA1 FG power (p = 0.81). Empty vector mice change with CNO in nine run features (DG theta, SG and FG power and FG frequency among them). With the rest part: figs6-double-like-pv is not reproduced (the exceptions fail, though only one of 58 features differs), figs6-double-unlike-sst is not reproduced, and figs6-empty-vector-control is not reproduced.
Fit check (per-peak features)¶
The frequency features have one observation per oscillation peak, up to millions per group, and their F tests
use the residual degrees of freedom (n - 2), as the code does. Two checks of these results. First, every model
is refitted with a Nelder-Mead search continuing from the best of the three L-BFGS-B starts (polish=True):
with this many observations the likelihood is large, its finite-difference gradient is noisy, and L-BFGS-B
can stop short of the maximum. Second, for the frequency features the fitted random-effect standard deviations,
the same F statistic referred to the number of mice (F(1, mice - 1)), and a t test of the per-mouse mean change.
t0 = time.time()
res_pol = J.add_decisions(J.test_all(TAB, groups=GROUPS, pairs=PAIRS, polish=True), J.RUN_FAMILY, list(J.RUN_FEATURES), counter)
cmp = res.merge(res_pol[["feature", "test", "reading", "coef", "p", "significant"]], on=["feature", "test", "reading"],
suffixes=("", "_pol"))
ratio = np.abs(np.log10(cmp.p.clip(lower=1e-300)) - np.log10(cmp.p_pol.clip(lower=1e-300)))
print(f"Refitted {len(cmp)} tests in {time.time() - t0:.0f} s. p changes by more than a factor of 2 in "
f"{int((ratio > np.log10(2)).sum())} (treatment tests {int(((ratio > np.log10(2)) & ~cmp.test.str.contains(' vs ')).sum())}, "
f"genotype tests {int(((ratio > np.log10(2)) & cmp.test.str.contains(' vs ')).sum())}); genotype tests with p = 1 "
f"(the full model fitted below the reduced one): {int((cmp.test.str.contains(' vs ') & (cmp.p > 0.9999)).sum())} before, "
f"{int((cmp.test.str.contains(' vs ') & (cmp.p_pol > 0.9999)).sum())} after")
print("\nTests whose Holm decision changes with the refit:")
print(cmp[cmp.significant != cmp.significant_pol][["feature", "test", "reading", "coef", "p", "significant", "coef_pol", "p_pol",
"significant_pol"]].to_string(index=False, float_format=lambda v: f"{v:.3g}"))
for title, parts in (("fig5f-sg-frequency-pv", [("sg_freq_ca1", "PV", "down"), ("sg_freq_ca3", "PV", "down"), ("sg_freq_dg", "PV", "down"),
("sg_freq_ca1", "SST", "ns"), ("sg_freq_ca3", "SST", "ns"), ("sg_freq_dg", "SST", "ns"),
("sg_freq_ca1", "PV vs SST", "sig"), ("sg_freq_ca3", "PV vs SST", "sig"), ("sg_freq_dg", "PV vs SST", "sig"),
("sg_freq1_ca1", "PV", "down"), ("sg_freq1_ca3", "PV", "down"), ("sg_freq1_dg", "PV", "down")]),
("fig6g-fg-frequency-sst", [("fg_freq_ca1", "SST", "up"), ("fg_freq_ca3", "SST", "up"), ("fg_freq_dg", "SST", "up"),
("fg_freq1_ca1", "SST", "up"), ("fg_freq1_ca3", "SST", "up"), ("fg_freq1_dg", "SST", "up")]),
("figs5-theta-coherence-frequency, frequency parts", [("theta_freq_dg", "PV", "up")] + [(f, g, "ns") for f in ("theta_freq_ca1", "theta_freq_ca3", "theta_freq_dg")
for g in ("PV", "SST") if not (f == "theta_freq_dg" and g == "PV")])):
print(f"\n{title}, refitted (reading a):")
t = J.show_parts(res_pol, parts)
print(t[t.reading == "a"].drop(columns=["reading"]).to_string(index=False, float_format=lambda v: f"{v:.3g}"))
Refitted 660 tests in 615 s. p changes by more than a factor of 2 in 87 (treatment tests 35, genotype tests 52); genotype tests with p = 1 (the full model fitted below the reduced one): 25 before, 6 after
Tests whose Holm decision changes with the refit:
feature test reading coef p significant coef_pol p_pol significant_pol
mua_ca1 PV vs SST a 13.7 0.226 False 13.7 0.000826 True
mua_ca1 PV vs PS a -15.9 0.75 False -16 4.01e-05 True
sg_freq_ca3 PV a -0.0341 0.00869 False -0.0341 0.000658 True
sg_freq_ca3 PV b -0.0341 0.00869 False -0.0341 0.000658 True
fg_freq_ca3 EV a 0.0124 0.00414 False 0.0124 0.00141 True
fg_freq_ca3 EV b 0.0124 0.00414 False 0.0124 0.00141 True
mua_dg PV vs PS a 22.4 0.0016 False 22.4 0.000725 True
mua_dg SST vs PS a 8.19 0.000103 True 8.18 0.00315 False
sg_freq_dg PV a -0.0273 0.0329 False -0.0274 0.00145 True
sg_freq_dg PV b -0.0273 0.0329 False -0.0274 0.00145 True
fg_freq1_ca1 SST vs PS a 0.0115 0.000769 True 0.0115 0.41 False
fg_freq1_ca1 SST vs PS b 0.0115 0.000769 True 0.0115 0.41 False
fg_freq1_ca3 SST a 0.0309 0.239 False 0.0309 3.47e-06 True
fg_freq1_ca3 EV a 0.0114 0.34 False 0.0114 0.000202 True
fg_freq1_ca3 SST b 0.0309 0.239 False 0.0309 3.47e-06 True
fg_freq1_ca3 EV b 0.0114 0.34 False 0.0114 0.000202 True
fg_freq1_dg PS a 0.0216 0.0896 False 0.0215 8.7e-11 True
fg_freq1_dg SST vs PS a -0.00697 3.98e-08 True -0.00695 0.681 False
fg_freq1_dg PS b 0.0216 0.0896 False 0.0215 8.7e-11 True
fg_freq1_dg SST vs PS b -0.00697 3.98e-08 True -0.00695 0.681 False
fig5f-sg-frequency-pv, refitted (reading a):
feature test expected log coef stat p significant holds animals n p_df5 significant_df5
sg_freq_ca1 PV down True -0.0125 2.15 0.142 False False 8 980169 NaN NaN
sg_freq_ca3 PV down True -0.0341 11.6 0.000658 True True 8 1206877 NaN NaN
sg_freq_dg PV down True -0.0274 10.1 0.00145 True True 8 1237469 NaN NaN
sg_freq_ca1 SST ns True -0.00326 0.498 0.48 False True 7 1950187 NaN NaN
sg_freq_ca3 SST ns True -0.00135 0.0927 0.761 False True 7 1809136 NaN NaN
sg_freq_dg SST ns True -0.00216 1.08 0.298 False True 7 1881565 NaN NaN
sg_freq_ca1 PV vs SST sig True 0.00922 18.3 0.0319 False False 15 2930356 0.0026 False
sg_freq_ca3 PV vs SST sig True 0.0328 15.8 0.0704 False False 15 3016013 0.00733 False
sg_freq_dg PV vs SST sig True 0.0252 24.3 0.00389 False False 15 3119034 0.000193 True
sg_freq1_ca1 PV down True -0.0137 1.1 0.295 False False 8 347369 NaN NaN
sg_freq1_ca3 PV down True -0.0259 10.9 0.000987 True True 8 327694 NaN NaN
sg_freq1_dg PV down True -0.012 2.32 0.128 False False 8 337731 NaN NaN
fig6g-fg-frequency-sst, refitted (reading a):
feature test expected log coef stat p significant holds animals n
fg_freq_ca1 SST up True 0.0161 6.76 0.0093 False False 7 3870968
fg_freq_ca3 SST up True 0.03 26.4 2.82e-07 True True 7 3597659
fg_freq_dg SST up True 0.0295 35.6 2.38e-09 True True 7 3714052
fg_freq1_ca1 SST up True 0.00474 0.31 0.577 False False 7 1104034
fg_freq1_ca3 SST up True 0.0309 21.5 3.47e-06 True True 7 1090042
fg_freq1_dg SST up True 0.0285 33.5 7.05e-09 True True 7 1090661
figs5-theta-coherence-frequency, frequency parts, refitted (reading a):
feature test expected log coef stat p significant holds animals n
theta_freq_dg PV up True 0.0395 12.2 0.000485 True True 8 286418
theta_freq_ca1 PV ns True 0.0287 6.91 0.00858 False True 8 215300
theta_freq_ca1 SST ns True 0.00737 0.374 0.541 False True 7 408142
theta_freq_ca3 PV ns True 0.0353 7.24 0.00715 False True 8 282715
theta_freq_ca3 SST ns True 0.0153 1.68 0.195 False True 7 391299
theta_freq_dg SST ns True 0.0183 2.02 0.155 False True 7 408716
rows = []
for f in [k for k in TAB if "freq" in k]:
d = TAB[f].assign(value=J.log_values(TAB[f].value))
for g in ("PV", "SST", "PS"):
dd = d[d.group == g]
r = J.fit_lmm(J.cell_stats(dd, "value"), polish=True)
th = r["theta"]
L = np.array([[np.exp(th[1]), 0], [th[2], np.exp(th[3])]])
G = L @ L.T
mc = dd.groupby(["animal", "cno"]).value.mean().unstack()
diff = (mc[1] - mc[0]).dropna()
F = r["beta"][1] ** 2 / r["cov"][1, 1]
rows.append(dict(feature=f, group=g, coef=r["beta"][1], se=np.sqrt(r["cov"][1, 1]), slope_sd=np.sqrt(G[1, 1]),
intercept_sd=np.sqrt(G[0, 0]), resid_sd=np.exp(th[0]), p_n=stats.f.sf(F, 1, r["n"] - 2),
p_mice=stats.f.sf(F, 1, len(diff) - 1), mice=len(diff), mice_up=int((diff > 0).sum()),
mouse_change=diff.mean(), p_mouse_t=stats.ttest_1samp(diff, 0).pvalue))
FC = pd.DataFrame(rows)
print("Frequency features (log), refitted: random-effect SDs, the F test with n - 2 and with mice - 1 denominator df,")
print("and a one-sample t test of the per-mouse change (mean CNO minus mean vehicle):")
print(FC.to_string(index=False, float_format=lambda v: f"{v:.3g}"))
rows = []
for f in ("sg_freq_ca3", "sg_freq_dg", "sgfg_ca3", "sgfg_dg", "sg_freq1_ca3", "sg_freq1_dg"):
d = TAB[f]
d = d[d.group.isin(("PV", "SST")) & d.session.isin(S[S.treatment == "Vehicle"].session)].copy()
d["cno"] = (d.group == "SST").astype(int) # coefficient is SST minus PV
if J.within_skew(d) > J.SKEW_LOG:
d["value"] = J.log_values(d.value)
r0 = J.treatment_test(J.cell_stats(d, "value"))
r1 = J.treatment_test(J.cell_stats(d, "value"), polish=True)
m = d.groupby(["group", "animal"]).value.mean()
w = stats.ttest_ind(m["SST"], m["PV"], equal_var=False)
rows.append(dict(feature=f, sst_minus_pv=r1["coef"], p=r0["p"], p_refit=r1["p"],
p_refit_mice=stats.f.sf(r1["F"], 1, d.animal.nunique() - 2), p_welch_mouse_means=w.pvalue,
mice=d.animal.nunique()))
print("\ntables4-genotype-baseline, vehicle sessions, SST-Cre minus PV-Cre: main fit, refit, refit with mice - 2 df,")
print("and a Welch t test of the per-mouse means:")
print(pd.DataFrame(rows).to_string(index=False, float_format=lambda v: f"{v:.3g}"))
Frequency features (log), refitted: random-effect SDs, the F test with n - 2 and with mice - 1 denominator df,
and a one-sample t test of the per-mouse change (mean CNO minus mean vehicle):
feature group coef se slope_sd intercept_sd resid_sd p_n p_mice mice mice_up mouse_change p_mouse_t
theta_freq_ca1 PV 0.0287 0.0109 0.0307 0.017 0.2 0.00858 0.034 8 6 0.0288 0.0427
theta_freq_ca1 SST 0.00737 0.012 0.0318 0.0328 0.193 0.541 0.563 7 4 0.00745 0.589
theta_freq_ca1 PS 0.0192 0.00678 0.0178 0.0208 0.193 0.00465 0.03 7 6 0.0192 0.039
sg_freq_ca1 PV -0.0125 0.00851 0.024 0.0198 0.282 0.142 0.186 8 3 -0.0124 0.215
sg_freq_ca1 SST -0.00326 0.00461 0.0121 0.00995 0.259 0.48 0.507 7 3 -0.00323 0.539
sg_freq_ca1 PS -0.0206 0.0111 0.0292 0.018 0.272 0.0628 0.112 7 2 -0.0205 0.136
fg_freq_ca1 PV -0.00937 0.0093 0.0263 0.0256 0.282 0.314 0.347 8 3 -0.00936 0.378
fg_freq_ca1 SST 0.0161 0.00621 0.0164 0.0134 0.274 0.0093 0.0406 7 6 0.0161 0.0528
fg_freq_ca1 PS -0.00137 0.00405 0.0107 0.017 0.277 0.735 0.747 7 3 -0.00137 0.764
theta_freq_ca3 PV 0.0353 0.0131 0.0371 0.0214 0.19 0.00715 0.0311 8 6 0.0355 0.0395
theta_freq_ca3 SST 0.0153 0.0118 0.0311 0.0402 0.181 0.195 0.243 7 5 0.0153 0.275
theta_freq_ca3 PS 0.0216 0.00889 0.0234 0.0226 0.179 0.0153 0.0515 7 6 0.0216 0.0652
sg_freq_ca3 PV -0.0341 0.01 0.0283 0.0236 0.297 0.000658 0.0113 8 1 -0.0341 0.0154
sg_freq_ca3 SST -0.00135 0.00442 0.0116 0.0179 0.271 0.761 0.771 7 4 -0.00143 0.777
sg_freq_ca3 PS -0.0106 0.0128 0.0337 0.0401 0.287 0.404 0.436 7 3 -0.0106 0.471
fg_freq_ca3 PV 0.00905 0.0086 0.0243 0.0219 0.283 0.292 0.327 8 7 0.00907 0.357
fg_freq_ca3 SST 0.03 0.00585 0.0154 0.0182 0.273 2.82e-07 0.00215 7 7 0.03 0.00313
fg_freq_ca3 PS 0.0172 0.00329 0.00865 0.0185 0.275 1.78e-07 0.00197 7 7 0.0172 0.00281
theta_freq_dg PV 0.0395 0.0113 0.0319 0.0234 0.197 0.000485 0.0101 8 8 0.0396 0.014
theta_freq_dg SST 0.0183 0.0129 0.0339 0.0368 0.187 0.155 0.205 7 4 0.0185 0.234
theta_freq_dg PS 0.0239 0.0107 0.0281 0.0282 0.189 0.025 0.0662 7 6 0.0239 0.0828
sg_freq_dg PV -0.0274 0.00859 0.0242 0.0243 0.293 0.00145 0.0154 8 1 -0.0273 0.0205
sg_freq_dg SST -0.00216 0.00207 0.00527 0.0171 0.266 0.298 0.338 7 2 -0.00244 0.335
sg_freq_dg PS -0.00927 0.011 0.029 0.0408 0.28 0.398 0.43 7 3 -0.00927 0.463
fg_freq_dg PV 0.0155 0.00694 0.0196 0.0172 0.28 0.0255 0.0607 8 7 0.0155 0.0747
fg_freq_dg SST 0.0295 0.00494 0.013 0.0131 0.272 2.38e-09 0.000991 7 7 0.0296 0.00149
fg_freq_dg PS 0.0197 0.00329 0.00866 0.0176 0.273 2.21e-09 0.00098 7 7 0.0197 0.00147
theta_freq1_ca1 PV 0.0297 0.0118 0.0331 0.0184 0.203 0.0121 0.0404 8 6 0.0301 0.0476
theta_freq1_ca1 SST 0.00122 0.0119 0.0313 0.0393 0.194 0.918 0.921 7 3 0.00139 0.917
theta_freq1_ca1 PS 0.0206 0.00913 0.0239 0.0226 0.187 0.0242 0.065 7 5 0.0206 0.0806
sg_freq1_ca1 PV -0.0137 0.0131 0.0369 0.0238 0.279 0.295 0.33 8 3 -0.0137 0.36
sg_freq1_ca1 SST -0.00865 0.0123 0.0326 0.0227 0.257 0.483 0.51 7 3 -0.00865 0.54
sg_freq1_ca1 PS -0.00687 0.0137 0.0361 0.0277 0.271 0.616 0.634 7 3 -0.00678 0.663
fg_freq1_ca1 PV -0.00639 0.01 0.0283 0.0393 0.28 0.525 0.545 8 4 -0.00633 0.574
fg_freq1_ca1 SST 0.00474 0.00851 0.0224 0.0302 0.275 0.577 0.598 7 5 0.00475 0.623
fg_freq1_ca1 PS 0.0162 0.00573 0.0151 0.0163 0.271 0.00461 0.0298 7 5 0.0162 0.0397
theta_freq1_ca3 PV 0.0394 0.0121 0.0338 0.0213 0.19 0.0011 0.0138 8 8 0.0398 0.0177
theta_freq1_ca3 SST 0.0186 0.0127 0.0333 0.0424 0.182 0.141 0.191 7 5 0.0187 0.221
theta_freq1_ca3 PS 0.0232 0.00821 0.0214 0.021 0.181 0.00471 0.0301 7 6 0.0232 0.0389
sg_freq1_ca3 PV -0.0259 0.00786 0.022 0.0269 0.297 0.000987 0.0132 8 1 -0.0259 0.0172
sg_freq1_ca3 SST -0.00257 0.0057 0.0149 0.0203 0.273 0.652 0.667 7 3 -0.00274 0.675
sg_freq1_ca3 PS -0.00735 0.0153 0.0403 0.0439 0.285 0.63 0.647 7 3 -0.00731 0.673
fg_freq1_ca3 PV 0.00906 0.0083 0.0234 0.025 0.284 0.275 0.311 8 5 0.00907 0.34
fg_freq1_ca3 SST 0.0309 0.00666 0.0175 0.0178 0.273 3.47e-06 0.00354 7 7 0.0309 0.00503
fg_freq1_ca3 PS 0.00816 0.00404 0.0106 0.0191 0.278 0.0437 0.0902 7 5 0.00825 0.107
theta_freq1_dg PV 0.0484 0.00913 0.0254 0.0248 0.195 1.13e-07 0.00112 8 8 0.0484 0.00158
theta_freq1_dg SST 0.0216 0.0119 0.0312 0.0356 0.185 0.0694 0.119 7 5 0.0217 0.144
theta_freq1_dg PS 0.0304 0.00703 0.0183 0.0273 0.184 1.52e-05 0.00495 7 6 0.0304 0.00681
sg_freq1_dg PV -0.012 0.00789 0.0221 0.0278 0.289 0.128 0.172 8 2 -0.012 0.197
sg_freq1_dg SST 0.00605 0.00359 0.00924 0.0181 0.263 0.0923 0.143 7 5 0.00588 0.189
sg_freq1_dg PS 7.51e-05 0.00893 0.0235 0.0386 0.276 0.993 0.994 7 4 0.000115 0.991
fg_freq1_dg PV 0.0155 0.00584 0.0164 0.0161 0.278 0.00813 0.0331 8 7 0.0155 0.0418
fg_freq1_dg SST 0.0285 0.00492 0.0129 0.012 0.274 7.05e-09 0.00116 7 7 0.0286 0.00176
fg_freq1_dg PS 0.0215 0.00331 0.00861 0.0165 0.273 8.7e-11 0.000637 7 7 0.0216 0.000948
tables4-genotype-baseline, vehicle sessions, SST-Cre minus PV-Cre: main fit, refit, refit with mice - 2 df,
and a Welch t test of the per-mouse means:
feature sst_minus_pv p p_refit p_refit_mice p_welch_mouse_means mice
sg_freq_ca3 0.0371 0.000561 0.000581 0.00439 0.00696 15
sg_freq_dg 0.0383 0.000343 0.000346 0.00337 0.00565 15
sgfg_ca3 -0.432 0.000536 0.000536 0.00419 0.00672 15
sgfg_dg -0.427 0.000264 0.000264 0.00293 0.00508 15
sg_freq1_ca3 0.0426 0.00052 0.000521 0.00415 0.00642 15
sg_freq1_dg 0.0327 0.00633 0.00635 0.0172 0.0251 15
Result (fit check). Refitted to the likelihood maximum, 87 of 660 run tests change p by more than a factor of 2 (35 treatment tests, 52 genotype tests), and the genotype tests with p = 1, where the full model had been fitted below the reduced one, fall from 25 to 6. The Holm decision changes in 12 tests (20 rows with the two log readings): the PV-Cre SG frequency decreases in CA3 and DG become significant, the one-site FG frequency rise of SST-Cre mice becomes significant in CA3, the empty vector CA3 FG frequency change becomes significant, four MUA genotype tests change, and four other tests of the one-site variant change. No claim's outcome changes: fig5f-sg-frequency-pv still lacks the CA1 decrease, fig6g-fg-frequency-sst holds in CA3 and DG under both frequency readings, the frequency parts of figs5-theta-coherence-frequency and the tables4 tests do not change, and the figs6 and fig5b outcomes do not depend on the changed tests. The main fits vary between runs for the per-peak features (the one-site DG FG frequency of SST-Cre mice gave p = 2.2e-08 in this run and 0.33 in the run the verifier reviewed); the refit gave the same values in both runs made of this notebook. The fitted random-slope SDs of the frequency features are 0.005 to 0.04 log units, against residual SDs of 0.18 to 0.30. Referred to the number of mice, or tested on per-mouse means, the significant frequency effects have p from about 0.001 to 0.02. They hold per mouse in direction (for example DG FG frequency rises in 7 of 7 SST-Cre mice), but with mice as the unit only the DG FG frequency rises of SST-Cre and P/S mice (p = 0.00099 and 0.00098) would pass the first Holm step over 36. The rest notebook's fits were not refitted: its run time is close to the 60 minute limit.
Summary¶
| Claim | Outcome |
|---|---|
| running-speed-unchanged | not reproduced |
| fig5b-mua-run | not reproduced |
| fig5d-sg-power-run | not reproduced |
| fig5e-sg-coherence-run | not reproduced |
| fig5f-sg-frequency-pv | not reproduced |
| fig5g-sg-theta-modulation | not reproduced |
| fig6b-fg-power-sst | not reproduced |
| figs4e-sg-fg-inverse | not reproduced |
| fig6e-sg-fg-ratio | not reproduced |
| fig6f-fg-coherence-unchanged | reproduced |
| fig6g-fg-frequency-sst | partially reproduced (assumed pooled frequency and refit) |
| fig6h-fg-theta-modulation-sst | not reproduced |
| figs4h-fg-theta-modulation-pv | partially reproduced |
| figs5-theta-power-ca1 | not reproduced |
| figs5-theta-coherence-frequency | reproduced (assumed pooled frequency) |
| tables4-genotype-baseline | reproduced (assumed pooled frequency) |
| tables6-sex-swr-size | not reproduced (with the rest notebook) |
| sex-stratified-effects | not reproduced (with the rest notebook) |
| figs6-double-like-pv, figs6-double-unlike-sst, figs6-empty-vector-control | not reproduced (with the rest notebook) |
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: coherence with the CA1 SWR site as the CA1 reference; models fitted by L-BFGS-B from three starts, which for the per-peak features can stop short of the maximum (a refit to the maximum is shown and changes no outcome); frequency pooled over the sites of each region (one site per region as a variant); the 1 s bins wholly in run; the genotype test fitted from cell statistics; the log transform under two readings.
What was found about the dataset: every mouse ran its vehicle sessions before its CNO sessions, so treatment is confounded with session order, and the empty vector mice change with CNO in nine of 36 run features, of which one also drifts within the vehicle sessions; the session start times are wrong (sessions of a mouse start minutes apart); sessions last 25 min, not 30.
print(f"notebook ran in {(time.time() - started) / 60:.1f} min")
notebook ran in 27.7 min