From STRidER frequencies to match probabilities

Jennifer

From a STRidER allele-frequency export to a random match probability, with the @skiffyard/strider and @deckyard/forensicgenetics decks.

November 2026, by @mplx.
Based on Jennifer 0.26.0

Powered by Jennifer's Cantrip - Markdown into slide decks, https://github.com/jennifer-language/cantrip
1 / 19

STR profiles in one slide

LocusGenotypeRead as
D3S135815/1715 and 17 repeats of a 4-base motif
vWA17/17the same allele from both parents: homozygous
TH016/9.39.3: nine full repeats and 3 bases of a tenth
2 / 19

From frequencies to a match probability

heterozygote ab:   2 pa pb        homozygote aa:   pa^2
profile:           product over all loci
with theta (NRC II 4.2):
  ab: 2 [t + (1-t)pa] [t + (1-t)pb] / [(1+t)(1+2t)]
  aa: [2t + (1-t)pa] [3t + (1-t)pa] / [(1+t)(1+2t)]
3 / 19

STRidER and its export

This talk uses a tiny invented export in the same shape: populations NORTHLAND and SOUTHLAND, three loci, made-up numbers.

4 / 19

The shape of an export

<frequencies created_timestamp="2026-11-01T09:00:00+01:00" ...>
  <marker>
    <name>D3S1358</name>
    <alleles>14, 15, 16, 17, 18</alleles>
    <origin name="Entire Database" n="12000">
      <frequency allele="14">1.20000e-01</frequency>
      ...
    </origin>
    <origin name="NORTHLAND" n="800"> ... </origin>
    <origin name="SOUTHLAND" n="150"> ... </origin>
  </marker>

Locus-major: each <marker> nests every population as an <origin>.

5 / 19

Two decks, one direction

$ jvc add @skiffyard/strider && jvc install
installed 2 deck(s):
  ok    @skiffyard/strider 0.3.0 -> https://github.com/skiffyard/...
  ok    @deckyard/forensicgenetics 0.5.0 -> https://github.com/deckyard/...
import "@skiffyard/strider/" as strider;
import "@deckyard/forensicgenetics/" as forensics;
6 / 19

parse: every population at once

def t as strider.Table init strider.parse(fs.readString("export.xml"));
io.printf("%s\n", $t.created);
io.printf("%v\n", strider.populations($t));
io.printf("%v\n", strider.loci($t, "SOUTHLAND"));
io.printf("N = %d\n", strider.sampleSize($t, "SOUTHLAND", "vWA"));
io.printf("%v\n", strider.frequencySums($t, "NORTHLAND"));
2026-11-01T09:00:00+01:00
["Entire Database", "NORTHLAND", "SOUTHLAND"]
["D3S1358", "vWA"]
N = 150
{"D3S1358": 1.0, "vWA": 1.0, "TH01": 1.0}
7 / 19

Check the sums before you trust a table

A locus that sums toHappens whentoFrequencyDb
about 1.0the table is soundconverts
0.60truncated, or a value misreadconverts silently
100.00the table is in per centthrows forensicgenetics
parsed, sum 0.60; converted
parsed, sum 100.00; forensicgenetics: locus 'TH01' allele '6':
  frequency must be in (0, 1]
8 / 19

Choose a population, convert

def south as forensics.FrequencyDb init
    strider.toFrequencyDb($t, "SOUTHLAND", "");
io.printf("%s %v\n", $south.name, forensics.loci($south));
io.printf("%v\n", $south.loci["D3S1358"].alleles);
SOUTHLAND ["D3S1358", "vWA"]
{"15": 0.31, "16": 0.29, "17": 0.23, "18": 0.17}
9 / 19

Rare and missing alleles: 5/(2N), on read

io.printf("floor %f|prec=4\n",
    forensics.minFrequency($south, "D3S1358"));
for (def a in ["14", "15"]) {
    io.printf("%s: %f|prec=4\n", $a,
        forensics.alleleFrequency($south, "D3S1358", $a));
}
floor 0.0167
14: 0.0167
15: 0.3100

N = 150 people, 300 alleles: 5 / 300 = 0.0167. Allele 14 is not in the table; it is scored at the floor, never at zero.

10 / 19

A profile and its genotype frequencies

def stain as forensics.Profile init forensics.profile("stain 1", [
    forensics.genotype("D3S1358", "17", "15"),
    forensics.genotype("vWA", "17", "17"),
    forensics.genotype("TH01", "9.3", "6")]);
for (def locus in forensics.profileLoci($stain)) {
    def g as forensics.Genotype init $stain.loci[$locus];
    io.printf("%s %s/%s %f|prec=4\n", $locus, $g.a, $g.b,
        forensics.genotypeFrequency($north, $g, $th));
}
D3S1358 15/17 0.1270
vWA 17/17 0.0886
TH01 6/9.3 0.1424
11 / 19

RMP, likelihood ratio, verbal scale

def rmp as float init
    forensics.randomMatchProbability($north, $stain, $th);
def lr as float init
    forensics.matchLikelihoodRatio($north, $stain, $th);
io.printf("RMP %f|prec=6, LR %f|prec=0, %s\n", $rmp, $lr,
    reporting.verbalEquivalent($lr).label);
RMP 0.001603, LR 624, moderately strong support
12 / 19

The population and theta change the answer

thetaNORTHLANDEntire Database
0 (product rule)747853
0.01 (THETA_GENERAL)624707
0.03 (THETA_ISOLATED)452506

Same stain, same three loci: the likelihood ratio, run for each cell.

13 / 19

Missing loci are refused, not skipped

forensics.randomMatchProbability($south, $stain, $th);     # throws
def used as forensics.Profile init
    forensics.restrict($stain, forensics.commonLoci($south, $stain));
io.printf("%v: LR %f|prec=0\n", forensics.profileLoci($used),
    forensics.matchLikelihoodRatio($south, $used, $th));
forensicgenetics: frequency database 'SOUTHLAND' has no locus 'TH01'
["D3S1358", "vWA"]: LR 54
14 / 19

No N, no floor

def noN as forensics.FrequencyDb init forensics.withLocus(
    forensics.db("no N"), "TH01", 0, {"6": 0.3, "9.3": 0.7});
forensics.alleleFrequency($noN, "TH01", "8");               # throws
forensicgenetics: locus 'TH01' allele '8': no frequency and no 5/2N
  floor (the table is missing its sample size)
15 / 19

Malformed exports and their kinds

InputkindThrown by
broken XML, a frequency like n/aruntimeparse
no <marker>, an allele listed twicestriderparse
a population the export lacksstridertoFrequencyDb, load
per-cent table, frequency 0 or above 1forensicgeneticstoFrequencyDb
runtime: toFloat("n/a"): not a valid float
strider: duplicate allele '6' in 'TH01' / 'X'
strider: no such population in the export: 'AUSTRIA'
16 / 19

Unsure of the population? Do not pool

forensics.matchLikelihoodRatioAcross([$north, $south], [0.5, 0.5],
    $p, $th);
forensics.matchLikelihoodRatio(
    forensics.combineFrequencies([$north, $south], "N+S"), $p, $th);
Two-locus profileLR
NORTHLAND / SOUTHLAND88.8 / 53.9
across, weights 0.5 and 0.567.1
pooled table81.7
17 / 19

What these numbers are not

Use them for research, teaching and cross-checking.

18 / 19

Read more

Based on Jennifer 0.26.0, November 2026.

19 / 19