transformSeuratToSpata | R Documentation |
This function provides a convenient way to transform your seurat-object into a spata-object while maintaining as much analysis progress as possible. See details for more information.
transformSeuratToSpata(
seurat_object,
sample_name,
method = "spatial",
coords_from = "pca",
assay_name = NULL,
assay_slot = NULL,
image_name = NULL,
gene_set_path = NULL,
verbose = TRUE
)
seurat_object |
A valid seurat object. |
sample_name |
Character value. Future input for SPATA's |
method |
Character value. Determines the data slots from which to compile the spata-object.
|
coords_from |
Character value. Either 'pca', 'tsne' or 'umap'. Only relevant if |
assay_name |
Character value. Denotes the assay from which to transfer
the data. If the seurat-object contains only one assay |
assay_slot |
Character value. Denotes the slot of the seurat-object's
assay object from which to transfer the expression matrix (the count matrix
is always taken from slot |
gene_set_path |
Character value (or NULL). Specifies the path to a .RDS-file containing a data.frame that is to be used as input for slot @used_genesets. Must have the character-variables
If set to NULL the default gene-set data.frame will used. Run |
verbose |
Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
This function assembles a spata-object from the data it finds in the provided
seurat-object. This always includes gene count- and expression-matrices as well as
dimensional reduction data like PCA, UMAP and TSNE. Whenever transformSpataToSeurat()
does not find anything it well tell you via a warning message or an error message if the missing
data is essential to the spata-object. You might have to run certain functions afterwards with the
obtained SPATA-object. (e.g. did not find UMAP data in seurat-object -> runUmap()
).
If your seurat-object contains more than one assay-object or more than one
SpatialImage-object you need to specify the respective objects by name using the arguments
assay_name
and image_name
. If the assay you denoted with assay_name
contains more than one valid expression matrix you need to specify the one you
want to use as the spata-object's scaled_mtr using the argument assay_slot
.
Seurat-objects containing data derived from spatial experiments (method
= 'spatial'):
If you specify argument method
as 'spatial' transformSeuratToSpata()
assumes that the provided seurat-object contains a SpatialImage-object in slot @images
from which it will extract the coordinates and the histology image.
Seurat-objects containing data derived from spatial experiments (method
= 'single_cell'):
If you specify argument method
as 'single_cell' transformSeuratToSpata()
uses either tsne or umap embedding as surrogate coordinates.
A spata object.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.