diff options
author | Pjotr Prins | 2023-11-16 10:37:49 +0100 |
---|---|---|
committer | Pjotr Prins | 2023-11-16 10:37:49 +0100 |
commit | 678d976260c6f566166e0459a425d5ef296b002f (patch) | |
tree | 3b14aee7d57a7c27b901627fbcff984abe15468c /scripts | |
parent | d0761ae4837e15419bda1faf1b19ee6823335f3f (diff) | |
download | gn-guile-678d976260c6f566166e0459a425d5ef296b002f.tar.gz |
Move procedures into mysql.scm and add documentation
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/precompute/precompute-hits.scm | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/scripts/precompute/precompute-hits.scm b/scripts/precompute/precompute-hits.scm index 22bf2d7..cc26a9a 100755 --- a/scripts/precompute/precompute-hits.scm +++ b/scripts/precompute/precompute-hits.scm @@ -26,31 +26,10 @@ (dbi-query db "SELECT StrainId,Strain.Name FROM Strain, StrainXRef WHERE StrainXRef.StrainId = Strain.Id AND StrainXRef.InbredSetId = 1 AND Used_for_mapping='Y' ORDER BY StrainId;") (db-check db) -(define (display-rows db) - (let [(row (dbi-get_row db))] - (if row - (begin - (display row) - (get-rows db) - ) - #f - ) - )) +(define ids (db-get-rows-apply db (lambda (r) `(,(assoc-ref r "StrainId") . ,(assoc-ref r "Name"))) '())) -(define (get-rows db list) - (let [(row (dbi-get_row db))] - (if row - (get-rows db (append list `(,row))) - list - ))) - -(define (get-rows-apply db func list) - (let [(row (dbi-get_row db))] - (if row - (get-rows-apply db func (append list `(,(func row)))) - list - ))) - -; (display (get-rows db '())) - -(display (get-rows-apply db (lambda (r) `(,(assoc-ref r "StrainId") . ,(assoc-ref r "Name"))) '())) +(newline) +(display (car ids)) +(newline) +(display (assoc 5 ids)) +(newline) |