stlearn.read_xenium

stlearn.read_xenium(feature_cell_matrix_file: str | Path, cell_summary_file: str | Path, image_path: Path | None = None, library_id: str | None = None, scale: float = 1.0, quality: str = 'hires', spot_diameter_fullres: float = 15, background_color: Literal['black', 'white'] = 'white', alignment_matrix_file: str | Path | None = None, experiment_xenium_file: str | Path | None = None, default_pixel_size_microns: float = 0.2125) AnnData[source]

Read Xenium data

Parameters:
  • feature_cell_matrix_file – Path to feature cell count matrix file. Only support h5ad file now.

  • cell_summary_file – Path to cell summary CSV file.

  • image_path – Path to image. Only need when loading full resolution image.

  • library_id – Identifier for the Xenium library. Can be modified when concatenating multiple adata objects.

  • scale – Set scale factor.

  • quality – Set quality that convert to stlearn to use. Store in anndata.obs[‘imagecol’ & ‘imagerow’]

  • spot_diameter_fullres – Diameter of spot in full resolution

  • background_color – Color of the background. Only black or white is allowed.

  • alignment_matrix_file – Path to transformation matrix CSV file exported from Xenium Explorer. If provided, coordinates will be transformed according to coordinate_space.

  • experiment_xenium_file – Path to experiment.xenium JSON file. If provided, pixel_size will be read from here.

  • default_pixel_size_microns – Pixel size in microns (default 0.2125 for Xenium data).

Return type:

AnnData