SpatialFeatureExperiment-subset: Subsetting SpatialFeatureExperiment objects

SpatialFeatureExperiment-subsetR Documentation

Subsetting SpatialFeatureExperiment objects

Description

Note that spatial neighborhood graphs may change meaning after subsetting. For example, for a k nearest neighbor graph, after subsetting, some cells might no longer have all k nearest neighbors from the original

Usage

## S4 method for signature 'SpatialFeatureExperiment,ANY,ANY,ANY'
x[i, j, ..., drop = FALSE]

Arguments

x

A SpatialFeatureExperiment object.

i

Row indices for subsetting.

j

column indices for subsetting.

...

Passed to the SingleCellExperiment method of [.

drop

Ignored as of version 1.9.2.

Value

A subsetted SpatialFeatureExperiment object.

Examples

# Just like subsetting matrices and SingleCellExperiment
library(SFEData)
sfe <- McKellarMuscleData(dataset = "small")
sfe_subset <- sfe[seq_len(10), seq_len(10), drop = TRUE]
# Gives warning as graph reconstruction fails

sfe_subset <- sfe[seq_len(10), seq_len(10)]


pachterlab/SpatialFeatureExperiment documentation built on Nov. 15, 2024, 1:46 a.m.