Title: Query the GTEx Portal API
Version: 0.2.0
Description: A convenient R interface to the Genotype-Tissue Expression (GTEx) Portal API. The GTEx project 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 enabling programmatic access to human gene expression data. For more information on the API, see https://gtexportal.org/api/v2/redoc.
License: MIT + file LICENSE
URL: https://docs.ropensci.org/gtexr/, https://github.com/ropensci/gtexr
BugReports: https://github.com/ropensci/gtexr/issues
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.2
Depends: R (≥ 4.2.0)
Imports: cli, dplyr, httr2 (≥ 1.0.0), purrr, rlang, tibble, tidyr
Suggests: curl, httptest2, knitr, rmarkdown, spelling, stringr, testthat (≥ 3.0.0), withr
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-04-23 21:21:23 UTC; alasdair
Author: Alasdair Warwick ORCID iD [aut, cre, cph], Benjamin Zuckerman ORCID iD [aut], Abraham Olvera-Barrios ORCID iD [aut], Chuin Ying Ung ORCID iD [aut], Robert Luben ORCID iD [aut], Zhian N. Kamvar ORCID iD [rev]
Maintainer: Alasdair Warwick <alasdair.warwick.19@ucl.ac.uk>
Repository: CRAN
Date/Publication: 2025-04-23 21:30:02 UTC

gtexr: Query the GTEx Portal API

Description

logo

A convenient R interface to the Genotype-Tissue Expression (GTEx) Portal API. The GTEx project 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 enabling programmatic access to human gene expression data. For more information on the API, see https://gtexportal.org/api/v2/redoc.

Author(s)

Maintainer: Alasdair Warwick alasdair.warwick.19@ucl.ac.uk (ORCID) [copyright holder]

Authors:

Other contributors:

See Also

Useful links:


Calculate Expression Quantitative Trait Loci

Description

Calculate your own eQTLs

By default, the calculation is based on the latest GTEx release.

GTEx Portal API documentation.

Usage

calculate_expression_quantitative_trait_loci(
  tissueSiteDetailId,
  gencodeId,
  variantId,
  datasetId = "gtex_v8",
  .return_raw = FALSE
)

Arguments

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Notes on output:

Notes on input:

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Dynamic Association Endpoints: calculate_ieqtls(), calculate_isqtls(), calculate_splicing_quantitative_trait_loci()

Examples

## Not run: 
# perform request - returns a tibble with a single row
calculate_expression_quantitative_trait_loci(
  tissueSiteDetailId = "Whole_Blood",
  gencodeId = "ENSG00000203782.5",
  variantId = "rs79641866"
)

# unnest list columns with tidyr::unnest()
calculate_expression_quantitative_trait_loci(
  tissueSiteDetailId = "Whole_Blood",
  gencodeId = "ENSG00000203782.5",
  variantId = "rs79641866"
) |>
  tidyr::unnest(c("data", "genotypes"))

# to calculate minor and alternative allele frequencies
calculate_expression_quantitative_trait_loci(
  tissueSiteDetailId = "Liver",
  gencodeId = "ENSG00000237973.1",
  variantId = "rs12119111"
) |>
  dplyr::bind_rows(.id = "rsid") |>
  tidyr::separate(
    col = "variantId",
    into = c(
      "chromosome",
      "position",
      "reference_allele",
      "alternative_allele",
      "genome_build"
    ),
    sep = "_"
  ) |>
  # ...then ascertain alternative_allele frequency
  dplyr::mutate(
    alt_allele_count = (2 * homoAltCount) + hetCount,
    total_allele_count = 2 * (homoAltCount + hetCount + homoRefCount),
    alternative_allele_frequency = alt_allele_count / total_allele_count
  ) |>
  dplyr::select(
    rsid,
    beta = nes,
    se = error,
    pValue,
    minor_allele_frequency = maf,
    alternative_allele_frequency,
    chromosome:genome_build,
    tissueSiteDetailId
  )

## End(Not run)

Calculate Ieqtls

Description

Calculate your own Cell Specific eQTLs.

By default, the calculation is based on the latest GTEx release.

GTEx Portal API documentation.

Usage

calculate_ieqtls(
  cellType,
  tissueSiteDetailId,
  gencodeId,
  variantId,
  datasetId = "gtex_v8",
  .return_raw = FALSE
)

Arguments

cellType

String. "Adipocytes", "Epithelial_cells", "Hepatocytes", "Keratinocytes", "Myocytes", "Neurons", "Neutrophils".

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Dynamic Association Endpoints: calculate_expression_quantitative_trait_loci(), calculate_isqtls(), calculate_splicing_quantitative_trait_loci()

Examples

## Not run: 
# perform request
calculate_ieqtls(
  cellType = "Adipocytes",
  tissueSiteDetailId = "Adipose_Subcutaneous",
  gencodeId = "ENSG00000203782.5",
  variantId = "chr1_1099341_T_C_b38"
)

## End(Not run)

Calculate Isqtls

Description

Calculate your own Cell Specific sQTLs.

By default, the calculation is based on the latest GTEx release.

GTEx Portal API documentation.

Usage

calculate_isqtls(
  cellType,
  tissueSiteDetailId,
  phenotypeId,
  variantId,
  datasetId = "gtex_v8",
  .return_raw = FALSE
)

Arguments

cellType

String. "Adipocytes", "Epithelial_cells", "Hepatocytes", "Keratinocytes", "Myocytes", "Neurons", "Neutrophils".

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

phenotypeId

String. See GTEx portal FAQs for further details.

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Dynamic Association Endpoints: calculate_expression_quantitative_trait_loci(), calculate_ieqtls(), calculate_splicing_quantitative_trait_loci()

Examples

## Not run: 
# perform request
calculate_isqtls(
  cellType = "Neutrophils",
  tissueSiteDetailId = "Whole_Blood",
  phenotypeId = "chr1:15947:16607:clu_40980:ENSG00000227232.5",
  variantId = "chr1_1099341_T_C_b38"
)

## End(Not run)

Calculate Splicing Quantitative Trait Loci

Description

GTEx Portal API documentation.

Usage

calculate_splicing_quantitative_trait_loci(
  tissueSiteDetailId,
  phenotypeId,
  variantId,
  datasetId = "gtex_v8",
  .return_raw = FALSE
)

Arguments

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

phenotypeId

