filterSCE: 'SingleCellExperiment' filtering

View source: R/filterSCE.R

filterSCER Documentation

SingleCellExperiment filtering

Description

Filters cells/features from a SingleCellExperiment using conditional statements a la dplyr.

Usage

filterSCE(x, ..., k = NULL)

Arguments

x

a SingleCellExperiment.

...

conditional statements separated by comma. Only rows/columns where the condition evaluates to TRUE are kept.

k

numeric or character string. Specifies the clustering to extract populations from. Must be one of names(cluster_codes(x)). Defaults to the 1st clustering available.

Value

a SingleCellExperiment.

Author(s)

Helena L Crowell helena.crowell@uzh.ch

Examples

# construct SCE & run clustering
data(PBMC_fs, PBMC_panel, PBMC_md, merging_table)
sce <- prepData(PBMC_fs, PBMC_panel, PBMC_md)
sce <- cluster(sce)

# one condition only, remove a single sample
filterSCE(sce, condition == "Ref", sample_id != "Ref1")

# keep only a subset of clusters
filterSCE(sce, cluster_id %in% c(7, 8, 18), k = "meta20")


HelenaLC/CATALYST documentation built on Oct. 16, 2024, 12:21 a.m.