Contents
generate
Generate environment
generate is the entry point for building or importing polygenic score
models. It holds:
- generate$sources
$...(): declare the GWAS summary statistics to fit from - generate$algorithms
$...(): declare the PRS method to fit with generate$models(): cross-join sources with algorithms and execute themgenerate$from.pgs.catalog(): import published models from the PGS Cataloggenerate$from.pgs.file(): read models from local PGS scoring files
Usage
generateDetails
A typical generate workflow declares sources and algorithms separately, then crosses them:
models <- generate$models(
sources = generate$sources$opengwas("ieu-b-2"),
algorithms = c(
generate$algorithms$ClumpingThresholding(
pval = c(5e-8, 1e-5), reference.panel = "EUR"
),
generate$algorithms$LDpred2(
reference.panel = "EUR", variant.space = "HapMap3+"
)
)
)
Published models bypass fitting entirely:
models <- generate$from.pgs.catalog("PGS002280")
models <- generate$from.pgs.file("scores/")