get_prop_zero: Get the Proportion of Zero Counts for Each Gene in Each Group

View source: R/get_prop_zero.R

get_prop_zeroR Documentation

Get the Proportion of Zero Counts for Each Gene in Each Group

Description

This function calculates the Proportion Zero for each gene in each user defined group. Proportion Zero = number of zero counts for a gene for a group of cells/number of cells in the group.

Usage

get_prop_zero(sce, group_col = "cellType")

Arguments

sce

SummarizedExperiment-class object

group_col

name of the column in the colData() of sce that defines the group of interest.

Details

For more information about calculating Proportion Zero, check equation 1 from the vignette in section "Calculate Proportion Zero and Pick Cutoff".

Value

A data.frame() containing proportion of zero counts, genes as rows, groups as columns.

See Also

Other Proportion Zero functions: filter_prop_zero()

Examples

## Basic Proportion counts == 0
rowSums(assays(sce_zero_test)$counts == 0) / ncol(sce_zero_test)

## Get proportion by the default group "cellType"
get_prop_zero(sce_zero_test)

## Get proportion by user defined grouping of the data
get_prop_zero(sce_zero_test, group_col = "group")

## Groups with missing levels will be dropped
get_prop_zero(sce_zero_test, group_col = "cellType_na")

LieberInstitute/TREG documentation built on May 7, 2024, 3:49 p.m.