R package:blupADC-Feature 4

Table of Contents

Overview

🦄 Pedigree is the important information in animal breeding. By applying trace_pedigree function in package: blupADC, user can trace, rename, correct pedigree errors in an easy way. In addition, user can visualize the pedigree structure by ggped function.

Example

💖Trace pedigree

library(blupADC)
pedigree_result=trace_pedigree(
                input_pedigree=example_ped1,   #provided pedigree data object
                output_pedigree_tree=TRUE  # output pedigree tree
                )                 

Output

By typing str(pedigree_result), we can get the output result of this function:

str(pedigree_result)
## List of 5
##  $ ped          : chr [1:15945, 1:3] "DD19348310" "DD19386807" "DD19119705" "DD16007415" ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : NULL
##   .. ..$ : chr [1:3] "Offspring" "Sire" "Dam"
##  $ rename_ped   :'data.frame':	15945 obs. of  6 variables:
##   ..$ Offspring   : chr [1:15945] "DD19348310" "DD19386807" "DD19119705" "DD16007415" ...
##   ..$ Generation  : num [1:15945] 0 0 0 0 0 0 0 0 0 0 ...
##   ..$ Offspring_Id: int [1:15945] 1 2 3 4 5 6 7 8 9 10 ...
##   ..$ Sire_Id     : num [1:15945] 0 0 0 0 0 0 0 0 0 0 ...
##   ..$ Dam_Id      : num [1:15945] 0 0 0 0 0 0 0 0 0 0 ...
##   ..$ Order       : int [1:15945] 1 2 3 4 5 6 7 8 9 10 ...
##  $ pedigree_tree: chr [1:15945, 1:15] "DD19348310" "DD19386807" "DD19119705" "DD16007415" ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : NULL
##   .. ..$ : chr [1:15] "Offspring" "Sire" "Dam" "SireSire" ...
##  $ error_id_set :List of 4
##   ..$ error_duplicated_id: chr [1:24] "DD19119705" "DD20488904" "DD20153801" "DD20376912" ...
##   ..$ error_sex_id: chr "DD13006182"
##   ..$ error_breed_id: NULL
##   ..$ error_birth_date_id: NULL

Output result includes several parts:

  • ped: pedigree without rename
  • rename_ped: renamed pedigree. The first column is original id, the second column is generation, columns 3-5 stand for the renamed pedigree.
  • pedigree_tree: pedigree tree. Pedigree tree contains ancestry records information for each individual. For saving time, software doesn’t output pedigree tree in default.
  • error_id_set: dataset of pedigree errors .According to the type of pedigree errors, these datasets can be divided four parts:
    • error_duplicated_id: same individual but has different records of sire and dam
    • error_sex_id: same individual appears in the column of sire and dam simultaneously
    • error_breed_id: breed of parents and offspring is different (only for specify format of original id)
    • error_birth_date_id: offspring born before its parents (need to provide birth data information in the fourth column of pedigree)

Parameter

💥Basic

  • 1:input_pedigree

User-provided pedigree data, data.frame or matrix class.

💌The format of provided pedigree data should be one of the following format:

  • 3 columns format:
OffspringSireDam
DD19575312DD18768902DD16376015
DD19513112DD18768902DD17111017
DD20348012DD19132207DD19234510
DD20361110DD19331001DD19293112
DD20471212DD19331001DD19320808
DD20564818DD19331001DD19311009
  • 4 columns format:
OffspringSireDamBirth_Date
DD19575312DD18768902DD1637601520200101
DD19513112DD18768902DD1711101720200102
DD20348012DD19132207DD1923451020200103
DD20361110DD19331001DD1929311220200104
DD20471212DD19331001DD1932080820200105
DD20564818DD19331001DD1931100920200106
  • Multiple columns format:
OffspringSireDamSireSireDamSireSireSireSire
DD20231905DD19581002DD18750810DD16785512DD15507717DD14008512
DD20458701DD19564302DD18925809DD15349017DD15245411DD16771212
DD20324707DD19232903DD18571012DD16794714DD16744412DD16714516
DD19288609DD18713408DD18552609DD15180015DD15479214DD15243711
DD16222012DD15145005DD15378812DD14110014DD15501518DD15206217
DD17684713DD16672107DD15122311DD15505715DD15347415DD16383111

Note: When the format of provided pedigree data is multiple columns ,user must set multi_col=TRUE, and the colnames of pedigree data should be the specify format , e.g. SireSire stands for the father of offspring’s father, SirSireSire stands for the father of SireSire

Missing record in pedigree could be set as NA or 0 .

  • 2:input_pedigree_path

File path of pedigree data, character class.

  • 3:input_pedigree_name

File name of pedigree data, character class.

  • 4:multi_col

Whether convert multiple columns pedigree into standard 3 columns pedigree, logical class. When the format of provided pedigree data is multiple columns, user need to set multi_col=TRUE .

  • 5:trace_id

Individuals set in tracing pedigree, character class. Default is NULL , which means tracing all individuals in pedigree.

  • 6:trace_generation

The max generation in tracing pedigree, numeric class. Default is NULL , which means tracing all generation in pedigree.

  • 7:trace_birth_date

Threshold of birth date in tracing pedigree, numeric class. Individuals set with birth date earlier than user provided birth date would be excluded in tracing pedigree.

  • 8:output_pedigree_path

File path of output pedigree data, character class.

  • 9:output_pedigree_name

File path of output pedigree name, character class.

💨Advanced

  • 10:dup_error_check

Whether check the pedigree error of error_duplicated,logical class. Default is TRUE.

  • 11:sex_error_check

Whether check the pedigree error of error_sex,logical class. Default is TRUE.

  • 12:birth_date_error_check

Whether check the birth date error record,logical class. Default is TRUE.

  • 13:output_pedigree_tree

Whether output the pedigree tree, logical class. Default is FALSE.

  • 14:pedigree_tree_depth

Depth of pedigree tree, numeric class. Default is 3.

Quanshun Mei
Quanshun Mei
Postdoctoral researcher

My research interests include applying genomic selection and machine learning in animal breeding.