{"id":22021630,"url":"https://github.com/lieberinstitute/treg","last_synced_at":"2025-05-07T06:41:32.705Z","repository":{"id":113732298,"uuid":"391101988","full_name":"LieberInstitute/TREG","owner":"LieberInstitute","description":"Tools for finding Total RNA Expression Genes in single nucleus RNA-seq data","archived":false,"fork":false,"pushed_at":"2024-12-10T21:25:54.000Z","size":25249,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"devel","last_synced_at":"2025-04-18T06:25:29.182Z","etag":null,"topics":["bioconductor","deconvolution","rnascope","rstats","scrna-seq","smfish","snrna-seq","treg"],"latest_commit_sha":null,"homepage":"http://research.libd.org/TREG/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LieberInstitute.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-30T14:57:58.000Z","updated_at":"2024-12-10T21:10:20.000Z","dependencies_parsed_at":"2023-05-31T16:46:00.870Z","dependency_job_id":"c6c25242-73ce-46ff-9301-28dfb91406b9","html_url":"https://github.com/LieberInstitute/TREG","commit_stats":{"total_commits":155,"total_committers":7,"mean_commits":"22.142857142857142","dds":"0.32258064516129037","last_synced_commit":"7fcd6df6cc62a4cbddedbff4eb136d552c0dd6b5"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LieberInstitute%2FTREG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LieberInstitute%2FTREG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LieberInstitute%2FTREG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LieberInstitute%2FTREG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LieberInstitute","download_url":"https://codeload.github.com/LieberInstitute/TREG/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252830636,"owners_count":21810772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioconductor","deconvolution","rnascope","rstats","scrna-seq","smfish","snrna-seq","treg"],"created_at":"2024-11-30T06:13:23.058Z","updated_at":"2025-05-07T06:41:32.698Z","avatar_url":"https://github.com/LieberInstitute.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n    collapse = TRUE,\n    comment = \"#\u003e\",\n    fig.path = \"man/figures/README-\",\n    out.width = \"100%\"\n)\n```\n\n# TREG \u003ca href=\"http://research.libd.org/TREG/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\" alt=\"TREG website\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![Bioc release status](http://www.bioconductor.org/shields/build/release/bioc/TREG.svg)](https://bioconductor.org/checkResults/release/bioc-LATEST/TREG)\n[![Bioc devel status](http://www.bioconductor.org/shields/build/devel/bioc/TREG.svg)](https://bioconductor.org/checkResults/devel/bioc-LATEST/TREG)\n[![Bioc downloads rank](https://bioconductor.org/shields/downloads/release/TREG.svg)](http://bioconductor.org/packages/stats/bioc/TREG/)\n[![Bioc support](https://bioconductor.org/shields/posts/TREG.svg)](https://support.bioconductor.org/tag/TREG)\n[![Bioc history](https://bioconductor.org/shields/years-in-bioc/TREG.svg)](https://bioconductor.org/packages/release/bioc/html/TREG.html#since)\n[![Bioc last commit](https://bioconductor.org/shields/lastcommit/devel/bioc/TREG.svg)](http://bioconductor.org/checkResults/devel/bioc-LATEST/TREG/)\n[![Bioc dependencies](https://bioconductor.org/shields/dependencies/release/TREG.svg)](https://bioconductor.org/packages/release/bioc/html/TREG.html#since)\n[![Codecov test coverage](https://codecov.io/gh/LieberInstitute/TREG/branch/devel/graph/badge.svg)](https://codecov.io/gh/LieberInstitute/TREG?branch=devel)\n[![R build status](https://github.com/LieberInstitute/TREG/actions/workflows/check-bioc.yml/badge.svg)](https://github.com/LieberInstitute/TREG/actions/workflows/check-bioc.yml)\n[![GitHub issues](https://img.shields.io/github/issues/LieberInstitute/TREG)](https://github.com/LieberInstitute/TREG/issues)\n[![GitHub pulls](https://img.shields.io/github/issues-pr/LieberInstitute/TREG)](https://github.com/LieberInstitute/TREG/pulls)\n[![DOI](https://zenodo.org/badge/391101988.svg)](https://zenodo.org/badge/latestdoi/391101988)\n\u003c!-- badges: end --\u003e\n\nThe goal of `TREG` is to help find candidate **Total RNA Expression Genes (TREGs)**\nin single nucleus (or single cell) RNA-seq data.\n\n_**Note**: TREG is pronounced as a single word and fully capitalized, unlike [Regulatory T cells](https://en.wikipedia.org/wiki/Regulatory_T_cell), which are known as \"Tregs\" (pronounced \"T-regs\"). The work described here is unrelated to regulatory T cells._\n\n### Why are TREGs useful?\nThe expression of a TREG is proportional to the the overall RNA expression in a\ncell. This relationship can be used to estimate total RNA content in cells in \nassays where only a few genes can be measured, such as single-molecule \nfluorescent in situ hybridization (smFISH). \n\nIn a smFISH experiment the number of TREG puncta can be used to infer the total\nRNA expression of the cell.\n\nThe motivation of this work is to collect data via smFISH in to help build better \ndeconvolution algorithms. But may be many other application for TREGs in \nexperimental design!\n\n\u003cp align=\"center\"\u003e\n![The Expression of a TREG can inform total RNA content of a cell](man/figures/TREG_cartoon.png){width=50%}\n\u003c/p\u003e\n\n### What makes a gene a good TREG?  \n1. The gene must have **non-zero expression in most cells** across different tissue \nand cell types.\n\n2. A TREG should also be expressed at a constant level in respect to other genes\nacross different cell types or have **high rank invariance**. \n\n3. Be **measurable as a continuous metric** in the experimental assay, for example\nhave a dynamic range of puncta when observed in RNAscope. This will need to be\nconsidered for the candidate TREGs, and may need to be validated experimentally. \n\n\u003cp align=\"center\"\u003e\n![Distribution of ranks of a gene of High and Low Invariance](man/figures/fig1_rank_violin_demo.png){width=30%}\n\u003c/p\u003e\n\n### How to find candidate TREGs with `TREG`\n\n\u003cp align=\"center\"\u003e\n![Overview of the Rank Invariance Process](man/figures/RI_flow.png){width=100%}\n\u003c/p\u003e\n\n1. **Filter for low Proportion Zero genes snRNA-seq dataset:** This is \nfacilitated with the functions `get_prop_zero()` and `filter_prop_zero()`.\nsnRNA-seq data is notoriously sparse, these functions enrich for genes with more\nuniversal expression.\n\n2.  **Evaluate genes for Rank Invariance** The nuclei are grouped only\nby cell type. Within each cell type, the mean expression for each\ngene is ranked, the result is a vector (length is the number of\ngenes), using the function `rank_group()`. Then the expression of each gene is \nranked for each nucleus,the result is a matrix (the number of nuclei x number\nof genes), using the function `rank_cells()`.Then the absolute difference \nbetween the rank of each nucleus and the mean expression is found, from here \nthe mean of the differences for each gene is calculated, then ranked. \nThese steps are repeated for each group, the result is a matrix of ranks, (number of cell\ntypes x number of genes). From here the sum of the ranks for each\ngene are reversed ranked, so there is one final value for each gene,\nthe “Rank Invariance” The genes with the highest rank-invariance are\nconsidered good candidates as TREGs. This is calculated with `rank_invariance_express()`.\n**This full process is implemented by: `rank_invariance_express()`.**\n\n## Installation instructions\n\nGet the latest stable `R` release from [CRAN](http://cran.r-project.org/). Then install `TREG` using from [Bioconductor](http://bioconductor.org/) the following code:\n\n```{r 'install', eval = FALSE}\nif (!requireNamespace(\"BiocManager\", quietly = TRUE)) {\n    install.packages(\"BiocManager\")\n}\n\nBiocManager::install(\"TREG\")\n```\n\nAnd the development version from [GitHub](https://github.com/LieberInstitute/TREG) with:\n\n```{r 'install_dev', eval = FALSE}\nBiocManager::install(\"LieberInstitute/TREG\")\n```\n## Example\n\n```{r `libraries`, message = FALSE, warning=FALSE}\n## Load packages\nlibrary(\"TREG\")\n```\n\n\n### Proportion Zero Filtering  \nA  TREG gene should be expressed in almost every cell. The set of\ngenes should be filtered by maximum Proportion Zero within a groups of cells.\n\n```{r calc_prop_zero, eval = requireNamespace('TREG')}\n## Calculate Proportion Zero in groups defined by a column in colData\n(prop_zero \u003c- get_prop_zero(sce = sce_zero_test, group_col = \"cellType\"))\n\n## Get list of genes that pass the max Proportion Zero filter\n(filtered_genes \u003c- filter_prop_zero(prop_zero, cutoff = 0.9))\n\n## Filter sce object to this list of genes\nsce_filter \u003c- sce_zero_test[filtered_genes, ]\n```\n\n### Evaluate RI for Filtered SCE Data\nThe genes with the highest Rank Invariance are considered good candidates as TREGs.\nIn this example the gene *g0* would be the strongest candidate TREG.\n\n```{r run_RI, eval = requireNamespace('TREG')}\n## Get the Rank Invariance value for each gene\n## The highest values are the best TREG candidates\nri \u003c- rank_invariance_express(sce_filter)\nsort(ri, decreasing = TRUE)\n```\n\n\n## Citation\n\nBelow is the citation output from using `citation('TREG')` in R. Please\nrun this yourself to check for any updates on how to cite __TREG__.\n\n```{r 'citation', eval = requireNamespace('TREG')}\nprint(citation(\"TREG\"), bibtex = TRUE)\n```\n\nPlease 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.\n\n## Code of Conduct\n\nPlease note that the `TREG` project is released with a [Contributor Code of Conduct](http://bioconductor.org/about/code-of-conduct/). By contributing to this project, you agree to abide by its terms.\n\n## Development tools\n\n* Continuous code testing is possible thanks to [GitHub actions](https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/)  through `r BiocStyle::CRANpkg('usethis')`, `r BiocStyle::CRANpkg('remotes')`, and `r BiocStyle::CRANpkg('rcmdcheck')` customized to use [Bioconductor's docker containers](https://www.bioconductor.org/help/docker/) and `r BiocStyle::Biocpkg('BiocCheck')`.\n* Code coverage assessment is possible thanks to [codecov](https://codecov.io/gh) and `r BiocStyle::CRANpkg('covr')`.\n* The [documentation website](http://LieberInstitute.github.io/TREG) is automatically updated thanks to `r BiocStyle::CRANpkg('pkgdown')`.\n* The code is styled automatically thanks to `r BiocStyle::CRANpkg('styler')`.\n* The documentation is formatted thanks to `r BiocStyle::CRANpkg('devtools')` and `r BiocStyle::CRANpkg('roxygen2')`.\n\nFor more details, check the `dev` directory.\n\nThis package was developed using `r BiocStyle::Biocpkg('biocthis')`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flieberinstitute%2Ftreg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flieberinstitute%2Ftreg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flieberinstitute%2Ftreg/lists"}