You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to put your exposure and outcome data into data.frames with the relevant column names. See the example below for the names or there is a little example here.
library(TwoSampleMR)
#> TwoSampleMR version 0.5.6 #> [>] New: Option to use non-European LD reference panels for clumping etc#> [>] Some studies temporarily quarantined to verify effect allele#> [>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further detailsao<- available_outcomes()
#> API: public: http://gwas-api.mrcieu.ac.uk/#> API: public: http://gwas-api.mrcieu.ac.uk/bmi_exp_dat<- extract_instruments(outcomes='ieu-a-2')
chd_out_dat<- extract_outcome_data(snps=bmi_exp_dat$SNP, outcomes='ieu-a-7')
#> Extracting data for 79 SNP(s) from 1 GWAS(s)#> Extracting data for 79 SNP(s) from 1 GWAS(s)
class(bmi_exp_dat)
#> [1] "data.frame"
names(bmi_exp_dat)
#> [1] "pval.exposure" "samplesize.exposure" "chr.exposure" #> [4] "se.exposure" "beta.exposure" "pos.exposure" #> [7] "id.exposure" "SNP" "effect_allele.exposure"#> [10] "other_allele.exposure" "eaf.exposure" "exposure" #> [13] "mr_keep.exposure" "pval_origin.exposure" "data_source.exposure"
class(chd_out_dat)
#> [1] "data.frame"
names(chd_out_dat)
#> [1] "SNP" "chr" "pos" #> [4] "beta.outcome" "se.outcome" "samplesize.outcome" #> [7] "pval.outcome" "eaf.outcome" "effect_allele.outcome"#> [10] "other_allele.outcome" "outcome" "id.outcome" #> [13] "originalname.outcome" "outcome.deprecated" "mr_keep.outcome" #> [16] "data_source.outcome"
Suppose you have your own exposure GWAS and your own outcome GWAS, how can you do a 2 sample MR?
The text was updated successfully, but these errors were encountered: