aboutsummaryrefslogtreecommitdiff
path: root/gn/data/strains.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gn/data/strains.scm')
-rw-r--r--gn/data/strains.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/gn/data/strains.scm b/gn/data/strains.scm
new file mode 100644
index 0000000..275c4cd
--- /dev/null
+++ b/gn/data/strains.scm
@@ -0,0 +1,22 @@
+(define-module (gn data strains)
+ #:use-module (json)
+ #:use-module (ice-9 match)
+ #:use-module (ice-9 format)
+ #:use-module (ice-9 iconv)
+ #:use-module (ice-9 receive)
+ #:use-module (ice-9 string-fun)
+ ;; #:use-module (gn db sparql)
+ #:use-module (dbi dbi)
+ #:use-module (gn db mysql)
+ #:use-module (gn data group)
+ #:use-module (web gn-uri)
+
+ #:export (
+ strain-names
+ ))
+
+(define (strain-names)
+ (call-with-db
+ (lambda (db)
+ (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;")
+ (get-rows-apply db (lambda (r) `(,(assoc-ref r "StrainId") . ,(assoc-ref r "Name"))) '()))))