基因组选择软件众多,但就生产实践环节而言许多软件都存在部分问题,如生产人员上手不易及软件费用等,此外国产主流生物育种软件仍较少,因此编写易操作且开源的国产基因组选择软件也是缓解中国动物育种行业“卡脖子”问题的一道关。
由华中农业大学赵书红、刘小磊团队(尹立林,张浩浩,付玉华,唐振双,许静雅,殷动等)开发的HIBLUP,是一款基于BLUP方法的分析工具,可实现ABLUP/PBLUP、GBLUP、SSBLUP等模型,具体包括A、G、H矩阵构建,AI、EM等多种方差组分估计方法,以及混合模型方程求解等。
github地址: https://github.com/xiaolei-lab/hiblup/tree/642e147b2afeb407f9e9df6ad381abc4e693ace2
该软件直接运行hiblupInstaller.sh即可完成下载。脚本主要包括下载Miniconda3,创建hiblup环境,下载R语言及hiblup安装包等过程,下载完成进入hiblup环境conda activate hiblup
,键入hiblup或打开Rlibrary(hiblup)
即可使用(hiblup v1.3.1手册)。
笔者因已在使用Miniconda,且修改了镜子(前段时间据说清华不维护了,不知道真假),故在直接运行脚本的过程中报了Error: Unknow MIRROR
。查看hiblupInstaller.sh之后,在现有环境的基础上手动安装了hiblup_1.3.0。
下载及安装
进入github地址,手动下载最新版本1.3.1所有文件,进入\hiblup-642e147b2afeb407f9e9df6ad381abc4e693ace2\version\1.3.1\
下找到了R packagehiblup_1.3.0_R_3.5.1_community_x86_64_Linux.tar.gz
,接下来根据hiblupInstaller.sh中的提示创建相关环境及安装包hiblup_1.3.0_R_3.5.1_community_x86_64_Linux.tar.gz
传输进服务器。
conda create -n hiblup r-base=3.5.1 r-essentials r-rcpp r-rcpparmadillo -y #创建hiblup环境,R版本3.5.1
conda activate hiblup
Rscript -e "install.packages('bigmemory', repos='https://mirrors.tuna.tsinghua.edu.cn/CRAN/', lib='/path(写入位置)/miniconda3/lib/R/library')" #安装依赖包
Rscript -e "install.packages('/path(服务器中该包的位置)/hiblup_1.3.0_R_3.5.1_community_x86_64_Linux.tar.gz', repos=NULL, lib='/path(写入位置)/miniconda3/envs/hiblup/lib/R/library')"
测试
运行 Quick Start
R
library(hiblup)
data("hidata") ###/tree/642e147b2afeb407f9e9df6ad381abc4e693ace2#quick-start)
X <- model.matrix(~as.factor(Sex), data=pheno) # fixed effects
R <- as.matrix(pheno$Sire) # random effects
gebv <- hiblup(pheno=pheno[,c(1,4)], geno=geno, map=map, geno.id=geno.id,
pedigree=pedigree, vc.method=c("HI"), mode="A", CV=X, R=R,
snp.solution=TRUE)
#-------------------------Welcome to HIBLUP--------------------------#
# He-aI BLUP _ _ _____ ____ _ _ _ _____ #
# | | | |_ _| _ \| | | | | | __ \ #
# | |__| | | | | |_) | | | | | | |__) | #
# | __ | | | | _ <| | | | | | ___/ #
# | | | |_| |_| |_) | |___| |__| | | #
# |_| |_|_____|____/|______\____/|_| Version: 1.3.1 #
# Developed by Lilin Yin#, HaoHao Zhang#, and Xiaolei Liu #
#--------------------------------------------------------------------#
SSBLUP model is selected based on the provided data!
Analyzed trait: t1
Number of fixed effects: 2 (intercept included)
Number of random effects: 1 + 1
Number of individuals with phenotypic observations: 800
Number of SNPs in genotype: 48353
Deriving GA matrix from genotype...Done within 0s
Number of genotyped individuals: 573
Number of genotyped individuals with phenotypic observations: 175
Number of genotyped individuals without phenotypic observations: 398
Deriving A matrix from pedigree...Done within 0s
Number of total predicted individuals: 2524
Realign index of y...Done!
Realign index of X matrix...Done!
Realign index of R matrix...Done!
Constructing H matrix...
Extracting A11 matrix...Done!
Mean of diagonal and Off-diagonal of PA: 1.0014 0.0285
Mean of diagonal and Off-diagonal of GA: 0.9886 -0.0017
Adjusting GA matrix: GA* = 0.98 * GA + 0.03
Weighting of A11 and GA matrix: 0.05
Calculating the inverse of A11 matrix...Done within 1s
Constructing HA matrix...Done within 0s
HE Prior derived: A:0 e:3.596691; Done within 0s
HE adopted: TRUE
Variance components estimation:
Dimension of V^(-1): 800 * 800
[Iter] Var_R1(SE) Var_K1(SE) Var_e(SE) h2_R1(SE) h2_K1(SE)
[AI] 0.292929(0.1173) 0.000000(0.2728) 3.596691(0.2963) 0.0753(0.0285) 0.0000(0.0701)
[AI] 0.324038(0.1173) 0.000000(0.2728) 3.377041(0.2963) 0.0876(0.0298) 0.0000(0.0737)
[AI] 0.322506(0.1256) 0.000000(0.2497) 3.385865(0.2706) 0.0870(0.0316) 0.0000(0.0673)
[AI] 0.322609(0.1252) 0.000000(0.2506) 3.386054(0.2716) 0.0870(0.0315) 0.0000(0.0676)
[AI] 0.322605(0.1252) 0.000000(0.2506) 3.386048(0.2716) 0.0870(0.0315) 0.0000(0.0676)
[AI] 0.322605(0.1252) 0.000000(0.2506) 3.386048(0.2716) 0.0870(0.0315) 0.0000(0.0676)
[Convergence] YES
Done within 6s
Estimating random effect...Done within 0s
Estimating SNP effect...Done within 0s
Estimated beta: 162.2234 0.9265338
Estimated Vg and Ve: 0 3.386048
HIBLUP IS DONE WITHIN: 8s
HIBLUP ACCOMPLISHED SUCCESSFULLY!
以上,即安装成功。
此外,作者指出:
Microsoft R Open (MRO)可以加速HIBLUP的数学计算,它包括多线程的数学库。这些库使得许多常见的R运算(如矩阵乘/逆、矩阵分解和一些更高级别的矩阵运算)能够并行计算,并使用所有可用的处理能力来减少计算时间。对于Linux和macOS,我们的shell脚本可以自动安装包含HIBLUP包的MRO,没有root权限要求。对于Windows,我们强烈建议用户为HIBLUP安装MRO。
但在手动安装过程中,笔者在 Using MRO language with Anaconda 指导下安装MRO时conda create -n mro-environment r-essentials mro-base
,可能由于网络或镜子原因未能成功Solving environment,于是根据指导下载Linux microsoft-r-open-3.5.1.tar.gz安装了Microsoft R Open 3.5.1
(最新版本4.0)。
tar -xf /mnt/d/ylf/ykzhang/soft/microsoft-r-open-3.5.1.tar.gz
cd microsoft-r-open/
sudo ./install.sh
键入R
报错libtinfo.so.5: cannot open shared object file: No such file or directory
,于是参考论坛重新下载了libtinfo.so.5
。
再次键入R
,顺利使用MRO;
935348004