← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-spatial-transcriptomics-spatial-preprocessing / references / usage-guide.md

Spatial Preprocessing - Usage Guide

Overview

This skill covers quality control, filtering, and normalization for spatial transcriptomics data, with the decisions forked by platform class. Sequencing/spot data (Visium, Visium HD, Slide-seq, Stereo-seq) and imaging/in-situ data (Xenium, MERSCOPE/MERFISH, CosMx, seqFISH) need different QC floors and, critically, different normalization. The central reframe is that in spatial data library size carries biology rather than pure technical depth, so the scRNA reflex of dividing it out removes real spatially-structured signal and degrades downstream domain detection. The skill gives per-platform QC floors, the negative-control false-discovery metric for imaging specificity, and a normalization decision table that steers skewed targeted panels toward cell-area normalization instead of Pearson residuals.

Prerequisites

pip install squidpy scanpy anndata spatialdata

Quick Start

Tell your AI agent what you want to do: - "QC and normalize my Visium data" - "Set QC floors for my Xenium cells without deleting real cells" - "Compute the negative-control false-discovery rate for my MERFISH panel" - "Normalize my imaging data by cell area instead of library size" - "Show QC metrics on the tissue to check for spatial artifacts"

Example Prompts

QC floors by platform

"My Xenium cells have about 100 transcripts each -- what count floor should I use so I do not delete real lymphocytes?"

"Run QC on my Visium section using tissue-appropriate UMI, gene, and mito thresholds and show me where the cut spots fall."

Specificity and controls

"Compute the negative-control-probe and blank-barcode false-discovery rate for my imaging panel and drop the controls before clustering."

Normalization decision

"Should I normalize my spatial data at all, given that library size tracks cellularity? Pick a method for my skewed targeted panel."

"Normalize my Xenium data by segmented cell area rather than total counts and explain why Pearson residuals would not fix the panel-skew bias."

Spatial QC inspection

"Map total counts and genes per cell onto the tissue to check for an edge or permeabilization gradient before I threshold."

What the Agent Will Do

  1. Identify the platform class (spot vs imaging) to fork every threshold decision.
  2. Annotate negative controls and mito genes, then compute QC metrics.
  3. Compute the negative-control false-discovery rate as the imaging specificity metric.
  4. Map QC metrics onto tissue coordinates to catch spatial artifacts before cutting.
  5. Apply platform-appropriate floors that do not preferentially delete small real cells.
  6. Choose a normalization method from the decision table -- cell-area/volume for skewed imaging panels, deliberate log1p or Pearson residuals for whole-transcriptome spot data.

Tips