summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-06-23 10:54:00 +0200
committerRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2015-07-08 17:05:00 +0200
commit56e373ef75d161325d4878f8cfaafffa7dba24a5 (patch)
tree61eab520e4526306959992ba84b174af3e198620
parent5bdda30b32676528bcfa0a169c30237fabaa4607 (diff)
gnu: Add preseq.
* gnu/packages/bioinformatics.scm (preseq): New variable. * gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch: New file. * gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch: New file. * gnu-system.am (dist_patch_DATA): Add them.
-rw-r--r--gnu-system.am2
-rw-r--r--gnu/packages/bioinformatics.scm56
-rw-r--r--gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch37
-rw-r--r--gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch33
4 files changed, 128 insertions, 0 deletions
diff --git a/gnu-system.am b/gnu-system.am
index 11ae3e630ce..59090b54753 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -571,6 +571,8 @@ dist_patch_DATA = \
571 gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ 571 gnu/packages/patches/plotutils-libpng-jmpbuf.patch \
572 gnu/packages/patches/polkit-drop-test.patch \ 572 gnu/packages/patches/polkit-drop-test.patch \
573 gnu/packages/patches/portaudio-audacity-compat.patch \ 573 gnu/packages/patches/portaudio-audacity-compat.patch \
574 gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch \
575 gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch \
574 gnu/packages/patches/procps-make-3.82.patch \ 576 gnu/packages/patches/procps-make-3.82.patch \
575 gnu/packages/patches/pt-scotch-build-parallelism.patch \ 577 gnu/packages/patches/pt-scotch-build-parallelism.patch \
576 gnu/packages/patches/pulseaudio-fix-mult-test.patch \ 578 gnu/packages/patches/pulseaudio-fix-mult-test.patch \
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index f6349cfb8f4..2b7f78be342 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2087,6 +2087,62 @@ subsequent visualization, annotation and storage of results.")
2087 ;; LGPLv2.1+ 2087 ;; LGPLv2.1+
2088 (license (list license:gpl2 license:lgpl2.1+)))) 2088 (license (list license:gpl2 license:lgpl2.1+))))
2089 2089
2090(define-public preseq
2091 (package
2092 (name "preseq")
2093 (version "1.0.2")
2094 (source (origin
2095 (method url-fetch)
2096 (uri
2097 (string-append "http://smithlabresearch.org/downloads/preseq-"
2098 version ".tar.bz2"))
2099 (sha256
2100 (base32 "0r7sw07p6nv8ygvc17gd78lisbw5336v3vhs86b5wv8mw3pwqksc"))
2101 (patches (list (search-patch "preseq-1.0.2-install-to-PREFIX.patch")
2102 (search-patch "preseq-1.0.2-link-with-libbam.patch")))
2103 (modules '((guix build utils)))
2104 (snippet
2105 ;; Remove bundled samtools.
2106 '(delete-file-recursively "preseq-master/samtools"))))
2107 (build-system gnu-build-system)
2108 (arguments
2109 `(#:tests? #f ;no "check" target
2110 #:phases
2111 (modify-phases %standard-phases
2112 (add-after
2113 'unpack 'enter-dir
2114 (lambda _
2115 (chdir "preseq-master")
2116 #t))
2117 (add-after
2118 'unpack 'use-samtools-headers
2119 (lambda _
2120 (substitute* '("smithlab_cpp/SAM.cpp"
2121 "smithlab_cpp/SAM.hpp")
2122 (("sam.h") "samtools/sam.h"))
2123 #t))
2124 (delete 'configure))
2125 #:make-flags (list (string-append "PREFIX="
2126 (assoc-ref %outputs "out"))
2127 (string-append "LIBBAM="
2128 (assoc-ref %build-inputs "samtools")
2129 "/lib/libbam.a"))))
2130 (inputs
2131 `(("gsl" ,gsl)
2132 ("samtools" ,samtools-0.1)
2133 ("zlib" ,zlib)))
2134 (home-page "http://smithlabresearch.org/software/preseq/")
2135 (synopsis "Program for analyzing library complexity")
2136 (description
2137 "The preseq package is aimed at predicting and estimating the complexity
2138of a genomic sequencing library, equivalent to predicting and estimating the
2139number of redundant reads from a given sequencing depth and how many will be
2140expected from additional sequencing using an initial sequencing experiment.
2141The estimates can then be used to examine the utility of further sequencing,
2142optimize the sequencing depth, or to screen multiple libraries to avoid low
2143complexity samples.")
2144 (license license:gpl3+)))
2145
2090(define-public sra-tools 2146(define-public sra-tools
2091 (package 2147 (package
2092 (name "sra-tools") 2148 (name "sra-tools")
diff --git a/gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch b/gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch
new file mode 100644
index 00000000000..f8318ae0f53
--- /dev/null
+++ b/gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch
@@ -0,0 +1,37 @@
1This patch has been submitted upstream: https://github.com/smithlabcode/preseq/pull/15
2
3From 65387b0d766e6c06a15cf8d8f9183d9a4ba644bb Mon Sep 17 00:00:00 2001
4From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
5Date: Thu, 25 Jun 2015 15:01:53 +0200
6Subject: [PATCH] Install to PREFIX
7
8---
9 Makefile | 8 ++++++--
10 1 file changed, 6 insertions(+), 2 deletions(-)
11
12diff --git a/Makefile b/Makefile
13index 4d0367a..e334f2f 100644
14--- a/preseq-master/Makefile
15+++ b/preseq-master/Makefile
16@@ -22,6 +22,10 @@ ifndef ROOT
17 ROOT = $(shell pwd)
18 endif
19
20+ifndef PREFIX
21+PREFIX = $(ROOT)
22+endif
23+
24 ifndef SMITHLAB_CPP
25 SMITHLAB_CPP=$(ROOT)/smithlab_cpp/
26 endif
27@@ -91,8 +95,8 @@ endif
28 $(CXX) $(CXXFLAGS) -o $@ $^ $(INCLUDEARGS) $(LIBS)
29
30 install: $(PROGS)
31- @mkdir -p $(ROOT)/bin
32- @install -m 755 $(PROGS) $(ROOT)/bin
33+ @mkdir -p $(PREFIX)/bin
34+ @install -m 755 $(PROGS) $(PREFIX)/bin
35
36 clean:
37 @-rm -f $(PROGS) *.o *~
diff --git a/gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch b/gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch
new file mode 100644
index 00000000000..035a3b1fe48
--- /dev/null
+++ b/gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch
@@ -0,0 +1,33 @@
1This patch has been submitted upstream: https://github.com/smithlabcode/preseq/pull/15
2
3From a937a54d56e8a6ff06237471e568154d1fa5f267 Mon Sep 17 00:00:00 2001
4From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
5Date: Thu, 25 Jun 2015 15:02:35 +0200
6Subject: [PATCH] Link with libbam.a if provided via LIBBAM
7
8---
9 Makefile | 7 +++++++
10 1 file changed, 7 insertions(+)
11
12diff --git a/Makefile b/Makefile
13index e334f2f..de310e4 100644
14--- a/preseq-master/Makefile
15+++ b/preseq-master/Makefile
16@@ -83,10 +83,17 @@ $(PROGS): $(addprefix $(SMITHLAB_CPP)/, \
17 preseq: continued_fraction.o load_data_for_complexity.o moment_sequence.o
18
19 ifdef SAMTOOLS_DIR
20+ifdef LIBBAM
21+LIBS += -pthread
22+bam2mr preseq: $(addprefix $(SMITHLAB_CPP)/, SAM.o) \
23+ $(LIBBAM)
24+else
25 bam2mr preseq: $(addprefix $(SMITHLAB_CPP)/, SAM.o) \
26 $(addprefix $(SAMTOOLS_DIR)/, sam.o bam.o bam_import.o bam_pileup.o \
27 faidx.o bam_aux.o kstring.o knetfile.o sam_header.o razf.o bgzf.o)
28 endif
29+endif # SAMTOOLS_DIR
30+
31
32 %.o: %.cpp %.hpp
33 $(CXX) $(CXXFLAGS) -c -o $@ $< $(INCLUDEARGS)