diff options
-rw-r--r-- | gn/data/strains.scm | 7 | ||||
-rwxr-xr-x | scripts/precompute/list-traits-to-compute.scm | 7 |
2 files changed, 12 insertions, 2 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." diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm index 07e80e9..d85a51f 100755 --- a/scripts/precompute/list-traits-to-compute.scm +++ b/scripts/precompute/list-traits-to-compute.scm @@ -77,7 +77,12 @@ When that is the case we might as well write the phenotype file because we have (define (write-json id recs) (display id) (newline) - (display (scm->json (reverse recs))) + (write (scm->json recs)) + (write (scm->json (map (lambda (r) + r + ) + recs))) + (newline) ) (define (write-phenotypes first-id num batch-size) |