This function takes exposure and outcome data as produced by format_data()
and used to perform
MR analysis against a list of outcomes; in the latter case it can be data from MR-Base, e.g.,
outcome <- extract_outcome_data(snps=with(exposure,SNP),outcomes=c("ieu-a-7","ebi-a-GCST007432"))
.
Details
Adapted from zheng20;textualpQTLtools, this function is analogous to run_TwoSampleMR()
.
Examples
fi <- file.path(find.package("pQTLtools",lib.loc=.libPaths()),"tests","Ins.csv")
exposure <- TwoSampleMR::format_data(read.csv(fi),type="exposure")
fo <- file.path(find.package("pQTLtools",lib.loc=.libPaths()),"tests","Out.csv")
outcome <- TwoSampleMR::format_data(read.csv(fo),type="outcome")
#> Warning: The following columns are not present but are helpful for harmonisation
#> eaf
pQTLtools::pqtlMR(exposure, outcome, prefix="IL6R-")
#> Harmonising IL.6 (O9YIMd) and Rheumatoid arthritis (4WZ5NH)
#> Harmonising IL.6 (O9YIMd) and Coronary artery disease (aL6STL)
#> Harmonising IL.6 (O9YIMd) and Atopic dermatitis (cG94vA)
#> Analysing 'O9YIMd' on '4WZ5NH'
#> Analysing 'O9YIMd' on 'aL6STL'
#> Analysing 'O9YIMd' on 'cG94vA'
pQTLtools::pqtlMR(exposure, outcome, prefix="IL6R_rev-",reverse=TRUE)
#> Harmonising IL.6 (O9YIMd) and Rheumatoid arthritis (4WZ5NH)
#> Harmonising IL.6 (O9YIMd) and Coronary artery disease (aL6STL)
#> Harmonising IL.6 (O9YIMd) and Atopic dermatitis (cG94vA)
#> Analysing '4WZ5NH' on 'O9YIMd'
#> Analysing 'aL6STL' on 'O9YIMd'
#> Analysing 'cG94vA' on 'O9YIMd'
unlink(c("IL6R*","pQTL-combined*"))
# Phenotype,SNP,effect_allele,other_allele,eaf,beta,se,pval
# ABO,rs505922,C,T,0.313,1.298,0.014,1.2e-1828
# LIFR,rs635634,T,C,0.180,-0.300,0.032,6.00E-21
# f <- file.path(find.package("pQTLtools",lib.loc=.libPaths()),"tests","ms.ins")
# exposure <- format_data(read.table(f, header=TRUE), samplesize_col="N")
# SNP Phenotype effect_allele other_allele eaf beta se pval N
# rs1800693 TNFB T C 0.6033 0.0282 0.0136 0.0389045 11787
# rs2364485 TNFB A C 0.1645 6514963 0.1759 1.62181e-20 11344
# https://raw.githubusercontent.com/MRCIEU/epigraphdb-pqtl/master/scripts/MR-pQTL-script.R