From 53ae1b4cbf8bd68278e7a59cd41a4c145f8362ab Mon Sep 17 00:00:00 2001 From: Pjotr Date: Sun, 11 Oct 2026 20:07:40 +0000 Subject: gemma: default lmm to 9, matching GeneNetwork's own convention GeneNetwork2 (wqflask/marker_regression/gemma_mapping.py) and gn-guile (gn/runner/gemma.scm) both always use -lmm 9 in their working --loco invocations. Checked by running it: gemma-gn2 accepts 9 fine, and the resulting .assoc.txt carries p_lrt, not p_wald -- some mapping other than stock GEMMA's 1-4 scale, not independently verified here, but consistent with what both of those codebases rely on in production. Widened validation from a 1-4 range to the explicit set {1, 2, 3, 4, 9}: 9 is now known-good, but 5-8 remain untested and stock-invalid, so they're still rejected rather than guessed at. Updated the real end-to-end test to assert on p_lrt (what lmm=9 actually produces) instead of p_wald, and moved the out-of-range-lmm test from 9 (now valid) to 5. Verified: cargo test passes in full, including the real gemma-wrapper/ GEMMA run against the BXD fixtures with the new default. Co-Authored-By: Claude Sonnet 5 --- tests/gemma.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/gemma.rs b/tests/gemma.rs index 2529174..d08a088 100644 --- a/tests/gemma.rs +++ b/tests/gemma.rs @@ -66,7 +66,9 @@ async fn compute_gemma_maps_a_qtl_from_the_bxd_fixtures() { let first = &rows[0]; assert!(first.get("chr").is_some(), "{first}"); assert!(first.get("rs").is_some(), "{first}"); - assert!(first.get("p_wald").is_some(), "lmm defaults to 4 (all tests): {first}"); + // lmm defaults to 9 (GeneNetwork's convention); observed to behave + // like LRT, carrying p_lrt rather than p_wald. + assert!(first.get("p_lrt").is_some(), "{first}"); } #[tokio::test] @@ -80,7 +82,9 @@ async fn compute_gemma_rejects_an_out_of_range_lmm() { "genotype_file": test_data_path("BXD_geno.txt.gz"), "snps_file": test_data_path("BXD_snps.txt"), "trait_values": [1.0, 2.0], - "lmm": 9, + // 9 is now accepted (GeneNetwork's convention); 5-8 are stock- + // invalid and untested, so they're still rejected. + "lmm": 5, }); let response = common::post_json_with_token( "POST /compute/gemma (bad lmm)", -- cgit 1.4.1