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 |
... |
Arguments passed to other methods |
value |
Depends on the method:
|
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
-
Cells(SpatialImage)
: Get the cell names from an image ([Override]) -
DefaultAssay(SpatialImage)
: Get the associated assay of aSpatialImage
-derived object -
DefaultAssay(SpatialImage) <- value
: Set the associated assay of aSpatialImage
-derived object -
GetImage(SpatialImage)
: Get the image data from aSpatialImage
-derived object -
GetTissueCoordinates(SpatialImage)
: Get tissue coordinates for aSpatialImage
-derived object ([Override]) -
IsGlobal(SpatialImage)
: Globality test forSpatialImage
-derived object -
Key(SpatialImage)
: Get the key for aSpatialImage
-derived object -
Key(SpatialImage) <- value
: Set the key for aSpatialImage
-derived object -
Radius(SpatialImage)
: Get the spot radius size -
RenameCells(SpatialImage)
: Rename cells in aSpatialImage
-derived object ([Override]) -
[
: Subset aSpatialImage
-derived object -
dim(SpatialImage)
: Get the plotting dimensions of an image ([Override]) -
subset(SpatialImage)
: Subset aSpatialImage
-derived object ([Override]) -
show(SpatialImage)
: Overview of aSpatialImage
-derived object
Provided methods
These methods are defined on the SpatialImage
object and should not
be overridden without careful thought
-
GetImage
; this method can be overridden to provide image data, normally returns empty image data. If overridden, should default to returning agrob
object -
Radius
; this method can be overridden to provide a spot radius for image objects -
[
; this method can be overridden to change default subset behavior, normally returnssubset(x = x, cells = i)
. If overridden, should only accepti
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