育種中如何檢查系譜是否有錯誤
系譜檢查常見錯誤,包括:
個體有重複值
父母本交叉
系譜有迴圈
這些情況應該如何快速檢查呢?
這裡推薦我寫的R包
learnasreml
中的
check_pedigree
函式,簡單好用,結果友好。能夠檢查:
個體是否有重複值
父母本是否有交叉
至於系譜迴圈檢查,推薦欒生老師寫的
visPedigree
包中的函式
tidyped
。下面介紹函式的用法。
1。 正常的系譜
這裡使用
asreml
包中的harvey。ped資料:
> head(ped)
Calf Sire Dam
1 101 Sire_1 0
2 102 Sire_1 0
3 103 Sire_1 0
4 104 Sire_1 0
5 105 Sire_1 0
6 106 Sire_1 0
> learnasreml::check_pedigree(ped)
系譜共有行數: 65
個體共有個數: 65
父本共有個數: 9
母本共有個數: 0
個體沒有重複!
父母本個體沒有交叉!
可以看到,共有65行系譜,個體沒有重複,父母本沒有交叉。
「使用visPeidgree包:」
在這裡插入程式碼片> pped = visPedigree::tidyped(ped = ped)
Warning message:
In checkped(ped_inter, addgen) :
In the sire or dam column, Blank, Zero, asterisk, or character NA is recognized as a missing parent and is replaced with the missing value NA。
> head(pped)
Ind Sire Dam Gen Sex IndNum SireNum DamNum
1: Sire_1
2: Sire_2
3: Sire_3
4: Sire_4
5: Sire_5
6: Sire_6
「使用nadiv包檢查系譜:」
> pped = visPedigree::tidyped(ped = ped)
Warning message:
In checkped(ped_inter, addgen) :
In the sire or dam column, Blank, Zero, asterisk, or character NA is recognized as a missing parent and is replaced with the missing value NA。
> head(pped)
Ind Sire Dam Gen Sex IndNum SireNum DamNum
1: Sire_1
2: Sire_2
3: Sire_3
4: Sire_4
5: Sire_5
6: Sire_6
2。 個體重複的系譜
「使用nadiv檢查系譜:」
> ped = data。frame(ID = c(1:10,5,8), Sire = paste0(“A”,1:12), Dam = paste0(“B”,1:12))
> ped
ID Sire Dam
1 1 A1 B1
2 2 A2 B2
3 3 A3 B3
4 4 A4 B4
5 5 A5 B5
6 6 A6 B6
7 7 A7 B7
8 8 A8 B8
9 9 A9 B9
10 10 A10 B10
11 5 A11 B11
12 8 A12 B12
> nadiv::prepPed(ped)
Error in nadiv::prepPed(ped) :
some individuals appear more than once in the pedigree
可以看到,報錯,顯示ID中有重複,但是沒有說明哪些有錯誤。
「visPedigree檢查系譜:」
> visPedigree::tidyped(ped)
Error in checkped(ped_inter, addgen) : Please check the pedigree!
In addition: Warning messages:
1: In checkped(ped_inter, addgen) :
The 2 duplicated individual IDs are found in the pedigree。 Only the first 2 records are shown。
2: In checkped(ped_inter, addgen) : 5, A5, B5
3: In checkped(ped_inter, addgen) : 8, A8, B8
提示,系譜5和8有重複。
「learnasreml包檢查系譜:」
> learnasreml::check_pedigree(ped)
系譜共有行數: 12
個體共有個數: 10
父本共有個數: 12
母本共有個數: 12
個體重複數為: 2 個,分別是: 5 8
父母本個體沒有交叉!
這個結果最友好,中文的,顯示個體重複編號是5,8。
提取這兩個系譜:
> ped %>% filter(ID %in% c(5,8))
ID Sire Dam
1 5 A5 B5
2 8 A8 B8
3 5 A11 B11
4 8 A12 B12
可以看到,這裡ID有重複,但是其父母本不一樣,應該是系譜錯誤所致。
如何安裝
learnasreml
#安裝方法:
if (!requireNamespace(“devtools”)) install。packages(“devtools”)
library(devtools)
install_github(“dengfei2013/learnasreml”)
❝
歡迎關注我的公眾號:
育種資料分析之放飛自我
。主要分享R語言,Python,育種資料分析,生物統計,數量遺傳學,混合線性模型,GWAS和GS相關的知識。
❞
飛哥彙總 | 入門資料分析資源推薦
福利領取 | GWAS教程第二版釋出啦!
用最酷的方法學習R語言
下一篇介紹如何檢查系譜中的loop,歡迎繼續關注。
感覺不錯,還請轉點贊、在看、發朋友圈,十分感謝。
上一篇:美瞳選擇?