String. See GTEx portal FAQs for further details.

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Dynamic Association Endpoints: calculate_expression_quantitative_trait_loci(), calculate_ieqtls(), calculate_isqtls()

Examples

## Not run: 
# perform request - returns a tibble with a single row
calculate_splicing_quantitative_trait_loci(
  tissueSiteDetailId = "Whole_Blood",
  phenotypeId = "chr1:15947:16607:clu_40980:ENSG00000227232.5",
  variantId = "chr1_14677_G_A_b38"
)

## End(Not run)

Download

Description

GTEx Portal API documentation

Usage

download(
  materialTypes = NULL,
  tissueSiteDetailIds = NULL,
  pathCategory = NULL,
  tissueSampleIds = NULL,
  sex = NULL,
  sortBy = "sampleId",
  sortDirection = "asc",
  searchTerm = NULL,
  sampleIds = NULL,
  subjectIds = NULL,
  ageBrackets = NULL,
  hardyScales = NULL,
  hasExpressionData = NULL,
  hasGenotype = NULL,
  .return_raw = FALSE
)

Arguments

materialTypes

String, vector. Options: "Cells:Cell Line Viable", "DNA:DNA Genomic", "DNA:DNA Somatic", "RNA:Total RNA", "Tissue:PAXgene Preserved", "Tissue:PAXgene Preserved Paraffin-embedded", "Tissue:Fresh Frozen Tissue".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

pathCategory

Character vector. Options: "adenoma", "amylacea", "atelectasis", "atherosclerosis", "atherosis", "atrophy", "calcification", "cirrhosis", "clean_specimens", "congestion", "corpora_albicantia", "cyst", "desquamation", "diabetic", "dysplasia", "edema", "emphysema", "esophagitis", "fibrosis", "gastritis", "glomerulosclerosis", "goiter", "gynecomastoid", "hashimoto", "heart_failure_cells", "hemorrhage", "hepatitis", "hyalinization", "hypereosinophilia", "hyperplasia", "hypertrophy", "hypoxic", "infarction", "inflammation", "ischemic_changes", "macrophages", "mastopathy", "metaplasia", "monckeberg", "necrosis", "nephritis", "nephrosclerosis", "no_abnormalities", "nodularity", "pancreatitis", "pigment", "pneumonia", "post_menopausal", "prostatitis", "saponification", "scarring", "sclerotic", "solar_elastosis", "spermatogenesis", "steatosis", "sweat_glands", "tma".

tissueSampleIds

Array of strings. A list of Tissue Sample ID(s).

sex

String. Options: "male", "female".

sortBy

String. Options: "sampleId", "ischemicTime", "aliquotId", "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", "tissueSiteDetailId", "sex".

sortDirection

String. Options: "asc", "desc". Default = "asc".

searchTerm

String.

sampleIds

Character vector. GTEx sample ID.

subjectIds

Character vector. GTEx subject ID.

ageBrackets

The age bracket(s) of the donors of interest. Options: "20-29", "30-39", "40-49", "50-59", "60-69", "70-79".

hardyScales

Character vector. A list of Hardy Scale(s) of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

hasExpressionData

Logical.

hasGenotype

Logical.

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Note: running this request with no filters (i.e. download()) raises an error.

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Biobank Data Endpoints: get_sample_biobank_data()

Examples

## Not run: 
download(
  materialTypes = "RNA:Total RNA",
  tissueSiteDetailIds = "Thyroid",
  pathCategory = "clean_specimens",
  sex = "male",
  ageBrackets = "50-59"
)

## End(Not run)

Get Annotation

Description

This service returns the list of annotations and allowed values by which a particular dataset can be subsetted. Results may be filtered by dataset.

GTEx Portal API documentation

Usage

get_annotation(
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Note: the output for this function appears to be incomplete currently.

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_annotation()

## End(Not run)

Get Clustered Median Exon Expression

Description

Find median transcript expression data along with hierarchical clusters.

By default, this endpoint queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_clustered_median_exon_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_clustered_median_exon_expression(c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))

# clustering data is stored as an attribute "clusters"
result <- get_clustered_median_exon_expression(c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))
attr(result, "clusters")

# process clustering data with the ape package
# install.packages("ape")
# phylo_tree <- ape::read.tree(text = attr(result, "clusters")$tissue)
# plot(phylo_tree)
# print(phylo_tree)

## End(Not run)

Get Clustered Median Gene Expression

Description

Find median gene expression data along with hierarchical clusters.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_clustered_median_gene_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_clustered_median_gene_expression(gencodeIds = c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))

# clustering data is stored as an attribute "clusters"
result <- get_clustered_median_gene_expression(c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))
attr(result, "clusters")

# process clustering data with the ape package
# install.packages("ape")
# phylo_tree <- ape::read.tree(text = attr(result, "clusters")$tissue)
# plot(phylo_tree)
# print(phylo_tree)

## End(Not run)

Get Clustered Median Junction Expression

Description

Find median junction expression data along with hierarchical clusters.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_clustered_median_junction_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_clustered_median_junction_expression(gencodeIds = c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))

# clustering data is stored as an attribute "clusters"
result <- get_clustered_median_junction_expression(c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))
attr(result, "clusters")

# process clustering data with the ape package
# install.packages("ape")
# phylo_tree <- ape::read.tree(text = attr(result, "clusters")$tissue)
# plot(phylo_tree)
# print(phylo_tree)

## End(Not run)

Get Clustered Median Transcript Expression

Description

Find median transcript expression data of all known transcripts of a gene along with hierarchical clusters.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_clustered_median_transcript_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_clustered_median_transcript_expression(gencodeIds = c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))

# clustering data is stored as an attribute "clusters"
result <- get_clustered_median_transcript_expression(c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))
attr(result, "clusters")

# process clustering data with the ape package
# install.packages("ape")
# phylo_tree <- ape::read.tree(text = attr(result, "clusters")$tissue)
# plot(phylo_tree)
# print(phylo_tree)

## End(Not run)

Get Collapsed Gene Model Exon

Description

This service returns the collapsed exons in the gene model of the given gene. Gene-level and exon-level expression quantification were based on the GENCODE annotation, collapsed to a single transcript model for each gene using an algorithm developed by the GTEx analysis team.

By default, this service queries the models used by the latest GTEx release.

GTEx Portal API documentation

Usage

