about summary refs log tree commit diff
path: root/test/python/test_groups.py
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-14 03:02:37 +0000
committerPjotr <wrk@bosa.lan>2026-11-14 03:02:37 +0000
commita0d7a37d65e98fc874617d5b08983fe66c5f2655 (patch)
tree7374546579e518a9c95e62b5a1cf473048349ce6 /test/python/test_groups.py
parenta5d6437a90686e97b5c410af3a3479114e4ab9c5 (diff)
downloadgenenetwork4-a0d7a37d65e98fc874617d5b08983fe66c5f2655.tar.gz
individuals: select who enters a mapping, by name
Parents and F1s are excluded by default (as in GeneNetwork2/3), with
include_parents_f1 to keep them all. That boolean was not enough for what was
asked -- "include these, drop that substrain" -- and the exclusion list itself
is data (parents_and_f1s.json, seven groups) that no request can reach. F1
names also differ per group (B6D2F1 for BXD, BHF1/HBF1 for BXH,
C57BL/6JxBXD037F1 for the intercross F1s), so pattern matching is the wrong
tool.

Every group-mapping endpoint -- /compute/gemma, /compute/gemma/ravanan,
/compute/rqtl, /compute/qtl2, /compute/fitqtl, /compute/bulklmm -- now takes

  "individuals": {"include": [...], "exclude": [...]}

applied after the parent/F1 rule, exclude winning over include. An unknown name
is a 422 invalid_individuals whose message lists the panel: a silently dropped
animal changes a kinship matrix without anyone noticing, so the failure has to
be loud. genotypes::select_panel is the one implementation, and it returns what
it did (dropped parents/F1s, re-included by name, excluded by name) so the
Genotype note can say it: "197 individuals, 38 parents/F1s dropped; 1 excluded
by name".

The note now also spells out the distinction that makes this option
treacherous: the kinship uses *every* individual in the genotype file, the
association uses only those with a trait value -- GEMMA reads no phenotypes for
the kinship. So "include the F1s" changes the relatedness structure without
putting the F1s in the fit, and a request can legitimately have 234 individuals
in the genotype file and 34 in the association. Verified on BXD.8: excluding
BXD1 gives 197 individuals / 33 values; include_parents_f1 with an F1
re-included and a substrain excluded gives 234 / 34.

A basket supplies values by name, so a selection applies to a basket-fed
mapping the same way: the individuals excluded are simply not in the panel any
more, and their basket values are ignored.

GenotypeError gains Invalid for this (422) so a caller's typo is not reported
as a missing genotype file; the read-only endpoints that can never see one map
it the same way for exhaustiveness.
Diffstat (limited to 'test/python/test_groups.py')
0 files changed, 0 insertions, 0 deletions