diff options
author | Munyoki Kilyungi | 2023-08-21 15:37:37 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2023-08-21 17:52:07 +0300 |
commit | 99cef5dab86b93fb6f7d600297bd4fbb54622a64 (patch) | |
tree | e3d607fbb53e4ffdc0f94163a26010ab3aa3203f /examples/species-metadata.scm | |
parent | 8e1e4cceab516afab46ccced63ca9edab663ca11 (diff) | |
download | gn-transform-databases-99cef5dab86b93fb6f7d600297bd4fbb54622a64.tar.gz |
Remove hard-coded paths
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples/species-metadata.scm')
-rwxr-xr-x | examples/species-metadata.scm | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/examples/species-metadata.scm b/examples/species-metadata.scm index b67c0bc..b330b12 100755 --- a/examples/species-metadata.scm +++ b/examples/species-metadata.scm @@ -3,21 +3,14 @@ (use-modules (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (ice-9 match) (ice-9 regex) (transform strings) (transform sql) (transform triples) (transform special-forms)) - - - -(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!" @@ -201,26 +194,34 @@ At this point it is not very clear how Name, Name2, Symbol and Alias are used. -(with-documentation - (name "Species Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("gnt:" "<http://genenetwork.org/term/>") - ("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#>") - ("taxon:" "<http://purl.uniprot.org/taxonomy/>"))) - (inputs - (list - inbred-set - species - strain - mapping-method - avg-method)) - (outputs - '(#:documentation "./docs/species-metadata.md" - #:rdf "/export/data/genenetwork-virtuoso/species-metadata.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 "Species Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("gnt:" "<http://genenetwork.org/term/>") + ("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#>") + ("taxon:" "<http://purl.uniprot.org/taxonomy/>"))) + (inputs + (list inbred-set species strain mapping-method avg-method)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) + |