about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-09 13:00:47 +0000
committerPjotr <wrk@bosa.lan>2026-11-09 13:00:47 +0000
commit216d1491435cce156f89a01684eb5c07e07db31e (patch)
treeee9eb9b183a60c4916ae9d26c60d7a26876a1fc6 /test/python
parentc560ce726bc0c45ac87b8f0f9bf83870e25ac195 (diff)
downloadgenenetwork4-216d1491435cce156f89a01684eb5c07e07db31e.tar.gz
compute: report GEMMA's effect size next to the score
A GEMMA row now carries the effect beside the p-value it belongs to:
`… beta, se, l_mle, additive, p_lrt`. `additive` is `-beta/2`, which is
what GeneNetwork's own tables and CSV call the additive effect
(gn2/wqflask/marker_regression/gemma_mapping.py:240). Halved because half
the difference between the two homozygotes is the usual additive effect;
negated because GN2's BIMBAM conversion codes `@mat` as 1, so GEMMA's beta
is per *maternal* copy while GeneNetwork's published sign is anchored on the
other allele. Two facts that make this worth doing carefully:

* `beta` and `se` are left exactly where GEMMA put them. `se` is what makes
  the effect interpretable (`beta +/- 1.96*se` is a 95% interval) and both
  are GEMMA's own numbers, so replacing them with a derived one would lose
  information;
* the derived column goes *before* the p-value, not after it. `p_lrt` must
  stay the last column: `gemma::peak_marker` reads `row.last()` for the peak
  (and with it the PheWAS and plot suggestions), and the plotters and the
  docs all say "the last column is the p-value". Appending would have
  silently pointed every peak at an effect size.

The response also says what the three columns mean, and that they describe
*this run* on these samples and this genotype version -- not the `additive`
trait info reports, which came from the published mapping (trait 20010:
this run -0.54, published +2.118, same peak marker).

Nothing is added when GEMMA wrote no `beta` (a non-LMM run): the columns
are then exactly GEMMA's.

* src/gemma.rs: `with_effect_size`, applied by `parse_assoc_file`, so
  /compute/gemma and /compute/gemma/ravanan both get it.
* src/routes/gemma.rs: the note.
* tests: four unit tests (placement, sign and halving, `peak_marker` still
  finds the peak from the last column, a table without beta untouched, a
  null effect for a row with `NA` beta) and one end-to-end test asserting
  the column sits immediately before `p_lrt`, every value is `-beta/2`,
  `p_lrt` stays a probability, and the note is there.
* README.md (the response example and what the column means),
  docs/www/SKILL.md (how to read and quote it).

286 tests pass; the same four as before do not.
Diffstat (limited to 'test/python')
0 files changed, 0 insertions, 0 deletions