From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH] gnu: Add bamm. Date: Sat, 13 Aug 2016 21:19:39 +1000 Message-ID: <20160813111939.31610-2-donttrustben@gmail.com> References: <20160813111939.31610-1-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYWyv-0007iN-IM for guix-devel@gnu.org; Sat, 13 Aug 2016 07:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYWyq-0003fA-3l for guix-devel@gnu.org; Sat, 13 Aug 2016 07:20:00 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYWyp-0003f5-PZ for guix-devel@gnu.org; Sat, 13 Aug 2016 07:19:56 -0400 Received: by mail-pf0-x242.google.com with SMTP id y134so824400pfg.3 for ; Sat, 13 Aug 2016 04:19:55 -0700 (PDT) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id yv9sm19723116pab.0.2016.08.13.04.19.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 04:19:53 -0700 (PDT) In-Reply-To: <20160813111939.31610-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 (bamm): New variable. --- gnu/packages/bioinformatics.scm | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index b206f33..7728118 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -136,6 +136,100 @@ tRNA consensus sequences and RNA structure. It also outputs the secondary structure of the predicted RNA.") (license license:gpl2))) +(define-public bamm + (package + (name "bamm") + (version "1.7.2a") + (source (origin + (method url-fetch) + ;; BamM is not available on pypi. + (uri (string-append + "https://github.com/Ecogenomics/BamM/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0nb20yml39f8fh0cahpjywsl91irh9yskig549c17xkrkl74czsq")) + (modules '((guix build utils))) + (snippet + `(begin + ;; Delete bundled htslib. + (delete-file-recursively "c/htslib-1.3.1") + #t)))) + (build-system python-build-system) + (arguments + `(#:python ,python-2 ; BamM is Python 2 only. + ;; Do not use bundled libhts. Do use the bundled libcfu because it has + ;; been modified from its original form. + #:configure-flags (list + "--with-libhts-lib" + (string-append (assoc-ref %build-inputs "htslib") + "/lib") + "--with-libhts-inc" + (string-append (assoc-ref %build-inputs "htslib") + "/include/htslib")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'autogen + (lambda _ + ;; Use autogen so that 'configure' works. + (with-directory-excursion "c" + (substitute* "autogen.sh" + (("/bin/sh") (which "sh"))) + (setenv "CONFIG_SHELL" (which "sh")) + (substitute* "configure" + (("/bin/sh") (which "sh"))) + (zero? (system* "./autogen.sh"))))) + (delete 'build) + ;; Run tests after installation so compilation only happens once. + (delete 'check) + (add-after 'install 'post-install-check + (lambda* (#:key inputs outputs #:allow-other-keys) + (setenv "PATH" + (string-append (assoc-ref outputs "out") + "/bin:" + (getenv "PATH"))) + (setenv "PYTHONPATH" + (string-append + (assoc-ref outputs "out") + "/lib/python" + (string-take (string-take-right + (assoc-ref inputs "python") 5) 3) + "/site-packages:" + (getenv "PYTHONPATH"))) + (zero? (system* "nosetests")))) + (add-after 'install 'wrap-executable + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (path (getenv "PATH"))) + (wrap-program (string-append out "/bin/bamm") + `("PATH" ":" prefix (,path)))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("zlib" ,zlib) + ("python-nose" ,python2-nose) + ("python-pysam" ,python2-pysam) + ("python-setuptools" ,python2-setuptools))) + (inputs + `(("htslib" ,htslib) + ("samtools" ,samtools) + ("bwa" ,bwa) + ("grep" ,grep) + ("sed" ,sed) + ("coreutils" ,coreutils))) + (propagated-inputs + `(("python-numpy" ,python2-numpy))) + (home-page "http://ecogenomics.github.io/BamM/") + (synopsis "Metagenomics-focused BAM file manipulator") + (description + "BamM is a C library, wrapped in python, to efficiently generate and +parse BAM files, specifically for the analysis of metagenomic data. For +instance, it implements several methods to assess contig-wise read coverage.") + (license license:lgpl3+))) + (define-public bamtools (package (name "bamtools") -- 2.9.1