about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-10 11:25:49 +0000
committerPjotr <wrk@bosa.lan>2026-11-10 11:25:49 +0000
commit8f4a9512d7fb4ac518341f23a4b062ccf80e2a7d (patch)
tree698de016efbd16f2a659eac3f57c8df40babdf2f /test/python
parent7646276e63fb7c4a7433530cfc3314ace3d362d8 (diff)
downloadgenenetwork4-8f4a9512d7fb4ac518341f23a4b062ccf80e2a7d.tar.gz
compute/qtl2: multiparent crosses, by name
A multiparent population cannot come from a .geno. That file carries two
codes per marker (B/D, A/H/B) -- a collapse, not a founder allele -- and
the collapse is not invertible, so DOL's 194 DO animals cannot be fitted
as a DO however much reference data appears. What can be is a cross that
ships its own qtl2 control file with founder genotypes, so the endpoint
now takes one by name:

  {"rqtl2_cross": "do", "trait_name": "DO::10001 (WBC)", "samples": ...}

  * resolve_control_file looks in genotype/rqtl2/{name}.json, then
    {name}/{name}.json (do/do.json), then {name}.json under
    GENOTYPE_FILES; prepare_control_cross reads the cross's pheno, maps
    and founder_geno headers without converting anything. It reports
    crosstype, founders and whether the cross is multiparent, and
    refuses a multiparent crosstype with no founder_geno rather than
    silently scanning it as biallelic.
  * Samples are matched to the cross's own population by name and the
    strays are counted in notes; rqtl2_cross cannot be combined with
    group or genotype_file.
  * The gate is given individuals x founders, because a multiparent scan
    fits one coefficient per founder allele at every marker.
  * Autosomes only now applies to shipped crosses as well: the DO's X is
    left out (369 markers) instead of being fitted without a sex
    covariate, and the script subsets with cross[, chr = autosomal].

Measured on the DO (WBC, 742 individuals, 8 founders, 6044 autosomal
markers): probabilities 174 s / 1.39 GB (cached), LOCO kinship 15 s
(cached), scan 21 s. scan1 runs on one core for a multiparent cross
because its forked path stalls on allele probabilities here -- 25+
minutes at 8 cores with no CPU consumed, against 21 s serial.

Two bugs found by running an actual published trait through it:

  * do_pmap.csv is in Mb, not the bp qtl2 documents, so every DO peak was
    reported at 0.0 Mb. The map's unit is now detected from its largest
    position and printed.
  * The phenotype file was read with the default whitespace separator, so
    a label with a space ("DO::10001 (WBC)") split into three fields and
    read.table stopped with "line 1 did not have 3 elements". Both the
    pheno and covariate reads are tab-separated now.

The R error extraction also joins R's wrapped continuation line, so a
complaint reads as a sentence rather than "Error in scan(...) :".
Diffstat (limited to 'test/python')
0 files changed, 0 insertions, 0 deletions