#! Run GEMMA A simple script that takes the JSON input from list-traits-to-compute and runs GEMMA on those. Run from base dir with ~/opt/guix-pull/bin/guix shell guile guile-dbi guile-json -- guile -L . -e main -s scripts/precompute/run-gemma.scm 115476.json and with some extra paths (for gemma) ~/opt/guix-pull/bin/guix shell -C -F xz tar time parallel coreutils-minimal guile guile-dbi guile-json ruby --expose=/home/wrk/iwrk/opensource/code/genetics/gemma-wrapper/=/gemma-wrapper --expose=/home/wrk/iwrk/opensource/code/genetics/gemma/=/gemma -- env TMPDIR=tmp GEMMA_COMMAND=/gemma/bin/gemma-0.98.5-linux-static-debug guile -L . -e main -s ./scripts/precompute/run-gemma.scm !# (use-modules ; (gn data dataset) ; (gn data hits) ; (gn data strains) ; (gn util convert) (gn runner gemma) (ice-9 getopt-long) (ice-9 match) (ice-9 textual-ports) (json) (rnrs bytevectors) (srfi srfi-1) ) (define (main args) ;; (write args) (let* [ (option-spec '( (version (single-char #\v) (value #f)) (help (single-char #\h) (value #f)))) (options (getopt-long args option-spec)) (help-wanted (option-ref options 'help #f))] (display "RUNNING") (if help-wanted (format #t "list-traits-to-compute writes JSON traits files from the GN DB Usage: list-traits-to-compute [options...] -h, --help Display this help ")) (let [(trait-name "115475")] (call-with-input-file "115475.json" (lambda (port) (let* [(json (json->scm port)) (dataset (assoc-ref json "traits")) (dataset-name (car (car dataset))) (traits (assoc-ref dataset dataset-name)) ] (display dataset) (write-pheno-file "pheno.txt" traits) (invoke-gemma-wrapper-loco dataset-name trait-name "pheno.txt") ))))))