PolyGenius
Contents

generate$algorithms$lassosum2

lassosum2 algorithm specification

Declares a lassosum2 algorithm for generate$models(). Fitting is delegated to bigsnpr and happens during execution, not here.

Usage

generate$algorithms$lassosum2(
  reference.panel,
  variant.space = NULL,
  pval = 1,
  ld.size = 3000,
  ld.thr = 0.002,
  ncores = 1,
  ...
)

Arguments

ArgumentDescription
reference.panelCharacter scalar. Reference panel LD is built from, named as in workspace$catalogs$referencePanels$view().
variant.spaceCharacter scalar or NULL (default). Variant space narrowing reference.panel: PolyGenius derives a restricted panel from the two and builds LD from that. Either the display name shown by workspace$catalogs$variantSpaces$view() or the catalog key selects the same space and the same cached panel; an unknown name, or a reference.panel that is already restricted, aborts.
pvalNumeric scalar in [0, 1], default 1. GWAS p-value filter applied before fitting. A vector aborts.
ld.sizeInteger scalar, default 3000. LD-construction control, passed to bigsnpr LD storage as window.
ld.thrNumeric scalar, default 0.002. LD-construction control, passed to bigsnpr LD storage as threshold.
ncoresInteger scalar, default 1. Worker cores requested for this algorithm. A runtime hint that does not enter model cache identity; a value above the workspace core budget aborts generate$models() before anything is scheduled.
...Native bigsnpr::snp_lassosum2() arguments, such as delta or nlambda. Forwarded only when the installed bigsnpr version declares them.

Value

A ResourceSpecSet holding one unresolved generate-algorithm specification, for generate$models(algorithms = ). During execution that one specification expands into one model per candidate lambda/delta pair.

Details

The rule consumes the same ld.bigsnpr storage as LDpred2. Native bigsnpr::snp_lassosum2() arguments given through ... are forwarded only when the installed bigsnpr version declares them; the rest are dropped. Arguments left unsupplied keep PolyGenius' defaults, which mirror bigsnpr's.

lassosum2 returns a grid of candidate effect vectors, one model each. This declaration receives no validation genotypes or outcomes, so choosing among those candidates is a downstream step, for example evaluate$performance() on a validation study.

Parameter guidance: https://privefl.github.io/bigsnpr/reference/snp_lassosum2.html and https://privefl.github.io/bigsnpr-extdoc/polygenic-scores-pgs.html.

Rules behind this algorithm

BuildLDBigsnprRule materializes the ld.bigsnpr correlation storage from the reference panel, then RunLassosum2Rule fits against it. LDpred2 and lassosum2 share that storage, so requesting both builds it once.

Prerequisites, resolved and cached on demand: a bfile reference panel and the bigsnpr package family (SetupBigsnprRule).

Examples

models <- generate$models(
  sources    = generate$sources$opengwas("ieu-b-2"),
  algorithms = generate$algorithms$lassosum2(reference.panel = "EUR")
)

See Also

Aliases: generate-lassosum2, generate.algorithm.lassosum2, generate$algorithms$lassosum2