Skip to contents

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,
  hardyScales = NULL,
  subjectIds = NULL,
  page = 0,
  itemsPerPage = 250
)

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

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

subjectIds

Character vector. GTEx subject ID.

page

Integer (default = 0).

itemsPerPage

Integer (default = 250).

Value

A Tibble

Examples

# \dontrun{
  get_subject()
#> Warning: ! Total number of items (979) exceeds maximum page size (250).
#>  Try increasing `itemsPerPage`.
#> 
#> ── Paging info ─────────────────────────────────────────────────────────────────
#>  numberOfPages = 4
#>  page = 0
#>  maxItemsPerPage = 250
#>  totalNumberOfItems = 979
#> # A tibble: 250 × 5
#>    hardyScale                  ageBracket subjectId  sex    datasetId
#>    <chr>                       <chr>      <chr>      <chr>  <chr>    
#>  1 Slow death                  60-69      GTEX-1117F female gtex_v8  
#>  2 Ventilator case             50-59      GTEX-111CU male   gtex_v8  
#>  3 Fast death - violent        60-69      GTEX-111FC male   gtex_v8  
#>  4 Intermediate death          60-69      GTEX-111VG male   gtex_v8  
#>  5 Ventilator case             60-69      GTEX-111YS male   gtex_v8  
#>  6 Ventilator case             60-69      GTEX-1122O female gtex_v8  
#>  7 Fast death - natural causes 60-69      GTEX-1128S female gtex_v8  
#>  8 NA                          60-69      GTEX-113IC male   gtex_v8  
#>  9 Fast death - natural causes 50-59      GTEX-113JC female gtex_v8  
#> 10 Fast death - natural causes 60-69      GTEX-117XS male   gtex_v8  
#> # ℹ 240 more rows
# }