GetCellMat {scCB2} | R Documentation |
CB2FindCell
output and optionally
filter out low-quality cellsHandy function to extract real cell matrix from CB2FindCell
output.
It provides the option to filter out broken cells based on proportion
of mitochondrial gene expressions. The input can also be a sparse matrix
only for cell filtering.
GetCellMat(CBout, MTfilter = 1, MTgene = NULL)
CBout |
Output object from |
MTfilter |
Numeric value between 0 and 1. Default: |
MTgene |
Character vector. User may specify customized mitochondrial gene IDs to perform the filtering. This should correspond to a subset of row names in raw data. |
A dgCMatrix
count matrix of real cells.
# Please also refer to the example in function CB2FindCell. # Simulate CB2FindCell output object. library(SummarizedExperiment) data(mbrainSub) mbrainReal <- mbrainSub[,Matrix::colSums(mbrainSub)>500] CBOut <- SummarizedExperiment( list(cell_matrix = mbrainReal[,sample(ncol(mbrainReal), 200, replace = TRUE)])) # Get cell matrix, filtering out barcodes with # more than 10% of counts from mitochondrial genes. RealCell <- GetCellMat(CBOut, MTfilter = 0.1) str(RealCell)