diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-17 10:54:50 +0000 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-17 10:54:50 +0000 |
| commit | 314dbfd4b834cd7ad30e808587cd1ec3dc30feec (patch) | |
| tree | 203034314ef330827bd72cc18d2ac5f645890b8b /src/param.cpp | |
| parent | c0cf1065f5d128c31ea0b32245837158ac2d57e2 (diff) | |
| download | pangemma-314dbfd4b834cd7ad30e808587cd1ec3dc30feec.tar.gz | |
main: drop the startup Guile example; param: refuse LOCO on PLINK input
Two things that made pangemma unsafe to call, both found by driving it from
gemma-wrapper.
main() called gemmaguile::start_test(), which loaded src/guile/examples.scm
relative to the working directory and printed four lines of example output:
elem 0 = 1.000000
elem 1 = 2.200000
...
So the binary only ran from the source root -- anywhere else the load threw
"open-file: No such file or directory", the process produced no output at
all and still exited 0, which a caller reads as success -- and even from the
right directory those four lines went to stdout, where gemma-wrapper's --json
reply lives. The Guile interpreter is still initialised for the version
banner; the example belongs in a test.
CheckParam had the PLINK LOCO guard commented out, so
`-bfile ... -loco 1` silently computed the *full* K: measured on
example/mouse_hs1940, `-loco 1` and `-loco 2` return the same matrix, in
this build and in GEMMA 0.98.6 alike. A run that looks like a LOCO scan is
then N identical full-data scans, and nothing says so. It is an error now,
naming the two paths that do work (BIMBAM -g, and the lmdb store, which
carries the chromosome in the key).
Checked with the rebuilt binary: -h and -gk now work from any directory with
no stray stdout, the BXD GRM is identical to before (max |diff| 0 against
gemma 0.98.6), the lmdb LOCO path still gives 636 identical rows for chr 1,
and gemma-wrapper no longer prints its spurious "GEMMA version is out of
date" warning -- it reads the 0.98.5 out of the banner and records none.
Diffstat (limited to 'src/param.cpp')
| -rw-r--r-- | src/param.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/param.cpp b/src/param.cpp index 96a9cd2..e2a61ea 100644 --- a/src/param.cpp +++ b/src/param.cpp @@ -946,7 +946,13 @@ void PARAM::CheckParam(void) { if (!loco.empty()) { enforce_msg((a_mode >= 1 && a_mode <= 4) || a_mode == 9 || a_mode == 21 || a_mode == 22, "LOCO only works with LMM and K"); - // enforce_msg(file_bfile.empty(), "LOCO does not work with PLink (yet)"); + // PLINK input cannot do LOCO: the check used to be commented out, and + // measured against this build and GEMMA 0.98.6, '-bfile ... -loco 1' and + // '-loco 2' return the same K -- -loco is ignored without a word, so a run + // that looks like a LOCO scan is really N identical full-data scans. An + // error is the only honest answer; BIMBAM (-g) and the lmdb store both work. + enforce_msg(file_bfile.empty(), + "LOCO does not work with PLINK (-bfile): use BIMBAM (-g) or an lmdb store"); enforce_msg(file_gxe.empty(), "LOCO does not support GXE (yet)"); if (!is_mdb) enforce_msg(!file_anno.empty(), "Without mdb LOCO requires annotation file (-a switch)"); |
