SDAS Input Data Format Description
Users can directly use the single or multiple spatial transcriptomics expression matrices generated by SAW, or prepare files themselves according to the h5ad and rds format descriptions below as SDAS input. For more detailed format descriptions, please refer to the usage instructions of each module.
h5ad file: AnnData object
Raw expression matrix: Can be stored in adata.layers (specify the key via the --layer parameter in the SDAS command line), or in adata.raw.X, adata.X
Gene name (i.e., gene symbol): Can be stored in adata.var["real_gene_name"], or other columns of adata.var (specify the key via the --gene_symbol_key parameter in the SDAS command line)
Spatial coordinates (x, y): Spatial coordinates are stored in adata.obsm["spatial"] and are used by scanpy.pl.spatial() for plotting spatial maps or for other spatial distance calculations. The coordinate system must conform to the standard output format of SAW software. The unit of the coordinates is specified as pixels of the spatial chip.
Spatial Coordinates Example (Stereo-seq data, bin100 resolution):
print(adata.obsm["spatial"])
# Output format: [x_coordinate, y_coordinate]
[[100 7900] # First spatial point coordinate
[100 8000] # Second spatial point coordinate
[100 8100] # Third spatial point coordinate
...
[20200 18800] # Third-to-last spatial point coordinate
[20200 18900] # Second-to-last spatial point coordinate
[20200 19000]] # Last spatial point coordinate
rds file: Seurat v4 assay object
Raw expression matrix: Stored in the counts of the default assay (e.g., @assays$RNA@counts), or specify the assay name in SDAS via --assay
Gene name (i.e., gene symbol): Can be stored in meta.features["real_gene_name"], or other columns of meta.features (specify the key via --gene_symbol_key in SDAS)
Spatial coordinates (x, y): Stored in @reductions$spatial, used for FeaturePlot(reduction="spatial") or DimPlot(reduction = "spatial") to plot spatial maps
Last updated