Construct a count matrix from per-molecule information, typically the cell and gene of origin.
makeCountMatrix(gene, cell, all.genes=NULL, all.cells=NULL, value=NULL)
An integer or character vector specifying the gene to which each molecule was assigned.
An integer or character vector specifying the cell to which each molecule was assigned.
A character vector containing the names of all genes in the dataset.
A character vector containing the names of all cells in the dataset.
A numeric vector containing values for each molecule.
Each element of the vectors
cell and (if specified)
value contain information for a single transcript molecule.
Each entry of the output matrix corresponds to a single
If multiple molecules are present with the same combination, their values in
value are summed together, and the sum is used as the entry of the output matrix.
value=NULL, it will default to a vector of all 1's.
Each entry of the output matrix represents the number of molecules with the corresponding combination, i.e., UMI counts.
Users can pass other metrics such as the number of reads covering each molecule.
This would yield a read count matrix rather than a UMI count matrix.
all.genes is not specified, it is kept as
NULL for integer
Otherwise, it is defined as the sorted unique values of character
The same occurs for
gene is integer, its values should be positive and no greater than
gene is character, its values should be a subset of those in
The same requirements apply to
A sparse matrix where rows are genes, columns are cells and entries are the sum of
value for each gene/cell combination.
Rows and columns are named if the
cell are character or if
all.cells are specified.
nmolecules <- 100
gene.id <- sample(LETTERS, nmolecules, replace=TRUE)
cell.id <- sample(20, nmolecules, replace=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.