get_collapsed_gene_model_exon(
  gencodeId,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_collapsed_gene_model_exon(gencodeId = "ENSG00000132693.12")

## End(Not run)

Get Dataset Info

Description

GTEx Portal API documentation

Usage

get_dataset_info(
  datasetId = NULL,
  organizationName = NULL,
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

organizationName

String. Options: "GTEx Consortium" "Kid's First".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

Examples

## Not run: 
get_dataset_info(datasetId = "gtex_v8", organizationName = "GTEx Consortium")

## End(Not run)

Get Downloads Page Data

Description

Retrieves all the files belonging to the given project_id for display on the ⁠Downloads Page⁠

GTEx Portal API documentation

Usage

get_downloads_page_data(project_id, .return_raw = FALSE)

Arguments

project_id

String. Options: "gtex", "adult-gtex", "egtex".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Note: The GTEx Portal API documentation states "GTEx currently has one project available: gtex". However, project_id values "adult-gtex" and "egtex" both return results, whereas "gtex" does not (see examples).

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
# "adult-gtex" (default `project_id` value) and "egtex" both return results
get_downloads_page_data("adult-gtex")
egtex <- get_downloads_page_data("egtex")
egtex

# ..."gtex" does not
get_downloads_page_data("gtex")

# get details for whole blood methylation data, including download URL
purrr::pluck(
  egtex$children,
  1,
  "folders",
  "Methylation - EPIC Array",
  "children",
  "folders",
  "mQTLs",
  "children",
  "files",
  "WholeBlood.mQTLs.regular.txt.gz"
)

## End(Not run)

Get Eqtl Genes

Description

Retrieve eGenes (eQTL Genes).

For each eGene, the results include the allelic fold change (log2AllelicFoldChange), p-value (pValue), p-value threshold (pValueThreshold), empirical p-value (empiricalPValue), and q-value (qValue).

GTEx Portal API documentation.

Usage

get_eqtl_genes(
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
get_eqtl_genes(c("Whole_Blood", "Artery_Aorta"))

## End(Not run)

Get Exons

Description

This service returns exons from all known transcripts of the given gene.

GTEx Portal API documentation

Usage

get_exons(
  gencodeIds,
  gencodeVersion = NULL,
  genomeBuild = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_gene_search(), get_genes(), get_genomic_features(), get_gwas_catalog_by_location(), get_neighbor_gene(), get_transcripts()

Examples

## Not run: 
get_exons(gencodeIds = c("ENSG00000132693.12", "ENSG00000203782.5"))

## End(Not run)

Get Expression Pca

Description

Find gene expression PCA data.

By default, the service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_expression_pca(
  tissueSiteDetailIds,
  datasetId = "gtex_v8",
  sampleId = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

sampleId

String. ⁠^GTEX-[A-Z0-9]{5}-[0-9]{4}-SM-[A-Z0-9]{5}$⁠

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_expression_pca(tissueSiteDetailIds = c(
  "Adipose_Subcutaneous",
  "Whole_Blood"
))

get_expression_pca(
  tissueSiteDetailIds = "Adipose_Subcutaneous",
  sampleId = "GTEX-1117F-0226-SM-5GZZ7"
)

## End(Not run)

Get File List

Description

Get all the files in GTEx dataset for Download page

GTEx Portal API documentation

Usage

get_file_list(.return_raw = FALSE)

Arguments

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

The returned tibble includes a nested list column, "filesets". This details files, sub-categorised by fileset (see examples section).

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
# Column "filesets" is a list column
get_file_list()

# Get "GTEx Analysis V9" file list
gtex_v9_files <- get_file_list() |>
  dplyr::filter(name == "GTEx Analysis V9") |>
  dplyr::pull(filesets)

# "GTEx Analysis V9" filesets
names(gtex_v9_files[[1]])

# "GTEx Analysis V9", "snRNA-Seq Data" fileset files
names(gtex_v9_files[[1]][["snRNA-Seq Data"]]$files)

## End(Not run)

Get Fine Mapping

Description

Retrieve Fine Mapping Data

The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation

Usage

get_fine_mapping(
  gencodeIds,
  datasetId = "gtex_v8",
  variantId = NULL,
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

variantId

String. A gtex variant ID.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
# search by gene
get_fine_mapping(gencodeIds = c(
  "ENSG00000132693.12",
  "ENSG00000203782.5"
))

# optionally filter for a single variant and/or one or more tissues
get_fine_mapping(
  gencodeIds = c(
    "ENSG00000132693.12",
    "ENSG00000203782.5"
  ),
  variantId = "chr1_153228363_A_G_b38",
  tissueSiteDetailIds = c(
    "Whole_Blood",
    "Thyroid"
  )
)

## End(Not run)

Get Full Get Collapsed Gene Model Exon

Description

This service allows the user to query the full Collapsed Gene Model Exon of a specific gene by gencode ID

GTEx Portal API documentation

Usage

get_full_get_collapsed_gene_model_exon(
  gencodeId,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_full_get_collapsed_gene_model_exon(gencodeId = "ENSG00000203782.5")

## End(Not run)

Get Functional Annotation

Description

This endpoint retrieves the functional annotation of a certain chromosome location. Default to most recent dataset release.

GTEx Portal API documentation

Usage

get_functional_annotation(
  datasetId = "gtex_v8",
  chromosome,
  start,
  end,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

start

Integer.

end

Integer.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_functional_annotation(chromosome = "chr1", start = 192168000, end = 192169000)

## End(Not run)

Get Gene Expression

Description

Find normalized gene expression data.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_gene_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  attributeSubset = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

attributeSubset

String. Examples include but are not limited to "sex", "ageBracket"

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
# multiple genes, selected tissues
get_gene_expression(
  gencodeIds = c(
    "ENSG00000132693.12",
    "ENSG00000203782.5"
  ),
  tissueSiteDetailIds = c("Thyroid", "Whole_Blood")
)

# single gene, selected (single) tissue
get_gene_expression(
  gencodeIds = "ENSG00000132693.12",
  tissueSiteDetailIds = "Whole_Blood"
)

# subset by sex
get_gene_expression(
  gencodeIds = "ENSG00000132693.12",
  tissueSiteDetailIds = "Whole_Blood",
  attributeSubset = "sex"
)

# subset by age bracket
get_gene_expression(
  gencodeIds = "ENSG00000132693.12",
  tissueSiteDetailIds = "Whole_Blood",
  attributeSubset = "ageBracket"
)

## End(Not run)

Description

Find genes that are partial or complete match of a gene_id

GTEx Portal API documentation

Usage

get_gene_search(
  geneId,
  gencodeVersion = "v26",
  genomeBuild = "GRCh38/hg38",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

geneId

String. A gene symbol, a gencode ID, or an Ensemble ID.

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_genes(), get_genomic_features(), get_gwas_catalog_by_location(), get_neighbor_gene(), get_transcripts()

Examples

## Not run: 
get_gene_search("CRP")

## End(Not run)

Get Genes

Description

This service returns information about reference genes. A genome build and GENCODE version must be provided.

GTEx API Portal documentation

Usage

get_genes(
  geneIds,
  gencodeVersion = "v26",
  genomeBuild = "GRCh38/hg38",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

geneIds

A character vector of gene symbols, versioned gencodeIds, or unversioned gencodeIds.

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_gene_search(), get_genomic_features(), get_gwas_catalog_by_location(), get_neighbor_gene(), get_transcripts()

Examples

## Not run: 
get_genes(c("CRP", "IL6R"))

## End(Not run)

Get Genomic Features

Description

GTEx API Portal documentation

Usage

get_genomic_features(.featureId, datasetId = "gtex_v8", .return_raw = FALSE)

Arguments

.featureId

String. A genomic feature e.g. GENCODE ID, RSID or GTEx Variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

This endpoint takes a path parameter "featureId".

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_gene_search(), get_genes(), get_gwas_catalog_by_location(), get_neighbor_gene(), get_transcripts()

Examples

## Not run: 
# gene symbol
get_genomic_features("brca1")

# GENCODE ID
get_genomic_features("ENSG00000132693.12")

# RSID
get_genomic_features("rs1815739")

# GTEx variant ID
get_genomic_features("chr11_66561023_G_GTTA_b38")

## End(Not run)

Get Gwas Catalog By Location

Description

Find the GWAS Catalog on a certain chromosome between start and end locations.

GTEx API Portal documentation

Usage

get_gwas_catalog_by_location(
  start,
  end,
  chromosome,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

start

Integer.

end

Integer.

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_gene_search(), get_genes(), get_genomic_features(), get_neighbor_gene(), get_transcripts()

Examples

## Not run: 
get_gwas_catalog_by_location(start = 1, end = 10000000, chromosome = "chr1")

## End(Not run)

Get Image

Description

GTEx Portal API documentation

Usage

get_image(
  tissueSampleIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

tissueSampleIds

Array of strings. A list of Tissue Sample ID(s).

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

Examples

## Not run: 
get_image()

# filter by `tissueSampleId`
result <- get_image(tissueSampleIds = "GTEX-1117F-0526")
print(result)

# note that `pathologyNotesCategories` (if present) is a list column
print(result$pathologyNotesCategories)

## End(Not run)

Get Independent Eqtl

Description

Retrieve Independent eQTL Data

The retrieved data is split into pages with items_per_page entries per page

GTEx portal API documentation

Usage

get_independent_eqtl(
  gencodeIds,
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
# search by gene
get_independent_eqtl(gencodeIds = c(
  "ENSG00000132693.12",
  "ENSG00000203782.5"
))

# optionally filter for a single variant and/or one or more tissues
get_independent_eqtl(
  gencodeIds = c(
    "ENSG00000132693.12",
    "ENSG00000203782.5"
  ),
  tissueSiteDetailIds = c(
    "Whole_Blood",
    "Thyroid"
  )
)

## End(Not run)

Get Linkage Disequilibrium By Variant Data

Description

Find linkage disequilibrium (LD) data for a given variant

GTEx Portal API documentation

Usage

get_linkage_disequilibrium_by_variant_data(
  variantId,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

variantId

String. A gtex variant ID.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

get_linkage_disequilibrium_by_variant_data("chr1_159245536_C_T_b38")

Get Linkage Disequilibrium Data

Description

Find linkage disequilibrium (LD) data for a given gene.

This endpoint returns linkage disequilibrium data for the cis-eQTLs found associated with the provided gene in a specified dataset. Results are queried by gencode ID. By default, the service queries the latest GTEx release. Specify a dataset ID to fetch results from a different dataset.

GTEx Portal API documentation

Usage

get_linkage_disequilibrium_data(
  gencodeId,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

get_linkage_disequilibrium_data(gencodeId = "ENSG00000132693.12")

Get Maintenance Message

Description

Getting all the maintenance messages from the database that are enabled.

GTEx Portal API documentation.

Usage

get_maintenance_message(
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Note this typically returns an empty tibble.

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Admin Endpoints: get_news_item()

Examples

## Not run: 
get_maintenance_message()

## End(Not run)

Get Median Exon Expression

Description

Find median exon expression data.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_median_exon_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
# median exon expression values for CRP, filtered for whole blood
get_median_exon_expression(
  gencodeIds = "ENSG00000132693.12",
  tissueSiteDetailIds = "Whole_Blood"
)

## End(Not run)

Get Median Gene Expression

Description

Find median gene expression data along with hierarchical clusters.

GTEx Portal API documentation

Usage

get_median_gene_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_median_gene_expression(gencodeIds = "ENSG00000132693.12")

## End(Not run)

Get Median Junction Expression

Description

Find junction gene expression data.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_median_junction_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_median_junction_expression(gencodeIds = "ENSG00000132693.12")

## End(Not run)

Get Median Transcript Expression

Description

Find median transcript expression data of all known transcripts of a gene.

By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_median_transcript_expression(
  gencodeIds,
  datasetId = "gtex_v8",
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
get_median_transcript_expression(gencodeIds = "ENSG00000132693.12")

## End(Not run)

Get Multi Tissue Eqtls

Description

Find multi-tissue eQTL Metasoft results.

By default, the service queries the latest GTEx release. The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation

Usage

get_multi_tissue_eqtls(
  gencodeId,
  variantId = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
# search by gene
get_multi_tissue_eqtls(gencodeId = "ENSG00000132693.12")

# note that 'tissues' is a list-column
x <- get_multi_tissue_eqtls(gencodeId = "ENSG00000132693.12",
                            variantId = "chr1_159476920_T_C_b38")

x$tissues[[1]]

## End(Not run)

Get Neighbor Gene

Description

Find all neighboring genes on a certain chromosome around a position with a certain window size.

GTEx API Portal documentation

Usage

get_neighbor_gene(
  pos,
  chromosome,
  bp_window,
  page = 0,
  gencodeVersion = "v26",
  genomeBuild = "GRCh38/hg38",
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

pos

Integer.

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

bp_window

Integer.

page

Integer (default = 0).

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_gene_search(), get_genes(), get_genomic_features(), get_gwas_catalog_by_location(), get_transcripts()

Examples

## Not run: 
get_neighbor_gene(pos = 1000000, chromosome = "chr1", bp_window = 10000)

## End(Not run)

Get News Item

Description

Getting all the news items from the database that are current.

GTEx Portal API documentation.

Usage

get_news_item(
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Admin Endpoints: get_maintenance_message()

Examples

## Not run: 
get_news_item()

## End(Not run)

Get Sample (Biobank Data)

Description

GTEx Portal API documentation

Usage

get_sample_biobank_data(
  draw = NULL,
  materialTypes = NULL,
  tissueSiteDetailIds = NULL,
  pathCategory = NULL,
  tissueSampleIds = NULL,
  sex = NULL,
  sortBy = "sampleId",
  sortDirection = "asc",
  searchTerm = NULL,
  sampleIds = NULL,
  subjectIds = NULL,
  ageBrackets = NULL,
  hardyScales = NULL,
  hasExpressionData = NULL,
  hasGenotype = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

draw

Integer.

materialTypes

String, vector. Options: "Cells:Cell Line Viable", "DNA:DNA Genomic", "DNA:DNA Somatic", "RNA:Total RNA", "Tissue:PAXgene Preserved", "Tissue:PAXgene Preserved Paraffin-embedded", "Tissue:Fresh Frozen Tissue".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

pathCategory

Character vector. Options: "adenoma", "amylacea", "atelectasis", "atherosclerosis", "atherosis", "atrophy", "calcification", "cirrhosis", "clean_specimens", "congestion", "corpora_albicantia", "cyst", "desquamation", "diabetic", "dysplasia", "edema", "emphysema", "esophagitis", "fibrosis", "gastritis", "glomerulosclerosis", "goiter", "gynecomastoid", "hashimoto", "heart_failure_cells", "hemorrhage", "hepatitis", "hyalinization", "hypereosinophilia", "hyperplasia", "hypertrophy", "hypoxic", "infarction", "inflammation", "ischemic_changes", "macrophages", "mastopathy", "metaplasia", "monckeberg", "necrosis", "nephritis", "nephrosclerosis", "no_abnormalities", "nodularity", "pancreatitis", "pigment", "pneumonia", "post_menopausal", "prostatitis", "saponification", "scarring", "sclerotic", "solar_elastosis", "spermatogenesis", "steatosis", "sweat_glands", "tma".

tissueSampleIds

Array of strings. A list of Tissue Sample ID(s).

sex

String. Options: "male", "female".

sortBy

String. Options: "sampleId", "ischemicTime", "aliquotId", "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", "tissueSiteDetailId", "sex".

sortDirection

String. Options: "asc", "desc". Default = "asc".

searchTerm

String.

sampleIds

Character vector. GTEx sample ID.

subjectIds

Character vector. GTEx subject ID.

ageBrackets

The age bracket(s) of the donors of interest. Options: "20-29", "30-39", "40-49", "50-59", "60-69", "70-79".

hardyScales

Character vector. A list of Hardy Scale(s) of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

hasExpressionData

Logical.

hasGenotype

Logical.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Biobank Data Endpoints: download()

Examples

## Not run: 
get_sample_biobank_data(tissueSiteDetailIds = "Whole_Blood")

## End(Not run)

Get Sample (Datasets)

Description

This service returns information of samples used in analyses from all datasets. Results may be filtered by dataset ID, sample ID, subject ID, sample metadata, or other provided parameters. By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_sample_datasets(
  datasetId = "gtex_v8",
  sampleIds = NULL,
  tissueSampleIds = NULL,
  subjectIds = NULL,
  ageBrackets = NULL,
  sex = NULL,
  pathCategory = NULL,
  tissueSiteDetailIds = NULL,
  aliquotIds = NULL,
  autolysisScores = NULL,
  hardyScales = NULL,
  ischemicTimes = NULL,
  ischemicTimeGroups = NULL,
  rins = NULL,
  uberonIds = NULL,
  dataTypes = NULL,
  sortBy = "sampleId",
  sortDirection = "asc",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

sampleIds

Character vector. GTEx sample ID.

tissueSampleIds

Array of strings. A list of Tissue Sample ID(s).

subjectIds

Character vector. GTEx subject ID.

ageBrackets

The age bracket(s) of the donors of interest. Options: "20-29", "30-39", "40-49", "50-59", "60-69", "70-79".

sex

String. Options: "male", "female".

pathCategory

Character vector. Options: "adenoma", "amylacea", "atelectasis", "atherosclerosis", "atherosis", "atrophy", "calcification", "cirrhosis", "clean_specimens", "congestion", "corpora_albicantia", "cyst", "desquamation", "diabetic", "dysplasia", "edema", "emphysema", "esophagitis", "fibrosis", "gastritis", "glomerulosclerosis", "goiter", "gynecomastoid", "hashimoto", "heart_failure_cells", "hemorrhage", "hepatitis", "hyalinization", "hypereosinophilia", "hyperplasia", "hypertrophy", "hypoxic", "infarction", "inflammation", "ischemic_changes", "macrophages", "mastopathy", "metaplasia", "monckeberg", "necrosis", "nephritis", "nephrosclerosis", "no_abnormalities", "nodularity", "pancreatitis", "pigment", "pneumonia", "post_menopausal", "prostatitis", "saponification", "scarring", "sclerotic", "solar_elastosis", "spermatogenesis", "steatosis", "sweat_glands", "tma".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

aliquotIds

Character vector.

autolysisScores

Character vector. Options: "None", "Mild", "Moderate", "Severe".

hardyScales

Character vector. A list of Hardy Scale(s) of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

ischemicTimes

Integer.

ischemicTimeGroups

Character vector. Options: "<= 0", "1 - 300", "301 - 600", "601 - 900", "901 - 1200", "1201 - 1500", "> 1500".

rins

Integer, vector.

uberonIds

Character vector of Uberon IDs (e.g. "UBERON:EFO_0000572"; use get_tissue_site_detail() to see valid values).

dataTypes

Character vector. Options: "RNASEQ", "WGS", "WES", "OMNI", "EXCLUDE".

sortBy

String. Options: "sampleId", "ischemicTime", "aliquotId", "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", "tissueSiteDetailId", "sex".

sortDirection

String. Options: "asc", "desc". Default = "asc".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_subject(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_sample_datasets()

## End(Not run)

Get Service Info

Description

General information about the GTEx service.

GTEx Portal API documentation.

Usage

get_service_info(.return_raw = FALSE)

Arguments

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

Examples

## Not run: 
get_service_info()

## End(Not run)

Get Significant Single Tissue Eqtls

Description

Find significant single tissue eQTLs.

By default, the service queries the latest GTEx release and the retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation.

Usage

get_significant_single_tissue_eqtls(
  gencodeIds = NULL,
  variantIds = NULL,
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

variantIds

Character vector. Gtex variant IDs.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Details

Note: although the GTEx Portal API documentation says to use the dbSNP rsID when searching by variant, this returns no results. Instead use gtex variant IDs e.g. use "chr1_153209640_C_A_b38" instead of "rs1410858".

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
# search by gene
get_significant_single_tissue_eqtls(gencodeIds = c(
  "ENSG00000132693.12",
  "ENSG00000203782.5"
))

# search by variant - must be variantId (not rsid)
get_significant_single_tissue_eqtls(variantIds = "chr1_153209640_C_A_b38")

# filter by gene/variant and tissue site - either `gencodeIds` or `variantIds`
# should be supplied as a minimum
get_significant_single_tissue_eqtls(
  gencodeIds = c(
    "ENSG00000132693.12",
    "ENSG00000203782.5"
  ),
  variantIds = "chr1_153209640_C_A_b38",
  tissueSiteDetailIds = "Whole_Blood"
)

## End(Not run)

Get Significant Single Tissue eQTLs By Location

Description

Find significant single tissue eQTLs using Chromosomal Locations.

By default, the service queries the latest GTEx release. Since this endpoint is used to support a third party program on the portal, the return structure is different from other endpoints and is not paginated.

GTEx Portal API documentation

Usage

get_significant_single_tissue_eqtls_by_location(
  tissueSiteDetailId,
  start,
  end,
  chromosome,
  datasetId = "gtex_v8",
  .return_raw = FALSE
)

Arguments

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

start

Integer.

end

Integer.

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
get_significant_single_tissue_eqtls_by_location(
  tissueSiteDetailId = "Artery_Aorta",
  start = 10000,
  end = 250000,
  chromosome = "chr11"
)

## End(Not run)

Get Significant Single Tissue Ieqtls

Description

Retrieve Interaction eQTL Data.

The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation

Usage

get_significant_single_tissue_ieqtls(
  gencodeIds,
  variantIds = NULL,
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

variantIds

Character vector. Gtex variant IDs.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
get_significant_single_tissue_ieqtls(c(
  "ENSG00000132693.12",
  "ENSG00000203782.5"
))

## End(Not run)

Get Significant Single Tissue Isqtls

Description

Retrieve Interaction sQTL Data.

The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation.

Usage

get_significant_single_tissue_isqtls(
  gencodeIds,
  variantIds = NULL,
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

variantIds

Character vector. Gtex variant IDs.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_sqtls(), get_sqtl_genes()

Examples

## Not run: 
get_significant_single_tissue_isqtls(gencodeIds = c(
  "ENSG00000065613.9",
  "ENSG00000203782.5"
))

## End(Not run)

Get Significant Single Tissue Sqtls

Description

Retrieve Single Tissue sQTL Data.

The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation.

Usage

get_significant_single_tissue_sqtls(
  gencodeIds = NULL,
  variantIds = NULL,
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

variantIds

Character vector. Gtex variant IDs.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_sqtl_genes()

Examples

## Not run: 
# search by gene
get_significant_single_tissue_sqtls(gencodeIds = c(
  "ENSG00000065613.9",
  "ENSG00000203782.5"
))

## End(Not run)

Get Single Nucleus Gex

Description

Retrieve Single Nucleus Gene Expression Data for a given Gene.

GTEx Portal API documentation

Usage

get_single_nucleus_gex(
  gencodeIds,
  datasetId = "gtex_snrnaseq_pilot",
  tissueSiteDetailIds = NULL,
  excludeDataArray = TRUE,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

excludeDataArray

String. Options are TRUE or FALSE

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex_summary(), get_top_expressed_genes()

Examples

## Not run: 
# Search for one or more genes - returns a tibble with one row per tissue.
# Column "cellTypes" now contains a tibble of expression summary data, with
# one row for each cell type
get_single_nucleus_gex(gencodeIds = c(
  "ENSG00000203782.5",
  "ENSG00000132693.12"
))

# `excludeDataArray = FALSE` - expression values are stored under "celltypes"
# in an additional column called "data"
response <- get_single_nucleus_gex(
  gencodeIds = "ENSG00000132693.12",
  excludeDataArray = FALSE,
  itemsPerPage = 2
)

response

# "cellTypes" contains a tibble of data with one row for each
# cell type e.g. for Breast_Mammary_Tissue
response$cellTypes[[2]]

# when `excludeDataArray = FALSE`, expression values are stored in "data"
# e.g. for Breast_Mammary_Tissue, Epithelial cell (luminal):
response$cellTypes[[2]]$data[[1]]

## End(Not run)

Get Single Nucleus Gex Summary

Description

Retrieve Summarized Single Nucleus Gene Expression Data.

GTEx Portal API documentation

Usage

get_single_nucleus_gex_summary(
  datasetId = "gtex_snrnaseq_pilot",
  tissueSiteDetailIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_top_expressed_genes()

Examples

## Not run: 
# all tissues
get_single_nucleus_gex_summary()

# filter for specific tissue
get_single_nucleus_gex_summary(tissueSiteDetailIds = c(
  "Breast_Mammary_Tissue",
  "Skin_Sun_Exposed_Lower_leg"
))

## End(Not run)

Get Sqtl Genes

Description

Retrieve sGenes (sQTL Genes).

The retrieved data is split into pages with items_per_page entries per page

GTEx Portal API documentation.

Usage

get_sqtl_genes(
  tissueSiteDetailIds = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Static Association Endpoints: get_eqtl_genes(), get_fine_mapping(), get_independent_eqtl(), get_multi_tissue_eqtls(), get_significant_single_tissue_eqtls(), get_significant_single_tissue_eqtls_by_location(), get_significant_single_tissue_ieqtls(), get_significant_single_tissue_isqtls(), get_significant_single_tissue_sqtls()

Examples

## Not run: 
get_sqtl_genes("Whole_Blood")

## End(Not run)

Get Subject

Description

This service returns information of subjects used in analyses from all datasets. Results may be filtered by dataset ID, subject ID, sex, age bracket or Hardy Scale. By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_subject(
  datasetId = "gtex_v8",
  sex = NULL,
  ageBrackets = NULL,
  hardyScale = NULL,
  subjectIds = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

sex

String. Options: "male", "female".

ageBrackets

The age bracket(s) of the donors of interest. Options: "20-29", "30-39", "40-49", "50-59", "60-69", "70-79".

hardyScale

String A Hardy Scale of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

subjectIds

Character vector. GTEx subject ID.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_tissue_site_detail(), get_variant(), get_variant_by_location()

Examples

## Not run: 
get_subject()

## End(Not run)

Get Tissue Site Detail

Description

Retrieve all tissue site detail information in the database

GTEx Portal API documentation

Usage

get_tissue_site_detail(
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_variant(), get_variant_by_location()

Examples

## Not run: 
# returns a tibble with one row per tissue
get_tissue_site_detail()

# `eqtlSampleSummary` and `rnaSeqSampleSummary` are list columns
bladder_site_details <- get_tissue_site_detail() |>
  dplyr::filter(tissueSiteDetailId == "Bladder")

purrr::pluck(bladder_site_details, "eqtlSampleSummary", 1)

purrr::pluck(bladder_site_details, "rnaSeqSampleSummary", 1)

## End(Not run)

Get Top Expressed Genes

Description

Find top expressed genes for a specified tissue.

GTEx Portal API documentation

Usage

get_top_expressed_genes(
  tissueSiteDetailId,
  datasetId = "gtex_v8",
  filterMtGene = TRUE,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

filterMtGene

Logical. Exclude mitochondrial genes.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Expression Data Endpoints: get_clustered_median_exon_expression(), get_clustered_median_gene_expression(), get_clustered_median_junction_expression(), get_clustered_median_transcript_expression(), get_expression_pca(), get_gene_expression(), get_median_exon_expression(), get_median_gene_expression(), get_median_junction_expression(), get_median_transcript_expression(), get_single_nucleus_gex(), get_single_nucleus_gex_summary()

Examples

## Not run: 
get_top_expressed_genes(tissueSiteDetailId = "Artery_Aorta")

## End(Not run)

Get Transcripts

Description

Find all transcripts of a reference gene.

GTEx API Portal documentation

Usage

get_transcripts(
  gencodeId,
  gencodeVersion = "v26",
  genomeBuild = "GRCh38/hg38",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Reference Genome Endpoints: get_exons(), get_gene_search(), get_genes(), get_genomic_features(), get_gwas_catalog_by_location(), get_neighbor_gene()

Examples

## Not run: 
get_transcripts(gencodeId = "ENSG00000203782.5")

## End(Not run)

Get Variant

Description

This service returns information about a variant, including position, dbSNP RS ID, the reference allele, the alternative allele, and whether the minor allele frequency is >= 1%. For GTEx v6p, there is also information about whether the whole exome sequence and chip sequencing data are available. Results may be queried by GTEx variant ID (variantId), dbSNP RS ID (snpId) or genomic location (chromosome and pos). Variants are identified based on the genotype data of each dataset cohort, namely, are dataset-dependent. Each variant is assigned a unique GTEx variant ID (i.e. the primary key). Not all variants have a mappable dbSNP RS ID. By default, this service queries the latest GTEx release.

GTEx Portal API documentation

Usage

get_variant(
  snpId = NULL,
  variantId = NULL,
  datasetId = "gtex_v8",
  chromosome = NULL,
  poss = NULL,
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

snpId

String

variantId

String. A gtex variant ID.

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

poss

Integer, vector.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant_by_location()

Examples

# search by rsid
get_variant(snpId = "rs1410858")

# search by variantId
get_variant(variantId = "chr1_153209640_C_A_b38")

# search by chromosome and position
get_variant(
  chromosome = "chr1",
  pos = 153209600:153209700
)

Get Variant By Location

Description

This service allows the user to query information about variants on a certain chromosome at a certain location.

GTEx Portal API documentation

Usage

get_variant_by_location(
  start,
  end,
  chromosome,
  sortBy = "pos",
  sortDirection = "asc",
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = getOption("gtexr.itemsPerPage"),
  .verbose = getOption("gtexr.verbose"),
  .return_raw = FALSE
)

Arguments

start

Integer.

end

Integer.

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

sortBy

String. Options: "sampleId", "ischemicTime", "aliquotId", "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", "tissueSiteDetailId", "sex".

sortDirection

String. Options: "asc", "desc". Default = "asc".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

page

Integer (default = 0).

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

Value

A tibble. Or a list if .return_raw = TRUE.

See Also

Other Datasets Endpoints: get_annotation(), get_collapsed_gene_model_exon(), get_downloads_page_data(), get_file_list(), get_full_get_collapsed_gene_model_exon(), get_functional_annotation(), get_linkage_disequilibrium_by_variant_data(), get_linkage_disequilibrium_data(), get_sample_datasets(), get_subject(), get_tissue_site_detail(), get_variant()

Examples

get_variant_by_location(
  start = 153209600,
  end = 153209700,
  chromosome = "chr1"
)

gtexr arguments

Description

Internal function that documents all arguments for exported gtexr functions that wrap GTEx Portal API endpoints (using roxygen ⁠@inheritParams⁠ tag).

Usage

gtexr_arguments(
  ageBrackets = NULL,
  aliquotIds = NULL,
  attributeSubset = NULL,
  autolysisScores = NULL,
  cellType = NULL,
  bp_window = NULL,
  chromosome = NULL,
  datasetId = NULL,
  dataTypes = NULL,
  draw = NULL,
  end = NULL,
  excludeDataArray = NULL,
  .featureId = NULL,
  filterMtGene = NULL,
  gencodeId = NULL,
  gencodeIds = NULL,
  gencodeVersion = NULL,
  geneId = NULL,
  geneIds = NULL,
  genomeBuild = NULL,
  hardyScale = NULL,
  hardyScales = NULL,
  hasExpressionData = NULL,
  hasGenotype = NULL,
  itemsPerPage = NULL,
  ischemicTimes = NULL,
  ischemicTimeGroups = NULL,
  materialTypes = NULL,
  organizationName = NULL,
  page = NULL,
  pathCategory = NULL,
  phenotypeId = NULL,
  pos = NULL,
  poss = NULL,
  project_id = NULL,
  .return_raw = NULL,
  rins = NULL,
  sampleId = NULL,
  sampleIds = NULL,
  searchTerm = NULL,
  sex = NULL,
  snpId = NULL,
  sortBy = NULL,
  sortDirection = NULL,
  start = NULL,
  subjectIds = NULL,
  tissueSampleIds = NULL,
  tissueSiteDetailId = NULL,
  tissueSiteDetailIds = NULL,
  uberonIds = NULL,
  variantId = NULL,
  variantIds = NULL,
  .verbose = NULL
)

Arguments

ageBrackets

The age bracket(s) of the donors of interest. Options: "20-29", "30-39", "40-49", "50-59", "60-69", "70-79".

aliquotIds

Character vector.

attributeSubset

String. Examples include but are not limited to "sex", "ageBracket"

autolysisScores

Character vector. Options: "None", "Mild", "Moderate", "Severe".

cellType

String. "Adipocytes", "Epithelial_cells", "Hepatocytes", "Keratinocytes", "Myocytes", "Neurons", "Neutrophils".

bp_window

Integer.

chromosome

String. One of "chr1", "chr2", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr20", "chr21", "chr22", "chrM", "chrX", "chrY".

datasetId

String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".

dataTypes

Character vector. Options: "RNASEQ", "WGS", "WES", "OMNI", "EXCLUDE".

draw

Integer.

end

Integer.

excludeDataArray

String. Options are TRUE or FALSE

.featureId

String. A genomic feature e.g. GENCODE ID, RSID or GTEx Variant ID.

filterMtGene

Logical. Exclude mitochondrial genes.

gencodeId

String. A Versioned GENCODE ID of a gene, e.g. "ENSG00000065613.9".

gencodeIds

A character vector of Versioned GENCODE IDs, e.g. c("ENSG00000132693.12", "ENSG00000203782.5").

gencodeVersion

String (default = "v26"). GENCODE annotation release. Either "v26" or "v19".

geneId

String. A gene symbol, a gencode ID, or an Ensemble ID.

geneIds

A character vector of gene symbols, versioned gencodeIds, or unversioned gencodeIds.

genomeBuild

String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".

hardyScale

String A Hardy Scale of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

hardyScales

Character vector. A list of Hardy Scale(s) of interest. Options: "Ventilator case", "Fast death - violent", "Fast death - natural causes", "Intermediate death", "Slow death".

hasExpressionData

Logical.

hasGenotype

Logical.

itemsPerPage

Integer (default = 250). Set globally to maximum value 100000 with options(list(gtexr.itemsPerPage = 100000)).

ischemicTimes

Integer.

ischemicTimeGroups

Character vector. Options: "<= 0", "1 - 300", "301 - 600", "601 - 900", "901 - 1200", "1201 - 1500", "> 1500".

materialTypes

String, vector. Options: "Cells:Cell Line Viable", "DNA:DNA Genomic", "DNA:DNA Somatic", "RNA:Total RNA", "Tissue:PAXgene Preserved", "Tissue:PAXgene Preserved Paraffin-embedded", "Tissue:Fresh Frozen Tissue".

organizationName

String. Options: "GTEx Consortium" "Kid's First".

page

Integer (default = 0).

pathCategory

Character vector. Options: "adenoma", "amylacea", "atelectasis", "atherosclerosis", "atherosis", "atrophy", "calcification", "cirrhosis", "clean_specimens", "congestion", "corpora_albicantia", "cyst", "desquamation", "diabetic", "dysplasia", "edema", "emphysema", "esophagitis", "fibrosis", "gastritis", "glomerulosclerosis", "goiter", "gynecomastoid", "hashimoto", "heart_failure_cells", "hemorrhage", "hepatitis", "hyalinization", "hypereosinophilia", "hyperplasia", "hypertrophy", "hypoxic", "infarction", "inflammation", "ischemic_changes", "macrophages", "mastopathy", "metaplasia", "monckeberg", "necrosis", "nephritis", "nephrosclerosis", "no_abnormalities", "nodularity", "pancreatitis", "pigment", "pneumonia", "post_menopausal", "prostatitis", "saponification", "scarring", "sclerotic", "solar_elastosis", "spermatogenesis", "steatosis", "sweat_glands", "tma".

phenotypeId

String. See GTEx portal FAQs for further details.

pos

Integer.

poss

Integer, vector.

project_id

String. Options: "gtex", "adult-gtex", "egtex".

.return_raw

Logical. If TRUE, return the raw API JSON response. Default = FALSE

rins

Integer, vector.

sampleId

String. ⁠^GTEX-[A-Z0-9]{5}-[0-9]{4}-SM-[A-Z0-9]{5}$⁠

sampleIds

Character vector. GTEx sample ID.

searchTerm

String.

sex

String. Options: "male", "female".

snpId

String

sortBy

String. Options: "sampleId", "ischemicTime", "aliquotId", "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", "tissueSiteDetailId", "sex".

sortDirection

String. Options: "asc", "desc". Default = "asc".

start

Integer.

subjectIds

Character vector. GTEx subject ID.

tissueSampleIds

Array of strings. A list of Tissue Sample ID(s).

tissueSiteDetailId

String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or an Ontology ID.

tissueSiteDetailIds

Character vector of IDs for tissues of interest. Can be GTEx specific IDs (e.g. "Whole_Blood"; use get_tissue_site_detail() to see valid values) or Ontology IDs.

uberonIds

Character vector of Uberon IDs (e.g. "UBERON:EFO_0000572"; use get_tissue_site_detail() to see valid values).

variantId

String. A gtex variant ID.

variantIds

Character vector. Gtex variant IDs.

.verbose

Logical. If TRUE (default), print paging information. Set to FALSE globally with options(list(gtexr.verbose = FALSE)).

Value

A tibble of gtexr arguments and their metadata. Used for documentation only.