filterSCE: 'SingleCellExperiment' filtering

Description Usage Arguments Value Author(s) Examples

View source: R/filterSCE.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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")

CATALYST documentation built on Nov. 8, 2020, 6:53 p.m.