想请教各位,孟德尔随机化研究(MR)是不是用本地clump和在线clump做出来的数据是有差别的呀?我做出来以后,在线clump数据要多一些
# 加载所需的库
library(MendelianRandomization)
library(tidyverse)
# 设置参数
gene_name <- "ENSG00000141510" # 目标基因名称
p_threshold <- 5e-8 # GWAS SNP筛选的阈值
ld_threshold <- 0.001 # SNP之间的LD筛选阈值
# 从一个已有的GWAS数据集中筛选与目标基因有关的SNP,进行本地clump分析
gwas_data <- read.table("gwas_data.txt", header = TRUE)
local_snps <- mr_clump(gwas_data, gene_name, p_threshold = p_threshold, ld_threshold = ld_threshold)
# 从在线库中筛选与目标基因有关的SNP,进行在线clump分析
online_snps <- mr_data(query = gene_name, pvalue = p_threshold, ld_threshold = ld_threshold, cis = TRUE)
# 进行MR分析
mr_results_local <- mr_rg(local_snps, outcome_data, exposure_data)
mr_results_online <- mr_rg(online_snps, outcome_data, exposure_data)
# 输出结果
print(paste("本地clump MR结果:", mr_results_local$est, "(", mr_results_local$se, ")"))
print(paste("在线clump MR结果:", mr_results_online$est, "(", mr_results_online$se, ")"))
请问您解决了吗?我也出现了这个问题