Package 'GWASapi'

Title: NHGRI-EBI GWAS Catalog of Summary Statistics
Description: Tools for connecting to the NHGRI-EBI API for GWAS summary statistics.
Authors: Karl W Broman [aut, cre]
Maintainer: Karl W Broman <[email protected]>
License: MIT + file LICENSE
Version: 0.1-4
Built: 2026-06-07 21:08:24 UTC
Source: https://github.com/rqtl/GWASapi

Help Index


Check if the GWAS Catalog is live

Description

Check if the GWAS Catalog is live

Usage

check_gwasapi()

Value

Character string.

Examples

check_gwasapi()

Get GWAS associations for a given region

Description

Get GWAS associations for a given region

Usage

get_asso(
  chr,
  bp_lower = NULL,
  bp_upper = NULL,
  study = NULL,
  p_lower = NULL,
  p_upper = NULL,
  start = NULL,
  size = NULL
)

Arguments

chr

chromosome number

bp_lower

Lower endpoint of basepairs initerval

bp_upper

Upper endpoint of basepairs initerval

study

Restrict to a particular study

p_lower

Lower bound on p-values

p_upper

Upper bound of p-values

start

First record to retrieve (starting at 0)

size

Maximum number of results to retrieve

Value

Data frame of associations

See Also

get_variant(), get_trait_asso()

Examples

result <- get_asso(chr=19, bp_lower=19200000, bp_upper=19300000)

Get GWAS associations for a particular trait

Description

Get GWAS associations for a particular trait

Usage

get_trait_asso(
  trait = NULL,
  study = NULL,
  p_lower = NULL,
  p_upper = NULL,
  start = NULL,
  size = NULL
)

Arguments

trait

Restrict to a particular study

study

Restrict to a particular study

p_lower

Lower bound on p-values

p_upper

Upper bound of p-values

start

First record to retrieve (starting at 0)

size

Maximum number of results to retrieve

Value

Data frame of associations

See Also

get_variant(), get_asso()

Examples

## Not run: result <- get_trait_asso("EFO_0001360", p_upper=1e-10)

Get associations for a given variant

Description

Get all associations for a given variant

Usage

get_variant(
  rsnum,
  chr = NULL,
  p_lower = NULL,
  p_upper = NULL,
  study = NULL,
  start = NULL,
  size = NULL
)

Arguments

rsnum

RS number for a variant

chr

chromosome number if known

p_lower

Lower bound on p-values

p_upper

Upper bound of p-values

study

Restrict to a particular study

start

First record to retrieve (starting at 0)

size

Maximum number of results to retrieve

Value

Data frame with associations as rows

See Also

get_asso(), get_trait_asso()

Examples

# get associations for a given variant
results <- get_variant("rs2228603")
# use information about the chromosome it's on
results <- get_variant("rs2228603", 19)
# get the next 20 results
next20 <- get_variant("rs2228603", 19, start=20)
# get 100 results rather than just 20
first100 <- get_variant("rs2228603", 19, size=100)
# return just the associations with P < 1e-8
top_results <- get_variant("rs2228603", 19, p_upper=1e-8)

Information about a study

Description

Information about a particular study

Usage

info_study(study)

Arguments

study

Study identifieer

Value

List of meta-data


List chromosomes

Description

List chromosomes

Usage

list_chr()

Value

Vector of chromosome numbers (as integers)

See Also

list_studies(), list_traits()

Examples

chr <- list_chr()

List studies

Description

List studies

Usage

list_studies(trait = NULL, start = NULL, size = NULL)

Arguments

trait

If provided, restrict search to studies that included the specified trait.

start

First record to retrieve (starting at 0)

size

Maximum number of results to retrieve

Value

Vector of study accessions

See Also

list_chr(), list_traits()

Examples

first20 <- list_studies() # returns 20 studies
next20 <- list_studies(start=20) # returns the next 20 studies
first100 <- list_studies(size=100) # returns 100 studies
with_trait <- list_studies(trait="EFO_0001360")

List traits

Description

List traits

Usage

list_traits(start = NULL, size = NULL)

Arguments

start

First record to retrieve (starting at 0)

size

Maximum number of results to retrieve

Value

Vector of trait IDs

See Also

list_studies(), list_chr()

Examples

first20 <- list_traits() # first 20 traits
next20 <- list_traits(start=20) # the next 20 traits
first100 <- list_traits(size=100) # returns 100 traits