前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >如何安装GWAS软件包:GAPIT

如何安装GWAS软件包:GAPIT

作者头像
邓飞
发布2022-12-13 17:22:14
7510
发布2022-12-13 17:22:14
举报

飞哥推荐:

现在R语言的版本是R4.2.1,这里介绍一下安装最新版的GAPIT如何安装,以及如何运行示例数据,运行处结果。安装前建议,第一电脑用户名需要是英文的,如果是中文的建议新建一个英文的用户名再安装,第二安装最新版的R4.2.1以及Rtoools软件(这个软件单独安装不是R包)。后面我列举了常见的安装错误以及解决方案。

版本情况:

* windows11

* R4.2.1

代码语言:javascript
复制
> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

「太长不看版」

在R中运行下面命令即可安装成功PAPIT软件。

代码语言:javascript
复制
# 安装GAPIT软件做GWAS分析
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")

1. GAPIT官网

张志武老师实验室的网站:

http://www.zzlab.net/GAPIT/

GAPIT说明文档:http://www.zzlab.net/GAPIT/gapit_help_document.pdf

2. GAPIT安装

「错误的做法」

代码语言:javascript
复制
install.packages("GAPIT")

「报错:」

代码语言:javascript
复制
> install.packages("GAPIT")
Installing package into ‘C:/Users/dave/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘GAPIT’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

因为GAPIT不在CRAN上面,所以上面命令是错误的。

「正确的做法」

参考说明文档里的用法,在R中,运行下面命令:

代码语言:javascript
复制
source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")

就可以安装了。

「注意,这两条命令会下载安装一些包,默认安装就行。下面将解决一些常见的报错。」

3. 安装报错信息

3.1 Bioconductor 用BioManager
代码语言:javascript
复制
载入需要的程辑包:scatterplot3d
错误: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install
此外: Warning messages:
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  不存在叫‘LDheatmap’这个名字的程辑包
2: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
 
 错误: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install 

「解决方法:安装BioManager软件」

代码语言:javascript
复制
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")

然后再运行命令即可成功:

代码语言:javascript
复制
source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")
3.2 LDheatmap包找不到

「解决方法:」

代码语言:javascript
复制
 install.packages("nloptr")
 install.packages("LDheatmap")
3.3 snpStats包安装错误

「解决方案:」

代码语言:javascript
复制
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("snpStats")

「运行成功,没有报错,说明安装成功!」

代码语言:javascript
复制
> source("http://zzlab.net/GAPIT/GAPIT.library.R")
载入需要的程辑包:ape
载入需要的程辑包:compiler
载入需要的程辑包:EMMREML
载入需要的程辑包:Matrix
载入需要的程辑包:scatterplot3d
> source("http://zzlab.net/GAPIT/gapit_functions.txt")

4. 测试GAPIT

代码语言:javascript
复制
# test GAPIT

#Import data from Zhiwu Zhang Lab
myY <- read.table("http://zzlab.net/GAPIT/data/mdp_traits.txt", head = TRUE)
myGD=read.table(file="http://zzlab.net/GAPIT/data/mdp_numeric.txt",head=T)
myGM=read.table(file="http://zzlab.net/GAPIT/data/mdp_SNP_information.txt",head=T)
source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")
#GWAS with five methods
myGAPIT_MLM <- GAPIT(
  Y=myY[,c(1,3)], #fist column is individual ID, the third columns is days to pollination
  GD=myGD,
  GM=myGM,
  PCA.total=3,
  model=c("GLM", "MLM", "CMLM", "FarmCPU", "Blink"),
  Multiple_analysis=TRUE)

经过一段时间的运行,结束后,我们可以在工作目录中查看运行的GWAS分析结果。

「运行日志:」

「结果文件:」

结果文件在D盘中的test_gapit文件夹中:

「结果预览:」

这个软件很强大,很友好,很值得学习使用!

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2022-09-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 育种数据分析之放飞自我 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1. GAPIT官网
  • 2. GAPIT安装
  • 3. 安装报错信息
    • 3.1 Bioconductor 用BioManager
      • 3.2 LDheatmap包找不到
        • 3.3 snpStats包安装错误
        • 4. 测试GAPIT
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档