omicverse.io.spatial.write_visium_hd_cellseg#
- omicverse.io.spatial.write_visium_hd_cellseg(adata, path, sample=None)[source]#
Export cell-level AnnData to SpaceRanger v4-compatible directory structure.
Creates the following output files:
path/ ├── filtered_feature_cell_matrix.h5 ├── graphclust_annotated_cell_segmentations.geojson └── spatial/ ├── tissue_hires_image.png ├── tissue_lowres_image.png └── scalefactors_json.json- Parameters:
adata (AnnData) – Cell-level AnnData from
bin_to_cell()orread_visium_hd_seg(). Must haveobs["geometry"](WKT strings) andobsm["spatial"].path (str or Path) – Output directory to write SpaceRanger-like structure.
sample (str, optional) – Sample key in
adata.uns["spatial"]. If None, uses the first key.