.net安装_如何安装GWAS分析软件R包:GAPIT

122cea7a1419302ccdb21b1d494cfefd.png

「太长不看版」 在R中运行下面命令即可安装成功PAPIT软件。

# 安装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安装

「错误的做法」

install.packages("GAPIT")

「报错:」

> 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中,运行下面命令:

source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")

就可以安装了。

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

「我的版本:」

  • R:R4.0.3
  • windows 10

3. 安装报错信息

3.1 Bioconductor 用BioManager

载入需要的程辑包: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软件」

if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")

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

source("http://zzlab.net/GAPIT/GAPIT.library.R")
source("http://zzlab.net/GAPIT/gapit_functions.txt")

3.2 LDheatmap包找不到

7543045f42c6ee71dfae1733a5110a72.png

「解决方法:」

 install.packages("nloptr")
 install.packages("LDheatmap")

3.3 snpStats包安装错误

「解决方案:」

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("snpStats")

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

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

4. 测试GAPIT

# 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分析结果。

「结果文件:」

7b92a8c655e240e43359048b071bf7a2.png

「结果预览:」

f97160c2eb87f5c7bc684085e5173ec1.png

0461537325da22bdecf84b4171e08fe3.png

9843f4641c999216b443f8b0a0ee1634.png

2829c6175ba7381f390e147d6b7b5846.png

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

感觉有用,关注我吧!

「公众号:育种数据分析之放飞自我」

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值