Matches variants in sumstats against info_snp by rsid, effect allele
(a1), and other allele (a0). Optionally removes ambiguous SNPs
(A/T and C/G), performs strand flipping, and reverses allele coding.
Usage
snp_match_munge(
sumstats,
info_snp,
strand_flip = TRUE,
join_by_pos = TRUE,
remove_dups = TRUE,
match.min.prop = 0.2,
return_flip_and_rev = FALSE
)Arguments
- sumstats
A data frame of GWAS summary statistics. Must contain columns
rsid,a0,a1, andbeta.- info_snp
A data frame of reference SNPs. Must contain columns
rsid,a0, anda1.- strand_flip
Logical; if
TRUE(default), remove ambiguous SNPs (A/T, C/G) and attempt strand flipping.- join_by_pos
Logical; if
TRUE, also join by position. DefaultTRUE.- remove_dups
Logical; if
TRUE(default), remove duplicate rsid entries after matching.- match.min.prop
Minimum proportion of variants that must match. Default
0.2. An error is raised if fewer variants match.- return_flip_and_rev
Logical; if
TRUE, retain the_FLIP_and_REV_indicator columns in the output. DefaultFALSE.