knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of TREG
is to help find candidate Total RNA Expression Genes (TREGs)
in single nucleus (or single cell) RNA-seq data.
Note: TREG is pronounced as a single word and fully capitalized, unlike Regulatory T cells, which are known as "Tregs" (pronounced "T-regs"). The work described here is unrelated to regulatory T cells.
The expression of a TREG is proportional to the the overall RNA expression in a cell. This relationship can be used to estimate total RNA content in cells in assays where only a few genes can be measured, such as single-molecule fluorescent in situ hybridization (smFISH).
In a smFISH experiment the number of TREG puncta can be used to infer the total RNA expression of the cell.
The motivation of this work is to collect data via smFISH in to help build better deconvolution algorithms. But may be many other application for TREGs in experimental design!
{width=50%}
The gene must have non-zero expression in most cells across different tissue and cell types.
A TREG should also be expressed at a constant level in respect to other genes across different cell types or have high rank invariance.
Be measurable as a continuous metric in the experimental assay, for example have a dynamic range of puncta when observed in RNAscope. This will need to be considered for the candidate TREGs, and may need to be validated experimentally.
{width=30%}
TREG
{width=100%}
Filter for low Proportion Zero genes snRNA-seq dataset: This is
facilitated with the functions get_prop_zero()
and filter_prop_zero()
.
snRNA-seq data is notoriously sparse, these functions enrich for genes with more
universal expression.
Evaluate genes for Rank Invariance The nuclei are grouped only
by cell type. Within each cell type, the mean expression for each
gene is ranked, the result is a vector (length is the number of
genes), using the function rank_group()
. Then the expression of each gene is
ranked for each nucleus,the result is a matrix (the number of nuclei x number
of genes), using the function rank_cells()
.Then the absolute difference
between the rank of each nucleus and the mean expression is found, from here
the mean of the differences for each gene is calculated, then ranked.
These steps are repeated for each group, the result is a matrix of ranks, (number of cell
types x number of genes). From here the sum of the ranks for each
gene are reversed ranked, so there is one final value for each gene,
the “Rank Invariance” The genes with the highest rank-invariance are
considered good candidates as TREGs. This is calculated with rank_invariance_express()
.
This full process is implemented by: rank_invariance_express()
.
Get the latest stable R
release from CRAN. Then install TREG
using from Bioconductor the following code:
if (!requireNamespace("BiocManager", quietly = TRUE)) { install.packages("BiocManager") } BiocManager::install("TREG")
And the development version from GitHub with:
BiocManager::install("LieberInstitute/TREG")
## Load packages library("TREG")
A TREG gene should be expressed in almost every cell. The set of genes should be filtered by maximum Proportion Zero within a groups of cells.
## Calculate Proportion Zero in groups defined by a column in colData (prop_zero <- get_prop_zero(sce = sce_zero_test, group_col = "cellType")) ## Get list of genes that pass the max Proportion Zero filter (filtered_genes <- filter_prop_zero(prop_zero, cutoff = 0.9)) ## Filter sce object to this list of genes sce_filter <- sce_zero_test[filtered_genes, ]
The genes with the highest Rank Invariance are considered good candidates as TREGs. In this example the gene g0 would be the strongest candidate TREG.
## Get the Rank Invariance value for each gene ## The highest values are the best TREG candidates ri <- rank_invariance_express(sce_filter) sort(ri, decreasing = TRUE)
Below is the citation output from using citation('TREG')
in R. Please
run this yourself to check for any updates on how to cite TREG.
print(citation("TREG"), bibtex = TRUE)
Please note that the TREG
was only made possible thanks to many other R and bioinformatics software authors, which are cited either in the vignettes and/or the paper(s) describing this package.
Please note that the TREG
project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
r BiocStyle::CRANpkg('usethis')
, r BiocStyle::CRANpkg('remotes')
, and r BiocStyle::CRANpkg('rcmdcheck')
customized to use Bioconductor's docker containers and r BiocStyle::Biocpkg('BiocCheck')
.r BiocStyle::CRANpkg('covr')
.r BiocStyle::CRANpkg('pkgdown')
.r BiocStyle::CRANpkg('styler')
.r BiocStyle::CRANpkg('devtools')
and r BiocStyle::CRANpkg('roxygen2')
.For more details, check the dev
directory.
This package was developed using r BiocStyle::Biocpkg('biocthis')
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.