harmonise_data | R Documentation |
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.
harmonise_data(exposure_dat, outcome_dat, action = 2)
exposure_dat |
Output from |
outcome_dat |
Output from |
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. |
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
Data frame with harmonised effects and alleles
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.