parse_phenotypes: Parse a vector of phenotype names

Description Usage Arguments Value Details Examples

View source: R/select_rows.R

Description

This helper function takes a user-friendly list of single and multiple phenotype names and converts it to a named list of phenotype selectors for use with select_rows. By using parse_phenotypes a user does not have to know the (somewhat inscrutable) details of select_rows.

Usage

1

Arguments

...

Phenotypes to be decoded, or a list of same, optionally with names.

Value

A named list of phenotype selectors for use with select_rows.

Details

Each phenotype must be either a single phenotype name (e.g. CD3+ or CD8-) or two or more names separated by a slash (/) or comma (,).

Phenotypes containing slashes are interpreted as requiring all of the individual phenotypes. For example, "CD3+/CD8-" is a CD3+ cell which is also CD8-.

Phenotypes containing commas are interpreted as requiring any of the individual phenotypes. For example, "CD68+,CD163+" is a cell which is either CD68+ or CD163+ or both.

Additionally,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Create selectors for
# - All CD3+ cells
# - CD3+/CD8+ double-positive cells
# - CD3+/CD8- single-positive cells
# - CD3+ cells with membrane PDL-1 > 5
# - All cells regardless of phenotype
# - Macrophages, defined as either CD68+ OR CD163+
parse_phenotypes("CD3+", "CD3+/CD8+", "CD3+/CD8-",
                 "CD3+/PDL-1+"="CD3+/~`Membrane PDL-1 (Opal 520) Mean`>5",
                 "Total Cells", Macrophage="CD68+,CD163+")

akoyabio/phenoptr documentation built on Jan. 7, 2022, 5:37 p.m.