Skip to contents

Read a PLINK2 allele frequency file (.afreq or .afreq.zst)

Usage

readAfreq(prefix)

Arguments

prefix

File prefix (without .afreq extension).

Value

A data.frame with columns: chrom, id, A2 (REF), A1 (ALT), alt_freq, obs_ct. alt_freq is the frequency of the A1 (ALT/effect) allele.

Examples

stem <- file.path(system.file("extdata", "ld_reference", "chr22",
  package = "pecotmr"), "protocol_example.LD.chr22")
readAfreq(stem)
#> # A tibble: 175 × 8
#>    chrom id                 A2    A1    alt_freq obs_ct u_min u_max
#>    <chr> <chr>              <chr> <chr>    <dbl>  <dbl> <dbl> <dbl>
#>  1 chr22 chr22:10685239:C:T C     T       0.0583    120 -3.21  3.07
#>  2 chr22 chr22:10761227:G:A G     A       0.15      120 -3.01  2.95
#>  3 chr22 chr22:11285239:C:T C     T       0.0833    120 -3.13  2.78
#>  4 chr22 chr22:11601805:G:A G     A       0.0583    120 -2.54  2.87
#>  5 chr22 chr22:11791698:G:T G     T       0.05      120 -2.74  3.27
#>  6 chr22 chr22:11797697:C:T C     T       0.05      120 -2.84  3.45
#>  7 chr22 chr22:12044872:A:C A     C       0.0417    120 -3.10  3.39
#>  8 chr22 chr22:12194389:G:A G     A       0.0583    120 -3.18  3.28
#>  9 chr22 chr22:12207043:C:T C     T       0.0583    120 -3.14  2.83
#> 10 chr22 chr22:12350816:G:A G     A       0.0583    120 -3.38  3.44
#> # ℹ 165 more rows