1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages bioinformatics)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix packages)
22 #:use-module (guix utils)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system perl)
28 #:use-module (guix build-system python)
29 #:use-module (guix build-system trivial)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages boost)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages file)
35 #:use-module (gnu packages java)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages machine-learning)
38 #:use-module (gnu packages maths)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages popt)
43 #:use-module (gnu packages protobuf)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages statistics)
46 #:use-module (gnu packages swig)
47 #:use-module (gnu packages tbb)
48 #:use-module (gnu packages textutils)
49 #:use-module (gnu packages vim)
50 #:use-module (gnu packages web)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages zip))
54 (define-public bamtools
61 "https://github.com/pezmaster31/bamtools/archive/v"
63 (file-name (string-append name "-" version ".tar.gz"))
66 "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018"))))
67 (build-system cmake-build-system)
69 `(#:tests? #f ;no "check" target
71 (modify-phases %standard-phases
73 'configure 'set-ldflags
74 (lambda* (#:key outputs #:allow-other-keys)
78 (assoc-ref outputs "out") "/lib/bamtools")))))))
79 (inputs `(("zlib" ,zlib)))
80 (home-page "https://github.com/pezmaster31/bamtools")
81 (synopsis "C++ API and command-line toolkit for working with BAM data")
83 "BamTools provides both a C++ API and a command-line toolkit for handling
85 (license license:expat)))
93 (uri (string-append "https://github.com/bedops/bedops/archive/v"
95 (file-name (string-append name "-" version ".tar.gz"))
98 "0wmg6j0icimlrnsidaxrzf3hfgjvlkkcwvpdg7n4gg7hdv2m9ni5"))))
99 (build-system gnu-build-system)
102 #:make-flags (list (string-append "BINDIR=" %output "/bin"))
105 'unpack 'unpack-tarballs
107 ;; FIXME: Bedops includes tarballs of minimally patched upstream
108 ;; libraries jansson, zlib, and bzip2. We cannot just use stock
109 ;; libraries because at least one of the libraries (zlib) is
110 ;; patched to add a C++ function definition (deflateInit2cpp).
111 ;; Until the Bedops developers offer a way to link against system
112 ;; libraries we have to build the in-tree copies of these three
115 ;; See upstream discussion:
116 ;; https://github.com/bedops/bedops/issues/124
118 ;; Unpack the tarballs to benefit from shebang patching.
119 (with-directory-excursion "third-party"
120 (and (zero? (system* "tar" "xvf" "jansson-2.6.tar.bz2"))
121 (zero? (system* "tar" "xvf" "zlib-1.2.7.tar.bz2"))
122 (zero? (system* "tar" "xvf" "bzip2-1.0.6.tar.bz2"))))
123 ;; Disable unpacking of tarballs in Makefile.
124 (substitute* "system.mk/Makefile.linux"
125 (("^\tbzcat .*") "\t@echo \"not unpacking\"\n")
126 (("\\./configure") "CONFIG_SHELL=bash ./configure"))
127 (substitute* "third-party/zlib-1.2.7/Makefile.in"
128 (("^SHELL=.*$") "SHELL=bash\n")))
129 (alist-delete 'configure %standard-phases))))
130 (home-page "https://github.com/bedops/bedops")
131 (synopsis "Tools for high-performance genomic feature operations")
133 "BEDOPS is a suite of tools to address common questions raised in genomic
134 studies---mostly with regard to overlap and proximity relationships between
135 data sets. It aims to be scalable and flexible, facilitating the efficient
136 and accurate analysis and management of large-scale genomic data.
138 BEDOPS provides tools that perform highly efficient and scalable Boolean and
139 other set operations, statistical calculations, archiving, conversion and
140 other management of genomic data of arbitrary scale. Tasks can be easily
141 split by chromosome for distributing whole-genome analyses across a
142 computational cluster.")
143 (license license:gpl2+)))
145 (define-public bedtools
151 (uri (string-append "https://github.com/arq5x/bedtools2/archive/v"
153 (file-name (string-append name "-" version ".tar.gz"))
156 "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"))))
157 (build-system gnu-build-system)
158 (native-inputs `(("python" ,python-2)))
159 (inputs `(("samtools" ,samtools)
162 '(#:test-target "test"
165 'unpack 'patch-makefile-SHELL-definition
167 ;; patch-makefile-SHELL cannot be used here as it does not
168 ;; yet patch definitions with `:='. Since changes to
169 ;; patch-makefile-SHELL result in a full rebuild, features
170 ;; of patch-makefile-SHELL are reimplemented here.
171 (substitute* "Makefile"
172 (("^SHELL := .*$") (string-append "SHELL := " (which "bash") " -e \n"))))
177 (lambda* (#:key outputs #:allow-other-keys)
178 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
180 (for-each (lambda (file)
181 (copy-file file (string-append bin (basename file))))
182 (find-files "bin" ".*"))))
183 %standard-phases)))))
184 (home-page "https://github.com/arq5x/bedtools2")
185 (synopsis "Tools for genome analysis and arithmetic")
187 "Collectively, the bedtools utilities are a swiss-army knife of tools for
188 a wide-range of genomics analysis tasks. The most widely-used tools enable
189 genome arithmetic: that is, set theory on the genome. For example, bedtools
190 allows one to intersect, merge, count, complement, and shuffle genomic
191 intervals from multiple files in widely-used genomic file formats such as BAM,
193 (license license:gpl2)))
195 (define-public python2-pybedtools
197 (name "python2-pybedtools")
202 "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-"
206 "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an"))))
207 (build-system python-build-system)
208 (arguments `(#:python ,python-2)) ; no Python 3 support
210 `(("python-cython" ,python2-cython)
211 ("python-matplotlib" ,python2-matplotlib)))
213 `(("bedtools" ,bedtools)
214 ("samtools" ,samtools)))
216 `(("python-pyyaml" ,python2-pyyaml)
217 ("python-nose" ,python2-nose)
218 ("python-setuptools" ,python2-setuptools)))
219 (home-page "https://pythonhosted.org/pybedtools/")
220 (synopsis "Python wrapper for BEDtools programs")
222 "pybedtools is a Python wrapper for Aaron Quinlan's BEDtools programs,
223 which are widely used for genomic interval manipulation or \"genome algebra\".
224 pybedtools extends BEDTools by offering feature-level manipulations from with
226 (license license:gpl2+)))
228 (define-public python-biopython
230 (name "python-biopython")
235 "http://biopython.org/DIST/biopython-"
239 "13m8s9jkrw40zvdp1rl709n6lmgdh4f52aann7gzr6sfp0fwhg26"))))
240 (build-system python-build-system)
242 `(("python-numpy" ,python-numpy)))
244 `(("python-setuptools" ,python2-setuptools)))
245 (home-page "http://biopython.org/")
246 (synopsis "Tools for biological computation in Python")
248 "Biopython is a set of tools for biological computation including parsers
249 for bioinformatics files into Python data structures; interfaces to common
250 bioinformatics programs; a standard sequence class and tools for performing
251 common operations on them; code to perform data classification; code for
252 dealing with alignments; code making it easy to split up parallelizable tasks
253 into separate processes; and more.")
254 (license (license:non-copyleft "http://www.biopython.org/DIST/LICENSE"))))
256 (define-public python2-biopython
257 (package (inherit (package-with-python2 python-biopython))
259 `(("python2-numpy" ,python2-numpy)))))
261 (define-public bowtie
267 (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
269 (file-name (string-append name "-" version ".tar.gz"))
272 "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
273 (modules '((guix build utils)))
275 '(substitute* "Makefile"
276 (("^CC = .*$") "CC = gcc")
277 (("^CPP = .*$") "CPP = g++")
278 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
279 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
280 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
281 (patches (list (search-patch "bowtie-fix-makefile.patch")))))
282 (build-system gnu-build-system)
283 (inputs `(("perl" ,perl)
284 ("perl-clone" ,perl-clone)
285 ("perl-test-deep" ,perl-test-deep)
286 ("perl-test-simple" ,perl-test-simple)
287 ("python" ,python-2)))
289 '(#:make-flags '("allall")
295 (lambda* (#:key outputs #:allow-other-keys)
296 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
298 (for-each (lambda (file)
299 (copy-file file (string-append bin file)))
300 (find-files "." "bowtie2.*"))))
303 (lambda* (#:key outputs #:allow-other-keys)
305 "scripts/test/simple_tests.pl"
306 "--bowtie2=./bowtie2"
307 "--bowtie2-build=./bowtie2-build"))
308 %standard-phases)))))
309 (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
310 (synopsis "Fast and sensitive nucleotide sequence read aligner")
312 "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
313 reads to long reference sequences. It is particularly good at aligning reads
314 of about 50 up to 100s or 1,000s of characters, and particularly good at
315 aligning to relatively long (e.g. mammalian) genomes. Bowtie 2 indexes the
316 genome with an FM Index to keep its memory footprint small: for the human
317 genome, its memory footprint is typically around 3.2 GB. Bowtie 2 supports
318 gapped, local, and paired-end alignment modes.")
319 (supported-systems '("x86_64-linux"))
320 (license license:gpl3+)))
328 (uri (string-append "mirror://sourceforge/bio-bwa/bwa-"
332 "1330dpqncv0px3pbhjzz1gwgg39kkcv2r9qp2xs0sixf8z8wl7bh"))))
333 (build-system gnu-build-system)
335 '(#:tests? #f ;no "check" target
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let ((bin (string-append
341 (assoc-ref outputs "out") "/bin"))
343 (assoc-ref outputs "out") "/share/doc/bwa"))
345 (assoc-ref outputs "out") "/share/man/man1")))
349 (copy-file "bwa" (string-append bin "/bwa"))
350 (copy-file "README.md" (string-append doc "/README.md"))
351 (copy-file "bwa.1" (string-append man "/bwa.1"))))
352 ;; no "configure" script
353 (alist-delete 'configure %standard-phases))))
354 (inputs `(("zlib" ,zlib)))
355 (home-page "http://bio-bwa.sourceforge.net/")
356 (synopsis "Burrows-Wheeler sequence aligner")
358 "BWA is a software package for mapping low-divergent sequences against a
359 large reference genome, such as the human genome. It consists of three
360 algorithms: BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm is
361 designed for Illumina sequence reads up to 100bp, while the rest two for
362 longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar
363 features such as long-read support and split alignment, but BWA-MEM, which is
364 the latest, is generally recommended for high-quality queries as it is faster
365 and more accurate. BWA-MEM also has better performance than BWA-backtrack for
366 70-100bp Illumina reads.")
367 (license license:gpl3+)))
369 (define-public python2-bx-python
371 (name "python2-bx-python")
376 "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
380 "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
381 (modules '((guix build utils)))
383 '(substitute* "setup.py"
384 ;; remove dependency on outdated "distribute" module
385 (("^from distribute_setup import use_setuptools") "")
386 (("^use_setuptools\\(\\)") "")))))
387 (build-system python-build-system)
389 `(#:tests? #f ;tests fail because test data are not included
392 `(("python-numpy" ,python2-numpy)
395 `(("python-nose" ,python2-nose)
396 ("python-setuptools" ,python2-setuptools)))
397 (home-page "http://bitbucket.org/james_taylor/bx-python/")
398 (synopsis "Tools for manipulating biological data")
400 "bx-python provides tools for manipulating biological data, particularly
401 multiple sequence alignments.")
402 (license license:expat)))
404 (define-public clipper
411 "https://github.com/YeoLab/clipper/archive/"
415 "1q7jpimsqln7ic44i8v2rx2haj5wvik8hc1s2syd31zcn0xk1iyq"))
416 (modules '((guix build utils)))
418 ;; remove unnecessary setup dependency
419 '(substitute* "setup.py"
420 (("setup_requires = .*") "")))))
421 (build-system python-build-system)
422 (arguments `(#:python ,python-2)) ; only Python 2 is supported
425 ("python-pybedtools" ,python2-pybedtools)
426 ("python-cython" ,python2-cython)
427 ("python-scikit-learn" ,python2-scikit-learn)
428 ("python-matplotlib" ,python2-matplotlib)
429 ("python-pysam" ,python2-pysam)
430 ("python-numpy" ,python2-numpy)
431 ("python-scipy" ,python2-scipy)))
433 `(("python-mock" ,python2-mock) ; for tests
434 ("python-pytz" ,python2-pytz) ; for tests
435 ("python-setuptools" ,python2-setuptools)))
436 (home-page "https://github.com/YeoLab/clipper")
437 (synopsis "CLIP peak enrichment recognition")
439 "CLIPper is a tool to define peaks in CLIP-seq datasets.")
440 (license license:gpl2)))
442 (define-public couger
449 "http://couger.oit.duke.edu/static/assets/COUGER"
453 "04p2b14nmhzxw5h72mpzdhalv21bx4w9b87z0wpw0xzxpysyncmq"))))
454 (build-system gnu-build-system)
458 (modify-phases %standard-phases
463 (lambda* (#:key outputs #:allow-other-keys)
464 (let ((out (assoc-ref outputs "out")))
465 (copy-recursively "src" (string-append out "/src"))
466 (mkdir (string-append out "/bin"))
467 ;; Add "src" directory to module lookup path.
468 (substitute* "couger"
470 (string-append "import sys\nsys.path.append(\""
471 out "\")\nfrom argparse")))
472 (copy-file "couger" (string-append out "/bin/couger")))
475 'install 'wrap-program
476 (lambda* (#:key inputs outputs #:allow-other-keys)
477 ;; Make sure 'couger' runs with the correct PYTHONPATH.
478 (let* ((out (assoc-ref outputs "out"))
479 (path (getenv "PYTHONPATH")))
480 (wrap-program (string-append out "/bin/couger")
481 `("PYTHONPATH" ":" prefix (,path))))
484 `(("python" ,python-2)
485 ("python2-pillow" ,python2-pillow)
486 ("python2-numpy" ,python2-numpy)
487 ("python2-scipy" ,python2-scipy)
488 ("python2-matplotlib" ,python2-matplotlib)))
492 ("randomjungle" ,randomjungle)))
495 (home-page "http://couger.oit.duke.edu")
496 (synopsis "Identify co-factors in sets of genomic regions")
498 "COUGER can be applied to any two sets of genomic regions bound by
499 paralogous TFs (e.g., regions derived from ChIP-seq experiments) to identify
500 putative co-factors that provide specificity to each TF. The framework
501 determines the genomic targets uniquely-bound by each TF, and identifies a
502 small set of co-factors that best explain the in vivo binding differences
505 COUGER uses classification algorithms (support vector machines and random
506 forests) with features that reflect the DNA binding specificities of putative
507 co-factors. The features are generated either from high-throughput TF-DNA
508 binding data (from protein binding microarray experiments), or from large
509 collections of DNA motifs.")
510 (license license:gpl3+)))
512 (define-public clustal-omega
514 (name "clustal-omega")
519 "http://www.clustal.org/omega/clustal-omega-"
523 "02ibkx0m0iwz8nscg998bh41gg251y56cgh86bvyrii5m8kjgwqf"))))
524 (build-system gnu-build-system)
526 `(("argtable" ,argtable)))
527 (home-page "http://www.clustal.org/omega/")
528 (synopsis "Multiple sequence aligner for protein and DNA/RNA")
530 "Clustal-Omega is a general purpose multiple sequence alignment (MSA)
531 program for protein and DNA/RNA. It produces high quality MSAs and is capable
532 of handling data-sets of hundreds of thousands of sequences in reasonable
534 (license license:gpl2+)))
536 (define-public crossmap
542 (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
546 "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
547 ;; patch has been sent upstream already
549 (search-patch "crossmap-allow-system-pysam.patch")))
550 (modules '((guix build utils)))
551 ;; remove bundled copy of pysam
553 '(delete-file-recursively "lib/pysam"))))
554 (build-system python-build-system)
560 (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
563 `(("python-numpy" ,python2-numpy)
564 ("python-pysam" ,python2-pysam)
567 `(("python-cython" ,python2-cython)
568 ("python-nose" ,python2-nose)
569 ("python-setuptools" ,python2-setuptools)))
570 (home-page "http://crossmap.sourceforge.net/")
571 (synopsis "Convert genome coordinates between assemblies")
573 "CrossMap is a program for conversion of genome coordinates or annotation
574 files between different genome assemblies. It supports most commonly used
575 file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
576 (license license:gpl2+)))
578 (define-public cutadapt
585 "https://github.com/marcelm/cutadapt/archive/v"
587 (file-name (string-append name "-" version ".tar.gz"))
590 "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5"))))
591 (build-system python-build-system)
593 ;; tests must be run after install
594 `(#:phases (alist-cons-after
596 (lambda* (#:key inputs outputs #:allow-other-keys)
599 (getenv "PYTHONPATH")
600 ":" (assoc-ref outputs "out")
602 (string-take (string-take-right
603 (assoc-ref inputs "python") 5) 3)
605 (zero? (system* "nosetests" "-P" "tests")))
606 (alist-delete 'check %standard-phases))))
608 `(("python-cython" ,python-cython)
609 ("python-nose" ,python-nose)
610 ("python-setuptools" ,python-setuptools)))
611 (home-page "https://code.google.com/p/cutadapt/")
612 (synopsis "Remove adapter sequences from nucleotide sequencing reads")
614 "Cutadapt finds and removes adapter sequences, primers, poly-A tails and
615 other types of unwanted sequence from high-throughput sequencing reads.")
616 (license license:expat)))
618 (define-public edirect
624 ;; Note: older versions are not retained.
625 (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip")
628 "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj"))))
629 (build-system perl-build-system)
631 `(#:tests? #f ;no "check" target
633 (modify-phases %standard-phases
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let ((target (string-append (assoc-ref outputs "out")
641 (copy-file "edirect.pl"
642 (string-append target "/edirect.pl"))
645 'install 'wrap-program
646 (lambda* (#:key inputs outputs #:allow-other-keys)
647 ;; Make sure 'edirect.pl' finds all perl inputs at runtime.
648 (let* ((out (assoc-ref outputs "out"))
649 (path (getenv "PERL5LIB")))
650 (wrap-program (string-append out "/bin/edirect.pl")
651 `("PERL5LIB" ":" prefix (,path)))))))))
653 `(("perl-html-parser" ,perl-html-parser)
654 ("perl-encode-locale" ,perl-encode-locale)
655 ("perl-file-listing" ,perl-file-listing)
656 ("perl-html-tagset" ,perl-html-tagset)
657 ("perl-html-tree" ,perl-html-tree)
658 ("perl-http-cookies" ,perl-http-cookies)
659 ("perl-http-date" ,perl-http-date)
660 ("perl-http-message" ,perl-http-message)
661 ("perl-http-negotiate" ,perl-http-negotiate)
662 ("perl-lwp-mediatypes" ,perl-lwp-mediatypes)
663 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
664 ("perl-net-http" ,perl-net-http)
665 ("perl-uri" ,perl-uri)
666 ("perl-www-robotrules" ,perl-www-robotrules)
670 (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288")
671 (synopsis "Tools for accessing the NCBI's set of databases")
673 "Entrez Direct (EDirect) is a method for accessing the National Center
674 for Biotechnology Information's (NCBI) set of interconnected
675 databases (publication, sequence, structure, gene, variation, expression,
676 etc.) from a terminal. Functions take search terms from command-line
677 arguments. Individual operations are combined to build multi-step queries.
678 Record retrieval and formatting normally complete the process.
680 EDirect also provides an argument-driven function that simplifies the
681 extraction of data from document summaries or other results that are returned
682 in structured XML format. This can eliminate the need for writing custom
683 software to answer ad hoc questions.")
684 (license license:public-domain)))
686 (define-public express
694 "http://bio.math.berkeley.edu/eXpress/downloads/express-"
695 version "/express-" version "-src.tgz"))
698 "03rczxd0gjp2l1jxcmjfmf5j94j77zqyxa6x063zsc585nj40n0c"))))
699 (build-system cmake-build-system)
701 `(#:tests? #f ;no "check" target
704 'unpack 'use-shared-boost-libs-and-set-bamtools-paths
705 (lambda* (#:key inputs #:allow-other-keys)
706 (substitute* "CMakeLists.txt"
707 (("set\\(Boost_USE_STATIC_LIBS ON\\)")
708 "set(Boost_USE_STATIC_LIBS OFF)")
709 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/bamtools/include")
710 (string-append (assoc-ref inputs "bamtools") "/include/bamtools")))
711 (substitute* "src/CMakeLists.txt"
712 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/\\.\\./bamtools/lib")
713 (string-append (assoc-ref inputs "bamtools") "/lib/bamtools")))
718 ("bamtools" ,bamtools)
719 ("protobuf" ,protobuf)
721 (home-page "http://bio.math.berkeley.edu/eXpress")
722 (synopsis "Streaming quantification for high-throughput genomic sequencing")
724 "eXpress is a streaming tool for quantifying the abundances of a set of
725 target sequences from sampled subsequences. Example applications include
726 transcript-level RNA-Seq quantification, allele-specific/haplotype expression
727 analysis (from RNA-Seq), transcription factor binding quantification in
728 ChIP-Seq, and analysis of metagenomic data.")
729 (license license:artistic2.0)))
731 (define-public fastx-toolkit
733 (name "fastx-toolkit")
739 "https://github.com/agordon/fastx_toolkit/releases/download/"
740 version "/fastx_toolkit-" version ".tar.bz2"))
743 "01jqzw386873sr0pjp1wr4rn8fsga2vxs1qfmicvx1pjr72007wy"))))
744 (build-system gnu-build-system)
746 `(("libgtextutils" ,libgtextutils)))
748 `(("pkg-config" ,pkg-config)))
749 (home-page "http://hannonlab.cshl.edu/fastx_toolkit/")
750 (synopsis "Tools for FASTA/FASTQ file preprocessing")
752 "The FASTX-Toolkit is a collection of command line tools for Short-Reads
753 FASTA/FASTQ files preprocessing.
755 Next-Generation sequencing machines usually produce FASTA or FASTQ files,
756 containing multiple short-reads sequences. The main processing of such
757 FASTA/FASTQ files is mapping the sequences to reference genomes. However, it
758 is sometimes more productive to preprocess the files before mapping the
759 sequences to the genome---manipulating the sequences to produce better mapping
760 results. The FASTX-Toolkit tools perform some of these preprocessing tasks.")
761 (license license:agpl3+)))
763 (define-public flexbar
770 (string-append "mirror://sourceforge/flexbar/"
771 version "/flexbar_v" version "_src.tgz"))
774 "13jaykc3y1x8y5nn9j8ljnb79s5y51kyxz46hdmvvjj6qhyympmf"))))
775 (build-system cmake-build-system)
777 `(#:configure-flags (list
778 (string-append "-DFLEXBAR_BINARY_DIR="
779 (assoc-ref %outputs "out")
784 (lambda* (#:key outputs #:allow-other-keys)
785 (setenv "PATH" (string-append
786 (assoc-ref outputs "out") "/bin:"
788 (chdir "../flexbar_v2.5_src/test")
789 (zero? (system* "bash" "flexbar_validate.sh")))
790 (alist-delete 'install %standard-phases))))
795 `(("pkg-config" ,pkg-config)
797 (home-page "http://flexbar.sourceforge.net")
798 (synopsis "Barcode and adapter removal tool for sequencing platforms")
800 "Flexbar preprocesses high-throughput nucleotide sequencing data
801 efficiently. It demultiplexes barcoded runs and removes adapter sequences.
802 Moreover, trimming and filtering features are provided. Flexbar increases
803 read mapping rates and improves genome and transcriptome assemblies. It
804 supports next-generation sequencing data in fasta/q and csfasta/q format from
805 Illumina, Roche 454, and the SOLiD platform.")
806 (license license:gpl3)))
815 "https://github.com/nboley/grit/archive/"
817 (file-name (string-append name "-" version ".tar.gz"))
820 "157in84dj70wimbind3x7sy1whs3h57qfgcnj2s6lrd38fbrb7mj"))))
821 (build-system python-build-system)
826 'unpack 'generate-from-cython-sources
827 (lambda* (#:key inputs outputs #:allow-other-keys)
828 ;; Delete these C files to force fresh generation from pyx sources.
829 (delete-file "grit/sparsify_support_fns.c")
830 (delete-file "grit/call_peaks_support_fns.c")
831 (substitute* "setup.py"
832 (("Cython.Setup") "Cython.Build")
833 ;; Add numpy include path to fix compilation
835 (string-append "pyx\", ], include_dirs = ['"
836 (assoc-ref inputs "python-numpy")
837 "/lib/python2.7/site-packages/numpy/core/include/"
841 `(("python-scipy" ,python2-scipy)
842 ("python-numpy" ,python2-numpy)
843 ("python-pysam" ,python2-pysam)
844 ("python-networkx" ,python2-networkx)))
846 `(("python-cython" ,python2-cython)
847 ("python-setuptools" ,python2-setuptools)))
848 (home-page "http://grit-bio.org")
849 (synopsis "Tool for integrative analysis of RNA-seq type assays")
851 "GRIT is designed to use RNA-seq, TES, and TSS data to build and quantify
852 full length transcript models. When none of these data sources are available,
853 GRIT can be run by providing a candidate set of TES or TSS sites. In
854 addition, GRIT can merge in reference junctions and gene boundaries. GRIT can
855 also be run in quantification mode, where it uses a provided GTF file and just
856 estimates transcript expression.")
857 (license license:gpl3+)))
866 "http://ccb.jhu.edu/software/hisat/downloads/hisat-"
867 version "-beta-source.zip"))
870 "1k381ydranqxp09yf2y7w1d0chz5d59vb6jchi89hbb0prq19lk5"))))
871 (build-system gnu-build-system)
873 `(#:tests? #f ;no check target
874 #:make-flags '("allall"
875 ;; Disable unsupported `popcnt' instructions on
876 ;; architectures other than x86_64
877 ,@(if (string-prefix? "x86_64"
878 (or (%current-target-system)
881 '("POPCNT_CAPABILITY=0")))
884 'unpack 'patch-sources
886 ;; XXX Cannot use snippet because zip files are not supported
887 (substitute* "Makefile"
888 (("^CC = .*$") "CC = gcc")
889 (("^CPP = .*$") "CPP = g++")
890 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
891 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
892 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\""))
893 (substitute* '("hisat-build" "hisat-inspect")
894 (("/usr/bin/env") (which "env"))))
897 (lambda* (#:key outputs #:allow-other-keys)
898 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
902 (copy-file file (string-append bin file)))
905 "hisat(-(build|align|inspect)(-(s|l)(-debug)*)*)*$"))))
906 (alist-delete 'configure %standard-phases)))))
913 (home-page "http://ccb.jhu.edu/software/hisat/index.shtml")
914 (synopsis "Hierarchical indexing for spliced alignment of transcripts")
916 "HISAT is a fast and sensitive spliced alignment program for mapping
917 RNA-seq reads. In addition to one global FM index that represents a whole
918 genome, HISAT uses a large set of small FM indexes that collectively cover the
919 whole genome. These small indexes (called local indexes) combined with
920 several alignment strategies enable effective alignment of RNA-seq reads, in
921 particular, reads spanning multiple exons.")
922 (license license:gpl3+)))
931 "https://pypi.python.org/packages/source/H/HTSeq/HTSeq-"
935 "1i85ppf2j2lj12m0x690qq5nn17xxk23pbbx2c83r8ayb5wngzwv"))))
936 (build-system python-build-system)
937 (arguments `(#:python ,python-2)) ; only Python 2 is supported
939 `(("python-numpy" ,python2-numpy)
940 ("python-setuptools" ,python2-setuptools)))
941 (home-page "http://www-huber.embl.de/users/anders/HTSeq/")
942 (synopsis "Analysing high-throughput sequencing data with Python")
944 "HTSeq is a Python package that provides infrastructure to process data
945 from high-throughput sequencing assays.")
946 (license license:gpl3+)))
948 (define-public htsjdk
955 "https://github.com/samtools/htsjdk/archive/"
957 (file-name (string-append name "-" version ".tar.gz"))
960 "0asdk9b8jx2ij7yd6apg9qx03li8q7z3ml0qy2r2qczkra79y6fw"))
961 (modules '((guix build utils)))
962 ;; remove build dependency on git
963 (snippet '(substitute* "build.xml"
964 (("failifexecutionfails=\"true\"")
965 "failifexecutionfails=\"false\"")))))
966 (build-system gnu-build-system)
968 `(#:modules ((srfi srfi-1)
969 (guix build gnu-build-system)
971 #:phases (alist-replace
974 (setenv "JAVA_HOME" (assoc-ref %build-inputs "jdk"))
975 (zero? (system* "ant" "all"
976 (string-append "-Ddist="
977 (assoc-ref %outputs "out")
978 "/share/java/htsjdk/"))))
979 (fold alist-delete %standard-phases
980 '(configure install check)))))
983 ("jdk" ,icedtea6 "jdk")))
984 (home-page "http://samtools.github.io/htsjdk/")
985 (synopsis "Java API for high-throughput sequencing data (HTS) formats")
987 "HTSJDK is an implementation of a unified Java library for accessing
988 common file formats, such as SAM and VCF, used for high-throughput
989 sequencing (HTS) data. There are also an number of useful utilities for
990 manipulating HTS data.")
991 (license license:expat)))
993 (define-public htslib
1000 "https://github.com/samtools/htslib/releases/download/"
1001 version "/htslib-" version ".tar.bz2"))
1004 "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx"))))
1005 (build-system gnu-build-system)
1008 (modify-phases %standard-phases
1010 'unpack 'patch-tests
1012 (substitute* "test/test.pl"
1013 (("/bin/bash") (which "bash")))
1019 (home-page "http://www.htslib.org")
1020 (synopsis "C library for reading/writing high-throughput sequencing data")
1022 "HTSlib is a C library for reading/writing high-throughput sequencing
1023 data. It also provides the bgzip, htsfile, and tabix utilities.")
1024 ;; Files under cram/ are released under the modified BSD license;
1025 ;; the rest is released under the Expat license
1026 (license (list license:expat license:bsd-3))))
1031 (version "2.1.0.20140616")
1035 "https://pypi.python.org/packages/source/M/MACS2/MACS2-"
1039 "11lmiw6avqhwn75sn59g4lfkrr2kk20r3rgfbx9xfqb8rg9mi2n6"))))
1040 (build-system python-build-system)
1042 `(#:python ,python-2 ; only compatible with Python 2.7
1043 #:tests? #f)) ; no test target
1045 `(("python-numpy" ,python2-numpy)))
1047 `(("python-setuptools" ,python2-setuptools)))
1048 (home-page "http://github.com/taoliu/MACS/")
1049 (synopsis "Model based analysis for ChIP-Seq data")
1051 "MACS is an implementation of a ChIP-Seq analysis algorithm for
1052 identifying transcript factor binding sites named Model-based Analysis of
1053 ChIP-Seq (MACS). MACS captures the influence of genome complexity to evaluate
1054 the significance of enriched ChIP regions and it improves the spatial
1055 resolution of binding sites through combining the information of both
1056 sequencing tag position and orientation.")
1057 (license license:bsd-3)))
1066 "http://pypi.python.org/packages/source/m/misopy/misopy-"
1070 "0x446867az8ir0z8c1vjqffkp0ma37wm4sylixnkhgawllzx8v5w"))
1071 (modules '((guix build utils)))
1072 ;; use "gcc" instead of "cc" for compilation
1074 '(substitute* "setup.py"
1076 "cc.set_executables(
1080 linker_so='gcc -shared'); defines")))))
1081 (build-system python-build-system)
1083 `(#:python ,python-2 ; only Python 2 is supported
1084 #:tests? #f)) ; no "test" target
1086 `(("samtools" ,samtools)
1087 ("python-numpy" ,python2-numpy)
1088 ("python-pysam" ,python2-pysam)
1089 ("python-scipy" ,python2-scipy)
1090 ("python-matplotlib" ,python2-matplotlib)))
1092 `(("python-setuptools" ,python2-setuptools)))
1093 (home-page "http://genes.mit.edu/burgelab/miso/index.html")
1094 (synopsis "Mixture of Isoforms model for RNA-Seq isoform quantitation")
1096 "MISO (Mixture-of-Isoforms) is a probabilistic framework that quantitates
1097 the expression level of alternatively spliced genes from RNA-Seq data, and
1098 identifies differentially regulated isoforms or exons across samples. By
1099 modeling the generative process by which reads are produced from isoforms in
1100 RNA-Seq, the MISO model uses Bayesian inference to compute the probability
1101 that a read originated from a particular isoform.")
1102 (license license:gpl2)))
1111 "https://github.com/wwood/OrfM/releases/download/v"
1112 version "/orfm-" version ".tar.gz"))
1115 "00jqvlspj9662ni9r4n1snxfnwkzc02i46g5nk1kwjshi6v3vgg3"))))
1116 (build-system gnu-build-system)
1117 (inputs `(("zlib" ,zlib)))
1118 (synopsis "Simple and not slow open reading frame (ORF) caller")
1120 "An ORF caller finds stretches of DNA that when translated are not
1121 interrupted by stop codons. OrfM finds and prints these ORFs.")
1122 (home-page "https://github.com/wwood/OrfM")
1123 (license license:lgpl3+)))
1125 (define-public python2-pbcore
1127 (name "python2-pbcore")
1132 "https://github.com/PacificBiosciences/pbcore/archive/"
1134 (file-name (string-append name "-" version ".tar.gz"))
1137 "1z46rwjac93jm87cbj2zgjg6qvsgs65140wkbbxsvxps7ai4pm09"))))
1138 (build-system python-build-system)
1139 (arguments `(#:python ,python-2)) ; pbcore requires Python 2.7
1141 `(("python-cython" ,python2-cython)
1142 ("python-numpy" ,python2-numpy)
1143 ("python-pysam" ,python2-pysam)
1144 ("python-h5py" ,python2-h5py)))
1146 `(("python-setuptools" ,python2-setuptools)))
1147 (home-page "http://pacificbiosciences.github.io/pbcore/")
1148 (synopsis "Library for reading and writing PacBio data files")
1150 "The pbcore package provides Python APIs for interacting with PacBio data
1151 files and writing bioinformatics applications.")
1152 (license license:bsd-3)))
1154 (define-public pbtranscript-tofu
1155 (let ((commit "c7bbd5472"))
1157 (name "pbtranscript-tofu")
1158 (version (string-append "0.4.1." commit))
1162 (url "https://github.com/PacificBiosciences/cDNA_primer.git")
1164 (file-name (string-append name "-" version ".tar.gz"))
1167 "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
1168 (build-system python-build-system)
1170 `(#:python ,python-2
1171 ;; With standard flags, the install phase attempts to create a zip'd
1172 ;; egg file, and fails with an error: 'ZIP does not support timestamps
1174 #:configure-flags '("--single-version-externally-managed"
1175 "--record=pbtranscript-tofu.txt")
1178 'unpack 'enter-directory-and-clean-up
1180 (chdir "pbtranscript-tofu/pbtranscript/")
1182 (delete-file-recursively "dist/")
1183 (delete-file-recursively "build/")
1184 (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/")
1185 (delete-file-recursively "pbtools.pbtranscript.egg-info")
1186 (delete-file "Cython-0.20.1.tar.gz")
1187 (delete-file "setuptools_cython-0.2.1-py2.7.egg")
1188 (delete-file "setuptools_cython-0.2.1.tar.gz")
1189 (delete-file "setup.cfg")
1190 (for-each delete-file
1191 (find-files "." "\\.so$"))
1192 ;; files should be writable for install phase
1193 (for-each (lambda (f) (chmod f #o755))
1194 (find-files "." "\\.py$")))
1197 `(("python-cython" ,python2-cython)
1198 ("python-numpy" ,python2-numpy)
1199 ("python-bx-python" ,python2-bx-python)
1200 ("python-networkx" ,python2-networkx)
1201 ("python-scipy" ,python2-scipy)
1202 ("python-pbcore" ,python2-pbcore)))
1204 `(("python-nose" ,python2-nose)
1205 ("python-setuptools" ,python2-setuptools)))
1206 (home-page "https://github.com/PacificBiosciences/cDNA_primer")
1207 (synopsis "Analyze transcriptome data generated with the Iso-Seq protocol")
1209 "pbtranscript-tofu contains scripts to analyze transcriptome data
1210 generated using the PacBio Iso-Seq protocol.")
1211 (license license:bsd-3))))
1221 (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-"
1224 (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q"))
1225 (patches (list (search-patch "rsem-makefile.patch")))
1226 (modules '((guix build utils)))
1229 ;; remove bundled copy of boost
1230 (delete-file-recursively "boost")
1232 (build-system gnu-build-system)
1234 `(#:tests? #f ;no "check" target
1236 (modify-phases %standard-phases
1237 ;; No "configure" script.
1238 ;; Do not build bundled samtools library.
1241 (substitute* "Makefile"
1242 (("^all : sam/libbam.a") "all : "))
1245 (lambda* (#:key outputs #:allow-other-keys)
1246 (let* ((out (string-append (assoc-ref outputs "out")))
1247 (bin (string-append out "/bin/"))
1248 (perl (string-append out "/lib/perl5/site_perl")))
1251 (for-each (lambda (file)
1253 (string-append bin (basename file))))
1254 (find-files "." "rsem-.*"))
1255 (copy-file "rsem_perl_utils.pm"
1256 (string-append perl "/rsem_perl_utils.pm")))
1259 'install 'wrap-program
1260 (lambda* (#:key outputs #:allow-other-keys)
1261 (let ((out (assoc-ref outputs "out")))
1262 (for-each (lambda (prog)
1263 (wrap-program (string-append out "/bin/" prog)
1264 `("PERL5LIB" ":" prefix
1265 (,(string-append out "/lib/perl5/site_perl")))))
1266 '("rsem-plot-transcript-wiggles"
1267 "rsem-calculate-expression"
1268 "rsem-generate-ngvector"
1270 "rsem-prepare-reference")))
1274 ("ncurses" ,ncurses)
1277 ("samtools" ,samtools-0.1)
1279 (home-page "http://deweylab.biostat.wisc.edu/rsem/")
1280 (synopsis "Estimate gene expression levels from RNA-Seq data")
1282 "RSEM is a software package for estimating gene and isoform expression
1283 levels from RNA-Seq data. The RSEM package provides a user-friendly
1284 interface, supports threads for parallel computation of the EM algorithm,
1285 single-end and paired-end read data, quality scores, variable-length reads and
1286 RSPD estimation. In addition, it provides posterior mean and 95% credibility
1287 interval estimates for expression levels. For visualization, it can generate
1288 BAM and Wiggle files in both transcript-coordinate and genomic-coordinate.")
1289 (license license:gpl3+)))
1291 (define-public rseqc
1299 (string-append "mirror://sourceforge/rseqc/"
1300 version "/RSeQC-" version ".tar.gz"))
1302 (base32 "15ly0254yi032qzkdplg00q144qfdsd986gh62829rl5bkxhj330"))
1303 (modules '((guix build utils)))
1306 ;; remove bundled copy of pysam
1307 (delete-file-recursively "lib/pysam")
1308 (substitute* "setup.py"
1309 ;; remove dependency on outdated "distribute" module
1310 (("^from distribute_setup import use_setuptools") "")
1311 (("^use_setuptools\\(\\)") "")
1312 ;; do not use bundled copy of pysam
1313 (("^have_pysam = False") "have_pysam = True"))))))
1314 (build-system python-build-system)
1315 (arguments `(#:python ,python-2))
1317 `(("python-cython" ,python2-cython)
1318 ("python-pysam" ,python2-pysam)
1319 ("python-numpy" ,python2-numpy)
1320 ("python-setuptools" ,python2-setuptools)
1323 `(("python-nose" ,python2-nose)))
1324 (home-page "http://rseqc.sourceforge.net/")
1325 (synopsis "RNA-seq quality control package")
1327 "RSeQC provides a number of modules that can comprehensively evaluate
1328 high throughput sequence data, especially RNA-seq data. Some basic modules
1329 inspect sequence quality, nucleotide composition bias, PCR bias and GC bias,
1330 while RNA-seq specific modules evaluate sequencing saturation, mapped reads
1331 distribution, coverage uniformity, strand specificity, etc.")
1332 (license license:gpl3+)))
1334 (define-public samtools
1342 (string-append "mirror://sourceforge/samtools/"
1343 version "/samtools-" version ".tar.bz2"))
1346 "1y5p2hs4gif891b4ik20275a8xf3qrr1zh9wpysp4g8m0g1jckf2"))))
1347 (build-system gnu-build-system)
1349 `(;; There are 87 test failures when building on non-64-bit architectures
1350 ;; due to invalid test data. This has since been fixed upstream (see
1351 ;; <https://github.com/samtools/samtools/pull/307>), but as there has
1352 ;; not been a new release we disable the tests for all non-64-bit
1354 #:tests? ,(string=? (or (%current-system) (%current-target-system))
1356 #:make-flags (list "LIBCURSES=-lncurses"
1357 (string-append "prefix=" (assoc-ref %outputs "out")))
1362 (lambda* (#:key inputs #:allow-other-keys)
1363 (let ((bash (assoc-ref inputs "bash")))
1364 (substitute* "test/test.pl"
1365 ;; The test script calls out to /bin/bash
1367 (string-append bash "/bin/bash"))
1368 ;; There are two failing tests upstream relating to the "stats"
1369 ;; subcommand in test_usage_subcommand ("did not have Usage"
1370 ;; and "usage did not mention samtools stats"), so we disable
1372 (("(test_usage_subcommand\\(.*\\);)" cmd)
1373 (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
1375 'install 'install-library
1376 (lambda* (#:key outputs #:allow-other-keys)
1377 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1379 (copy-file "libbam.a" (string-append lib "/libbam.a"))))
1380 (alist-delete 'configure %standard-phases)))))
1381 (native-inputs `(("pkg-config" ,pkg-config)))
1382 (inputs `(("ncurses" ,ncurses)
1386 (home-page "http://samtools.sourceforge.net")
1387 (synopsis "Utilities to efficiently manipulate nucleotide sequence alignments")
1389 "Samtools implements various utilities for post-processing nucleotide
1390 sequence alignments in the SAM, BAM, and CRAM formats, including indexing,
1391 variant calling (in conjunction with bcftools), and a simple alignment
1393 (license license:expat)))
1395 (define-public samtools-0.1
1396 ;; This is the most recent version of the 0.1 line of samtools. The input
1397 ;; and output formats differ greatly from that used and produced by samtools
1398 ;; 1.x and is still used in many bioinformatics pipelines.
1399 (package (inherit samtools)
1405 (string-append "mirror://sourceforge/samtools/"
1406 version "/samtools-" version ".tar.bz2"))
1408 (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
1410 (substitute-keyword-arguments (package-arguments samtools)
1411 ((#:tests? tests) #f) ;no "check" target
1413 `(modify-phases ,phases
1415 (lambda* (#:key outputs #:allow-other-keys)
1416 (let ((bin (string-append
1417 (assoc-ref outputs "out") "/bin")))
1419 (copy-file "samtools"
1420 (string-append bin "/samtools")))))
1421 (delete 'patch-tests)))))))
1423 (define-public ngs-sdk
1431 (string-append "https://github.com/ncbi/ngs/archive/"
1433 (file-name (string-append name "-" version ".tar.gz"))
1436 "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y"))))
1437 (build-system gnu-build-system)
1439 `(#:parallel-build? #f ; not supported
1440 #:tests? #f ; no "check" target
1444 (lambda* (#:key outputs #:allow-other-keys)
1445 (let ((out (assoc-ref outputs "out")))
1446 ;; The 'configure' script doesn't recognize things like
1447 ;; '--enable-fast-install'.
1448 (zero? (system* "./configure"
1449 (string-append "--build-prefix=" (getcwd) "/build")
1450 (string-append "--prefix=" out)))))
1453 (lambda _ (chdir "ngs-sdk") #t)
1454 %standard-phases))))
1455 (native-inputs `(("perl" ,perl)))
1456 (home-page "https://github.com/ncbi/ngs")
1457 (synopsis "API for accessing Next Generation Sequencing data")
1459 "NGS is a domain-specific API for accessing reads, alignments and pileups
1460 produced from Next Generation Sequencing. The API itself is independent from
1461 any particular back-end implementation, and supports use of multiple back-ends
1463 (license license:public-domain)))
1465 (define-public ngs-java
1466 (package (inherit ngs-sdk)
1469 `(,@(substitute-keyword-arguments
1470 `(#:modules ((guix build gnu-build-system)
1474 ,@(package-arguments ngs-sdk))
1477 'enter-dir 'fix-java-symlink-installation
1479 ;; Only replace the version suffix, not the version number in
1480 ;; the directory name. Reported here:
1481 ;; https://github.com/ncbi/ngs/pull/4
1482 (substitute* "Makefile.java"
1483 (((string-append "\\$\\(subst "
1484 "(\\$\\(VERSION[^\\)]*\\)),"
1485 "(\\$\\([^\\)]+\\)),"
1486 "(\\$\\([^\\)]+\\)|\\$\\@)"
1488 _ pattern replacement target)
1489 (string-append "$(patsubst "
1494 'enter-dir (lambda _ (chdir "ngs-java") #t)
1497 `(("jdk" ,icedtea6 "jdk")
1498 ("ngs-sdk" ,ngs-sdk)))
1499 (synopsis "Java bindings for NGS SDK")))
1501 (define-public ncbi-vdb
1509 (string-append "https://github.com/ncbi/ncbi-vdb/archive/"
1511 (file-name (string-append name "-" version ".tar.gz"))
1514 "1cj8nk6if8sqagv20vx36v566fdvhcaadf0x1ycnbgql6chbs6vy"))))
1515 (build-system gnu-build-system)
1517 `(#:parallel-build? #f ; not supported
1518 #:tests? #f ; no "check" target
1522 (lambda* (#:key inputs outputs #:allow-other-keys)
1523 (let ((out (assoc-ref outputs "out")))
1524 ;; Only replace the version suffix, not the version number in the
1525 ;; directory name; fixed in commit 4dbba5c6a809 (no release yet).
1526 (substitute* "setup/konfigure.perl"
1527 (((string-append "\\$\\(subst "
1528 "(\\$\\(VERSION[^\\)]*\\)),"
1529 "(\\$\\([^\\)]+\\)),"
1530 "(\\$\\([^\\)]+\\)|\\$\\@)"
1532 _ pattern replacement target)
1533 (string-append "$(patsubst "
1538 ;; Override include path for libmagic
1539 (substitute* "setup/package.prl"
1540 (("name => 'magic', Include => '/usr/include'")
1541 (string-append "name=> 'magic', Include => '"
1542 (assoc-ref inputs "libmagic")
1545 ;; Install kdf5 library (needed by sra-tools)
1546 (substitute* "build/Makefile.install"
1547 (("LIBRARIES_TO_INSTALL =")
1548 "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)"))
1550 ;; The 'configure' script doesn't recognize things like
1551 ;; '--enable-fast-install'.
1554 (string-append "--build-prefix=" (getcwd) "/build")
1555 (string-append "--prefix=" (assoc-ref outputs "out"))
1556 (string-append "--debug")
1557 (string-append "--with-xml2-prefix="
1558 (assoc-ref inputs "libxml2"))
1559 (string-append "--with-ngs-sdk-prefix="
1560 (assoc-ref inputs "ngs-sdk"))
1561 (string-append "--with-ngs-java-prefix="
1562 (assoc-ref inputs "ngs-java"))
1563 (string-append "--with-hdf5-prefix="
1564 (assoc-ref inputs "hdf5"))))))
1566 'install 'install-interfaces
1567 (lambda* (#:key outputs #:allow-other-keys)
1568 ;; Install interface libraries. On i686 the interface libraries
1569 ;; are installed to "linux/gcc/i386", so we need to use the Linux
1570 ;; architecture name ("i386") instead of the target system prefix
1572 (mkdir (string-append (assoc-ref outputs "out") "/ilib"))
1573 (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/"
1574 ,(system->linux-architecture
1575 (or (%current-target-system)
1578 (string-append (assoc-ref outputs "out")
1580 ;; Install interface headers
1581 (copy-recursively "interfaces"
1582 (string-append (assoc-ref outputs "out")
1584 %standard-phases))))
1586 `(("libxml2" ,libxml2)
1587 ("ngs-sdk" ,ngs-sdk)
1588 ("ngs-java" ,ngs-java)
1591 (native-inputs `(("perl" ,perl)))
1592 (home-page "https://github.com/ncbi/ncbi-vdb")
1593 (synopsis "Database engine for genetic information")
1595 "The NCBI-VDB library implements a highly compressed columnar data
1596 warehousing engine that is most often used to store genetic information.
1597 Databases are stored in a portable image within the file system, and can be
1598 accessed/downloaded on demand across HTTP.")
1599 (license license:public-domain)))
1601 (define-public sra-tools
1609 (string-append "https://github.com/ncbi/sra-tools/archive/"
1611 (file-name (string-append name "-" version ".tar.gz"))
1614 "11nrnvz7a012f4iryf0wiwrid0h111grsfxbxa9j51h3f2xbvgns"))))
1615 (build-system gnu-build-system)
1617 `(#:parallel-build? #f ; not supported
1618 #:tests? #f ; no "check" target
1622 (lambda* (#:key inputs outputs #:allow-other-keys)
1623 ;; The build system expects a directory containing the sources and
1624 ;; raw build output of ncbi-vdb, including files that are not
1625 ;; installed. Since we are building against an installed version of
1626 ;; ncbi-vdb, the following modifications are needed.
1627 (substitute* "setup/konfigure.perl"
1628 ;; Make the configure script look for the "ilib" directory of
1629 ;; "ncbi-vdb" without first checking for the existence of a
1630 ;; matching library in its "lib" directory.
1631 (("^ my \\$f = File::Spec->catdir\\(\\$libdir, \\$lib\\);")
1632 "my $f = File::Spec->catdir($ilibdir, $ilib);")
1633 ;; Look for interface libraries in ncbi-vdb's "ilib" directory.
1634 (("my \\$ilibdir = File::Spec->catdir\\(\\$builddir, 'ilib'\\);")
1635 "my $ilibdir = File::Spec->catdir($dir, 'ilib');"))
1637 ;; The 'configure' script doesn't recognize things like
1638 ;; '--enable-fast-install'.
1641 (string-append "--build-prefix=" (getcwd) "/build")
1642 (string-append "--prefix=" (assoc-ref outputs "out"))
1643 (string-append "--debug")
1644 (string-append "--with-fuse-prefix="
1645 (assoc-ref inputs "fuse"))
1646 (string-append "--with-magic-prefix="
1647 (assoc-ref inputs "libmagic"))
1648 ;; TODO: building with libxml2 fails with linker errors
1649 ;; (string-append "--with-xml2-prefix="
1650 ;; (assoc-ref inputs "libxml2"))
1651 (string-append "--with-ncbi-vdb-sources="
1652 (assoc-ref inputs "ncbi-vdb"))
1653 (string-append "--with-ncbi-vdb-build="
1654 (assoc-ref inputs "ncbi-vdb"))
1655 (string-append "--with-ngs-sdk-prefix="
1656 (assoc-ref inputs "ngs-sdk"))
1657 (string-append "--with-hdf5-prefix="
1658 (assoc-ref inputs "hdf5")))))
1660 (native-inputs `(("perl" ,perl)))
1662 `(("ngs-sdk" ,ngs-sdk)
1663 ("ncbi-vdb" ,ncbi-vdb)
1668 (home-page "http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software")
1669 (synopsis "Tools and libraries for reading and writing sequencing data")
1671 "The SRA Toolkit from NCBI is a collection of tools and libraries for
1672 reading of sequencing files from the Sequence Read Archive (SRA) database and
1673 writing files into the .sra format.")
1674 (license license:public-domain)))
1676 (define-public seqan
1682 (uri (string-append "http://packages.seqan.de/seqan-library/"
1683 "seqan-library-" version ".tar.bz2"))
1686 "05s3wrrwn50f81aklfm65i4a749zag1vr8z03k21xm0pdxy47yvp"))))
1687 ;; The documentation is 7.8MB and the includes are 3.6MB heavy, so it
1688 ;; makes sense to split the outputs.
1689 (outputs '("out" "doc"))
1690 (build-system trivial-build-system)
1692 `(#:modules ((guix build utils))
1695 (use-modules (guix build utils))
1696 (let ((tar (assoc-ref %build-inputs "tar"))
1697 (bzip (assoc-ref %build-inputs "bzip2"))
1698 (out (assoc-ref %outputs "out"))
1699 (doc (assoc-ref %outputs "doc")))
1700 (setenv "PATH" (string-append tar "/bin:" bzip "/bin"))
1701 (system* "tar" "xvf" (assoc-ref %build-inputs "source"))
1702 (chdir (string-append "seqan-library-" ,version))
1703 (copy-recursively "include" (string-append out "/include"))
1704 (copy-recursively "share" (string-append doc "/share"))))))
1706 `(("source" ,source)
1709 (home-page "http://www.seqan.de")
1710 (synopsis "Library for nucleotide sequence analysis")
1712 "SeqAn is a C++ library of efficient algorithms and data structures for
1713 the analysis of sequences with the focus on biological data. It contains
1714 algorithms and data structures for string representation and their
1715 manipulation, online and indexed string search, efficient I/O of
1716 bioinformatics file formats, sequence alignment, and more.")
1717 (license license:bsd-3)))
1726 "https://github.com/alexdobin/STAR/archive/STAR_"
1730 "1y3bciych1aw6s7k8sy1saj23dcan9wk4d4f96an499slkxwz712"))
1731 (modules '((guix build utils)))
1733 '(substitute* "source/Makefile"
1734 (("/bin/rm") "rm")))))
1735 (build-system gnu-build-system)
1737 '(#:tests? #f ;no check target
1738 #:make-flags '("STAR")
1741 'unpack 'enter-source-dir (lambda _ (chdir "source"))
1744 (lambda* (#:key outputs #:allow-other-keys)
1745 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1747 (copy-file "STAR" (string-append bin "STAR"))))
1749 'configure %standard-phases)))))
1751 `(("vim" ,vim))) ; for xxd
1754 (home-page "https://github.com/alexdobin/STAR")
1755 (synopsis "Universal RNA-seq aligner")
1757 "The Spliced Transcripts Alignment to a Reference (STAR) software is
1758 based on a previously undescribed RNA-seq alignment algorithm that uses
1759 sequential maximum mappable seed search in uncompressed suffix arrays followed
1760 by seed clustering and stitching procedure. In addition to unbiased de novo
1761 detection of canonical junctions, STAR can discover non-canonical splices and
1762 chimeric (fusion) transcripts, and is also capable of mapping full-length RNA
1764 ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed.
1765 (license license:gpl3+)))
1767 (define-public subread
1770 (version "1.4.6-p2")
1774 "mirror://sourceforge/subread/subread-"
1775 version "-source.tar.gz"))
1778 "06sv9mpcsdj6p68y15d6gi70lca3lxmzk0dn61hg0kfsa7rxmsr3"))))
1779 (build-system gnu-build-system)
1781 `(#:tests? #f ;no "check" target
1782 #:make-flags '("-f" "Makefile.Linux")
1786 (lambda _ (chdir "src") #t)
1789 (lambda* (#:key outputs #:allow-other-keys)
1790 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1792 (copy-recursively "../bin" bin)))
1793 ;; no "configure" script
1794 (alist-delete 'configure %standard-phases)))))
1795 (inputs `(("zlib" ,zlib)))
1796 (home-page "http://bioinf.wehi.edu.au/subread-package/")
1797 (synopsis "Tool kit for processing next-gen sequencing data")
1799 "The subread package contains the following tools: subread aligner, a
1800 general-purpose read aligner; subjunc aligner: detecting exon-exon junctions
1801 and mapping RNA-seq reads; featureCounts: counting mapped reads for genomic
1802 features; exactSNP: a SNP caller that discovers SNPs by testing signals
1803 against local background noises.")
1804 (license license:gpl3+)))
1806 (define-public shogun
1814 "ftp://shogun-toolbox.org/shogun/releases/"
1815 (version-major+minor version)
1816 "/sources/shogun-" version ".tar.bz2"))
1819 "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
1820 (modules '((guix build utils)
1824 ;; Remove non-free sources and files referencing them
1825 (for-each delete-file
1826 (find-files "src/shogun/classifier/svm/"
1827 "SVMLight\\.(cpp|h)"))
1828 (for-each delete-file
1829 (find-files "examples/undocumented/libshogun/"
1831 "(classifier_.*svmlight.*|"
1832 "evaluation_cross_validation_locked_comparison).cpp")))
1833 ;; Remove non-free functions.
1834 (define (delete-ifdefs file)
1835 (with-atomic-file-replacement file
1837 (let loop ((line (read-line in 'concat))
1839 (if (eof-object? line)
1843 (not (string-prefix?
1844 "#endif //USE_SVMLIGHT" line)))
1846 "#ifdef USE_SVMLIGHT" line))))
1847 (when (or (not skipping?)
1848 (and skipping? (not skip-next?)))
1850 (loop (read-line in 'concat) skip-next?)))))))
1851 (for-each delete-ifdefs (find-files "src/shogun/kernel/"
1852 "^Kernel\\.(cpp|h)"))))))
1853 (build-system cmake-build-system)
1855 '(#:tests? #f ;no check target
1858 'unpack 'delete-broken-symlinks
1860 (for-each delete-file '("applications/arts/data"
1861 "applications/asp/data"
1862 "applications/easysvm/data"
1863 "applications/msplicer/data"
1864 "applications/ocr/data"
1865 "examples/documented/data"
1866 "examples/documented/matlab_static"
1867 "examples/documented/octave_static"
1868 "examples/undocumented/data"
1869 "examples/undocumented/matlab_static"
1870 "examples/undocumented/octave_static"
1871 "tests/integration/data"
1872 "tests/integration/matlab_static"
1873 "tests/integration/octave_static"
1874 "tests/integration/python_modular/tests"))
1877 'unpack 'change-R-target-path
1878 (lambda* (#:key outputs #:allow-other-keys)
1879 (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
1880 "src/interfaces/r_static/CMakeLists.txt"
1881 "examples/undocumented/r_modular/CMakeLists.txt")
1882 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
1883 (string-append (assoc-ref outputs "out")
1884 "/lib/R/library/")))
1887 'unpack 'fix-octave-modules
1888 (lambda* (#:key outputs #:allow-other-keys)
1889 (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
1890 "src/interfaces/octave_static/CMakeLists.txt")
1891 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
1892 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
1894 ;; change target directory
1895 (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
1896 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
1897 (string-append (assoc-ref outputs "out")
1898 "/share/octave/packages")))
1902 ;; $HOME needs to be set at some point during the build phase
1903 (lambda _ (setenv "HOME" "/tmp") #t)
1904 %standard-phases))))
1906 (list "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
1907 ;;"-DJavaModular=ON" ;requires unpackaged jblas
1908 ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
1909 ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
1910 ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
1911 "-DOctaveModular=ON"
1913 "-DPythonModular=ON"
1917 "-DCmdLineStatic=ON")))
1919 `(("python" ,python)
1920 ("numpy" ,python-numpy)
1926 ("arpack" ,arpack-ng)
1929 ("libxml2" ,libxml2)
1933 `(("pkg-config" ,pkg-config)))
1934 (home-page "http://shogun-toolbox.org/")
1935 (synopsis "Machine learning toolbox")
1937 "The Shogun Machine learning toolbox provides a wide range of unified and
1938 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
1939 combine multiple data representations, algorithm classes, and general purpose
1940 tools. This enables both rapid prototyping of data pipelines and extensibility
1941 in terms of new algorithms.")
1942 (license license:gpl3+)))
1944 (define-public vcftools
1951 "mirror://sourceforge/vcftools/vcftools_"
1955 "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx"))))
1956 (build-system gnu-build-system)
1958 `(#:tests? #f ; no "check" target
1960 "CFLAGS=-O2" ; override "-m64" flag
1961 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1962 (string-append "MANDIR=" (assoc-ref %outputs "out")
1966 'unpack 'patch-manpage-install
1968 (substitute* "Makefile"
1969 (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1")))
1970 (alist-delete 'configure %standard-phases))))
1974 (home-page "http://vcftools.sourceforge.net/")
1975 (synopsis "Tools for working with VCF files")
1977 "VCFtools is a program package designed for working with VCF files, such
1978 as those generated by the 1000 Genomes Project. The aim of VCFtools is to
1979 provide easily accessible methods for working with complex genetic variation
1980 data in the form of VCF files.")
1981 ;; The license is declared as LGPLv3 in the README and
1982 ;; at http://vcftools.sourceforge.net/license.html
1983 (license license:lgpl3)))