The API Source answers queries through the OpenGWAS API. Every query function takes a Source as its first argument.
Usage
og_api(
url = getOption("opengwasr.url"),
timeout = default_timeout(),
max_in_flight = default_max_in_flight(),
caller = NULL,
ld_store = NULL,
geno_store = NULL,
inherit = NULL
)Arguments
- url
The API's base URL. Defaults to the
opengwasr.urloption, thenOPENGWAS_URL.- timeout
Seconds to wait for any one call before giving up. Defaults to the
opengwasr.timeoutoption, then 3600.- max_in_flight
How many Jobs one call may run at once. Defaults to the
opengwasr.max_in_flightoption, then 4; at most 100, the Jobs one user may have queued.- caller
A package or tool calling opengwasr on its users' behalf, to name itself in the user agent of every request this Source makes, so the API's logs can tell which tool made it:
og_api(caller = "TwoSampleMR/0.8.0")sendsopengwasr/<version> TwoSampleMR/0.8.0. One short string of printable characters (at most 100),name/versionby convention;NULL(the default) adds nothing.- ld_store
The Source's LD resource: an LD Store's name, such as
"hgdp1kgp-v2-EUR-k10", or an ancestry code, such as"EUR", for that ancestry's LD Store (an exact name wins). Every verb that needs LD (og_tophits()when it clumps,og_clump(),og_ld_matrix(),og_ld_proxies(),og_ld_reflookup()) uses it: the LD is chosen on the Source, and nowhere else.NULL(the default): each Analysis's Assigned Ancestry chooses its LD Store. It is checked againstog_ld_stores()when a call first needs it. Seevignette("ld").- geno_store
A Genotype Store, from which LD would be computed when asked. Not available yet: anything but
NULLis refused (classopengwasr_ld_resource_unavailable) until the API serves Genotype Stores.- inherit
An API Source to build this one like: every argument given replaces the inherited one, and the rest (
urland the key it was made with,timeout,max_in_flight,caller, and the LD resource) come frominherit. Givingld_storeorgeno_storereplaces the inherited LD resource whole. So other LD for one call isog_api(inherit = src, ld_store = "AFR"). The arguments are checked as for any other Source. Anything but an API Source is refused (classopengwasr_argument).