diff options
Diffstat (limited to 'examples/genotype.scm')
-rwxr-xr-x | examples/genotype.scm | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/examples/genotype.scm b/examples/genotype.scm index 6fe60c9..830da0a 100755 --- a/examples/genotype.scm +++ b/examples/genotype.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) @@ -14,12 +15,6 @@ -(define %connection-settings - (call-with-input-file (list-ref (command-line) 1) - read)) - - - (define (remap-species-identifiers str) "This procedure remaps identifiers to standard binominal. Obviously this should be sorted by correcting the database!" @@ -103,22 +98,33 @@ -(with-documentation - (name "Genotype Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("dct:" "<http://purl.org/dc/terms/>") - ("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("gnt:" "<http://genenetwork.org/term/>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>"))) - (inputs - (list genotypes)) - (outputs - '(#:documentation "./docs/genotype.md" - #:rdf "/export/data/genenetwork-virtuoso/genotype.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 "Genotype Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("dct:" "<http://purl.org/dc/terms/>") + ("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("gnt:" "<http://genenetwork.org/term/>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>"))) + (inputs + (list genotypes)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) |