diff --git a/R/get_variant.R b/R/get_variant.R index b234d6f..a9a9352 100644 --- a/R/get_variant.R +++ b/R/get_variant.R @@ -1,21 +1,18 @@ #' Get Variant #' -#' [This service returns information about a variant, including position, dbSNP -#' RS ID, the reference allele, the alternative allele, and whether the minor -#' allele frequency is >= -#' 1%.](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_api_v2_dataset_variant_get) -#' -#' For GTEx v6p, there is also information about whether the whole exome -#' sequence and chip sequencing data are available. Results may be queried by -#' GTEx variant ID (variantId), dbSNP RS ID (snpId) or genomic location -#' (chromosome and pos). Variants are identified based on the genotype data of -#' each dataset cohort, namely, are dataset-dependent. Each variant is assigned -#' a unique GTEx variant ID (i.e. the primary key). Not all variants have a -#' mappable dbSNP RS ID. By default, this service queries the latest GTEx -#' release. -#' -#' Note: searching by chromosome and position can be more easily achieved using -#' [get_variant_by_location()]. +#' @description This service returns information about a variant, including +#' position, dbSNP RS ID, the reference allele, the alternative allele, and +#' whether the minor allele frequency is >= 1%. For GTEx v6p, there is also +#' information about whether the whole exome sequence and chip sequencing data +#' are available. Results may be queried by GTEx variant ID (variantId), dbSNP +#' RS ID (snpId) or genomic location (chromosome and pos). Variants are +#' identified based on the genotype data of each dataset cohort, namely, are +#' dataset-dependent. Each variant is assigned a unique GTEx variant ID (i.e. +#' the primary key). Not all variants have a mappable dbSNP RS ID. By default, +#' this service queries the latest GTEx release. +#' +#' [GTEx Portal API +#' documentation](https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_api_v2_dataset_variant_get) #' #' @inheritParams gtexr_arguments #' @@ -41,10 +38,5 @@ get_variant <- function(snpId = NULL, page = 0, itemsPerPage = 250) { - if (is.null(snpId) & is.null(variantId) & (is.null(chromosome) | is.null(pos))) { - cli::cli_abort(c("Either `snpId` or `variantId` must be provided, or both `chromosome` and `pos`.", - "i" = "See {.fn ?get_variant} for examples")) - } - gtex_query(endpoint = "dataset/variant") } diff --git a/man/get_variant.Rd b/man/get_variant.Rd index 801a0f4..83cbe97 100644 --- a/man/get_variant.Rd +++ b/man/get_variant.Rd @@ -37,20 +37,18 @@ data source and data release. Options: "gtex_v8", "gtex_snrnaseq_pilot".} A tibble. } \description{ -\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_api_v2_dataset_variant_get}{This service returns information about a variant, including position, dbSNP RS ID, the reference allele, the alternative allele, and whether the minor allele frequency is >= 1\%.} -} -\details{ -For GTEx v6p, there is also information about whether the whole exome -sequence and chip sequencing data are available. Results may be queried by -GTEx variant ID (variantId), dbSNP RS ID (snpId) or genomic location -(chromosome and pos). Variants are identified based on the genotype data of -each dataset cohort, namely, are dataset-dependent. Each variant is assigned -a unique GTEx variant ID (i.e. the primary key). Not all variants have a -mappable dbSNP RS ID. By default, this service queries the latest GTEx -release. +This service returns information about a variant, including +position, dbSNP RS ID, the reference allele, the alternative allele, and +whether the minor allele frequency is >= 1\%. For GTEx v6p, there is also +information about whether the whole exome sequence and chip sequencing data +are available. Results may be queried by GTEx variant ID (variantId), dbSNP +RS ID (snpId) or genomic location (chromosome and pos). Variants are +identified based on the genotype data of each dataset cohort, namely, are +dataset-dependent. Each variant is assigned a unique GTEx variant ID (i.e. +the primary key). Not all variants have a mappable dbSNP RS ID. By default, +this service queries the latest GTEx release. -Note: searching by chromosome and position can be more easily achieved using -\code{\link[=get_variant_by_location]{get_variant_by_location()}}. +\href{https://gtexportal.org/api/v2/redoc#tag/Datasets-Endpoints/operation/get_variant_api_v2_dataset_variant_get}{GTEx Portal API documentation} } \examples{ # search by rsid