Sign inSign up

flobenhsj/spaceranger-fixed

By flobenhsj

•Updated 6 months ago

Reproducible Space Ranger Visium pipeline container

Image
Developer tools
0

141

flobenhsj/spaceranger-fixed repository overview

⁠🧬 Space Ranger (Apptainer) — Reproducible Visium/Visium HD Pipeline

ā šŸ“¦ Container

apptainer pull docker://flobenhsj/spaceranger-fixed:4.0.1

This produces a portable .sif image containing Space Ranger 4.0.1.


ā ā¬‡ļø 1. Download Required Resources

⁠🧬 Reference transcriptome

wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-GRCh38-2024-A.tar.gz
tar -xvzf refdata-gex-GRCh38-2024-A.tar.gz

⁠🧫 Probe set (if required for assay type)

wget https://cf.10xgenomics.com/supp/spatial-exp/probeset/Visium_Human_Transcriptome_Probe_Set_v2.1.0_GRCh38-2024-A.csv

⁠🧫 Slide geometry file (.vlf)

wget https://visiumhdslide.10xgenomics.com/vlf/H1-GZ847TV.vlf

āš ļø Replace H1-GZ847TV.vlf with the correct slide-specific file for your experiment.


ā šŸ–¼ Imaging data (experiment-specific)

Typical required inputs:

wget <CYTA_IMAGE_URL>
wget <HIGH_RES_IMAGE_URL>
  • CytAssist image (optional depending on protocol)
  • High-resolution tissue image (OME-TIFF or TIFF)

ā šŸ“Š FASTQ data

FASTQs are generated by sequencing and must be placed in:

/path/to/fastq_directory/

project/
ā”œā”€ā”€ container/
│   └── spaceranger-fixed_4.0.1.sif
ā”œā”€ā”€ reference/
│   └── refdata-gex-GRCh38-2024-A/
ā”œā”€ā”€ probeset/
│   └── Visium_Human_Transcriptome_Probe_Set_v2.1.0_GRCh38-2024-A.csv
ā”œā”€ā”€ slide/
│   └── H1-GZ847TV.vlf
ā”œā”€ā”€ images/
│   ā”œā”€ā”€ cytassist.tif
│   └── hires.ome.tiff
└── fastq/

ā šŸš€ 2. Run Space Ranger (SLURM + Apptainer)

#!/bin/bash
#SBATCH --job-name=spaceranger
#SBATCH --output=spaceranger_%j.out
#SBATCH --error=spaceranger_%j.err
#SBATCH --cpus-per-task=XX
#SBATCH --mem=XXXG
#SBATCH --time=HH:MM:SS
#SBATCH --account=YOUR_ACCOUNT

set -euo pipefail

module load apptainer || true

WORKDIR=/path/to/project
SIF=$WORKDIR/container/spaceranger-fixed_4.0.1.sif

cd "$WORKDIR"

apptainer exec \
  --bind "$WORKDIR" \
  "$SIF" \
  spaceranger count \
    --id=RUN_NAME \
    --fastqs=fastq \
    --sample=SAMPLE_NAME \
    --transcriptome=reference/refdata-gex-GRCh38-2024-A \
    --slide=SLIDE_ID \
    --area=CAPTURE_AREA \
    --probe-set=probeset/Visium_Human_Transcriptome_Probe_Set_v2.1.0_GRCh38-2024-A.csv \
    --slidefile=slide/H1-GZ847TV.vlf \
    --cytaimage=images/cytassist.tif \
    --image=images/hires.ome.tiff \
    --create-bam=false \
    --localcores=XX \
    --localmem=XXX

echo "Done: $(date)"

ā āš™ļø Key Parameters

ParameterDescription
--idOutput run name
--fastqsFASTQ directory
--sampleSample ID in FASTQs
--transcriptomeReference genome
--slideSlide ID (must match .vlf)
--areaCapture area (e.g. A1)
--probe-setProbe annotation CSV
--slidefile.vlf geometry file
--cytaimageCytAssist image
--imageHigh-resolution tissue image
--localcoresCPU cores
--localmemRAM (GB)

ā āš ļø Critical consistency rules

  • .vlf file must match slide ID exactly
  • reference + probe set must come from the same genome build
  • imaging files must correspond to the same capture area
  • FASTQ sample name must match sequencing metadata

⁠🧱 Design of flobenhsj/spaceranger-fixed

  • āœ” Reproducible Space Ranger environment
  • āœ” Portable HPC execution via Apptainer
  • āœ” Fixed dependency stack (no drift across clusters)
  • āœ” Compatible with Visium + Visium HD workflows

Tag summary

Content type

Image

Digest

sha256:ea9509b55…

Size

1 GB

Last updated

6 months ago

docker pull flobenhsj/spaceranger-fixed:v2