This mimics the TwoSampleMR::make_dat function, which automatically looks up exposure and outcome datasets and harmonises them, except this function uses GWAS-VCF datasets instead. The supporting reference datasets can be accessed by UoB users on BC4 using set_bc4_files()

make_TwoSampleMR_dat(
  id1,
  id2,
  proxies = TRUE,
  nthreads = 1,
  vcfdir = options()$gwasglue.vcfdir,
  proxydb = options()$gwasglue.proxydb,
  rsidx = options()$gwasglue.rsidx,
  bfile = options()$gwasglue.bfile,
  action = 1,
  plink_bin = genetics.binaRies::get_plink_binary()
)

Arguments

id1

Exposure datasets. Either an array of vcf files, or array of IDs if vcfdir is set

id2

Outcome datasets. Either an array of vcf files, or array of IDs if vcfdir is set

proxies

Lookup proxies? default=TRUE but requires either bfile or proxydb to be set

nthreads

Parellelise default=1

vcfdir

Location of vcf files if id1 and id2 are just IDs. Defaults to options()$gwasglue.vcfdir

proxydb

Location of LD proxy database Default=options()$gwasglue.proxydb

rsidx

Location of rsidx index database Default=options()$gwasglue.rsidx

bfile

Location of LD reference panel Default=options()$gwasglue.bfile

Value

harmonised dataset