get_gene_pct: Get percent of reads aligned to given gene(s)

View source: R/objects.R

get_gene_pctR Documentation

Get percent of reads aligned to given gene(s)

Description

Add a data column for each droplet giving the percentage of raw reads/UMIs that align to genes given in genes. The column name is specified by name.

Usage

get_gene_pct(x, genes, name)

Arguments

x

An SCE object.

genes

Genes to calculate percentage of in counts.

name

Column name to place in dropl_info.

Value

An SCE object.

Examples

# Add MT%
mt_genes <- grep(pattern="^mt-", x=rownames(mb_small@gene_data), ignore.case=TRUE, value=TRUE)
mb_small <- get_gene_pct(x = mb_small, genes=mt_genes, name="pct.mt")
# Add MALAT1
genes <- grep(pattern="^malat1$", x=rownames(mb_small@gene_data), ignore.case=TRUE, value=TRUE)
mb_small <- get_gene_pct(x = mb_small, genes=genes, name="MALAT1")

marcalva/diem documentation built on Jan. 1, 2023, 2:33 a.m.