From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH 4/4] gnu: Add prokka. Date: Sat, 3 Dec 2016 20:39:01 +1000 Message-ID: <20161203103901.27770-4-donttrustben@gmail.com> References: <20161203103901.27770-1-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50401) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cD7j4-00012d-Kf for guix-devel@gnu.org; Sat, 03 Dec 2016 05:39:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cD7j3-0006BM-5t for guix-devel@gnu.org; Sat, 03 Dec 2016 05:39:26 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:34112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cD7j2-0006B1-PC for guix-devel@gnu.org; Sat, 03 Dec 2016 05:39:25 -0500 Received: by mail-pg0-x242.google.com with SMTP id e9so10503479pgc.1 for ; Sat, 03 Dec 2016 02:39:24 -0800 (PST) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id o68sm13952132pfb.42.2016.12.03.02.39.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 02:39:21 -0800 (PST) In-Reply-To: <20161203103901.27770-1-donttrustben@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/bioinformatics.scm (prokka): New variable. --- gnu/packages/bioinformatics.scm | 110 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 4541791..c4f421c 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -62,6 +62,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) #:use-module (gnu packages java) + #:use-module (gnu packages less) #:use-module (gnu packages linux) #:use-module (gnu packages logging) #:use-module (gnu packages machine-learning) @@ -3743,6 +3744,115 @@ for sequences to be aligned and then, simultaneously with the alignment, predicts the locations of structural units in the sequences.") (license license:gpl2+))) +(define-public prokka + ;; There has been many commits since the last released version 1.11 so we + ;; package from git. + (let ((commit "1caf2394850998f89a3782cc8846dc51978faac2")) + (package + (name "prokka") + (version (string-append "1.11-1." (string-take commit 8))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tseemann/prokka.git") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "1h8dpmrcfw5z3w9sydgv4439v1wdidyq4nx247fyqahvn88rfsnj")) + (modules '((guix build utils))) + ;; Remove bundled code. + (snippet '(begin + (delete-file-recursively "binaries") + (delete-file-recursively "perl5") + #t)))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda _ + (zero? (system* "bin/prokka" "--setupdb")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Set the path to the 'db' to refer to the share directory. + (substitute* "bin/prokka" + (("^my \\$DBDIR = .*") + (string-append "my $DBDIR = '" + (assoc-ref outputs "out") + "/share/prokka/db';\n"))) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (prokka (string-append bin "/prokka")) + (share (string-append out "/share/prokka")) + (path (getenv "PATH")) + (perl5lib (getenv "PERL5LIB"))) + (mkdir-p share) + (copy-recursively "db" (string-append share "/db")) + (install-file "bin/prokka" bin) + (install-file "bin/prokka-genbank_to_fasta_db" bin) + (wrap-program prokka + `("PATH" ":" prefix + (,(string-append path ":" out "/bin")))) + (for-each + (lambda (binary) + (wrap-program binary + `("PERL5LIB" ":" prefix + (,(string-append perl5lib ":" out + "/lib/perl5/site_perl"))))) + (list prokka (string-append + bin "/prokka-genbank_to_fasta_db")))) + #t)) + (delete 'check) + (add-after 'install 'post-install-check + (lambda* (#:key inputs #:allow-other-keys) + ;; There are no tests, instead we run a sanity check on an + ;; entire genome. + (zero? (system* "bin/prokka" + "--noanno" + "--outdir" "example-out" + (assoc-ref inputs "example-genome")))))))) + (native-inputs + `(("example-genome" + ,(origin + (method url-fetch) + (uri "http://www.ebi.ac.uk/ena/data/view/CP002565&display=fasta") + (file-name (string-append "ena-genome-CP002565.fasta")) + (sha256 + (base32 + "0dv3m29kgyssjc96zbmb5khkrk7cy7a66bsjk2ricwc302g5hgfy")))))) + (inputs + `(("perl" ,perl) + ("bioperl" ,bioperl-minimal) + ("blast+" ,blast+) + ("hmmer" ,hmmer) + ("aragorn" ,aragorn) + ("prodigal" ,prodigal) + ("parallel" ,parallel) + ("infernal" ,infernal) + ("barrnap" ,barrnap) + ("minced" ,minced) + ("tbl2asn" ,ncbi-tools) + ("grep" ,grep) + ("sed" ,sed) + ("less" ,less) + ("perl-time-piece" ,perl-time-piece) + ("perl-xml-simple" ,perl-xml-simple) + ("perl-digest-md5" ,perl-digest-md5))) + (home-page "http://www.vicbioinformatics.com/software.prokka.shtml") + (synopsis "Rapid prokaryotic genome annotation") + (description + "Prokka is a software tool for the rapid annotation of prokaryotic +genomes. It produces GFF3, GBK and SQN files that are ready for editing in +Sequin and ultimately submitted to Genbank/DDJB/ENA. ") + (license (list license:gpl2 + ;; Available under various licenses. + (license:non-copyleft + "file://doc" + "See license files in the doc directory.")))))) + (define-public proteinortho (package (name "proteinortho") -- 2.10.2