From 3bd6904ce66c28363bb535cc7d66d5403a388739 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 13 May 2024 12:17:41 +0200 Subject: Preparing BXD named for strain output in JSON --- gn/data/strains.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gn') 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." -- cgit v1.2.3