about summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2026-02-03 10:04:17 +0300
committerMunyoki Kilyungi2026-02-03 10:04:17 +0300
commitb4907a5cfc10f3ea33b702dca8cccb9984753cf7 (patch)
treee259cb09687e59d51082759cf0a4394bd5858b96 /examples
parent28b9947c645c1c2499c13f241fe26c8520eb2a76 (diff)
downloadgn-transform-databases-b4907a5cfc10f3ea33b702dca8cccb9984753cf7.tar.gz
Fix empty phenotypes trait page.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/phenotype.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/phenotype.scm b/examples/phenotype.scm
index 690b6a9..0fba2c1 100755
--- a/examples/phenotype.scm
+++ b/examples/phenotype.scm
@@ -32,11 +32,12 @@
 
 (define-transformer gn:dataset->gn:trait
   (tables (PublishXRef
-           (left-join InbredSet "ON InbredSet.InbredSetId = PublishXRef.InbredSetId")
+           (inner-join InbredSet "ON InbredSet.InbredSetId = PublishXRef.InbredSetId")
+           (inner-join Species "ON InbredSet.SpeciesId = Species.Id")
            (inner-join PublishFreeze "ON PublishFreeze.InbredSetId = InbredSet.Id")
-           (left-join Publication "ON Publication.Id = PublishXRef.PublicationId")
-           (left-join Phenotype "ON Phenotype.Id = PublishXRef.PhenotypeId"))
-          "WHERE InbredSet.public > 0")
+           (inner-join Publication "ON Publication.Id = PublishXRef.PublicationId")
+           (inner-join Phenotype "ON Phenotype.Id = PublishXRef.PhenotypeId"))
+          "WHERE InbredSet.public > 0 GROUP BY Species.Name, PublishFreeze.Name")
   (triples (string->identifier "dataset" (field PublishFreeze Name) #:separator "_")
     (set gnt:has_phenotype_trait
          (let ((post-abbrev (blank-p (field Phenotype Post_publication_abbreviation)))
@@ -47,7 +48,9 @@
             "trait"
             (format #f "~a_~a" (field PublishFreeze Name)
                     (or post-abbrev pre-abbrev post-desc pre-desc))
-            #:separator "_")))))
+            #:separator "_")))
+    (set dct:created (annotate-field (field PublishFreeze CreateTime) '^^xsd:datetime))
+    (set gnt:has_strain (string->identifier "set" (field InbredSet Name InbredSetName) #:separator "_"))))
 
 (define-transformer gnc:phenotype->gn:phenotype
   (tables (Phenotype))