process_input: process input data from ST pipeline to make sure they conform...

Description Usage Arguments Value

View source: R/process_input.R

Description

process input data from ST pipeline to make sure they conform to the format the package expects

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
process_input(
  counts,
  ids = NULL,
  img_path = NULL,
  separate_by = "x",
  force_counts = FALSE,
  force_indices = FALSE,
  dup.sep = "_",
  n.gene.cutoff = 100,
  verbose = TRUE,
  normalize = FALSE
)

Arguments

counts

non-negative numeric matrix containing gene counts, rows correspond to spots, columns correspond to genes

ids

data frame or matrix assigning spatial coordinates to the spots, the spot 0,0 is in the right lower corner of the corresponding tissue slide and the number of spots along the X-axis is higher than the number of spots on the Y-axis. optional if spatial information is contained in rownames of counts

img_path

character, optional. file path to ST slide image

separate_by

only necessary if spatial information is given as in the output of ST Pipeline (Navarro et al.), e.g. 32x2; default x

force_counts

logical, in case there are less genes than spots this needs to be TRUE; default FALSE

force_indices

logical, in case the range of x and y indices is not the same as in the ST barcode files

dup.sep

character, optional; if duplicate gene names are distinguished by e.g. 1, 2 at the end, pass dup.sep="" to try to combine these columns; default ""

n.gene.cutoff

integer > 0, number of genes that need to be expressed in a spots in order for the spot not to be removed from the data

verbose

logical, default TRUE

normalize

logical, default FALSE

Value

list with three entries:

  1. counts - count matrix

  2. ids - barcode data frame assigning spatial positions to spots

  3. img - image (EBImage object), if img_path is supplied

  4. counts.normalized - normalized counts matrix, if normalize is true; NULL else


tmirus/TTT documentation built on April 17, 2021, 11:04 p.m.