diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 0000000..81b960f --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50d1aa1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.Rproj.user +docs +.Rhistory diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..f9faec3 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,29 @@ +Package: gtexr +Title: Query the GTEx Portal API +Version: 0.0.0.9000 +Authors@R: + person(given = "Alasdair", + family = "Warwick", + role = c("aut", "cre", "cph"), + email = "alasdair.warwick06@gmail.com", + comment = c(ORCID = "0000-0002-0800-2890")) +Description: A convenient R interface to the GTEx Portal API. +License: MIT + file LICENSE +URL: https://rmgpanw.github.io/gtexr/, + https://github.com/rmgpanw/gtexr +BugReports: https://github.com/rmgpanw/gtexr/issues +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.1 +Imports: + cli, + dplyr, + httr2 (>= 1.0.0), + purrr, + rlang, + tibble, + tidyr +Suggests: + httptest2, + testthat (>= 3.0.0) +Config/testthat/edition: 3 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..42c8f8f --- /dev/null +++ b/LICENSE @@ -0,0 +1,2 @@ +YEAR: 2024 +COPYRIGHT HOLDER: gtexr authors diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7852da8 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2024 gtexr authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..db557fb --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,38 @@ +# Generated by roxygen2: do not edit by hand + +export(available_tissueSiteDetailIds) +export(calculate_eqtls) +export(get_annotation) +export(get_collapsed_gene_model_exon) +export(get_dataset_info) +export(get_downloads_page_data) +export(get_eqtl_genes) +export(get_exons) +export(get_file_list) +export(get_fine_mapping) +export(get_full_get_collapsed_gene_model_exon) +export(get_functional_annotation) +export(get_gene_search) +export(get_genes) +export(get_gwas_catalog_by_location) +export(get_image) +export(get_independent_eqtl) +export(get_linkage_disequilibrium_by_variant_data) +export(get_linkage_disequilibrium_data) +export(get_maintenance_message) +export(get_multi_tissue_eqtls) +export(get_neighbor_gene) +export(get_news_item) +export(get_sample) +export(get_service_info) +export(get_significant_single_tissue_eqtls) +export(get_significant_single_tissue_eqtls_by_location) +export(get_significant_single_tissue_ieqtls) +export(get_significant_single_tissue_isqtls) +export(get_significant_single_tissue_sqtls) +export(get_sqtl_genes) +export(get_subject) +export(get_tissue_site_detail) +export(get_transcripts) +export(get_variant) +export(get_variant_by_location) diff --git a/R/calculate_eqtls.R b/R/calculate_eqtls.R index ca99be5..47afba4 100644 --- a/R/calculate_eqtls.R +++ b/R/calculate_eqtls.R @@ -3,6 +3,11 @@ #' [Calculate your own #' eQTLs](https://gtexportal.org/api/v2/redoc#tag/Dynamic-Association-Endpoints/operation/calculate_expression_quantitative_trait_loci_api_v2_association_dyneqtl_get) #' +#' Notes on output: +#' +#' * Beta and standard error are recorded in columns `nes` and `error` respectively (see [GTEx FAQs](https://gtexportal.org/home/faq#nes_beta)) +#' * `variantId` contains (in order) chromosome, position, reference allele, alternative allele and human genome build separated by underscores. The reference and alternative alleles for "chr1_13550_G_A_b38" for example are "G" and "A" respectively. +#' #' @inheritParams gtexr_arguments #' #' @return A tibble. diff --git a/R/get_annotation.R b/R/get_annotation.R index a50d465..5303339 100644 --- a/R/get_annotation.R +++ b/R/get_annotation.R @@ -1,13 +1,12 @@ #'Get Annotation #' #'@description -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_annotation_api_v2_dataset_annotation_get #' - 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] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_annotation_api_v2_dataset_annotation_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_annotation_api_v2_dataset_annotation_get) +#' #'@inheritParams gtexr_arguments #' #'@return A tibble @@ -15,7 +14,6 @@ #'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_annotation() get_annotation <- function(datasetId = "gtex_v8", page = 0, diff --git a/R/get_collapsed_gene_model_exon.R b/R/get_collapsed_gene_model_exon.R index ec32bc1..5f82ab9 100644 --- a/R/get_collapsed_gene_model_exon.R +++ b/R/get_collapsed_gene_model_exon.R @@ -8,8 +8,7 @@ #'algorithm developed by the GTEx analysis team. #' - By default, this service queries the models used by the latest GTEx release. #' -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_collapsed_gene_model_exon_api_v2_dataset_collapsedGeneModelExon_get +#'[GTEx Portal API documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_collapsed_gene_model_exon_api_v2_dataset_collapsedGeneModelExon_get) #' #'@inheritParams gtexr_arguments #' @@ -18,7 +17,6 @@ #'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_collapsed_gene_model_exon(gencodeIds = c("ENSG00000132693.12", #' "ENSG00000203782.5")) get_collapsed_gene_model_exon <- function(gencodeIds, diff --git a/R/get_downloads_page_data.R b/R/get_downloads_page_data.R index b17cf6c..1c3617c 100644 --- a/R/get_downloads_page_data.R +++ b/R/get_downloads_page_data.R @@ -3,18 +3,20 @@ #'@description #' - Retrieves all the files belonging to the given project_id for display on the Downloads Page #' -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_downloads_page_data_api_v2_dataset_openAccessFilesMetadata_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_downloads_page_data_api_v2_dataset_openAccessFilesMetadata_get) #' #'@inheritParams gtexr_arguments #' #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_downloads_page_data() -get_downloads_page_data <- function(project_id = "gtex"){ - gtex_query(endpoint = "dataset/openAccessFilesMetaData") +get_downloads_page_data <- function(project_id = "adult-gtex") { + gtex_query(endpoint = "dataset/openAccessFilesMetadata", + return_raw = TRUE)$data |> + purrr::map(tibble::as_tibble) |> + dplyr::bind_rows() } diff --git a/R/get_file_list.R b/R/get_file_list.R index 7f2279d..ebc34b7 100644 --- a/R/get_file_list.R +++ b/R/get_file_list.R @@ -1,19 +1,21 @@ #' Get File List +#' #' @description #' - Get all the files in GTEx dataset for Download page #' -#' [GTEx Portal API documentation] -#' https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_file_list_api_v2_dataset_fileList_get +#' [GTEx Portal API +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_file_list_api_v2_dataset_fileList_get) #' -#'@inheritParams gtexr_arguments #' #' @return A Tibble #' @export #' @family Datasets Endpoints #' #' @examples -#' \dontrun #' get_file_list() -get_file_list <- function(){ - gtex_query(enpoint = "dataset/fileList") +get_file_list <- function() { + gtex_query(endpoint = "dataset/fileList", + return_raw = TRUE) |> + purrr::map(tibble::as_tibble) |> + dplyr::bind_rows() } diff --git a/R/get_fine_mapping.R b/R/get_fine_mapping.R index 14933f8..191dab4 100644 --- a/R/get_fine_mapping.R +++ b/R/get_fine_mapping.R @@ -17,7 +17,6 @@ #'@family Static Association Endpoints #' #' @examples -#' \dontrun{ #' # search by gene #' get_fine_mapping(gencodeIds = c("ENSG00000132693.12", #' "ENSG00000203782.5")) @@ -28,7 +27,6 @@ #' variantId = "chr1_153228363_A_G_b38", #' tissueSiteDetailIds = c("Whole_Blood", #' "Thyroid")) -#'} get_fine_mapping <- function(gencodeIds, datasetId = "gtex_v8", variantId = NULL, diff --git a/R/get_full_get_collapsed_gene_model_exon.R b/R/get_full_get_collapsed_gene_model_exon.R index 15b101e..f1340f5 100644 --- a/R/get_full_get_collapsed_gene_model_exon.R +++ b/R/get_full_get_collapsed_gene_model_exon.R @@ -3,17 +3,16 @@ #'@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] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get) #' #'@inheritParams gtexr_arguments #' #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_full_get_collapsed_gene_model_exon(gencodeIds = c("ENSG00000132693.12", #' "ENSG00000203782.5")) get_full_get_collapsed_gene_model_exon <- function(gencodeIds, diff --git a/R/get_functional_annotation.R b/R/get_functional_annotation.R index c4c6a4e..a8a45d9 100644 --- a/R/get_functional_annotation.R +++ b/R/get_functional_annotation.R @@ -3,16 +3,15 @@ #'@description #' - This endpoint retrieves the functional annotation of a certain chromosome location. Default to most recent dataset release. #' -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get) #' #'@inheritParams gtexr_arguments #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_functional_annotation(chromosome = "chr15", start = 1400, end = 20000) get_functional_annotation <- function(datasetId = "gtex_v8", chromosome, diff --git a/R/get_image.R b/R/get_image.R index 02a5b65..2bdcb2b 100644 --- a/R/get_image.R +++ b/R/get_image.R @@ -8,8 +8,8 @@ #' #' @examples #' get_image() -#' get_image(tissueSampleId = "GTEX-1117F-0226", page = 0, itemsPerPage = 100000) -get_image <- function(tissueSampleId = NULL, +#' get_image(tissueSampleIds = "GTEX-1117F-0226", page = 0, itemsPerPage = 100000) +get_image <- function(tissueSampleIds = NULL, page = 0, itemsPerPage = 250) { gtex_query(endpoint = "histology/image") diff --git a/R/get_independent_eqtl.R b/R/get_independent_eqtl.R index 177193a..35b5c7c 100644 --- a/R/get_independent_eqtl.R +++ b/R/get_independent_eqtl.R @@ -2,12 +2,12 @@ #' #'@description Retrieve Independent eQTL Data #' -#' Finds and returns Independent eQTL Data data for the provided list of genes -#' By default, this endpoint fetches data from the latest GTEx version The -#' retrieved data is split into pages with items_per_page entries per page +#' - Finds and returns Independent eQTL Data data for the provided list of genes +#' - By default, this endpoint fetches data from the latest GTEx version #' -#' [GTEx portal API documentation] -#' (https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_independent_eqtl_api_v2_association_independentEqtl_get) +#' The retrieved data is split into pages with items_per_page entries per page +#' +#' [GTEx portal API documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_independent_eqtl_api_v2_association_independentEqtl_get) #' #'@inheritParams gtexr_arguments #' @@ -16,19 +16,17 @@ #'@family Static Association Endpoints #' #' @examples -#' \dontrun{ #' # 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")) -#'} -get_independent_eqtl <- function(gencodeId, - tissueSiteDetailId = NULL, +#' "ENSG00000203782.5"), +#' tissueSiteDetailIds = c("Whole_Blood", +#' "Thyroid")) +get_independent_eqtl <- function(gencodeIds, + tissueSiteDetailIds = NULL, datasetId = "gtex_v8", page = 0, itemsPerPage = 250){ diff --git a/R/get_linkage_disequilibrium_by_variant_data.R b/R/get_linkage_disequilibrium_by_variant_data.R index 9179d4e..9ad4d71 100644 --- a/R/get_linkage_disequilibrium_by_variant_data.R +++ b/R/get_linkage_disequilibrium_by_variant_data.R @@ -1,20 +1,19 @@ -#' Get Linkage Disequilibrium By Variant Data +#'Get Linkage Disequilibrium By Variant Data #' -#' @description +#'@description #' - Find linkage disequilibrium (LD) data for a given variant #' -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_linkage_disequilibrium_by_variant_data_api_v2_dataset_ldByVariant_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_linkage_disequilibrium_by_variant_data_api_v2_dataset_ldByVariant_get) #' #'@inheritParams gtexr_arguments #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_linkage_disequilibrium_by_variant_data() -get_linkage_disequilibirum_by_variant_data <- function(variantId = NULL, +get_linkage_disequilibrium_by_variant_data <- function(variantId = NULL, page = 0, itemsPerPage = 250){ gtex_query(endpoint = "dataset/ldByVariant") diff --git a/R/get_linkage_disequiliribum_data.R b/R/get_linkage_disequilibrium_data.R similarity index 51% rename from R/get_linkage_disequiliribum_data.R rename to R/get_linkage_disequilibrium_data.R index c70b99c..d977e8a 100644 --- a/R/get_linkage_disequiliribum_data.R +++ b/R/get_linkage_disequilibrium_data.R @@ -1,26 +1,32 @@ -#'Get Linkage Disequilibrium Data +#' Get Linkage Disequilibrium Data #' -#'@description +#' @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] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_by_location_api_v2_dataset_variantByLocation_get#' +#' [GTEx Portal API documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_by_location_api_v2_dataset_variantByLocation_get) #' -#'@inheritParams gtexr_arguments -#'@return A Tibble -#'@export -#'@family Dataset Endpoints +#' @inheritParams gtexr_arguments +#' @return A tibble. +#' @export +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_linkage_disequilibrium_data(gencodeIds = c("ENSG00000132693.12", #' "ENSG00000203782.5")) -get_linkage_disequilibirum_data <- function(gencodeIds, +get_linkage_disequilibrium_data <- function(gencodeIds, datasetId = "gtex_v8", page = 0, itemsPerPage = 250){ - gtex_query(endpoint = "dataset/ld") + gtex_query(endpoint = "dataset/ld", + return_raw = TRUE)$data |> + purrr::map(\(x) tibble::tibble(variants = x[[1]], ld = x[[2]])) |> + dplyr::bind_rows() |> + tidyr::separate_wider_delim( + cols = "variants", + delim = ",", + names = c("variantId_1", "variantId_2") + ) } diff --git a/R/get_linkage_disequiliribium_data.R b/R/get_linkage_disequiliribium_data.R deleted file mode 100644 index b4fc7c6..0000000 --- a/R/get_linkage_disequiliribium_data.R +++ /dev/null @@ -1,26 +0,0 @@ -#'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] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_by_location_api_v2_dataset_variantByLocation_get#' -#' -#'@inheritParams gtexr_arguments -#'@return A Tibble -#'@export -#'@family Dataset Endpoints -#' -#' @examples -#' \dontrun -#' get_linkage_disequilibirium_data(gencodeIds = c("ENSG00000132693.12", -#' "ENSG00000203782.5")) -get_linkage_disequilibirium_data <- function(gencodeIds, - datasetId = "gtex_v8", - page = 0, - itemsPerPage = 250){ - gtex_query(endpoint = "dataset/ld") -} diff --git a/R/get_multi_tissue_eqtls.R b/R/get_multi_tissue_eqtls.R index 18257d8..69e4581 100644 --- a/R/get_multi_tissue_eqtls.R +++ b/R/get_multi_tissue_eqtls.R @@ -1,14 +1,18 @@ -#' Get Significant Single Tissue Eqtls By Location +#' Get Multi Tissue Eqtls #' -#' @description Find significant single tissue eQTLs using Chromosomal -#' Locations. This service returns precomputed significant single tissue -#' eQTLs. Results may be filtered by tissue, and/or dataset. 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. +#' @description Find multi-tissue eQTL Metasoft results. +#' +#' - This service returns multi-tissue eQTL Metasoft results for a given gene and variant in a specified dataset. +#' - A Versioned GENCODE ID must be provided. +#' - For each tissue, the results include: m-value (mValue), normalized effect size (nes), p-value (pValue), and standard error (se). +#' - The m-value is the posterior probability that an eQTL effect exists in each tissue tested in the cross-tissue meta-analysis (Han and Eskin, PLoS Genetics 8(3): e1002555, 2012). +#' - The normalized effect size is the slope of the linear regression of normalized expression data versus the three genotype categories using single-tissue eQTL analysis, representing eQTL effect size. +#' - The p-value is from a t-test that compares observed NES from single-tissue eQTL analysis to a null NES of 0. +#' +#' 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](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_api_v2_association_singleTissueEqtl_get) +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_multi_tissue_eqtls_api_v2_association_metasoft_get) #' #' @inheritParams gtexr_arguments #' @@ -17,11 +21,10 @@ #' @family Static Association Endpoints #' #' @examples -#' \dontrun{ #' # search by gene -#' get_multi_tissue_eqtls(gencodeIds = c("ENSG00000132693.12", -#' "ENSG00000203782.5"))} -get_multi_tissue_eqtls <- function(gencodeId, +#' get_multi_tissue_eqtls(gencodeId = c("ENSG00000132693.12", +#' "ENSG00000203782.5")) +get_multi_tissue_eqtls <- function(gencodeIds, variantId = NULL, datasetId = "gtex_v8", page = 0, diff --git a/R/get_sample.R b/R/get_sample.R index 02050f8..068b926 100644 --- a/R/get_sample.R +++ b/R/get_sample.R @@ -1,37 +1,36 @@ -#' Get Sample +#'Get Sample #' -#' @description +#'@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] -#' https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_sample_api_v2_dataset_sample_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_sample_api_v2_dataset_sample_get) #' #'@inheritParams gtexr_arguments #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun -#' get_saumple() +#' get_sample() get_sample <- function(datasetId = "gtex_v8", - sampleId = NULL, + sampleIds = NULL, tissueSampleIds = NULL, - subjectId = NULL, - ageBracket = NULL, + subjectIds = NULL, + ageBrackets = NULL, sex = NULL, pathCategory = NULL, tissueSiteDetailId = NULL, - aliquotId = NULL, - autolysisScore = NULL, - hardyScale = NULL, + aliquotIds = NULL, + autolysisScores = NULL, + hardyScales = NULL, ischemicTime = NULL, - ischemicTimeGroup = NULL, + ischemicTimeGroups = NULL, rin = NULL, - uberonId = NULL, - dataType = NULL, + uberonIds = NULL, + dataTypes = NULL, sortBy = NULL, sortDirection = NULL, page = NULL, diff --git a/R/get_significant_single_tissue_eqtls.R b/R/get_significant_single_tissue_eqtls.R index 2a93a49..0eeedc5 100644 --- a/R/get_significant_single_tissue_eqtls.R +++ b/R/get_significant_single_tissue_eqtls.R @@ -1,9 +1,7 @@ #' Get Significant Single Tissue Eqtls #' -#' Find significant single tissue eQTLs. -#' -#' [GTEx Portal API -#'documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_api_v2_association_singleTissueEqtl_get) +#' [Find significant single tissue +#' eQTLs.](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_api_v2_association_singleTissueEqtl_get) #' #' - This service returns precomputed significant single tissue eQTLs. #' - Results may be filtered by tissue, gene, variant or dataset. diff --git a/R/get_significant_single_tissue_eqtls_by_location.R b/R/get_significant_single_tissue_eqtls_by_location.R index e541dc7..905512a 100644 --- a/R/get_significant_single_tissue_eqtls_by_location.R +++ b/R/get_significant_single_tissue_eqtls_by_location.R @@ -19,18 +19,20 @@ #' @export #' @family Static Association Endpoints #' -#' @example -#' \dontrun{ -#' get_significant_single_tissue_eqtls_by_location(tissueSiteDetailId = "Artery_Aorta", -#' start = 10000, -#' end = 250000, -#' chromosome = "chr_11") +#' @examples +#' get_significant_single_tissue_eqtls_by_location( +#' tissueSiteDetailId = "Artery_Aorta", +#' start = 10000, +#' end = 250000, +#' chromosome = "chr11") get_significant_single_tissue_eqtls_by_location <- function(tissueSiteDetailId, start, end, chromosome, datasetId = "gtex_v8") { - gtex_query(endpoint = "association/singleTissueEqtlByLocation") + gtex_query(endpoint = "association/singleTissueEqtlByLocation", + return_raw = TRUE)$singleTissueEqtl |> + purrr::map(tibble::as_tibble) |> dplyr::bind_rows() } diff --git a/R/get_significant_single_tissue_ieqtls.R b/R/get_significant_single_tissue_ieqtls.R index 8772c97..320befc 100644 --- a/R/get_significant_single_tissue_ieqtls.R +++ b/R/get_significant_single_tissue_ieqtls.R @@ -1,24 +1,25 @@ #' Get Significant Single Tissue Ieqtls #' -#' Retrieve Interaction eQTL Data. This service returns cell type interaction -#' eQTLs (ieQTLs), from a specified dataset. Results may be filtered by tissue -#' By default, the service queries the latest GTEx release. +#' Retrieve Interaction eQTL Data. +#' +#' - This service returns cell type interaction eQTLs (ieQTLs), from a specified dataset. +#' - Results may be filtered by tissue +#' - 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](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_sqtls_api_v2_association_singleTissueSqtl_get) +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_ieqtls_api_v2_association_singleTissueIEqtl_get) #' #' @inheritParams gtexr_arguments -#' #' @return A Tibble #' @export #' @family Static Association Endpoints #' #' @examples -#' \dontrun -#' get_significant_single_tissueIeqtls(gencodeId = "ENSG00000132693.12") -get_significant_single_tissue_Ieqtls <- function(gencodeId, +#' get_significant_single_tissue_ieqtls(c("ENSG00000132693.12", +#' "ENSG00000203782.5")) +get_significant_single_tissue_ieqtls <- function(gencodeIds, variantId = NULL, tissueSiteDetailId = NULL, datasetId = "gtex_v8", diff --git a/R/get_significant_single_tissue_isqtls.R b/R/get_significant_single_tissue_isqtls.R index e5b1c91..09b7319 100644 --- a/R/get_significant_single_tissue_isqtls.R +++ b/R/get_significant_single_tissue_isqtls.R @@ -1,23 +1,22 @@ #'Get Significant Single Tissue Isqtls #' -#'[GTEx Portal API -#'documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_ieqtls_api_v2_association_singleTissueIEqtl_get) +#' Retrieve Interaction sQTL Data. This service retrieves cell type interaction +#' sQTLs (isQTLs), from a specified dataset. Results may be filtered by tissue +#' By default, the service queries the latest GTEx release. The retrieved data +#' is split into pages with items_per_page entries per page #' -#'Retrieve Interaction sQTL Data. This service retrieves cell type interaction -#'sQTLs (isQTLs), from a specified dataset. Results may be filtered by tissue 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](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_isqtls_api_v2_association_singleTissueISqtl_get) #' #' @inheritParams gtexr_arguments -#' -#'@return A Tibble -#'@export -#'@family Static Assocation Endpoints +#' @return A Tibble +#' @export +#' @family Static Association Endpoints #' #' @examples -#' \dontrun -#' get_significant_single_tissue_isqtls(gencodeId = "ENSG00000132693.12") -get_significant_single_tissue_isqtls <- function(gencodeId, +#' get_significant_single_tissue_isqtls(gencodeIds = c("ENSG00000065613.9", +#' "ENSG00000203782.5")) +get_significant_single_tissue_isqtls <- function(gencodeIds, variantId = NULL, tissueSiteDetailId = NULL, datasetId = "gtex_v8", diff --git a/R/get_significant_single_tissue_sqtls.R b/R/get_significant_single_tissue_sqtls.R index fa545b9..2d7f196 100644 --- a/R/get_significant_single_tissue_sqtls.R +++ b/R/get_significant_single_tissue_sqtls.R @@ -7,20 +7,18 @@ #' The retrieved data is split into pages with items_per_page entries per page #' #' [GTEx Portal API -#' documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_by_location_api_v2_association_singleTissueEqtlByLocation_get) +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_sqtls_api_v2_association_singleTissueSqtl_get) #' #' @inheritParams gtexr_arguments -#' #' @return A tibble #' @export #' @family Static Association Endpoints #' #' @examples -#' \dontrun -#' search by gene -#' get_significant_single_tissue_sqtls(gencodeId = "ENSG00000132693.12") - -get_significant_single_tissue_sqtls <- function(gencodeId, +#' # search by gene +#' get_significant_single_tissue_sqtls(gencodeIds = c("ENSG00000065613.9", +#' "ENSG00000203782.5")) +get_significant_single_tissue_sqtls <- function(gencodeIds, variantId = NULL, tissueSiteDetailId = NULL, datasetId = "gtex_v8"){ diff --git a/R/get_subject.R b/R/get_subject.R index d12145c..ce78c72 100644 --- a/R/get_subject.R +++ b/R/get_subject.R @@ -1,26 +1,25 @@ -#' Get Subject +#'Get Subject #' -#' @description +#'@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] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get) #' #'@inheritParams gtexr_arguments #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_subject() get_subject <- function(datasetId = "gtex_v8", sex = NULL, - ageBracket = NULL, - hardyScale = NULL, - subjectId = NULL, + ageBrackets = NULL, + hardyScales = NULL, + subjectIds = NULL, page = 0, itemsPerPage = 250){ gtex_query(endpoint = "dataset/subject") diff --git a/R/get_tissue_site_detail.R b/R/get_tissue_site_detail.R index 9307012..f567640 100644 --- a/R/get_tissue_site_detail.R +++ b/R/get_tissue_site_detail.R @@ -3,16 +3,15 @@ #'@description #' - Retrieve all tissue site detail information in the database #' -#'[GTEx Portal API documentation] -#'https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get +#'[GTEx Portal API +#'documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get) #' #'@inheritParams gtexr_arguments #'@return A Tibble #'@export -#'@family Dataset Endpoints +#'@family Datasets Endpoints #' #' @examples -#' \dontrun #' get_tissue_site_detail() get_tissue_site_detail <- function(page = 0, itemsPerPage = 250){ diff --git a/R/gtexr_arguments.R b/R/gtexr_arguments.R index 5bf569e..08d209d 100644 --- a/R/gtexr_arguments.R +++ b/R/gtexr_arguments.R @@ -3,6 +3,12 @@ #' Internal function that documents all arguments for exported gtexr functions #' that wrap GTEx Portal API endpoints (using roxygen `@inheritParams` tag). #' +#' @param ageBrackets The age bracket(s) of the donors of interest. Options: +#' "20-29", "30-39", "40-49", "50-59", "60-69", "70-79". +#' @param aliquotIds Character vector. +#' @param autolysisScores Character vector. Options: "None", "Mild", "Moderate", +#' "Severe". +#' @param bp_window Integer. #' @param 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", @@ -10,6 +16,8 @@ #' @param datasetId String. Unique identifier of a dataset. Usually includes a #' data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". #' Default = "gtex_v8". +#' @param dataTypes Character vector. Options: "RNASEQ", "WGS", "WES", "OMNI", +#' "EXCLUDE". #' @param end Integer. #' @param gencodeId String. A Versioned GENCODE ID of a gene, e.g. #' "ENSG00000065613.9". @@ -22,18 +30,62 @@ #' unversioned gencodeIds. #' @param genomeBuild String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = #' "GRCh38/hg38". +#' @param 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". #' @param itemsPerPage Integer (default = 250). +#' @param ischemicTime Integer. +#' @param ischemicTimeGroups Character vector. Options: "<= 0", "1 - 300", "301 +#' - 600", "601 - 900", "901 - 1200", "1201 - 1500", "> 1500". +#' @param organizationName String. Options: "GTEx Consortium" "Kid's First". #' @param page Integer (default = 0). +#' @param 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". #' @param pos Integer, vector. +#' @param project_id String. Options: "gtex" "adult-gtex" "egtex". +#' @param rin Integer. +#' @param sampleIds Character vector. GTEx sample ID. +#' @param sex String. Options: "male", "female". #' @param snpId String +#' @param sortBy String. Options: "sampleId", "ischemicTime", "aliquotId", +#' "tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", +#' "tissueSiteDetailId", "sex". #' @param sortDirection String. Options: "asc", "desc". Default = "asc". #' @param start Integer. +#' @param subjectIds Character vector. GTEx subject ID. +#' @param tissueSampleIds Array of strings. A list of Tissue Sample ID(s). #' @param tissueSiteDetailId String. The ID of the tissue of interest. Can be a #' GTEx specific ID (e.g. "Whole_Blood"; use [available_tissueSiteDetailIds()] #' to see valid values) or an Ontology ID. #' @param tissueSiteDetailIds Character vector of IDs for tissues of interest. #' Can be GTEx specific IDs (e.g. "Whole_Blood"; use #' [available_tissueSiteDetailIds()] to see valid values) or Ontology IDs. +#' @param uberonIds Character vector. A list of Uberon ID(s) of interest. +#' Options: "UBERON:EFO_0000572", "UBERON:EFO_0002009", "UBERON:0000007", +#' "UBERON:0000458", "UBERON:0000473", "UBERON:0000945", "UBERON:0000992", +#' "UBERON:0000995", "UBERON:0000996", "UBERON:0001114", "UBERON:0001150", +#' "UBERON:0001157", "UBERON:0001159", "UBERON:0001211", "UBERON:0001225", +#' "UBERON:0001255", "UBERON:0001293", "UBERON:0001323", "UBERON:0001496", +#' "UBERON:0001621", "UBERON:0001870", "UBERON:0001873", "UBERON:0001874", +#' "UBERON:0001876", "UBERON:0001882", "UBERON:0001898", "UBERON:0001954", +#' "UBERON:0002037", "UBERON:0002038", "UBERON:0002046", "UBERON:0002106", +#' "UBERON:0002190", "UBERON:0002367", "UBERON:0002369", "UBERON:0003889", +#' "UBERON:0004264", "UBERON:0004550", "UBERON:0004648", "UBERON:0006330", +#' "UBERON:0006469", "UBERON:0006566", "UBERON:0006631", "UBERON:0006920", +#' "UBERON:0007610", "UBERON:0008367", "UBERON:0008952", "UBERON:0009834", +#' "UBERON:0009835", "UBERON:0010414", "UBERON:0011907", "UBERON:0012249", +#' "UBERON:0013756", "UBERON:0036149". #' @param variantId String. A gtex variant ID. #' #' @keywords internal @@ -41,8 +93,13 @@ gtexr_arguments <- function() { tibble::tribble( ~arg, ~type, ~scalar, ~pluralised, + "ageBrackets", "character", FALSE, TRUE, + "aliquotIds", "character", FALSE, TRUE, + "autolysisScores", "character", FALSE, TRUE, + "bp_window", "integer", TRUE, FALSE, "chromosome", "character", TRUE, FALSE, "datasetId", "character", TRUE, FALSE, + "dataTypes", "character", FALSE, TRUE, "end", "integer", TRUE, FALSE, "gencodeId", "character", TRUE, FALSE, "gencodeIds", "character", FALSE, TRUE, @@ -50,14 +107,27 @@ gtexr_arguments <- function() { "geneId", "character", TRUE, FALSE, "geneIds", "character", FALSE, TRUE, "genomeBuild", "character", TRUE, FALSE, + "hardyScales", "character", FALSE, TRUE, "itemsPerPage", "integer", TRUE, FALSE, + "ischemicTime", "integer", FALSE, FALSE, + "ischemicTimeGroups", "character", FALSE, TRUE, + "organizationName", "character", TRUE, FALSE, "page", "integer", TRUE, FALSE, + "pathCategory", "character", FALSE, FALSE, "pos", "integer", FALSE, FALSE, + "project_id", "character", TRUE, FALSE, + "rin", "integer", FALSE, FALSE, + "sampleIds", "character", FALSE, TRUE, + "sex", "character", TRUE, FALSE, "snpId", "character", TRUE, FALSE, + "sortBy", "character", TRUE, FALSE, "sortDirection", "character", TRUE, FALSE, "start", "integer", TRUE, FALSE, + "subjectIds", "character", TRUE, TRUE, + "tissueSampleIds", "character", FALSE, TRUE, "tissueSiteDetailId", "character", TRUE, FALSE, "tissueSiteDetailIds", "character", FALSE, TRUE, + "uberonIds", "character", FALSE, TRUE, "variantId", "character", TRUE, FALSE ) } diff --git a/R/validate_args.R b/R/validate_args.R index a9eb89a..077c6be 100644 --- a/R/validate_args.R +++ b/R/validate_args.R @@ -2,6 +2,10 @@ validate_args <- function(arguments, call) { metadata <- gtexr_arguments() + # TODO move checks for missing args here, and also any "" values e.g. calculate_eqtls(tissueSiteDetailId = "Whole_Blood", + # gencodeId = "", + # variantId = "rs79641866") + # see ?purrr::purrr_error_indexed - withCallingHandlers() is used here to get # rid of purrr's wrapper error withCallingHandlers( @@ -9,6 +13,13 @@ validate_args <- function(arguments, \(value, arg_name) { arg_metadata <- metadata[metadata$arg == arg_name, ] + if (identical(nrow(arg_metadata), 0L)) { + cli::cli_abort(c("Unrecognised argument: {.var {arg_name}}", + "i" = "Please submit an issue at {.url {packageDescription('gtexr')$BugReports}} with a reproducible example.", + "i" = "For gtexr package developers: check whether {.var {arg_name}} is included in {.fun gtexr_arguments}"), + call = call) + } + if (arg_metadata$scalar) { error_msg <- c("`{arg_name}` must be class {.cls {arg_metadata$type}} of length 1", diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..af1fbea --- /dev/null +++ b/README.Rmd @@ -0,0 +1,54 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# gtexr + + +[![pkgdown](https://github.com/rmgpanw/gtexr/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/rmgpanw/gtexr/actions/workflows/pkgdown.yaml) +[![Codecov test coverage](https://codecov.io/gh/rmgpanw/gtexr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rmgpanw/gtexr?branch=main) + + +The goal of gtexr is to provide a convenient R interface to the [GTEx Portal API V2](https://gtexportal.org/api/v2/redoc#tag/GTEx-Portal-API-Info). + +## Installation + +You can install the development version of gtexr from [GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("rmgpanw/gtexr") +``` + +## Examples + +Get general information about the GTEx service: + +```{r} +library(gtexr) +get_service_info() +``` + +Retrieve eQTL genes for whole blood tissue: + +```{r get-eqtl-genes} +get_eqtl_genes("Whole_Blood") +``` + +Retrieve significant eQTLs for one or more genes: + +```{r get-significant-single-tissue-eqtls} +get_significant_single_tissue_eqtls(gencodeId = c("ENSG00000132693.12", + "ENSG00000203782.5")) +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f3c070 --- /dev/null +++ b/README.md @@ -0,0 +1,99 @@ + + + +# gtexr + + + +[![pkgdown](https://github.com/rmgpanw/gtexr/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/rmgpanw/gtexr/actions/workflows/pkgdown.yaml) +[![Codecov test +coverage](https://codecov.io/gh/rmgpanw/gtexr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rmgpanw/gtexr?branch=main) + + +The goal of gtexr is to provide a convenient R interface to the [GTEx +Portal API +V2](https://gtexportal.org/api/v2/redoc#tag/GTEx-Portal-API-Info). + +## Installation + +You can install the development version of gtexr from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("rmgpanw/gtexr") +``` + +## Examples + +Get general information about the GTEx service: + +``` r +library(gtexr) +get_service_info() +#> # A tibble: 1 × 9 +#> id name version organization_name organization_url description contactUrl +#> +#> 1 org.g… GTEx… 2.0.0 GTEx Project https://gtexpor… This servi… https://g… +#> # ℹ 2 more variables: documentationUrl , environment +``` + +Retrieve eQTL genes for whole blood tissue: + +``` r +get_eqtl_genes("Whole_Blood") +#> Warning: ! Total number of items (12360) exceeds maximum page size (250). +#> ℹ Try increasing `itemsPerPage`, or set this to `NULL` to return all available +#> items in one page. +#> +#> ── Paging info ───────────────────────────────────────────────────────────────── +#> • numberOfPages = 50 +#> • page = 0 +#> • maxItemsPerPage = 250 +#> • totalNumberOfItems = 12360 +#> # A tibble: 250 × 10 +#> tissueSiteDetailId ontologyId datasetId empiricalPValue gencodeId geneSymbol +#> +#> 1 Whole_Blood UBERON:001… gtex_v8 1.05e- 9 ENSG0000… WASH7P +#> 2 Whole_Blood UBERON:001… gtex_v8 1.06e-25 ENSG0000… RP11-34P1… +#> 3 Whole_Blood UBERON:001… gtex_v8 6.31e- 2 ENSG0000… CICP27 +#> 4 Whole_Blood UBERON:001… gtex_v8 8.71e- 9 ENSG0000… RP11-34P1… +#> 5 Whole_Blood UBERON:001… gtex_v8 6.01e-20 ENSG0000… RP11-34P1… +#> 6 Whole_Blood UBERON:001… gtex_v8 6.96e- 9 ENSG0000… RP11-34P1… +#> 7 Whole_Blood UBERON:001… gtex_v8 3.10e- 4 ENSG0000… RP11-34P1… +#> 8 Whole_Blood UBERON:001… gtex_v8 1.92e- 3 ENSG0000… ABC7-4304… +#> 9 Whole_Blood UBERON:001… gtex_v8 1.58e- 3 ENSG0000… RP11-34P1… +#> 10 Whole_Blood UBERON:001… gtex_v8 7.82e- 2 ENSG0000… AP006222.2 +#> # ℹ 240 more rows +#> # ℹ 4 more variables: log2AllelicFoldChange , pValue , +#> # pValueThreshold , qValue +``` + +Retrieve significant eQTLs for one or more genes: + +``` r +get_significant_single_tissue_eqtls(gencodeId = c("ENSG00000132693.12", + "ENSG00000203782.5")) +#> +#> ── Paging info ───────────────────────────────────────────────────────────────── +#> • numberOfPages = 1 +#> • page = 0 +#> • maxItemsPerPage = 250 +#> • totalNumberOfItems = 249 +#> # A tibble: 249 × 13 +#> snpId pos snpIdUpper variantId geneSymbol pValue geneSymbolUpper +#> +#> 1 rs12128960 159343657 RS12128960 chr1_1593… CRP 8.52e-5 CRP +#> 2 rs12132451 159344052 RS12132451 chr1_1593… CRP 7.92e-5 CRP +#> 3 rs12136402 159347493 RS12136402 chr1_1593… CRP 7.92e-5 CRP +#> 4 rs10908709 159350390 RS10908709 chr1_1593… CRP 7.92e-5 CRP +#> 5 rs10908710 159351189 RS10908710 chr1_1593… CRP 7.92e-5 CRP +#> 6 rs11265178 159359256 RS11265178 chr1_1593… CRP 9.62e-5 CRP +#> 7 rs35532309 159360755 RS35532309 chr1_1593… CRP 6.11e-5 CRP +#> 8 rs6692378 159369451 RS6692378 chr1_1593… CRP 1.17e-6 CRP +#> 9 rs10908714 159370563 RS10908714 chr1_1593… CRP 1.80e-5 CRP +#> 10 rs6656924 159372915 RS6656924 chr1_1593… CRP 1.00e-6 CRP +#> # ℹ 239 more rows +#> # ℹ 6 more variables: datasetId , tissueSiteDetailId , +#> # ontologyId , chromosome , gencodeId , nes +``` diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..9033d88 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,48 @@ +url: https://rmgpanw.github.io/gtexr/ +template: + bootstrap: 5 + +reference: +- title: GTEx Portal API Info +- contents: + - has_concept("GTEx Portal API Info") + +- title: Admin Endpoints +- contents: + - has_concept("Admin Endpoints") + +- title: Static Association Endpoints +- contents: + - has_concept("Static Association Endpoints") + +- title: Dynamic Association Endpoints +- contents: + - has_concept("Dynamic Association Endpoints") + +- title: Biobank Data Endpoints +- contents: + - has_concept("Biobank Data Endpoints") + +- title: Datasets Endpoints +- contents: + - has_concept("Datasets Endpoints") + +- title: Expression Data Endpoints +- contents: + - has_concept("Expression Data Endpoints") + +- title: Histology Endpoints +- contents: + - has_concept("Histology Endpoints") + +- title: Metadata Endpoints +- contents: + - has_concept("Metadata Endpoints") + +- title: Reference Genome Endpoints +- contents: + - has_concept("Reference Genome Endpoints") + +- title: Utilities +- contents: + - has_concept("Utilities") diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..04c5585 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true diff --git a/man/calculate_eqtls.Rd b/man/calculate_eqtls.Rd index ac80a97..48c1df0 100644 --- a/man/calculate_eqtls.Rd +++ b/man/calculate_eqtls.Rd @@ -31,6 +31,13 @@ A tibble. \description{ \href{https://gtexportal.org/api/v2/redoc#tag/Dynamic-Association-Endpoints/operation/calculate_expression_quantitative_trait_loci_api_v2_association_dyneqtl_get}{Calculate your own eQTLs} } +\details{ +Notes on output: +\itemize{ +\item Beta and standard error are recorded in columns \code{nes} and \code{error} respectively (see \href{https://gtexportal.org/home/faq#nes_beta}{GTEx FAQs}) +\item \code{variantId} contains (in order) chromosome, position, reference allele, alternative allele and human genome build separated by underscores. The reference and alternative alleles for "chr1_13550_G_A_b38" for example are "G" and "A" respectively. +} +} \examples{ # perform request result <- calculate_eqtls(tissueSiteDetailId = "Whole_Blood", diff --git a/man/get_annotation.Rd b/man/get_annotation.Rd new file mode 100644 index 0000000..65bbe71 --- /dev/null +++ b/man/get_annotation.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_annotation.R +\name{get_annotation} +\alias{get_annotation} +\title{Get Annotation} +\usage{ +get_annotation(datasetId = "gtex_v8", page = 0, itemsPerPage = 250) +} +\arguments{ +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A tibble +} +\description{ +\itemize{ +\item This service returns the list of annotations and allowed values by which a particular dataset can be subsetted. +\item Results may be filtered by dataset. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_annotation_api_v2_dataset_annotation_get}{GTEx Portal API documentation} +} +\examples{ +get_annotation() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_collapsed_gene_model_exon.Rd b/man/get_collapsed_gene_model_exon.Rd new file mode 100644 index 0000000..83ad43c --- /dev/null +++ b/man/get_collapsed_gene_model_exon.Rd @@ -0,0 +1,59 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_collapsed_gene_model_exon.R +\name{get_collapsed_gene_model_exon} +\alias{get_collapsed_gene_model_exon} +\title{Get Collapsed Gene Model Exon} +\usage{ +get_collapsed_gene_model_exon( + gencodeIds, + datasetId = "gtex_v8", + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} + +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item This service returns the collapsed exons in the gene model of the given gene. +\item 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. +\item By default, this service queries the models used by the latest GTEx release. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_collapsed_gene_model_exon_api_v2_dataset_collapsedGeneModelExon_get}{GTEx Portal API documentation} +} +\examples{ +get_collapsed_gene_model_exon(gencodeIds = c("ENSG00000132693.12", + "ENSG00000203782.5")) +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_downloads_page_data.Rd b/man/get_downloads_page_data.Rd new file mode 100644 index 0000000..c85f540 --- /dev/null +++ b/man/get_downloads_page_data.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_downloads_page_data.R +\name{get_downloads_page_data} +\alias{get_downloads_page_data} +\title{Get Downloads Page Data} +\usage{ +get_downloads_page_data(project_id = "adult-gtex") +} +\arguments{ +\item{project_id}{String. Options: "gtex" "adult-gtex" "egtex".} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item Retrieves all the files belonging to the given project_id for display on the Downloads Page +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_downloads_page_data_api_v2_dataset_openAccessFilesMetadata_get}{GTEx Portal API documentation} +} +\examples{ +get_downloads_page_data() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_eqtl_genes.Rd b/man/get_eqtl_genes.Rd index 8e41bd6..3a2533d 100644 --- a/man/get_eqtl_genes.Rd +++ b/man/get_eqtl_genes.Rd @@ -56,7 +56,11 @@ Other Static Association Endpoints: \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } \concept{Static Association Endpoints} diff --git a/man/get_file_list.Rd b/man/get_file_list.Rd new file mode 100644 index 0000000..a6205b0 --- /dev/null +++ b/man/get_file_list.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_file_list.R +\name{get_file_list} +\alias{get_file_list} +\title{Get File List} +\usage{ +get_file_list() +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item Get all the files in GTEx dataset for Download page +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_file_list_api_v2_dataset_fileList_get}{GTEx Portal API documentation} +} +\examples{ +get_file_list() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_fine_mapping.Rd b/man/get_fine_mapping.Rd index a2d0392..2bea7b4 100644 --- a/man/get_fine_mapping.Rd +++ b/man/get_fine_mapping.Rd @@ -46,7 +46,6 @@ The retrieved data is split into pages with items_per_page entries per page \href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_fine_mapping_api_v2_association_fineMapping_get}{GTEx Portal API documentation} } \examples{ -\dontrun{ # search by gene get_fine_mapping(gencodeIds = c("ENSG00000132693.12", "ENSG00000203782.5")) @@ -58,13 +57,16 @@ get_fine_mapping(gencodeIds = c("ENSG00000132693.12", tissueSiteDetailIds = c("Whole_Blood", "Thyroid")) } -} \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } \concept{Static Association Endpoints} diff --git a/man/get_full_get_collapsed_gene_model_exon.Rd b/man/get_full_get_collapsed_gene_model_exon.Rd new file mode 100644 index 0000000..e5408a4 --- /dev/null +++ b/man/get_full_get_collapsed_gene_model_exon.Rd @@ -0,0 +1,50 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_full_get_collapsed_gene_model_exon.R +\name{get_full_get_collapsed_gene_model_exon} +\alias{get_full_get_collapsed_gene_model_exon} +\title{Get Full Get Collapsed Gene Model Exon} +\usage{ +get_full_get_collapsed_gene_model_exon( + gencodeIds, + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item This service allows the user to query the full Collapsed Gene Model Exon of a specific gene by gencode ID +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get}{GTEx Portal API documentation} +} +\examples{ +get_full_get_collapsed_gene_model_exon(gencodeIds = c("ENSG00000132693.12", + "ENSG00000203782.5")) +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_functional_annotation.Rd b/man/get_functional_annotation.Rd new file mode 100644 index 0000000..f97e81e --- /dev/null +++ b/man/get_functional_annotation.Rd @@ -0,0 +1,62 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_functional_annotation.R +\name{get_functional_annotation} +\alias{get_functional_annotation} +\title{Get Functional Annotation} +\usage{ +get_functional_annotation( + datasetId = "gtex_v8", + chromosome, + start, + end, + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{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".} + +\item{start}{Integer.} + +\item{end}{Integer.} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item This endpoint retrieves the functional annotation of a certain chromosome location. Default to most recent dataset release. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_full_get_collapsed_gene_model_exon_api_v2_dataset_fullCollapsedGeneModelExon_get}{GTEx Portal API documentation} +} +\examples{ +get_functional_annotation(chromosome = "chr15", start = 1400, end = 20000) +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_gene_search.Rd b/man/get_gene_search.Rd index 59814d6..2376b1e 100644 --- a/man/get_gene_search.Rd +++ b/man/get_gene_search.Rd @@ -42,6 +42,10 @@ get_gene_search("CRP") } \seealso{ Other Reference Genome Endpoints: -\code{\link{get_genes}()} +\code{\link{get_exons}()}, +\code{\link{get_genes}()}, +\code{\link{get_gwas_catalog_by_location}()}, +\code{\link{get_neighbor_gene}()}, +\code{\link{get_transcripts}()} } \concept{Reference Genome Endpoints} diff --git a/man/get_genes.Rd b/man/get_genes.Rd index 28918a6..bfc4a33 100644 --- a/man/get_genes.Rd +++ b/man/get_genes.Rd @@ -45,6 +45,10 @@ get_genes(c("CRP", "IL6R")) } \seealso{ Other Reference Genome Endpoints: -\code{\link{get_gene_search}()} +\code{\link{get_exons}()}, +\code{\link{get_gene_search}()}, +\code{\link{get_gwas_catalog_by_location}()}, +\code{\link{get_neighbor_gene}()}, +\code{\link{get_transcripts}()} } \concept{Reference Genome Endpoints} diff --git a/man/get_image.Rd b/man/get_image.Rd index fc544ff..e02b867 100644 --- a/man/get_image.Rd +++ b/man/get_image.Rd @@ -4,10 +4,10 @@ \alias{get_image} \title{Get Image} \usage{ -get_image(tissueSampleId = NULL, page = 0, itemsPerPage = 250) +get_image(tissueSampleIds = NULL, page = 0, itemsPerPage = 250) } \arguments{ -\item{tissueSampleId}{Array of strings. A list of Tissue Sample ID(s).} +\item{tissueSampleIds}{Array of strings. A list of Tissue Sample ID(s).} \item{page}{Integer (default = 0).} @@ -21,6 +21,6 @@ Get Image } \examples{ get_image() -get_image(tissueSampleId = "GTEX-1117F-0226", page = 0, itemsPerPage = 100000) +get_image(tissueSampleIds = "GTEX-1117F-0226", page = 0, itemsPerPage = 100000) } \concept{Histology Endpoints} diff --git a/man/get_independent_eqtl.Rd b/man/get_independent_eqtl.Rd index 2878fba..ef28e2a 100644 --- a/man/get_independent_eqtl.Rd +++ b/man/get_independent_eqtl.Rd @@ -5,20 +5,20 @@ \title{Get Independent eQTL} \usage{ get_independent_eqtl( - gencodeId, - tissueSiteDetailId = NULL, + gencodeIds, + tissueSiteDetailIds = NULL, datasetId = "gtex_v8", page = 0, itemsPerPage = 250 ) } \arguments{ -\item{gencodeId}{String. A Versioned GENCODE ID of a gene, e.g. -"ENSG00000065613.9".} +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} -\item{tissueSiteDetailId}{String. The ID of the tissue of interest. Can be a -GTEx specific ID (e.g. "Whole_Blood"; use \code{\link[=available_tissueSiteDetailIds]{available_tissueSiteDetailIds()}} -to see valid values) or an Ontology ID.} +\item{tissueSiteDetailIds}{Character vector of IDs for tissues of interest. +Can be GTEx specific IDs (e.g. "Whole_Blood"; use +\code{\link[=available_tissueSiteDetailIds]{available_tissueSiteDetailIds()}} to see valid values) or Ontology IDs.} \item{datasetId}{String. Unique identifier of a dataset. Usually includes a data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". @@ -33,33 +33,36 @@ A tibble. } \description{ Retrieve Independent eQTL Data +\itemize{ +\item Finds and returns Independent eQTL Data data for the provided list of genes +\item By default, this endpoint fetches data from the latest GTEx version +} -Finds and returns Independent eQTL Data data for the provided list of genes -By default, this endpoint fetches data from the latest GTEx version The retrieved data is split into pages with items_per_page entries per page -\link[=GTEx portal API -documentation]{GTEx portal API documentation} (https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_independent_eqtl_api_v2_association_independentEqtl_get) +\href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_independent_eqtl_api_v2_association_independentEqtl_get}{GTEx portal API documentation} } \examples{ -\dontrun{ # 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")) -} + "ENSG00000203782.5"), + tissueSiteDetailIds = c("Whole_Blood", + "Thyroid")) } \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_fine_mapping}()}, \code{\link{get_multi_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } \concept{Static Association Endpoints} diff --git a/man/get_linkage_disequilibrium_by_variant_data.Rd b/man/get_linkage_disequilibrium_by_variant_data.Rd new file mode 100644 index 0000000..2ab5bc4 --- /dev/null +++ b/man/get_linkage_disequilibrium_by_variant_data.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_linkage_disequilibrium_by_variant_data.R +\name{get_linkage_disequilibrium_by_variant_data} +\alias{get_linkage_disequilibrium_by_variant_data} +\title{Get Linkage Disequilibrium By Variant Data} +\usage{ +get_linkage_disequilibrium_by_variant_data( + variantId = NULL, + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{variantId}{String. A gtex variant ID.} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item Find linkage disequilibrium (LD) data for a given variant +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_linkage_disequilibrium_by_variant_data_api_v2_dataset_ldByVariant_get}{GTEx Portal API documentation} +} +\examples{ +get_linkage_disequilibrium_by_variant_data() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_linkage_disequilibrium_data.Rd b/man/get_linkage_disequilibrium_data.Rd new file mode 100644 index 0000000..c6970c1 --- /dev/null +++ b/man/get_linkage_disequilibrium_data.Rd @@ -0,0 +1,58 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_linkage_disequilibrium_data.R +\name{get_linkage_disequilibrium_data} +\alias{get_linkage_disequilibrium_data} +\title{Get Linkage Disequilibrium Data} +\usage{ +get_linkage_disequilibrium_data( + gencodeIds, + datasetId = "gtex_v8", + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} + +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A tibble. +} +\description{ +\itemize{ +\item Find linkage disequilibrium (LD) data for a given gene. +\item This endpoint returns linkage disequilibrium data for the cis-eQTLs found associated with the provided gene in a specified dataset. +\item Results are queried by gencode ID. By default, the service queries the latest GTEx release. +\item Specify a dataset ID to fetch results from a different dataset. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_by_location_api_v2_dataset_variantByLocation_get}{GTEx Portal API documentation} +} +\examples{ +get_linkage_disequilibrium_data(gencodeIds = c("ENSG00000132693.12", + "ENSG00000203782.5")) +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_multi_tissue_eqtls.Rd b/man/get_multi_tissue_eqtls.Rd index c99dc72..9a2cd07 100644 --- a/man/get_multi_tissue_eqtls.Rd +++ b/man/get_multi_tissue_eqtls.Rd @@ -2,10 +2,10 @@ % Please edit documentation in R/get_multi_tissue_eqtls.R \name{get_multi_tissue_eqtls} \alias{get_multi_tissue_eqtls} -\title{Get Significant Single Tissue Eqtls By Location} +\title{Get Multi Tissue Eqtls} \usage{ get_multi_tissue_eqtls( - gencodeId, + gencodeIds, variantId = NULL, datasetId = "gtex_v8", page = 0, @@ -13,8 +13,8 @@ get_multi_tissue_eqtls( ) } \arguments{ -\item{gencodeId}{String. A Versioned GENCODE ID of a gene, e.g. -"ENSG00000065613.9".} +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} \item{variantId}{String. A gtex variant ID.} @@ -30,25 +30,35 @@ Default = "gtex_v8".} A tibble. } \description{ -Find significant single tissue eQTLs using Chromosomal Locations. -This service returns precomputed significant single tissue eQTLs. -Results may be filtered by tissue, and/or dataset. -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. +Find multi-tissue eQTL Metasoft results. +\itemize{ +\item This service returns multi-tissue eQTL Metasoft results for a given gene and variant in a specified dataset. +\item A Versioned GENCODE ID must be provided. +\item For each tissue, the results include: m-value (mValue), normalized effect size (nes), p-value (pValue), and standard error (se). +\item The m-value is the posterior probability that an eQTL effect exists in each tissue tested in the cross-tissue meta-analysis (Han and Eskin, PLoS Genetics 8(3): e1002555, 2012). +\item The normalized effect size is the slope of the linear regression of normalized expression data versus the three genotype categories using single-tissue eQTL analysis, representing eQTL effect size. +\item The p-value is from a t-test that compares observed NES from single-tissue eQTL analysis to a null NES of 0. +} + +By default, the service queries the latest GTEx release. The retrieved data is split into pages with items_per_page entries per page -\href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_api_v2_association_singleTissueEqtl_get}{GTEx Portal API documentation} +\href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_multi_tissue_eqtls_api_v2_association_metasoft_get}{GTEx Portal API documentation} } \examples{ -\dontrun{ # search by gene -get_multi_tissue_eqtls(gencodeIds = c("ENSG00000132693.12", - "ENSG00000203782.5"))} +get_multi_tissue_eqtls(gencodeId = c("ENSG00000132693.12", + "ENSG00000203782.5")) } \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } \concept{Static Association Endpoints} diff --git a/man/get_sample.Rd b/man/get_sample.Rd new file mode 100644 index 0000000..cf3da92 --- /dev/null +++ b/man/get_sample.Rd @@ -0,0 +1,141 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_sample.R +\name{get_sample} +\alias{get_sample} +\title{Get Sample} +\usage{ +get_sample( + datasetId = "gtex_v8", + sampleIds = NULL, + tissueSampleIds = NULL, + subjectIds = NULL, + ageBrackets = NULL, + sex = NULL, + pathCategory = NULL, + tissueSiteDetailId = NULL, + aliquotIds = NULL, + autolysisScores = NULL, + hardyScales = NULL, + ischemicTime = NULL, + ischemicTimeGroups = NULL, + rin = NULL, + uberonIds = NULL, + dataTypes = NULL, + sortBy = NULL, + sortDirection = NULL, + page = NULL, + itemsPerPage = NULL +) +} +\arguments{ +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{sampleIds}{Character vector. GTEx sample ID.} + +\item{tissueSampleIds}{Array of strings. A list of Tissue Sample ID(s).} + +\item{subjectIds}{Character vector. GTEx subject ID.} + +\item{ageBrackets}{The age bracket(s) of the donors of interest. Options: +"20-29", "30-39", "40-49", "50-59", "60-69", "70-79".} + +\item{sex}{String. Options: "male", "female".} + +\item{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".} + +\item{tissueSiteDetailId}{String. The ID of the tissue of interest. Can be a +GTEx specific ID (e.g. "Whole_Blood"; use \code{\link[=available_tissueSiteDetailIds]{available_tissueSiteDetailIds()}} +to see valid values) or an Ontology ID.} + +\item{aliquotIds}{Character vector.} + +\item{autolysisScores}{Character vector. Options: "None", "Mild", "Moderate", +"Severe".} + +\item{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".} + +\item{ischemicTime}{Integer.} + +\item{ischemicTimeGroups}{Character vector. Options: "<= 0", "1 - 300", "301 +\itemize{ +\item 600", "601 - 900", "901 - 1200", "1201 - 1500", "> 1500". +}} + +\item{rin}{Integer.} + +\item{uberonIds}{Character vector. A list of Uberon ID(s) of interest. +Options: "UBERON:EFO_0000572", "UBERON:EFO_0002009", "UBERON:0000007", +"UBERON:0000458", "UBERON:0000473", "UBERON:0000945", "UBERON:0000992", +"UBERON:0000995", "UBERON:0000996", "UBERON:0001114", "UBERON:0001150", +"UBERON:0001157", "UBERON:0001159", "UBERON:0001211", "UBERON:0001225", +"UBERON:0001255", "UBERON:0001293", "UBERON:0001323", "UBERON:0001496", +"UBERON:0001621", "UBERON:0001870", "UBERON:0001873", "UBERON:0001874", +"UBERON:0001876", "UBERON:0001882", "UBERON:0001898", "UBERON:0001954", +"UBERON:0002037", "UBERON:0002038", "UBERON:0002046", "UBERON:0002106", +"UBERON:0002190", "UBERON:0002367", "UBERON:0002369", "UBERON:0003889", +"UBERON:0004264", "UBERON:0004550", "UBERON:0004648", "UBERON:0006330", +"UBERON:0006469", "UBERON:0006566", "UBERON:0006631", "UBERON:0006920", +"UBERON:0007610", "UBERON:0008367", "UBERON:0008952", "UBERON:0009834", +"UBERON:0009835", "UBERON:0010414", "UBERON:0011907", "UBERON:0012249", +"UBERON:0013756", "UBERON:0036149".} + +\item{dataTypes}{Character vector. Options: "RNASEQ", "WGS", "WES", "OMNI", +"EXCLUDE".} + +\item{sortBy}{String. Options: "sampleId", "ischemicTime", "aliquotId", +"tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", +"tissueSiteDetailId", "sex".} + +\item{sortDirection}{String. Options: "asc", "desc". Default = "asc".} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item This service returns information of samples used in analyses from all datasets. +\item Results may be filtered by dataset ID, sample ID, subject ID, sample metadata, or other provided parameters. +\item By default, this service queries the latest GTEx release. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_sample_api_v2_dataset_sample_get}{GTEx Portal API documentation} +} +\examples{ +get_sample() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_significant_single_tissue_Ieqtls.Rd b/man/get_significant_single_tissue_Ieqtls.Rd index 4079bad..78f65a2 100644 --- a/man/get_significant_single_tissue_Ieqtls.Rd +++ b/man/get_significant_single_tissue_Ieqtls.Rd @@ -1,11 +1,11 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/get_significant_single_tissue_ieqtls.R -\name{get_significant_single_tissue_Ieqtls} -\alias{get_significant_single_tissue_Ieqtls} +\name{get_significant_single_tissue_ieqtls} +\alias{get_significant_single_tissue_ieqtls} \title{Get Significant Single Tissue Ieqtls} \usage{ -get_significant_single_tissue_Ieqtls( - gencodeId, +get_significant_single_tissue_ieqtls( + gencodeIds, variantId = NULL, tissueSiteDetailId = NULL, datasetId = "gtex_v8", @@ -14,8 +14,8 @@ get_significant_single_tissue_Ieqtls( ) } \arguments{ -\item{gencodeId}{String. A Versioned GENCODE ID of a gene, e.g. -"ENSG00000065613.9".} +\item{gencodeIds}{A character vector of Versioned GENCODE IDs, e.g. +c("ENSG00000132693.12", "ENSG00000203782.5").} \item{variantId}{String. A gtex variant ID.} @@ -49,7 +49,8 @@ The retrieved data is split into pages with items_per_page entries per page \href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_ieqtls_api_v2_association_singleTissueIEqtl_get}{GTEx Portal API documentation} } \examples{ -get_significant_single_tissue_Ieqtls("ENSG00000132693.12") +get_significant_single_tissue_ieqtls(c("ENSG00000132693.12", + "ENSG00000203782.5")) } \seealso{ Other Static Association Endpoints: diff --git a/man/get_significant_single_tissue_eqtls.Rd b/man/get_significant_single_tissue_eqtls.Rd index 0060ee6..6657770 100644 --- a/man/get_significant_single_tissue_eqtls.Rd +++ b/man/get_significant_single_tissue_eqtls.Rd @@ -70,6 +70,10 @@ Other Static Association Endpoints: \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } \concept{Static Association Endpoints} diff --git a/man/get_significant_single_tissue_eqtls_by_location.Rd b/man/get_significant_single_tissue_eqtls_by_location.Rd index 3892827..6e5d7da 100644 --- a/man/get_significant_single_tissue_eqtls_by_location.Rd +++ b/man/get_significant_single_tissue_eqtls_by_location.Rd @@ -45,22 +45,20 @@ and is not paginated. #' \href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_eqtls_api_v2_association_singleTissueEqtl_get}{GTEx Portal API documentation} } \examples{ -\dontrun{ get_significant_single_tissue_eqtls_by_location( tissueSiteDetailId = "Artery_Aorta", start = 10000, end = 250000, chromosome = "chr11") } -} \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, -\code{\link{get_significant_single_tissue_Ieqtls}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, \code{\link{get_significant_single_tissue_isqtls}()}, \code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} diff --git a/man/get_significant_single_tissue_isqtls.Rd b/man/get_significant_single_tissue_isqtls.Rd index 3bd403e..9ccb140 100644 --- a/man/get_significant_single_tissue_isqtls.Rd +++ b/man/get_significant_single_tissue_isqtls.Rd @@ -44,20 +44,18 @@ is split into pages with items_per_page entries per page \href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_isqtls_api_v2_association_singleTissueISqtl_get}{GTEx Portal API documentation} } \examples{ -\dontrun{ get_significant_single_tissue_isqtls(gencodeIds = c("ENSG00000065613.9", "ENSG00000203782.5")) } -} \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, -\code{\link{get_significant_single_tissue_Ieqtls}()}, \code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, \code{\link{get_significant_single_tissue_sqtls}()}, \code{\link{get_sqtl_genes}()} } diff --git a/man/get_significant_single_tissue_sqtls.Rd b/man/get_significant_single_tissue_sqtls.Rd index f47eee1..e6a0559 100644 --- a/man/get_significant_single_tissue_sqtls.Rd +++ b/man/get_significant_single_tissue_sqtls.Rd @@ -39,21 +39,19 @@ The retrieved data is split into pages with items_per_page entries per page \href{https://gtexportal.org/api/v2/redoc#tag/Static-Association-Endpoints/operation/get_significant_single_tissue_sqtls_api_v2_association_singleTissueSqtl_get}{GTEx Portal API documentation} } \examples{ -\dontrun{ # search by gene get_significant_single_tissue_sqtls(gencodeIds = c("ENSG00000065613.9", "ENSG00000203782.5")) } -} \seealso{ Other Static Association Endpoints: \code{\link{get_eqtl_genes}()}, \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, -\code{\link{get_significant_single_tissue_Ieqtls}()}, \code{\link{get_significant_single_tissue_eqtls_by_location}()}, \code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, \code{\link{get_significant_single_tissue_isqtls}()}, \code{\link{get_sqtl_genes}()} } diff --git a/man/get_sqtl_genes.Rd b/man/get_sqtl_genes.Rd index 401bed3..bdbd184 100644 --- a/man/get_sqtl_genes.Rd +++ b/man/get_sqtl_genes.Rd @@ -57,6 +57,10 @@ Other Static Association Endpoints: \code{\link{get_fine_mapping}()}, \code{\link{get_independent_eqtl}()}, \code{\link{get_multi_tissue_eqtls}()}, -\code{\link{get_significant_single_tissue_eqtls}()} +\code{\link{get_significant_single_tissue_eqtls_by_location}()}, +\code{\link{get_significant_single_tissue_eqtls}()}, +\code{\link{get_significant_single_tissue_ieqtls}()}, +\code{\link{get_significant_single_tissue_isqtls}()}, +\code{\link{get_significant_single_tissue_sqtls}()} } \concept{Static Association Endpoints} diff --git a/man/get_subject.Rd b/man/get_subject.Rd new file mode 100644 index 0000000..a2bbab4 --- /dev/null +++ b/man/get_subject.Rd @@ -0,0 +1,67 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_subject.R +\name{get_subject} +\alias{get_subject} +\title{Get Subject} +\usage{ +get_subject( + datasetId = "gtex_v8", + sex = NULL, + ageBrackets = NULL, + hardyScales = NULL, + subjectIds = NULL, + page = 0, + itemsPerPage = 250 +) +} +\arguments{ +\item{datasetId}{String. Unique identifier of a dataset. Usually includes a +data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". +Default = "gtex_v8".} + +\item{sex}{String. Options: "male", "female".} + +\item{ageBrackets}{The age bracket(s) of the donors of interest. Options: +"20-29", "30-39", "40-49", "50-59", "60-69", "70-79".} + +\item{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".} + +\item{subjectIds}{Character vector. GTEx subject ID.} + +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item This service returns information of subjects used in analyses from all datasets. +\item Results may be filtered by dataset ID, subject ID, sex, age bracket or Hardy Scale. +\item By default, this service queries the latest GTEx release. +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get}{GTEx Portal API documentation} +} +\examples{ +get_subject() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_tissue_site_detail}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_tissue_site_detail.Rd b/man/get_tissue_site_detail.Rd new file mode 100644 index 0000000..9bf927e --- /dev/null +++ b/man/get_tissue_site_detail.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_tissue_site_detail.R +\name{get_tissue_site_detail} +\alias{get_tissue_site_detail} +\title{Get Tissue Site Detail} +\usage{ +get_tissue_site_detail(page = 0, itemsPerPage = 250) +} +\arguments{ +\item{page}{Integer (default = 0).} + +\item{itemsPerPage}{Integer (default = 250).} +} +\value{ +A Tibble +} +\description{ +\itemize{ +\item Retrieve all tissue site detail information in the database +} + +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_tissue_site_detail_api_v2_dataset_tissueSiteDetail_get}{GTEx Portal API documentation} +} +\examples{ +get_tissue_site_detail() +} +\seealso{ +Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_variant_by_location}()}, +\code{\link{get_variant}()} +} +\concept{Datasets Endpoints} diff --git a/man/get_variant.Rd b/man/get_variant.Rd index af4eb0d..163c3af 100644 --- a/man/get_variant.Rd +++ b/man/get_variant.Rd @@ -66,6 +66,17 @@ get_variant(chromosome = "chr1", } \seealso{ Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, \code{\link{get_variant_by_location}()} } \concept{Datasets Endpoints} diff --git a/man/get_variant_by_location.Rd b/man/get_variant_by_location.Rd index bdb4cf2..b8a8842 100644 --- a/man/get_variant_by_location.Rd +++ b/man/get_variant_by_location.Rd @@ -42,6 +42,17 @@ get_variant_by_location(start = 153209600, } \seealso{ Other Datasets Endpoints: +\code{\link{get_annotation}()}, +\code{\link{get_collapsed_gene_model_exon}()}, +\code{\link{get_downloads_page_data}()}, +\code{\link{get_file_list}()}, +\code{\link{get_full_get_collapsed_gene_model_exon}()}, +\code{\link{get_functional_annotation}()}, +\code{\link{get_linkage_disequilibrium_by_variant_data}()}, +\code{\link{get_linkage_disequilibrium_data}()}, +\code{\link{get_sample}()}, +\code{\link{get_subject}()}, +\code{\link{get_tissue_site_detail}()}, \code{\link{get_variant}()} } \concept{Datasets Endpoints} diff --git a/man/gtexr_arguments.Rd b/man/gtexr_arguments.Rd index 02be343..a0306e1 100644 --- a/man/gtexr_arguments.Rd +++ b/man/gtexr_arguments.Rd @@ -7,6 +7,16 @@ gtexr_arguments() } \arguments{ +\item{ageBrackets}{The age bracket(s) of the donors of interest. Options: +"20-29", "30-39", "40-49", "50-59", "60-69", "70-79".} + +\item{aliquotIds}{Character vector.} + +\item{autolysisScores}{Character vector. Options: "None", "Mild", "Moderate", +"Severe".} + +\item{bp_window}{Integer.} + \item{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", @@ -16,6 +26,9 @@ gtexr_arguments() data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot". Default = "gtex_v8".} +\item{dataTypes}{Character vector. Options: "RNASEQ", "WGS", "WES", "OMNI", +"EXCLUDE".} + \item{end}{Integer.} \item{gencodeId}{String. A Versioned GENCODE ID of a gene, e.g. @@ -35,18 +48,61 @@ unversioned gencodeIds.} \item{genomeBuild}{String. Options: "GRCh38/hg38", "GRCh37/hg19". Default = "GRCh38/hg38".} +\item{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".} + \item{itemsPerPage}{Integer (default = 250).} +\item{ischemicTime}{Integer.} + +\item{ischemicTimeGroups}{Character vector. Options: "<= 0", "1 - 300", "301 +\itemize{ +\item 600", "601 - 900", "901 - 1200", "1201 - 1500", "> 1500". +}} + +\item{organizationName}{String. Options: "GTEx Consortium" "Kid's First".} + \item{page}{Integer (default = 0).} +\item{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".} + \item{pos}{Integer, vector.} +\item{project_id}{String. Options: "gtex" "adult-gtex" "egtex".} + +\item{rin}{Integer.} + +\item{sampleIds}{Character vector. GTEx sample ID.} + +\item{sex}{String. Options: "male", "female".} + \item{snpId}{String} +\item{sortBy}{String. Options: "sampleId", "ischemicTime", "aliquotId", +"tissueSampleId", "hardyScale", "pathologyNotes", "ageBracket", +"tissueSiteDetailId", "sex".} + \item{sortDirection}{String. Options: "asc", "desc". Default = "asc".} \item{start}{Integer.} +\item{subjectIds}{Character vector. GTEx subject ID.} + +\item{tissueSampleIds}{Array of strings. A list of Tissue Sample ID(s).} + \item{tissueSiteDetailId}{String. The ID of the tissue of interest. Can be a GTEx specific ID (e.g. "Whole_Blood"; use \code{\link[=available_tissueSiteDetailIds]{available_tissueSiteDetailIds()}} to see valid values) or an Ontology ID.} @@ -55,6 +111,22 @@ to see valid values) or an Ontology ID.} Can be GTEx specific IDs (e.g. "Whole_Blood"; use \code{\link[=available_tissueSiteDetailIds]{available_tissueSiteDetailIds()}} to see valid values) or Ontology IDs.} +\item{uberonIds}{Character vector. A list of Uberon ID(s) of interest. +Options: "UBERON:EFO_0000572", "UBERON:EFO_0002009", "UBERON:0000007", +"UBERON:0000458", "UBERON:0000473", "UBERON:0000945", "UBERON:0000992", +"UBERON:0000995", "UBERON:0000996", "UBERON:0001114", "UBERON:0001150", +"UBERON:0001157", "UBERON:0001159", "UBERON:0001211", "UBERON:0001225", +"UBERON:0001255", "UBERON:0001293", "UBERON:0001323", "UBERON:0001496", +"UBERON:0001621", "UBERON:0001870", "UBERON:0001873", "UBERON:0001874", +"UBERON:0001876", "UBERON:0001882", "UBERON:0001898", "UBERON:0001954", +"UBERON:0002037", "UBERON:0002038", "UBERON:0002046", "UBERON:0002106", +"UBERON:0002190", "UBERON:0002367", "UBERON:0002369", "UBERON:0003889", +"UBERON:0004264", "UBERON:0004550", "UBERON:0004648", "UBERON:0006330", +"UBERON:0006469", "UBERON:0006566", "UBERON:0006631", "UBERON:0006920", +"UBERON:0007610", "UBERON:0008367", "UBERON:0008952", "UBERON:0009834", +"UBERON:0009835", "UBERON:0010414", "UBERON:0011907", "UBERON:0012249", +"UBERON:0013756", "UBERON:0036149".} + \item{variantId}{String. A gtex variant ID.} } \value{ diff --git a/tests/testthat/test-gtex_query.R b/tests/testthat/test-gtex_query.R index a00500f..2623730 100644 --- a/tests/testthat/test-gtex_query.R +++ b/tests/testthat/test-gtex_query.R @@ -14,4 +14,6 @@ with_mock_dir("gtex_query", { # TODO - add test for `calculate_eqtls(tissueSiteDetailId = "Artery_Aorta", # gencodeId = "ENSG00000116117", variantId = "rs147387290")` - returns `NULL` -# for "pValueThreshold" +# for "pValueThreshold". This doesn't however: +# `calculate_eqtls(tissueSiteDetailId = "Artery_Aorta", gencodeId = +# "ENSG00000225630", variantId = "rs554008981")` diff --git a/tests/testthat/test-validate_args.R b/tests/testthat/test-validate_args.R index bf72a2a..56e9f85 100644 --- a/tests/testthat/test-validate_args.R +++ b/tests/testthat/test-validate_args.R @@ -26,3 +26,9 @@ test_that("validate_args() removes 's$' from pluralised args", { call = rlang::caller_env()), list(geneId = "CRP")) }) + + +test_that("validate_args() raises an error for arguments that are not listed by `gtexr_arguments()`", { + expect_error(validate_args(list(unrecognised_arg = "x"), rlang::caller_env()), + "Unrecognised argument: `unrecognised_arg`") +})