Aery Jones et al. (2021) from dandiset 000165: CSD during SWRs in cohort 1¶
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.
This notebook tests one claim, fig2ef-csd-sr, on the home cage sessions of cohort 1 (single-shank probe, 32 sites at 50 um). The other claims are tested in the two other notebooks; their table of claims lists every claim and where it is tested.
Method. SWRs as in the rest notebook (3 SD on the "ca1-pyr 1" site, during extended immobility, edge and artifact rules). CSD: each site smoothed with its neighbours as (a + 2b + c)/4 (code RTCSD.m, as the criterion says), then minus the second difference across depth over the spacing squared, so that sources are positive and sinks negative. Per SWR, the peak source and the peak sink (as a magnitude) over the CA1-sr sites in the 100 ms after onset (Methods, Analysis of neural data, paragraph 4). The LMM and genotype test are Method M as in the other notebooks; Holm over the 24 rest comparisons, with the comparisons computed in the rest notebook not repeated here, so p < 0.05/24 suffices.
import time
import warnings
import numpy as np
import pandas as pd
import jones2021 as J
warnings.filterwarnings("ignore", category=RuntimeWarning)
pd.set_option("display.width", 220)
started = time.time()
assets = J.list_assets()
hc = assets[assets.kind == "HomeCage"]
first = hc.drop_duplicates("subject") # the probe is a property of the mouse: one file per mouse is read
probe = first.merge(J.scan(first.asset_id.tolist(), workers=16), on="asset_id").set_index("subject").probe
c1 = hc[hc.subject.map(probe).str.contains("A1x32")]
c1 = c1.merge(J.scan(c1.asset_id.tolist(), workers=16), on="asset_id")
print("Probes by mouse:", probe.value_counts().to_dict())
print(f"dandiset {J.DANDISET_ID} version {J.DANDISET_VERSION}: {len(c1)} single-shank home cage files of {len(hc)}")
t0 = time.time()
results = J.process_many(c1.asset_id.tolist(), "CSD", workers=4)
errors = [r for r in results if "error" in r]
print(f"processed in {(time.time() - t0) / 60:.1f} min; failed: {len(errors)}")
for e in errors:
print(" ", e)
Probes by mouse: {'A4x8-5mm-400-200-703-CM32': 53, 'A1x32-6mm-50-703-CM32': 9}
dandiset 000165 version 0.211118.1526: 62 single-shank home cage files of 402
processed in 5.0 min; failed: 0
Data check¶
S = J.session_table(results)
print("Probes:", c1.probe.unique())
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)))
print("\nTreatment sequence per mouse (v vehicle, C CNO):"); print(seq.to_string())
print("Sessions skipped:", S.skipped.notna().sum())
chk = pd.DataFrame([dict(session=r["meta"]["session_id"], depth_sorted=r["depth_sorted"], n_sr=r["n_sr"],
rest_min=r["rest_s"] / 60, swr=len(r.get("swr", [])), seconds=r.get("seconds"),
maxrss_gb=r.get("maxrss_kb", 0) / 1e6) for r in results if "error" not in r])
print("\nSite depths increase with site index in every file:", bool(chk.depth_sorted.all()))
print(chk.drop(columns=["session", "depth_sorted"]).describe().round(2).T.to_string())
sw = pd.concat([results[i]["swr"].assign(group=g, treatment=t) for i, g, t in zip(S.i, S.group, S.treatment) if "swr" in results[i]])
print("\nPeak source and sink (file units per mm2) over SWRs, by group and treatment:")
print(sw.groupby(["group", "treatment"])[["source", "sink"]].describe().round(0).T.to_string())
Probes: <StringArray>
['A1x32-6mm-50-703-CM32']
Length: 1, dtype: str
sessions mice minutes
group treatment
PV CNO 19 5 68.2
Vehicle 15 5 67.4
SST CNO 16 4 67.8
Vehicle 12 4 67.6
Treatment sequence per mouse (v vehicle, C CNO):
group sequence
animal
Aphid PV vCvCvCC
Cicada SST vCvCvCC
Cricket SST vCvCvCC
Fruitfly PV vCvCvC
Grasshopper PV vCvCvCC
Honeybee PV vCvCvCC
Ladybug SST vCvCvCC
Mantis SST vCvCvCC
Rolypoly PV vCvCvCC
Sessions skipped: 0
Site depths increase with site index in every file: True
count mean std min 25% 50% 75% max
n_sr 62.0 3.89 0.89 2.00 4.00 4.00 4.00 5.00
rest_min 62.0 62.56 7.54 44.95 57.88 60.99 66.64 88.38
swr 62.0 994.13 476.05 136.00 596.50 1053.00 1320.00 2102.00
seconds 62.0 19.06 3.06 14.10 17.40 18.46 19.83 35.45
maxrss_gb 62.0 1.73 0.14 1.45 1.67 1.68 1.80 1.95
Peak source and sink (file units per mm2) over SWRs, by group and treatment:
group PV SST
treatment CNO Vehicle CNO Vehicle
source count 14821.0 13535.0 21884.0 11396.0
mean 32814.0 28234.0 34884.0 33011.0
std 17360.0 15693.0 17130.0 16381.0
min -5100.0 -3600.0 -5600.0 -3600.0
25% 20600.0 16850.0 21600.0 20300.0
50% 29900.0 25400.0 32800.0 31100.0
75% 42400.0 36600.0 46100.0 43800.0
max 415500.0 177700.0 182400.0 139200.0
sink count 14821.0 13535.0 21884.0 11396.0
mean 52185.0 43216.0 58566.0 55755.0
std 28495.0 22648.0 27393.0 25702.0
min -2500.0 2700.0 -13500.0 3100.0
25% 32200.0 27300.0 38000.0 36800.0
50% 46900.0 38600.0 54200.0 51700.0
75% 66200.0 54300.0 75100.0 70900.0
max 223300.0 162800.0 214000.0 223100.0
fig2ef-csd-sr¶
During SWRs, current source density sources and sinks in CA1 stratum radiatum increase when either PV+ or SST+ interneurons are suppressed, with no difference between genotypes.
Readings (a) log when right skewed, (b) log always (Method M); the code's 5 SD SWRs are a variant.
FEAT = {"source": J._col("swr", "source"), "sink": J._col("swr", "sink"),
"source_5sd": J._sel("swr", "source", min_size=5), "sink_5sd": J._sel("swr", "sink", min_size=5)}
S = S[S.skipped.isna()].reset_index(drop=True)
TAB = J.build_tables(results, S, FEAT)
res = J.test_all(TAB, groups=("PV", "SST"), pairs=(("PV", "SST"),))
res = J.add_decisions(res, J.REST_FAMILY, ["source", "sink"], {"source_5sd": "source", "sink_5sd": "sink"})
parts = [("source", "PV", "up"), ("source", "SST", "up"), ("sink", "PV", "up"), ("sink", "SST", "up"),
("source", "PV vs SST", "ns"), ("sink", "PV vs SST", "ns")]
print(J.show_parts(res, parts).to_string(index=False, float_format=lambda v: f"{v:.3g}"))
print("\n5 SD variant:")
print(J.show_parts(res, [(f + "_5sd", g, e) for f, g, e in parts]).to_string(index=False, float_format=lambda v: f"{v:.3g}"))
m = TAB["sink"].groupby(["group", "animal", "cno"]).value.mean().unstack()
s_ = TAB["source"].groupby(["group", "animal", "cno"]).value.mean().unstack()
print("\nPer mouse, mean peak source and sink by treatment (0 vehicle, 1 CNO):")
print(pd.concat({"source": s_, "sink": m}, axis=1).round(0).to_string())
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5
source PV up a False 6.54e+03 43.4 4.43e-11 True True 5 28356 NaN NaN
source PV up b True 0.182 58 2.76e-14 True True 5 28356 NaN NaN
source SST up a False 2.34e+03 7.07 0.00783 False False 4 33280 NaN NaN
source SST up b True 0.0611 8.12 0.00437 False False 4 33280 NaN NaN
sink PV up a False 1.62e+04 10.2 0.00143 True True 5 28356 NaN NaN
sink PV up b True 0.238 27.1 1.91e-07 True True 5 28356 NaN NaN
sink SST up a False 3.9e+03 5.92 0.015 False False 4 33280 NaN NaN
sink SST up b True 0.0516 5.36 0.0206 False False 4 33280 NaN NaN
source PV vs SST ns a False -4.21e+03 6.89 0.648 False True 9 61636 0.229 False
source PV vs SST ns b True -0.121 8.95 0.442 False True 9 61636 0.111 False
sink PV vs SST ns a False -1.23e+04 11.7 0.231 False True 9 61636 0.0391 False
sink PV vs SST ns b True -0.186 15 0.0905 False True 9 61636 0.0103 False
5 SD variant:
feature test expected reading log coef stat p significant holds animals n p_df5 significant_df5
source_5sd PV up a False 6.7e+03 24.9 6.25e-07 True True 5 18616 NaN NaN
source_5sd PV up b True 0.179 24.8 6.33e-07 True True 5 18616 NaN NaN
source_5sd SST up a False 2.34e+03 8.61 0.00335 False False 4 22933 NaN NaN
source_5sd SST up b True 0.0564 10.5 0.00117 True True 4 22933 NaN NaN
sink_5sd PV up a False 1.56e+04 7.59 0.00588 False False 5 18616 NaN NaN
sink_5sd PV up b True 0.271 14.2 0.000169 True True 5 18616 NaN NaN
sink_5sd SST up a False 3.82e+03 6.18 0.0129 False False 4 22933 NaN NaN
sink_5sd SST up b True 0.0528 4.56 0.0328 False False 4 22933 NaN NaN
source_5sd PV vs SST ns a False -4.36e+03 7.24 0.612 False True 9 41549 0.203 False
source_5sd PV vs SST ns b True -0.123 8.77 0.459 False True 9 41549 0.119 False
sink_5sd PV vs SST ns a False -1.18e+04 11.6 0.234 False True 9 41549 0.0399 False
sink_5sd PV vs SST ns b True -0.218 14.7 0.101 False True 9 41549 0.0119 False
Per mouse, mean peak source and sink by treatment (0 vehicle, 1 CNO):
source sink
cno 0 1 0 1
group animal
PV Aphid 18490.0 25814.0 31212.0 45212.0
Fruitfly 28884.0 34965.0 40306.0 53976.0
Grasshopper 34006.0 44315.0 59411.0 97568.0
Honeybee 38367.0 43616.0 44223.0 52556.0
Rolypoly 16933.0 20603.0 22533.0 29360.0
SST Cicada 38426.0 39588.0 62734.0 63048.0
Cricket 30470.0 35774.0 46531.0 55091.0
Ladybug 36107.0 37042.0 65060.0 69146.0
Mantis 19763.0 21739.0 35210.0 37846.0
Result: not reproduced. With PV+ suppression the peak CA1-sr source (+6540 file units per mm2, p = 4.4e-11) and sink (+16200, p = 0.0014) increase, and the genotype tests are not significant (p = 0.65 and 0.23), as claimed. With SST+ suppression both rise in every mouse but not significantly (source p = 0.0078, sink p = 0.015; with the rest notebook's SST-Cre p-values the Holm family stops at its second rank, 0.05/23). Two of the four treatment effects hold, and the partial rule needs three. Reading (b) of the log transform gives the same decisions; with the code's 5 SD SWRs, reading (b) makes the SST-Cre source significant (p = 0.0012), three of four. 5 PV-Cre and 4 SST-Cre mice.
Summary¶
| Claim | Outcome |
|---|---|
| fig2ef-csd-sr | not reproduced |
A failure to reproduce here may be a failure of this attempt, not of the paper: see the reasoning and the differences from the paper's method.
How the analysis differs from the paper's: SWR boundaries where the envelope crosses its mean (as in the rest notebook); the CSD spacing taken as 50 um from the probe name, with values in file units per mm2; Holm decided with the rest notebook's p-values, not recomputed here.
What was found about the dataset: the cohort 1 files give site depths (rel_y) in site order and label the layers, so the CA1-sr sites can be found; cohort 1 alternates vehicle and CNO, ending with two CNO sessions in most mice.
print(f"notebook ran in {(time.time() - started) / 60:.1f} min")
notebook ran in 5.3 min