diff options
Diffstat (limited to 'scripts/precompute')
-rw-r--r-- | scripts/precompute/.guix-shell | 10 | ||||
-rw-r--r-- | scripts/precompute/README.md | 4 | ||||
-rwxr-xr-x | scripts/precompute/precompute-hits.scm | 20 |
3 files changed, 24 insertions, 10 deletions
diff --git a/scripts/precompute/.guix-shell b/scripts/precompute/.guix-shell deleted file mode 100644 index 08c74f9..0000000 --- a/scripts/precompute/.guix-shell +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# -# run with options '-- ./webserver.scm 8091' e.g. -# . .guix-shell -- guile -L .. --fresh-auto-compile --listen=1970 -e main ./webserver.scm 8091 - -echo "Create a shell to run tools. In the container" -echo "mkdir /usr/bin -p" -echo "ln -s \$GUIX_ENVIRONMENT/bin/env /usr/bin/env" - -guix shell -C -F --network coreutils guile guile-dbi guile-dbd-mysql guile-fibers guile-json guile-gnutls guile-readline guile-redis openssl nss-certs $* diff --git a/scripts/precompute/README.md b/scripts/precompute/README.md index 53f846e..c1f2efc 100644 --- a/scripts/precompute/README.md +++ b/scripts/precompute/README.md @@ -1,3 +1,7 @@ # Precompute Some work on precompute is documented [here](https://issues.genenetwork.org/topics/systems/mariadb/precompute-mapping-input-data). This is WIP. + +# Install and run + +See the header of [precompute-hits.scm](precompute-hits.scm). diff --git a/scripts/precompute/precompute-hits.scm b/scripts/precompute/precompute-hits.scm new file mode 100755 index 0000000..7986f6a --- /dev/null +++ b/scripts/precompute/precompute-hits.scm @@ -0,0 +1,20 @@ +#! Run from base dir with + +. .guix-shell -- guile -L . -s ./scripts/precompute/precompute-hits.scm + +!# + +(use-modules (dbi dbi) + (gn db mysql) + ) + +;; potentially you want to test connection with mysql client: +;; +;; mysql -uwebqtlout -pwebqtlout -A -h 127.0.0.1 -P 3306 +;; +(define db_webqtl (dbi-open "mysql" "webqtlout:webqtlout:db_webqtl:tcp:127.0.0.1:3306")) +(dbi-query db_webqtl "SELECT * FROM ProbeSetXRef LIMIT 3") +(display (dbi-get_status db_webqtl)) +(let [(row (dbi-get_row db_webqtl))] + (display row) +) |