Filters for DNA Data Model#2378
Conversation
|
I'm wondering about gramps/gen/filters/rules/dnamatch/_hasdnamatch.py Here it looks like you are doing two filters: DNA match, plus it also filters on name. My main concern is that getting a person's display name is very expensive and slow. Wouldn't it be better to separate these two filters? The filter optimizer can work better when these two searches are separated. And with planned SQL implementations of filters, it may be possible to make the DNA match very fast, even with a lot of dna tests. For more information on filter optimizations, see: #2350 |
Thanks for the detailed look. This filter was added in the core PR to support sidebar searching on the DNA Match view. As you point out this is probably over broad and doesn't need to filter on the person's name. I'm aware of the filter optimisations idea which I think is great, so it would be good to play nice with it. I'll take a look and experiment a bit with what I feel would be a good compromise. I think any fix will be applied against #2295 for consistency. |
Note that this has the side effect of adding an optional person selector button for the family/_fatherhasidof.py, family/_motherhasidof.py and family/_childhasidof.py filters.
This PR builds on #2295 and adds a range of filters for DNA Tests, DNA Matches and a few for People. Currently this PR is based on master which means it contains all the commits from the
dna-corebranch. Once #2295 is merged this PR will be a lot easier to review. The diff between thedna-coreanddna-filtersbranches can be viewed here: iand/gramps@dna-core...iand:gramps:dna-filtersDNA Test filters
AllDNATests- matches every DNA test (catch-all)HasIdOf- DNA test with a given Gramps IDDNATestPrivate- DNA tests marked privateChangedSince- DNA tests changed after a given date/timeHasReferenceCountOf- DNA tests with a given reference countHasGallery- DNA tests with a given number of mediaHasNote- DNA tests with a given number of notesHasNoteRegexp- DNA tests with a note matching a regular expressionHasNoteTag- DNA tests with a note bearing a given tagHasAttribute- DNA tests with a given DNA attributeMatchesFilter- DNA tests matching another saved DNA test filterHasYHaplogroup- DNA tests whose Y-DNA haplogroup contains textHasMtHaplogroup- DNA tests whose mtDNA haplogroup contains textHasPerson- DNA tests linked to a given personMatchesBothTestsOf- DNA tests that have a match with each of the two tests of a selected DNA match (matches of matches)DNA Match filters
AllDNAMatches- matches every DNA match (catch-all)HasIdOf- DNA match with a given Gramps IDDNAMatchPrivate- DNA matches marked privateChangedSince- DNA matches changed after a given date/timeHasReferenceCountOf- DNA matches with a given reference countHasGallery- DNA matches with a given number of mediaHasNote- DNA matches with a given number of notesHasNoteRegexp- DNA matches with a note matching a regular expressionHasNoteTag- DNA matches with a note bearing a given tagHasAttribute- DNA matches with a given DNA attributeMatchesFilter- DNA matches matching another saved DNA match filterHasSegment- DNA matches with a segment meeting combined criteria (chromosome, min cM, min SNPs, phase, IBD state)HasSegmentOverlapping- DNA matches with a segment overlapping a chromosome regionSharesSegmentWithMatch- DNA matches sharing a segment with another given matchHasSharedAncestor- DNA matches recording a given person as a shared ancestor (optional confidence)HasNoSharedAncestors- DNA matches with no shared-ancestor entriesHasSubjectPerson- DNA matches whose subject kit belongs to a given personHasMatchPerson- DNA matches whose match kit belongs to a given personMatchesSubjectTestFilter- DNA matches whose subject kit matches a saved DNA test filterMatchesMatchTestFilter- DNA matches whose match kit matches a saved DNA test filterPerson filters
HasDNATest- people with a DNA test meeting combined criteria (provider + test type, optional)HasDNATestWithTag- people with a DNA test bearing a given tagHasDNATestWithAttribute- people with a DNA test carrying a given DNA attributeHasYHaplogroup- people with a DNA test whose Y-DNA haplogroup contains textHasMtHaplogroup- people with a DNA test whose mtDNA haplogroup contains textHasDNAMatch- people with at least one DNA matchHasDNAMatchWithSharedAncestor- people with a DNA match recording a given person as shared ancestor (optional confidence)IsSharedAncestor- people recorded as a shared ancestor in any DNA match (optional confidence)IsSharedAncestorInDNAMatchesOf- people recorded as a shared ancestor in the DNA matches of a given personThe following filters are already implemented in the dna-core branch and are in PR #2295
DNA Test filters (dnatest)
HasDNATest- DNA tests whose fields contain a substringHasProvider- DNA tests from a given testing providerHasTestType- DNA tests of a given test typeHasTag- DNA tests carrying a given tagRegExpIdOf- DNA tests whose ID matches a regular expressionIsUnidentified- DNA tests with no linked personDNA Match filters (dnamatch)
HasDNAMatch- DNA matches whose fields contain a substringHasSharedCm- DNA matches with shared cM between a min and maxHasTag- DNA matches carrying a given tagRegExpIdOf- DNA matches whose ID matches a regular expression