From bac78b1607851096cdf48c46bbd1e5dd9c31fe96 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 8 May 2024 09:59:49 +0200 Subject: Use match to select for BXD traits --- scripts/precompute/list-traits-to-compute.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3