S2 — Normalize + Cluster
Goal
Normalize and log-transform the filtered data, then cluster spots with the standard PCA + UMAP + Leiden pipeline.
Steps
- Normalize:
normalize_visium(adata_path=..., output_path=..., plot_path=..., target_sum=..., n_top_genes=...)- Defaults:
target_sum=None(scanpy default),n_top_genes=2000. - Output: normalized h5ad + HVG plot.
- Defaults:
- Cluster:
cluster_spatial_data(adata_path=..., output_path=..., plot_path=..., n_pcs=..., resolution=...)- Defaults:
n_pcs=30,resolution=1.0(adjust if clusters look over/under-split). - Output: clustered h5ad + UMAP plot + spatial scatter colored by cluster.
- Defaults:
Outputs
results/03_normalization/<sample>_normalized.h5adresults/04_clustering/<sample>_clustered.h5adresults/04_clustering/<sample>_umap.pngresults/04_clustering/<sample>_spatial_clusters.png
Biological Interpretation
- Report the number of clusters found and their spatial distribution.
- Look at the spatial scatter: do clusters form contiguous spatial regions (tissue architecture) or scattered noise?
- If clusters are too fragmented / too coarse, suggest resolution adjustment.
Stop for Review
Present interpretation using the template from the parent spatial-transcriptomics skill. Wait for 通过 / 调整 / 跳过 before proceeding to S3.


