harmonise_data: Harmonise the alleles and effects between the exposure and...

View source: R/harmonize.R

harmonise_dataR Documentation

Harmonise the alleles and effects between the exposure and outcome

Description

In order to perform MR the effect of a SNP on an outcome and exposure must be harmonised to be relative to the same allele.

Usage

harmonise_data(exposure_dat, outcome_dat, action = 2)

Arguments

exposure_dat

Output from read_exposure_data

outcome_dat

Output from extract_outcome_data

action

Level of strictness in dealing with SNPs. 1=Assume all reference alleles are on the positive strand, i.e. do nothing (warning - this is very risky and is not recommended); 2=Try to infer positive strand alleles, using allele frequencies for palindromes; 3=Correct strand for non-palindromic SNPs, and drop all palindromic SNPs from the analysis. If a single value is passed then this action is applied to all outcomes. But multiple values can be supplied as a vector, each element relating to a different outcome.

Details

Expects data in the format generated by read_exposure_data and extract_outcome_data. This means the inputs must be dataframes with the following columns: outcome_dat: - SNP - beta.outcome - se.outcome - effect_allele.outcome - other_allele.outcome - eaf.outcome - outcome

exposure_dat: - SNP - beta.exposure - se.exposure - effect_allele.exposure - other_allele.exposure - eaf.exposure

Value

Data frame with harmonised effects and alleles


jingshuw/GRAPPLE-beta- documentation built on March 29, 2024, 1:26 p.m.