# New filter rules for genetic genealogy

**URL:** <https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352>\
**Category:** Development\
**Tags:** hacks, new\_filter\_rules\
**Created:** [April 6, 2020, 4:42pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352 "2020-04-06T16:42:36Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [April 9, 2020, 4:32pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/21 "2020-04-09T16:32:09Z")

</div>

I’ll change the filter rules to following names and descriptions to avoid confusion:

1. `Patrilineal progenitor of <person>`  
Matches the earliest recorded patrilineal ancestor father.
2. `Matrilineal progenitorix of <person>`  
Matches the earliest recorded matrilineal ancestor mother.
3. `Y-chromsomal inheritance of <person>`  
Matches recorded descendants of person following Y-chromsomal inheritance patterns.
4. `Mitochondrial inheritance of <person>`  
Matches recorded descendants of person following mitochondrial inheritance patterns.
5. `Y-chromsomal inheritance of <filter>`  
Matches recorded descendants of a filter result following Y-chromsomal inheritance patterns.
6. `Mitochondrial inheritance of <filter>`  
Matches recorded descendants of a filter result following mitochondrial inheritance patterns.

> [@emyoulation](#):
>
> If you wanted to make them more flexible, you could add an optional checkbox for ‘only biological relationships’ for 1, 2, 3 &5. It wouldn’t make sense for 4 & 6 since that is a built-in variant.

I won’t add the checkboxes to this set of filter rules, because I want them to follow stricktly the genetic inheritance patterns, but I can create new filter rules following the male or female lines or other inheritance patterns with an option for including non-biological descendants.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 4:34pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/22 "2020-04-09T16:34:33Z")

</div>

> [@Mattkmmr](#):
>
> Any suggestions how I should update the description to make it less confusing?

Why not

- Patrilineal progenitor by ‘Birth’ relationships
- Matrilineal progenitor by ‘Birth’ relationships
- Patrilineal descendants by ‘Birth’ relationships
- Matrilineal descendants by ‘Birth’ relationships

It makes clear that it is not making actual DNA searches and that the relationships are by Birth. Maybe expand the Description to include something like: "… the search results are the presumed Y-DNA results passed on by fathers to biological sons.

---

<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:** [April 9, 2020, 4:37pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/23 "2020-04-09T16:37:25Z")

</div>

@Mattkmmr  
Need to reiterate in this thread how much I appreciate these additions that you’re coding.

Filters seem to be a great place to get my feet wet with customizing Gramps. I’m learning a lot from your postings.

Thank YOU!!!

---

<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:** [April 9, 2020, 4:43pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/24 "2020-04-09T16:43:18Z")

</div>

![AddRule-selector-dialog-PersonFilters-example-50](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/0e74327aabed61eca35c3ee057034c3b44875ed1.png)

In choosing a Rule name, we need to keep the character limits of the interface in mind. We could get VERY explicit but the names need to be as terse as possible with the most critical criteria early.

Also, the convention seems to also require indicating the parameter. So the ‘of \<person\>’ portion wouldn’t be optional for the name

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 4:53pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/25 "2020-04-09T16:53:22Z")

</div>

> [@Mattkmmr](#):
>
> I won’t add the checkboxes to this set of filter rules, because I want them to follow stricktly the genetic inheritance patterns, but I can create new filter rules following the male or female lines or other inheritance patterns with an option for including non-biological descendants.

I experimented with adding the ‘Adopted’ sons to the SharedYDNA file. I named it ‘Male Line Descendants’. Besides changing the description verbiage, etc I added three lines of code.

```
for family_handle in family_list:
    family = self.db.get_family_from_handle(family_handle)
    for child_ref in family.get_child_ref_list():
        child = self.db.get_person_from_handle(child_ref.ref)
        if (child_ref.get_father_relation() == _("Birth") and
                child.get_gender() == 1):
            male_children.add(child_ref.ref)
        if (child_ref.get_father_relation() == _("Adopted") and
                child.get_gender() == 1):
            male_children.add(child_ref.ref)
return male_children

```

Not sure of the best way to share this.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 4:58pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/26 "2020-04-09T16:58:37Z")

</div>

True and should be remembered but now moot as @Mattkmmr has come up with a solution. My suggestion was half a minute too slow.

And that window has vexed me because I have not yet figured out how to permanently expand that selection window.

---

<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:** [April 9, 2020, 5:08pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/27 "2020-04-09T17:08:32Z")

</div>

> [@Mattkmmr](#):
>
> > [@emyoulation](#):
> >
> > If you wanted to make them more flexible, you could add an optional checkbox for ‘only biological relationships’ for 1, 2, 3 &5. It wouldn’t make sense for 4 & 6 since that is a built-in variant.
> 
> I won’t add the checkboxes to this set of filter rules, because I want them to follow stricktly the genetic inheritance patterns, but I can create new filter rules following the male or female lines or other inheritance patterns with an option for including non-biological descendants.

Was hoping we could minimizing addition of rare use add-on rules that are a simple exception. The rules lists could become overwhelming very quickly. (And my selfish reason… And the documentation burden would be lighter too! Only 1 entry in the [Add-on list](https://gramps-project.org/wiki/index.php/5.1_Addons#Addon_List) page, 1 section in the [Rule Expansions](https://gramps-project.org/wiki/index.php/Rule_expansions) page, & 1 screen capture. Note that Rules haven’t yet been inserted in the [Add-on List](https://gramps-project.org/wiki/index.php/5.1_Addons#Addon_List) because we haven’t sussed out some oddities in the management of Rules.)

The primary use would be for biological relationships with the rare case including the adopted & hired womb babies.

So how about making the checkbox for the rare-case with the defaults being for the general case? The deselected by default checkbox might be ❏_include all dependant relationships_. (Although that still feels like awkward wording)

---

<div class="post-metadata">

**Author:** ![GBaynes](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/gbaynes/32/20_2.png) [@GBaynes](https://gramps.discourse.group/u/GBaynes)\
**Post date:** [April 9, 2020, 7:26pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/28 "2020-04-09T19:26:06Z")

</div>

This is rule by committee, Everybody has an opinion, but at the end of the day someone has to decide.

Are these filters Issued yet or are they in Beta ?

---

<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:** [April 9, 2020, 7:34pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/29 "2020-04-09T19:34:21Z")

</div>

Yup, “_by Committee_” is pretty much the entire concept of Open Source!

That said, Matt is creating them and has final say on his contributions. But he’s welcome to choose when to tell us to shut up. I try to show my appreciation by adding them to the wiki so he doesn’t have to.

He has been graciously posting to the GitHub repository for others to try out. They haven’t gone through code review yet and are still at the ‘Potentially hazardous. Use at your own risk’ stage!

You have to know enough (be enough of a daredevil) to be able to install manually. Once they pass through peer/code review, then an admin will add them to the Update manager and installation becomes easy enough for everyone,

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 7:38pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/30 "2020-04-09T19:38:00Z")

</div>

> [@DaveSch](#):
>
> And that window has vexed me because I have not yet figured out how to permanently expand that selection window.

Found It!! 💥

Time well spent while social distancing!!

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 7:43pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/31 "2020-04-09T19:43:08Z")

</div>

> [@GBaynes](#):
>
> Are these filters Issued yet or are they in Beta ?

@Mattkmmr posted links to the files (or to the code) in the first post to this thread.

---

<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:** [April 9, 2020, 8:14pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/32 "2020-04-09T20:14:33Z")

</div>

Hey @Mattkmmr  
I just re-read the add-on Rules docs and noticed that we can’t credit your work properly yet. Add-ons are normally credited in the Add-On list. But add-on Rules are doing funky things with the Plug-in Manager. So Rules haven’t been added there yet.

It is currently an All-or-nothing proposition. You can’t install & de-install one. Gramps applies the changes to all downloaded Rules at the same time. I suppose you have a measure of control because you can choose not to download. But Rule downloads tend to be bundled in sets rather than individual rules. And groups of distinctly different rules don’t slot into the compact Add-on List Table cleanly.

So far, only you and Paul have posted Rule contributions. Paul’s got his fingerprints all over Gramps. (In a _ **GOOD** _ way, @prculley !) So what would you like us to do for your credit until there’s some solution for the Rules in the Addon/Plugin Manager section?

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 8:45pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/33 "2020-04-09T20:45:21Z")

</div>

> [@emyoulation](#):
>
> So far, only you and Paul have posted Rule contributions.

You need to look more closely. There is a source filter rule that I had a part in. In fact it was the first addon rule. Although I was shocked when Paul got it into a working form that he included me in the credits. My contribution was to copy existing code and get it configured to be used as a new builtin standard rule. He did all the work to make it an addon so it could be pushed out to the user needing it.

@prculley rocks!! Or should I say rules!!

---

<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:** [April 9, 2020, 9:16pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/34 "2020-04-09T21:16:31Z")

</div>

He certainly does!

Sorry for missing your Contribution. That’s another reason Sam’s been trying to find a way to drive some sort of synchronization between that wiki table wiki & download manager. Its too easy to overlook someone’s significant efforts.

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 9, 2020, 9:41pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/35 "2020-04-09T21:41:31Z")

</div>

Do not overplay my “significant efforts”. 😉

---

<div class="post-metadata">

**Author:** ![Geneo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Geneo](https://gramps.discourse.group/u/Geneo)\
**Post date:** [April 11, 2020, 8:53am UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/36 "2020-04-11T08:53:03Z")

</div>

> [@DaveSch](#):
>
> I experimented with adding the ‘Adopted’ sons to the SharedYDNA file. I named it ‘Male Line Descendants’.

@DaveSch Wouldn’t it be a bit confusing to call this filter “Male Line Descendants” if it only includes male male-line descendants? From the name only I would have assumed it includes female male-line descendants too (_vide_ [Filter for male-line descendants](https://gramps.discourse.group/t/filter-for-male-line-descendants/356/24)) Is there a reason why someone might want all patrilineal descendants (including adopted sons) but not daughters? Perhaps it would be more intuitive to have a filter that is called “Patrilineal descendants” that would include all male-line descendants (male or female) - and then the user could easily add the gender filter on top of it?

---

<div class="post-metadata">

**Author:** ![Geneo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Geneo](https://gramps.discourse.group/u/Geneo)\
**Post date:** [April 11, 2020, 8:58am UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/37 "2020-04-11T08:58:30Z")

</div>

> [@Mattkmmr](#):
>
> Matrilineal progenitorix of

I think the correct Latin term would be _progenitrix_.

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [April 11, 2020, 9:03am UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/38 "2020-04-11T09:03:11Z")

</div>

> [@emyoulation](#):
>
> add-on Rules are doing funky things with the Plug-in Manager. So Rules haven’t been added there yet. It is currently an All-or-nothing proposition. You can’t install & de-install one.

That’s probably because all addon filter rules are placed in one folder. We might split them up if the grow a lot, so they can be installed seperatly.

> [@Geneo](#):
>
> I think the correct Latin term would be _progenitrix_ .

Ah right, I’ll rename it. 😅

---

<div class="post-metadata">

**Author:** ![DaveSch](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/davesch/32/40_2.png) [@DaveSch](https://gramps.discourse.group/u/DaveSch)\
**Post date:** [April 11, 2020, 12:15pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/39 "2020-04-11T12:15:40Z")

</div>

Did you not want this ability?

# [Filter for male-line descendants](https://gramps.discourse.group/t/filter-for-male-line-descendants/356)

The filter that was cobbled together included @Mattkmmr male line Y-DNA filter combined with their children.

As I pointed out, this excluded adopted sons.

> [@Filter rule for male-line descendants](https://gramps.discourse.group/t/filter-rule-for-male-line-descendants/356/19):
>
> There is a problem.
> 
> The DNA filters are only valid for “Birth” children. Any “Adopted” child is excluded. This is valid for a DNA filter but may not hold true doing a “Family” filter

My “Male Line Descendants” solved this by making the selecting of the males from a Biological to a Family filter rule.

---

<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:** [April 11, 2020, 2:17pm UTC](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352/40 "2020-04-11T14:17:19Z")

</div>

> [@DaveSch](#):
>
> Found It!! 💥

You gonna make us beg? 🥴

Where?

[Previous page](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352.md?page=1)

[Next page](https://gramps.discourse.group/t/new-filter-rules-for-genetic-genealogy/352.md?page=3)
