### Get Transcripts API Request (Python) Source: https://gtexportal.org/api/v2/redoc Example of how to make a request to the GTEx Portal API v2 to get transcript information for a given GENCODE ID using Python. This snippet demonstrates constructing the URL and making a GET request, handling potential errors. ```python import requests def get_transcripts(gencode_id, gencode_version="v26", genome_build="GRCh38/hg38", page=0, items_per_page=250): """Fetches transcript information from the GTEx Portal API v2. Args: gencode_id (str): A Versioned GENCODE ID of a gene. gencode_version (str): GENCODE annotation release. Defaults to "v26". genome_build (str): Genome build. Defaults to "GRCh38/hg38". page (int): The 0-based numeric ID of the page to retrieve. Defaults to 0. items_per_page (int): Number of items per page. Defaults to 250. Returns: dict: A dictionary containing the API response, or None if an error occurs. """ base_url = "https://gtexportal.org/api/v2/reference/transcript" params = { "gencodeId": gencode_id, "gencodeVersion": gencode_version, "genomeBuild": genome_build, "page": page, "itemsPerPage": items_per_page } try: response = requests.get(base_url, params=params) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching transcripts: {e}") return None # Example usage: gene_id = "ENSG00000065613.9" transcript_data = get_transcripts(gene_id) if transcript_data: print("Successfully retrieved transcript data:") # Process the transcript_data dictionary here # print(transcript_data) else: print("Failed to retrieve transcript data.") ``` -------------------------------- ### Get Transcripts API Request (JavaScript) Source: https://gtexportal.org/api/v2/redoc Example of how to make a request to the GTEx Portal API v2 to get transcript information for a given GENCODE ID using JavaScript. This snippet demonstrates using the fetch API to construct the URL and make a GET request, handling the JSON response. ```javascript async function getTranscripts(gencodeId, gencodeVersion = 'v26', genomeBuild = 'GRCh38/hg38', page = 0, itemsPerPage = 250) { const baseUrl = 'https://gtexportal.org/api/v2/reference/transcript'; const params = new URLSearchParams({ gencodeId: gencodeId, gencodeVersion: gencodeVersion, genomeBuild: genomeBuild, page: page.toString(), itemsPerPage: itemsPerPage.toString() }); const url = `${baseUrl}?${params.toString()}`; try { const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); return data; } catch (error) { console.error('Error fetching transcripts:', error); return null; } } // Example usage: const geneId = 'ENSG00000065613.9'; getTranscripts(geneId).then(transcriptData => { if (transcriptData) { console.log('Successfully retrieved transcript data:'); // Process the transcriptData object here // console.log(transcriptData); } else { console.log('Failed to retrieve transcript data.'); } }); ``` -------------------------------- ### Get PCA Data - Example Source: https://gtexportal.org/api/v2/redoc This snippet demonstrates how to fetch Principal Component Analysis (PCA) data for gene expression. It shows the structure of the request and the expected response, which includes PCA values (pc1, pc2, pc3) and sample identifiers. The data can be filtered by tissue site and dataset. ```json { "data": [ { "pc1": 0, "pc2": 0, "pc3": 0, "sampleId": "string", "tissueSiteDetailId": "Adipose_Subcutaneous", "ontologyId": "UBERON:EFO_0000572", "datasetId": "gtex_v8" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### GET /api/v2/ Source: https://gtexportal.org/api/v2/openapi Retrieves general information about the GTEx service. ```APIDOC ## GET /api/v2/ ### Description General information about the GTEx service. ### Method GET ### Endpoint /api/v2/ ### Parameters None ### Request Example None ### Response #### Success Response (200) - **schema** (object) - Reference to the ServiceInfo schema for detailed structure. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Median Exon Expression Data - Example Source: https://gtexportal.org/api/v2/redoc This snippet shows how to obtain median exon expression data. Similar to gene expression, it requires gene identifiers and can be filtered by dataset and tissue. The response provides median read counts for specific exons, along with gene and tissue details. This endpoint is useful for analyzing expression at the exon level. ```json { "data": [ { "median": 0, "exonId": "string", "tissueSiteDetailId": "Adipose_Subcutaneous", "ontologyId": "UBERON:EFO_0000572", "datasetId": "gtex_v8", "gencodeId": "string", "geneSymbol": "string", "unit": "TPM" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### GET /api/v2/dataset/sample Source: https://gtexportal.org/api/v2/redoc Retrieves sample information from the GTEx dataset. You can paginate the results using 'page' and 'itemsPerPage' parameters. ```APIDOC ## GET /api/v2/dataset/sample ### Description Retrieves sample information from the GTEx dataset. You can paginate the results using 'page' and 'itemsPerPage' parameters. ### Method GET ### Endpoint /api/v2/dataset/sample ### Parameters #### Query Parameters - **page** (integer) - Optional - Default: 0 - The 0-based numeric ID of the page to retrieve. - **itemsPerPage** (integer) - Optional - Default: 250 - The number of items to return per page. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **data** (array) - An array of sample objects. - **ischemicTime** (integer) - The ischemic time of the sample. - **aliquotId** (string) - The aliquot ID of the sample. - **tissueSampleId** (string) - The tissue sample ID. - **tissueSiteDetail** (string) - The detailed tissue site. - **dataType** (string) - The data type of the sample. - **ischemicTimeGroup** (string) - The ischemic time group. - **pathologyNotesCategories** (object) - Categories of pathology notes. - **property1** (boolean) - **property2** (boolean) - **freezeType** (string) - The freeze type of the sample. - **pathologyNotes** (string) - Pathology notes for the sample. - **sampleId** (string) - The sample ID. - **sampleIdUpper** (string) - The uppercase sample ID. - **ageBracket** (string) - The age bracket of the donor. - **rin** (integer) - The RNA integrity number. - **hardyScale** (string) - The Hardy scale of the donor. - **tissueSiteDetailId** (string) - The tissue site detail ID. - **subjectId** (string) - The subject ID. - **uberonId** (string) - The UBERON ID. - **sex** (string) - The sex of the donor. - **autolysisScore** (string) - The autolysis score. - **datasetId** (string) - The dataset ID. - **paging_info** (object) - Information about the pagination. - **numberOfPages** (integer) - **page** (integer) - **maxItemsPerPage** (integer) - **totalNumberOfItems** (integer) #### Response Example ```json { "data": [ { "ischemicTime": 0, "aliquotId": "string", "tissueSampleId": "string", "tissueSiteDetail": "string", "dataType": "string", "ischemicTimeGroup": "string", "pathologyNotesCategories": { "property1": true, "property2": true }, "freezeType": "string", "pathologyNotes": "string", "sampleId": "string", "sampleIdUpper": "string", "ageBracket": "20-29", "rin": 0, "hardyScale": "Ventilator case", "tissueSiteDetailId": "Adipose_Subcutaneous", "subjectId": "string", "uberonId": "string", "sex": "male", "autolysisScore": "string", "datasetId": "string" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` ``` -------------------------------- ### Python Example for Fetching Top Expressed Genes Source: https://gtexportal.org/api/v2/redoc This Python snippet demonstrates how to make a request to the 'Get Top Expressed Genes' endpoint using the 'requests' library. It shows how to pass required and optional query parameters such as tissue ID, dataset ID, and filtering for mitochondrial genes. ```python import requests api_url = "https://gtexportal.org/api/v2/expression/topExpressedGene" tokens = { "tissueSiteDetailId": "Brain_Cerebellum", "datasetId": "gtex_v10", "filterMtGene": "true" } response = requests.get(api_url, params=tokens) if response.status_code == 200: print(response.json()) else: print(f"Error: {response.status_code}") ``` -------------------------------- ### Get Gene Expression Data - Example Source: https://gtexportal.org/api/v2/redoc This snippet illustrates how to retrieve normalized gene expression data. It requires a gene identifier (gencodeId) and can be filtered by dataset and tissue. The response includes expression values, gene symbols, and tissue information. At least one gene must be provided in the request. ```json { "data": [ { "data": [ 0 ], "tissueSiteDetailId": "Adipose_Subcutaneous", "ontologyId": "UBERON:EFO_0000572", "datasetId": "gtex_v8", "gencodeId": "string", "geneSymbol": "string", "unit": "TPM", "subsetGroup": "male" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### GET /api/v2/admin/newsItem Source: https://gtexportal.org/api/v2/openapi Retrieves all current news items from the database. ```APIDOC ## GET /api/v2/admin/newsItem ### Description Getting all the news items from the database that are current. ### Method GET ### Endpoint /api/v2/admin/newsItem ### Parameters #### Query Parameters - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve. Defaults to 0. - **itemsPerPage** (integer) - Optional - The number of items to retrieve per page. Defaults to 250. ### Request Example ```json { "example": "?page=0&itemsPerPage=250" } ``` ### Response #### Success Response (200) - **schema** (object) - Reference to the PaginatedResponse_NewsItem_ schema for detailed structure. #### Response Example ```json { "example": "response body" } ``` #### Error Response (422) - **schema** (object) - Reference to the HTTPValidationError schema for detailed structure. ``` -------------------------------- ### GET /api/v2/dataset/fileList Source: https://gtexportal.org/api/v2/openapi Retrieves a list of all files available in the GTEx dataset, intended for display on the Download page. ```APIDOC ## GET /api/v2/dataset/fileList ### Description Get all the files in GTEx dataset for Download page. ### Method GET ### Endpoint /api/v2/dataset/fileList ### Parameters None ### Response #### Success Response (200) - **(array of File objects)** - Each object contains details about a file. #### Response Example ```json [ { "dataType": "RNA-Seq", "fileName": "GTEx_Analysis_2017-06-05_v8_RNA-Seq_RNA-Seq_sample_attributes.txt.gz", "fileSize": 1234567, "md5sum": "a1b2c3d4e5f678901234567890abcdef" } ] ``` ``` -------------------------------- ### GET /api/v2/metadata/dataset Source: https://gtexportal.org/api/v2/redoc Retrieves detailed information about GTEx datasets, including IDs, descriptions, and sample counts. ```APIDOC ## GET /api/v2/metadata/dataset ### Description Fetches metadata for GTEx datasets, providing details such as dataset ID, description, genome build, and various sample and tissue counts. Allows filtering by organization name. ### Method GET ### Endpoint /api/v2/metadata/dataset ### Parameters #### Query Parameters - **datasetId** (string) - Optional - A GTEx dataset identifier. Enum: "gtex_v8", "gtex_snrnaseq_pilot", "gtex_v10". - **organizationName** (string) - Optional - Filters datasets by organization. Enum: "GTEx Consortium", "Kid's First". ### Response #### Success Response (200) - The response is an array of dataset objects. - **datasetId** (string) - Unique identifier for the dataset. - **dbSnpBuild** (integer) - dbSNP build version. - **dbgapId** (string) - dbGaP identifier for the dataset. - **description** (string) - A description of the dataset. - **displayName** (string) - The display name of the dataset. - **eqtlSubjectCount** (integer) - Number of subjects with eQTL data. - **eqtlTissuesCount** (integer) - Number of tissues with eQTL data. - **gencodeVersion** (string) - GENCODE annotation version used. - **genomeBuild** (string) - The genome build used for the dataset (e.g., GRCh38/hg38). - **organization** (string) - The organization that provided the dataset. - **rnaSeqAndGenotypeSampleCount** (integer) - Number of samples with both RNA-Seq and genotype data. - **rnaSeqSampleCount** (integer) - Number of samples with RNA-Seq data. - **subjectCount** (integer) - Total number of subjects in the dataset. - **tissueCount** (integer) - Number of distinct tissues in the dataset. #### Response Example ```json [ { "datasetId": "string", "dbSnpBuild": 0, "dbgapId": "string", "description": "string", "displayName": "string", "eqtlSubjectCount": 0, "eqtlTissuesCount": 0, "gencodeVersion": "v39", "genomeBuild": "GRCh38/hg38", "organization": "string", "rnaSeqAndGenotypeSampleCount": 0, "rnaSeqSampleCount": 0, "subjectCount": 0, "tissueCount": 0 } ] ``` ``` -------------------------------- ### Get Downloads Page Data Source: https://gtexportal.org/api/v2/redoc Retrieves all files associated with a specific project ID for display on the Downloads Page. ```APIDOC ## GET /api/v2/dataset/openAccessFilesMetadata ### Description Retrieves all the files belonging to the given `project_id` for display on the `Downloads Page` ### Method GET ### Endpoint /api/v2/dataset/openAccessFilesMetadata ### Query Parameters - **project_id** (string) - Required - Enum: "gtex", "adult-gtex", "egtex". GTEx currently has one project available: gtex. ### Response #### Success Response (200) - **data** (array) - Contains file metadata for the specified project. - **name** (string) - **displayName** (string) - **description** (string) - **order** (integer) - **parent** (string) - **children** (object) - **files** (array) - **displayName** (string) - **description** (string) - **fileSize** (integer) - **url** (string) - **order** (integer) - **parent** (string) - **folders** (array) - **(object)** - Empty object schema provided. #### Response Example (200) ```json { "data": [ { "name": "string", "displayName": "string", "description": "string", "order": 0, "parent": "string", "children": { "files": [ { "displayName": "string", "description": "string", "fileSize": 0, "url": "string", "order": 0, "parent": "string" } ], "folders": [ { } ] } } ] } ``` #### Error Response (422) Validation Error ``` -------------------------------- ### GET /api/v2/histology/image Source: https://gtexportal.org/api/v2/openapi Retrieves histology images for specified tissue samples. Supports pagination. ```APIDOC ## GET /api/v2/histology/image ### Description Retrieves histology images based on provided tissue sample IDs. Supports pagination for results. ### Method GET ### Endpoint /api/v2/histology/image ### Parameters #### Query Parameters - **tissueSampleId** (array of strings) - Optional - A list of Tissue Sample ID(s) to filter images by. - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve. Defaults to 0. - **itemsPerPage** (integer) - Optional - The number of items to retrieve per page. Defaults to 250. ### Request Example ```json { "tissueSampleId": ["sample-1", "sample-2"], "page": 0, "itemsPerPage": 50 } ``` ### Response #### Success Response (200) - **results** (array) - A list of histology image data. - **total** (integer) - The total number of results. #### Response Example ```json { "results": [ { "tissueSampleId": "sample-1", "imageUrl": "http://example.com/image1.jpg" } ], "total": 10 } ``` ``` -------------------------------- ### GET /api/v2/reference/gwasCatalogByLocation Source: https://gtexportal.org/api/v2/redoc Finds entries in the GWAS Catalog located on a specific chromosome within a given start and end range. ```APIDOC ## GET /api/v2/reference/gwasCatalogByLocation ### Description Finds entries in the GWAS Catalog located on a specific chromosome within a given start and end range. ### Method GET ### Endpoint /api/v2/reference/gwasCatalogByLocation ### Parameters #### Query Parameters - **start** (integer) - Required - The start position on the chromosome. Range: [0 .. 250000000]. - **end** (integer) - Required - The end position on the chromosome. Range: [0 .. 250000000]. - **chromosome** (string) - Required - The chromosome identifier. Enum: "chr1", "chr10", "chr11", "chr12", "chr13", "chr14", "chr15", "chr16", "chr17", "chr18", "chr19", "chr2", "chr20", "chr21", "chr22", "chr3", "chr4", "chr5", "chr6", "chr7", "chr8", "chr9", "chrM", "chrX", "chrY". - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve. Default: 0. Range: [0 .. 1000000]. - **itemsPerPage** (integer) - Optional - The number of items to retrieve per page. Default: 250. Range: [1 .. 100000]. ### Request Example ```json { "start": 1000000, "end": 2000000, "chromosome": "chr1" } ``` ### Response #### Success Response (200) - **data** (array) - Array of GWAS Catalog entries matching the location criteria. - **chromosome** (string) - **start** (integer) - **end** (integer) - **phenotype** (string) - **pValue** (number) - **beta** (number) - **pubmedId** (integer) - **snpId** (string) - **riskAllele** (string) - **genomeBuild** (string) - **paging_info** (object) - Information about the pagination of the results. - **numberOfPages** (integer) - **page** (integer) - **maxItemsPerPage** (integer) - **totalNumberOfItems** (integer) #### Response Example (200) ```json { "data": [ { "chromosome": "chr1", "start": 1500000, "end": 1500001, "phenotype": "Type 2 diabetes", "pValue": 5.23e-10, "beta": 0.2, "pubmedId": 23456789, "snpId": "rs123456", "riskAllele": "A", "genomeBuild": "GRCh38/hg38" } ], "paging_info": { "numberOfPages": 1, "page": 0, "maxItemsPerPage": 250, "totalNumberOfItems": 1 } } ``` #### Error Response (400) Illegal query input. #### Error Response (422) Validation Error. ``` -------------------------------- ### Get File List (GTEx API v2) Source: https://gtexportal.org/api/v2/redoc Fetches a list of all files available in the GTEx dataset, intended for the Download page. Each file entry includes its name, subpath, dbGaP ID, dataset, release information, type, ID, description, and associated filesets. ```json [ { "name": "string", "subpath": "string", "dbgapId": "string", "dataset": "string", "release": "string", "order": 0, "type": "string", "id": "string", "description": "string", "filesets": [ null ] } ] ``` -------------------------------- ### GET /api/v2/reference/gwasCatalogByLocation Source: https://gtexportal.org/api/v2/openapi Retrieves entries from the GWAS Catalog based on genomic location (chromosome, start, and end positions). Supports pagination. ```APIDOC ## GET /api/v2/reference/gwasCatalogByLocation ### Description Find the GWAS Catalog on a certain chromosome between start and end locations. This endpoint supports pagination. ### Method GET ### Endpoint /api/v2/reference/gwasCatalogByLocation ### Parameters #### Query Parameters - **start** (integer) - Required - The starting genomic position. - **end** (integer) - Required - The ending genomic position. - **chromosome** (string) - Required - The chromosome name (e.g., 'chr1'). - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve. Defaults to 0. - **itemsPerPage** (integer) - Optional - The number of items to return per page. Defaults to 250. ### Request Example ```json { "example": "GET /api/v2/reference/gwasCatalogByLocation?start=1000000&end=2000000&chromosome=chr1&page=0&itemsPerPage=250" } ``` ### Response #### Success Response (200) - **result** (object) - Contains a list of GWAS Catalog entries. - **total_items** (integer) - Total number of items found. - **items** (array) - Array of GWAS Catalog entries. - **variant_id** (string) - The rsID of the variant. - **p_value** (number) - The p-value of the association. - **study_id** (string) - The ID of the study. - **trait** (string) - The trait associated with the variant. - **chromosome** (string) - The chromosome of the variant. - **position** (integer) - The genomic position of the variant. #### Response Example ```json { "example": { "result": { "total_items": 10, "items": [ { "variant_id": "rs12345", "p_value": 1.5e-8, "study_id": "GCST000001", "trait": "Type 2 Diabetes", "chromosome": "chr1", "position": 1500000 } ] } } } ``` #### Error Response (400) - **message** (string) - Description of the error. #### Error Response (422) - **detail** (array) - Details of the validation error. ``` -------------------------------- ### Get Dataset Sample - JSON Response Structure Source: https://gtexportal.org/api/v2/redoc This JSON structure outlines the response for retrieving dataset sample information. It includes sample details, such as ischemic time, aliquot ID, tissue site, and pathology notes, along with pagination information. ```json { "data": [ { "ischemicTime": 0, "aliquotId": "string", "tissueSampleId": "string", "tissueSiteDetail": "string", "dataType": "string", "ischemicTimeGroup": "string", "pathologyNotesCategories": { "property1": true, "property2": true }, "freezeType": "string", "pathologyNotes": "string", "sampleId": "string", "sampleIdUpper": "string", "ageBracket": "20-29", "rin": 0, "hardyScale": "Ventilator case", "tissueSiteDetailId": "Adipose_Subcutaneous", "subjectId": "string", "uberonId": "string", "sex": "male", "autolysisScore": "string", "datasetId": "string" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### Get Significant Single Tissue Eqtls By Location API Endpoint Source: https://gtexportal.org/api/v2/redoc This endpoint retrieves significant single tissue eQTLs based on chromosomal location. It requires tissue, start, end, and chromosome, and can be filtered by dataset. The distance between start and end locations must not exceed 8,000,000 base pairs. ```http GET /api/v2/association/singleTissueEqtlByLocation https://gtexportal.org/api/v2/association/singleTissueEqtlByLocation ``` -------------------------------- ### GET /api/v2/dataset/functionalAnnotation Source: https://gtexportal.org/api/v2/redoc Retrieves functional annotation for genetic variants within specified genomic regions and datasets. It allows filtering by chromosome, start and end positions, and pagination. ```APIDOC ## GET /api/v2/dataset/functionalAnnotation ### Description This endpoint retrieves functional annotation for genetic variants. It allows specifying a genomic region (chromosome, start, end) and filtering by dataset. Pagination is supported. ### Method GET ### Endpoint /api/v2/dataset/functionalAnnotation ### Parameters #### Query Parameters - **datasetId** (string) - Optional - Default: "gtex_v8" - Unique identifier of a dataset. Enum: "gtex_v8", "gtex_snrnaseq_pilot", "gtex_v10". - **chromosome** (string) - Required - Specifies the chromosome. Enum: "chr1", "chr10", ..., "chrY". - **start** (integer) - Required - The start position of the genomic region. Range: [0 .. 250000000]. - **end** (integer) - Required - The end position of the genomic region. Range: [0 .. 250000000]. - **page** (integer) - Optional - Default: 0 - The 0-based numeric ID of the page to retrieve. Range: [0 .. 1000000]. - **itemsPerPage** (integer) - Optional - Default: 250 - The number of items to return per page. Range: [1 .. 100000]. ### Request Example ```json { "datasetId": "gtex_v8", "chromosome": "chr1", "start": 10000, "end": 20000, "page": 0, "itemsPerPage": 100 } ``` ### Response #### Success Response (200) - **data** (array) - An array of functional annotation objects. - **variantId** (string) - Unique identifier for the variant. - **enhancer** (boolean) - Indicates if the variant is in an enhancer region. - **promoter** (boolean) - Indicates if the variant is in a promoter region. - **openChromatinRegion** (boolean) - Indicates if the variant is in an open chromatin region. - **promoterFlankingRegion** (boolean) - Indicates if the variant is in a promoter-flanking region. - **ctcfBindingSite** (boolean) - Indicates if the variant is a CTCF binding site. - **tfBindingSite** (boolean) - Indicates if the variant is a transcription factor binding site. - **3PrimeUtrVariant** (boolean) - Indicates if the variant is in a 3' UTR. - **5PrimeUtrVariant** (boolean) - Indicates if the variant is in a 5' UTR. - **frameshiftVariant** (boolean) - Indicates if the variant is a frameshift variant. - **intronVariant** (boolean) - Indicates if the variant is an intron variant. - **missenseVariant** (boolean) - Indicates if the variant is a missense variant. - **nonCodingTranscriptExonVariant** (boolean) - Indicates if the variant is in a non-coding transcript exon. - **spliceAcceptorVariant** (boolean) - Indicates if the variant is a splice acceptor variant. - **spliceDonorVariant** (boolean) - Indicates if the variant is a splice donor variant. - **spliceRegionVariant** (boolean) - Indicates if the variant is a splice region variant. - **stopGained** (boolean) - Indicates if the variant is a stop-gained variant. - **synonymousVariant** (boolean) - Indicates if the variant is a synonymous variant. - **chromosome** (string) - The chromosome of the variant. - **pos** (integer) - The position of the variant. - **ref** (string) - The reference allele. - **alt** (string) - The alternative allele. - **datasetId** (string) - The ID of the dataset. - **paging_info** (object) - Pagination details. - **numberOfPages** (integer) - Total number of pages. - **page** (integer) - Current page number. - **maxItemsPerPage** (integer) - Maximum items per page. - **totalNumberOfItems** (integer) - Total number of items. #### Response Example ```json { "data": [ { "variantId": "chr1:10000:A:G", "enhancer": false, "promoter": true, "openChromatinRegion": false, "promoterFlankingRegion": false, "ctcfBindingSite": false, "tfBindingSite": true, "3PrimeUtrVariant": false, "5PrimeUtrVariant": false, "frameshiftVariant": false, "intronVariant": false, "missenseVariant": false, "nonCodingTranscriptExonVariant": false, "spliceAcceptorVariant": false, "spliceDonorVariant": false, "spliceRegionVariant": false, "stopGained": false, "synonymousVariant": false, "chromosome": "chr1", "pos": 10000, "ref": "A", "alt": "G", "datasetId": "gtex_v8" } ], "paging_info": { "numberOfPages": 1, "page": 0, "maxItemsPerPage": 100, "totalNumberOfItems": 1 } } ``` #### Error Response (400) - Illegal query input. #### Error Response (422) - Validation Error. ``` -------------------------------- ### Get Downloads Page Data (GTEx API v2) Source: https://gtexportal.org/api/v2/redoc Retrieves metadata for open-access files for display on the Downloads Page, filterable by project ID. The response includes file details such as name, display name, description, size, URL, and hierarchical organization into folders and files. ```json { "data": [ { "name": "string", "displayName": "string", "description": "string", "order": 0, "parent": "string", "children": { "files": [ { "displayName": "string", "description": "string", "fileSize": 0, "url": "string", "order": 0, "parent": "string" } ], "folders": [ {} ] } } ] } ``` -------------------------------- ### GET /api/v2/dataset/functionalAnnotation Source: https://gtexportal.org/api/v2/openapi Retrieves the functional annotation of a specified chromosome location. It defaults to the most recent dataset release and allows filtering by dataset, chromosome, start, and end positions. ```APIDOC ## GET /api/v2/dataset/functionalAnnotation ### Description Retrieves the functional annotation of a specified chromosome location. It defaults to the most recent dataset release and allows filtering by dataset, chromosome, start, and end positions. ### Method GET ### Endpoint /api/v2/dataset/functionalAnnotation ### Parameters #### Query Parameters - **datasetId** (string) - Optional - Unique identifier of a dataset. Usually includes a data source and data release. (Default: "gtex_v8") - **chromosome** (string) - Required - Chromosome identifier. - **start** (integer) - Required - Start position of the genomic region. - **end** (integer) - Required - End position of the genomic region. - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve (Default: 0). - **itemsPerPage** (integer) - Optional - Number of items to return per page (Default: 250). ### Response #### Success Response (200) - **results** (array) - A list of functional annotations. - **total** (integer) - The total number of results available. #### Response Example ```json { "results": [ { "chromosome": "chr1", "start": 10000, "end": 20000, "annotation": "gene_id:ENSG00000123456,gene_name:ABC1,feature_type:gene" } ], "total": 1 } ``` ``` -------------------------------- ### GET /api/v2/dataset/sample Source: https://gtexportal.org/api/v2/openapi Retrieves a paginated list of samples from the GTEx dataset. Allows filtering by various criteria such as dataset ID, tissue site, RNA integrity number (RIN), and data type. Sorting and pagination are also supported. ```APIDOC ## GET /api/v2/dataset/sample ### Description Retrieves a paginated list of samples from the GTEx dataset. Allows filtering by various criteria such as dataset ID, tissue site, RNA integrity number (RIN), and data type. Sorting and pagination are also supported. ### Method GET ### Endpoint /api/v2/dataset/sample ### Parameters #### Query Parameters - **datasetId** (string) - Optional - Unique identifier of a dataset. Usually includes a data source and data release. - **tissueSite** (array of references to components/schemas/TissueSite) - Optional - A list of tissue site(s) of interest. - **ischemicTimeGroup** (array of references to components/schemas/IschemicTimeGroup) - Optional - - **rin** (array of numbers) - Optional - The RNA integrity number (RIN) of the sample. Values should be between 1 and 10. - **uberonId** (array of references to components/schemas/TissueSiteOntologyId) - Optional - A list of Uberon ID(s) of interest. - **dataType** (array of references to components/schemas/DataType) - Optional - - **sortBy** (reference to components/schemas/SampleSortBy) - Optional - Field to sort the results by. Defaults to 'sampleId'. - **sortDirection** (reference to components/schemas/SortDirection) - Optional - Direction to sort the results. Defaults to 'asc'. - **page** (integer) - Optional - The 0-based numeric ID of the page to retrieve. Defaults to 0. - **itemsPerPage** (integer) - Optional - The number of items to return per page. Defaults to 250. ### Response #### Success Response (200) - **data** (array) - A list of sample objects. - **total** (integer) - The total number of samples matching the query. #### Response Example ```json { "data": [ { "sampleId": "GTEX-1117-0001-1084-01", "datasetId": "gtex_v8", "tissueSite": { "tissueSiteId": "WHCL", "tissueSiteDescription": "Whole blood" }, "collectionDate": "2015-08-11T00:00:00", "subjectId": "GTEX-1117", "sex": "M", "ageBracket": "30-39", "hardyScale": "1", "rnaseqPlatform": "Illumina HiSeq 2500", "rnaseqUnit": "Reads", "rnaseqTotalReads": 49986778, "rnaseqMedianCounts": 21423419, "rnaseqMedianExons": 33803, "geneIds": [ "ENSG00000237491", "ENSG00000175835", "ENSG00000184595", "ENSG00000170051", "ENSG00000171867", "ENSG00000167075", "ENSG00000187634", "ENSG00000163614", "ENSG00000166582", "ENSG00000078140" ], "geneSymbols": [ "DDX11L2", "OR4F2", "LINC00115", "SAMD11", "NPIP", "MDM1", "RP11-783G7.2", "KLHL17", "PLEKHN1", "CDCPA1" ], "omicsOmics": [ "RNA-Seq" ] } ], "total": 1 } ``` #### Error Response (422) - **detail** (array) - Validation errors. #### Response Example ```json { "detail": [ { "loc": [ "query", "page" ], "msg": "ensure this value is greater than or equal to 0", "type": "value_error.number.min" } ] } ``` ``` -------------------------------- ### Get Dataset Info Response JSON Source: https://gtexportal.org/api/v2/redoc This JSON structure represents a successful response for retrieving dataset information. It returns an array of dataset objects, each detailing the dataset ID, dbSNP build, dbGaP ID, description, display name, subject and tissue counts, and genome build information. ```json [ { "datasetId": "string", "dbSnpBuild": 0, "dbgapId": "string", "description": "string", "displayName": "string", "eqtlSubjectCount": 0, "eqtlTissuesCount": 0, "gencodeVersion": "v39", "genomeBuild": "GRCh38/hg38", "organization": "string", "rnaSeqAndGenotypeSampleCount": 0, "rnaSeqSampleCount": 0, "subjectCount": 0, "tissueCount": 0 } ] ``` -------------------------------- ### Get Exons Response JSON Source: https://gtexportal.org/api/v2/redoc This JSON structure represents a successful response for retrieving exon data. It includes an array of exon objects, each containing feature type, start and end positions, genome build, chromosome, gene and transcript IDs, and GENCODE version. Pagination details are also provided. ```json { "data": [ { "featureType": "string", "end": 0, "genomeBuild": "GRCh38/hg38", "start": 0, "exonId": "string", "source": "string", "chromosome": "chr1", "gencodeId": "string", "transcriptId": "string", "geneSymbol": "string", "gencodeVersion": "v39", "strand": "+", "exonNumber": "string" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### Get Subject - JSON Response Structure Source: https://gtexportal.org/api/v2/redoc This JSON structure represents the response for the 'Get Subject' endpoint, which retrieves subject information. It includes details like Hardy Scale, age bracket, subject ID, sex, and the dataset ID. ```json { "data": [ { "hardyScale": "Ventilator case", "ageBracket": "20-29", "subjectId": "string", "sex": "male", "datasetId": "string" } ], "paging_info": { "numberOfPages": 0, "page": 0, "maxItemsPerPage": 0, "totalNumberOfItems": 0 } } ``` -------------------------------- ### File Schema Source: https://gtexportal.org/api/v2/openapi Defines the structure for files available in the GTEx portal, including metadata and access information. ```APIDOC ## File Schema ### Description Represents a data file within the GTEx portal, including its name, path, associated dataset, and description. ### Method N/A (Schema definition) ### Endpoint N/A (Schema definition) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **name** (string) - The name of the file. - **subpath** (string) - The subpath relative to the dataset's base path. - **dbgapId** (string) - dbGaP accession ID associated with the file, if applicable. - **dataset** (string) - The dataset this file belongs to (e.g., 'GTEx_V8'). - **release** (string) - The release version of the dataset. - **order** (integer) - An ordering number for display purposes. - **type** (string) - The type of the file (e.g., 'vcf', 'tsv', 'bigwig'). - **id** (string) - A unique identifier for the file. - **description** (string) - A description of the file's content. - **filesets** (array) - Information about the filesets this file belongs to. #### Response Example ```json { "name": "GTEx_V8_egenes_HGI.egenes.txt.gz", "subpath": "genotypes/", "dbgapId": "phs000424.v8.p2", "dataset": "GTEx_V8", "release": "8", "order": 1, "type": "tsv", "id": "GTEX_V8_egenes_HGI.egenes.txt.gz", "description": "eGene list for GTEx V8", "filesets": [{"id": "GTEX_V8"}] } ``` ```