spateo.tdr.interpolations.utils =============================== .. py:module:: spateo.tdr.interpolations.utils Functions --------- .. autoapisummary:: spateo.tdr.interpolations.utils.get_X_Y_grid Module Contents --------------- .. py:function:: get_X_Y_grid(adata: Optional[anndata.AnnData] = None, genes: Optional[List] = None, X: Optional[numpy.ndarray] = None, Y: Optional[numpy.ndarray] = None, grid_num: List = [50, 50, 50]) -> Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray] Prepare the X (spatial coordinates), Y (gene expression) and grid points for the kernel or deep model. :param adata: AnnData object that contains spatial (numpy.ndarray) in the `obsm` attribute. :param genes: Gene list whose interpolate expression across space needs to learned. If Y is provided, genes will only be used to retrive the gene annotation info. :param X: The spatial coordinates of each data point. :param Y: The gene expression of the corresponding data point. :param grid_num: Number of grid to generate. Default is 50 for each dimension. Must be non-negative. :returns: spatial coordinates. Y: gene expression of the associated spatial coordinates. Grid: grid points formed with the input spatial coordinates. grid_in_hull: A list of booleans indicates whether the current grid points is within the convex hull formed by the input data points. :rtype: X