From 8e8263c374f84fb9cbd6c3a0da7b7f17e6e06c72 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 9 May 2024 10:33:53 +0200 Subject: Full test for whether a data-id belongs to the BXD --- scripts/precompute/list-traits-to-compute.scm | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'scripts/precompute') diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm index 1fadb4a..e954b14 100755 --- a/scripts/precompute/list-traits-to-compute.scm +++ b/scripts/precompute/list-traits-to-compute.scm @@ -70,25 +70,11 @@ 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 - (let [(bxd-strains (bxd-strain-id-names #:used-for-mapping? #t))] + (let [(bxd-strains (memo-bxd-strain-id-names #:used-for-mapping? #t))] (define (run-list-traits-to-compute db prev-id count) (let* [(hits (get-precompute-hits db prev-id count)) (data-ids (map (lambda (hit) @@ -101,7 +87,7 @@ When that is the case we might as well write the phenotype file because we have (data-ids-query (string-join data-str-ids " OR ")) (query (string-append "SELECT Id,StrainId,value FROM ProbeSetData WHERE " data-ids-query)) ] - (display query) + ;; (display query) (dbi-query db query) (let [(id-traits (get-rows db '())) (nrecs '())] @@ -114,15 +100,16 @@ When that is the case we might as well write the phenotype file because we have (acons strain-id value has-lst) '()) )] - ;; (display lst) (set! nrecs (assoc-set! nrecs data-id lst)))) id-traits) (for-each (lambda (r) - (if (is-bxd? (cdr r)) - (display r) + (if (has-bxd? (cdr r)) + (begin + (display (car r)) + (newline)) )) nrecs) ; (display nrecs) ))) - (run-list-traits-to-compute db 0 5) ;; start precompute + (run-list-traits-to-compute db 0 1000) ;; start precompute ;; (write bxd-strains) )))) -- cgit v1.2.3