goatpy.io
=========

.. py:module:: goatpy.io


Functions
---------

.. autoapisummary::

   goatpy.io.parmap
   goatpy.io.getimage
   goatpy.io.rd_peaks
   goatpy.io.rd_peaks_from_package
   goatpy.io.glyco_spatialdata
   goatpy.io.centroids_to_pixel_squares
   goatpy.io.ihc_spatialdata


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

.. py:function:: parmap(f, X, nprocs=None)

   Parallel map using joblib (more robust for Jupyter).

   :param f: Function to apply to each element
   :type f: callable
   :param X: Input data
   :type X: iterable
   :param nprocs: Number of processes (default: -1, all CPUs)
   :type nprocs: int, optional

   :returns: Results in same order as input
   :rtype: list


.. py:function:: getimage(peak, path, tol=0.1, reduce_func=sum)

.. py:function:: rd_peaks(fn)

.. py:function:: rd_peaks_from_package()

.. py:function:: glyco_spatialdata(imzml_path, peaks_path=None, tol=0.1, pixel_size=20, reduce_func=sum)

.. py:function:: centroids_to_pixel_squares(df, x_col='x', y_col='y', pixel_size=1.0)

.. py:function:: ihc_spatialdata(ihc_image_path, channel_names=None, image_key='ihc_image')

   Generate a SpatialData object from a multichannel IHC TIFF/OME-TIFF image.

   :param ihc_image_path: Path to TIFF/OME-TIFF image.
   :type ihc_image_path: str
   :param channel_names: Names of image channels.
                         Example:
                         ["sc_405", "CF_488", "CF_561", "DIC"]
   :type channel_names: list, optional
   :param image_key: Name of image key in SpatialData object.
   :type image_key: str

   :rtype: SpatialData


