piratical / Madeline_2.0_PDE

The Madeline 2.0 Pedigree Drawing Engine (PDE) is a pedigree drawing program designed to handle large and complex pedigrees with an emphasis on readability and aesthetics. The program was designed primarily for human pedigrees.
GNU General Public License v2.0
19 stars 18 forks source link

Simple pedigree incorrectly displayed #42

Open gregorynuel opened 7 years ago

gregorynuel commented 7 years ago

Hi,

I recently discovered your Madeline software which is by far the best I ever saw for pedigree drawing. I look forward including your software into my own research projects.

However, I found some inconsistencies when using it to draw some test pedigree using the tab delimited format. It definitely seems to be a minimal reproducible bug, but I let you judge by yourself.

here is the pedigree (tab-separated file):

FamilyID    IndividualID    Gender  Father  Mother
3   44  M   .   .
3   1   M   .   .
3   2   F   .   .
3   6   M   1   2
3   7   F   .   .
3   15  F   6   7
3   16  F   6   7
3   17  F   44  7

Here is the command and output:

$ uname -a
Darwin GroBook.local 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64
$ ./src/madeline2 minimal_bug_pedigree.data
┌─────────────────────────────┐
│ Welcome to Madeline 2.0 PDE │
└─────────────────────────────┘
--------------------------------------------
 LABELS                          TOTAL: 0
--------------------------------------------
--------------------------------------------
Parser::readFile(): Opening a(n) UTF-8 file ...
Reading file data in delimited format ...
Table 1 is a pedigree table.
┏ Start of    addPedigreesFromDataTable ┓
Warning: Individual 17 already exists in pedigree 3: Ignoring replicated individual from data file.
Default ordering of siblings.
┗ End of      addPedigreesFromDataTable ┛
┏ Start of    draw                      ┓
Pedigree output file is “3_pedigree.svg”
┗ End of      draw                      ┛

And here is the result (svg converted into png):

capture d ecran 2017-02-18 a 08 24 19

As you can see, there is clearly a problem with the output !

There is also a minor issue with the warning regarding the last entry of the file, but this is really minor since it does not seem to alter the result.

Hoping you will be able to suggest a fix. Please let me know if I can assist you in any way ...

Regards,

GN

the-x-at commented 5 years ago

Confirmed. I am having a similar issue with a larger pedigree. Curiously, my pedigree also features one partner having offspring with two different partners (like in the example above, female 7 with male partners 6 and 44. When breaking this triplet up into nuclear families (6, 7, 15, 6) and (44, 17, with a new mother 45), the issue vanishes.

the-x-at commented 5 years ago

Unsurprisingly, changing to XML format does not help, either: the result is as described above. I have used the following input, which is a transformation of the initial example:

<?xml version="1.0" standalone="no"?>
<madeline-xml>
  <table>
    <row>
      <d>familyid</d> <d>individualid</d> <d>gender</d> <d>father</d> <d>mother</d>
    </row>
    <row>
      <d>3</d>        <d>44</d>           <d>M</d>      <d>.</d>      <d>.</d>
    </row>
    <row>
      <d>3</d>        <d>1</d>            <d>M</d>      <d>.</d>      <d>.</d>
    </row>
    <row>
      <d>3</d>        <d>2</d>            <d>F</d>      <d>.</d>      <d>.</d>
    </row>
    <row>
      <d>3</d>        <d>6</d>            <d>M</d>      <d>1</d>      <d>2</d>
    </row>
    <row>
      <d>3</d>        <d>7</d>            <d>F</d>      <d>.</d>      <d>.</d>
    </row>
    <row>
      <d>3</d>        <d>15</d>           <d>F</d>      <d>6</d>      <d>7</d>
    </row>
    <row>
      <d>3</d>        <d>16</d>           <d>F</d>      <d>6</d>      <d>7</d>
    </row>
    <row>
      <d>3</d>        <d>17</d>           <d>F</d>      <d>44</d>     <d>7</d>
    </row>
  </table>
</madeline-xml>

I am using madeline2 as of commit 8ab82ad51151e4f49e4124ff04afc15a1579fac6 from github.

piratical commented 1 year ago

The best workaround is exactly as the-x-at mentions above: break the nuclear family with mother 7 and father 44 and offspring 17 off into a separate nuclear family. Madeline2 can render the descent trees of one person married to multiple partners as long as that one person is part of the original descent tree. For example, male 6 is married to female 7. Now suppose that male 6 has a second or third spouse and children from both the 2nd and 3rd partner, the pedigree would render correctly, because 6 is himself a descendent of 1 and 2 who form the "original ancestral pair" for that descent tree. But, unfortunately, Madeline2 has problems with "married in" partners who themselves also have other partners. So, female 7 is "married in" to the descent tree that began with 1 and 2. But 7 also has another partner, 44, ... and this other descent tree is what messes things up. Unfortunately, there are no plans to fix this anytime soon.