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/probeset.scm | 71 +++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 33 deletions(-) (limited to 'examples/probeset.scm') diff --git a/examples/probeset.scm b/examples/probeset.scm index 2dfdbc2..fa2fff6 100755 --- a/examples/probeset.scm +++ b/examples/probeset.scm @@ -3,19 +3,13 @@ (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-transformer probeset (tables (ProbeSet @@ -156,29 +150,40 @@ -(with-documentation - (name "ProbeSet Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gn:" "") - ("probeset:" "") - ("gnc:" "") - ("gnt:" "") - ("rdf:" "") - ("kegg:" "") - ("pubchem:" "") - ("omim:" "") - ("rdfs:" "") - ("uniprot:" "") - ("chebi:" "") - ("dct:" "") - ("owl:" "") - ("homologene:" "") - ("xsd:" "") - ("skos:" ""))) - (inputs - (list probeset)) - (outputs - '(#:documentation "./docs/probeset.md" - #:rdf "./verified-data/probeset.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 "ProbeSet Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("gn:" "") + ("probeset:" "") + ("gnc:" "") + ("gnt:" "") + ("rdf:" "") + ("kegg:" "") + ("pubchem:" "") + ("omim:" "") + ("rdfs:" "") + ("uniprot:" "") + ("chebi:" "") + ("dct:" "") + ("owl:" "") + ("homologene:" "") + ("xsd:" "") + ("skos:" ""))) + (inputs + (list probeset)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) -- cgit v1.2.3