add_label: Adds useful labels to colData.

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Can be used to add cell types to cluster numbers

Usage

1
add_label(fsce, labels, by = NULL, expt = "rnaseq")

Arguments

fsce

An object of class FunctionalSingleCellExperiment

labels

dataframe of new labels. Must contain at least one column of matching variables (e.g. cell_id or k_cluster)

by

column name labels to match in colData of expt. If NULL, will match by all matching column names

expt

Data to use for match labels (default is rnaseq). Must be present in names(fsce).

Value

fsce with all labels in expt colData.

Examples

1
2
3
4
5
6
7
8
# Add cell_type labels to PBMC data

labels <- data.frame(k_cluster = as.factor(c("1", "2", "3", "4", "5", "6")),
label = c("MC", "NK", "NK+T", "MC", "MK", "CD4/8 T"))

fsce <- add_label(fsce_small, labels)

SingleCellExperiment::colData(fsce[["rnaseq"]])

hesselberthlab/scrunchy documentation built on Nov. 11, 2019, 2:29 p.m.