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 maths)
38 #:use-module (gnu packages ncurses)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages popt)
42 #:use-module (gnu packages protobuf)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages statistics)
45 #:use-module (gnu packages swig)
46 #:use-module (gnu packages tbb)
47 #:use-module (gnu packages textutils)
48 #:use-module (gnu packages vim)
49 #:use-module (gnu packages web)
50 #:use-module (gnu packages xml)
51 #:use-module (gnu packages zip))
53 (define-public bamtools
60 "https://github.com/pezmaster31/bamtools/archive/v"
62 (file-name (string-append name "-" version ".tar.gz"))
65 "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018"))))
66 (build-system cmake-build-system)
68 `(#:tests? #f ;no "check" target
70 (modify-phases %standard-phases
72 'configure 'set-ldflags
73 (lambda* (#:key outputs #:allow-other-keys)
77 (assoc-ref outputs "out") "/lib/bamtools")))))))
78 (inputs `(("zlib" ,zlib)))
79 (home-page "https://github.com/pezmaster31/bamtools")
80 (synopsis "C++ API and command-line toolkit for working with BAM data")
82 "BamTools provides both a C++ API and a command-line toolkit for handling
84 (license license:expat)))
92 (uri (string-append "https://github.com/bedops/bedops/archive/v"
94 (file-name (string-append name "-" version ".tar.gz"))
97 "0wmg6j0icimlrnsidaxrzf3hfgjvlkkcwvpdg7n4gg7hdv2m9ni5"))))
98 (build-system gnu-build-system)
101 #:make-flags (list (string-append "BINDIR=" %output "/bin"))
104 'unpack 'unpack-tarballs
106 ;; FIXME: Bedops includes tarballs of minimally patched upstream
107 ;; libraries jansson, zlib, and bzip2. We cannot just use stock
108 ;; libraries because at least one of the libraries (zlib) is
109 ;; patched to add a C++ function definition (deflateInit2cpp).
110 ;; Until the Bedops developers offer a way to link against system
111 ;; libraries we have to build the in-tree copies of these three
114 ;; See upstream discussion:
115 ;; https://github.com/bedops/bedops/issues/124
117 ;; Unpack the tarballs to benefit from shebang patching.
118 (with-directory-excursion "third-party"
119 (and (zero? (system* "tar" "xvf" "jansson-2.6.tar.bz2"))
120 (zero? (system* "tar" "xvf" "zlib-1.2.7.tar.bz2"))
121 (zero? (system* "tar" "xvf" "bzip2-1.0.6.tar.bz2"))))
122 ;; Disable unpacking of tarballs in Makefile.
123 (substitute* "system.mk/Makefile.linux"
124 (("^\tbzcat .*") "\t@echo \"not unpacking\"\n")
125 (("\\./configure") "CONFIG_SHELL=bash ./configure"))
126 (substitute* "third-party/zlib-1.2.7/Makefile.in"
127 (("^SHELL=.*$") "SHELL=bash\n")))
128 (alist-delete 'configure %standard-phases))))
129 (home-page "https://github.com/bedops/bedops")
130 (synopsis "Tools for high-performance genomic feature operations")
132 "BEDOPS is a suite of tools to address common questions raised in genomic
133 studies---mostly with regard to overlap and proximity relationships between
134 data sets. It aims to be scalable and flexible, facilitating the efficient
135 and accurate analysis and management of large-scale genomic data.
137 BEDOPS provides tools that perform highly efficient and scalable Boolean and
138 other set operations, statistical calculations, archiving, conversion and
139 other management of genomic data of arbitrary scale. Tasks can be easily
140 split by chromosome for distributing whole-genome analyses across a
141 computational cluster.")
142 (license license:gpl2+)))
144 (define-public bedtools
150 (uri (string-append "https://github.com/arq5x/bedtools2/archive/v"
152 (file-name (string-append name "-" version ".tar.gz"))
155 "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"))))
156 (build-system gnu-build-system)
157 (native-inputs `(("python" ,python-2)))
158 (inputs `(("samtools" ,samtools)
161 '(#:test-target "test"
164 'unpack 'patch-makefile-SHELL-definition
166 ;; patch-makefile-SHELL cannot be used here as it does not
167 ;; yet patch definitions with `:='. Since changes to
168 ;; patch-makefile-SHELL result in a full rebuild, features
169 ;; of patch-makefile-SHELL are reimplemented here.
170 (substitute* "Makefile"
171 (("^SHELL := .*$") (string-append "SHELL := " (which "bash") " -e \n"))))
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
179 (for-each (lambda (file)
180 (copy-file file (string-append bin (basename file))))
181 (find-files "bin" ".*"))))
182 %standard-phases)))))
183 (home-page "https://github.com/arq5x/bedtools2")
184 (synopsis "Tools for genome analysis and arithmetic")
186 "Collectively, the bedtools utilities are a swiss-army knife of tools for
187 a wide-range of genomics analysis tasks. The most widely-used tools enable
188 genome arithmetic: that is, set theory on the genome. For example, bedtools
189 allows one to intersect, merge, count, complement, and shuffle genomic
190 intervals from multiple files in widely-used genomic file formats such as BAM,
192 (license license:gpl2)))
194 (define-public python2-pybedtools
196 (name "python2-pybedtools")
201 "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-"
205 "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an"))))
206 (build-system python-build-system)
207 (arguments `(#:python ,python-2)) ; no Python 3 support
209 `(("python-cython" ,python2-cython)
210 ("python-matplotlib" ,python2-matplotlib)))
212 `(("bedtools" ,bedtools)
213 ("samtools" ,samtools)))
215 `(("python-pyyaml" ,python2-pyyaml)
216 ("python-nose" ,python2-nose)
217 ("python-setuptools" ,python2-setuptools)))
218 (home-page "https://pythonhosted.org/pybedtools/")
219 (synopsis "Python wrapper for BEDtools programs")
221 "pybedtools is a Python wrapper for Aaron Quinlan's BEDtools programs,
222 which are widely used for genomic interval manipulation or \"genome algebra\".
223 pybedtools extends BEDTools by offering feature-level manipulations from with
225 (license license:gpl2+)))
227 (define-public python-biopython
229 (name "python-biopython")
234 "http://biopython.org/DIST/biopython-"
238 "13m8s9jkrw40zvdp1rl709n6lmgdh4f52aann7gzr6sfp0fwhg26"))))
239 (build-system python-build-system)
241 `(("python-numpy" ,python-numpy)))
243 `(("python-setuptools" ,python2-setuptools)))
244 (home-page "http://biopython.org/")
245 (synopsis "Tools for biological computation in Python")
247 "Biopython is a set of tools for biological computation including parsers
248 for bioinformatics files into Python data structures; interfaces to common
249 bioinformatics programs; a standard sequence class and tools for performing
250 common operations on them; code to perform data classification; code for
251 dealing with alignments; code making it easy to split up parallelizable tasks
252 into separate processes; and more.")
253 (license (license:non-copyleft "http://www.biopython.org/DIST/LICENSE"))))
255 (define-public python2-biopython
256 (package (inherit (package-with-python2 python-biopython))
258 `(("python2-numpy" ,python2-numpy)))))
260 (define-public bowtie
266 (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
268 (file-name (string-append name "-" version ".tar.gz"))
271 "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
272 (modules '((guix build utils)))
274 '(substitute* "Makefile"
275 (("^CC = .*$") "CC = gcc")
276 (("^CPP = .*$") "CPP = g++")
277 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
278 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
279 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
280 (patches (list (search-patch "bowtie-fix-makefile.patch")))))
281 (build-system gnu-build-system)
282 (inputs `(("perl" ,perl)
283 ("perl-clone" ,perl-clone)
284 ("perl-test-deep" ,perl-test-deep)
285 ("perl-test-simple" ,perl-test-simple)
286 ("python" ,python-2)))
288 '(#:make-flags '("allall")
294 (lambda* (#:key outputs #:allow-other-keys)
295 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
297 (for-each (lambda (file)
298 (copy-file file (string-append bin file)))
299 (find-files "." "bowtie2.*"))))
302 (lambda* (#:key outputs #:allow-other-keys)
304 "scripts/test/simple_tests.pl"
305 "--bowtie2=./bowtie2"
306 "--bowtie2-build=./bowtie2-build"))
307 %standard-phases)))))
308 (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
309 (synopsis "Fast and sensitive nucleotide sequence read aligner")
311 "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
312 reads to long reference sequences. It is particularly good at aligning reads
313 of about 50 up to 100s or 1,000s of characters, and particularly good at
314 aligning to relatively long (e.g. mammalian) genomes. Bowtie 2 indexes the
315 genome with an FM Index to keep its memory footprint small: for the human
316 genome, its memory footprint is typically around 3.2 GB. Bowtie 2 supports
317 gapped, local, and paired-end alignment modes.")
318 (supported-systems '("x86_64-linux"))
319 (license license:gpl3+)))
327 (uri (string-append "mirror://sourceforge/bio-bwa/bwa-"
331 "1330dpqncv0px3pbhjzz1gwgg39kkcv2r9qp2xs0sixf8z8wl7bh"))))
332 (build-system gnu-build-system)
334 '(#:tests? #f ;no "check" target
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let ((bin (string-append
340 (assoc-ref outputs "out") "/bin"))
342 (assoc-ref outputs "out") "/share/doc/bwa"))
344 (assoc-ref outputs "out") "/share/man/man1")))
348 (copy-file "bwa" (string-append bin "/bwa"))
349 (copy-file "README.md" (string-append doc "/README.md"))
350 (copy-file "bwa.1" (string-append man "/bwa.1"))))
351 ;; no "configure" script
352 (alist-delete 'configure %standard-phases))))
353 (inputs `(("zlib" ,zlib)))
354 (home-page "http://bio-bwa.sourceforge.net/")
355 (synopsis "Burrows-Wheeler sequence aligner")
357 "BWA is a software package for mapping low-divergent sequences against a
358 large reference genome, such as the human genome. It consists of three
359 algorithms: BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm is
360 designed for Illumina sequence reads up to 100bp, while the rest two for
361 longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar
362 features such as long-read support and split alignment, but BWA-MEM, which is
363 the latest, is generally recommended for high-quality queries as it is faster
364 and more accurate. BWA-MEM also has better performance than BWA-backtrack for
365 70-100bp Illumina reads.")
366 (license license:gpl3+)))
368 (define-public python2-bx-python
370 (name "python2-bx-python")
375 "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
379 "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
380 (modules '((guix build utils)))
382 '(substitute* "setup.py"
383 ;; remove dependency on outdated "distribute" module
384 (("^from distribute_setup import use_setuptools") "")
385 (("^use_setuptools\\(\\)") "")))))
386 (build-system python-build-system)
388 `(#:tests? #f ;tests fail because test data are not included
391 `(("python-numpy" ,python2-numpy)
394 `(("python-nose" ,python2-nose)
395 ("python-setuptools" ,python2-setuptools)))
396 (home-page "http://bitbucket.org/james_taylor/bx-python/")
397 (synopsis "Tools for manipulating biological data")
399 "bx-python provides tools for manipulating biological data, particularly
400 multiple sequence alignments.")
401 (license license:expat)))
403 (define-public clipper
410 "https://github.com/YeoLab/clipper/archive/"
414 "1q7jpimsqln7ic44i8v2rx2haj5wvik8hc1s2syd31zcn0xk1iyq"))
415 (modules '((guix build utils)))
417 ;; remove unnecessary setup dependency
418 '(substitute* "setup.py"
419 (("setup_requires = .*") "")))))
420 (build-system python-build-system)
421 (arguments `(#:python ,python-2)) ; only Python 2 is supported
424 ("python-pybedtools" ,python2-pybedtools)
425 ("python-cython" ,python2-cython)
426 ("python-scikit-learn" ,python2-scikit-learn)
427 ("python-matplotlib" ,python2-matplotlib)
428 ("python-pysam" ,python2-pysam)
429 ("python-numpy" ,python2-numpy)
430 ("python-scipy" ,python2-scipy)))
432 `(("python-mock" ,python2-mock) ; for tests
433 ("python-pytz" ,python2-pytz) ; for tests
434 ("python-setuptools" ,python2-setuptools)))
435 (home-page "https://github.com/YeoLab/clipper")
436 (synopsis "CLIP peak enrichment recognition")
438 "CLIPper is a tool to define peaks in CLIP-seq datasets.")
439 (license license:gpl2)))
441 (define-public clustal-omega
443 (name "clustal-omega")
448 "http://www.clustal.org/omega/clustal-omega-"
452 "02ibkx0m0iwz8nscg998bh41gg251y56cgh86bvyrii5m8kjgwqf"))))
453 (build-system gnu-build-system)
455 `(("argtable" ,argtable)))
456 (home-page "http://www.clustal.org/omega/")
457 (synopsis "Multiple sequence aligner for protein and DNA/RNA")
459 "Clustal-Omega is a general purpose multiple sequence alignment (MSA)
460 program for protein and DNA/RNA. It produces high quality MSAs and is capable
461 of handling data-sets of hundreds of thousands of sequences in reasonable
463 (license license:gpl2+)))
465 (define-public crossmap
471 (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
475 "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
476 ;; patch has been sent upstream already
478 (search-patch "crossmap-allow-system-pysam.patch")))
479 (modules '((guix build utils)))
480 ;; remove bundled copy of pysam
482 '(delete-file-recursively "lib/pysam"))))
483 (build-system python-build-system)
489 (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
492 `(("python-numpy" ,python2-numpy)
493 ("python-pysam" ,python2-pysam)
496 `(("python-cython" ,python2-cython)
497 ("python-nose" ,python2-nose)
498 ("python-setuptools" ,python2-setuptools)))
499 (home-page "http://crossmap.sourceforge.net/")
500 (synopsis "Convert genome coordinates between assemblies")
502 "CrossMap is a program for conversion of genome coordinates or annotation
503 files between different genome assemblies. It supports most commonly used
504 file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
505 (license license:gpl2+)))
507 (define-public cutadapt
514 "https://github.com/marcelm/cutadapt/archive/v"
516 (file-name (string-append name "-" version ".tar.gz"))
519 "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5"))))
520 (build-system python-build-system)
522 ;; tests must be run after install
523 `(#:phases (alist-cons-after
525 (lambda* (#:key inputs outputs #:allow-other-keys)
528 (getenv "PYTHONPATH")
529 ":" (assoc-ref outputs "out")
531 (string-take (string-take-right
532 (assoc-ref inputs "python") 5) 3)
534 (zero? (system* "nosetests" "-P" "tests")))
535 (alist-delete 'check %standard-phases))))
537 `(("python-cython" ,python-cython)
538 ("python-nose" ,python-nose)
539 ("python-setuptools" ,python-setuptools)))
540 (home-page "https://code.google.com/p/cutadapt/")
541 (synopsis "Remove adapter sequences from nucleotide sequencing reads")
543 "Cutadapt finds and removes adapter sequences, primers, poly-A tails and
544 other types of unwanted sequence from high-throughput sequencing reads.")
545 (license license:expat)))
547 (define-public edirect
553 ;; Note: older versions are not retained.
554 (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip")
557 "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj"))))
558 (build-system perl-build-system)
560 `(#:tests? #f ;no "check" target
562 (modify-phases %standard-phases
566 (lambda* (#:key outputs #:allow-other-keys)
567 (let ((target (string-append (assoc-ref outputs "out")
570 (copy-file "edirect.pl"
571 (string-append target "/edirect.pl"))
574 'install 'wrap-program
575 (lambda* (#:key inputs outputs #:allow-other-keys)
576 ;; Make sure 'edirect.pl' finds all perl inputs at runtime.
577 (let* ((out (assoc-ref outputs "out"))
578 (path (getenv "PERL5LIB")))
579 (wrap-program (string-append out "/bin/edirect.pl")
580 `("PERL5LIB" ":" prefix (,path)))))))))
582 `(("perl-html-parser" ,perl-html-parser)
583 ("perl-encode-locale" ,perl-encode-locale)
584 ("perl-file-listing" ,perl-file-listing)
585 ("perl-html-tagset" ,perl-html-tagset)
586 ("perl-html-tree" ,perl-html-tree)
587 ("perl-http-cookies" ,perl-http-cookies)
588 ("perl-http-date" ,perl-http-date)
589 ("perl-http-message" ,perl-http-message)
590 ("perl-http-negotiate" ,perl-http-negotiate)
591 ("perl-lwp-mediatypes" ,perl-lwp-mediatypes)
592 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
593 ("perl-net-http" ,perl-net-http)
594 ("perl-uri" ,perl-uri)
595 ("perl-www-robotrules" ,perl-www-robotrules)
599 (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288")
600 (synopsis "Tools for accessing the NCBI's set of databases")
602 "Entrez Direct (EDirect) is a method for accessing the National Center
603 for Biotechnology Information's (NCBI) set of interconnected
604 databases (publication, sequence, structure, gene, variation, expression,
605 etc.) from a terminal. Functions take search terms from command-line
606 arguments. Individual operations are combined to build multi-step queries.
607 Record retrieval and formatting normally complete the process.
609 EDirect also provides an argument-driven function that simplifies the
610 extraction of data from document summaries or other results that are returned
611 in structured XML format. This can eliminate the need for writing custom
612 software to answer ad hoc questions.")
613 (license license:public-domain)))
615 (define-public express
623 "http://bio.math.berkeley.edu/eXpress/downloads/express-"
624 version "/express-" version "-src.tgz"))
627 "03rczxd0gjp2l1jxcmjfmf5j94j77zqyxa6x063zsc585nj40n0c"))))
628 (build-system cmake-build-system)
630 `(#:tests? #f ;no "check" target
633 'unpack 'use-shared-boost-libs-and-set-bamtools-paths
634 (lambda* (#:key inputs #:allow-other-keys)
635 (substitute* "CMakeLists.txt"
636 (("set\\(Boost_USE_STATIC_LIBS ON\\)")
637 "set(Boost_USE_STATIC_LIBS OFF)")
638 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/bamtools/include")
639 (string-append (assoc-ref inputs "bamtools") "/include/bamtools")))
640 (substitute* "src/CMakeLists.txt"
641 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/\\.\\./bamtools/lib")
642 (string-append (assoc-ref inputs "bamtools") "/lib/bamtools")))
647 ("bamtools" ,bamtools)
648 ("protobuf" ,protobuf)
650 (home-page "http://bio.math.berkeley.edu/eXpress")
651 (synopsis "Streaming quantification for high-throughput genomic sequencing")
653 "eXpress is a streaming tool for quantifying the abundances of a set of
654 target sequences from sampled subsequences. Example applications include
655 transcript-level RNA-Seq quantification, allele-specific/haplotype expression
656 analysis (from RNA-Seq), transcription factor binding quantification in
657 ChIP-Seq, and analysis of metagenomic data.")
658 (license license:artistic2.0)))
660 (define-public fastx-toolkit
662 (name "fastx-toolkit")
668 "https://github.com/agordon/fastx_toolkit/releases/download/"
669 version "/fastx_toolkit-" version ".tar.bz2"))
672 "01jqzw386873sr0pjp1wr4rn8fsga2vxs1qfmicvx1pjr72007wy"))))
673 (build-system gnu-build-system)
675 `(("libgtextutils" ,libgtextutils)))
677 `(("pkg-config" ,pkg-config)))
678 (home-page "http://hannonlab.cshl.edu/fastx_toolkit/")
679 (synopsis "Tools for FASTA/FASTQ file preprocessing")
681 "The FASTX-Toolkit is a collection of command line tools for Short-Reads
682 FASTA/FASTQ files preprocessing.
684 Next-Generation sequencing machines usually produce FASTA or FASTQ files,
685 containing multiple short-reads sequences. The main processing of such
686 FASTA/FASTQ files is mapping the sequences to reference genomes. However, it
687 is sometimes more productive to preprocess the files before mapping the
688 sequences to the genome---manipulating the sequences to produce better mapping
689 results. The FASTX-Toolkit tools perform some of these preprocessing tasks.")
690 (license license:agpl3+)))
692 (define-public flexbar
699 (string-append "mirror://sourceforge/flexbar/"
700 version "/flexbar_v" version "_src.tgz"))
703 "13jaykc3y1x8y5nn9j8ljnb79s5y51kyxz46hdmvvjj6qhyympmf"))))
704 (build-system cmake-build-system)
706 `(#:configure-flags (list
707 (string-append "-DFLEXBAR_BINARY_DIR="
708 (assoc-ref %outputs "out")
713 (lambda* (#:key outputs #:allow-other-keys)
714 (setenv "PATH" (string-append
715 (assoc-ref outputs "out") "/bin:"
717 (chdir "../flexbar_v2.5_src/test")
718 (zero? (system* "bash" "flexbar_validate.sh")))
719 (alist-delete 'install %standard-phases))))
724 `(("pkg-config" ,pkg-config)
726 (home-page "http://flexbar.sourceforge.net")
727 (synopsis "Barcode and adapter removal tool for sequencing platforms")
729 "Flexbar preprocesses high-throughput nucleotide sequencing data
730 efficiently. It demultiplexes barcoded runs and removes adapter sequences.
731 Moreover, trimming and filtering features are provided. Flexbar increases
732 read mapping rates and improves genome and transcriptome assemblies. It
733 supports next-generation sequencing data in fasta/q and csfasta/q format from
734 Illumina, Roche 454, and the SOLiD platform.")
735 (license license:gpl3)))
744 "https://github.com/nboley/grit/archive/"
746 (file-name (string-append name "-" version ".tar.gz"))
749 "157in84dj70wimbind3x7sy1whs3h57qfgcnj2s6lrd38fbrb7mj"))))
750 (build-system python-build-system)
755 'unpack 'generate-from-cython-sources
756 (lambda* (#:key inputs outputs #:allow-other-keys)
757 ;; Delete these C files to force fresh generation from pyx sources.
758 (delete-file "grit/sparsify_support_fns.c")
759 (delete-file "grit/call_peaks_support_fns.c")
760 (substitute* "setup.py"
761 (("Cython.Setup") "Cython.Build")
762 ;; Add numpy include path to fix compilation
764 (string-append "pyx\", ], include_dirs = ['"
765 (assoc-ref inputs "python-numpy")
766 "/lib/python2.7/site-packages/numpy/core/include/"
770 `(("python-scipy" ,python2-scipy)
771 ("python-numpy" ,python2-numpy)
772 ("python-pysam" ,python2-pysam)
773 ("python-networkx" ,python2-networkx)))
775 `(("python-cython" ,python2-cython)
776 ("python-setuptools" ,python2-setuptools)))
777 (home-page "http://grit-bio.org")
778 (synopsis "Tool for integrative analysis of RNA-seq type assays")
780 "GRIT is designed to use RNA-seq, TES, and TSS data to build and quantify
781 full length transcript models. When none of these data sources are available,
782 GRIT can be run by providing a candidate set of TES or TSS sites. In
783 addition, GRIT can merge in reference junctions and gene boundaries. GRIT can
784 also be run in quantification mode, where it uses a provided GTF file and just
785 estimates transcript expression.")
786 (license license:gpl3+)))
795 "http://ccb.jhu.edu/software/hisat/downloads/hisat-"
796 version "-beta-source.zip"))
799 "1k381ydranqxp09yf2y7w1d0chz5d59vb6jchi89hbb0prq19lk5"))))
800 (build-system gnu-build-system)
802 `(#:tests? #f ;no check target
803 #:make-flags '("allall"
804 ;; Disable unsupported `popcnt' instructions on
805 ;; architectures other than x86_64
806 ,@(if (string-prefix? "x86_64"
807 (or (%current-target-system)
810 '("POPCNT_CAPABILITY=0")))
813 'unpack 'patch-sources
815 ;; XXX Cannot use snippet because zip files are not supported
816 (substitute* "Makefile"
817 (("^CC = .*$") "CC = gcc")
818 (("^CPP = .*$") "CPP = g++")
819 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
820 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
821 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\""))
822 (substitute* '("hisat-build" "hisat-inspect")
823 (("/usr/bin/env") (which "env"))))
826 (lambda* (#:key outputs #:allow-other-keys)
827 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
831 (copy-file file (string-append bin file)))
834 "hisat(-(build|align|inspect)(-(s|l)(-debug)*)*)*$"))))
835 (alist-delete 'configure %standard-phases)))))
842 (home-page "http://ccb.jhu.edu/software/hisat/index.shtml")
843 (synopsis "Hierarchical indexing for spliced alignment of transcripts")
845 "HISAT is a fast and sensitive spliced alignment program for mapping
846 RNA-seq reads. In addition to one global FM index that represents a whole
847 genome, HISAT uses a large set of small FM indexes that collectively cover the
848 whole genome. These small indexes (called local indexes) combined with
849 several alignment strategies enable effective alignment of RNA-seq reads, in
850 particular, reads spanning multiple exons.")
851 (license license:gpl3+)))
860 "https://pypi.python.org/packages/source/H/HTSeq/HTSeq-"
864 "1i85ppf2j2lj12m0x690qq5nn17xxk23pbbx2c83r8ayb5wngzwv"))))
865 (build-system python-build-system)
866 (arguments `(#:python ,python-2)) ; only Python 2 is supported
868 `(("python-numpy" ,python2-numpy)
869 ("python-setuptools" ,python2-setuptools)))
870 (home-page "http://www-huber.embl.de/users/anders/HTSeq/")
871 (synopsis "Analysing high-throughput sequencing data with Python")
873 "HTSeq is a Python package that provides infrastructure to process data
874 from high-throughput sequencing assays.")
875 (license license:gpl3+)))
877 (define-public htsjdk
884 "https://github.com/samtools/htsjdk/archive/"
886 (file-name (string-append name "-" version ".tar.gz"))
889 "0asdk9b8jx2ij7yd6apg9qx03li8q7z3ml0qy2r2qczkra79y6fw"))
890 (modules '((guix build utils)))
891 ;; remove build dependency on git
892 (snippet '(substitute* "build.xml"
893 (("failifexecutionfails=\"true\"")
894 "failifexecutionfails=\"false\"")))))
895 (build-system gnu-build-system)
897 `(#:modules ((srfi srfi-1)
898 (guix build gnu-build-system)
900 #:phases (alist-replace
903 (setenv "JAVA_HOME" (assoc-ref %build-inputs "jdk"))
904 (zero? (system* "ant" "all"
905 (string-append "-Ddist="
906 (assoc-ref %outputs "out")
907 "/share/java/htsjdk/"))))
908 (fold alist-delete %standard-phases
909 '(configure install check)))))
912 ("jdk" ,icedtea6 "jdk")))
913 (home-page "http://samtools.github.io/htsjdk/")
914 (synopsis "Java API for high-throughput sequencing data (HTS) formats")
916 "HTSJDK is an implementation of a unified Java library for accessing
917 common file formats, such as SAM and VCF, used for high-throughput
918 sequencing (HTS) data. There are also an number of useful utilities for
919 manipulating HTS data.")
920 (license license:expat)))
922 (define-public htslib
929 "https://github.com/samtools/htslib/releases/download/"
930 version "/htslib-" version ".tar.bz2"))
933 "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx"))))
934 (build-system gnu-build-system)
937 (modify-phases %standard-phases
941 (substitute* "test/test.pl"
942 (("/bin/bash") (which "bash")))
948 (home-page "http://www.htslib.org")
949 (synopsis "C library for reading/writing high-throughput sequencing data")
951 "HTSlib is a C library for reading/writing high-throughput sequencing
952 data. It also provides the bgzip, htsfile, and tabix utilities.")
953 ;; Files under cram/ are released under the modified BSD license;
954 ;; the rest is released under the Expat license
955 (license (list license:expat license:bsd-3))))
960 (version "2.1.0.20140616")
964 "https://pypi.python.org/packages/source/M/MACS2/MACS2-"
968 "11lmiw6avqhwn75sn59g4lfkrr2kk20r3rgfbx9xfqb8rg9mi2n6"))))
969 (build-system python-build-system)
971 `(#:python ,python-2 ; only compatible with Python 2.7
972 #:tests? #f)) ; no test target
974 `(("python-numpy" ,python2-numpy)))
976 `(("python-setuptools" ,python2-setuptools)))
977 (home-page "http://github.com/taoliu/MACS/")
978 (synopsis "Model based analysis for ChIP-Seq data")
980 "MACS is an implementation of a ChIP-Seq analysis algorithm for
981 identifying transcript factor binding sites named Model-based Analysis of
982 ChIP-Seq (MACS). MACS captures the influence of genome complexity to evaluate
983 the significance of enriched ChIP regions and it improves the spatial
984 resolution of binding sites through combining the information of both
985 sequencing tag position and orientation.")
986 (license license:bsd-3)))
995 "http://pypi.python.org/packages/source/m/misopy/misopy-"
999 "0x446867az8ir0z8c1vjqffkp0ma37wm4sylixnkhgawllzx8v5w"))
1000 (modules '((guix build utils)))
1001 ;; use "gcc" instead of "cc" for compilation
1003 '(substitute* "setup.py"
1005 "cc.set_executables(
1009 linker_so='gcc -shared'); defines")))))
1010 (build-system python-build-system)
1012 `(#:python ,python-2 ; only Python 2 is supported
1013 #:tests? #f)) ; no "test" target
1015 `(("samtools" ,samtools)
1016 ("python-numpy" ,python2-numpy)
1017 ("python-pysam" ,python2-pysam)
1018 ("python-scipy" ,python2-scipy)
1019 ("python-matplotlib" ,python2-matplotlib)))
1021 `(("python-setuptools" ,python2-setuptools)))
1022 (home-page "http://genes.mit.edu/burgelab/miso/index.html")
1023 (synopsis "Mixture of Isoforms model for RNA-Seq isoform quantitation")
1025 "MISO (Mixture-of-Isoforms) is a probabilistic framework that quantitates
1026 the expression level of alternatively spliced genes from RNA-Seq data, and
1027 identifies differentially regulated isoforms or exons across samples. By
1028 modeling the generative process by which reads are produced from isoforms in
1029 RNA-Seq, the MISO model uses Bayesian inference to compute the probability
1030 that a read originated from a particular isoform.")
1031 (license license:gpl2)))
1033 (define-public python2-pbcore
1035 (name "python2-pbcore")
1040 "https://github.com/PacificBiosciences/pbcore/archive/"
1042 (file-name (string-append name "-" version ".tar.gz"))
1045 "1z46rwjac93jm87cbj2zgjg6qvsgs65140wkbbxsvxps7ai4pm09"))))
1046 (build-system python-build-system)
1047 (arguments `(#:python ,python-2)) ; pbcore requires Python 2.7
1049 `(("python-cython" ,python2-cython)
1050 ("python-numpy" ,python2-numpy)
1051 ("python-pysam" ,python2-pysam)
1052 ("python-h5py" ,python2-h5py)))
1054 `(("python-setuptools" ,python2-setuptools)))
1055 (home-page "http://pacificbiosciences.github.io/pbcore/")
1056 (synopsis "Library for reading and writing PacBio data files")
1058 "The pbcore package provides Python APIs for interacting with PacBio data
1059 files and writing bioinformatics applications.")
1060 (license license:bsd-3)))
1062 (define-public pbtranscript-tofu
1063 (let ((commit "c7bbd5472"))
1065 (name "pbtranscript-tofu")
1066 (version (string-append "0.4.1." commit))
1070 (url "https://github.com/PacificBiosciences/cDNA_primer.git")
1072 (file-name (string-append name "-" version ".tar.gz"))
1075 "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
1076 (build-system python-build-system)
1078 `(#:python ,python-2
1079 ;; With standard flags, the install phase attempts to create a zip'd
1080 ;; egg file, and fails with an error: 'ZIP does not support timestamps
1082 #:configure-flags '("--single-version-externally-managed"
1083 "--record=pbtranscript-tofu.txt")
1086 'unpack 'enter-directory-and-clean-up
1088 (chdir "pbtranscript-tofu/pbtranscript/")
1090 (delete-file-recursively "dist/")
1091 (delete-file-recursively "build/")
1092 (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/")
1093 (delete-file-recursively "pbtools.pbtranscript.egg-info")
1094 (delete-file "Cython-0.20.1.tar.gz")
1095 (delete-file "setuptools_cython-0.2.1-py2.7.egg")
1096 (delete-file "setuptools_cython-0.2.1.tar.gz")
1097 (delete-file "setup.cfg")
1098 (for-each delete-file
1099 (find-files "." "\\.so$"))
1100 ;; files should be writable for install phase
1101 (for-each (lambda (f) (chmod f #o755))
1102 (find-files "." "\\.py$")))
1105 `(("python-cython" ,python2-cython)
1106 ("python-numpy" ,python2-numpy)
1107 ("python-bx-python" ,python2-bx-python)
1108 ("python-networkx" ,python2-networkx)
1109 ("python-scipy" ,python2-scipy)
1110 ("python-pbcore" ,python2-pbcore)))
1112 `(("python-nose" ,python2-nose)
1113 ("python-setuptools" ,python2-setuptools)))
1114 (home-page "https://github.com/PacificBiosciences/cDNA_primer")
1115 (synopsis "Analyze transcriptome data generated with the Iso-Seq protocol")
1117 "pbtranscript-tofu contains scripts to analyze transcriptome data
1118 generated using the PacBio Iso-Seq protocol.")
1119 (license license:bsd-3))))
1129 (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-"
1132 (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q"))
1133 (patches (list (search-patch "rsem-makefile.patch")))
1134 (modules '((guix build utils)))
1137 ;; remove bundled copy of boost
1138 (delete-file-recursively "boost")
1140 (build-system gnu-build-system)
1142 `(#:tests? #f ;no "check" target
1144 (modify-phases %standard-phases
1145 ;; No "configure" script.
1146 ;; Do not build bundled samtools library.
1149 (substitute* "Makefile"
1150 (("^all : sam/libbam.a") "all : "))
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 (let* ((out (string-append (assoc-ref outputs "out")))
1155 (bin (string-append out "/bin/"))
1156 (perl (string-append out "/lib/perl5/site_perl")))
1159 (for-each (lambda (file)
1161 (string-append bin (basename file))))
1162 (find-files "." "rsem-.*"))
1163 (copy-file "rsem_perl_utils.pm"
1164 (string-append perl "/rsem_perl_utils.pm")))
1167 'install 'wrap-program
1168 (lambda* (#:key outputs #:allow-other-keys)
1169 (let ((out (assoc-ref outputs "out")))
1170 (for-each (lambda (prog)
1171 (wrap-program (string-append out "/bin/" prog)
1172 `("PERL5LIB" ":" prefix
1173 (,(string-append out "/lib/perl5/site_perl")))))
1174 '("rsem-plot-transcript-wiggles"
1175 "rsem-calculate-expression"
1176 "rsem-generate-ngvector"
1178 "rsem-prepare-reference")))
1182 ("ncurses" ,ncurses)
1185 ("samtools" ,samtools-0.1)
1187 (home-page "http://deweylab.biostat.wisc.edu/rsem/")
1188 (synopsis "Estimate gene expression levels from RNA-Seq data")
1190 "RSEM is a software package for estimating gene and isoform expression
1191 levels from RNA-Seq data. The RSEM package provides a user-friendly
1192 interface, supports threads for parallel computation of the EM algorithm,
1193 single-end and paired-end read data, quality scores, variable-length reads and
1194 RSPD estimation. In addition, it provides posterior mean and 95% credibility
1195 interval estimates for expression levels. For visualization, it can generate
1196 BAM and Wiggle files in both transcript-coordinate and genomic-coordinate.")
1197 (license license:gpl3+)))
1199 (define-public rseqc
1207 (string-append "mirror://sourceforge/rseqc/"
1208 version "/RSeQC-" version ".tar.gz"))
1210 (base32 "15ly0254yi032qzkdplg00q144qfdsd986gh62829rl5bkxhj330"))
1211 (modules '((guix build utils)))
1214 ;; remove bundled copy of pysam
1215 (delete-file-recursively "lib/pysam")
1216 (substitute* "setup.py"
1217 ;; remove dependency on outdated "distribute" module
1218 (("^from distribute_setup import use_setuptools") "")
1219 (("^use_setuptools\\(\\)") "")
1220 ;; do not use bundled copy of pysam
1221 (("^have_pysam = False") "have_pysam = True"))))))
1222 (build-system python-build-system)
1223 (arguments `(#:python ,python-2))
1225 `(("python-cython" ,python2-cython)
1226 ("python-pysam" ,python2-pysam)
1227 ("python-numpy" ,python2-numpy)
1228 ("python-setuptools" ,python2-setuptools)
1231 `(("python-nose" ,python2-nose)))
1232 (home-page "http://rseqc.sourceforge.net/")
1233 (synopsis "RNA-seq quality control package")
1235 "RSeQC provides a number of modules that can comprehensively evaluate
1236 high throughput sequence data, especially RNA-seq data. Some basic modules
1237 inspect sequence quality, nucleotide composition bias, PCR bias and GC bias,
1238 while RNA-seq specific modules evaluate sequencing saturation, mapped reads
1239 distribution, coverage uniformity, strand specificity, etc.")
1240 (license license:gpl3+)))
1242 (define-public samtools
1250 (string-append "mirror://sourceforge/samtools/"
1251 version "/samtools-" version ".tar.bz2"))
1254 "1y5p2hs4gif891b4ik20275a8xf3qrr1zh9wpysp4g8m0g1jckf2"))))
1255 (build-system gnu-build-system)
1257 `(;; There are 87 test failures when building on non-64-bit architectures
1258 ;; due to invalid test data. This has since been fixed upstream (see
1259 ;; <https://github.com/samtools/samtools/pull/307>), but as there has
1260 ;; not been a new release we disable the tests for all non-64-bit
1262 #:tests? ,(string=? (or (%current-system) (%current-target-system))
1264 #:make-flags (list "LIBCURSES=-lncurses"
1265 (string-append "prefix=" (assoc-ref %outputs "out")))
1270 (lambda* (#:key inputs #:allow-other-keys)
1271 (let ((bash (assoc-ref inputs "bash")))
1272 (substitute* "test/test.pl"
1273 ;; The test script calls out to /bin/bash
1275 (string-append bash "/bin/bash"))
1276 ;; There are two failing tests upstream relating to the "stats"
1277 ;; subcommand in test_usage_subcommand ("did not have Usage"
1278 ;; and "usage did not mention samtools stats"), so we disable
1280 (("(test_usage_subcommand\\(.*\\);)" cmd)
1281 (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
1283 'install 'install-library
1284 (lambda* (#:key outputs #:allow-other-keys)
1285 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1287 (copy-file "libbam.a" (string-append lib "/libbam.a"))))
1288 (alist-delete 'configure %standard-phases)))))
1289 (native-inputs `(("pkg-config" ,pkg-config)))
1290 (inputs `(("ncurses" ,ncurses)
1294 (home-page "http://samtools.sourceforge.net")
1295 (synopsis "Utilities to efficiently manipulate nucleotide sequence alignments")
1297 "Samtools implements various utilities for post-processing nucleotide
1298 sequence alignments in the SAM, BAM, and CRAM formats, including indexing,
1299 variant calling (in conjunction with bcftools), and a simple alignment
1301 (license license:expat)))
1303 (define-public samtools-0.1
1304 ;; This is the most recent version of the 0.1 line of samtools. The input
1305 ;; and output formats differ greatly from that used and produced by samtools
1306 ;; 1.x and is still used in many bioinformatics pipelines.
1307 (package (inherit samtools)
1313 (string-append "mirror://sourceforge/samtools/"
1314 version "/samtools-" version ".tar.bz2"))
1316 (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
1318 (substitute-keyword-arguments (package-arguments samtools)
1319 ((#:tests? tests) #f) ;no "check" target
1321 `(modify-phases ,phases
1323 (lambda* (#:key outputs #:allow-other-keys)
1324 (let ((bin (string-append
1325 (assoc-ref outputs "out") "/bin")))
1327 (copy-file "samtools"
1328 (string-append bin "/samtools")))))
1329 (delete 'patch-tests)))))))
1331 (define-public ngs-sdk
1339 (string-append "https://github.com/ncbi/ngs/archive/"
1341 (file-name (string-append name "-" version ".tar.gz"))
1344 "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y"))))
1345 (build-system gnu-build-system)
1347 `(#:parallel-build? #f ; not supported
1348 #:tests? #f ; no "check" target
1352 (lambda* (#:key outputs #:allow-other-keys)
1353 (let ((out (assoc-ref outputs "out")))
1354 ;; The 'configure' script doesn't recognize things like
1355 ;; '--enable-fast-install'.
1356 (zero? (system* "./configure"
1357 (string-append "--build-prefix=" (getcwd) "/build")
1358 (string-append "--prefix=" out)))))
1361 (lambda _ (chdir "ngs-sdk") #t)
1362 %standard-phases))))
1363 (native-inputs `(("perl" ,perl)))
1364 (home-page "https://github.com/ncbi/ngs")
1365 (synopsis "API for accessing Next Generation Sequencing data")
1367 "NGS is a domain-specific API for accessing reads, alignments and pileups
1368 produced from Next Generation Sequencing. The API itself is independent from
1369 any particular back-end implementation, and supports use of multiple back-ends
1371 (license license:public-domain)))
1373 (define-public ngs-java
1374 (package (inherit ngs-sdk)
1377 `(,@(substitute-keyword-arguments
1378 `(#:modules ((guix build gnu-build-system)
1382 ,@(package-arguments ngs-sdk))
1385 'enter-dir 'fix-java-symlink-installation
1387 ;; Only replace the version suffix, not the version number in
1388 ;; the directory name. Reported here:
1389 ;; https://github.com/ncbi/ngs/pull/4
1390 (substitute* "Makefile.java"
1391 (((string-append "\\$\\(subst "
1392 "(\\$\\(VERSION[^\\)]*\\)),"
1393 "(\\$\\([^\\)]+\\)),"
1394 "(\\$\\([^\\)]+\\)|\\$\\@)"
1396 _ pattern replacement target)
1397 (string-append "$(patsubst "
1402 'enter-dir (lambda _ (chdir "ngs-java") #t)
1405 `(("jdk" ,icedtea6 "jdk")
1406 ("ngs-sdk" ,ngs-sdk)))
1407 (synopsis "Java bindings for NGS SDK")))
1409 (define-public ncbi-vdb
1417 (string-append "https://github.com/ncbi/ncbi-vdb/archive/"
1419 (file-name (string-append name "-" version ".tar.gz"))
1422 "1cj8nk6if8sqagv20vx36v566fdvhcaadf0x1ycnbgql6chbs6vy"))))
1423 (build-system gnu-build-system)
1425 `(#:parallel-build? #f ; not supported
1426 #:tests? #f ; no "check" target
1430 (lambda* (#:key inputs outputs #:allow-other-keys)
1431 (let ((out (assoc-ref outputs "out")))
1432 ;; Only replace the version suffix, not the version number in the
1433 ;; directory name; fixed in commit 4dbba5c6a809 (no release yet).
1434 (substitute* "setup/konfigure.perl"
1435 (((string-append "\\$\\(subst "
1436 "(\\$\\(VERSION[^\\)]*\\)),"
1437 "(\\$\\([^\\)]+\\)),"
1438 "(\\$\\([^\\)]+\\)|\\$\\@)"
1440 _ pattern replacement target)
1441 (string-append "$(patsubst "
1446 ;; Override include path for libmagic
1447 (substitute* "setup/package.prl"
1448 (("name => 'magic', Include => '/usr/include'")
1449 (string-append "name=> 'magic', Include => '"
1450 (assoc-ref inputs "libmagic")
1453 ;; Install kdf5 library (needed by sra-tools)
1454 (substitute* "build/Makefile.install"
1455 (("LIBRARIES_TO_INSTALL =")
1456 "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)"))
1458 ;; The 'configure' script doesn't recognize things like
1459 ;; '--enable-fast-install'.
1462 (string-append "--build-prefix=" (getcwd) "/build")
1463 (string-append "--prefix=" (assoc-ref outputs "out"))
1464 (string-append "--debug")
1465 (string-append "--with-xml2-prefix="
1466 (assoc-ref inputs "libxml2"))
1467 (string-append "--with-ngs-sdk-prefix="
1468 (assoc-ref inputs "ngs-sdk"))
1469 (string-append "--with-ngs-java-prefix="
1470 (assoc-ref inputs "ngs-java"))
1471 (string-append "--with-hdf5-prefix="
1472 (assoc-ref inputs "hdf5"))))))
1474 'install 'install-interfaces
1475 (lambda* (#:key outputs #:allow-other-keys)
1476 ;; Install interface libraries. On i686 the interface libraries
1477 ;; are installed to "linux/gcc/i386", so we need to use the Linux
1478 ;; architecture name ("i386") instead of the target system prefix
1480 (mkdir (string-append (assoc-ref outputs "out") "/ilib"))
1481 (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/"
1482 ,(system->linux-architecture
1483 (or (%current-target-system)
1486 (string-append (assoc-ref outputs "out")
1488 ;; Install interface headers
1489 (copy-recursively "interfaces"
1490 (string-append (assoc-ref outputs "out")
1492 %standard-phases))))
1494 `(("libxml2" ,libxml2)
1495 ("ngs-sdk" ,ngs-sdk)
1496 ("ngs-java" ,ngs-java)
1499 (native-inputs `(("perl" ,perl)))
1500 (home-page "https://github.com/ncbi/ncbi-vdb")
1501 (synopsis "Database engine for genetic information")
1503 "The NCBI-VDB library implements a highly compressed columnar data
1504 warehousing engine that is most often used to store genetic information.
1505 Databases are stored in a portable image within the file system, and can be
1506 accessed/downloaded on demand across HTTP.")
1507 (license license:public-domain)))
1509 (define-public sra-tools
1517 (string-append "https://github.com/ncbi/sra-tools/archive/"
1519 (file-name (string-append name "-" version ".tar.gz"))
1522 "11nrnvz7a012f4iryf0wiwrid0h111grsfxbxa9j51h3f2xbvgns"))))
1523 (build-system gnu-build-system)
1525 `(#:parallel-build? #f ; not supported
1526 #:tests? #f ; no "check" target
1530 (lambda* (#:key inputs outputs #:allow-other-keys)
1531 ;; The build system expects a directory containing the sources and
1532 ;; raw build output of ncbi-vdb, including files that are not
1533 ;; installed. Since we are building against an installed version of
1534 ;; ncbi-vdb, the following modifications are needed.
1535 (substitute* "setup/konfigure.perl"
1536 ;; Make the configure script look for the "ilib" directory of
1537 ;; "ncbi-vdb" without first checking for the existence of a
1538 ;; matching library in its "lib" directory.
1539 (("^ my \\$f = File::Spec->catdir\\(\\$libdir, \\$lib\\);")
1540 "my $f = File::Spec->catdir($ilibdir, $ilib);")
1541 ;; Look for interface libraries in ncbi-vdb's "ilib" directory.
1542 (("my \\$ilibdir = File::Spec->catdir\\(\\$builddir, 'ilib'\\);")
1543 "my $ilibdir = File::Spec->catdir($dir, 'ilib');"))
1545 ;; The 'configure' script doesn't recognize things like
1546 ;; '--enable-fast-install'.
1549 (string-append "--build-prefix=" (getcwd) "/build")
1550 (string-append "--prefix=" (assoc-ref outputs "out"))
1551 (string-append "--debug")
1552 (string-append "--with-fuse-prefix="
1553 (assoc-ref inputs "fuse"))
1554 (string-append "--with-magic-prefix="
1555 (assoc-ref inputs "libmagic"))
1556 ;; TODO: building with libxml2 fails with linker errors
1557 ;; (string-append "--with-xml2-prefix="
1558 ;; (assoc-ref inputs "libxml2"))
1559 (string-append "--with-ncbi-vdb-sources="
1560 (assoc-ref inputs "ncbi-vdb"))
1561 (string-append "--with-ncbi-vdb-build="
1562 (assoc-ref inputs "ncbi-vdb"))
1563 (string-append "--with-ngs-sdk-prefix="
1564 (assoc-ref inputs "ngs-sdk"))
1565 (string-append "--with-hdf5-prefix="
1566 (assoc-ref inputs "hdf5")))))
1568 (native-inputs `(("perl" ,perl)))
1570 `(("ngs-sdk" ,ngs-sdk)
1571 ("ncbi-vdb" ,ncbi-vdb)
1576 (home-page "http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software")
1577 (synopsis "Tools and libraries for reading and writing sequencing data")
1579 "The SRA Toolkit from NCBI is a collection of tools and libraries for
1580 reading of sequencing files from the Sequence Read Archive (SRA) database and
1581 writing files into the .sra format.")
1582 (license license:public-domain)))
1584 (define-public seqan
1590 (uri (string-append "http://packages.seqan.de/seqan-library/"
1591 "seqan-library-" version ".tar.bz2"))
1594 "05s3wrrwn50f81aklfm65i4a749zag1vr8z03k21xm0pdxy47yvp"))))
1595 ;; The documentation is 7.8MB and the includes are 3.6MB heavy, so it
1596 ;; makes sense to split the outputs.
1597 (outputs '("out" "doc"))
1598 (build-system trivial-build-system)
1600 `(#:modules ((guix build utils))
1603 (use-modules (guix build utils))
1604 (let ((tar (assoc-ref %build-inputs "tar"))
1605 (bzip (assoc-ref %build-inputs "bzip2"))
1606 (out (assoc-ref %outputs "out"))
1607 (doc (assoc-ref %outputs "doc")))
1608 (setenv "PATH" (string-append tar "/bin:" bzip "/bin"))
1609 (system* "tar" "xvf" (assoc-ref %build-inputs "source"))
1610 (chdir (string-append "seqan-library-" ,version))
1611 (copy-recursively "include" (string-append out "/include"))
1612 (copy-recursively "share" (string-append doc "/share"))))))
1614 `(("source" ,source)
1617 (home-page "http://www.seqan.de")
1618 (synopsis "Library for nucleotide sequence analysis")
1620 "SeqAn is a C++ library of efficient algorithms and data structures for
1621 the analysis of sequences with the focus on biological data. It contains
1622 algorithms and data structures for string representation and their
1623 manipulation, online and indexed string search, efficient I/O of
1624 bioinformatics file formats, sequence alignment, and more.")
1625 (license license:bsd-3)))
1634 "https://github.com/alexdobin/STAR/archive/STAR_"
1638 "1y3bciych1aw6s7k8sy1saj23dcan9wk4d4f96an499slkxwz712"))
1639 (modules '((guix build utils)))
1641 '(substitute* "source/Makefile"
1642 (("/bin/rm") "rm")))))
1643 (build-system gnu-build-system)
1645 '(#:tests? #f ;no check target
1646 #:make-flags '("STAR")
1649 'unpack 'enter-source-dir (lambda _ (chdir "source"))
1652 (lambda* (#:key outputs #:allow-other-keys)
1653 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1655 (copy-file "STAR" (string-append bin "STAR"))))
1657 'configure %standard-phases)))))
1659 `(("vim" ,vim))) ; for xxd
1662 (home-page "https://github.com/alexdobin/STAR")
1663 (synopsis "Universal RNA-seq aligner")
1665 "The Spliced Transcripts Alignment to a Reference (STAR) software is
1666 based on a previously undescribed RNA-seq alignment algorithm that uses
1667 sequential maximum mappable seed search in uncompressed suffix arrays followed
1668 by seed clustering and stitching procedure. In addition to unbiased de novo
1669 detection of canonical junctions, STAR can discover non-canonical splices and
1670 chimeric (fusion) transcripts, and is also capable of mapping full-length RNA
1672 ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed.
1673 (license license:gpl3+)))
1675 (define-public subread
1678 (version "1.4.6-p2")
1682 "mirror://sourceforge/subread/subread-"
1683 version "-source.tar.gz"))
1686 "06sv9mpcsdj6p68y15d6gi70lca3lxmzk0dn61hg0kfsa7rxmsr3"))))
1687 (build-system gnu-build-system)
1689 `(#:tests? #f ;no "check" target
1690 #:make-flags '("-f" "Makefile.Linux")
1694 (lambda _ (chdir "src") #t)
1697 (lambda* (#:key outputs #:allow-other-keys)
1698 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1700 (copy-recursively "../bin" bin)))
1701 ;; no "configure" script
1702 (alist-delete 'configure %standard-phases)))))
1703 (inputs `(("zlib" ,zlib)))
1704 (home-page "http://bioinf.wehi.edu.au/subread-package/")
1705 (synopsis "Tool kit for processing next-gen sequencing data")
1707 "The subread package contains the following tools: subread aligner, a
1708 general-purpose read aligner; subjunc aligner: detecting exon-exon junctions
1709 and mapping RNA-seq reads; featureCounts: counting mapped reads for genomic
1710 features; exactSNP: a SNP caller that discovers SNPs by testing signals
1711 against local background noises.")
1712 (license license:gpl3+)))
1714 (define-public shogun
1722 "ftp://shogun-toolbox.org/shogun/releases/"
1723 (version-major+minor version)
1724 "/sources/shogun-" version ".tar.bz2"))
1727 "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
1728 (modules '((guix build utils)
1732 ;; Remove non-free sources and files referencing them
1733 (for-each delete-file
1734 (find-files "src/shogun/classifier/svm/"
1735 "SVMLight\\.(cpp|h)"))
1736 (for-each delete-file
1737 (find-files "examples/undocumented/libshogun/"
1739 "(classifier_.*svmlight.*|"
1740 "evaluation_cross_validation_locked_comparison).cpp")))
1741 ;; Remove non-free functions.
1742 (define (delete-ifdefs file)
1743 (with-atomic-file-replacement file
1745 (let loop ((line (read-line in 'concat))
1747 (if (eof-object? line)
1751 (not (string-prefix?
1752 "#endif //USE_SVMLIGHT" line)))
1754 "#ifdef USE_SVMLIGHT" line))))
1755 (when (or (not skipping?)
1756 (and skipping? (not skip-next?)))
1758 (loop (read-line in 'concat) skip-next?)))))))
1759 (for-each delete-ifdefs (find-files "src/shogun/kernel/"
1760 "^Kernel\\.(cpp|h)"))))))
1761 (build-system cmake-build-system)
1763 '(#:tests? #f ;no check target
1766 'unpack 'delete-broken-symlinks
1768 (for-each delete-file '("applications/arts/data"
1769 "applications/asp/data"
1770 "applications/easysvm/data"
1771 "applications/msplicer/data"
1772 "applications/ocr/data"
1773 "examples/documented/data"
1774 "examples/documented/matlab_static"
1775 "examples/documented/octave_static"
1776 "examples/undocumented/data"
1777 "examples/undocumented/matlab_static"
1778 "examples/undocumented/octave_static"
1779 "tests/integration/data"
1780 "tests/integration/matlab_static"
1781 "tests/integration/octave_static"
1782 "tests/integration/python_modular/tests"))
1785 'unpack 'change-R-target-path
1786 (lambda* (#:key outputs #:allow-other-keys)
1787 (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
1788 "src/interfaces/r_static/CMakeLists.txt"
1789 "examples/undocumented/r_modular/CMakeLists.txt")
1790 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
1791 (string-append (assoc-ref outputs "out")
1792 "/lib/R/library/")))
1795 'unpack 'fix-octave-modules
1796 (lambda* (#:key outputs #:allow-other-keys)
1797 (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
1798 "src/interfaces/octave_static/CMakeLists.txt")
1799 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
1800 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
1802 ;; change target directory
1803 (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
1804 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
1805 (string-append (assoc-ref outputs "out")
1806 "/share/octave/packages")))
1810 ;; $HOME needs to be set at some point during the build phase
1811 (lambda _ (setenv "HOME" "/tmp") #t)
1812 %standard-phases))))
1814 (list "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
1815 ;;"-DJavaModular=ON" ;requires unpackaged jblas
1816 ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
1817 ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
1818 ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
1819 "-DOctaveModular=ON"
1821 "-DPythonModular=ON"
1825 "-DCmdLineStatic=ON")))
1827 `(("python" ,python)
1828 ("numpy" ,python-numpy)
1834 ("arpack" ,arpack-ng)
1837 ("libxml2" ,libxml2)
1841 `(("pkg-config" ,pkg-config)))
1842 (home-page "http://shogun-toolbox.org/")
1843 (synopsis "Machine learning toolbox")
1845 "The Shogun Machine learning toolbox provides a wide range of unified and
1846 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
1847 combine multiple data representations, algorithm classes, and general purpose
1848 tools. This enables both rapid prototyping of data pipelines and extensibility
1849 in terms of new algorithms.")
1850 (license license:gpl3+)))
1852 (define-public vcftools
1859 "mirror://sourceforge/vcftools/vcftools_"
1863 "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx"))))
1864 (build-system gnu-build-system)
1866 `(#:tests? #f ; no "check" target
1868 "CFLAGS=-O2" ; override "-m64" flag
1869 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1870 (string-append "MANDIR=" (assoc-ref %outputs "out")
1874 'unpack 'patch-manpage-install
1876 (substitute* "Makefile"
1877 (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1")))
1878 (alist-delete 'configure %standard-phases))))
1882 (home-page "http://vcftools.sourceforge.net/")
1883 (synopsis "Tools for working with VCF files")
1885 "VCFtools is a program package designed for working with VCF files, such
1886 as those generated by the 1000 Genomes Project. The aim of VCFtools is to
1887 provide easily accessible methods for working with complex genetic variation
1888 data in the form of VCF files.")
1889 ;; The license is declared as LGPLv3 in the README and
1890 ;; at http://vcftools.sourceforge.net/license.html
1891 (license license:lgpl3)))