Configuration Reference and Practical Tips
Practical tips:
- Scenario 1: use Snakemake reproducibility to retune parameters and rerun a module
For example, if the
resolutionandpcsvalues used in--option=clusteringdo not produce a satisfactory clustering result, you can adjust them and rerun the step.Tune
resolutionandpcsbased on the UMAP result, for example by trying different resolution values such as 0.5, 0.7, or 0.9.You can also use the built-in Snakemake rerun option. Add
-rto the original command to remove the previous result for that step automatically, then rerun the same command without-rto execute the module again with the updated parameters.
- Scenario 2: run downstream modules independently, using either single-cell or spatial transcriptomics data as input
In many studies, spatial transcriptomics data are accompanied by high-quality single-cell sequencing data generated under comparable experimental conditions. In that case, some downstream modules, such as ligand-receptor analysis or transcription factor analysis, can also use transcriptomics data in
anndata/h5adformat as input, providing indirect support for the interpretation of spatial transcriptomics results.- Scenario 3: atlas-style analysis with repeated splitting, reclustering, and subcluster annotation across multiple cell types
For example, when using
--option=reclustering, you may want to refine several cell types in parallel.Add the split
zarrfiles for different cell types tosample.txtand assign distinct names.Use Snakemake parallelization to process different cell types simultaneously and improve efficiency. Note that this approach does not support per-sample parameter tuning. If one result is unsatisfactory, rerun that dataset separately with adjusted parameters.
- Scenario 4: use
useful_toolfor ROI selection and sample splitting Typical use cases for
--option=splittinginclude:Multiple samples are present on the same slide and need to be separated before analysis.
After major-cell-type annotation, you want to focus on tumor infiltration regions or peri-tumor microenvironments.
You want to define irregular ROIs using Loupe or Xenium Explorer.
You want to define approximate rectangular ROIs using image coordinates.
Scenario 5: interact with the R/Seurat ecosystem through transform
Some spatial transcriptomics tools are available only in R, so you can use
--option=transformto convert the data into a Seurat object for downstream analysis.Likewise, you can convert the data into standard
anndataformat when needed.
Scenario 6: resume after an interrupted run
Use
--unlockto unlock the workflow and rerun the interrupted module.
Scenario 7: add analysis stages midway by following the expected file structure
In
core_analysis, the stages before annotation require sample names, raw files, and related metadata to ensure stable execution. If you want to run only one of these steps with your own data, place{sample}.zarrunderresults/{sample}/{option}/and Spatialsnake will use the information insample.txtto continue from the expected input state.For downstream modules or utility modules, raw files are not required. You only need to provide the correct input files as described in the corresponding tutorial.
Parameter reference: