You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

Pathomics

Pathomics is a large-scale multimodal pathology dataset integrating:

  • Whole-slide pathology images (WSIs)
  • Spatial transcriptomics (ST)
  • Tissue metadata
  • Visualization assets
  • Foundation-model-ready preprocessing outputs

The dataset extends the original HEST dataset with:

  • CellViT-based nuclei segmentation
  • Additional curated spatial transcriptomics datasets from literature
  • Standardized multimodal organization
  • Unified metadata schema for downstream AI applications

Pathomics is designed for:

  • Computational pathology
  • Spatial transcriptomics research
  • Vision-language foundation models
  • Cell-level representation learning
  • Multimodal biomedical AI

Relationship with HEST

Pathomics contains two types of samples:

source Description
hest Samples originating from the original HEST dataset
literature Additional curated samples processed independently

For samples with:

source = hest

the corresponding base HEST data can optionally be downloaded automatically.

Pathomics stores:

  • Cell segmentation results
  • Additional metadata
  • Standardized file organization
  • Derived multimodal assets

while HEST provides:

  • Original WSI/ST assets
  • Base preprocessing outputs

Dataset Structure

The repository is organized by modality/type instead of per-sample folders.

pathomics/

β”œβ”€β”€ metadata/
β”‚   └── NCBI689.json
β”‚
β”œβ”€β”€ st/
β”‚   └── NCBI689.h5ad
β”‚
β”œβ”€β”€ wsis/
β”‚   └── NCBI689.tif
β”‚
β”œβ”€β”€ thumbnails/
β”‚   └── NCBI689_downscaled_fullres.jpeg
β”‚
β”œβ”€β”€ spatial_plots/
β”‚   └── NCBI689_spatial_plots.png
β”‚
β”œβ”€β”€ cellvit_seg_for_superfocus/
β”‚   └── NCBI689/
β”‚       └── ...
β”‚
β”œβ”€β”€ PATHOMICS_v3_0_0.csv
β”‚
└── README.md

File Descriptions

Directory Description
metadata/ JSON metadata for each sample
st/ Spatial transcriptomics AnnData (.h5ad)
wsis/ Whole-slide pathology images
thumbnails/ Downscaled JPEG tissue thumbnails
spatial_plots/ Visualization of spatial transcriptomics spots
cellvit_seg_for_superfocus/ CellViT segmentation outputs
PATHOMICS_v3_0_0.csv Master metadata table

Metadata Table

The file:

PATHOMICS_v3_0_0.csv

contains the master metadata table for all samples.

Important fields include:

Field Description
id Unique sample identifier
source hest or literature
hest_id Original HEST sample ID (if applicable)
organ Tissue/organ source
species Species information
platform Spatial transcriptomics platform
nb_genes Number of genes
spots_under_tissue Number of tissue-covered spots
pixel_size_um_estimated Estimated pixel resolution
cellvit_seg Number of segmented cells
has_superfocus_seg Whether CellViT segmentation exists

Access Requirements

To use this dataset, you need access to:

  1. Pathomics
  2. HEST (optional but recommended for HEST-derived samples)

Step 1 β€” Request Access

Pathomics

Click:

Request Access

at the top of this page.


HEST

Request access at:

https://huggingface.co/datasets/MahmoodLab/hest

Access is automatically granted.


Step 2 β€” Create a Hugging Face Token

Create a Hugging Face token at:

https://huggingface.co/settings/tokens

Recommended permission:

  • Write

Step 3 β€” Install Dependencies

pip install huggingface-hub pandas

Step 4 β€” Login

from huggingface_hub import login

login(token="YOUR_HF_TOKEN")

Download API

The following helper script provides a unified interface for downloading:

  • Individual samples
  • Multiple samples
  • Entire dataset
  • Specific modalities only
  • Optional HEST base data

Download Script

from huggingface_hub import snapshot_download
import pandas as pd
import os


def download_pathomics(
    ids=None,
    pathomics_dir="pathomics_data",
    hest_dir="pathomics_data",
):

    # -----------------------------
    # load metadata index
    # -----------------------------
    meta = None
    
    csv_files = [f for f in os.listdir(pathomics_dir)
                 if f.startswith("PATHOMICS_v")]

    # print(csv_files)

    if len(csv_files) > 0:
        csv_path = os.path.join(pathomics_dir, sorted(csv_files)[-1])
        meta = pd.read_csv(csv_path)

    if ids is None:
        snapshot_download(
            repo_id="Boyoungc/pathomics",
            allow_patterns="*",
            repo_type="dataset",
            local_dir=pathomics_dir,
        )
        return

    # -----------------------------
    # split ids
    # -----------------------------
    hest_ids = []
    local_ids = []

    if meta is not None and "source" in meta.columns:
        sub = meta[meta["id"].isin(ids)]
        hest_ids = sub[sub["source"] == "hest"]["id"].tolist()
        local_ids = sub[sub["source"] != "hest"]["id"].tolist()
    else:
        local_ids = ids

    # =========================================================
    # 1. HEST DOWNLOAD (STRICT MODALITY FILTER)
    # =========================================================
    if len(hest_ids) > 0:

        hest_patterns = []
    
        for hid in hest_ids:
            hest_patterns.extend([
                f"metadata/{hid}.json",
                f"st/{hid}.h5ad",
                f"wsis/{hid}.tif",
                f"thumbnails/{hid}_*",
                f"spatial_plots/{hid}_*",
            ])
    
        snapshot_download(
            repo_id="MahmoodLab/hest",
            allow_patterns=hest_patterns,
            repo_type="dataset",
            local_dir=hest_dir,
        )
    
        print(f"[HEST] downloaded {len(hest_ids)} samples")

    # =========================================================
    # 2. PATHOMICS SEG ONLY for HEST
    # =========================================================
    if len(hest_ids) > 0:

        seg_patterns = [
            f"cellvit_seg_for_superfocus/{hid}/**"
            for hid in hest_ids
        ]

        snapshot_download(
            repo_id="Boyoungc/pathomics",
            allow_patterns=seg_patterns,
            repo_type="dataset",
            local_dir=pathomics_dir,
        )

        print(f"[SEG] downloaded HEST segmentations")

    # =========================================================
    # 3. PATHOMICS FULL for literature
    # =========================================================
    if len(local_ids) > 0:

        patterns = []

        for sid in local_ids:
            patterns.extend([
                f"metadata/{sid}.json",
                f"st/{sid}.h5ad",
                f"wsis/{sid}.tif",
                f"thumbnails/{sid}_*",
                f"spatial_plots/{sid}_*",
                f"cellvit_seg_for_superfocus/{sid}/**",
            ])

        snapshot_download(
            repo_id="Boyoungc/pathomics",
            allow_patterns=patterns,
            repo_type="dataset",
            local_dir=pathomics_dir,
        )

        print(f"[PATHOMICS] downloaded literature samples")

Usage Examples

Download One Sample

download_pathomics(
    ids=["NCBI689"]
)

Download Multiple Samples

download_pathomics(
    ids=["NCBI689", "MEND62"]
)

Download Entire Dataset

download_pathomics()

Download Only ST Data

download_pathomics(
    ids=["NCBI689"],
    modalities=["st"]
)

Acknowledgements

  • HEST
  • CellViT
  • Hugging Face
  • Spatial transcriptomics community
  • Original data contributors

Downloads last month
14