Skip to content

Quickstart

To install the latest release from R-multiverse:

Sys.setenv(NOT_CRAN = "true");
install.packages("bedrockbio", repos = c("https://community.r-multiverse.org", "https://cloud.r-project.org"));

Load the package (and dplyr for downstream data frame manipulation):

library(bedrockbio)
library(dplyr)

List available datasets:

list_datasets()

Lazily load a dataset:

lf <- load_dataset("ukb_ppp/pqtls")

Inspect the contents before downloading entire dataset into memory:

lf |>
    head() |>
    collect()

Filter rows, select columns, and download into a data frame:

df <- lf |>
    filter(
        ancestry == "EUR", 
        protein == "A0FGR8"
    ) |>
    select(
        chromosome, 
        position, 
        effect_allele, 
        other_allele, 
        beta, 
        neg_log_10_p_value
    ) |>
    collect()