# New Addon to import DNA match files

**URL:** <https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980>\
**Category:** Development\
**Tags:** third-party-addon, dna\
**Created:** [November 10, 2022, 12:26pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980 "2022-11-10T12:26:11Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 10, 2022, 12:26pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/1 "2022-11-10T12:26:11Z")

</div>

Hi  
I have just put on github my first version my addon to import match files in GRAMPS.  
It s still in early alpha stage and i m not really a good programmer.

It s compatible with the new dnasegmentmap  
it only work for geneanet and myheritage.

you can read the tiny doc here  
[https://github.com/grocanar/glopgrampsaddons/tree/main/addons-source/ImportADNMatch](https://github.com/grocanar/glopgrampsaddons/tree/main/addons-source/ImportADNMatch)

and download it here  
[https://github.com/grocanar/glopgrampsaddons/blob/main/addons/5.1/download/ImportADNMatch.addon.tgz?raw=true](https://github.com/grocanar/glopgrampsaddons/blob/main/addons/5.1/download/ImportADNMatch.addon.tgz?raw=true)

Any comments and help more than welcome

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 13, 2022, 9:28pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/2 "2022-11-13T21:28:04Z")

</div>

In order to use this tool i have written an addon that add a rule which allow to match people that triangulate with two other people.

Here is the code

> **[glopgrampsaddons/addons-source/HasTriangulation at main ·...](https://github.com/grocanar/glopgrampsaddons/tree/main/addons-source/HasTriangulation)**
>
> main/addons-source/HasTriangulation

Any comments welcome

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 13, 2022, 11:27pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/3 "2022-11-13T23:27:30Z")

</div>

Thanks for making your add-on available to everyone!

I’m a bit confused by the name of the folder and add-on. Is ADN a type of dna test or a typographical error?

---

<div class="post-metadata">

**Author:** ![GaryGriffin](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/garygriffin/32/6525_2.png) [@GaryGriffin](https://gramps.discourse.group/u/GaryGriffin)\
**Post date:** [November 14, 2022, 2:31am UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/4 "2022-11-14T02:31:45Z")

</div>

I set the Default person to be the same as the ID and the megabase as 0, I got 0 matches. I thought the ID was the person person whose Association list is checked. When I looked at code, it appears that the default person’s association list is checked against the ID person? Not sure exactly what the rule does. Does it find everyone that has a triangulated segment match that the default person and the ID person have?

When I set the ID to a different person who I had a DNA relationship, I noticed that you only allow comma as the separator. You should also allow TAB. If the line does not have a comma, you get an index error on

> debut=int(L[1])

You need to check the 1st character to see if it is a valid chromosome number (and not a comment). Only process the rest of the line if the chromosome is valid.

I ran with an ID that used comma separators and still got 0 matches. I think this is because most of my Notes use a TAB separator instead of a comma (based on import from FTDNA).

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 14, 2022, 8:07pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/5 "2022-11-14T20:07:28Z")

</div>

Hi  
well i mess up with the name  
ADN is just DNA in french  
perhaps i shoumd change the name.

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 14, 2022, 8:20pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/6 "2022-11-14T20:20:00Z")

</div>

Hi Gary

i wrtoe the rule as an example of use of m addon to import DNA data.  
therefore the format of data was uite regular.  
I will add your suggestion ASAP.

Let me give some explantation.  
To make a triangulation we need three person.  
The first one is the one that make the test and this person is the Home person.  
The second one is usually the person that you don’t have genealogical information. It s the person you select with ID and that match the Home Person.  
and we search in the database the third person that traingulate with the two others with a segment that is greater than the number of megabase you give.

I hope to have been enough clear. .

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 14, 2022, 8:23pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/7 "2022-11-14T20:23:58Z")

</div>

