SubsetSTData: Subset a Seurat object containing Staffli image data

SubsetSTDataR Documentation

Subset a Seurat object containing Staffli image data

Description

Subsets a Seurat object containing Spatial Transcriptomics data while making sure that the images and the spot coordinates are subsetted correctly. If you use the default subset function there is a risk that images are kept in the output Seurat object which will make the STUtility functions crash.

Usage

SubsetSTData(
  object,
  expression,
  spots = NULL,
  features = NULL,
  idents = NULL,
  ...
)

Arguments

object

A Seurat object containing Staffli data

expression

Logical expression indicating features/variables to keep

spots

A vector of spots to keep

features

A vector of features to keep

idents

A vector of identity classes to keep

...

Extra parameters passed to WhichCells, such as slot, invert, or downsample

Examples

## Not run: 
# Subset using meta data to keep spots with more than 1000 unique genes
se.subset <- SubsetSTData(se, expression = nFeature_RNA >= 1000)

# Subset by a predefined set of spots 
se.subset <- SubsetSTData(se, spots = keep.spots)

# Subset by a predefined set of features
se.subset <- SubsetSTData(se, features = keep.features)

## End(Not run)

jbergenstrahle/STUtility documentation built on March 14, 2023, 7:15 a.m.