From patchwork Tue Apr 9 13:13:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Wurmus X-Patchwork-Id: 3257 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1856016DD9; Tue, 9 Apr 2019 14:22:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 443F316DA6 for ; Tue, 9 Apr 2019 14:22:09 +0100 (BST) Received: from localhost ([127.0.0.1]:41764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDqhU-0000pa-TN for patchwork@mira.cbaines.net; Tue, 09 Apr 2019 09:22:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDqgR-0000Bv-Sd for guix-patches@gnu.org; Tue, 09 Apr 2019 09:21:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDqgQ-0001Fh-Dw for guix-patches@gnu.org; Tue, 09 Apr 2019 09:21:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDqgQ-0001FY-6r for guix-patches@gnu.org; Tue, 09 Apr 2019 09:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDqgQ-00012U-0X for guix-patches@gnu.org; Tue, 09 Apr 2019 09:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35207] [PATCH 3/3] gnu: Add pplacer. Resent-From: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Apr 2019 13:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35207 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35207@debbugs.gnu.org Received: via spool by 35207-submit@debbugs.gnu.org id=B35207.15548160053892 (code B ref 35207); Tue, 09 Apr 2019 13:21:01 +0000 Received: (at 35207) by debbugs.gnu.org; 9 Apr 2019 13:20:05 +0000 Received: from localhost ([127.0.0.1]:50759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDqfQ-0000zz-8y for submit@debbugs.gnu.org; Tue, 09 Apr 2019 09:20:03 -0400 Received: from sender4-of-o53.zoho.com ([136.143.188.53]:21358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDqfN-0000zh-GV for 35207@debbugs.gnu.org; Tue, 09 Apr 2019 09:19:58 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1554815987; cv=none; d=zoho.com; s=zohoarc; b=ojq4YrOPLuFO9Dsdod10RL3PdttHuj17zjbHj/iIoBQAhrNoJxUaYQ1y8fU5rwkODmJGLGybgDe6FwQq4V1jG8SOTAHBRmT61oUtJ8bsoUCeZG5M2injJoWQpSjB4lsPZGl6uzzvA+LfhIqzaB7iCsblOo+98fbjUJv03ve68t0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1554815987; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=Vr1mjiUTC90bb7B9DdZZSFP1nhgIpOPrUuQdWE6DowE=; b=AmjfIZ/5WcvH9DUgkzGMKkdLGe7R7tGLfvA37M1su4zyxdfn/Sns9VVb+DIyB3H1qY9xpnI3uodFb6KdObsXb414Wc5LbfoGqlW5wRAWCd4oISphl1YAx9KZmKUzxDaPL9YwIBfnXmApwrbqnby8ysEWAGM/rBygWZ2sF2cwOms= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1554815987; s=zoho; d=elephly.net; i=rekado@elephly.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; l=5635; bh=Vr1mjiUTC90bb7B9DdZZSFP1nhgIpOPrUuQdWE6DowE=; b=TzlxoAesrEGp5GEebb08H/pCNiLtIsO9dv6KkOGO1Qg+qjfWBVudqrRU0sj8dKd6 2ILcNVpcGN4bf8go9aPkDz/L68KEUWW6a/8VuJ3lC8/+3titTxYm/XLY4/fY5zsu7mS Y9bh/JsphBU5FS2F+oRI87ZiR3Gb6DqJlGwmmQac= Received: from localhost (141.80.247.154 [141.80.247.154]) by mx.zohomail.com with SMTPS id 155481598555070.68352761901212; Tue, 9 Apr 2019 06:19:45 -0700 (PDT) From: Ricardo Wurmus Message-ID: <20190409131330.12089-3-rekado@elephly.net> Date: Tue, 9 Apr 2019 15:13:30 +0200 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190409131330.12089-1-rekado@elephly.net> References: <20190409131330.12089-1-rekado@elephly.net> MIME-Version: 1.0 X-ZohoMailClient: External X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/bioinformatics.scm (pplacer, pplacer-scripts): New variables. --- gnu/packages/bioinformatics.scm | 151 ++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 4cd032abd4..c073519dc3 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -14555,3 +14555,154 @@ overlapping paired-ended reads into (longer) consensus sequences. Additionally, the AdapterRemoval may be used to recover a consensus adapter sequence for paired-ended data, for which this information is not available.") (license license:gpl3+))) + +(define-public pplacer + (let ((commit "807f6f3")) + (package + (name "pplacer") + ;; The commit should be updated with each version change. + (version "1.1.alpha19") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/matsen/pplacer.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "11ppbbbx20p2g9wj3ff64dhnarb12q79v7qh4rk0gj6lkbz4n7cn")))) + (build-system ocaml-build-system) + (arguments + `(#:ocaml ,ocaml-4.02 + #:findlib ,ocaml4.02-findlib + #:modules ((guix build ocaml-build-system) + (guix build utils) + (ice-9 ftw)) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'fix-build-with-ocaml-4.02 + (lambda _ + (substitute* "myocamlbuild.ml" + (("let run_and_read" m) + (string-append " +let split s ch = + let x = ref [] in + let rec go s = + let pos = String.index s ch in + x := (String.before s pos)::!x; + go (String.after s (pos + 1)) + in + try go s + with Not_found -> !x +let split_nl s = split s '\\n' +let before_space s = + try String.before s (String.index s ' ') + with Not_found -> s + +" m)) + (("run_and_read \"ocamlfind list \\| cut -d' ' -f1\"" m) + (string-append "List.map before_space (split_nl & " m ")")) + ((" blank_sep_strings &") "") + ((" Lexing.from_string &") "")) + #t)) + (add-after 'unpack 'replace-bundled-cddlib + (lambda* (#:key inputs #:allow-other-keys) + (let* ((cddlib-src (assoc-ref inputs "cddlib-src")) + (local-dir "cddlib_guix")) + (mkdir local-dir) + (with-directory-excursion local-dir + (invoke "tar" "xvf" cddlib-src)) + (let ((cddlib-src-folder + (string-append local-dir "/" + (list-ref (scandir local-dir) 2) + "/lib-src"))) + (for-each make-file-writable (find-files "cdd_src" ".*")) + (for-each + (lambda (file) + (copy-file file + (string-append "cdd_src/" (basename file)))) + (find-files cddlib-src-folder ".*[ch]$"))) + #t))) + (add-after 'unpack 'fix-makefile + (lambda _ + ;; Remove system calls to 'git'. + (substitute* "Makefile" + (("^DESCRIPT:=pplacer-.*") + (string-append + "DESCRIPT:=pplacer-$(shell uname)-v" ,version "\n"))) + (substitute* "myocamlbuild.ml" + (("git describe --tags --long .*\\\" with") + (string-append + "echo -n v" ,version "-" ,commit "\" with"))) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (copy-recursively "bin" bin)) + #t))))) + (inputs + `(("zlib" ,zlib "static") + ("gsl" ,gsl) + ("ocaml-ounit" ,ocaml4.02-ounit) + ("ocaml-batteries" ,ocaml4.02-batteries) + ("ocaml-camlzip" ,ocaml4.02-camlzip) + ("ocaml-csv" ,ocaml4.02-csv) + ("ocaml-sqlite3" ,ocaml4.02-sqlite3) + ("ocaml-xmlm" ,ocaml4.02-xmlm) + ("ocaml-mcl" ,ocaml4.02-mcl) + ("ocaml-gsl" ,ocaml4.02-gsl))) + (native-inputs + `(("cddlib-src" ,(package-source cddlib)) + ("pkg-config" ,pkg-config))) + (propagated-inputs + `(("pplacer-scripts" ,pplacer-scripts))) + (synopsis "Phylogenetic placement of biological sequences") + (description + "Pplacer places query sequences on a fixed reference phylogenetic tree +to maximize phylogenetic likelihood or posterior probability according to a +reference alignment. Pplacer is designed to be fast, to give useful +information about uncertainty, and to offer advanced visualization and +downstream analysis.") + (home-page "http://matsen.fhcrc.org/pplacer") + (license license:gpl3)))) + +;; This package is installed alongside 'pplacer'. It is a separate package so +;; that it can use the python-build-system for the scripts that are +;; distributed alongside the main OCaml binaries. +(define pplacer-scripts + (package + (inherit pplacer) + (name "pplacer-scripts") + (build-system python-build-system) + (arguments + `(#:python ,python-2 + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-scripts-dir + (lambda _ (chdir "scripts") #t)) + (replace 'check + (lambda _ (invoke "python" "-m" "unittest" "discover" "-v") #t)) + (add-after 'install 'wrap-executables + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (let ((path (string-append + (assoc-ref inputs "hmmer") "/bin:" + (assoc-ref inputs "infernal") "/bin"))) + (display path) + (wrap-program (string-append bin "/refpkg_align.py") + `("PATH" ":" prefix (,path)))) + (let ((path (string-append + (assoc-ref inputs "hmmer") "/bin"))) + (wrap-program (string-append bin "/hrefpkg_query.py") + `("PATH" ":" prefix (,path))))) + #t))))) + (inputs + `(("infernal" ,infernal) + ("hmmer" ,hmmer))) + (propagated-inputs + `(("python-biopython" ,python2-biopython) + ("taxtastic" ,taxtastic))) + (synopsis "Pplacer Python scripts")))