CAD_autophagy.R 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # apolipoprotein L, 1
  2. # apolipoprotein L, 1
  3. # arylsulfatase B
  4. # Baculoviral IAP repeat-containing protein 5
  5. # BCL2/adenovirus E1B 19 kDa protein-interacting protein 3
  6. # calnexin
  7. # Caspase 8 levels
  8. # Caspase-3
  9. # C-C motif chemokine ligand 2
  10. # Cyclin-dependent kinase inhibitor 1B
  11. # Cathepsin L1 levels
  12. # cathepsin D
  13. # Cathepsin B
  14. # Cathepsin L1 levels
  15. # C-X3-C motif chemokine ligand 1
  16. # Death-associated protein kinase 2
  17. # DnaJ homolog subfamily B member 9
  18. # Glutamate receptor ionotropic, delta-2
  19. # Interferon gamma
  20. # Gamma-aminobutyric acid receptor-associated protein-like 1
  21. # Gamma-aminobutyric acid receptor-associated protein-like 2
  22. # Glutamate receptor ionotropic, delta-2
  23. # Mitogen-activated protein kinase 1
  24. # Mitogen-activated protein kinase 3
  25. # Mitogen-activated protein kinase 8
  26. # Nicotinamide phosphoribosyltransferase
  27. # Next to BRCA1 gene 1 protein
  28. # PTK6
  29. # sphingosine kinase 1
  30. # Vesicle-associated membrane protein 3
  31. # vascular endothelial growth factor A
  32. #在线孟德尔分析
  33. #加载包
  34. library(TwoSampleMR)
  35. # install.packages("ieugwasr")
  36. library(ieugwasr)
  37. # 登陆token
  38. Sys.setenv(OPENGWAS_JWT="eyJhbGciOiJSUzI1NiIsImtpZCI6ImFwaS1qd3QiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhcGkub3Blbmd3YXMuaW8iLCJhdWQiOiJhcGkub3Blbmd3YXMuaW8iLCJzdWIiOiJ6anQ3ODU2MzIxQGhvdG1haWwuY29tIiwiaWF0IjoxNzI0NTg2NzM3LCJleHAiOjE3MjU3OTYzMzd9.hseY1Y4YiYJ4WWi-WoQmm0VWQA6Ozqurj08HvJV8q6xh7D4Jfv5o3zdwBvU_4HhC87C59KWgXaBm5ZiMynqLSp5uFLlai_5ObswpbdLHtNRghZYti0wF7TRTGcXPa9_ICWvrEoIRNoAyj10I1nOrPE9RhRL0PrzHOYb9Y3L7oBDzmsch-boFLYE3R9ZhUoZSMMiZYNR9_PmYbJi2Lrd6C_tI1fCna9jzF5vHsQQReYgy4IS59rr_lDEwdE46dCIq2cHoDIZJ4ohArPHtoLaw5CXf0yUrY89Xo2J5KnVWHtzlFK7EEgOIpx1DX6mSgrVxXtvlFSM-j7K1qbM9Awr6JQ")
  39. ieugwasr::user()
  40. Coronary_artery_disease_list = c("ebi-a-GCST005195", "ebi-a-GCST005194")
  41. autoghagy_list <- c("prot-a-134", "prot-a-135", "prot-a-172", "prot-a-252" , "prot-a-261",
  42. "prot-a-353", "ebi-a-GCST90012072", "prot-a-364", "prot-b-4", "prot-a-495",
  43. "ebi-a-GCST90012073", "prot-b-51", "prot-a-718", "ebi-a-GCST90012073", "prot-b-70",
  44. "prot-a-763", "prot-a-842", "prot-a-1276", "prot-a-1428", "prot-a-1161",
  45. "prot-a-1162", "prot-a-1276","prot-a-1845", "prot-a-1848", "prot-a-1849",
  46. "prot-a-1998", "prot-a-2004","prot-a-2536","ebi-a-GCST90000502")
  47. result_all <- data.frame()
  48. for (i in seq_along(Coronary_artery_disease_list)) {
  49. for (j in seq_along(autoghagy_list)) {
  50. #两样本MR(在线读)
  51. #提取蛋白的SNP
  52. print(autoghagy_list[j])
  53. autoghagy <- extract_instruments(outcomes = autoghagy_list[j])
  54. #提取SNP在结局中的信息
  55. print(Coronary_artery_disease_list[i])
  56. outcome_dat <- extract_outcome_data(snps = autoghagy$SNP, outcomes = Coronary_artery_disease_list[i])
  57. #合并暴露和结局的数据
  58. dat <- harmonise_data(autoghagy, outcome_dat)
  59. #分析MR
  60. result <- mr(dat)
  61. result_all <- rbind(result_all, result)
  62. }
  63. }
  64. # 保存为 CSV 文件
  65. write.csv(result_all, file = "result_all.csv", row.names = FALSE)
  66. a = read.csv("result_all.csv")
  67. autoghagy <- extract_instruments(outcomes = "ebi-a-GCST90000502")
  68. #提取SNP在结局中的信息
  69. print(Coronary_artery_disease_list[i])
  70. outcome_dat <- extract_outcome_data(snps = autoghagy$SNP, outcomes = "ebi-a-GCST005194")
  71. #合并暴露和结局的数据
  72. dat <- harmonise_data(autoghagy, outcome_dat)
  73. #分析MR
  74. result <- mr(dat)
  75. # #由于结局是二分类,所以生成OR值
  76. # OR <- generate_odds_ratios(results)
  77. # # 异质性检验
  78. # heterogeneity <- mr_heterogeneity(dat)
  79. # res_MRPRESSO <- run_mr_presso(dat)
  80. # # 多效性检验
  81. # pleiotropy <- mr_pleiotropy_test(dat)
  82. # pleiotropy
  83. # #散点图
  84. # mr_scatter_plot(results, dat)
  85. # #留一图
  86. # leaveoneout <- mr_leaveoneout(dat)
  87. # mr_leaveoneout_plot(leaveoneout)
  88. # #森林图
  89. # results_single <- mr_singlesnp(dat)
  90. # mr_forest_plot(results_single)
  91. # #漏斗图
  92. # mr_funnel_plot(results_single)
  93. # 本地文件孟德尔分析
  94. install.packages("vroom")
  95. library(vroom)
  96. setwd("/root/zjt")
  97. a <- vroom("11510_31_APOL1_Apo_L1.txt", col_names = TRUE)