gnu: ngs-sdk: Update to version 1.1.1.
[jackhill/guix/guix.git] / gnu / packages / bioinformatics.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
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.
10 ;;;
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.
15 ;;;
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/>.
18
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))
52
53 (define-public bamtools
54 (package
55 (name "bamtools")
56 (version "2.3.0")
57 (source (origin
58 (method url-fetch)
59 (uri (string-append
60 "https://github.com/pezmaster31/bamtools/archive/v"
61 version ".tar.gz"))
62 (file-name (string-append name "-" version ".tar.gz"))
63 (sha256
64 (base32
65 "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018"))))
66 (build-system cmake-build-system)
67 (arguments
68 `(#:tests? #f ;no "check" target
69 #:phases
70 (modify-phases %standard-phases
71 (add-before
72 'configure 'set-ldflags
73 (lambda* (#:key outputs #:allow-other-keys)
74 (setenv "LDFLAGS"
75 (string-append
76 "-Wl,-rpath="
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")
81 (description
82 "BamTools provides both a C++ API and a command-line toolkit for handling
83 BAM files.")
84 (license license:expat)))
85
86 (define-public bedops
87 (package
88 (name "bedops")
89 (version "2.4.5")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append "https://github.com/bedops/bedops/archive/v"
93 version ".tar.gz"))
94 (file-name (string-append name "-" version ".tar.gz"))
95 (sha256
96 (base32
97 "0wmg6j0icimlrnsidaxrzf3hfgjvlkkcwvpdg7n4gg7hdv2m9ni5"))))
98 (build-system gnu-build-system)
99 (arguments
100 '(#:tests? #f
101 #:make-flags (list (string-append "BINDIR=" %output "/bin"))
102 #:phases
103 (alist-cons-after
104 'unpack 'unpack-tarballs
105 (lambda _
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
112 ;; libraries.
113
114 ;; See upstream discussion:
115 ;; https://github.com/bedops/bedops/issues/124
116
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")
131 (description
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.
136
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+)))
143
144 (define-public bedtools
145 (package
146 (name "bedtools")
147 (version "2.22.0")
148 (source (origin
149 (method url-fetch)
150 (uri (string-append "https://github.com/arq5x/bedtools2/archive/v"
151 version ".tar.gz"))
152 (file-name (string-append name "-" version ".tar.gz"))
153 (sha256
154 (base32
155 "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"))))
156 (build-system gnu-build-system)
157 (native-inputs `(("python" ,python-2)))
158 (inputs `(("samtools" ,samtools)
159 ("zlib" ,zlib)))
160 (arguments
161 '(#:test-target "test"
162 #:phases
163 (alist-cons-after
164 'unpack 'patch-makefile-SHELL-definition
165 (lambda _
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"))))
172 (alist-delete
173 'configure
174 (alist-replace
175 'install
176 (lambda* (#:key outputs #:allow-other-keys)
177 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
178 (mkdir-p 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")
185 (description
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,
191 BED, GFF/GTF, VCF.")
192 (license license:gpl2)))
193
194 (define-public python2-pybedtools
195 (package
196 (name "python2-pybedtools")
197 (version "0.6.9")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append
201 "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-"
202 version ".tar.gz"))
203 (sha256
204 (base32
205 "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an"))))
206 (build-system python-build-system)
207 (arguments `(#:python ,python-2)) ; no Python 3 support
208 (inputs
209 `(("python-cython" ,python2-cython)
210 ("python-matplotlib" ,python2-matplotlib)))
211 (propagated-inputs
212 `(("bedtools" ,bedtools)
213 ("samtools" ,samtools)))
214 (native-inputs
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")
220 (description
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
224 Python.")
225 (license license:gpl2+)))
226
227 (define-public python-biopython
228 (package
229 (name "python-biopython")
230 (version "1.65")
231 (source (origin
232 (method url-fetch)
233 (uri (string-append
234 "http://biopython.org/DIST/biopython-"
235 version ".tar.gz"))
236 (sha256
237 (base32
238 "13m8s9jkrw40zvdp1rl709n6lmgdh4f52aann7gzr6sfp0fwhg26"))))
239 (build-system python-build-system)
240 (inputs
241 `(("python-numpy" ,python-numpy)))
242 (native-inputs
243 `(("python-setuptools" ,python2-setuptools)))
244 (home-page "http://biopython.org/")
245 (synopsis "Tools for biological computation in Python")
246 (description
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"))))
254
255 (define-public python2-biopython
256 (package (inherit (package-with-python2 python-biopython))
257 (inputs
258 `(("python2-numpy" ,python2-numpy)))))
259
260 (define-public bowtie
261 (package
262 (name "bowtie")
263 (version "2.2.4")
264 (source (origin
265 (method url-fetch)
266 (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
267 version ".tar.gz"))
268 (file-name (string-append name "-" version ".tar.gz"))
269 (sha256
270 (base32
271 "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
272 (modules '((guix build utils)))
273 (snippet
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)))
287 (arguments
288 '(#:make-flags '("allall")
289 #:phases
290 (alist-delete
291 'configure
292 (alist-replace
293 'install
294 (lambda* (#:key outputs #:allow-other-keys)
295 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
296 (mkdir-p bin)
297 (for-each (lambda (file)
298 (copy-file file (string-append bin file)))
299 (find-files "." "bowtie2.*"))))
300 (alist-replace
301 'check
302 (lambda* (#:key outputs #:allow-other-keys)
303 (system* "perl"
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")
310 (description
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+)))
320
321 (define-public bwa
322 (package
323 (name "bwa")
324 (version "0.7.12")
325 (source (origin
326 (method url-fetch)
327 (uri (string-append "mirror://sourceforge/bio-bwa/bwa-"
328 version ".tar.bz2"))
329 (sha256
330 (base32
331 "1330dpqncv0px3pbhjzz1gwgg39kkcv2r9qp2xs0sixf8z8wl7bh"))))
332 (build-system gnu-build-system)
333 (arguments
334 '(#:tests? #f ;no "check" target
335 #:phases
336 (alist-replace
337 'install
338 (lambda* (#:key outputs #:allow-other-keys)
339 (let ((bin (string-append
340 (assoc-ref outputs "out") "/bin"))
341 (doc (string-append
342 (assoc-ref outputs "out") "/share/doc/bwa"))
343 (man (string-append
344 (assoc-ref outputs "out") "/share/man/man1")))
345 (mkdir-p bin)
346 (mkdir-p doc)
347 (mkdir-p man)
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")
356 (description
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+)))
367
368 (define-public python2-bx-python
369 (package
370 (name "python2-bx-python")
371 (version "0.7.2")
372 (source (origin
373 (method url-fetch)
374 (uri (string-append
375 "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
376 version ".tar.gz"))
377 (sha256
378 (base32
379 "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
380 (modules '((guix build utils)))
381 (snippet
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)
387 (arguments
388 `(#:tests? #f ;tests fail because test data are not included
389 #:python ,python-2))
390 (inputs
391 `(("python-numpy" ,python2-numpy)
392 ("zlib" ,zlib)))
393 (native-inputs
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")
398 (description
399 "bx-python provides tools for manipulating biological data, particularly
400 multiple sequence alignments.")
401 (license license:expat)))
402
403 (define-public clipper
404 (package
405 (name "clipper")
406 (version "0.3.0")
407 (source (origin
408 (method url-fetch)
409 (uri (string-append
410 "https://github.com/YeoLab/clipper/archive/"
411 version ".tar.gz"))
412 (sha256
413 (base32
414 "1q7jpimsqln7ic44i8v2rx2haj5wvik8hc1s2syd31zcn0xk1iyq"))
415 (modules '((guix build utils)))
416 (snippet
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
422 (inputs
423 `(("htseq" ,htseq)
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)))
431 (native-inputs
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")
437 (description
438 "CLIPper is a tool to define peaks in CLIP-seq datasets.")
439 (license license:gpl2)))
440
441 (define-public clustal-omega
442 (package
443 (name "clustal-omega")
444 (version "1.2.1")
445 (source (origin
446 (method url-fetch)
447 (uri (string-append
448 "http://www.clustal.org/omega/clustal-omega-"
449 version ".tar.gz"))
450 (sha256
451 (base32
452 "02ibkx0m0iwz8nscg998bh41gg251y56cgh86bvyrii5m8kjgwqf"))))
453 (build-system gnu-build-system)
454 (inputs
455 `(("argtable" ,argtable)))
456 (home-page "http://www.clustal.org/omega/")
457 (synopsis "Multiple sequence aligner for protein and DNA/RNA")
458 (description
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
462 time.")
463 (license license:gpl2+)))
464
465 (define-public crossmap
466 (package
467 (name "crossmap")
468 (version "0.1.6")
469 (source (origin
470 (method url-fetch)
471 (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
472 version ".tar.gz"))
473 (sha256
474 (base32
475 "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
476 ;; patch has been sent upstream already
477 (patches (list
478 (search-patch "crossmap-allow-system-pysam.patch")))
479 (modules '((guix build utils)))
480 ;; remove bundled copy of pysam
481 (snippet
482 '(delete-file-recursively "lib/pysam"))))
483 (build-system python-build-system)
484 (arguments
485 `(#:python ,python-2
486 #:phases
487 (alist-cons-after
488 'unpack 'set-env
489 (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
490 %standard-phases)))
491 (inputs
492 `(("python-numpy" ,python2-numpy)
493 ("python-pysam" ,python2-pysam)
494 ("zlib" ,zlib)))
495 (native-inputs
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")
501 (description
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+)))
506
507 (define-public cutadapt
508 (package
509 (name "cutadapt")
510 (version "1.8")
511 (source (origin
512 (method url-fetch)
513 (uri (string-append
514 "https://github.com/marcelm/cutadapt/archive/v"
515 version ".tar.gz"))
516 (file-name (string-append name "-" version ".tar.gz"))
517 (sha256
518 (base32
519 "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5"))))
520 (build-system python-build-system)
521 (arguments
522 ;; tests must be run after install
523 `(#:phases (alist-cons-after
524 'install 'check
525 (lambda* (#:key inputs outputs #:allow-other-keys)
526 (setenv "PYTHONPATH"
527 (string-append
528 (getenv "PYTHONPATH")
529 ":" (assoc-ref outputs "out")
530 "/lib/python"
531 (string-take (string-take-right
532 (assoc-ref inputs "python") 5) 3)
533 "/site-packages"))
534 (zero? (system* "nosetests" "-P" "tests")))
535 (alist-delete 'check %standard-phases))))
536 (native-inputs
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")
542 (description
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)))
546
547 (define-public edirect
548 (package
549 (name "edirect")
550 (version "2.50")
551 (source (origin
552 (method url-fetch)
553 ;; Note: older versions are not retained.
554 (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip")
555 (sha256
556 (base32
557 "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj"))))
558 (build-system perl-build-system)
559 (arguments
560 `(#:tests? #f ;no "check" target
561 #:phases
562 (modify-phases %standard-phases
563 (delete 'configure)
564 (delete 'build)
565 (replace 'install
566 (lambda* (#:key outputs #:allow-other-keys)
567 (let ((target (string-append (assoc-ref outputs "out")
568 "/bin")))
569 (mkdir-p target)
570 (copy-file "edirect.pl"
571 (string-append target "/edirect.pl"))
572 #t)))
573 (add-after
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)))))))))
581 (inputs
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)
596 ("perl" ,perl)))
597 (native-inputs
598 `(("unzip" ,unzip)))
599 (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288")
600 (synopsis "Tools for accessing the NCBI's set of databases")
601 (description
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.
608
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)))
614
615 (define-public express
616 (package
617 (name "express")
618 (version "1.5.1")
619 (source (origin
620 (method url-fetch)
621 (uri
622 (string-append
623 "http://bio.math.berkeley.edu/eXpress/downloads/express-"
624 version "/express-" version "-src.tgz"))
625 (sha256
626 (base32
627 "03rczxd0gjp2l1jxcmjfmf5j94j77zqyxa6x063zsc585nj40n0c"))))
628 (build-system cmake-build-system)
629 (arguments
630 `(#:tests? #f ;no "check" target
631 #:phases
632 (alist-cons-after
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")))
643 #t)
644 %standard-phases)))
645 (inputs
646 `(("boost" ,boost)
647 ("bamtools" ,bamtools)
648 ("protobuf" ,protobuf)
649 ("zlib" ,zlib)))
650 (home-page "http://bio.math.berkeley.edu/eXpress")
651 (synopsis "Streaming quantification for high-throughput genomic sequencing")
652 (description
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)))
659
660 (define-public fastx-toolkit
661 (package
662 (name "fastx-toolkit")
663 (version "0.0.14")
664 (source (origin
665 (method url-fetch)
666 (uri
667 (string-append
668 "https://github.com/agordon/fastx_toolkit/releases/download/"
669 version "/fastx_toolkit-" version ".tar.bz2"))
670 (sha256
671 (base32
672 "01jqzw386873sr0pjp1wr4rn8fsga2vxs1qfmicvx1pjr72007wy"))))
673 (build-system gnu-build-system)
674 (inputs
675 `(("libgtextutils" ,libgtextutils)))
676 (native-inputs
677 `(("pkg-config" ,pkg-config)))
678 (home-page "http://hannonlab.cshl.edu/fastx_toolkit/")
679 (synopsis "Tools for FASTA/FASTQ file preprocessing")
680 (description
681 "The FASTX-Toolkit is a collection of command line tools for Short-Reads
682 FASTA/FASTQ files preprocessing.
683
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+)))
691
692 (define-public flexbar
693 (package
694 (name "flexbar")
695 (version "2.5")
696 (source (origin
697 (method url-fetch)
698 (uri
699 (string-append "mirror://sourceforge/flexbar/"
700 version "/flexbar_v" version "_src.tgz"))
701 (sha256
702 (base32
703 "13jaykc3y1x8y5nn9j8ljnb79s5y51kyxz46hdmvvjj6qhyympmf"))))
704 (build-system cmake-build-system)
705 (arguments
706 `(#:configure-flags (list
707 (string-append "-DFLEXBAR_BINARY_DIR="
708 (assoc-ref %outputs "out")
709 "/bin/"))
710 #:phases
711 (alist-replace
712 'check
713 (lambda* (#:key outputs #:allow-other-keys)
714 (setenv "PATH" (string-append
715 (assoc-ref outputs "out") "/bin:"
716 (getenv "PATH")))
717 (chdir "../flexbar_v2.5_src/test")
718 (zero? (system* "bash" "flexbar_validate.sh")))
719 (alist-delete 'install %standard-phases))))
720 (inputs
721 `(("tbb" ,tbb)
722 ("zlib" ,zlib)))
723 (native-inputs
724 `(("pkg-config" ,pkg-config)
725 ("seqan" ,seqan)))
726 (home-page "http://flexbar.sourceforge.net")
727 (synopsis "Barcode and adapter removal tool for sequencing platforms")
728 (description
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)))
736
737 (define-public grit
738 (package
739 (name "grit")
740 (version "2.0.2")
741 (source (origin
742 (method url-fetch)
743 (uri (string-append
744 "https://github.com/nboley/grit/archive/"
745 version ".tar.gz"))
746 (file-name (string-append name "-" version ".tar.gz"))
747 (sha256
748 (base32
749 "157in84dj70wimbind3x7sy1whs3h57qfgcnj2s6lrd38fbrb7mj"))))
750 (build-system python-build-system)
751 (arguments
752 `(#:python ,python-2
753 #:phases
754 (alist-cons-after
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
763 (("pyx\", \\]")
764 (string-append "pyx\", ], include_dirs = ['"
765 (assoc-ref inputs "python-numpy")
766 "/lib/python2.7/site-packages/numpy/core/include/"
767 "']"))) #t)
768 %standard-phases)))
769 (inputs
770 `(("python-scipy" ,python2-scipy)
771 ("python-numpy" ,python2-numpy)
772 ("python-pysam" ,python2-pysam)
773 ("python-networkx" ,python2-networkx)))
774 (native-inputs
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")
779 (description
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+)))
787
788 (define-public hisat
789 (package
790 (name "hisat")
791 (version "0.1.4")
792 (source (origin
793 (method url-fetch)
794 (uri (string-append
795 "http://ccb.jhu.edu/software/hisat/downloads/hisat-"
796 version "-beta-source.zip"))
797 (sha256
798 (base32
799 "1k381ydranqxp09yf2y7w1d0chz5d59vb6jchi89hbb0prq19lk5"))))
800 (build-system gnu-build-system)
801 (arguments
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)
808 (%current-system)))
809 '()
810 '("POPCNT_CAPABILITY=0")))
811 #:phases
812 (alist-cons-after
813 'unpack 'patch-sources
814 (lambda _
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"))))
824 (alist-replace
825 'install
826 (lambda* (#:key outputs #:allow-other-keys)
827 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
828 (mkdir-p bin)
829 (for-each
830 (lambda (file)
831 (copy-file file (string-append bin file)))
832 (find-files
833 "."
834 "hisat(-(build|align|inspect)(-(s|l)(-debug)*)*)*$"))))
835 (alist-delete 'configure %standard-phases)))))
836 (native-inputs
837 `(("unzip" ,unzip)))
838 (inputs
839 `(("perl" ,perl)
840 ("python" ,python)
841 ("zlib" ,zlib)))
842 (home-page "http://ccb.jhu.edu/software/hisat/index.shtml")
843 (synopsis "Hierarchical indexing for spliced alignment of transcripts")
844 (description
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+)))
852
853 (define-public htseq
854 (package
855 (name "htseq")
856 (version "0.6.1")
857 (source (origin
858 (method url-fetch)
859 (uri (string-append
860 "https://pypi.python.org/packages/source/H/HTSeq/HTSeq-"
861 version ".tar.gz"))
862 (sha256
863 (base32
864 "1i85ppf2j2lj12m0x690qq5nn17xxk23pbbx2c83r8ayb5wngzwv"))))
865 (build-system python-build-system)
866 (arguments `(#:python ,python-2)) ; only Python 2 is supported
867 (inputs
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")
872 (description
873 "HTSeq is a Python package that provides infrastructure to process data
874 from high-throughput sequencing assays.")
875 (license license:gpl3+)))
876
877 (define-public htsjdk
878 (package
879 (name "htsjdk")
880 (version "1.129")
881 (source (origin
882 (method url-fetch)
883 (uri (string-append
884 "https://github.com/samtools/htsjdk/archive/"
885 version ".tar.gz"))
886 (file-name (string-append name "-" version ".tar.gz"))
887 (sha256
888 (base32
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)
896 (arguments
897 `(#:modules ((srfi srfi-1)
898 (guix build gnu-build-system)
899 (guix build utils))
900 #:phases (alist-replace
901 'build
902 (lambda _
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)))))
910 (native-inputs
911 `(("ant" ,ant)
912 ("jdk" ,icedtea6 "jdk")))
913 (home-page "http://samtools.github.io/htsjdk/")
914 (synopsis "Java API for high-throughput sequencing data (HTS) formats")
915 (description
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)))
921
922 (define-public htslib
923 (package
924 (name "htslib")
925 (version "1.2.1")
926 (source (origin
927 (method url-fetch)
928 (uri (string-append
929 "https://github.com/samtools/htslib/releases/download/"
930 version "/htslib-" version ".tar.bz2"))
931 (sha256
932 (base32
933 "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx"))))
934 (build-system gnu-build-system)
935 (arguments
936 `(#:phases
937 (modify-phases %standard-phases
938 (add-after
939 'unpack 'patch-tests
940 (lambda _
941 (substitute* "test/test.pl"
942 (("/bin/bash") (which "bash")))
943 #t)))))
944 (inputs
945 `(("zlib" ,zlib)))
946 (native-inputs
947 `(("perl" ,perl)))
948 (home-page "http://www.htslib.org")
949 (synopsis "C library for reading/writing high-throughput sequencing data")
950 (description
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))))
956
957 (define-public macs
958 (package
959 (name "macs")
960 (version "2.1.0.20140616")
961 (source (origin
962 (method url-fetch)
963 (uri (string-append
964 "https://pypi.python.org/packages/source/M/MACS2/MACS2-"
965 version ".tar.gz"))
966 (sha256
967 (base32
968 "11lmiw6avqhwn75sn59g4lfkrr2kk20r3rgfbx9xfqb8rg9mi2n6"))))
969 (build-system python-build-system)
970 (arguments
971 `(#:python ,python-2 ; only compatible with Python 2.7
972 #:tests? #f)) ; no test target
973 (inputs
974 `(("python-numpy" ,python2-numpy)))
975 (native-inputs
976 `(("python-setuptools" ,python2-setuptools)))
977 (home-page "http://github.com/taoliu/MACS/")
978 (synopsis "Model based analysis for ChIP-Seq data")
979 (description
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)))
987
988 (define-public miso
989 (package
990 (name "miso")
991 (version "0.5.3")
992 (source (origin
993 (method url-fetch)
994 (uri (string-append
995 "http://pypi.python.org/packages/source/m/misopy/misopy-"
996 version ".tar.gz"))
997 (sha256
998 (base32
999 "0x446867az8ir0z8c1vjqffkp0ma37wm4sylixnkhgawllzx8v5w"))
1000 (modules '((guix build utils)))
1001 ;; use "gcc" instead of "cc" for compilation
1002 (snippet
1003 '(substitute* "setup.py"
1004 (("^defines")
1005 "cc.set_executables(
1006 compiler='gcc',
1007 compiler_so='gcc',
1008 linker_exe='gcc',
1009 linker_so='gcc -shared'); defines")))))
1010 (build-system python-build-system)
1011 (arguments
1012 `(#:python ,python-2 ; only Python 2 is supported
1013 #:tests? #f)) ; no "test" target
1014 (inputs
1015 `(("samtools" ,samtools)
1016 ("python-numpy" ,python2-numpy)
1017 ("python-pysam" ,python2-pysam)
1018 ("python-scipy" ,python2-scipy)
1019 ("python-matplotlib" ,python2-matplotlib)))
1020 (native-inputs
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")
1024 (description
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)))
1032
1033 (define-public python2-pbcore
1034 (package
1035 (name "python2-pbcore")
1036 (version "0.9.3")
1037 (source (origin
1038 (method url-fetch)
1039 (uri (string-append
1040 "https://github.com/PacificBiosciences/pbcore/archive/"
1041 version ".tar.gz"))
1042 (file-name (string-append name "-" version ".tar.gz"))
1043 (sha256
1044 (base32
1045 "1z46rwjac93jm87cbj2zgjg6qvsgs65140wkbbxsvxps7ai4pm09"))))
1046 (build-system python-build-system)
1047 (arguments `(#:python ,python-2)) ; pbcore requires Python 2.7
1048 (inputs
1049 `(("python-cython" ,python2-cython)
1050 ("python-numpy" ,python2-numpy)
1051 ("python-pysam" ,python2-pysam)
1052 ("python-h5py" ,python2-h5py)))
1053 (native-inputs
1054 `(("python-setuptools" ,python2-setuptools)))
1055 (home-page "http://pacificbiosciences.github.io/pbcore/")
1056 (synopsis "Library for reading and writing PacBio data files")
1057 (description
1058 "The pbcore package provides Python APIs for interacting with PacBio data
1059 files and writing bioinformatics applications.")
1060 (license license:bsd-3)))
1061
1062 (define-public pbtranscript-tofu
1063 (let ((commit "c7bbd5472"))
1064 (package
1065 (name "pbtranscript-tofu")
1066 (version (string-append "0.4.1." commit))
1067 (source (origin
1068 (method git-fetch)
1069 (uri (git-reference
1070 (url "https://github.com/PacificBiosciences/cDNA_primer.git")
1071 (commit commit)))
1072 (file-name (string-append name "-" version ".tar.gz"))
1073 (sha256
1074 (base32
1075 "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
1076 (build-system python-build-system)
1077 (arguments
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
1081 ;; before 1980'
1082 #:configure-flags '("--single-version-externally-managed"
1083 "--record=pbtranscript-tofu.txt")
1084 #:phases
1085 (alist-cons-after
1086 'unpack 'enter-directory-and-clean-up
1087 (lambda _
1088 (chdir "pbtranscript-tofu/pbtranscript/")
1089 ;; Delete clutter
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$")))
1103 %standard-phases)))
1104 (inputs
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)))
1111 (native-inputs
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")
1116 (description
1117 "pbtranscript-tofu contains scripts to analyze transcriptome data
1118 generated using the PacBio Iso-Seq protocol.")
1119 (license license:bsd-3))))
1120
1121 (define-public rsem
1122 (package
1123 (name "rsem")
1124 (version "1.2.20")
1125 (source
1126 (origin
1127 (method url-fetch)
1128 (uri
1129 (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-"
1130 version ".tar.gz"))
1131 (sha256
1132 (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q"))
1133 (patches (list (search-patch "rsem-makefile.patch")))
1134 (modules '((guix build utils)))
1135 (snippet
1136 '(begin
1137 ;; remove bundled copy of boost
1138 (delete-file-recursively "boost")
1139 #t))))
1140 (build-system gnu-build-system)
1141 (arguments
1142 `(#:tests? #f ;no "check" target
1143 #:phases
1144 (modify-phases %standard-phases
1145 ;; No "configure" script.
1146 ;; Do not build bundled samtools library.
1147 (replace 'configure
1148 (lambda _
1149 (substitute* "Makefile"
1150 (("^all : sam/libbam.a") "all : "))
1151 #t))
1152 (replace 'install
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")))
1157 (mkdir-p bin)
1158 (mkdir-p perl)
1159 (for-each (lambda (file)
1160 (copy-file 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")))
1165 #t))
1166 (add-after
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"
1177 "rsem-run-ebseq"
1178 "rsem-prepare-reference")))
1179 #t)))))
1180 (inputs
1181 `(("boost" ,boost)
1182 ("ncurses" ,ncurses)
1183 ("r" ,r)
1184 ("perl" ,perl)
1185 ("samtools" ,samtools-0.1)
1186 ("zlib" ,zlib)))
1187 (home-page "http://deweylab.biostat.wisc.edu/rsem/")
1188 (synopsis "Estimate gene expression levels from RNA-Seq data")
1189 (description
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+)))
1198
1199 (define-public rseqc
1200 (package
1201 (name "rseqc")
1202 (version "2.6.1")
1203 (source
1204 (origin
1205 (method url-fetch)
1206 (uri
1207 (string-append "mirror://sourceforge/rseqc/"
1208 version "/RSeQC-" version ".tar.gz"))
1209 (sha256
1210 (base32 "15ly0254yi032qzkdplg00q144qfdsd986gh62829rl5bkxhj330"))
1211 (modules '((guix build utils)))
1212 (snippet
1213 '(begin
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))
1224 (inputs
1225 `(("python-cython" ,python2-cython)
1226 ("python-pysam" ,python2-pysam)
1227 ("python-numpy" ,python2-numpy)
1228 ("python-setuptools" ,python2-setuptools)
1229 ("zlib" ,zlib)))
1230 (native-inputs
1231 `(("python-nose" ,python2-nose)))
1232 (home-page "http://rseqc.sourceforge.net/")
1233 (synopsis "RNA-seq quality control package")
1234 (description
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+)))
1241
1242 (define-public samtools
1243 (package
1244 (name "samtools")
1245 (version "1.1")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri
1250 (string-append "mirror://sourceforge/samtools/"
1251 version "/samtools-" version ".tar.bz2"))
1252 (sha256
1253 (base32
1254 "1y5p2hs4gif891b4ik20275a8xf3qrr1zh9wpysp4g8m0g1jckf2"))))
1255 (build-system gnu-build-system)
1256 (arguments
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
1261 ;; systems.
1262 #:tests? ,(string=? (or (%current-system) (%current-target-system))
1263 "x86_64-linux")
1264 #:make-flags (list "LIBCURSES=-lncurses"
1265 (string-append "prefix=" (assoc-ref %outputs "out")))
1266 #:phases
1267 (alist-cons-after
1268 'unpack
1269 'patch-tests
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
1274 (("/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
1279 ;; them.
1280 (("(test_usage_subcommand\\(.*\\);)" cmd)
1281 (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
1282 (alist-cons-after
1283 'install 'install-library
1284 (lambda* (#:key outputs #:allow-other-keys)
1285 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1286 (mkdir-p 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)
1291 ("perl" ,perl)
1292 ("python" ,python)
1293 ("zlib" ,zlib)))
1294 (home-page "http://samtools.sourceforge.net")
1295 (synopsis "Utilities to efficiently manipulate nucleotide sequence alignments")
1296 (description
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
1300 viewer.")
1301 (license license:expat)))
1302
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)
1308 (version "0.1.19")
1309 (source
1310 (origin
1311 (method url-fetch)
1312 (uri
1313 (string-append "mirror://sourceforge/samtools/"
1314 version "/samtools-" version ".tar.bz2"))
1315 (sha256
1316 (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
1317 (arguments
1318 (substitute-keyword-arguments (package-arguments samtools)
1319 ((#:tests? tests) #f) ;no "check" target
1320 ((#:phases phases)
1321 `(modify-phases ,phases
1322 (replace 'install
1323 (lambda* (#:key outputs #:allow-other-keys)
1324 (let ((bin (string-append
1325 (assoc-ref outputs "out") "/bin")))
1326 (mkdir-p bin)
1327 (copy-file "samtools"
1328 (string-append bin "/samtools")))))
1329 (delete 'patch-tests)))))))
1330
1331 (define-public ngs-sdk
1332 (package
1333 (name "ngs-sdk")
1334 (version "1.1.1")
1335 (source
1336 (origin
1337 (method url-fetch)
1338 (uri
1339 (string-append "https://github.com/ncbi/ngs/archive/"
1340 version ".tar.gz"))
1341 (file-name (string-append name "-" version ".tar.gz"))
1342 (sha256
1343 (base32
1344 "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y"))))
1345 (build-system gnu-build-system)
1346 (arguments
1347 `(#:parallel-build? #f ; not supported
1348 #:tests? #f ; no "check" target
1349 #:phases
1350 (alist-replace
1351 'configure
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)))))
1359 (alist-cons-after
1360 'unpack 'enter-dir
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")
1366 (description
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
1370 simultaneously.")
1371 (license license:public-domain)))
1372
1373 (define-public ngs-java
1374 (package (inherit ngs-sdk)
1375 (name "ngs-java")
1376 (arguments
1377 `(,@(substitute-keyword-arguments
1378 `(#:modules ((guix build gnu-build-system)
1379 (guix build utils)
1380 (srfi srfi-1)
1381 (srfi srfi-26))
1382 ,@(package-arguments ngs-sdk))
1383 ((#:phases phases)
1384 `(alist-cons-after
1385 'enter-dir 'fix-java-symlink-installation
1386 (lambda _
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 "(\\$\\([^\\)]+\\)|\\$\\@)"
1395 "\\)")
1396 _ pattern replacement target)
1397 (string-append "$(patsubst "
1398 "%" pattern ","
1399 "%" replacement ","
1400 target ")"))))
1401 (alist-replace
1402 'enter-dir (lambda _ (chdir "ngs-java") #t)
1403 ,phases))))))
1404 (inputs
1405 `(("jdk" ,icedtea6 "jdk")
1406 ("ngs-sdk" ,ngs-sdk)))
1407 (synopsis "Java bindings for NGS SDK")))
1408
1409 (define-public ncbi-vdb
1410 (package
1411 (name "ncbi-vdb")
1412 (version "2.4.5-5")
1413 (source
1414 (origin
1415 (method url-fetch)
1416 (uri
1417 (string-append "https://github.com/ncbi/ncbi-vdb/archive/"
1418 version ".tar.gz"))
1419 (file-name (string-append name "-" version ".tar.gz"))
1420 (sha256
1421 (base32
1422 "1cj8nk6if8sqagv20vx36v566fdvhcaadf0x1ycnbgql6chbs6vy"))))
1423 (build-system gnu-build-system)
1424 (arguments
1425 `(#:parallel-build? #f ; not supported
1426 #:tests? #f ; no "check" target
1427 #:phases
1428 (alist-replace
1429 'configure
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 "(\\$\\([^\\)]+\\)|\\$\\@)"
1439 "\\)")
1440 _ pattern replacement target)
1441 (string-append "$(patsubst "
1442 "%" pattern ","
1443 "%" replacement ","
1444 target ")")))
1445
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")
1451 "/include" "'")))
1452
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)"))
1457
1458 ;; The 'configure' script doesn't recognize things like
1459 ;; '--enable-fast-install'.
1460 (zero? (system*
1461 "./configure"
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"))))))
1473 (alist-cons-after
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
1479 ;; ("i686").
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)
1484 (%current-system)))
1485 "/rel/ilib")
1486 (string-append (assoc-ref outputs "out")
1487 "/ilib"))
1488 ;; Install interface headers
1489 (copy-recursively "interfaces"
1490 (string-append (assoc-ref outputs "out")
1491 "/include")))
1492 %standard-phases))))
1493 (inputs
1494 `(("libxml2" ,libxml2)
1495 ("ngs-sdk" ,ngs-sdk)
1496 ("ngs-java" ,ngs-java)
1497 ("libmagic" ,file)
1498 ("hdf5" ,hdf5)))
1499 (native-inputs `(("perl" ,perl)))
1500 (home-page "https://github.com/ncbi/ncbi-vdb")
1501 (synopsis "Database engine for genetic information")
1502 (description
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)))
1508
1509 (define-public sra-tools
1510 (package
1511 (name "sra-tools")
1512 (version "2.4.5-5")
1513 (source
1514 (origin
1515 (method url-fetch)
1516 (uri
1517 (string-append "https://github.com/ncbi/sra-tools/archive/"
1518 version ".tar.gz"))
1519 (file-name (string-append name "-" version ".tar.gz"))
1520 (sha256
1521 (base32
1522 "11nrnvz7a012f4iryf0wiwrid0h111grsfxbxa9j51h3f2xbvgns"))))
1523 (build-system gnu-build-system)
1524 (arguments
1525 `(#:parallel-build? #f ; not supported
1526 #:tests? #f ; no "check" target
1527 #:phases
1528 (alist-replace
1529 'configure
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');"))
1544
1545 ;; The 'configure' script doesn't recognize things like
1546 ;; '--enable-fast-install'.
1547 (zero? (system*
1548 "./configure"
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")))))
1567 %standard-phases)))
1568 (native-inputs `(("perl" ,perl)))
1569 (inputs
1570 `(("ngs-sdk" ,ngs-sdk)
1571 ("ncbi-vdb" ,ncbi-vdb)
1572 ("libmagic" ,file)
1573 ("fuse" ,fuse)
1574 ("hdf5" ,hdf5)
1575 ("zlib" ,zlib)))
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")
1578 (description
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)))
1583
1584 (define-public seqan
1585 (package
1586 (name "seqan")
1587 (version "1.4.2")
1588 (source (origin
1589 (method url-fetch)
1590 (uri (string-append "http://packages.seqan.de/seqan-library/"
1591 "seqan-library-" version ".tar.bz2"))
1592 (sha256
1593 (base32
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)
1599 (arguments
1600 `(#:modules ((guix build utils))
1601 #:builder
1602 (begin
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"))))))
1613 (native-inputs
1614 `(("source" ,source)
1615 ("tar" ,tar)
1616 ("bzip2" ,bzip2)))
1617 (home-page "http://www.seqan.de")
1618 (synopsis "Library for nucleotide sequence analysis")
1619 (description
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)))
1626
1627 (define-public star
1628 (package
1629 (name "star")
1630 (version "2.4.0j")
1631 (source (origin
1632 (method url-fetch)
1633 (uri (string-append
1634 "https://github.com/alexdobin/STAR/archive/STAR_"
1635 version ".tar.gz"))
1636 (sha256
1637 (base32
1638 "1y3bciych1aw6s7k8sy1saj23dcan9wk4d4f96an499slkxwz712"))
1639 (modules '((guix build utils)))
1640 (snippet
1641 '(substitute* "source/Makefile"
1642 (("/bin/rm") "rm")))))
1643 (build-system gnu-build-system)
1644 (arguments
1645 '(#:tests? #f ;no check target
1646 #:make-flags '("STAR")
1647 #:phases
1648 (alist-cons-after
1649 'unpack 'enter-source-dir (lambda _ (chdir "source"))
1650 (alist-replace
1651 'install
1652 (lambda* (#:key outputs #:allow-other-keys)
1653 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1654 (mkdir-p bin)
1655 (copy-file "STAR" (string-append bin "STAR"))))
1656 (alist-delete
1657 'configure %standard-phases)))))
1658 (native-inputs
1659 `(("vim" ,vim))) ; for xxd
1660 (inputs
1661 `(("zlib" ,zlib)))
1662 (home-page "https://github.com/alexdobin/STAR")
1663 (synopsis "Universal RNA-seq aligner")
1664 (description
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
1671 sequences.")
1672 ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed.
1673 (license license:gpl3+)))
1674
1675 (define-public subread
1676 (package
1677 (name "subread")
1678 (version "1.4.6-p2")
1679 (source (origin
1680 (method url-fetch)
1681 (uri (string-append
1682 "mirror://sourceforge/subread/subread-"
1683 version "-source.tar.gz"))
1684 (sha256
1685 (base32
1686 "06sv9mpcsdj6p68y15d6gi70lca3lxmzk0dn61hg0kfsa7rxmsr3"))))
1687 (build-system gnu-build-system)
1688 (arguments
1689 `(#:tests? #f ;no "check" target
1690 #:make-flags '("-f" "Makefile.Linux")
1691 #:phases
1692 (alist-cons-after
1693 'unpack 'enter-dir
1694 (lambda _ (chdir "src") #t)
1695 (alist-replace
1696 'install
1697 (lambda* (#:key outputs #:allow-other-keys)
1698 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1699 (mkdir-p 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")
1706 (description
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+)))
1713
1714 (define-public shogun
1715 (package
1716 (name "shogun")
1717 (version "4.0.0")
1718 (source
1719 (origin
1720 (method url-fetch)
1721 (uri (string-append
1722 "ftp://shogun-toolbox.org/shogun/releases/"
1723 (version-major+minor version)
1724 "/sources/shogun-" version ".tar.bz2"))
1725 (sha256
1726 (base32
1727 "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
1728 (modules '((guix build utils)
1729 (ice-9 rdelim)))
1730 (snippet
1731 '(begin
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/"
1738 (string-append
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
1744 (lambda (in out)
1745 (let loop ((line (read-line in 'concat))
1746 (skipping? #f))
1747 (if (eof-object? line)
1748 #t
1749 (let ((skip-next?
1750 (or (and skipping?
1751 (not (string-prefix?
1752 "#endif //USE_SVMLIGHT" line)))
1753 (string-prefix?
1754 "#ifdef USE_SVMLIGHT" line))))
1755 (when (or (not skipping?)
1756 (and skipping? (not skip-next?)))
1757 (display line out))
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)
1762 (arguments
1763 '(#:tests? #f ;no check target
1764 #:phases
1765 (alist-cons-after
1766 'unpack 'delete-broken-symlinks
1767 (lambda _
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"))
1783 #t)
1784 (alist-cons-after
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/")))
1793 #t)
1794 (alist-cons-after
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"))
1801
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")))
1807 #t)
1808 (alist-cons-before
1809 'build 'set-HOME
1810 ;; $HOME needs to be set at some point during the build phase
1811 (lambda _ (setenv "HOME" "/tmp") #t)
1812 %standard-phases))))
1813 #:configure-flags
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"
1820 "-DOctaveStatic=ON"
1821 "-DPythonModular=ON"
1822 "-DPythonStatic=ON"
1823 "-DRModular=ON"
1824 "-DRStatic=ON"
1825 "-DCmdLineStatic=ON")))
1826 (inputs
1827 `(("python" ,python)
1828 ("numpy" ,python-numpy)
1829 ("r" ,r)
1830 ("octave" ,octave)
1831 ("swig" ,swig)
1832 ("hdf5" ,hdf5)
1833 ("atlas" ,atlas)
1834 ("arpack" ,arpack-ng)
1835 ("lapack" ,lapack)
1836 ("glpk" ,glpk)
1837 ("libxml2" ,libxml2)
1838 ("lzo" ,lzo)
1839 ("zlib" ,zlib)))
1840 (native-inputs
1841 `(("pkg-config" ,pkg-config)))
1842 (home-page "http://shogun-toolbox.org/")
1843 (synopsis "Machine learning toolbox")
1844 (description
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+)))
1851
1852 (define-public vcftools
1853 (package
1854 (name "vcftools")
1855 (version "0.1.12b")
1856 (source (origin
1857 (method url-fetch)
1858 (uri (string-append
1859 "mirror://sourceforge/vcftools/vcftools_"
1860 version ".tar.gz"))
1861 (sha256
1862 (base32
1863 "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx"))))
1864 (build-system gnu-build-system)
1865 (arguments
1866 `(#:tests? #f ; no "check" target
1867 #:make-flags (list
1868 "CFLAGS=-O2" ; override "-m64" flag
1869 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1870 (string-append "MANDIR=" (assoc-ref %outputs "out")
1871 "/share/man/man1"))
1872 #:phases
1873 (alist-cons-after
1874 'unpack 'patch-manpage-install
1875 (lambda _
1876 (substitute* "Makefile"
1877 (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1")))
1878 (alist-delete 'configure %standard-phases))))
1879 (inputs
1880 `(("perl" ,perl)
1881 ("zlib" ,zlib)))
1882 (home-page "http://vcftools.sourceforge.net/")
1883 (synopsis "Tools for working with VCF files")
1884 (description
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)))