about summary refs log tree commit diff
path: root/scripts/plot-rqtl.py
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 18:45:52 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 18:45:52 +0000
commitb223757bb5c04d03be5ccccf32488594134bb542 (patch)
treeab134383ab2dfe73878b0b785708a79e6195177b /scripts/plot-rqtl.py
parent3854e38fd8c4521df1f501dd6b093fe8b27a840a (diff)
downloadgenenetwork4-b223757bb5c04d03be5ccccf32488594134bb542.tar.gz
rqtl: the rows are `data`, and the permutation null is meta.permutation
Every compute endpoint kept its rows in `data` except this one, which put them
under `data.markers` beside `data.permutation`.  A script written from SKILL.md
("rows are positional") broke on the first scan it read, and the same script had
to special-case both shapes -- measured in Rob Williams's test drive of the
release service.

`data` is now the marker array (positional, `meta.columns` names the columns,
as /compute/gemma and /compute/qtl2 already did), and the permutation null goes
to `meta.permutation`, where Meta's own documentation says endpoint-specific
qualifier information belongs.  /plot/rqtl and scripts/plot-rqtl.py accept both
shapes, so a saved reply from an older build still plots.
Diffstat (limited to 'scripts/plot-rqtl.py')
-rw-r--r--scripts/plot-rqtl.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/plot-rqtl.py b/scripts/plot-rqtl.py
index 73d8c51..b24a14f 100644
--- a/scripts/plot-rqtl.py
+++ b/scripts/plot-rqtl.py
@@ -28,8 +28,13 @@ def main():
     if "data" not in doc:
         sys.exit(f"{a.result}: no 'data' member (error response?): {str(doc)[:200]}")
     res = doc["data"]
-    rows = res["markers"]            # [name, chr, pos_mb, lod]
-    perm = res.get("permutation")
+    # `data` is the marker array itself (a reply from before that change kept
+    # it under `data.markers`), and the permutation null sits beside it in
+    # meta; older replies carried it inside data.
+    rows = res if isinstance(res, list) else res["markers"]
+    perm = (doc.get("meta") or {}).get("permutation") or (
+        res.get("permutation") if isinstance(res, dict) else None
+    )
     thr = []                          # (value, label, dash)
     if perm:
         thr = [(perm["significant"], "significant (95%)", "7 4"),