calculates the total percentage of (normalized) counts for a subset of selected genes
addGenesPerc(
gobject,
expression_values = c("normalized", "scaled", "custom"),
genes = NULL,
vector_name = "gene_perc",
return_gobject = TRUE
)
giotto object
expression values to use
vector of selected genes
column name as seen in pDataDT()
boolean: return giotto object (default = TRUE)
giotto object if return_gobject = TRUE, else a vector with
data(mini_giotto_single_cell)
# select genes (e.g. Rpl or mitochondrial)
random_genes = sample(slot(mini_giotto_single_cell, 'gene_ID'), 5)
# calculate percentage of those selected genes per cells/spot
updated_giotto_object = addGenesPerc(mini_giotto_single_cell,
genes = random_genes,
vector_name = 'random_gene_perc')
# visualize result in data.table format
pDataDT(updated_giotto_object)