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 × 6
#>    chrom id                 A2    A1    alt_freq obs_ct
#>    <dbl> <chr>              <chr> <chr>    <dbl>  <dbl>
#>  1    22 chr22:10685239:C:T C     T        0.509   2000
#>  2    22 chr22:10761227:G:A G     A        0.498   2000
#>  3    22 chr22:11285239:C:T C     T        0.527   2000
#>  4    22 chr22:11601805:G:A G     A        0.464   2000
#>  5    22 chr22:11791698:G:T G     T        0.459   2000
#>  6    22 chr22:11797697:C:T C     T        0.462   2000
#>  7    22 chr22:12044872:A:C A     C        0.482   2000
#>  8    22 chr22:12194389:G:A G     A        0.502   2000
#>  9    22 chr22:12207043:C:T C     T        0.524   2000
#> 10    22 chr22:12350816:G:A G     A        0.500   2000
#> # ℹ 165 more rows