about summary refs log tree commit diff
path: root/examples/genbank.scm
diff options
context:
space:
mode:
authorMunyoki Kilyungi2025-12-23 12:06:06 +0300
committerMunyoki Kilyungi2026-01-13 12:02:49 +0300
commit1ca7e679b834ccaf53a3243d0e1c2f3f9e8d56d8 (patch)
tree514c544706986f3edd0b3f53a89113e334a0b9a3 /examples/genbank.scm
parentc42933e8f474d8d14eac387d5a94da6f52210629 (diff)
downloadgn-transform-databases-1ca7e679b834ccaf53a3243d0e1c2f3f9e8d56d8.tar.gz
Snake case gn/gnt/gnc identifiers.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples/genbank.scm')
-rwxr-xr-xexamples/genbank.scm20
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/genbank.scm b/examples/genbank.scm
index c83643c..7aae5ba 100755
--- a/examples/genbank.scm
+++ b/examples/genbank.scm
@@ -14,30 +14,20 @@
 
 
 
-(define (remap-species-identifiers str)
-  "This procedure remaps identifiers to standard binominal. Obviously this should
-   be sorted by correcting the database!"
-  (match str
-    ["Fly (Drosophila melanogaster dm6)" "Drosophila melanogaster"]
-    ["Oryzias latipes (Japanese medaka)" "Oryzias latipes"]
-    ["Macaca mulatta" "Macaca nemestrina"]
-    ["Bat (Glossophaga soricina)" "Glossophaga soricina"]
-    [str str]))
-
 (define-transformer genbank
   (tables (Genbank
            (left-join Species "USING (SpeciesId)")))
   (schema-triples
    (gnc:nucleotide a skos:Concept)
-   (gnt:hasSequence rdfs:domain gnc:nucleotide))
+   (gnt:has_sequence rdfs:domain gnc:nucleotide))
   (triples (ontology
             'genbank:
             (field Genbank Id))
-    (set gnt:hasSequence (field Genbank Sequence))
-    (set gnt:belongsToSpecies
+    (set gnt:has_sequence (field Genbank Sequence))
+    (set gnt:belongs_to_species
          (string->identifier "" (remap-species-identifiers (field Species Fullname))
-                             #:separator ""
-                             #:proc string-capitalize-first))))
+                             #:separator "_"
+                             #:proc string-downcase))))