aboutsummaryrefslogtreecommitdiff
path: root/gn
diff options
context:
space:
mode:
authorPjotr Prins2024-05-13 12:17:41 +0200
committerPjotr Prins2024-05-13 12:17:41 +0200
commit3bd6904ce66c28363bb535cc7d66d5403a388739 (patch)
tree5661a13334d9dd9848491495ed9194f5f916b9c6 /gn
parent8294b95324af7cb86b4abec6ee9d09b8684f137e (diff)
downloadgn-guile-3bd6904ce66c28363bb535cc7d66d5403a388739.tar.gz
Preparing BXD named for strain output in JSON
Diffstat (limited to 'gn')
-rw-r--r--gn/data/strains.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/gn/data/strains.scm b/gn/data/strains.scm
index 7854cfe..06255e3 100644
--- a/gn/data/strains.scm
+++ b/gn/data/strains.scm
@@ -14,6 +14,7 @@
#:export (
strain-id-names
+ bxd-name
is-a-bxd?
has-bxd?
bxd-strain-id-names
@@ -38,7 +39,7 @@ used-for-mapping? will say whether the strains/individuals are used for mapping.
(define* (bxd-strain-id-names #:key (used-for-mapping? #f))
- "Return assoc list of tuples of strain id + names. Same as strain-id-names, but just for the BXD
+ "Return assoc list of tuples of strain id + names. Same as strain-id-names, but just for the BXD.
used-for-mapping? will say whether the strains/individuals are used for mapping. Always True, FIXME"
(filter (lambda (l) l)
@@ -53,6 +54,10 @@ used-for-mapping? will say whether the strains/individuals are used for mapping.
(define memo-bxd-strain-id-names
(memoize bxd-strain-id-names))
+(define (bxd-name strain-id)
+ "Return the name matching strain ID"
+ (assoc-ref (memo-bxd-strain-id-names) strain-id))
+
(define (is-a-bxd? strain-id)
"Is a strain a member of the BXD? For speed we memoize tuples from the DB. Note that we check the DB list, as
well as the name. This won't work for the parents. We do it this way because the GN table is wrong."