
image.png
主要使用blupADC完成題目的功能,此包是華中農(nóng)業(yè)大學(xué)梅全順編寫(xiě)。在使用以下6與7功能之前,通常需要提前下載好 DMU 軟件 (DMU下載網(wǎng)站) 和 BLUPF90軟件 (BLUPF90下載網(wǎng)站)。
如果您想將DMU和BLUPF90用作商業(yè)用途,請(qǐng)務(wù)必聯(lián)系 DMU 和 BLUPF90的作者?。?!
下載
首先查看Github的主頁(yè):https://github.com/TXiang-lab/blupADC/
需要將一面對(duì)應(yīng)的版本修改,目前其還在不斷改進(jìn),所以版本迭代的比較快。
install.packages(c("Rcpp", "RcppArmadillo","data.table"))
## linux
packageurl <- "https://github.com/TXiang-lab/blupADC/raw/main/blupADC_1.0.1_linux.tar.gz"
install.packages(packageurl,repos=NULL,method="libcurl")
## windows
packageurl <- "https://github.com/TXiang-lab/blupADC/raw/main/blupADC_1.0.1.zip"
install.packages(packageurl,repos=NULL)
功能簡(jiǎn)介:
- 基因型數(shù)據(jù)間的格式轉(zhuǎn)換
2.基因型數(shù)據(jù)的重復(fù)性檢測(cè) - 系譜追溯、重命名及糾錯(cuò)
- 基因型數(shù)據(jù)的質(zhì)控與填充
- 親緣關(guān)系矩陣的構(gòu)建
- DMU軟件的交互使用
- BLUPF90軟件的交互使用
以下是代碼
1. 基因型數(shù)據(jù)間的格式轉(zhuǎn)換
其可以實(shí)現(xiàn)Hapmap,Plink ,VCF ,Haplotype, Numeric , BLUPF90 格式的相互轉(zhuǎn)化
library(blupADC)
sum_data=genotype_data_format_conversion(
input_data_hmp=data_hmp, #提供的hampap格式數(shù)據(jù)的對(duì)象
output_data_type=c("Plink","BLUPF90","Numeric"),#基因型數(shù)據(jù)的輸出類型
return_result = TRUE, #是否在R中返回結(jié)果
cpu_cores=1 #調(diào)用的cpu數(shù)目
)
最近其增加了BLUPF90格式轉(zhuǎn)為Hapmap格式的文件。
2.基因型數(shù)據(jù)的重復(fù)性檢測(cè)
library(blupADC)
overlap_result=genotype_data_overlap(
input_data_hmp=data_hmp, #提供的hampap格式數(shù)據(jù)的對(duì)象
overlap_threshold=0.95, #判斷重復(fù)的閾值
return_result=TRUE #是否在R中返回結(jié)果
)
3. 系譜追溯、重命名及糾錯(cuò)
library(blupADC)
pedigree_result=trace_pedigree(
input_pedigree=origin_pedigree, #提供的系譜數(shù)據(jù)的對(duì)象
trace_generation=3 # 系譜追溯的代數(shù)
)
4. 基因型數(shù)據(jù)的質(zhì)控與填充
library(blupADC)
genotype_data_QC_Imputation(
input_data_hmp=data_hmp, #提供的hampap格式數(shù)據(jù)的對(duì)象
data_analysis_method="QC_Imputation", #數(shù)據(jù)分析方法,質(zhì)控+填充
output_data_path="/root/result", #基因型數(shù)據(jù)的輸出路徑
output_data_name="YY_data", #基因型數(shù)據(jù)的輸出名稱
output_data_type="Plink" #基因型數(shù)據(jù)的輸出類型
)
5. 親緣關(guān)系矩陣的構(gòu)建
library(blupADC)
kinship_result=cal_kinship(
input_data_hmp=data_hmp, #提供的hampap格式數(shù)據(jù)的對(duì)象
kinship_type=c("G_A","G_D"), #親緣關(guān)系矩陣的類型
dominance_type=c("genotypic"), #顯性效應(yīng)的類型
inbred_type=c("Homozygous"), #近交系數(shù)的類型
return_result=TRUE) #在R中返回結(jié)果
6. DMU軟件的交互使用
library(blupADC)
data_path=system.file("extdata", package = "blupADC") # 示例文件的路徑
run_DMU(
phe_col_names=c("Id","Mean","Sex","Herd_Year_Season","Litter","Trait1","Trait2"), # colnames of phenotype
target_trait_name=c("Trait1"), #性狀名稱
fixed_effect_name=list(c("Sex","Herd_Year_Season")), #固定效應(yīng)名稱
random_effect_name=list(c("Id","Litter")), #隨機(jī)效應(yīng)名稱
covariate_effect_name=NULL, #協(xié)變量效應(yīng)名稱
phe_path=data_path, #表型文件路徑
phe_name="phenotype.txt", #表型文件名
integer_n=5, #整型變量數(shù)
analysis_model="PBLUP_A", #遺傳評(píng)估模型
dmu_module="dmuai", #方差組分估計(jì)使用的DMU模塊
relationship_path=data_path, #親緣關(guān)系文件路徑
relationship_name="pedigree.txt", #親緣關(guān)系文件名
output_result_path="/root" #結(jié)果輸出路徑
)
7. BLUPF90軟件的交互使用
library(blupADC)
data_path=system.file("extdata", package = "blupADC") # 示例文件的路徑
run_BLUPF90(
phe_col_names=c("Id","Mean","Sex","Herd_Year_Season","Litter","Trait1","Trait2"), # 表型數(shù)據(jù)的列名(ps.表型文件無(wú)列名)
target_trait_name=c("Trait1"), #性狀名稱
fixed_effect_name=list(c("Sex","Herd_Year_Season")), #固定效應(yīng)名稱
random_effect_name=list(c("Id","Litter")), #隨機(jī)效應(yīng)名稱
covariate_effect_name=NULL, #協(xié)變量效應(yīng)名稱
phe_path=data_path, #表型文件路徑
phe_name="phenotype.txt", #表型文件名
analysis_model="PBLUP_A", #遺傳評(píng)估模型
relationship_path=data_path, #親緣關(guān)系文件路徑
relationship_name="pedigree.txt", #親緣關(guān)系文件名
output_result_path="/root" #結(jié)果輸出路徑
)
作者(梅全順)在2021/12/3的匯報(bào):
模塊3可以將將寬系譜改為長(zhǎng)系譜
模塊4,多種關(guān)系矩陣可以甲酸:

image.png
模塊5,遺傳評(píng)估,借助BLUPF90和DMU:

image.png
單性狀動(dòng)物模型-PBLUP:

image.png
多性狀動(dòng)物模型-

image.png
同時(shí)也可以使用多種更復(fù)雜的模型

image.png

image.png
估計(jì)結(jié)果展示

image.png

image.png

image.png
Shiny應(yīng)用(直接網(wǎng)頁(yè)版操作,無(wú)需代碼,但缺點(diǎn)可能運(yùn)行的數(shù)據(jù)量不能非常大):

image.png