about summary refs log tree commit diff
path: root/examples/phenotype.scm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/phenotype.scm')
-rwxr-xr-xexamples/phenotype.scm61
1 files changed, 34 insertions, 27 deletions
diff --git a/examples/phenotype.scm b/examples/phenotype.scm
index 31d7972..772c2bc 100755
--- a/examples/phenotype.scm
+++ b/examples/phenotype.scm
@@ -5,6 +5,7 @@
              (rnrs io ports)
              (srfi srfi-1)
              (srfi srfi-26)
+             (ice-9 getopt-long)
              (ice-9 match)
              (ice-9 regex)
              (transform strings)
@@ -13,12 +14,6 @@
              (transform special-forms))
 
 
-
-(define %connection-settings
-  (call-with-input-file (list-ref (command-line) 1)
-    read))
-
-
 (define-transformer phenotypes
   (tables (PublishXRef
            (left-join InbredSet "ON InbredSet.InbredSetId = PublishXRef.InbredSetId")
@@ -102,24 +97,36 @@
 
 
 
-(with-documentation
- (name "Phenotypes Metadata")
- (connection %connection-settings)
- (table-metadata? #f)
- (prefixes
-  '(("dct:" "<http://purl.org/dc/terms/>")
-    ("gn:" "<http://genenetwork.org/id/>")
-    ("owl:" "<http://www.w3.org/2002/07/owl#>")
-    ("gnc:" "<http://genenetwork.org/category/>")
-    ("gnt:" "<http://genenetwork.org/terms/>")
-    ("skos:" "<http://www.w3.org/2004/02/skos/core#>")
-    ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
-    ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
-    ("xsd:" "<http://www.w3.org/2001/XMLSchema#>")
-    ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>")))
- (inputs
-  (list
-   phenotypes))
- (outputs
-  '(#:documentation "./docs/phenotype.md"
-    #:rdf "/export/data/genenetwork-virtuoso/phenotype.ttl")))
+(let* ((option-spec
+        '((settings (single-char #\s) (value #t))
+          (output (single-char #\o) (value #t))
+          (documentation (single-char #\d) (value #t))))
+       (options (getopt-long (command-line) option-spec))
+       (settings (option-ref options 'settings #f))
+       (output (option-ref options 'output #f))
+       (documentation (option-ref options 'documentation #f))
+       (%connection-settings
+        (call-with-input-file settings
+          read)))
+  (with-documentation
+   (name "Phenotypes Metadata")
+   (connection %connection-settings)
+   (table-metadata? #f)
+   (prefixes
+    '(("dct:" "<http://purl.org/dc/terms/>")
+      ("gn:" "<http://genenetwork.org/id/>")
+      ("owl:" "<http://www.w3.org/2002/07/owl#>")
+      ("gnc:" "<http://genenetwork.org/category/>")
+      ("gnt:" "<http://genenetwork.org/terms/>")
+      ("skos:" "<http://www.w3.org/2004/02/skos/core#>")
+      ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
+      ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
+      ("xsd:" "<http://www.w3.org/2001/XMLSchema#>")
+      ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>")))
+   (inputs
+    (list
+     phenotypes))
+   (outputs
+    `(#:documentation ,documentation
+      #:rdf ,output))))
+