diff options
author | Pjotr Prins | 2024-05-08 09:16:16 +0200 |
---|---|---|
committer | Pjotr Prins | 2024-05-08 09:16:16 +0200 |
commit | 08fa74f000c55d42f6e39d9125015ff07cf44d38 (patch) | |
tree | 58138f8b22328ffac42d77e38c831b0ed1d472a2 | |
parent | ac351e7f5202e8992382e811ba09714a26b3ccd0 (diff) | |
download | gn-guile-08fa74f000c55d42f6e39d9125015ff07cf44d38.tar.gz |
Collate trait values
-rwxr-xr-x | scripts/precompute/list-traits-to-compute.scm | 25 |
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) )))) |