From 99cef5dab86b93fb6f7d600297bd4fbb54622a64 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 21 Aug 2023 15:37:37 +0300 Subject: Remove hard-coded paths Signed-off-by: Munyoki Kilyungi --- examples/genotype.scm | 56 ++++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'examples/genotype.scm') 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:" "") - ("gn:" "") - ("gnc:" "") - ("gnt:" "") - ("rdf:" "") - ("rdfs:" "") - ("owl:" "") - ("skos:" "") - ("xsd:" ""))) - (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:" "") + ("gn:" "") + ("gnc:" "") + ("gnt:" "") + ("rdf:" "") + ("rdfs:" "") + ("owl:" "") + ("skos:" "") + ("xsd:" ""))) + (inputs + (list genotypes)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) -- cgit v1.2.3