From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] gnu: Add bedtools Date: Fri, 12 Dec 2014 11:11:50 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzNCf-0005nv-4l for guix-devel@gnu.org; Fri, 12 Dec 2014 05:12:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzNCY-0001Em-P4 for guix-devel@gnu.org; Fri, 12 Dec 2014 05:12:05 -0500 Received: from venus.bbbm.mdc-berlin.de ([141.80.25.30]:33272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzNCY-0001E7-9Z for guix-devel@gnu.org; Fri, 12 Dec 2014 05:11:58 -0500 Received: from localhost (localhost [127.0.0.1]) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 7945438093E for ; Fri, 12 Dec 2014 11:11:56 +0100 (CET) Received: from venus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (venus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MCexYdOB4x0d for ; Fri, 12 Dec 2014 11:11:50 +0100 (CET) Received: from HTCATWO.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTP for ; Fri, 12 Dec 2014 11:11:50 +0100 (CET) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain This is a patch to add bedtools to the bioinformatics module. It depends on samtools and is part of the bioinformatics module created with the samtools patch. Since there is no install phase in the Makefile I had to write a replacement to copy all tools from the build bin/ directory to the output /bin/ directory. I don't know if it is better to explicitly list the tools to copy or if this should rather be done with a glob pattern. Another source of ugliness in the recipe is the patch-makefile-SHELL-definition phase which is really just patch-makefile-SHELL but working on ":=" definitions rather than "=" assignments. Augmenting patch-makefile-SHELL to handle definitions as well would result in a cleaner package recipe. Cheers, rekado --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-gnu-Add-bedtools.patch" >From c8d71da303ff6b82a30db542d382cab57a00699e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 11 Dec 2014 17:37:16 +0100 Subject: [PATCH] gnu: Add bedtools * gnu/packages/bioinformatics.scm (bedtools): New variable. --- gnu/packages/bioinformatics.scm | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 6f6178a..bcc5d43 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -28,6 +28,74 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages python)) +(define-public bedtools + (package + (name "bedtools") + (version "2.22.0") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/arq5x/bedtools2/archive/v" + version ".tar.gz")) + (sha256 + (base32 + "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl")))) + (build-system gnu-build-system) + (inputs `(("python" ,python) + ("samtools" ,samtools) + ("zlib" ,zlib))) + (arguments + '(#:test-target "test" + #:phases + (alist-cons-after + 'unpack 'patch-makefile-SHELL-definition + (lambda _ + ;; patch-makefile-SHELL cannot be used here as it does not + ;; yet patch definitions with `:='. Since changes to + ;; patch-makefile-SHELL result in a full rebuild, features + ;; of patch-makefile-SHELL are reimplemented here. + (define (find-shell name) + (let ((shell + (search-path (search-path-as-string->list (getenv "PATH")) + name))) + (unless shell + (format (current-error-port) + "patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%" + name)) + shell)) + (substitute* "Makefile" + (("^SHELL := .*$") (string-append "SHELL := " (find-shell "bash") " -e \n")))) + (alist-delete + 'configure + (alist-replace + 'install (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (tools + '("bamToFastq" "mapBed" "shuffleBed" "bed12ToBed6" "bedToBam" + "multiIntersectBed" "complementBed" "randomBed" "tagBam" "sortBed" + "annotateBed" "clusterBed" "fastaFromBed" "coverageBed" "bedpeToBam" + "pairToPair" "subtractBed" "nucBed" "expandCols" "bedToIgv" "slopBed" + "closestBed" "windowMaker" "linksBed" "getOverlap" "mergeBed" "windowBed" + "flankBed" "pairToBed" "intersectBed" "bamToBed" "multiBamCov" + "unionBedGraphs" "genomeCoverageBed" "groupBy" "maskFastaFromBed" + "bedtools"))) + (mkdir-p bin) + (map (lambda (tool) + (copy-file (string-append "bin/" tool) + (string-append bin "/" tool))) + tools))) + %standard-phases))))) + (home-page "https://github.com/arq5x/bedtools2") + (synopsis "Swiss army knife for genome arithmetic") + (description + "Collectively, the bedtools utilities are a swiss-army knife of tools for +a wide-range of genomics analysis tasks. The most widely-used tools enable +genome arithmetic: that is, set theory on the genome. For example, bedtools +allows one to intersect, merge, count, complement, and shuffle genomic +intervals from multiple files in widely-used genomic file formats such as BAM, +BED, GFF/GTF, VCF.") + (license license:gpl2))) + (define-public samtools (package (name "samtools") -- 1.9.3 --=-=-=--