Learn R Programming

GoogleGenomics (version 1.4.2)

variantsToGRanges: Convert variants to GRanges.

Description

Note that the Global Alliance for Genomics and Health API uses a 0-based coordinate system. For more detail, please see GA4GH discussions such as the following:

Usage

variantsToGRanges(variants, oneBasedCoord = TRUE, slStyle = "UCSC")

Arguments

variants
A list of R objects corresponding to the JSON objects returned by the Google Genomics Variants API.
oneBasedCoord
Convert genomic positions to 1-based coordinates.
slStyle
The style for seqnames (chrN or N or...). Default is UCSC.

Value

GRanges

See Also

Other variants converter functions: variantsToVRanges

Examples

Run this code
# Authenticated on package load from the env variable GOOGLE_API_KEY.
variants1 <- getVariants(converter=variantsToGRanges)
summary(variants1)
variants2 <- variantsToGRanges(getVariants())
print(identical(variants1, variants2))

Run the code above in your browser using DataLab