在孟德尔随机化分析中,有一个步骤是去除连锁不平衡,需要用到clump_data()函数,如果碰到如下情况:

> exposure_dat_clumped <- clump_data(exposure_dat, clump_kb=10000, clump_r2=0.001) 
Please look at vignettes for options on running this locally if you need to run many instances of this command.
Clumping ovEiTg, 4757 variants, using EUR population reference
No encoding supplied: defaulting to UTF-8.
Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump",  : 
  cannot mtfrm

有可能是openGWAS 账号的TOKEN过期了,需要reset一下,然后复制TOKEN,再进行如下操作:

 # 编辑R环境变量
 usethis::edit_r_environ() 
## 在弹出的编辑器中添加以下行,并将YOUR_PERSONAL_ACCESS_TOKEN替换为生成的令牌
 GITHUB_PAT="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"

# 保存并关闭编辑器,然后重新启动R或RStudio

更多推荐