Skip to contents

This function will build gene vectors based on the transcript coordinates of every gene

Usage

get_gene_vectors_tr(
  data_lst,
  all_genes,
  bin_type,
  bin_param,
  bin_length,
  w_x,
  w_y
)

Arguments

data_lst

A list of list. Every nested list refers to one sample, which must contain at least one matrix with transcript coordinates. Optional parameter.

all_genes

A vector of strings giving the name of the genes you want to test. This will be used as column names for one of the result matrix gene_mt.

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.

bin_length

A positive integer giving the length of total bins

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.

Value

a matrix contains the transcript count in each grid. Each row refers to a grid, and each column refers to a gene.