Skip to contents

Construct a GwasFineMappingResult collection from per-(study, method) tuples and a list of FineMappingRow payloads. The collection can represent either a single LD block (one row per (study, method)) or a genome-wide sweep across blocks (multiple rows per (study, method), each covering its own genomic range).

Rows are identified by (study, method) plus the element's own range, which is derived from the variants rather than stored, so it cannot drift out of step with them and stays correct after subsetRegion.

Usage

GwasFineMappingResult(
  studyName,
  method,
  entry,
  blockId = NULL,
  traitPos = NULL,
  region = NULL,
  dataType = NULL,
  dataSource = NULL,
  weightStandardized = NULL,
  ldReference = NULL
)

Arguments

studyName

Character vector of study identifiers (per tuple).

method

Character vector of fine-mapping method names (per tuple).

entry

List / SimpleList of FineMappingRow objects.

blockId

Optional character vector (per tuple) keying the external LD block manifest, e.g. "chr22_10516173_17414263". Provenance only, not part of the identity key. Supply it when the block BOUNDARIES matter: those are the one thing not recoverable from the variants, since adjacent blocks' spans leave gaps.

traitPos

Optional per-row trait genomic anchor (a GRanges or NULL), carried forward as provenance; not part of the identity key. NULL (default) omits the column.

region

Optional per-row analysis WINDOW (a GRanges or NULL) – the interval each row's fit was run over, carried forward as provenance; not part of the identity key. NULL (default) omits the column, and genomicRegion then derives the window from the span of the variants present.

dataType

Optional assay / modality label ("bulk_rnaseq", "methylation"), recorded as a per-row provenance column. Length 1 or one per row; NULL (default) omits the column.

dataSource

Optional per-row label for the kind of input the fit saw, "individual" or "sumstat". Recorded rather than derived: a combined collection can hold rows of both kinds, and its single ldReference cannot say which row came from which.

weightStandardized

Optional per-row flag: whether the posterior effect is on the STANDARDIZED genotype scale. The posterior effect IS the prediction weight, so it carries the same scale question as a TWAS weight. fineMappingPipeline always passes TRUE: it standardizes genotypes before fitting, and the posterior mean is reported on the scale of the X the fit was given. The argument exists for a collection assembled by hand, where only the caller knows.

ldReference

An optional genotype panel (see readGenotypes).

Value

A GwasFineMappingResult object.

Examples

tl <- data.frame(variant_id = paste0("chr1:", 100 * 1:3, ":A:G"),
  pip = c(0.9, 0.5, 0.1), cs = c(1L, 1L, NA))
fe <- fineMappingRow(
  variantIds = tl$variant_id, susieFit = list(), topLoci = tl)
GwasFineMappingResult(studyName = "t1", method = "susie", entry = list(fe))
#> GwasFineMappingResult: 1 entries
#>   1 studies, 1 methods
#>   LD reference: NULL