magnusdv / quickped

An online pedigree tool for research applications. Build pedigrees interactively and store as images or text files in ped format. QuickPed also computes a variety of relatedness coefficients and offers verbal descriptions of pairwise relationships.
https://magnusdv.shinyapps.io/quickped
GNU General Public License v3.0
22 stars 3 forks source link

Program ignoring assigned MZ twins and replacing one of them #10

Closed the-holographic closed 1 year ago

the-holographic commented 1 year ago

I've been creating a pedigree for my active Crusader Kings 3 campaign and became interested of any possible bugs precense in a designated program. After a series of entries the program started ignoring assigned MZ twins and started replacing one of them with a sibling of opposite sex.

https://youtu.be/BjRwlUCeWnU

P.S. A video is enclosed via Youtube due to size incompatability.

magnusdv commented 1 year ago

Thanks, that's an interesting pedigree. :)

This is indeed one of the rare cases where kinship2, which QuickPed uses under the hood, fails to produce a correct alignment:

x = kinship2::pedigree(
  id = 1:7,
  dadid = c(0, 0, 1, 1, 1, 3, 4),
  momid = c(0, 0, 2, 2, 2, 5, 5),
  sex = c(1, 2, 1, 1, 2, 1, 1),
  relation = data.frame(id1 = 3, id2 = 4, code = 1))  # 3 and 4 MZ twins

plot(x)
#> Warning in autohint(ped): Unexpected result in autohint, please contact developer

Created on 2023-02-13 with reprex v2.0.2

In some cases where this happens, better versions may be achieved in R with some tinkering of the plotting parameters (either in kinship2 directly, or with pedtools), but in this particular case I don't see a quick solution - sorry!

magnusdv commented 1 year ago

I've raised an issue about this at the kinship2 repo, so closing this.