Skip to contents

Extract the per-variant posterior fine-mapping payload as either a data.frame (default) or a GRanges. Returns identity columns (variant_id, chrom, pos, A1, A2), context (N, MAF), the posterior effect columns (beta = posterior_mean, se = posterior_sd), pip, and credible-set membership columns (cs_95, etc.). Rows are filtered by PIP by default – set signalCutoff = 0 to return every variant.

Usage

getTopLoci(x, type = c("data.frame", "GRanges"), signalCutoff = 0.025, ...)

# S4 method for class 'FineMappingResultBase'
getTopLoci(
  x,
  type = c("data.frame", "GRanges"),
  signalCutoff = 0.025,
  study = NULL,
  context = NULL,
  trait = NULL,
  method = NULL,
  region = NULL,
  minPurity = NULL,
  ...
)

Arguments

x

A FineMappingRow or FineMappingResult.

type

One of "data.frame" (default) or "GRanges".

signalCutoff

Numeric (length 1). Drop rows where pip <= signalCutoff. Default 0.025. Use signalCutoff = 0 to keep every variant.

...

Class-specific selection arguments.

study

Character (length 1) or NULL. Restrict the selection to this study; NULL matches all studies.

context

Character (length 1) or NULL. Restrict the selection to this context; NULL matches all contexts.

trait

Character (length 1) or NULL. Restrict the selection to this trait; NULL matches all traits.

method

Character (length 1) or NULL. Restrict the selection to this fine-mapping / weight method; NULL matches all methods.

region

Character (length 1, "chr:start-end") or NULL. Restrict variants to this region; NULL uses the full cis window / all regions.

minPurity

Numeric or NULL. Minimum credible-set purity to retain; NULL applies no purity filter.

Value

A data.frame or a GRanges.

Examples

data(qtlFineMappingExample)
getTopLoci(qtlFineMappingExample)
#> # A tibble: 15 × 27
#>    study  context trait blockId method variant_id chrom    pos A1    A2        N
#>    <chr>  <chr>   <chr> <chr>   <chr>  <chr>      <chr>  <int> <chr> <chr> <dbl>
#>  1 study… contex… gene… NA      susie  chr22:325… chr22 3.26e7 C     T       415
#>  2 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     T       415
#>  3 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 A     C       415
#>  4 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 A     G       415
#>  5 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     T       415
#>  6 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 A     G       415
#>  7 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 G     A       415
#>  8 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 T     C       415
#>  9 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 G     A       415
#> 10 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     T       415
#> 11 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     A       415
#> 12 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     T       415
#> 13 study… contex… gene… NA      susie  chr22:327… chr22 3.27e7 C     T       415
#> 14 study… contex… gene… NA      susie  chr22:327… chr22 3.28e7 G     A       415
#> 15 study… contex… gene… NA      susie  chr22:327… chr22 3.28e7 T     C       415
#> # ℹ 16 more variables: af <dbl>, beta <dbl>, se <dbl>, pip <dbl>, logBF <dbl>,
#> #   cs_95 <chr>, cs_70 <chr>, cs_50 <chr>, cs_95_purity <dbl>,
#> #   cs_70_purity <dbl>, cs_50_purity <dbl>, within_cs_pip <dbl>, gene <chr>,
#> #   event <chr>, grange_start <int>, grange_end <int>