深圳摄影群曝光事件视频
发布日期:2025-12-17 13:38 点击次数:57大家好,我是邓飞深圳摄影群曝光事件视频,今天先容一下TwoSampleMR包若何建树token,从而不错使用数据库的数据进行孟德尔飞速化的分析。
1,安设TwoSampleMR包这个包在github上头,之前流行用devtools包安设github上的R包,然则devtools自身就十分难安设,好在当今有了 remotes包,这个包比拟好安设,进而github上头的包也比拟好安设了。
# install.packages("remotes")library(remotes)install_github("MRCIEU/TwoSampleMR")将上头的代码贴到Rstudio中实施,就不错了。如若显现莫得 remote包,就把难得去掉,再启动就行了。
图片
2, 启动MR示例数据library(TwoSampleMR)# List available GWASsao <- available_outcomes()# Get instrumentsexposure_dat <- extract_instruments("ieu-a-2")# Get effects of instruments on outcomeoutcome_dat <- extract_outcome_data(snps=exposure_dat$SNP, outcomes = "ieu-a-7")# Harmonise the exposure and outcome datadat <- harmonise_data(exposure_dat, outcome_dat)# Perform MR然后发现报错了:
> library(TwoSampleMR)TwoSampleMR version 0.6.8 载入程辑包:'TwoSampleMR’The following object is masked from 'package:remotes’: add_metadata> # List available GWASs> ao <- available_outcomes()Error in `dplyr::bind_rows()`:! Argument 1 must be a data frame or a named atomic vector.
报错的信息是:Error in dplyr::bind_rows():! Argument 1 must be a data frame or a named atomic vector.Run rlang::last_trace() to see where the error occurred.
看起来是dplyr的错,其实不是,持续启动望望能不成读取ieu的数据:
> bmi_exp_dat <- extract_instruments(outcomes = 'ieu-a-2')
当今的报错信息是:> bmi_exp_dat <- extract_instruments(outcomes = 'ieu-a-2')Error in if (nrow(d) == 0) return(NULL) : 参数长度为零
忧伤,如若你认为我方是R谈话大神,念念从R谈话包安设的角度,包打破的角度去解决问题,终末很大可能是 砸电脑!!!
正确的解决法子,是检察官网,如若你把报错信息贴到网上头,概况率亦然找不到谜底,因为之前TwoSampleMR还莫得这个问题,网上的东西是相互抄,泰国按摩群垃圾信息满天飞,第一手良友恒久是官网。
https://mrcieu.github.io/ieugwasr/articles/guide.html
内部有一句话:
From 1st May 2024, most queries to the OpenGWAS API will require user authentication. For more information on why this is necessary, see this [blog post](https://blog.opengwas.io/posts/user-auth-spring-2024/).
从2024年5月1号,TwoSampleMR包需要建树token之后,才不错打听数据库,是以,底下即是若何建树token的问题了。
3,TwoSampleMR建树token官方保举有盘算:
A:更新你的R包
Please update your TwoSampleMR and ieugwasr packages - you can use the following command to do this.
install.packages("TwoSampleMR", repos = c("https://mrcieu.r-universe.dev", "https://cran.r-project.org"))B:建树token
Then you need to obtain an OPENGWAS_JWT token - see the ieugwasr documentation https://mrcieu.github.io/ieugwasr/articles/guide.html - and store it in your .Renviron file - then restart R.
Login to https://api.opengwas.io/profile/
Generate a new token
Add OPENGWAS_JWT=<token> to your .Renviron file. This file could be either in your home directory or in the working directory of your R session. You can check the location of your .Renviron file by running Sys.getenv("R_ENVIRON_USER") in R.
Restart your R session
To check that your token is being recognised, run [ieugwasr::get_opengwas_jwt()](https://mrcieu.github.io/ieugwasr/reference/get_opengwas_jwt.html). If it returns a long random string then you are authenticated.
To check that your token is working, run [user()](https://mrcieu.github.io/ieugwasr/reference/user.html). It will make a request to the API for your user information using your token. It should return a list with your user information. If it returns an error, then your token is not working.
底下,我将上头的体式,连合我我方的到手操作经过,先容一下,随着我的体式,你也详情能握住啦!
3.1 登录opengwas,注册一下登录注册,用github账号,https://api.opengwas.io/profile/
3.2 创建token按照底下的截图就能握住。
图片
把token复制一下。
3.3 在R谈话中检测是否有token如若之前莫得建树过,详情是莫得的。
Sys.getenv("R_ENVIRON_USER")我的复返成果:
> Sys.getenv("R_ENVIRON_USER")[1] ""不错看到,莫得建树。
那就需要在文档文献夹中,新建一个.Renviron文献
图片
3.4 把token放到新建的.Renviron文献中3.5 重启R谈话(必须)OPENGWAS_JWT="这里粘贴你的token"图片
重启R谈话,然后键入底下代码,测试token是否建树到手:
## 测试token是否灵验library(ieugwasr)user()
图片
不错看到个东说念主的信息,就建树到手了。
4. 测试MR示例数据library(TwoSampleMR)# List available GWASsao <- available_outcomes()# Get instrumentsexposure_dat <- extract_instruments("ieu-a-2")# Get effects of instruments on outcomeoutcome_dat <- extract_outcome_data(snps=exposure_dat$SNP, outcomes = "ieu-a-7")# Harmonise the exposure and outcome datadat <- harmonise_data(exposure_dat, outcome_dat)# Perform MRres <- mr(dat)启动成果:
图片
作图成果:
图片
这就握住了深圳摄影群曝光事件视频。
本站仅提供存储业绩,悉数践诺均由用户发布,如发现存害或侵权践诺,请点击举报。- 上一篇:大秀直播是不是真的吗
- 下一篇:smfk直播大秀
