diff options
author | Pjotr Prins | 2024-06-29 04:34:18 -0500 |
---|---|---|
committer | Pjotr Prins | 2024-06-29 04:34:18 -0500 |
commit | 191a98261ad8336c51a59655c2bf3a3b282f00fe (patch) | |
tree | 6a72fb1188d07d5a479766d43b0eabdff14a5a02 /scripts/precompute/list-traits-to-compute.scm | |
parent | 77d7bacbc270613137c55e99923c95961dc95349 (diff) | |
download | gn-guile-191a98261ad8336c51a59655c2bf3a3b282f00fe.tar.gz |
Get trait features - now need to refactor
Diffstat (limited to 'scripts/precompute/list-traits-to-compute.scm')
-rwxr-xr-x | scripts/precompute/list-traits-to-compute.scm | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/precompute/list-traits-to-compute.scm b/scripts/precompute/list-traits-to-compute.scm index 3e2acb3..a9e1340 100755 --- a/scripts/precompute/list-traits-to-compute.scm +++ b/scripts/precompute/list-traits-to-compute.scm @@ -81,6 +81,11 @@ When that is the case we might as well write the phenotype file because we have (srfi srfi-19) ; time ) +(define (get-trait db probeset-id) + (dbi-query db (string-append "select Id,Chr,Mb,Name,Symbol,description from ProbeSet where Id=" (int-to-string probeset-id) " limit 1")) + (get-row db) + ) + #! The following is produced by gemma-wrapper as metadata @@ -167,14 +172,13 @@ The following is produced by gemma-wrapper as metadata id-traits) ;; --- create the json output as a file (for-each (lambda (r hit) - (let [(probeset-id (assoc-ref hit "ProbeSetId")) - (data-id (assoc-ref hit "DataId")) - (data-id-str (int-to-string data-id)) - (probesetfreeze-id (assoc-ref hit "ProbeSetFreezeId")) - (probeset-id (assoc-ref hit "ProbeSetId")) - (trait (get-trait db probeset-id)) - (trait-name (assoc-ref trait "Name")) - (name (dataset-name db probesetfreeze-id)) + (let* [(probeset-id (assoc-ref hit "ProbeSetId")) + (data-id (assoc-ref hit "DataId")) + (data-id-str (int-to-string data-id)) + (probesetfreeze-id (assoc-ref hit "ProbeSetFreezeId")) + (trait (get-trait db probeset-id)) + (trait-name (assoc-ref trait "Name")) + (name (dataset-name db probesetfreeze-id)) ] (match r ((id . recs) (if (has-bxd? recs) |