Auto-detects the source type (PLINK2, PLINK1, VCF, GDS, or pre-computed LD metadata) and returns variant metadata. For PLINK2, opens only the .pvar file. For PLINK1, reads only the .bim file. For VCF and GDS, loads the full file and extracts variant info.
Value
A data.frame with columns: chrom, id, pos, A2, A1. May also include allele_freq, variance, n_nomiss depending on source.
Examples
meta <- system.file("extdata", "ld_reference", "ld_meta_file.tsv",
package = "pecotmr")
getRefVariantInfo(meta, region = "chr22:10000000-19000000")
#> # A tibble: 175 × 6
#> chrom id pos A2 A1 allele_freq
#> <chr> <chr> <int> <chr> <chr> <dbl>
#> 1 22 chr22:10685239:C:T 10685239 C T 0.509
#> 2 22 chr22:10761227:G:A 10761227 G A 0.498
#> 3 22 chr22:11285239:C:T 11285239 C T 0.527
#> 4 22 chr22:11601805:G:A 11601805 G A 0.464
#> 5 22 chr22:11791698:G:T 11791698 G T 0.459
#> 6 22 chr22:11797697:C:T 11797697 C T 0.462
#> 7 22 chr22:12044872:A:C 12044872 A C 0.482
#> 8 22 chr22:12194389:G:A 12194389 G A 0.502
#> 9 22 chr22:12207043:C:T 12207043 C T 0.524
#> 10 22 chr22:12350816:G:A 12350816 G A 0.500
#> # ℹ 165 more rows