https://github.com/ropensci/gtexr
An R interface to the GTEx Portal API
https://github.com/ropensci/gtexr
api-wrapper bioinformatics eqtl gtex r sqtl
Last synced: 2 months ago
JSON representation
An R interface to the GTEx Portal API
- Host: GitHub
- URL: https://github.com/ropensci/gtexr
- Owner: ropensci
- License: other
- Created: 2024-04-02T22:11:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-19T08:39:46.000Z (9 months ago)
- Last Synced: 2026-01-12T03:25:11.506Z (4 months ago)
- Topics: api-wrapper, bioinformatics, eqtl, gtex, r, sqtl
- Language: R
- Homepage: https://docs.ropensci.org/gtexr
- Size: 2.1 MB
- Stars: 12
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
- Codemeta: codemeta.json
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
[](https://app.codecov.io/gh/ropensci/gtexr?branch=main) [](https://github.com/ropensci/gtexr/actions/workflows/R-CMD-check.yaml) [](https://github.com/ropensci/gtexr/actions/workflows/shinyapps-deploy.yaml) [](https://CRAN.R-project.org/package=gtexr) [](https://CRAN.R-project.org/package=gtexr) [](https://CRAN.R-project.org/package=gtexr) [](https://www.repostatus.org/#active) [](https://github.com/ropensci/software-review/issues/684) [](https://joss.theoj.org/papers/10.21105/joss.08249)
The goal of gtexr is to provide a convenient R interface to the [GTEx Portal API V2](https://gtexportal.org/api/v2/redoc#tag/GTEx-Portal-API-Info).
The [Genotype-Tissue Expression (GTEx) project](https://www.gtexportal.org/home/) is a comprehensive public resource for studying tissue-specific gene expression and regulation in human tissues. Through systematic analysis of RNA sequencing data from 54 non-diseased tissue sites across nearly 1000 individuals, GTEx provides crucial insights into the relationship between genetic variation and gene expression. This data is accessible through the [GTEx Portal API](https://gtexportal.org/api/v2/redoc#tag/GTEx-Portal-API-Info), enabling programmatic access to human gene expression data.
New to R but want to explore the available data? Try out the interactive no-code ⭐[shiny app](https://7hocgq-rmgpanw.shinyapps.io/gtexr/)⭐.
## Installation
You can install this package from CRAN:
``` r
install.packages("gtexr")
```
Or you can install the development version of gtexr from either [GitHub](https://github.com/ropensci/gtexr) with:
``` r
# install.packages("pak")
pak::pak("ropensci/gtexr") # source - GitHub
```
... or [R Universe](https://ropensci.r-universe.dev/builds) with:
``` r
install.packages("gtexr", repos = "https://ropensci.r-universe.dev")
```
## Available functionality
- **GTEx Portal API Info** – Retrieve general service information about the GTEx API.
- **Admin Endpoints** – Access maintenance messages and news updates from GTEx.
- **Static Association Endpoints** – Query precomputed eQTL and sQTL associations across tissues.
- **Dynamic Association Endpoints** – Perform on-the-fly eQTL and sQTL calculations.
- **Biobank Data Endpoints** – Retrieve metadata on biobank samples.
- **Datasets Endpoints** – Access various GTEx dataset information, as well as variant annotation and linkage disequilibrium data.
- **Expression Data Endpoints** – Obtain expression levels across tissues, including gene, exon, junction, and transcript-level data.
- **Histology Endpoints** – Retrieve tissue histology image data.
- **Reference Genome Endpoints** – Query reference genome features, including genetic coordinates for genes, transcripts and exons, as well as reported phenotype associations for a region.
## Examples
Get general information about the GTEx service:
```{r}
library(gtexr)
get_service_info() |>
tibble::glimpse()
```
Retrieve eQTL genes for whole blood tissue:[^1]
[^1]: Note the warning raised if the number of items returned by a function call exceeds the requested page size. Argument `itemsPerPage` is set to 250 by default, but may be increased to ensure that all items are retrieved in one go.
```{r get-eqtl-genes}
get_eqtl_genes("Whole_Blood")
```
Retrieve significant eQTLs for one or more genes:
```{r get-significant-single-tissue-eqtls}
get_significant_single_tissue_eqtls(gencodeId = c(
"ENSG00000132693.12",
"ENSG00000203782.5"
))
```
## Citing gtexr
If you find gtexr useful, please consider citing both GTEx and gtexr. Citation details are available [here](https://docs.ropensci.org/gtexr/authors.html#citation).
Example publications citing gtexr include:
- [Schwartz R, Warwick AN, et al. Genetic Distinctions Between Reticular Pseudodrusen and Drusen: A Genome-Wide Association Study. Am J Ophthalmol. 2025 Mar 8:S0002-9394(25)00119-9. doi: 10.1016/j.ajo.2025.03.007. Epub ahead of print. PMID: 40064387](https://pubmed.ncbi.nlm.nih.gov/40064387/)
## Community guidelines
Feedback, bug reports, and feature requests are welcome; file issues or seek support [here](https://github.com/ropensci/gtexr/issues). If you would like to contribute to the package, please see our [contributing guidelines](https://docs.ropensci.org/gtexr/CONTRIBUTING.html).
Please note that this package is released with a [Contributor Code of Conduct](https://ropensci.org/code-of-conduct/). By contributing to this project, you agree to abide by its terms.
