about summary refs log tree commit diff
path: root/scripts/plot-rqtl.py
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-16 18:11:38 +0000
committerPjotr <wrk@bosa.lan>2026-11-16 18:11:38 +0000
commit061b76a5d963b7d5e2ce9d858094b305929766f2 (patch)
tree717cd9192f64225a064c91366bd9645efe97fb08 /scripts/plot-rqtl.py
parentea3dd926211e8db4a0d7d3739a606440b888e8b0 (diff)
downloadgenenetwork4-061b76a5d963b7d5e2ce9d858094b305929766f2.tar.gz
scripts/make-mdb.sh: build pangemma's genotype store, lock-free and frozen
pangemma picks an LMDB genotype store by looking for ".mdb" in the -g path
(src/param.cpp:943), so the store's name is part of the interface.  Two of
gemma-wrapper's helpers make it -- anno2mdb.rb then geno2mdb.rb -- and this
script does the three things they leave to the caller:

* the lock file.  Measured on a real store: these environments are single
  files (MDB_NOSUBDIR), and the lock is a *sibling*, <name>.mdb-lock, which
  every open recreates with different bytes (8d3d268b after writing, another
  sha1 after one read-only open, another after a read-write open) while the
  .mdb itself never changes.  Since the .mdb is what gets hashed and interned,
  the lock is deleted after writing and the .mdb is made read-only.
* the name: <name>.geno.mdb, so `-g' recognises it and the outer name says
  which translation it holds (Gf, Gb, G0_1, G0_2).
* atomicity: the makers write beside their input, so they are given links in a
  temporary directory and the finished store is renamed into place; nothing is
  written next to the caller's files (an earlier hand run of anno2mdb.rb put a
  2 MB .mdb into gn4-data, which is exactly the mistake this prevents).

Measured on BXD.8 (21 056 markers, 235 individuals): 0.17 s for the annotation
half, 4.7 s for the genotypes, 29 MB as Gf.

Two things found while testing it, both for the plan rather than this script:
the anno mdb is an intermediate that pangemma does not need (it takes the snps
file with -a), so it is not kept; and a store built from a BIMBAM whose chr/pos
columns are the "X"/"Y" placeholders makes pangemma produce an all-NaN K
silently -- 235 individuals read, no error, a 235x235 matrix of -nan -- because
geno2mdb keys genotypes by (chr,pos) and nothing matches the annotation.
Diffstat (limited to 'scripts/plot-rqtl.py')
0 files changed, 0 insertions, 0 deletions