harmonise.Rd
Harmonise effects across two GWAS datasets. The gwas
objects are expected to be in standard format - see standardise_gwas()
.
Corrects strand for non-palindromic SNPs (flip BETAs). Drop palindromic variants. Drop non-matching variant alleles.
This function is based on the same function in the Slopehunter
and TwoSampleMR packages. I have re-written it here to use
the standardised column names and use pure data.table syntax for increased processing speed.
harmonise(
gwas1,
gwas2,
gwas1_trait = "incidence",
gwas2_trait = "progression",
merge = NULL
)
a data.frame like object or file path, GWAS 1
a data.frame like object or file path, GWAS 2
a string, suffix to add to gwas1 column names e.g. progression –> columns chr_progression, bp_progression, ..., etc.
a string, suffix to add to gwas2 column names e.g. progression –> columns chr_progression, bp_progression, ..., etc.
a named character vector c(gwas1_col=gwas2_col) of the columns to join on; e.g. c("CHR1"="CHR2","BP1"="BP2"); can be NULL, in which case the gwases must be data.tables and already have keys set
a data.table, the harmonised dataset
Slopehunter https://github.com/Osmahmoud/SlopeHunter
TwoSampleMR https://github.com/MRCIEU/TwoSampleMR