mayoverse / kinship2

Pedigree creation, plotting, and analytics
GNU General Public License v2.0
14 stars 7 forks source link

Individuals Plotted as Mating Without Offspring or Relation Data #12

Open alexkrohn opened 1 year ago

alexkrohn commented 1 year ago

I stumbled on a weird plotting artifact that I can't quite figure out. Despite no evidence that Y and unkF2 were ever a couple (no relation data, no Y-unkF2 sired offspring), they appear as a mated pair in the pedigree plot.

In fact, the plot would be simpler and equally correct if the pair were removed and there were one arc going from unkF2 in the C-unkF2 pair, to the unkF2 in the unkF2-unkM2 pair.

Any idea what creates this plotting artifact?

pedigree.df <- data.frame(id = c('1','2','B','C','D','H','M','U','W','Y','Z','12-1.13','12-1.14','12-1.16','13-1.26','14.1-33','16.1-46','16.1-48','19.1-58','19.1-59','19.1-60','19.1-62','20.1-63','21.1-64','21.1-65','21.1-66','21.1-67','21.1-68','21.1-69','21.1-70','unkF1','unkF2','unkM1','unkM2'), dadid = c(NA,NA,'unkM1',NA,'unkM1','unkM2','Y',NA,NA,NA,'unkM2','Y','Y','Y','B','Y','C','C',NA,'H',NA,'H','C','D','D','D','D','D','D','D',NA,NA,NA,NA), momid = c(NA,NA,'unkF1',NA,'unkF1','unkF2','1',NA,NA,NA,'unkF2','1','1','1','1','1','1','1',NA,'1',NA,'1','unkF2','1','1','1','1','1','1','1',NA,NA,NA,NA), sex = c('2','2','1','1','1','1','1','1','1','1','1','3','3','3','3','3','3','3','3','3','3','3','3','3','3','3','3','3','3','3','2','2','1','1'))

with(pedigree.df, pedigree(id, dadid, momid, as.integer(sex)))

8maxmissing-pedigree

alexkrohn commented 1 year ago

Hi @sinnweja. Any updates to this?

sinnweja commented 1 year ago

Thanks for sharing your example. I've got a couple other bug reports on the alignments of parents since my last update, and I need to do a deep-dive into it. Your example will help me pinpoint it. I hope to get into it in the next couple days, but I do see that a re-ordering of the subjects allows the alignment to work correctly (another way I can pinpoint a fix).

` set.seed(1000)

plot(ped[sample(1:length(ped$id))]) `