unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add krona-tools.
@ 2016-04-25  3:23 Ben Woodcroft
  2016-04-25  3:23 ` [PATCH] gnu: " Ben Woodcroft
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ben Woodcroft @ 2016-04-25  3:23 UTC (permalink / raw)
  To: Guix-devel

This is a neat little visualisation tool that generates zoomable HTML5 charts
from hierarchical data e.g. disk usage
http://marbl.github.io/Krona/examples/du.krona.html

It is mainly used for bioinformatics (specifically metagenomics) I believe,
but is more generally applicable.  Not sure if web.scm is the right place for
it?

Thanks in advance,
ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] gnu: Add krona-tools.
  2016-04-25  3:23 [PATCH] Add krona-tools Ben Woodcroft
@ 2016-04-25  3:23 ` Ben Woodcroft
  2016-04-25 15:18 ` [PATCH] " Thompson, David
  2016-04-26  9:58 ` Ludovic Courtès
  2 siblings, 0 replies; 5+ messages in thread
From: Ben Woodcroft @ 2016-04-25  3:23 UTC (permalink / raw)
  To: Guix-devel

* gnu/packages/web.scm (krona-tools): New variable.
---
 gnu/packages/web.scm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 58de65c..a6279c8 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Jelle Licht <jlicht@fsfe.org>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -52,6 +53,7 @@
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
@@ -270,6 +272,100 @@ easily construct JSON objects in C, output them as JSON formatted strings and
 parse JSON formatted strings back into the C representation of JSON objects.")
     (license l:x11)))
 
