gene_counts: Find the Number of Times Each Gene Has Been Expressed

Description Usage Arguments Value Examples

View source: R/feature_selection.R

Description

Find the Number of Times Each Gene Has Been Expressed

Usage

1
gene_counts(expr, transpose = FALSE)

Arguments

expr

A matrix of gene expressions with cells as rows and genes as columns

transpose

A logical value indicating whether the matrix should be transposed before operations are carried out

Value

A vector of counts of expression for each gene

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Creating Data
gene1 <- c(0, 0, 0, 0, 1, 2, 3)
gene2 <- c(5, 5, 3, 2, 0, 0, 0)
gene3 <- c(2, 0, 2, 1, 3, 0, 1)
gene4 <- c(3, 3, 3, 3, 3, 3, 3)
gene5 <- c(0, 0, 0, 0, 5, 0, 0)
genes <- matrix(c(gene1, gene2, gene3, gene4, gene5), ncol = 5)
rownames(genes) <- paste0("cell", 1:7)
colnames(genes) <- paste0("gene", 1:5)

#Calculating Gene Counts
gene_counts(genes)

hwarden162/SCEnt documentation built on Dec. 20, 2021, 5:52 p.m.