aboutsummaryrefslogtreecommitdiff
path: root/gn/packages/genenetwork.scm
diff options
context:
space:
mode:
authorBonfaceKilz2020-12-06 14:54:57 +0300
committerGitea2020-12-06 10:51:06 -0600
commitac6999acd5f15a5037f9a9ab55b6ab4e373c1877 (patch)
tree80051e8b5dd6b83ac77d166d42b293177d9a6065 /gn/packages/genenetwork.scm
parentbee25d7a671449baca81b63398e67ec0a36b7b9e (diff)
downloadguix-bioinformatics-ac6999acd5f15a5037f9a9ab55b6ab4e373c1877.tar.gz
gn: python3-genenetwork2: Generate svg graph from python3-package
* gn/packages/genenetwork.scm (python3-genenetwork2): [native-inputs]: Add graphviz. [arguments]{generate-dag-svg-file}: New phase.
Diffstat (limited to 'gn/packages/genenetwork.scm')
-rw-r--r--gn/packages/genenetwork.scm34
1 files changed, 34 insertions, 0 deletions
diff --git a/gn/packages/genenetwork.scm b/gn/packages/genenetwork.scm
index 5987af8..fb9af1d 100644
--- a/gn/packages/genenetwork.scm
+++ b/gn/packages/genenetwork.scm
@@ -432,6 +432,8 @@ Graphical Fragment Assembly} files and related formats.")
(sha256
(base32
"1402g129ghfh0xwfxjj1i7gbib2yl9rahf55caj7b1psy24ys87x"))))
+ (native-inputs
+ `(("graphviz" ,graphviz)))
(propagated-inputs
(let ((inputs (package-propagated-inputs genenetwork2)))
`(,@(fold
@@ -520,6 +522,38 @@ Graphical Fragment Assembly} files and related formats.")
p
#:node-type %package-node-type
#:backend %d3js-backend)))))))))))
+ (add-after 'install 'generate-dag-svg-file
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((output-dir
+ (string-append
+ (assoc-ref outputs "out")
+ "/lib/python3.8/site-packages/wqflask/"))
+ (dot-file
+ (string-append
+ output-dir
+ "dependency-graph.dot"))
+ (svg-file
+ (string-append
+ output-dir
+ "dependency-graph.svg")))
+ (begin
+ (call-with-output-file
+ dot-file
+ (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 %graphviz-backend)))))))))
+ (invoke "dot" "-Tsvg" "-o" svg-file dot-file)))))
(add-after 'install 'generate-dependency-file
(lambda* (#:key inputs outputs #:allow-other-keys)
(call-with-output-file