+(define-public krona-tools
+  (package
+   (name "krona-tools")
+   (version "2.6.1")
+   (source (origin
+             (method url-fetch)
+             (uri (string-append
+                   "https://github.com/marbl/Krona/releases/download/v"
+                   version "/KronaTools-" version ".tar"))
+             (sha256
+              (base32
+               "1fj5mf6wbwz7v74n2safbw7fpw32fik19vf0wdbc2srn82i8fiwz"))))
+   (build-system perl-build-system)
+   (arguments
+     `(#:tests? #f ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         ;; There is no configure or build steps.
+         (delete 'configure)
+         (replace 'build
+           ;; Remove 'use lib' statements from scripts as PERL5LIB is set
+           ;; correctly during installation.
+           (lambda _
+             (for-each
+              (lambda (executable)
+                (display executable)(display "\n")
+                (substitute* executable
+                  (("use lib \\(`ktGetLibPath`\\);") "")))
+              (find-files "scripts/" ".*"))
+             #t))
+         ;; Install script "install.pl" expects the build directory to remain
+         ;; after installation, creating symlinks etc., so re-implement it
+         ;; here.
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin   (string-append (assoc-ref outputs "out") "/bin"))
+                   (perl  (string-append (assoc-ref outputs "out")
+                                         "/lib/perl5/site_perl"))
+                   (share (string-append
+                           (assoc-ref outputs "out") "/share/krona-tools")))
+               (mkdir-p bin)
+               (for-each
+                (lambda (script)
+                  (let* ((executable (string-append "scripts/" script ".pl")))
+                    ;; Prefix executables with 'kt' as install script does.
+                    (copy-file executable (string-append bin "/kt" script))))
+                '("ClassifyBLAST"
+                  "GetContigMagnitudes"
+                  "GetTaxIDFromGI"
+                  "ImportBLAST"
+                  "ImportDiskUsage"
+                  "ImportEC"
+                  "ImportFCP"
+                  "ImportGalaxy"
+                  "ImportKrona"
+                  "ImportMETAREP-BLAST"
+                  "ImportMETAREP-EC"
+                  "ImportMGRAST"
+                  "ImportPhymmBL"
+                  "ImportRDP"
+                  "ImportRDPComparison"
+                  "ImportTaxonomy" ; 
+                  "ImportText"
+                  "ImportXML"))
+               (mkdir-p share)
+               (copy-recursively "data" (string-append share "/data"))
+               (copy-recursively "img" (string-append share "/img"))
+               (copy-recursively "taxonomy" (string-append share "/taxonomy"))
+               (substitute* '("lib/KronaTools.pm")
+                 (("taxonomyDir = \".libPath/../taxonomy\"")
+                  (string-append "taxonomyDir = \"" share "/taxonomy\"")))
+               (install-file "lib/KronaTools.pm" perl))))
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (path (getenv "PERL5LIB")))
+               (for-each
+                (lambda (executable)
+                  (wrap-program executable
+                    `("PERL5LIB" ":" prefix
+                      (,(string-append out "/lib/perl5/site_perl")))))
+                (find-files (string-append out "/bin/") ".*"))))))))
+   (inputs
+    `(("perl" ,perl)))
+   (home-page "https://github.com/marbl/Krona/wiki")
+   (synopsis "Hierarchical data exploration with zoomable HTML5 pie charts")
+   (description
+    "Krona is a flexible tool for exploring the relative proportions of
+hierarchical data, such as metagenomic classifications, using a radial,
+space-filling display.  It is implemented using HTML5 and JavaScript, allowing
+charts to be explored locally or served over the Internet, requiring only a
+current version of any major web browser.")
+   (license l:bsd-3)))
+
 (define-public rapidjson
   (package
     (name "rapidjson")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add krona-tools.
  2016-04-25  3:23 [PATCH] Add krona-tools Ben Woodcroft
  2016-04-25  3:23 ` [PATCH] gnu: " Ben Woodcroft
@ 2016-04-25 15:18 ` Thompson, David
  2016-04-26  9:58 ` Ludovic Courtès
  2 siblings, 0 replies; 5+ messages in thread
From: Thompson, David @ 2016-04-25 15:18 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

On Sun, Apr 24, 2016 at 11:23 PM, Ben Woodcroft <donttrustben@gmail.com> wrote:
> This is a neat little visualisation tool that generates zoomable HTML5 charts
> from hierarchical data e.g. disk usage
> http://marbl.github.io/Krona/examples/du.krona.html

Does this include minified JavaScript files?  If so, we'll have to
figure out how to get the complete corresponding source code.

- Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add krona-tools.
  2016-04-25  3:23 [PATCH] Add krona-tools Ben Woodcroft
  2016-04-25  3:23 ` [PATCH] gnu: " Ben Woodcroft
  2016-04-25 15:18 ` [PATCH] " Thompson, David
@ 2016-04-26  9:58 ` Ludovic Courtès
  2016-05-18 12:29   ` Ben Woodcroft
  2 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-04-26  9:58 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: Guix-devel

Ben Woodcroft <donttrustben@gmail.com> skribis:

> This is a neat little visualisation tool that generates zoomable HTML5 charts
> from hierarchical data e.g. disk usage
> http://marbl.github.io/Krona/examples/du.krona.html

Would be nice to have ‘guix size’ generate something that can be used as
input to this tool!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add krona-tools.
  2016-04-26  9:58 ` Ludovic Courtès
@ 2016-05-18 12:29   ` Ben Woodcroft
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Woodcroft @ 2016-05-18 12:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On 26/04/16 19:58, Ludovic Courtès wrote:
> Ben Woodcroft <donttrustben@gmail.com> skribis:
>
>> This is a neat little visualisation tool that generates zoomable HTML5 charts
>> from hierarchical data e.g. disk usage
>> http://marbl.github.io/Krona/examples/du.krona.html
> Would be nice to have ‘guix size’ generate something that can be used as
> input to this tool!

Indeed, although it only visualises trees rather than graphs so some 
simplifying assumptions would be required.

Pushed as 'bd9fe0f03b461bf33852d4cdb654459d5587aca0'.

Thanks.
ben

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-18 12:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25  3:23 [PATCH] Add krona-tools Ben Woodcroft
2016-04-25  3:23 ` [PATCH] gnu: " Ben Woodcroft
2016-04-25 15:18 ` [PATCH] " Thompson, David
2016-04-26  9:58 ` Ludovic Courtès
2016-05-18 12:29   ` Ben Woodcroft

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).