Skip to contents

Reads the per-chromosome PLINK `.frq` files for the reference panel and stacks them into a single data.frame of CHR, SNP, MAF. Feeds the frq slot of SldscData.

Usage

readSldscFrq(frqfileDir, plinkName = "ADSP_chr")

Arguments

frqfileDir

Character. Directory of `.frq` files.

plinkName

Character. Filename prefix (files at `<plinkName><chr>.frq`). Falls back to all `*.frq` in the directory when the prefix matches nothing.

Value

A data.frame: CHR, SNP, MAF.

Examples

sldsc <- system.file("extdata", "sldsc", package = "pecotmr")
head(readSldscFrq(sldsc, plinkName = "reference."))
#> # A tibble: 6 × 3
#>     CHR SNP           MAF
#>   <dbl> <chr>       <dbl>
#> 1     2 rs10865542 0.166 
#> 2     2 rs13015040 0.396 
#> 3     2 rs719876   0.337 
#> 4     2 rs934558   0.0184
#> 5     2 rs1619241  0.0194
#> 6     2 rs6750358  0.263