Learn R Programming

cellassign (version 0.99.2)

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

Description

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

Usage

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

Value

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

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.

Examples

Run this code
# NOT RUN {
marker_list <- list(
 `cell_type_1` = c("geneA", "geneB"),
 `cell_type_2` = c("geneB", "geneC")
)
marker_list_to_mat(marker_list)

# }

Run the code above in your browser using DataLab