add ephys dataset
2 changed files+52−0
benchcompress/src/benchcompress/datasets/electrophysiology/__init__.pymodified+51−0View file
@@ -84,6 +84,26 @@ def _load_real_001290(
8484 return cast(np.ndarray, ret)
8585
8686
87+def _load_real_001259(*, num_samples: int) -> np.ndarray:
88+ """Load data from DANDI dataset 001259.
89+
90+ Args:
91+ num_samples: Number of samples to load
92+
93+ Returns:
94+ Array of shape (num_samples, 1) containing the loaded data
95+ """
96+ # this one only has one channel
97+ # https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/6fa78218-f4d4-45f3-a627-5afe4aa88c3e/download/&dandisetId=001259&dandisetVersion=draft
98+ nwb_url = "https://api.dandiarchive.org/api/assets/6fa78218-f4d4-45f3-a627-5afe4aa88c3e/download/"
99+ h5f = lindi.LindiH5pyFile.from_hdf5_file(nwb_url)
100+ ds = h5f["/acquisition/ElectricalSeries"]
101+ assert isinstance(ds, lindi.LindiH5pyDataset)
102+ # this one only has one channel
103+ ret = ds[:num_samples, 0]
104+ return cast(np.ndarray, ret)
105+
106+
87107 def _create_filtered_version(X: np.ndarray) -> np.ndarray:
88108 """Create filtered version of a dataset using bandpass filtering and quantization.
89109
@@ -213,6 +233,15 @@ datasets = [
213233 "source_file": SOURCE_FILE,
214234 "long_description": LONG_DESCRIPTION,
215235 },
236+ {
237+ "name": "ephys-001259",
238+ "version": "1",
239+ "description": "Raw extracellular electrophysiology recording from DANDI:001259.",
240+ "create": lambda: _load_real_001259(num_samples=500_000).flatten(),
241+ "tags": tags,
242+ "source_file": SOURCE_FILE,
243+ "long_description": LONG_DESCRIPTION,
244+ },
216245 {
217246 "name": "ephys-000876-ch45-filtered",
218247 "version": "1",
@@ -252,6 +281,17 @@ datasets = [
252281 "source_file": SOURCE_FILE,
253282 "long_description": LONG_DESCRIPTION,
254283 },
284+ {
285+ "name": "ephys-001259-filtered",
286+ "version": "1",
287+ "description": "Preprocessed version of real-001259. Bandpass filtered (300-6000 Hz).",
288+ "create": lambda: _create_filtered_version(
289+ _load_real_001259(num_samples=500_000).flatten()
290+ ),
291+ "tags": tags + ["filtered"],
292+ "source_file": SOURCE_FILE,
293+ "long_description": LONG_DESCRIPTION,
294+ },
255295 {
256296 "name": "ephys-000876-ch45-sparse",
257297 "version": "1",
@@ -291,4 +331,15 @@ datasets = [
291331 "source_file": SOURCE_FILE,
292332 "long_description": LONG_DESCRIPTION,
293333 },
334+ {
335+ "name": "ephys-001259-sparse",
336+ "version": "1",
337+ "description": "Sparse version of real-001259. Activity-based suppression applied.",
338+ "create": lambda: _create_sparse_version(
339+ _load_real_001259(num_samples=500_000).flatten()
340+ ),
341+ "tags": tags + ["filtered", "sparse"],
342+ "source_file": SOURCE_FILE,
343+ "long_description": LONG_DESCRIPTION,
344+ },
294345 ]
benchcompress/src/benchcompress/datasets/electrophysiology/electrophysiology.mdmodified+1−0View file
@@ -9,6 +9,7 @@ The datasets are samples from single channels within larger electrophysiology re
99 - Channel 45 from a session in [Dandiset 000876](https://dandiarchive.org/dandiset/000876)
1010 - Channel 101 from a session in [Dandiset 000409](https://dandiarchive.org/dandiset/000409)
1111 - Channel 0 from a session in [Dandiset 001290](https://dandiarchive.org/dandiset/001290)
12+- Only channel from a session in [Dandiset 001259](https://dandiarchive.org/dandiset/001259)
1213
1314 ## Dataset Variants
1415