Skip to contents

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

  • Returns median normalized expression in tissues of all known transcripts of a given gene along with the hierarchical clustering results of tissues and genes, based on expression, in Newick format.

  • Results may be filtered by dataset, gene or tissue, but at least one gene must be provided.

  • The hierarchical clustering is performed by calculating Euclidean distances and using the average linkage method.

  • This endpoint is not paginated.

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
)

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.

Value

A tibble, with clustering data stored as an attribute, "clusters".

Examples

# \dontrun{
get_clustered_median_transcript_expression(gencodeIds = c("ENSG00000203782.5",
                                                    "ENSG00000132693.12"))
#>  Retrieve clustering data with `attr(<df>, 'clusters')`
#> # A tibble: 432 × 8
#>    median transcriptId      tissueSiteDetailId    ontologyId datasetId gencodeId
#>     <dbl> <chr>             <chr>                 <chr>      <chr>     <chr>    
#>  1 0.130  ENST00000255030.9 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  2 0      ENST00000368110.1 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  3 0      ENST00000368111.5 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  4 0      ENST00000368112.5 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  5 0      ENST00000437342.1 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  6 0.0100 ENST00000473196.1 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  7 0      ENST00000489317.1 Adipose_Subcutaneous  UBERON:00… gtex_v8   ENSG0000…
#>  8 0.0900 ENST00000255030.9 Adipose_Visceral_Ome… UBERON:00… gtex_v8   ENSG0000…
#>  9 0      ENST00000368110.1 Adipose_Visceral_Ome… UBERON:00… gtex_v8   ENSG0000…
#> 10 0      ENST00000368111.5 Adipose_Visceral_Ome… UBERON:00… gtex_v8   ENSG0000…
#> # ℹ 422 more rows
#> # ℹ 2 more variables: geneSymbol <chr>, unit <chr>

# clustering data is stored as an attribute "clusters"
result <- get_clustered_median_transcript_expression(c("ENSG00000203782.5",
                                                 "ENSG00000132693.12"))
#>  Retrieve clustering data with `attr(<df>, 'clusters')`
attr(result, "clusters")
#> $transcript
#> [1] "(((ENST00000473196.1:0.46,ENST00000255030.9:0.46):1.64,(((ENST00000437342.1:0.16,ENST00000368112.5:0.16):0.09,(ENST00000368111.5:0.03,ENST00000368110.1:0.03):0.21):0.15,ENST00000489317.1:0.40):1.70):2.76,ENST00000368742.3:4.86);"
#> 
#> $tissue
#> [1] "(((((((((((Spleen:0.00,Breast_Mammary_Tissue:0.00):0.01,Lung:0.01):0.00,((Ovary:0.01,Esophagus_Mucosa:0.01):0.00,Nerve_Tibial:0.01):0.01):0.00,((((Artery_Coronary:0.00,Adipose_Subcutaneous:0.00):0.00,Adipose_Visceral_Omentum:0.01):0.00,((Esophagus_Muscularis:0.00,Esophagus_Gastroesophageal_Junction:0.00):0.00,Thyroid:0.00):0.00):0.00,(Small_Intestine_Terminal_Ileum:0.01,Artery_Aorta:0.01):0.01):0.00):0.01,(((((Cells_EBV-transformed_lymphocytes:0.00,Brain_Hippocampus:0.00):0.00,Brain_Spinal_cord_cervical_c-1:0.00):0.00,Artery_Tibial:0.01):0.00,Brain_Amygdala:0.01):0.01,(((Brain_Putamen_basal_ganglia:0.00,Brain_Caudate_basal_ganglia:0.00):0.00,Brain_Nucleus_accumbens_basal_ganglia:0.00):0.00,((Colon_Sigmoid:0.00,Brain_Substantia_nigra:0.00):0.00,(Muscle_Skeletal:0.00,Heart_Atrial_Appendage:0.00):0.00):0.00):0.01):0.01):0.01,((((Cells_Cultured_fibroblasts:0.01,Adrenal_Gland:0.01):0.01,Kidney_Cortex:0.01):0.00,((Uterus:0.01,Prostate:0.01):0.00,Minor_Salivary_Gland:0.01):0.01):0.00,((((Heart_Left_Ventricle:0.01,Colon_Transverse:0.01):0.00,(Whole_Blood:0.00,Brain_Cerebellar_Hemisphere:0.00):0.01):0.00,((Stomach:0.00,Brain_Cerebellum:0.00):0.01,Pituitary:0.01):0.01):0.00,Kidney_Medulla:0.02):0.01):0.01):0.02,(((Brain_Hypothalamus:0.01,Brain_Cortex:0.01):0.01,Vagina:0.02):0.01,(Brain_Frontal_Cortex_BA9:0.01,Brain_Anterior_cingulate_cortex_BA24:0.01):0.02):0.03):0.01,((((Cervix_Endocervix:0.02,Bladder:0.02):0.00,Cervix_Ectocervix:0.02):0.01,Fallopian_Tube:0.03):0.02,Testis:0.05):0.01):0.15,Pancreas:0.21):0.36,(Skin_Sun_Exposed_Lower_leg:0.01,Skin_Not_Sun_Exposed_Suprapubic:0.01):0.56):0.61,Liver:1.19);"
#> 

# 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)
# }