rank_invariance: Calculate the Rank Invariance of Each Gene from Cell and...

View source: R/rank_invariance.R

rank_invarianceR Documentation

Calculate the Rank Invariance of Each Gene from Cell and Group Ranks

Description

This function computes the Rank Invariance value for each gene, from the cell and group ranks computed by rank_cells() and rank_group() respectively. Genes with high RI values are considered good candidate TREGs.

Usage

rank_invariance(group_rank, cell_rank)

Arguments

group_rank

A data.frame() created with rank_group().

cell_rank

A data.frame() created with rank_cells().

Value

A numeric() with the rank of invariance for each gene. High values represent low Rank Invariance, these genes are considered good candidate TREGs.

See Also

Other invariance functions: rank_cells(), rank_group(), rank_invariance_express()

Examples

## Get the rank of the gene in each group
group_rank_test <- rank_group(sce_zero_test, group_col = "group")

## Get the rank of the gene for each cell
cell_rank_test <- rank_cells(sce_zero_test, group_col = "group")

## Use both rankings to calculate rank_invariance
rank_invar_test <- rank_invariance(group_rank_test, cell_rank_test)
## Highest RI value is best candidate TREG
sort(rank_invar_test, decreasing = TRUE)

LieberInstitute/TREG documentation built on Dec. 15, 2024, 12:24 p.m.