Skip to contents

Assemble a single row's payload for QtlFineMappingResult / GwasFineMappingResult: the variants, the stored fit and the per-variant topLoci table. Pass a list of these as the collections' entry argument.

The alignment between variantIds and topLoci is checked here, once, at the boundary where the two are still separate – topLoci's columns are taken positionally, so a table listing the same variants in a different order would silently mis-assign every one. Past this point they are a single GRanges and cannot disagree.

Usage

fineMappingRow(variantIds, susieFit, topLoci, cvResult = NULL)

Arguments

variantIds

Character vector of variant ids. Each must encode coordinates (chrom:pos:ref:alt): an id renders a range and alleles, so one without coordinates has no variant identity to store.

susieFit

The stored fine-mapping fit, or NULL.

topLoci

A per-variant table aligned row-for-row with variantIds.

cvResult

Optional cross-validation payload.

Value

A FineMappingRow.

See also

Examples

tl <- data.frame(
    variant_id = c("chr1:100:A:G", "chr1:200:C:T"),
    pip = c(0.9, 0.1)
)
row <- fineMappingRow(tl$variant_id, susieFit = list(), topLoci = tl)
QtlFineMappingResult(
    study = "s1", context = "c1", trait = "g1", method = "susie",
    entry = list(row)
)
#> QtlFineMappingResult: 1 entries
#>   1 studies, 1 contexts, 1 traits, 1 methods
#>   LD sketch: NULL (individual-level fit)