funnel_plot
setwd("D:/MR/endometriosis/prot-a-2665_ENDOMETRIOSIS_PELVICPERITONEUM")
write.csv(exp,'prot-a-2665_5e-06_exp.csv')
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM',
proxies=TRUE)#提取结局数据
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
results<-mr(dat)
results
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_out.csv')
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_datF.csv')
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_pleio.csv')
library(ggsci)
library(ggplot2)
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Endometriosis of pelvic peritoneum"
scatter_plot
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
##13.漏斗图------
funnel_plot<-mr_funnel_plot(mr_singlesnp(dat,all_method=c("mr_egger_regression","mr_weighted_median","mr_ivw","mr_simple_mode","mr_weighted_mode")))[[1]]+
theme_bw()+
scale_color_lancet()+
scale_fill_lancet()
# 更改漏斗图点的颜色
funnel_plot[["layers"]][[1]][["aes_params"]]$colour <- "black"
# 更改点的透明度
funnel_plot[["layers"]][[1]][["aes_params"]]$alpha<-0.5
funnel_plot
setwd("D:/MR/endometriosis/prot-a-2665_finn-b-N14_ENDOMETRIOSIS_RECTPVAGSEPT_VAGINA")
write.csv(exp,'prot-a-2665_5e-06_exp.csv')
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_RECTPVAGSEPT_VAGINA',
proxies=TRUE)#提取结局数据
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
##5.MR分析------
#查看TwoSample内置的MR方法
mr_method_list()
results<-mr(dat)
results
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
##1.提取暴露[exp]数据------r2 = 0.01,kb = 1000
exp <- extract_instruments(outcomes = 'prot-a-2665',p1 = 5e-05,
clump = TRUE,r2 = 0.001,kb = 10000,
access_token = NULL)#提取暴露数据
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_RECTPVAGSEPT_VAGINA',
proxies=TRUE)#提取结局数据
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
results<-mr(dat)
results
##1.提取暴露[exp]数据------r2 = 0.01,kb = 1000
exp <- extract_instruments(outcomes = 'prot-a-2665',p1 = 5e-06,
clump = TRUE,r2 = 0.001,kb = 10000,
access_token = NULL)#提取暴露数据
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_RECTPVAGSEPT_VAGINA',
proxies=TRUE)#提取结局数据
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
results<-mr(dat)
results
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_dat.csv')
dat <- read.csv('prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
results<-mr(dat)
results
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_RECTPVAGSEPT_VAGINA_out.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_datF.csv')
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
write.csv(heterogeneity,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_heterogeneity.csv')
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_PELVICPERITONEUM_pleio.csv')
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Endometriosis of rectovaginal septum and vagina"
scatter_plot
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
##13.漏斗图------
funnel_plot<-mr_funnel_plot(mr_singlesnp(dat,all_method=c("mr_egger_regression","mr_weighted_median","mr_ivw","mr_simple_mode","mr_weighted_mode")))[[1]]+
theme_bw()+
scale_color_lancet()+
scale_fill_lancet()
# 更改漏斗图点的颜色
funnel_plot[["layers"]][[1]][["aes_params"]]$colour <- "black"
# 更改点的透明度
funnel_plot[["layers"]][[1]][["aes_params"]]$alpha<-0.5
funnel_plot
setwd("D:/MR/endometriosis/prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE")
write.csv(exp,'prot-a-2665_5e-06_exp.csv')
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_INTESTINE',
proxies=TRUE)#提取结局数据
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_INTESTINE_out.csv')
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_dat.csv')
results<-mr(dat)
results
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
dat <- read.csv('prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_dat.csv')
results<-mr(dat)
results
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_finn-b-N14_ENDOMETRIOSIS_INTESTINE_datF.csv')
results<-mr(dat)
results
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
write.csv(heterogeneity,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE.csv')
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_pleio.csv')
##1.提取暴露[exp]数据------r2 = 0.01,kb = 1000
exp <- extract_instruments(outcomes = 'prot-a-2665',p1 = 5e-05,
clump = TRUE,r2 = 0.001,kb = 10000,
access_token = NULL)#提取暴露数据
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_INTESTINE',
proxies=TRUE)#提取结局数据
write.csv(exp,'prot-a-2665_5e-05_exp.csv')
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_INTESTINE_out.csv')
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 3)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_finn-b-N14_ENDOMETRIOSIS_INTESTINE_datF.csv')
results<-mr(dat)
results
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
write.csv(heterogeneity,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE.csv')
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_pleio.csv')
##1.提取暴露[exp]数据------r2 = 0.01,kb = 1000
exp <- extract_instruments(outcomes = 'prot-a-2665',p1 = 5e-06,
clump = TRUE,r2 = 0.001,kb = 10000,
access_token = NULL)#提取暴露数据
write.csv(exp,'prot-a-2665_5e-06_exp.csv')
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_INTESTINE',
proxies=TRUE)#提取结局数据
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_INTESTINE_out.csv')
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_finn-b-N14_ENDOMETRIOSIS_INTESTINE_datF.csv')
results<-mr(dat)
results
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
write.csv(heterogeneity,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE.csv')
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_INTESTINE_pleio.csv')
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Endometriosis of intestine"
scatter_plot
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
##13.漏斗图------
funnel_plot<-mr_funnel_plot(mr_singlesnp(dat,all_method=c("mr_egger_regression","mr_weighted_median","mr_ivw","mr_simple_mode","mr_weighted_mode")))[[1]]+
theme_bw()+
scale_color_lancet()+
scale_fill_lancet()
# 更改漏斗图点的颜色
funnel_plot[["layers"]][[1]][["aes_params"]]$colour <- "black"
# 更改点的透明度
funnel_plot[["layers"]][[1]][["aes_params"]]$alpha<-0.5
funnel_plot
##2.提取结局[out]数据------
out<-extract_outcome_data(snps = exp$SNP,
outcomes = 'finn-b-N14_ENDOMETRIOSIS_NOS',
proxies=TRUE)#提取结局数据
##3.等位基因对齐 + 去除回文序列------
####action = 2，意味着剔除中等等位基因频率的回文序列
####action = 3，意味着剔除所有的回文序列
dat<-harmonise_data(exp,out,action = 2)
head(dat)
dat<-dat[dat$mr_keep,]##删除不用于MR分析的SNp
results<-mr(dat)
results
setwd("D:/MR/endometriosis/prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS")
write.csv(exp,'prot-a-2665_5e-06_exp.csv')
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_INTESTINE_out.csv')
write.csv(out,'finn-b-N14_ENDOMETRIOSIS_NOS_out.csv')
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS_dat.csv')
##如上数据缺失算不出F值后，使用b^2/se^2
dat$`F`<-((dat$beta.exposure)^2)/((dat$se.exposure)^2)
write.csv(dat,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS_datF.csv')
#(OR,95%CI_or,p_value)--二分类变量【1】
#(beta,95%CI_beta,p_value)--连续性变量【0】
##6.二分类变量--OR值------
OR <-generate_odds_ratios(results)
OR
write.csv(OR,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS_OR.csv')
##7.异质性检验------
#异质性分析啦-p>0.05表明没有异质性，p<0.05表明有异质性,有异质性，但是我使用了随机效应模型
heterogeneity <- mr_heterogeneity(dat)
heterogeneity
write.csv(heterogeneity,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS.csv')
##8.水平多效性【MR-Egger截距】---p<0.05有水平多效性，p>0.05没有水平多效性
pleio <- mr_pleiotropy_test(dat)
pleio
write.csv(pleio,'prot-a-2665_finn-b-N14_ENDOMETRIOSIS_NOS_pleio.csv')
##10.留一法+作图------
###逐个剔除每个SNP，计算剩余SNP的效应
single <- mr_leaveoneout(dat)
mr_leaveoneout_plot(single)
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Unspecified/other endometriosis"
scatter_plot
##12.森林图---------
forest_plot<-mr_forest_plot(mr_singlesnp(dat))[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()+
theme(legend.position = 'none')
forest_plot
##13.漏斗图------
funnel_plot<-mr_funnel_plot(mr_singlesnp(dat,all_method=c("mr_egger_regression","mr_weighted_median","mr_ivw","mr_simple_mode","mr_weighted_mode")))[[1]]+
theme_bw()+
scale_color_lancet()+
scale_fill_lancet()
# 更改漏斗图点的颜色
funnel_plot[["layers"]][[1]][["aes_params"]]$colour <- "black"
# 更改点的透明度
funnel_plot[["layers"]][[1]][["aes_params"]]$alpha<-0.5
funnel_plot
setwd("D:/MR/endometriosis/prot-a-2665_finn-b-N14_ENDOMETRIOSIS_FALLOPIAN_TUBE")
dat <- read.csv('prot-a-2665_finn-b-N14_ENDOMETRIOSIS_FALLOPIAN_TUBE_dat.csv')
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Endometriosis of fallopian tube"
scatter_plot
setwd("D:/MR/endometriosis/prot-a-2665_finn-b-N14_ENDOMETRIOSIS_OVARY")
dat <- read.csv('prot-a-2665_finn-b-N14_ENDOMETRIOSIS_OVARY_dat.csv')
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on Endometriosis of ovary"
scatter_plot
setwd("D:/MR/endometriosis/E_selectin_prot-a-2665_met-a-601")
dat <- read.csv('prot-a-2665_met-a-601_dat.csv')
##导出图
##11.散点图------
# 散点图
scatter_plot<-mr_scatter_plot(results,dat)[[1]]+
scale_color_lancet()+
scale_fill_lancet()+
theme_bw()
# 更改散点图的点的颜色
scatter_plot[["layers"]][[3]][["aes_params"]]$colour<-"black"
# 更改散点图的点的透明度
scatter_plot[["layers"]][[3]][["aes_params"]]$alpha<-0.5
# 更改散点图的横坐标名字
scatter_plot[["labels"]][["x"]]<-"SNP effect on E-selectin"
# 更改散点图的纵坐标名字
scatter_plot[["labels"]][["y"]]<-"SNP effect on met-a-601"
scatter_plot
setwd("D:/MR/endometriosis/反向内异症到Eselectin")
dat <- read.csv('endometriosis_prot-a-2665_dat.csv)
setwd("D:/MR/endometriosis/met-a-601")
