goatpy.tools

Functions

annotate_glycans(sdata[, glycan_list, threshold, ...])

merge_spatialdata(→ spatialdata.SpatialData)

Merge a list of SpatialData objects into a single SpatialData object,

Module Contents

goatpy.tools.annotate_glycans(sdata, glycan_list=None, threshold=0.5, adata_slot='maldi_adata', duplicate_glycans='combine', print_stats=True)[source]
goatpy.tools.merge_spatialdata(sdatas: list, batch_names: list[str], table_name: str = 'maldi_adata', feature_join: str = 'inner') spatialdata.SpatialData[source]

Merge a list of SpatialData objects into a single SpatialData object, suffixing each element key with its batch name to avoid collisions.

SpatialData elements (images, shapes, points) are never modified. When offset_coords=True, only adata.obsm[“spatial”] and adata.uns[“spatial”] are shifted so batches appear side-by-side in scanpy/squidpy plots.

Parameters:
  • sdatas (list of SpatialData)

  • batch_names (list of str) – One label per SpatialData. Used as suffix for all element keys and added to adata.obs[“batch”].

  • table_name (str) – Key of the AnnData table in each SpatialData object.

  • offset_coords (bool) – If True, shift obsm[“spatial”] and uns[“spatial”] image coords so batches appear side-by-side in scanpy/squidpy plots. SpatialData elements are never modified regardless.

  • feature_join ("inner" | "outer") – “inner” keeps only features common to ALL samples. “outer” keeps all features, filling missing pixels with 0.

Return type:

SpatialData