about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPjotr Prins2024-05-08 09:59:49 +0200
committerPjotr Prins2024-05-08 09:59:49 +0200
commitbac78b1607851096cdf48c46bbd1e5dd9c31fe96 (patch)
treed67cff0a0dedce1b492c2b69a41344e79cf55c8f
parent08fa74f000c55d42f6e39d9125015ff07cf44d38 (diff)
downloadgn-guile-bac78b1607851096cdf48c46bbd1e5dd9c31fe96.tar.gz
Use match to select for BXD traits
-rwxr-xr-xscripts/precompute/list-traits-to-compute.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm
index c87b005..1fadb4a 100755
--- a/scripts/precompute/list-traits-to-compute.scm
+++ b/scripts/precompute/list-traits-to-compute.scm
@@ -70,6 +70,21 @@ When that is the case we might as well write the phenotype file because we have
              (srfi srfi-1)
              )
 
+(define (is-bxd? trait-values)
+  (display "HEY")
+  (display trait-values)
+  (newline)
+  (match trait-values
+    [(trait . rest) (begin
+                      (display "PARSE")
+                      (display trait)
+                      (match trait
+                        [(strain . value) (if (= strain 5)
+                                              #f
+                                              (is-bxd? rest))])
+                      (newline))]
+    [() #f]))
+
 (call-with-db
  (lambda (db)
    (begin
@@ -103,7 +118,9 @@ When that is the case we might as well write the phenotype file because we have
                       (set! nrecs (assoc-set! nrecs data-id lst))))
                        id-traits)
              (for-each (lambda (r)
-                         (write r) (newline)) nrecs)
+                         (if (is-bxd? (cdr r))
+                             (display r)
+                         )) nrecs)
              ; (display nrecs)
            )))
        (run-list-traits-to-compute db 0 5) ;; start precompute