forensicgenetics
jennifer
import "@deckyard/forensicgenetics/" as forensicgenetics;The entry module: profiles, reference frequencies, match probability and mixtures. Signatures, struct fields and constant values are in the Cheatsheet; this page lists the rules the functions apply.
Conventions
- Allele labels are strings, compared verbatim.
genotypeorders a pair by repeat count when both alleles are numeric, lexicographically otherwise. - Builders (
withLocus,withGenotype) return a copy and leave the argument unchanged. - Loci and map keys keep insertion order;
commonLocifollows profile order. alleleFrequencyfloors at5/(2N)and caps at 1.0; atn = 0there is no floor.genotypeFrequencyand the PI sum are capped at 1.0.thetamust be in[0, 1). The mixture functions take none.- Panel functions use every locus of the profile or mixture and throw on one the table lacks; narrow with
commonLociandrestrict. - The
Acrossweights must be non-negative, one per table, and sum to 1 within 0.001.
Background: Profiles and genotypes, Reference frequency data, Theta, Match probability, Mixtures.
Errors
Error{kind: "forensicgenetics"}, thrown for:
- a locus the database lacks, or a profile untyped at a locus asked for (
genotypeAt,restrict) - in
withLocus: an empty locus name, a negativen, a frequency outside(0, 1], or frequencies summing pastMAX_FREQUENCY_SUM - an unlisted allele at a locus with
n = 0(no frequency and no floor) - an empty locus name or allele label in
genotype; a locus listed twice inprofile - a non-numeric allele passed to
alleleValue - a theta outside
[0, 1) - an empty profile; a mixture with no loci, or a locus with no alleles
- a profile and mixture sharing no locus (
isIncluded) - in
combineFrequencies: an empty list, no shared locus, or a shared locus withn = 0in every input - in the
Acrossfunctions: an empty list, a weight count that differs from the table count, a negative weight, or weights not summing to 1 - a zero RMP in a likelihood-ratio function (only through underflow)