SpatialImage-methods {SeuratObject}R Documentation

SpatialImage methods

Description

Methods defined on the SpatialImage class. Some of these methods must be overridden in order to ensure proper functionality of the derived classes (see Required methods below). Other methods are designed to work across all SpatialImage-derived subclasses, and should only be overridden if necessary

Usage

## S3 method for class 'SpatialImage'
Cells(x, ...)

## S3 method for class 'SpatialImage'
DefaultAssay(object, ...)

## S3 replacement method for class 'SpatialImage'
DefaultAssay(object, ...) <- value

## S3 method for class 'SpatialImage'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

## S3 method for class 'SpatialImage'
GetTissueCoordinates(object, ...)

## S3 method for class 'SpatialImage'
IsGlobal(object, ...)

## S3 method for class 'SpatialImage'
Key(object, ...)

## S3 replacement method for class 'SpatialImage'
Key(object, ...) <- value

## S3 method for class 'SpatialImage'
Radius(object, ...)

## S3 method for class 'SpatialImage'
RenameCells(object, new.names = NULL, ...)

## S3 method for class 'SpatialImage'
x[i, ...]

## S3 method for class 'SpatialImage'
dim(x)

## S3 method for class 'SpatialImage'
subset(x, cells, ...)

## S4 method for signature 'SpatialImage'
show(object)

Arguments

x, object

A SpatialImage-derived object

...

Arguments passed to other methods

value

Depends on the method:

DefaultAssay<-

Assay that the image should be associated with

Key<-

New key for the image

mode

How to return the image; should accept one of “grob”, “raster”, “plotly”, or “raw”

new.names

vector of new cell names

i, cells

A vector of cells to keep

Value

[Override] Cells: should return cell names

DefaultAssay: The associated assay of a SpatialImage-derived object

DefaultAssay<-: object with the associated assay updated

[Override] GetImage: The image data from a SpatialImage-derived object

[Override] GetTissueCoordinates: ...

IsGlobal: returns TRUE as images are, by default, global

Key: The key for a SpatialImage-derived object

Key<-: object with the key set to value

Radius: The spot radius size; by default, returns NULL

[Override] RenameCells: object with the new cell names

[, subset: x/object for only the cells requested

[Override] dim: The dimensions of the image data in (Y, X) format

show: Prints summary to stdout and invisibly returns NULL

Functions

Provided methods

These methods are defined on the SpatialImage object and should not be overridden without careful thought

Required methods

All subclasses of the SpatialImage class must define the following methods; simply relying on the SpatialImage method will result in errors. For required parameters and their values, see the Usage and Arguments sections

Cells

Return the cell/spot barcodes associated with each position

dim

Return the dimensions of the image for plotting in (Y, X) format

GetTissueCoordinates

Return tissue coordinates; by default, must return a two-column data.frame with x-coordinates in the first column and y-coordinates in the second

Radius

Return the spot radius; returns NULL by default for use with non-spot image technologies

RenameCells

Rename the cell/spot barcodes for this image

subset

Subset the image data by cells/spots

These methods are used throughout Seurat, so defining them and setting the proper defaults will allow subclasses of SpatialImage to work seamlessly

See Also

DefaultAssay

GetImage

GetTissueCoordinates

IsGlobal

Key

RenameCells


[Package SeuratObject version 5.0.2 Index]