Allen Institute Openscope - Vision2Hippocampus project

Allen Institute Openscope - Vision2Hippocampus project. Neurophysiology / NWB data on the DANDI Archive (156 assets, 559.0 GB). License: spdx:CC-BY-4.0.

Category
Neuroscience
Provider
Mehta, Mayank R
License
spdx:CC-BY-4.0
DOI
10.48324/dandi.000690/0.260330.2144
Hosted on
Amazon S3, bucket dandiarchive/dandisets/000690, us-east-2
Access
Free and public. No account with the data provider is needed.
Source
https://dandiarchive.org/dandiset/000690
Data structure and loading code

Fields

assets.jsonld[]path, contentSize, encodingFormat (appli
dandiset.jsonldname, description, license, doi, citatio
nwb_version [per-probe ecephys]2.6.0
general/subject [per-probe ecephys]age=P116D; genotype=wt/wt; sex=F; specie
acquisition/ [per-probe ecephys]probe_0_lfp (LFP), probe_0_lfp_data (Ele
general/extracellular_ephys/electrodes [per-probe ecephys]61 channels; filtering, group, group_nam
nwb_version [session file (no suffix)]2.6.0
general/subject [session file (no suffix)]age=P108D; genotype=wt/wt; sex=M; specie
acquisition/ [session file (no suffix)]EyeTracking (EllipseEyeTracking), raw_ru
processing/running [session file (no suffix)]running_speed:TimeSeries, running_speed_
processing/stimulus [session file (no suffix)]timestamps:TimeSeries
intervals/ [session file (no suffix)]Stim01_SAC_Wd15_Vel2_White_loop_presenta
units [session file (no suffix)]487 units; columns PT_ratio, amplitude,
general/extracellular_ephys/electrodes [session file (no suffix)]384 channels; filtering, group, group_na
nwb_version [image]2.7.0
general/subject [image]age=P109D; genotype=wt/wt; sex=M; specie
acquisition/ [image]EyeTracking (EllipseEyeTracking), raw_ru
processing/running [image]running_speed:TimeSeries, running_speed_
processing/stimulus [image]timestamps:TimeSeries
intervals/ [image]Disco2SAC_Wd15_Vel2_Bndry1_Cntst0_loop_p

and 6 more

Load the data

import json, os, glob, collections
M = os.environ.get("SCIGANTIC_MOUNT_PATH", "/mnt/archive")
# The mount holds ONLY the dandiset metadata; the NWB files are content-addressed blobs elsewhere in the
# public dandiarchive bucket. assets.jsonld maps each logical path to its blob URL.
versions = sorted(d for d in os.listdir(M) if os.path.isdir(f"{M}/{d}"))
ver = "0.260330.2144" if "0.260330.2144" in versions else versions[-1]
assets = json.load(open(f"{M}/{ver}/assets.jsonld"))
assets = assets.get("@graph", assets) if isinstance(assets, dict) else assets
print(f"version {ver}: {len(assets)} assets, {sum(a.get('contentSize', 0) for a in assets)/1e9:.1f} GB")
def blob_key(a):
    return next((u.split(".s3.amazonaws.com/", 1)[1] for u in a.get("contentUrl", []) if ".s3.amazonaws.com/" in u), None)
import re
def kind(path):   # BIDS-style suffix = last "_" token without a "-"; none => bare "session" file
    if not path.endswith(".nwb"): return os.path.splitext(path)[1] or "other"
    toks = os.path.basename(path).rsplit(".", 1)[0].split("_")
    suffix = toks[-1] if len(toks) > 1 and "-" not in toks[-1] else "session"
    return ("probe-" if any(t.startswith("probe-") for t in toks) else "") + suffix
kinds = collections.Counter(kind(a["path"]) for a in assets)
print("file kinds:", dict(kinds))

# Open the smallest NWB of one kind lazily over anonymous S3 (h5py + s3fs; nothing is downloaded whole).
nwbs = sorted((a for a in assets if kind(a["path"]) == "session"), key=lambda a: a.get("contentSize", 0))
a = nwbs[0] if nwbs else sorted(assets, key=lambda a: a.get("contentSize", 0))[0]
key = blob_key(a); print("opening", a["path"], f"({a['contentSize']/1e6:.0f} MB) ->", key)
import h5py, s3fs
fs = s3fs.S3FileSystem(anon=True)
f = h5py.File(fs.open(f"dandiarchive/{key}", "rb", block_size=4 * 1024 * 1024), "r")
txt = lambda v: v.decode() if isinstance(v, bytes) else v
print("nwb", f.attrs.get("nwb_version"), "|", txt(f["session_description"][()]))
print("subject:", {k: txt(f["general/subject"][k][()]) for k in f["general/subject"]} if "general/subject" in f else "-")
print("acquisition:", list(f["acquisition"].keys())[:12])
print("processing:", {m: list(f["processing"][m].keys())[:8] for m in f["processing"]} if "processing" in f else {})
print("intervals:", list(f["intervals"].keys()) if "intervals" in f else [], "| units:", f["units/id"].shape[0] if "units" in f else 0)

# The same file through pynwb (preinstalled), still lazy:
from pynwb import NWBHDF5IO
io = NWBHDF5IO(file=f, mode="r", load_namespaces=True)
nwb = io.read(); print(nwb.identifier, "|", nwb.session_start_time)
units = nwb.units.to_dataframe(); print(units.head())

Written for a Scigantic notebook, where /mnt/archive is the mounted dataset.

Analyze this dataset without downloading it

On Scigantic, Allen Institute Openscope - Vision2Hippocampus project opens in a hosted JupyterLab notebook with the data already mounted, so you can read files where they are stored instead of copying them first. Each notebook includes an AI assistant that can see the mounted files and write and run analysis code. Open the dataset page to launch a notebook, or browse the full catalog.

Related Neuroscience datasets