Datasets:
Download README.md from EcodylicScience/mosaic-example-zebrafish: direct link, hf CLI and curl.
- Browser
- Download file 4.97 kB
-
https://huggingface.co/datasets/EcodylicScience/mosaic-example-zebrafish/resolve/main/README.md
- Command line
-
hf download hf://datasets/EcodylicScience/mosaic-example-zebrafish/README.md
-
curl -L -o README.md https://huggingface.co/datasets/EcodylicScience/mosaic-example-zebrafish/resolve/main/README.md
license: cc0-1.0
language:
- en
tags:
- biology
- animal-behavior
- collective-behavior
- animal-tracking
- mosaic
pretty_name: 'Zebrafish (wild type): collective motion and social forces'
size_categories:
- 10M<n<100M
Zebrafish wild type, collective motion and social forces
Pose tracks for 33 trials of wild-type (AB strain) zebrafish, six per group, free-swimming in a circular arena about 48 cm across, filmed from above at 60 Hz for 30 minutes. Converted to mosaic parquet tables and ready to analyse without a conversion step.
Worked example:
notebooks/collective-motion-zebrafish.ipynb.
Set SOURCE = "download" (the default) and it fetches both files below.
A tracker with no keypoints
This is a Ctrax/JAABA-style trx tracker: it reports a centroid, an orientation
and a fitted ellipse, and locates no keypoints at all. So these tables carry
X, Y and ANGLE and no poseX* / poseY* columns — which makes the
dataset a useful case for anyone whose own tracker does the same. Features that
genuinely need keypoints refuse a table without them, naming themselves; features
that merely prefer them fall back to the body centre.
X / Y is the tracker's centroid, as mosaic_v1 asks. (Contrast the
shiners dataset,
where it is the head.)
Files
| File | Size | What it is |
|---|---|---|
zebrafish-wt-tracks.tar.gz |
767 MB | A complete mosaic dataset: dataset.yaml + tracks/. 33 trials, about 21.4 million rows. |
zebrafish-raw-sample.tar.gz |
79 MB | Two trials of raw .mat, copied verbatim. |
SHA256SUMS carries the checksums.
The raw sample exists so the example notebook can run its converter rather than only display it. Converting the two samples reproduces the shipped tables exactly, and the notebook asserts this before going on.
Contents
Columns: frame, time, id, group, sequence, X, Y, ANGLE, body_length, body_width, px_per_cm. Positions are video pixels; px_per_cm is 40.236 and
is carried per row so the calibration travels with the data, but the columns are
not scaled by it — a physical unit is obtained downstream by mosaic's
scale-to-cm feature, never stored in the table.
ANGLE is the ellipse fit's head-resolved orientation, which the tracker
measures directly — hence the zfish_trx_v1 schema (mosaic_v1 plus ANGLE)
rather than plain mosaic_v1.
group is empty for every row: these trials form one flat set with no grouping
level. That is legal — group is an optional namespace, and sequence alone
identifies each trial.
Use
import tarfile
from huggingface_hub import hf_hub_download
from mosaic.core.dataset import Dataset
path = hf_hub_download("EcodylicScience/mosaic-example-zebrafish",
"zebrafish-wt-tracks.tar.gz", repo_type="dataset")
with tarfile.open(path) as tar:
tar.extractall("data")
ds = Dataset("data/zebrafish-wt-tracks/dataset.yaml").load()
tracks = ds.load_tracks("", "data10282015_10_43_AMAB")
huggingface_hub >= 1.2.0 is worth pinning: older clients retry a rate-limit
response with a 25-second backoff against a 5-minute window, so they fail where a
current client waits.
Provenance and changes
Derived from the Dryad record accompanying Tang et al. (2020). CC0 1.0, so this derivative carries the same terms.
Source: doi:10.5061/dryad.hx3ffbg9n
What was changed:
- The
trxMATLAB struct arrays were converted to mosaiczfish_trx_v1parquet tables. Column names and layout differ from the original release. Positions and orientations are unaltered —x,yandthetaare carried through verbatim. - A failed ellipse fit is reported as an exact zero in the source, and is converted to NaN here. This affects 12% to 46% of rows depending on the trial, 21% overall. Read literally, a zero is a fish zero pixels long: it drags the median body length down and would collapse any derived pose onto the centroid. This is the one place a value is changed rather than carried across, and it is the reason to prefer these tables over a naive read of the source.
- Fields not converted:
arena(stale fly-bowl template data — it reports a radius of 254 px while the fish occupy 108–1983 px), and the movie-name and bookkeeping fields.
Not included: video. Only pose data is distributed in the source record.
Citation
Tang W, Davidson JD, Zhang G, Conen KE, Fang J, Serluca F, Li J, Xiong X, Coble M, Tsai T, Molind G, Fawcett CH, Sanchez E, Zhu P, Couzin ID, Fishman MC (2020) Genetic Control of Collective Behavior in Zebrafish. iScience 23(3): 100942. doi:10.1016/j.isci.2020.100942