From 91ed2e9f0f1c5bd96b4378db0cdfe88fdbb4d01a Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sun, 5 May 2024 14:06:55 +0200 Subject: Trait IDs fetch in batch --- gn/data/hits.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gn') diff --git a/gn/data/hits.scm b/gn/data/hits.scm index 94b4749..f7ce49e 100644 --- a/gn/data/hits.scm +++ b/gn/data/hits.scm @@ -13,14 +13,18 @@ #:use-module (web gn-uri) #:export ( + get-precompute-hits get-precompute-hit set-precompute-hit-status! update-precompute! )) +(define (get-precompute-hits db prev-id num) + (dbi-query db (string-append "select Locus, DataId, ProbeSetId, ProbeSetFreezeId from ProbeSetXRef where DataId>" (int-to-string prev-id) " AND Locus_old is NULL ORDER BY DataId LIMIT " (format #f "~d" num))) + (get-rows db '())) + (define (get-precompute-hit db prev-id) - (dbi-query db (string-append "select Locus, DataId, ProbeSetId, ProbeSetFreezeId from ProbeSetXRef where DataId>" (int-to-string prev-id) " AND Locus_old is NULL ORDER BY DataId LIMIT 1")) - (get-row db)) + (car (get-precompute-hits db prev-id 1))) (define (set-precompute-hit-status! db data-id-str status-str) "Set status of precompute record - typically from NULL to 'GEMMA-START' or 'NON-BXD'. -- cgit v1.2.3