aboutsummaryrefslogtreecommitdiff
path: root/scripts/precompute/list-traits-to-compute.scm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/precompute/list-traits-to-compute.scm')
-rwxr-xr-xscripts/precompute/list-traits-to-compute.scm20
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)