unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH] Add preseq.
Date: Thu, 25 Jun 2015 15:23:38 +0200	[thread overview]
Message-ID: <idj8ub7kjl1.fsf@bimsb-sys02.mdc-berlin.net> (raw)
In-Reply-To: <idjvbeeoffw.fsf@bimsb-sys02.mdc-berlin.net>

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

Attached is a new version that includes support for BAM files, but
without using the bundled version of samtools.  Two patches were
necessary that I have submitted upstream.

I'm still testing this with a user, and I'm waiting for upstream to
comment on the patches, so I'm not in a hurry to push this.

~~ Ricardo


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

From 3ffe6847848f6ba107e0757728f1c6a6e7807d56 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Date: Tue, 23 Jun 2015 10:54:00 +0200
Subject: [PATCH] gnu: Add preseq.

* gnu/packages/bioinformatics.scm (preseq): New variable.
---
 gnu/packages/bioinformatics.scm                    | 51 ++++++++++++++++++++++
 .../patches/preseq-1.0.2-install-to-PREFIX.patch   | 37 ++++++++++++++++
 .../patches/preseq-1.0.2-link-with-libbam.patch    | 33 ++++++++++++++
 3 files changed, 121 insertions(+)
 create mode 100644 gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch
 create mode 100644 gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 4eb977b..d6fb32c 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -2033,6 +2033,57 @@ Databases are stored in a portable image within the file system, and can be
 accessed/downloaded on demand across HTTP.")
     (license license:public-domain)))
 
+(define-public preseq
+  (package
+    (name "preseq")
+    (version "1.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "http://smithlabresearch.org/downloads/preseq-"
+                              version ".tar.bz2"))
+              (sha256
+               (base32 "0r7sw07p6nv8ygvc17gd78lisbw5336v3vhs86b5wv8mw3pwqksc"))
+              (patches (list (search-patch "preseq-1.0.2-install-to-PREFIX.patch")
+                             (search-patch "preseq-1.0.2-link-with-libbam.patch")))
+              (modules '((guix build utils)))
+              (snippet
+               ;; Remove bundled samtools.  Leave the headers.
+               '(for-each delete-file
+                          (find-files "preseq-master/samtools"
+                                      "\\.c$")))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;no "check" target
+       #:phases
+       (modify-phases %standard-phases
+         (add-after
+          'unpack 'enter-dir
+          (lambda _
+            (chdir "preseq-master")
+            #t))
+         (delete 'configure))
+       #:make-flags (list (string-append "PREFIX="
+                                         (assoc-ref %outputs "out"))
+                          (string-append "LIBBAM="
+                                         (assoc-ref %build-inputs "samtools")
+                                         "/lib/libbam.a"))))
+    (inputs
+     `(("gsl" ,gsl)
+       ("samtools" ,samtools-0.1)
+       ("zlib" ,zlib)))
+    (home-page "http://smithlabresearch.org/software/preseq/")
+    (synopsis "Program for analyzing library complexity")
+    (description
+     "The preseq package is aimed at predicting and estimating the complexity
+of a genomic sequencing library, equivalent to predicting and estimating the
+number of redundant reads from a given sequencing depth and how many will be
+expected from additional sequencing using an initial sequencing experiment.
+The estimates can then be used to examine the utility of further sequencing,
+optimize the sequencing depth, or to screen multiple libraries to avoid low
+complexity samples.")
+    (license license:gpl3+)))
+
 (define-public sra-tools
   (package
     (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 0000000..f8318ae
--- /dev/null
+++ b/gnu/packages/patches/preseq-1.0.2-install-to-PREFIX.patch
@@ -0,0 +1,37 @@
+This patch has been submitted upstream: https://github.com/smithlabcode/preseq/pull/15
+
+From 65387b0d766e6c06a15cf8d8f9183d9a4ba644bb Mon Sep 17 00:00:00 2001
+From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
+Date: Thu, 25 Jun 2015 15:01:53 +0200
+Subject: [PATCH] Install to PREFIX
+
+---
+ Makefile | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4d0367a..e334f2f 100644
+--- a/preseq-master/Makefile
++++ b/preseq-master/Makefile
+@@ -22,6 +22,10 @@ ifndef ROOT
+ ROOT = $(shell pwd)
+ endif
+ 
++ifndef PREFIX
++PREFIX = $(ROOT)
++endif
++
+ ifndef SMITHLAB_CPP
+ SMITHLAB_CPP=$(ROOT)/smithlab_cpp/
+ endif
+@@ -91,8 +95,8 @@ endif
+ 	$(CXX) $(CXXFLAGS) -o $@ $^ $(INCLUDEARGS) $(LIBS)
+ 
+ install: $(PROGS)
+-	@mkdir -p $(ROOT)/bin
+-	@install -m 755 $(PROGS) $(ROOT)/bin
++	@mkdir -p $(PREFIX)/bin
++	@install -m 755 $(PROGS) $(PREFIX)/bin
+ 
+ clean:
+ 	@-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 0000000..035a3b1
--- /dev/null
+++ b/gnu/packages/patches/preseq-1.0.2-link-with-libbam.patch
@@ -0,0 +1,33 @@
+This patch has been submitted upstream: https://github.com/smithlabcode/preseq/pull/15
+
+From a937a54d56e8a6ff06237471e568154d1fa5f267 Mon Sep 17 00:00:00 2001
+From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
+Date: Thu, 25 Jun 2015 15:02:35 +0200
+Subject: [PATCH] Link with libbam.a if provided via LIBBAM
+
+---
+ Makefile | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index e334f2f..de310e4 100644
+--- a/preseq-master/Makefile
++++ b/preseq-master/Makefile
+@@ -83,10 +83,17 @@ $(PROGS): $(addprefix $(SMITHLAB_CPP)/, \
+ preseq: continued_fraction.o load_data_for_complexity.o moment_sequence.o
+ 
+ ifdef SAMTOOLS_DIR
++ifdef LIBBAM
++LIBS += -pthread
++bam2mr preseq: $(addprefix $(SMITHLAB_CPP)/, SAM.o) \
++        $(LIBBAM)
++else
+ bam2mr preseq: $(addprefix $(SMITHLAB_CPP)/, SAM.o) \
+         $(addprefix $(SAMTOOLS_DIR)/, sam.o bam.o bam_import.o bam_pileup.o \
+         faidx.o bam_aux.o kstring.o knetfile.o sam_header.o razf.o bgzf.o)
+ endif
++endif # SAMTOOLS_DIR
++
+ 
+ %.o: %.cpp %.hpp
+ 	$(CXX) $(CXXFLAGS) -c -o $@ $< $(INCLUDEARGS)
-- 
2.1.0


  reply	other threads:[~2015-06-25 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 11:02 [PATCH] Add preseq Ricardo Wurmus
2015-06-25 13:23 ` Ricardo Wurmus [this message]
2015-07-01 13:30   ` Ludovic Courtès
2015-07-01 13:33     ` Ricardo Wurmus
2015-07-01 15:00       ` Ludovic Courtès
2015-07-07 12:45         ` Ricardo Wurmus
2015-07-08 12:59           ` Ludovic Courtès
2015-07-08 22:37             ` Mark H Weaver
2015-07-09 10:16               ` Ricardo Wurmus
2015-07-09 15:55                 ` Mark H Weaver
2015-07-10  7:10                   ` Ricardo Wurmus
2015-07-01 13:30   ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=idj8ub7kjl1.fsf@bimsb-sys02.mdc-berlin.net \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).