Datasets:

License:
Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot extract the features (columns) for the split 'train' of the config 'default' of the dataset.
Error code:   FeaturesError
Exception:    ParserError
Message:      Error tokenizing data. C error: Expected 21 fields in line 3, saw 27

Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 243, in compute_first_rows_from_streaming_response
                  iterable_dataset = iterable_dataset._resolve_features()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 4379, in _resolve_features
                  features = _infer_features_from_batch(self.with_format(None)._head())
                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2661, in _head
                  return next(iter(self.iter(batch_size=n)))
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2839, in iter
                  for key, pa_table in ex_iterable.iter_arrow():
                                       ~~~~~~~~~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2377, in _iter_arrow
                  yield from self.ex_iterable._iter_arrow()
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/csv/csv.py", line 198, in _generate_tables
                  for batch_idx, df in enumerate(csv_file_reader):
                                       ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1843, in __next__
                  return self.get_chunk()
                         ~~~~~~~~~~~~~~^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1985, in get_chunk
                  return self.read(nrows=size)
                         ~~~~~~~~~^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/readers.py", line 1923, in read
                  ) = self._engine.read(  # type: ignore[attr-defined]
                      ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      nrows
                      ^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/pandas/io/parsers/c_parser_wrapper.py", line 234, in read
                  chunks = self._reader.read_low_memory(nrows)
                File "pandas/_libs/parsers.pyx", line 850, in pandas._libs.parsers.TextReader.read_low_memory
                File "pandas/_libs/parsers.pyx", line 905, in pandas._libs.parsers.TextReader._read_rows
                File "pandas/_libs/parsers.pyx", line 874, in pandas._libs.parsers.TextReader._tokenize_rows
                File "pandas/_libs/parsers.pyx", line 891, in pandas._libs.parsers.TextReader._check_tokenize_status
                File "pandas/_libs/parsers.pyx", line 2061, in pandas._libs.parsers.raise_parser_error
              pandas.errors.ParserError: Error tokenizing data. C error: Expected 21 fields in line 3, saw 27

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

MIST Dataset Construction For SPATIA (ICML 2026)

MIST (Multimodal Imaging and Spatial Transcriptomics) is the pretraining dataset. It combines cell-level gene expression with morphology image crops from Xenium spatial transcriptomics data. Construction has three stages:

Stage A: Crop cell images into LMDB

Crop cell-centered patches from Xenium morphology TIFF images and store them in an LMDB database.

Input layout (per Xenium dataset):

dataset_dir/
├── morphology_mip.ome.tif    # or morphology.ome.tif / DAPI.tif
├── cells.parquet             # cell centroids + boundaries
└── cell_feature_matrix.h5    # (optional, for building h5ad)

Crop pipeline:

cd gene_encoders/SPATIA-scprint

# Standard Xenium format (cells.parquet + morphology.ome.tif)
python scripts/0510_crop_images_cell_refactored.py \
    --output-lmdb /path/to/output/dataset_name.lmdb \
    --output-size 256 \
    --cache /path/to/cache

# SPATCH format (adata.h5ad + DAPI.tif, for COAD/HCC/OV datasets)
python scripts/0510_crop_images_cell_spatch.py \
    --input-dir /path/to/SPATCH/Xenium-5K \
    --output-lmdb /path/to/output/lmdb \
    --dataset-name HCC

Image processing details:

  • TIFF max intensity projection across channels
  • Normalize to uint8 (0-255)
  • Crop around cell centroid (adaptive size from cell boundaries, or default 32px radius)
  • Resize to 256x256
  • Store as raw bytes in LMDB with key format: {dataset_name}/{cell_id}
  • Coordinate mapping: pixel_x = spatial_y / 0.2125, pixel_y = spatial_x / 0.2125 (Xenium coordinate swap)

Stage B: Build annotated h5ad and register in lamindb

Annotate each dataset with ontology metadata and add to a lamindb Collection:

cd gene_encoders/SPATIA-scprint

python scripts/0512_add_single_dataset.py \
    /path/to/adata.h5ad \
    --tissue lung --disease normal \
    --dataset_name xenium_lung \
    --collection_name xenium_all_0212

Required metadata columns (added automatically by the script):

  • organism_ontology_term_id (e.g., NCBITaxon:9606)
  • cell_type_ontology_term_id, tissue_ontology_term_id, disease_ontology_term_id
  • assay_ontology_term_id, sex_ontology_term_id, development_stage_ontology_term_id
  • donor_id, dataset_name, index (cell ID matching LMDB keys)

Stage C: Merge per-dataset LMDBs (optional)

Consolidate multiple per-dataset LMDBs into a single file:

python scripts/0514_merge_lmdb.py \
    --input-dir /path/to/per_dataset_lmdbs/ \
    --output /path/to/merged/all.lmdb

Data loading at training time

The training data loader (scdataloader.data_spatial.Dataset) reads:

  1. Gene expression from a lamindb Collection (multiple h5ad files)
  2. Cell images from LMDB files (supports multiple scales)

LMDB environments are mapped to image keys in the batch:

  • 1st LMDB path -> image (cell-level crop)
  • 2nd LMDB path -> region_image (niche-level, optional)
  • 3rd LMDB path -> tissue_image (tissue-level, optional)

Images are preprocessed at load time: 256x256 grayscale -> stack to RGB -> AutoImageProcessor (ViT-MAE) -> (3, 224, 224) float tensor.

Downloads last month
215

Models trained or fine-tuned on mims-harvard/SPATIA_MIST