aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-12-03 23:45:07 +0300
committerGitea2020-12-04 02:39:17 -0600
commit3cc2d2758087816db58a1e75d22cc9070fbc2c3e (patch)
tree2952593a3b50de95f8b503d4f0125f888a9148e6
parent8909e4d885705add041110f3586e58c3b141a5fd (diff)
downloadguix-bioinformatics-3cc2d2758087816db58a1e75d22cc9070fbc2c3e.tar.gz
gn: python3-genenetwork2: Generate graph from python3-package
* gn/packages/genenetwork.scm: Add new #:use-modules: (guix graph) (guix scripts graph) (guix store) (python3-genenetwork2)[arguments]{generate-graph}: New phase after install that uses d3js to generate a new graph which uses d3js as a backend.
-rw-r--r--gn/packages/genenetwork.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/gn/packages/genenetwork.scm b/gn/packages/genenetwork.scm
index 91aeeb8..8454410 100644
--- a/gn/packages/genenetwork.scm
+++ b/gn/packages/genenetwork.scm
@@ -10,6 +10,9 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (guix build-system trivial)
+ #:use-module (guix graph)
+ #:use-module (guix scripts graph)
+ #:use-module (guix store)
#:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages bioconductor)
@@ -496,6 +499,28 @@ Graphical Fragment Assembly} files and related formats.")
(("rm") (which "rm"))
(("which") (which "which")))
#t))
+ (add-after 'install 'generate-graph
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (begin
+ (call-with-output-file
+ (string-append
+ (assoc-ref outputs "out")
+ "/lib/python3.8/site-packages"
+ "/wqflask/dependency-graph.html")
+ (lambda (port)
+ (format
+ port "~a"
+ ,(call-with-output-string
+ (lambda (p)
+ (with-output-to-port p
+ (lambda ()
+ (run-with-store
+ (open-connection)
+ (export-graph
+ (list this-package)
+ p
+ #:node-type %package-node-type
+ #:backend %d3js-backend))))))))))))
(add-after 'install 'generate-dependency-file
(lambda* (#:key inputs outputs #:allow-other-keys)
(call-with-output-file