aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-09-09 15:10:21 +0530
committerArun Isaac2021-09-09 15:15:13 +0530
commit3a7bcfb8f3eb8eb9a198542fcb9abc0c7242bbfa (patch)
tree3668780b3439052f2490730752ba6566d0d12cbe
parent0cec7d3398d17288877c36bee485a954627e736d (diff)
downloadgn-transform-databases-3a7bcfb8f3eb8eb9a198542fcb9abc0c7242bbfa.tar.gz
Dump Tissue.
* dump.scm (tissue-short-name->id, dump-tissue): New functions. Invoke dump-tissue.
-rwxr-xr-xdump.scm20
1 files changed, 20 insertions, 0 deletions
diff --git a/dump.scm b/dump.scm
index d0d320a..d49e8bf 100755
--- a/dump.scm
+++ b/dump.scm
@@ -273,6 +273,25 @@ Lab_code, Submitter, Owner, Authorized_Users FROM Phenotype"))
FROM PublishXRef
INNER JOIN InbredSet USING (InbredSetId)"))
+(define (tissue-short-name->id short-name)
+ (string->symbol (string-append "gn:tissue" short-name)))
+
+(define (dump-tissue db)
+ ;; The Name and TissueName fields seem to be identical. BIRN_lex_ID
+ ;; and BIRN_lex_Name are mostly NULL.
+ ;; TODO: Use standard ontology.
+ (triple 'gn:name 'rdfs:subPropertyOf 'rdfs:label)
+ (sql-for-each (match-lambda
+ (((_ . name)
+ (_ . short-name))
+ ;; Hopefully the Short_Name field is distinct and
+ ;; can be used as an identifier.
+ (let ((id (tissue-short-name->id short-name)))
+ (triple id 'rdf:type 'gn:tissue)
+ (triple id 'gn:name name))))
+ db
+ "SELECT Name, Short_Name FROM Tissue"))
+
(define (dump-data-table db table-name data-field)
(let ((dump-directory (string-append %dump-directory "/" table-name))
(port #f)
@@ -321,3 +340,4 @@ INNER JOIN InbredSet USING (InbredSetId)"))
(dump-phenotype db)
(dump-publication db)
(dump-publish-xref db)))))
+ (dump-tissue db)