goatpy.tools
============

.. py:module:: goatpy.tools


Functions
---------

.. autoapisummary::

   goatpy.tools.annotate_glycans
   goatpy.tools.merge_spatialdata


Module Contents
---------------

.. py:function:: annotate_glycans(sdata, glycan_list=None, threshold=0.5, adata_slot='maldi_adata', duplicate_glycans='combine', print_stats=True)

.. py:function:: merge_spatialdata(sdatas: list, batch_names: list[str], table_name: str = 'maldi_adata', feature_join: str = 'inner') -> spatialdata.SpatialData

   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.

   :param sdatas:
   :type sdatas: list of SpatialData
   :param batch_names: One label per SpatialData. Used as suffix for all element keys
                       and added to adata.obs["batch"].
   :type batch_names: list of str
   :param table_name: Key of the AnnData table in each SpatialData object.
   :type table_name: str
   :param offset_coords: 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.
   :type offset_coords: bool
   :param feature_join: "inner" keeps only features common to ALL samples.
                        "outer" keeps all features, filling missing pixels with 0.
   :type feature_join: "inner" | "outer"

   :rtype: SpatialData


