aboutsummaryrefslogtreecommitdiff
path: root/scripts/precompute
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/precompute')
-rwxr-xr-xscripts/precompute/list-traits-to-compute.scm25
1 files changed, 17 insertions, 8 deletions
diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm
index 6e9dcb3..c87b005 100755
--- a/scripts/precompute/list-traits-to-compute.scm
+++ b/scripts/precompute/list-traits-to-compute.scm
@@ -88,15 +88,24 @@ When that is the case we might as well write the phenotype file because we have
]
(display query)
(dbi-query db query)
- (let [(id-traits (get-rows-apply db
- (lambda (r)
- (let [(id (assoc-ref r "Id"))
+ (let [(id-traits (get-rows db '()))
+ (nrecs '())]
+ (for-each (lambda (r)
+ (let* [(data-id (assoc-ref r "Id"))
(strain-id (assoc-ref r "StrainId"))
- (value (assoc-ref r "value"))]
- `(,id ,strain-id ,value)))
- '()))]
- (display id-traits))
- ))
+ (value (assoc-ref r "value"))
+ (has-lst (assoc-ref nrecs data-id))
+ (lst (if has-lst
+ (acons strain-id value has-lst)
+ '())
+ )]
+ ;; (display lst)
+ (set! nrecs (assoc-set! nrecs data-id lst))))
+ id-traits)
+ (for-each (lambda (r)
+ (write r) (newline)) nrecs)
+ ; (display nrecs)
+ )))
(run-list-traits-to-compute db 0 5) ;; start precompute
;; (write bxd-strains)
))))