PolyGenius
Contents

RunLdPred2Rule

LDpred2 model rule

RunLdPred2Rule resolves LDpred2 polygenius.model outputs.

Details

Reactive rule for model outputs generated by algorithm LDpred2.

The rule requests GWAS input at required pval.max, binds an ld.bigsnpr storage resource for the matched panel/build, matches GWAS variants to that storage in-process, and then runs LDpred2 in auto, grid, or inf mode. inf and auto produce one final model. grid produces one dynamic model output per grid row because PolyGenius does not receive validation data and should not choose one grid column internally.

User-facing LD construction controls map onto ld.bigsnpr storage fields:

  • ld.size -> window
  • ld.thr -> threshold

These controls affect how the upstream bigsnpr LD storage is built. They are separate from native LDpred2 fitting arguments. Native fitting arguments are forwarded by name to the selected bigsnpr mode when supported by the installed bigsnpr version. Missing arguments use the private mode defaults; required values such as h2 or h2_init are estimated when not supplied.

Super class

PolyGenius::Rule -> RunLdPred2Rule

Methods

Public methods

  • RunLdPred2Rule$new()
  • RunLdPred2Rule$matches()
  • RunLdPred2Rule$inputs()
  • RunLdPred2Rule$bind()
  • RunLdPred2Rule$requirements()
  • RunLdPred2Rule$run()
  • RunLdPred2Rule$clone()

Method new()

Create the LDpred2 rule.

Usage

RunLdPred2Rule$new()

Method matches()

Check whether this rule can produce the requested output.

Usage

RunLdPred2Rule$matches(output.spec)

Arguments

output.spec — Output resource specification.

Returns

TRUE for LDpred2 model outputs.

Method inputs()

Build input specifications for this output.

Usage

RunLdPred2Rule$inputs(output.spec)

Arguments

output.spec — Output resource specification.

Returns

Named list with gwas and deferred ld input.

Method bind()

Bind LD storage input after GWAS build is known.

Usage

RunLdPred2Rule$bind(inputs, store, output.spec = NULL)

Arguments

inputs — Named list of input specifications.

store — Resource store.

output.spec — Output resource specification.

Returns

Updated named list of inputs.

Method requirements()

Declare resource requirements for this rule.

Usage

RunLdPred2Rule$requirements(output.spec, inputs)

Arguments

output.spec — Output resource specification.

inputs — Bound input values/specifications.

Returns

Named list with cores and memory.

Method run()

Execute LDpred2 model construction.

Usage

RunLdPred2Rule$run(output.spec, inputs, logger = pg.logger())

Arguments

output.spec — Output resource specification.

inputs — Named list of bound input values.

logger — Rule logger.

Returns

Rule result list with data, meta, and logs.

Method clone()

The objects of this class are cloneable with this method.

Usage

RunLdPred2Rule$clone(deep = FALSE)

Arguments

deep — Whether to make a deep clone.

See Also