Retrieves variants via the NHGRI-EBI GWAS Catalog REST API. The REST
API is queried multiple times with the criteria passed as arguments (see
below). By default all variants that match the criteria supplied in the
arguments are retrieved: this corresponds to the default option
set_operation
set to 'union'
. If you rather have only the
variants that match simultaneously all criteria provided, then set
set_operation
to 'intersection'
.
get_variants(
study_id = NULL,
association_id = NULL,
variant_id = NULL,
efo_id = NULL,
pubmed_id = NULL,
genomic_range = NULL,
cytogenetic_band = NULL,
gene_name = NULL,
efo_trait = NULL,
reported_trait = NULL,
set_operation = "union",
interactive = TRUE,
std_chromosomes_only = TRUE,
verbose = FALSE,
warnings = TRUE
)
A variants object.
A character vector of GWAS Catalog study accession identifiers.
A character vector of GWAS Catalog association identifiers.
A character vector of GWAS Catalog variant identifiers.
A character vector of EFO identifiers.
An integer vector of PubMed identifiers.
A named list of three vectors:
A character vector of chromosome names of the form 1--22, X or Y.
A numeric vector of start positions, starting at 1.
A numeric vector of end positions.
The three vectors need to be of the same length so that chromosome
names, start
and end
positions can be matched by position.
A character vector of cytogenetic bands of the form
'1p36.11'
.
Gene symbol according to HUGO Gene Nomenclature (HGNC).
A character vector of
EFO trait descriptions, e.g.,
'uric acid measurement'
.
A character vector of phenotypic traits as reported by the original authors of the study.
Either 'union'
or 'intersection'
. This
tells how variants retrieved by different criteria should be combined:
'union'
binds together all results removing duplicates and
'intersection'
only keeps same variants found with different
criteria.
A logical. If all variants are requested, whether to ask interactively if we really want to proceed.
Whether to return only variants mapped to standard chromosomes: 1 thru 22, X, Y, and MT.
Whether the function should be verbose about the different queries or not.
Whether to print warnings.
Please note that all search criteria are vectorised, thus allowing for batch
mode search, e.g., one can search by multiple variant identifiers at once by
passing a vector of identifiers to variant_id
.
# Get variants by study identifier
get_variants(study_id = 'GCST001085', warnings = FALSE)
# Get a variant by its identifier
if (FALSE) {
get_variants(variant_id = 'rs3798440', warnings = FALSE)
}
Run the code above in your browser using DataLab