about summary refs log tree commit diff
path: root/scripts/plot-rqtl.py
diff options
context:
space:
mode:
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"),