transformSpataToSeurat: Transform spata-object to a seurat-object

View source: R/t.R

transformSpataToSeuratR Documentation

Transform spata-object to a seurat-object

Description

Takes the count matrix of your spata-object and creates a Seurat-object with it. The spata-object's feature-data is passed as input for the meta.data-argument of Seurat::CreateSeuratObject(). If specified as TRUE or named list of arguments the respective functions are called in order to pre process the object.

Usage

transformSpataToSeurat(
  object,
  assay_name = "Spatial",
  ...,
  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

object

A valid spata-object.

...

Additional parameters given to Seurat::CreateSeuratObject().

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.

assay

Character value. The name under which the count- and expression matrix is to be saved.

Details

transformSpataToSeurat() is a convenient wrapper around all functions that preprocess a seurat-object after it's initiation. The object is initiated by passing the spata-objects count-matrix and feature data to it whereupon the functions are called in the order they are presented in this documentation. For all pre processing functions 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.)

Value

A seurat-object.


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.