aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-09-14 13:05:30 +0530
committerArun Isaac2021-09-14 13:38:59 +0530
commit178f16f8e33fb86ce3cac0830033493f0c4f306e (patch)
tree0f1dab6e167737fdb3838372b7856393706a44b1
parent2be45a4f15c956b17ab52d3467bbf2e6cd93c074 (diff)
downloadgn-transform-databases-178f16f8e33fb86ce3cac0830033493f0c4f306e.tar.gz
Dump AvgMethod.
* dump.scm (avg-method-name->id, dump-avg-method): New functions. [main]: Call dump-avg-method.
-rwxr-xr-xdump.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/dump.scm b/dump.scm
index 187fadf..f2034ab 100755
--- a/dump.scm
+++ b/dump.scm
@@ -325,6 +325,24 @@ INNER JOIN InbredSet USING (InbredSetId)"))
WHERE Email != ''
GROUP BY Email"))
+(define (avg-method-name->id name)
+ (string->symbol
+ (string-append "gn:avgmethod"
+ (string-replace-substring
+ (string-downcase name) " " "_"))))
+
+(define (dump-avg-method db)
+ (sql-for-each (match-lambda
+ (((_ . name))
+ (let ((id (avg-method-name->id name)))
+ (triple id 'rdf:type 'gn:avgMethod)
+ (triple id 'gn:name name))))
+ db
+ ;; The Name and Normalization fields seem to be the
+ ;; same. Some records have Name and Normalization as
+ ;; "N/A". Remove them.
+ "SELECT Name FROM AvgMethod WHERE Name != \"N/A\""))
+
(define (dump-data-table db table-name data-field)
(let ((dump-directory (string-append %dump-directory "/" table-name))
(port #f)
@@ -375,3 +393,4 @@ GROUP BY Email"))
(dump-publish-xref db)))))
(dump-tissue db)
(dump-investigators db)
+ (dump-avg-method db)))))