* [PATCH 0/1] Add BamM. @ 2016-08-13 11:19 Ben Woodcroft 2016-08-13 11:19 ` [PATCH] gnu: Add bamm Ben Woodcroft 0 siblings, 1 reply; 4+ messages in thread From: Ben Woodcroft @ 2016-08-13 11:19 UTC (permalink / raw) To: guix-devel Hi all, Note that I have some direct involvement in this project so if needed changes could be implemented in the code itself. Thanks in advance. ben ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] gnu: Add bamm. 2016-08-13 11:19 [PATCH 0/1] Add BamM Ben Woodcroft @ 2016-08-13 11:19 ` Ben Woodcroft 2016-08-13 14:46 ` Alex Kost 0 siblings, 1 reply; 4+ messages in thread From: Ben Woodcroft @ 2016-08-13 11:19 UTC (permalink / raw) To: guix-devel * 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 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gnu: Add bamm. 2016-08-13 11:19 ` [PATCH] gnu: Add bamm Ben Woodcroft @ 2016-08-13 14:46 ` Alex Kost 2016-08-14 4:57 ` Ben Woodcroft 0 siblings, 1 reply; 4+ messages in thread From: Alex Kost @ 2016-08-13 14:46 UTC (permalink / raw) To: Ben Woodcroft; +Cc: guix-devel Ben Woodcroft (2016-08-13 14:19 +0300) wrote: > * 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")) I would avoid this duplicating of (assoc-ref %build-inputs "htslib"): (let ((htslib (assoc-ref %build-inputs "htslib"))) (list "--with-libhts-lib" (string-append htslib "/lib") "--with-libhts-inc" (string-append 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"))))) and here as well: you call (which "sh") 3 times! I think it's better to do (let ((sh (which "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) 'inputs' argument is not needed here > + (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") -- Alex ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gnu: Add bamm. 2016-08-13 14:46 ` Alex Kost @ 2016-08-14 4:57 ` Ben Woodcroft 0 siblings, 0 replies; 4+ messages in thread From: Ben Woodcroft @ 2016-08-14 4:57 UTC (permalink / raw) To: Alex Kost, Ben Woodcroft; +Cc: guix-devel On 14/08/16 00:46, Alex Kost wrote: [..] Thanks Alex, correct on all counts. I pushed as 'a12ba6e'. ben ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-14 4:57 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-08-13 11:19 [PATCH 0/1] Add BamM Ben Woodcroft 2016-08-13 11:19 ` [PATCH] gnu: Add bamm Ben Woodcroft 2016-08-13 14:46 ` Alex Kost 2016-08-14 4:57 ` Ben Woodcroft
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.