aboutsummaryrefslogtreecommitdiff
path: root/gn/data/population.scm
blob: 46ef04c72b2f7d0d58af9584097b91b9a4acfd98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(define-module (gn data population)
  #: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 data group)
  #:use-module (gn db mysql)
  #:use-module (gn util convert)
  #:use-module (web gn-uri)

  #:export (
            population-info
            ))

(define* (population-info id)
  "
Return population (InbredSet) info by GN ID
"
  (call-with-db
   (lambda (db)
     (dbi-query db (string-append
                    "SELECT InbredSetId,InbredSetName,Name,SpeciesId,FullName WHERE"
                    (int-to-string id) " LIMIT 1"))
     (get-row db))))