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.
|
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
The function tries to harmonise INDELs. If they are coded as sequence strings things work more smoothly. If they are coded as D/I in one dataset it will try to convert them to sequences if the other dataset has adequate information. If coded as D/I in one dataset and as a variant with equal length INDEL alleles in the other, the variant is dropped. If one or both the datasets only has one allele (i.e. the effect allele) then harmonisation is naturally going to be more ambiguous and more variants will be dropped.
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.