unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add bowtie.
@ 2014-12-16 17:07 Ricardo Wurmus
  2014-12-17 20:41 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2014-12-16 17:07 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

Attached is a patch to add bowtie to the bioinformatics module.  The
test suite depends on a couple of Perl modules for which I have
previously submitted patches:

- [[http://lists.gnu.org/archive/html/guix-devel/2014-12/msg00326.html][Test::Simple]]
- [[http://lists.gnu.org/archive/html/guix-devel/2014-12/msg00321.html][Test::Deep]]
- [[http://lists.gnu.org/archive/html/guix-devel/2014-12/msg00323.html][Clone]]

-- rekado


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-bowtie.patch --]
[-- Type: text/x-patch, Size: 3351 bytes --]

From 713bb1145ff901c4069f2fadb210d8eb842981da Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 16 Dec 2014 17:52:44 +0100
Subject: [PATCH] gnu: Add bowtie

* gnu/packages/bioinformatics.scm (bowtie): New variable.
---
 gnu/packages/bioinformatics.scm | 60 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6f6178a..755287d 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -28,6 +28,66 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python))
 
+(define-public bowtie
+  (package
+    (name "bowtie")
+    (version "2.2.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))))
+    (build-system gnu-build-system)
+    (inputs `(("perl" ,perl)
+              ("perl-clone" ,perl-clone)
+              ("perl-test-deep" ,perl-test-deep)
+              ("perl-test-simple" ,perl-test-simple)
+              ("python" ,python-2)))
+    (arguments
+     '(#:make-flags '("allall")
+       #:phases
+       (alist-cons-after
+        'unpack
+        'patch-makefile
+        (lambda _
+          (substitute* "Makefile"
+            (("^CC = .*$") (string-append "CC = " (which "gcc")))
+            (("^CPP = .*$") (string-append "CPP = " (which "g++")))
+            ;; replace BUILD_HOST and BUILD_TIME for deterministic build
+            (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
+            (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
+        (alist-delete
+         'configure
+         (alist-replace
+          'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
+              (mkdir-p bin)
+              (for-each (lambda (file)
+                          (copy-file file (string-append bin file)))
+                        (find-files "." "bowtie2.*"))))
+          (alist-replace
+           'check
+           (lambda* (#:key outputs #:allow-other-keys)
+             (system* "perl"
+                      "scripts/test/simple_tests.pl"
+                      "--bowtie2=./bowtie2"
+                      "--bowtie2-build=./bowtie2-build"))
+           %standard-phases))))))
+    (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
+    (synopsis "Fast and sensitive nucleotide sequence read aligner")
+    (description
+     "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
+reads to long reference sequences.  It is particularly good at aligning reads
+of about 50 up to 100s or 1,000s of characters, and particularly good at
+aligning to relatively long (e.g. mammalian) genomes.  Bowtie 2 indexes the
+genome with an FM Index to keep its memory footprint small: for the human
+genome, its memory footprint is typically around 3.2 GB.  Bowtie 2 supports
+gapped, local, and paired-end alignment modes.")
+    (license license:gpl3)))
+
 (define-public samtools
   (package
     (name "samtools")
-- 
1.9.3


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

* Re: [PATCH] gnu: Add bowtie.
  2014-12-16 17:07 [PATCH] gnu: Add bowtie Ricardo Wurmus
@ 2014-12-17 20:41 ` Ludovic Courtès
  2014-12-18 16:15   ` Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-12-17 20:41 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> From 713bb1145ff901c4069f2fadb210d8eb842981da Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Tue, 16 Dec 2014 17:52:44 +0100
> Subject: [PATCH] gnu: Add bowtie
>
> * gnu/packages/bioinformatics.scm (bowtie): New variable.

[...]

> +        'patch-makefile
> +        (lambda _
> +          (substitute* "Makefile"
> +            (("^CC = .*$") (string-append "CC = " (which "gcc")))
> +            (("^CPP = .*$") (string-append "CPP = " (which "g++")))
> +            ;; replace BUILD_HOST and BUILD_TIME for deterministic build
> +            (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
> +            (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))

Could you make this a ‘snippet’?  It suffices to write “CC = gcc” and
“CPP = g++”.  That way, running ‘guix build -S bowtie’ will return
source that’s closer to what we’re using.

> +    (license license:gpl3)))

From a quick glance, this should be ‘gpl3+’ (source file headers carry
the “or any later version” phrase.)

Could you post an updated patch?

TIA,
Ludo’.

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

* Re: [PATCH] gnu: Add bowtie.
  2014-12-17 20:41 ` Ludovic Courtès
@ 2014-12-18 16:15   ` Ricardo Wurmus
  2014-12-19 17:52     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2014-12-18 16:15 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

>> +        'patch-makefile
>> +        (lambda _
>> +          (substitute* "Makefile"
>> +            (("^CC = .*$") (string-append "CC = " (which "gcc")))
>> +            (("^CPP = .*$") (string-append "CPP = " (which "g++")))
>> +            ;; replace BUILD_HOST and BUILD_TIME for deterministic build
>> +            (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
>> +            (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
>
> Could you make this a ‘snippet’?  It suffices to write “CC = gcc” and
> “CPP = g++”.  That way, running ‘guix build -S bowtie’ will return
> source that’s closer to what we’re using.

Okay.

>> +    (license license:gpl3)))
>
> From a quick glance, this should be ‘gpl3+’ (source file headers carry
> the “or any later version” phrase.)

I went by the NEWS and MANUAL files that say

  "Bowtie 2 is licensed under the GPLv3 license."

and

  "Bowtie 2 is distributed under the [GPLv3 license]"

but I have updated the package recipe to use `gpl3+' as the source file
headers do indeed carry the phrase "or any later version".


> Could you post an updated patch?

Please see the attached patch.

Thanks for the review!
Ricardo


PS: This depends on the Perl module "Clone" for which I sent a patch
previously.  Although you said it was applied I haven't yet seen it in
the git repository.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-bowtie.patch --]
[-- Type: text/x-patch, Size: 3349 bytes --]

From 96f31057ba6bb17c1801f87d4bbae70dd3539576 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 16 Dec 2014 17:52:44 +0100
Subject: [PATCH] gnu: Add bowtie

* gnu/packages/bioinformatics.scm (bowtie): New variable.
---
 gnu/packages/bioinformatics.scm | 58 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index a2846f1..ff6c337 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -77,6 +77,64 @@ intervals from multiple files in widely-used genomic file formats such as BAM,
 BED, GFF/GTF, VCF.")
     (license license:gpl2)))
 
+(define-public bowtie
+  (package
+    (name "bowtie")
+    (version "2.2.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
+              (modules '((guix build utils)))
+              (snippet
+               '(substitute* "Makefile"
+                  (("^CC = .*$") "CC = gcc")
+                  (("^CPP = .*$") "CPP = g++")
+                  ;; replace BUILD_HOST and BUILD_TIME for deterministic build
+                  (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
+                  (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))))
+    (build-system gnu-build-system)
+    (inputs `(("perl" ,perl)
+              ("perl-clone" ,perl-clone)
+              ("perl-test-deep" ,perl-test-deep)
+              ("perl-test-simple" ,perl-test-simple)
+              ("python" ,python-2)))
+    (arguments
+     '(#:make-flags '("allall")
+       #:phases
+       (alist-delete
+        'configure
+        (alist-replace
+         'install
+         (lambda* (#:key outputs #:allow-other-keys)
+           (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
+             (mkdir-p bin)
+             (for-each (lambda (file)
+                         (copy-file file (string-append bin file)))
+                       (find-files "." "bowtie2.*"))))
+         (alist-replace
+          'check
+          (lambda* (#:key outputs #:allow-other-keys)
+            (system* "perl"
+                     "scripts/test/simple_tests.pl"
+                     "--bowtie2=./bowtie2"
+                     "--bowtie2-build=./bowtie2-build"))
+          %standard-phases)))))
+    (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
+    (synopsis "Fast and sensitive nucleotide sequence read aligner")
+    (description
+     "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
+reads to long reference sequences.  It is particularly good at aligning reads
+of about 50 up to 100s or 1,000s of characters, and particularly good at
+aligning to relatively long (e.g. mammalian) genomes.  Bowtie 2 indexes the
+genome with an FM Index to keep its memory footprint small: for the human
+genome, its memory footprint is typically around 3.2 GB.  Bowtie 2 supports
+gapped, local, and paired-end alignment modes.")
+    (license license:gpl3+)))
+
 (define-public samtools
   (package
     (name "samtools")
-- 
1.9.3


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

* Re: [PATCH] gnu: Add bowtie.
  2014-12-18 16:15   ` Ricardo Wurmus
@ 2014-12-19 17:52     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2014-12-19 17:52 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> PS: This depends on the Perl module "Clone" for which I sent a patch
> previously.  Although you said it was applied I haven't yet seen it in
> the git repository.

My bad: I applied it and then forgot to push.  Sorry!

> From 96f31057ba6bb17c1801f87d4bbae70dd3539576 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Tue, 16 Dec 2014 17:52:44 +0100
> Subject: [PATCH] gnu: Add bowtie
>
> * gnu/packages/bioinformatics.scm (bowtie): New variable.

Applied, thanks!

Ludo’.

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

end of thread, other threads:[~2014-12-19 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 17:07 [PATCH] gnu: Add bowtie Ricardo Wurmus
2014-12-17 20:41 ` Ludovic Courtès
2014-12-18 16:15   ` Ricardo Wurmus
2014-12-19 17:52     ` Ludovic Courtès

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).