2024-03-12

TwosampleMR

Liangping Cheng

12 三月, 2024

學(xué)習(xí)使用TwosampleMR

首先是安裝必要的包,有的網(wǎng)絡(luò)是打不開github的所以需要魔法幫忙下載,下載好了之后就能在自己的目錄下安裝了。

#install.packages("devtools")
#devtools::install_local("TwoSampleMR-master.zip")
#devtools::install_local("MRInstruments-master.zip")

加載R包,獲取數(shù)據(jù)

You can also embed plots, for example:

## TwoSampleMR version 0.5.10 
## [>] New: Option to use non-European LD reference panels for clumping etc
## [>] Some studies temporarily quarantined to verify effect allele
## [>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
## API: public: http://gwas-api.mrcieu.ac.uk/
## OpenGWAS updates:
##   Date: 2024-03-07
##   [>] There is exceptional load on the OpenGWAS servers.
##   [>] Urgent infrastructure development being performed.
##   [>] The servers will be unavailable for approximately 48 hrs.
##   [>] See other options for analysis: https://mrcieu.github.io/gwasvcf/.
## Extracting data for 65 SNP(s) from 1 GWAS(s)
## Harmonising Cheese intake || id:ukb-b-1489 (ukb-b-1489) and Coronary heart disease || id:ieu-a-7 (ieu-a-7)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs1024853, rs26579
## Analysing 'ukb-b-1489' on 'ieu-a-7'
##   id.exposure id.outcome                              outcome
## 1  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
## 2  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
## 3  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
## 4  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
## 5  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
##                         exposure                    method nsnp          b
## 1 Cheese intake || id:ukb-b-1489                  MR Egger   62  0.1342111
## 2 Cheese intake || id:ukb-b-1489           Weighted median   62 -0.4300205
## 3 Cheese intake || id:ukb-b-1489 Inverse variance weighted   62 -0.4360602
## 4 Cheese intake || id:ukb-b-1489               Simple mode   62 -0.5269452
## 5 Cheese intake || id:ukb-b-1489             Weighted mode   62 -0.4311161
##          se         pval
## 1 0.4309722 7.565649e-01
## 2 0.1306445 9.964392e-04
## 3 0.1022658 2.008084e-05
## 4 0.3037105 8.778662e-02
## 5 0.2724922 1.187931e-01
##   id.exposure id.outcome                              outcome
## 1  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
## 2  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
##                         exposure                    method        Q Q_df
## 1 Cheese intake || id:ukb-b-1489                  MR Egger 81.96134   60
## 2 Cheese intake || id:ukb-b-1489 Inverse variance weighted 84.49375   61
##       Q_pval
## 1 0.03135632
## 2 0.02492620
## Analysing 'ukb-b-1489' on 'ieu-a-7'
##   id.exposure id.outcome                              outcome
## 1  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
##                         exposure
## 1 Cheese intake || id:ukb-b-1489
##                                                      method nsnp          b
## 1 Inverse variance weighted (multiplicative random effects)   62 -0.4360602
##          se         pval
## 1 0.1022658 2.008084e-05
##   id.exposure id.outcome                              outcome
## 1  ukb-b-1489    ieu-a-7 Coronary heart disease || id:ieu-a-7
##                         exposure egger_intercept          se      pval
## 1 Cheese intake || id:ukb-b-1489    -0.009837988 0.007225505 0.1784265
## $`ukb-b-1489.ieu-a-7`
## Warning: Using linewidth for a discrete variable is not advised.
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_errorbarh()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
image.png
## 
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
##   id.exposure id.outcome
## 1  ukb-b-1489    ieu-a-7
## $`ukb-b-1489.ieu-a-7`
image.png
## 
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
##   id.exposure id.outcome
## 1  ukb-b-1489    ieu-a-7
## $`ukb-b-1489.ieu-a-7`
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_errorbarh()`).
## Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
image.png
## 
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
##   id.exposure id.outcome
## 1  ukb-b-1489    ieu-a-7
## $`ukb-b-1489.ieu-a-7`
image.png
## 
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
##   id.exposure id.outcome
## 1  ukb-b-1489    ieu-a-7

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容