about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-16 21:23:45 +0000
committerPjotr <wrk@bosa.lan>2026-11-16 21:23:45 +0000
commitbce93d3deedfc4f0a00a931b1b06ee1c9e8520d1 (patch)
tree4628a096992c2a943fcef8214e68200c13b29d81 /scripts
parent7f6d92b546892ea5dba5a3f5df541c77c229f1e4 (diff)
downloadgenenetwork4-bce93d3deedfc4f0a00a931b1b06ee1c9e8520d1.tar.gz
impute: make the hmm path able to run at all -- three bugs
impute=none and impute=mean already worked; impute=hmm died every time with
"gemma-wrapper's response listed no association output files", which named
neither the cause nor the place.  Three separate faults, each measured:

1. chromosomes_from split the SNP map on whitespace only.  The panel's own
   file reads "marker, 3001490, 1" (spaces after the commas) and the HMM file
   scripts/qtl2-impute-bimbam.R writes reads "marker,3001490,1" -- one token --
   so the chromosome list came back empty and ravanan was handed an empty
   scatter.  It now splits on commas and whitespace both.
2. The HMM calls come from the qtl2 cross, whose individuals are the whole
   panel: 235 for BXD.8 against the 198 animals that carry trait values.
   Passing the panel's positional values against those columns makes every
   individual missing -- GEMMA says "no individuals in common", ravanan says
   "no association output files".  The R script now also writes
   <prefix>.individuals.txt and the ravanan path re-aligns the trait values to
   it by name; the reply says how many individuals the HMM calls carry.
3. A relative PREPARE_GENOTYPES ("scripts/prepare-genotypes.sh") is only found
   when the server runs from its checkout.  An instance started elsewhere
   answered "could not run scripts/prepare-genotypes.sh: No such file or
   directory".  A relative default is now resolved against the checkout that
   GEMMA_RAVANAN_WORKFLOW points into.

State after these: none 200 (21 055 rows), mean 200 (21 056 rows, with its
note), hmm now runs the whole workflow (the run took 32 minutes single-machine
before failing) and stops on ravanan's own manifest cache -- "source file
.../manifest.scm newer than compiled .../ccache" -- which is the next thing to
fix and is not about genotypes.

Same-genotype agreement, measured separately (gemma on the HMM BIMBAM versus
pangemma on an LMDB store built from that same file): identical top marker
(rsm10000010578, p 1.04e-05), Spearman rho 0.999971, top-50 overlap 50/50,
median |difference in -log10 p| 0.00000.  The engines agree; what was left was
plumbing.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qtl2-impute-bimbam.R6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qtl2-impute-bimbam.R b/scripts/qtl2-impute-bimbam.R
index 4003f4e..df5f6d6 100755
--- a/scripts/qtl2-impute-bimbam.R
+++ b/scripts/qtl2-impute-bimbam.R
@@ -82,6 +82,12 @@ for (chr_name in names(imputed)) {
 
 writeLines(vapply(rows, paste, character(1), collapse = ","),
            paste0(out_prefix, ".bimbam.txt"))
+# The individual order of the calls, because it is the *cross's* order and not
+# necessarily the panel's: a caller that writes a phenotype file positionally
+# has to align to this, or the two disagree by name and every individual is
+# missing (measured: gemma answered "no individuals in common" and ravanan
+# reported no association files at all).
+writeLines(colnames(imputed[[1]]), paste0(out_prefix, ".individuals.txt"))
 writeLines(vapply(snps, paste, character(1), collapse = ","),
            paste0(out_prefix, ".snps.txt"))