Skip to contents

helper function to check the inputs passed to create geneset function

Usage

check_geneset_input(data_lst, bin_type, bin_param, w_x, w_y, cluster_info)

Arguments

data_lst

A list of named matrices containing the coordinates of transcripts or the count matrix. If the transcript coordinates are provided, the spatial vectors will be created directly from the transcript coordinates for a given set of genes. In this case, every matrix must contain "x", "y", "feature_name" columns. If the a list of count matrices is provided, the spatial vectors will be defined with the cell coordinates and the count matrix. In the second case, the parameter `cluster_info` must be specified to provide cell coordinates.

bin_type

A string indicating which bin shape is to be used for vectorization. One of "square" (default), "rectangle", or "hexagon".

bin_param

A numeric vector indicating the size of the bin. If the bin_type is "square" or "rectangle", this will be a vector of length two giving the numbers of rectangular quadrats in the x and y directions. If the bin_type is "hexagonal", this will be a number giving the side length of hexagons. Positive numbers only.

w_x

A numeric vector of length two specifying the x coordinate limits of enclosing box.

w_y

A numeric vector of length two specifying the y coordinate limits of enclosing box.

cluster_info

If the `data_lst` contains the transcript coordinates, this parameter must be set to NULL. If the `data_lst` contains the count matrix, `cluster_info` should be a dataframe/matrix containing the centroid coordinates, cluster sample label for each cell.The column names must include "x" (x coordinate), "y" (y coordinate), "cluster" (cluster label) and "sample" (sample).

Value

A list of two elements