magnusdv/pedtools

Malformed random pedigrees with selfing

Closed this issue · 2 comments

library(pedtools)

x = randomPed(2, 2, selfing = TRUE, seed = 2)
x
#>  id fid mid sex
#>   1   *   *   1
#>   2   *   *   2
#>   3   1   2   1
#>   4   1   1   0

validatePed(x)
#> Error: Malformed pedigree.
#>  Individual 1 is male, but appear as the mother of 4

Created on 2022-03-08 by the reprex package (v2.0.1)

Hi @magnusdv , I am having also this problem when using as.ped(). Did you find out how to solve this? I created a Stackoverflow question (https://stackoverflow.com/questions/74361363/convert-a-dataframe-into-a-ped-object-in-r-pedtools)

Thanks

Hi, sorry for the late answer. This bug is still present, but will be dealt with soon - a major overhaul of randomPed() is on its way (hopefully early 2023).