aboutsummaryrefslogtreecommitdiff
path: root/scripts/precompute/list-traits-to-compute.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/precompute/list-traits-to-compute.scm')
-rwxr-xr-xscripts/precompute/list-traits-to-compute.scm27
1 files changed, 7 insertions, 20 deletions
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)
))))