famuvie / breedR

Statistical methods for forest genetic resources analysts
http://famuvie.github.io/breedR/
GNU General Public License v3.0
31 stars 24 forks source link

Error msg. for pedigrees with same codes for founders and offspring #49

Open famuvie opened 9 years ago

famuvie commented 9 years ago

The error message of an incorrectly specified pedigree is very general:

library(breedR)
build_pedigree(1:3,
               data = data.frame(self = 1:6,
                                 sire = rep(1:3, 2),
                                 dam  = rep(4:6, 2)))
Error: all(check_pedigree(pedx)) is not TRUE
In addition: Warning messages:
1: In pedigree::orderPed(pedx) :
  Be carefull, there are loops in the pedigree, individuals involved in the loop are indicated with a -1

2: In build_pedigree(1:3, data = data.frame(self = 1:6, sire = rep(1:3,  :
  The pedigree has been recoded. Check attr(ped, 'map').

The user has to consult the help for check_pedigree() or build_pedigree() to learn that codes for parents and offspring must be different. This situation could be checked for and yield a more informative error message.

On behalf of K. Vander.