R/harmonization.R
match_gwas_bigsnp.Rd
Match alleles between summary statistics and SNP information in the
bigSNP reference panel using the bigsnpr::snp_match()
function.
Match by ("chr", "a0", "a1") and ("pos" or "rsid"),
accounting for possible strand flips and reverse reference alleles (opposite effects).
match_gwas_bigsnp(
sumstats,
bigSNP,
strand_flip = TRUE,
match.min.prop = 0.1,
...
)
A data frame of GWAS summary statistics, with columns "chr", "pos", "a0", "a1" and "beta".
a bigsnpr
object attached via bigsnpr::snp_attach()
containing the reference genotype panel.
Whether to try to flip strand? (default is TRUE). If so, ambiguous alleles A/T and C/G are removed.
Minimum proportion of variants in the smallest data to be matched, otherwise stops with an error. Default: 10%
A data frame with matched summary statistics. Values in column "beta" are multiplied by -1 for variants with alleles reversed (i.e. swapped). New variable "ss_index" returns the corresponding row indices of the sumstats, and "bigSNP_index" corresponding to the indices of the bigSNP.