From 3cc2d2758087816db58a1e75d22cc9070fbc2c3e Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Thu, 3 Dec 2020 23:45:07 +0300 Subject: 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. --- gn/packages/genenetwork.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 -- cgit v1.2.3