Skip to content

Bin2cell Specifications

Process Details

  • Name: bin2cell
  • Process UUID: c663prihycqmzqthmp2hs9eaq15ame
  • Process Group: Spatial

Overview

This process performs downstream spatial analysis following spaceranger count, transforming Visium HD 2um binned output into cell-level resolution and quality-controlled data. The workflow includes notebook parameter injection, data loading and preparation, H&E image processing, StarDist cell segmentation, bin-to-cell conversion, quality control and filtering, normalization and dimensionality reduction, and visualization outputs.

This process is implemented in Bash, which invokes a Jupyter notebook for spatial transcriptomics analysis using Python-based tools.

Key Functionality

  • Cell Segmentation: Performs StarDist-based cell segmentation on H&E histology images to identify individual cell boundaries
  • Bin-to-Cell Conversion: Transforms Visium HD 2μm spatial bins into cell-level gene expression data by mapping bins to segmented cells
  • Quality Control & Filtering: Applies comprehensive QC metrics including minimum cell counts, gene detection thresholds, and mitochondrial/ribosomal gene analysis
  • Spatial Analysis: Conducts normalization, dimensionality reduction, and generates spatial visualization plots for downstream analysis

Input/Output Specification

Inputs

Required Inputs

  • Space Ranger Output

    • Description: Compressed tar.gz file containing the complete Space Ranger count output directory with binned spatial transcriptomics data
    • Format: tar.gz
  • TIFF Image File

    • Description: High-resolution H&E histology image corresponding to the spatial transcriptomics sample for cell segmentation
    • Format: TIFF

Outputs

  • H5AD File

    • Description: Processed AnnData object containing cell-level gene expression data with spatial coordinates and quality control metrics
    • Format: h5ad
  • HTML Report

    • Description: Interactive HTML notebook report containing quality control plots, spatial visualizations, and analysis summary
    • Format: HTML

Parameters & Settings

These parameters can be adjusted in the Foundry UI when running this process.

  • Organism

    • Description: Select Organism, used to target Mitochondrial and Ribosomal genes for QC.
    • Available options: Mouse (default), Human
  • Microns Per Pixel

    • Description: Spatial resolution of the source image, measured in micrometers per pixel. This conversion factor defines how many micrometers of actual tissue each pixel represents, essential for accurate spatial measurements and bin size calibration.
    • Default value: 0.30
  • Minimum number of cells

    • Description: Minimum number of cells required per bin. Bins with fewer cells than this threshold will be filtered out to remove low-quality or sparsely populated spatial regions.
    • Default value: 3
  • Minimum number of Genes

    • Description: Minimum number of genes that must be detected in a cell for it to be included in the analysis. Cells with fewer genes are filtered out to remove low-quality cells or potential empty droplets.
    • Default value: 100
  • Minimum Bins per Cell

    • Description: Minimum number of bins that must be detected per identified cell following completion of bin_to_cell conversion. Cells with fewer bins will be filtered out.
    • Default value: 5
  • Number of PCA Components

    • Description: Specifies the number of principal components to use during dimensionality reduction (e.g., UMAP) and clustering.
    • Default value: 12
  • Number of top variable genes

    • Description: Number of highly variable genes to select for downstream analysis. These genes are used for dimensionality reduction, clustering, and other analyses to capture the most biologically relevant signals while reducing computational complexity.
    • Default value: 5000
  • Window size for zoom mask

    • Description: Defines the size (in pixels) of the square window around the center. Used for efficient segmentation of the data by using a specific window for intial estimation
    • Default value: 100
  • Grid bins for zoom mask

    • Description: Number of grid bins for a coarse 2D histogram grid (grid_bins x grid_bins area) to scan the spatial area. Used for efficient segmentation of the data by using a specific window for intial estimation
    • Default value: 100

References & Resources

  • Tool Documentation: Contact the team for details on cell_binning_and_qc.ipynb