loki.preprocess.load_data_for_annotation

loki.preprocess.load_data_for_annotation(st_data_path, json_path, in_tissue=True)

Loads spatial transcriptomics (ST) data from an .h5ad file and prepares it for annotation.

Parameters:
  • sample_type – The type or category of the sample (used to locate the data in the directory structure).

  • sample_name – The name of the sample (used to locate specific files).

  • in_tissue – Boolean flag to filter the data to include only spots that are in tissue. Default is True.

Returns:

  • st_ad: AnnData object containing the spatial transcriptomics data, with spatial coordinates in obs.

  • library_id: The library ID associated with the spatial data.

  • roi_polygon: Region of interest polygon loaded from a JSON file for further annotation or analysis.