Default function for any spatial related experiment whoose spata2 objects are initiated with a raw count matrix. See details for more information.

initiateSpataObject_CountMtr(
  coords_df,
  count_mtr,
  sample_name,
  spatial_method = "Unknown",
  image = NULL,
  image_class = "HistologyImage",
  image_object = NULL,
  feature_df = NULL,
  directory_spata = NULL,
  directory_seurat = NULL,
  combine_with_wd = FALSE,
  SCTransform = FALSE,
  NormalizeData = list(normalization.method = "LogNormalize", scale.factor = 1000),
  FindVariableFeatures = list(selection.method = "vst", nfeatures = 2000),
  ScaleData = TRUE,
  RunPCA = list(npcs = 60),
  FindNeighbors = list(dims = 1:30),
  FindClusters = list(resolution = 0.8),
  RunTSNE = TRUE,
  RunUMAP = list(dims = 1:30),
  verbose = TRUE,
  ...
)

Arguments

coords_df

Data.frame containing information about the positions of all barcode-spots in form of a numeric x- and y-variable. The key-variable barcodes needs to be of type character and must be identical to the column names of the input matrix.

count_mtr

A numeric matrix to be used as the count matrix. Rownames must correspond to the genes and column names must correspond to the barcodes.

sample_name

Character value. Denotes the name of the sample you are analyzing with the spata-object. The future input for SPATA's of_sample-argument.

image

An Image of the sample that can be displayed as the surface plot's background.

SCTransform

A named list of arguments given to Seurat::SCTransform(), TRUE or FALSE.

NormalizeData

A named list of arguments given to Seurat::NormalizeData(), TRUE or FALSE.

FindVariableFeatures

A named list of arguments given to Seurat::FindVariableFeatures(), TRUE or FALSE.

ScaleData

A named list of arguments given to Seurat::ScaleData(), TRUE or FALSE.

Hint: If set to TRUE or the argument-list provided does not specify the argument features input for argument features is set to base::rownames(seurat_object).

RunPCA

A named list of arguments given to Seurat::RunPCA(), TRUE or FALSE.

FindNeighbors

A named list of arguments given to Seurat::FindNeighbors(), TRUE or FALSE.

FindClusters

A named list of arguments given to Seurat::FindClusters(), TRUE or FALSE.

RunTSNE

A named list of arguments given to Seurat::RunTSNE(), TRUE or FALSE.

RunUMAP

A named list of arguments given to Seurat::RunUMAP(), TRUE or FALSE.

...

Additional parameters given to Seurat::CreateSeuratObject().

Value

A spata2 object.

Details

The loading and preprocessing of the spata2 object currently relies on the Seurat-package. Before any pre processing function is applied mitochondrial and stress genes are discarded. For more advanced users the arguments above starting with a capital letter allow to manipulate the way the spata2 object is processed. For all of these arguments apply the following instructions:

  • If set to FALSE the processing function is skipped.

  • If set to TRUE the respective function is called with it's default argument settings. Note: RunUMAP() needs additional input!

  • If a named list is provided the respective function is called whereby the named list will provide the argument-input (the Seurat object to be constructed must not be named and will be passed to every function as the first argument!!!.)

Note that certain listed functions require previous functions! E.g. if RunPCA is set to FALSE RunTSNE() will result in an error. (base::tryCatch() will prevent the function from crashing but the respective slot is going to be empty.) Skipping functions might result in an incomplete spata2 object.