marker_list_to_mat: Convert a list of marker genes to a binary matrix

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Given a list of cell types and marker genes, convert to a binary cell type by gene matrix required by cellassign.

Usage

1
marker_list_to_mat(marker_list, include_other = TRUE)

Arguments

marker_list

A list where each entry is named by a cell type and contains a character vector of gene names belonging to that cell type

include_other

If TRUE adds a column of zeros for cells that do not exhibit high expression of any marker gene to be binned into

Details

This function takes a list of marker genes and converts it to a binary gene by cell type matrix. The input list should be the same length as the number of cell types with names corresponding to cell types. Each element of the list should be a character vector of the genes corresponding to that cell type. There is no requirement for mutually-exclusive marker genes.

Value

A cell type by gene binary matrix with 1 if a gene is a marker for a cell type and 0 otherwise

Examples

1
2
3
4
5
marker_list <- list(
 `cell_type_1` = c("geneA", "geneB"),
 `cell_type_2` = c("geneB", "geneC")
)
marker_list_to_mat(marker_list)

Irrationone/cellassign documentation built on April 23, 2020, 3:10 p.m.