diff options
| author | Pjotr <wrk@bosa.lan> | 2026-11-16 18:44:13 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-11-16 18:46:02 +0000 |
| commit | 74a5c318163ab4c286e8b8e43bd645c1c4840605 (patch) | |
| tree | 5e1bfddc7425b359ca384be59b3f630cacdcabb4 /scripts/plot-genotypes.py | |
| parent | 304b92e310df9570a67ef3cdd3bbcc714569bc83 (diff) | |
| download | genenetwork4-74a5c318163ab4c286e8b8e43bd645c1c4840605.tar.gz | |
make-mdb.sh: impute missing genotypes, because pangemma cannot represent them
pangemma's mdb path has no missing-data handling -- mdb_calc_kin in src/gemma_io.cpp still carries the comment "[ ] handle missing data" -- and one NA poisons the whole matrix. Measured on BXD.8 (235 individuals, 21 056 markers, 0.1% missing): a store built straight from the BIMBAM gave a 235x235 matrix of -nan in 0.1 s with "**** INFO: Done." and exit 0; the same data with NAs replaced by each marker's mean gave a clean 235x235 matrix, and -lmm 9 on one chromosome then produced 1 452 markers matching GEMMA's on 1 171 of them. So the script imputes per marker (awk, one streaming pass, no Python needed) by default and --keep-missing turns that off for anyone who wants the raw store. NOT what GEMMA does, measured afterwards: GEMMA keeps the missing genotype and reports it (n_miss=1 in its .assoc.txt) while analysing one individual fewer for that marker -- 286 of 1452 markers on chromosome 1 carry a missing value, and their p-values differ from the imputed run (0.732 against 0.698 for rsm10000000731) because n goes 235 -> 234. So imputation is a deliberate deviation the mdb path forces, not a reproduction of the direct path: on the 286 markers with a missing genotype, pangemma+mdb and gemma+BIMBAM are answering slightly different questions, and the endpoint has to say so. Also measured while checking: a File input is what ravanan hashes, and the store's LMDB lock is a sibling (<name>.mdb-lock), not a file inside it -- the .mdb's sha1 is identical before and after a read while the lock's bytes change on every open. So deleting the lock after writing gives a stable identity and the lock that comes back when a reader opens the store costs nothing.
Diffstat (limited to 'scripts/plot-genotypes.py')
0 files changed, 0 insertions, 0 deletions
