TwoSampleMR包的MVMR分析

library(TwoSampleMR)
exposure_dat = mv_extract_exposures_local(
  filenames_exposure=c('PSY_factor.txt',"Alanine_aminotransferase.vcf",'HDL.vcf','HbA1c.vcf'),
  sep = c("\t",'\t','\t','\t'),
  phenotype_col = "Phenotype",
  snp_col = "SNP",
  beta_col = "BETA",
  se_col = "SE",
  effect_allele_col = "A1",
  other_allele_col = "A2",
  pval_col = "P",
  samplesize_col = "N",
  min_pval = 1e-200,
  log_pval = FALSE,
  pval_threshold = 5e-08,
  plink_bin = 'C:/Users/DELL/Documents/R/win-library/4.1/plinkbinr/bin/plink_Windows.exe',
  bfile = "H:\\Puberty_SEM\\MR_GWAS\\EUR\\EUR",
  clump_r2 = 0.001,
  clump_kb = 10000,
  pop = "EUR",
  harmonise_strictness = 2
)
outcome_dat <- read_outcome_data(
  snps = exposure_dat$SNP,
  filename = 'mvAge.txt',
  sep = "\t",
  snp_col = "SNP",
  beta_col = "BETA",
  se_col = "SE",
  effect_allele_col = "A1",
  other_allele_col = "A2",
  pval_col = "P",
  samplesize_col = "N"
)
mvdat <- mv_harmonise_data(exposure_dat, outcome_dat)
res <- mv_multiple(mvdat)
mv_res = res[['result']]
write.table(mv_res,file = 'Puberty-aging-mv_res.txt',row.names = F,sep = '\t',quote = F)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值