> [@grocanar](#):
>
> well I mess up with the name
> 
> ADN is just DNA in french  
> perhaps I should change the name.

I did not know that ‘deoxyribonucleic acid’ was ‘acide désoxyribonucléique’ in French. Thank you!

But yes, it should probably be ‘DNA’ for the English version.

---

<div class="post-metadata">

**Author:** ![GaryGriffin](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/garygriffin/32/6525_2.png) [@GaryGriffin](https://gramps.discourse.group/u/GaryGriffin)\
**Post date:** [November 14, 2022, 9:02pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/8 "2022-11-14T21:02:47Z")

</div>

Thanks for the explanation. This makes sense. And I can see how this would be useful.

Question: shouldn’t the triangulation be just on the M or P side of the chromosome? That is, if the maternal side of chromosome 1 of the default person overlapped with the paternal side of chromosome 1 for the ID person, I dont think there should be any triangulation. Or am I wrong?

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 14, 2022, 9:22pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/9 "2022-11-14T21:22:43Z")

</div>

hi Gary

you re totally right.  
then one can get some false positive triangulation  
Right now i didn’t have data that give me the paternal and maternal side.

I need to write some tool to add the information based on my genealogy.  
And i will improve my rule.

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [November 14, 2022, 9:37pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/10 "2022-11-14T21:37:34Z")

</div>

> [@GaryGriffin](#):
>
> Question: shouldn’t the triangulation be just on the M or P side of the chromosome? That is, if the maternal side of chromosome 1 of the default person overlapped with the paternal side of chromosome 1 for the ID person, I dont think there should be any triangulation. Or am I wrong?

I think you are wrong in that case. Just consider a simple example of two people matching. My first cousin and I match in a number of places. Her mother was my father’s sister, so the matching segments are on her maternal chromosomes and my paternal chromosomes. In some cases we triangulate with my brother, on his paternal segments. In another case we triangulate with a more distant male cousin on his maternal segments.

But it is indeed to have false triangulations. Consider the three people in this diagram:

 ![image](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/3/3ff2c87e52c96f68d9a1fc36362fb89e197bbf9c.png)

Each color represents a matching segment of DNA on pairs of a given chromosome. Persons A and B have a common ancestor (green), persons B and C have a common ancestor (yellow), and persons A and C have a common ancestor (red). The fact that some are maternal or paternal is not relavant. But if you were not considering that breakdown, and were looking only at the chromosome number, you might think they all match each other, which is not the case here.

(Note that if a fourth person is added to the group, then there must be a true triangulation among some three of them.)

I think the filter rule can still be useful for identifying potential triangulations.

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 15, 2022, 12:01pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/11 "2022-11-15T12:01:56Z")

</div>

Hi

The next step is to write a tool to update DNA association based on genealogy.  
i will put on paternal side if there s only realtion on paternel side  
maternal if maternal  
and unknow if there s nothing or both.  
and the rule will be updated to use that information  
i will do that the same way that Gary did in dnasegmentmap.

---

<div class="post-metadata">

**Author:** ![GaryGriffin](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/garygriffin/32/6525_2.png) [@GaryGriffin](https://gramps.discourse.group/u/GaryGriffin)\
**Post date:** [November 15, 2022, 5:03pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/12 "2022-11-15T17:03:06Z")

</div>

Are you adding an M/P/U flag to the segment info in the Note? I dont recommend that since the SyncAssociation would create the reciprocal relation and it may be on a different side. What if in the future you find a relationship on the other side? That is why DNAsegment calculates the side on the fly, allowing for an override in the segment info.

TAB processing in Note: what I did if the segment info contained a TAB is to remove all commas and then change all TAB to commas and then split based on commas. The source that uses TAB also includes thousands comma separators.

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 15, 2022, 7:34pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/13 "2022-11-15T19:34:20Z")

</div>

Hi Gary  
My opinion is that the SyncAssociatin should not populate the DNA relation as it s not symmetric.  
one can have paternal side and the other maternal side.  
If i add the M/P/O flag i won"t sare anymore the Note.  
But i will think twice about that.  
Perhaps in my triangulation rule i will do the same that you.

For the TAB i will loe at yout code to help me

Thanks for your advice

---

<div class="post-metadata">

**Author:** ![grocanar](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/grocanar/32/6517_2.png) [@grocanar](https://gramps.discourse.group/u/grocanar)\
**Post date:** [November 19, 2022, 8:21pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/14 "2022-11-19T20:21:11Z")

</div>

Hi  
I have update my HasTriangulation rule to use centimorgan cutoff instead of megaase.  
Then i developp a fonction to convert megabase to centimorgan.

perhaps this function could be useful for other addon related to DNA.  
I m wondering what would bbe the best way ro make it available to other addons?

Here is the code of the rule.

> **[glopgrampsaddons/addons-source/HasTriangulation at main ·...](https://github.com/grocanar/glopgrampsaddons/tree/main/addons-source/HasTriangulation)**
>
> main/addons-source/HasTriangulation

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [December 19, 2022, 8:21pm UTC](https://gramps.discourse.group/t/new-addon-to-import-dna-match-files/2980/15 "2022-12-19T20:21:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
