PolyGenius
Contents

BuildLDBigsnprRule

Build bigsnpr LD storage rule

Reactive rule that materializes an ld.bigsnpr resource directly from a tidy reference.panel input using bigsnpr-native matrix operations.

Details

This rule is the first-class producer for the bigsnpr-family LD storage used by LDpred2 and lassosum2. It converts the reference panel to a bigSNP object and computes LD with bigsnpr::snp_cor() chromosome-by-chromosome, avoiding the retired PLINK .vcor edge-table path entirely.

Before LD is computed, variants are filtered by minor allele frequency in the reference panel used to estimate LD. The threshold follows the LDpred2 tutorial convention, MAF > 1 / sqrt(n_reference_samples), to avoid unstable or undefined correlations for monomorphic and very rare variants in the LD reference sample.

Super class

PolyGenius::Rule -> BuildLDBigsnprRule

Methods

Public methods

  • BuildLDBigsnprRule$new()
  • BuildLDBigsnprRule$matches()
  • BuildLDBigsnprRule$inputs()
  • BuildLDBigsnprRule$requirements()
  • BuildLDBigsnprRule$run()
  • BuildLDBigsnprRule$clone()

Method new()

Create the bigsnpr LD storage rule.

Usage

BuildLDBigsnprRule$new()

Method matches()

Check whether this rule can produce the requested output.

Usage

BuildLDBigsnprRule$matches(output.spec)

Arguments

output.spec — Output resource specification.

Returns

TRUE for ld.bigsnpr outputs.

Method inputs()

Build required reference-panel input.

Usage

BuildLDBigsnprRule$inputs(output.spec)

Arguments

output.spec — Output resource specification.

Returns

Named list with the required reference.panel input.

Method requirements()

Declare resource requirements for this rule.

Usage

BuildLDBigsnprRule$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 bigsnpr LD materialization.

Usage

BuildLDBigsnprRule$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.

Method clone()

The objects of this class are cloneable with this method.

Usage

BuildLDBigsnprRule$clone(deep = FALSE)

Arguments

deep — Whether to make a deep clone.

See Also