Skip to contents

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,
  chromosome = NULL,
  pos = NULL,
  datasetId = "gtex_v8",
  page = 0,
  itemsPerPage = 250
)

Arguments

snpId

String

variantId

String. A gtex variant ID.

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".

pos

Integer, vector.

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).

Value

A tibble.

Examples

# search by rsid
get_variant(snpId = "rs1410858")
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#>  numberOfPages = 1
#>  page = 0
#>  maxItemsPerPage = 250
#>  totalNumberOfItems = 1
#> # A tibble: 1 × 10
#>   snpId     b37VariantId         pos maf01 variantId alt   chromosome snpIdUpper
#>   <chr>     <chr>              <int> <lgl> <chr>     <chr> <chr>      <chr>     
#> 1 rs1410858 1_153182116_C_A_… 1.53e8 TRUE  chr1_153… A     chr1       RS1410858 
#> # ℹ 2 more variables: datasetId <chr>, ref <chr>

# search by variantId
get_variant(variantId = "chr1_153209640_C_A_b38")
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#>  numberOfPages = 1
#>  page = 0
#>  maxItemsPerPage = 250
#>  totalNumberOfItems = 1
#> # A tibble: 1 × 10
#>   snpId     b37VariantId         pos maf01 variantId alt   chromosome snpIdUpper
#>   <chr>     <chr>              <int> <lgl> <chr>     <chr> <chr>      <chr>     
#> 1 rs1410858 1_153182116_C_A_… 1.53e8 TRUE  chr1_153… A     chr1       RS1410858 
#> # ℹ 2 more variables: datasetId <chr>, ref <chr>

# search by chromosome and position
get_variant(chromosome = "chr1",
            pos = 153209600:153209700)
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#>  numberOfPages = 1
#>  page = 0
#>  maxItemsPerPage = 250
#>  totalNumberOfItems = 4
#> # A tibble: 4 × 10
#>   snpId       b37VariantId       pos maf01 variantId alt   chromosome snpIdUpper
#>   <chr>       <chr>            <int> <lgl> <chr>     <chr> <chr>      <chr>     
#> 1 rs11205220  1_153182115_T_… 1.53e8 TRUE  chr1_153… C     chr1       RS11205220
#> 2 rs1410858   1_153182116_C_… 1.53e8 TRUE  chr1_153… A     chr1       RS1410858 
#> 3 rs139296761 1_153182120_C_… 1.53e8 FALSE chr1_153… T     chr1       RS1392967…
#> 4 rs80104092  1_153182149_T_… 1.53e8 FALSE chr1_153… C     chr1       RS80104092
#> # ℹ 2 more variables: datasetId <chr>, ref <chr>