Merge branch 'master' into core-updates
[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 machine-learning)
38 #:use-module (gnu packages maths)
39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages popt)
43 #:use-module (gnu packages protobuf)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages statistics)
46 #:use-module (gnu packages swig)
47 #:use-module (gnu packages tbb)
48 #:use-module (gnu packages textutils)
49 #:use-module (gnu packages vim)
50 #:use-module (gnu packages web)
51 #:use-module (gnu packages xml)
52 #:use-module (gnu packages zip))
53
54 (define-public bamtools
55 (package
56 (name "bamtools")
57 (version "2.3.0")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append
61 "https://github.com/pezmaster31/bamtools/archive/v"
62 version ".tar.gz"))
63 (file-name (string-append name "-" version ".tar.gz"))
64 (sha256
65 (base32
66 "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018"))))
67 (build-system cmake-build-system)
68 (arguments
69 `(#:tests? #f ;no "check" target
70 #:phases
71 (modify-phases %standard-phases
72 (add-before
73 'configure 'set-ldflags
74 (lambda* (#:key outputs #:allow-other-keys)
75 (setenv "LDFLAGS"
76 (string-append
77 "-Wl,-rpath="
78 (assoc-ref outputs "out") "/lib/bamtools")))))))
79 (inputs `(("zlib" ,zlib)))
80 (home-page "https://github.com/pezmaster31/bamtools")
81 (synopsis "C++ API and command-line toolkit for working with BAM data")
82 (description
83 "BamTools provides both a C++ API and a command-line toolkit for handling
84 BAM files.")
85 (license license:expat)))
86
87 (define-public bedops
88 (package
89 (name "bedops")
90 (version "2.4.5")
91 (source (origin
92 (method url-fetch)
93 (uri (string-append "https://github.com/bedops/bedops/archive/v"
94 version ".tar.gz"))
95 (file-name (string-append name "-" version ".tar.gz"))
96 (sha256
97 (base32
98 "0wmg6j0icimlrnsidaxrzf3hfgjvlkkcwvpdg7n4gg7hdv2m9ni5"))))
99 (build-system gnu-build-system)
100 (arguments
101 '(#:tests? #f
102 #:make-flags (list (string-append "BINDIR=" %output "/bin"))
103 #:phases
104 (alist-cons-after
105 'unpack 'unpack-tarballs
106 (lambda _
107 ;; FIXME: Bedops includes tarballs of minimally patched upstream
108 ;; libraries jansson, zlib, and bzip2. We cannot just use stock
109 ;; libraries because at least one of the libraries (zlib) is
110 ;; patched to add a C++ function definition (deflateInit2cpp).
111 ;; Until the Bedops developers offer a way to link against system
112 ;; libraries we have to build the in-tree copies of these three
113 ;; libraries.
114
115 ;; See upstream discussion:
116 ;; https://github.com/bedops/bedops/issues/124
117
118 ;; Unpack the tarballs to benefit from shebang patching.
119 (with-directory-excursion "third-party"
120 (and (zero? (system* "tar" "xvf" "jansson-2.6.tar.bz2"))
121 (zero? (system* "tar" "xvf" "zlib-1.2.7.tar.bz2"))
122 (zero? (system* "tar" "xvf" "bzip2-1.0.6.tar.bz2"))))
123 ;; Disable unpacking of tarballs in Makefile.
124 (substitute* "system.mk/Makefile.linux"
125 (("^\tbzcat .*") "\t@echo \"not unpacking\"\n")
126 (("\\./configure") "CONFIG_SHELL=bash ./configure"))
127 (substitute* "third-party/zlib-1.2.7/Makefile.in"
128 (("^SHELL=.*$") "SHELL=bash\n")))
129 (alist-delete 'configure %standard-phases))))
130 (home-page "https://github.com/bedops/bedops")
131 (synopsis "Tools for high-performance genomic feature operations")
132 (description
133 "BEDOPS is a suite of tools to address common questions raised in genomic
134 studies---mostly with regard to overlap and proximity relationships between
135 data sets. It aims to be scalable and flexible, facilitating the efficient
136 and accurate analysis and management of large-scale genomic data.
137
138 BEDOPS provides tools that perform highly efficient and scalable Boolean and
139 other set operations, statistical calculations, archiving, conversion and
140 other management of genomic data of arbitrary scale. Tasks can be easily
141 split by chromosome for distributing whole-genome analyses across a
142 computational cluster.")
143 (license license:gpl2+)))
144
145 (define-public bedtools
146 (package
147 (name "bedtools")
148 (version "2.22.0")
149 (source (origin
150 (method url-fetch)
151 (uri (string-append "https://github.com/arq5x/bedtools2/archive/v"
152 version ".tar.gz"))
153 (file-name (string-append name "-" version ".tar.gz"))
154 (sha256
155 (base32
156 "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"))))
157 (build-system gnu-build-system)
158 (native-inputs `(("python" ,python-2)))
159 (inputs `(("samtools" ,samtools)
160 ("zlib" ,zlib)))
161 (arguments
162 '(#:test-target "test"
163 #:phases
164 (alist-cons-after
165 'unpack 'patch-makefile-SHELL-definition
166 (lambda _
167 ;; patch-makefile-SHELL cannot be used here as it does not
168 ;; yet patch definitions with `:='. Since changes to
169 ;; patch-makefile-SHELL result in a full rebuild, features
170 ;; of patch-makefile-SHELL are reimplemented here.
171 (substitute* "Makefile"
172 (("^SHELL := .*$") (string-append "SHELL := " (which "bash") " -e \n"))))
173 (alist-delete
174 'configure
175 (alist-replace
176 'install
177 (lambda* (#:key outputs #:allow-other-keys)
178 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
179 (mkdir-p bin)
180 (for-each (lambda (file)
181 (copy-file file (string-append bin (basename file))))
182 (find-files "bin" ".*"))))
183 %standard-phases)))))
184 (home-page "https://github.com/arq5x/bedtools2")
185 (synopsis "Tools for genome analysis and arithmetic")
186 (description
187 "Collectively, the bedtools utilities are a swiss-army knife of tools for
188 a wide-range of genomics analysis tasks. The most widely-used tools enable
189 genome arithmetic: that is, set theory on the genome. For example, bedtools
190 allows one to intersect, merge, count, complement, and shuffle genomic
191 intervals from multiple files in widely-used genomic file formats such as BAM,
192 BED, GFF/GTF, VCF.")
193 (license license:gpl2)))
194
195 (define-public python2-pybedtools
196 (package
197 (name "python2-pybedtools")
198 (version "0.6.9")
199 (source (origin
200 (method url-fetch)
201 (uri (string-append
202 "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-"
203 version ".tar.gz"))
204 (sha256
205 (base32
206 "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an"))))
207 (build-system python-build-system)
208 (arguments `(#:python ,python-2)) ; no Python 3 support
209 (inputs
210 `(("python-cython" ,python2-cython)
211 ("python-matplotlib" ,python2-matplotlib)))
212 (propagated-inputs
213 `(("bedtools" ,bedtools)
214 ("samtools" ,samtools)))
215 (native-inputs
216 `(("python-pyyaml" ,python2-pyyaml)
217 ("python-nose" ,python2-nose)
218 ("python-setuptools" ,python2-setuptools)))
219 (home-page "https://pythonhosted.org/pybedtools/")
220 (synopsis "Python wrapper for BEDtools programs")
221 (description
222 "pybedtools is a Python wrapper for Aaron Quinlan's BEDtools programs,
223 which are widely used for genomic interval manipulation or \"genome algebra\".
224 pybedtools extends BEDTools by offering feature-level manipulations from with
225 Python.")
226 (license license:gpl2+)))
227
228 (define-public python-biopython
229 (package
230 (name "python-biopython")
231 (version "1.65")
232 (source (origin
233 (method url-fetch)
234 (uri (string-append
235 "http://biopython.org/DIST/biopython-"
236 version ".tar.gz"))
237 (sha256
238 (base32
239 "13m8s9jkrw40zvdp1rl709n6lmgdh4f52aann7gzr6sfp0fwhg26"))))
240 (build-system python-build-system)
241 (inputs
242 `(("python-numpy" ,python-numpy)))
243 (native-inputs
244 `(("python-setuptools" ,python2-setuptools)))
245 (home-page "http://biopython.org/")
246 (synopsis "Tools for biological computation in Python")
247 (description
248 "Biopython is a set of tools for biological computation including parsers
249 for bioinformatics files into Python data structures; interfaces to common
250 bioinformatics programs; a standard sequence class and tools for performing
251 common operations on them; code to perform data classification; code for
252 dealing with alignments; code making it easy to split up parallelizable tasks
253 into separate processes; and more.")
254 (license (license:non-copyleft "http://www.biopython.org/DIST/LICENSE"))))
255
256 (define-public python2-biopython
257 (package (inherit (package-with-python2 python-biopython))
258 (inputs
259 `(("python2-numpy" ,python2-numpy)))))
260
261 (define-public bowtie
262 (package
263 (name "bowtie")
264 (version "2.2.4")
265 (source (origin
266 (method url-fetch)
267 (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
268 version ".tar.gz"))
269 (file-name (string-append name "-" version ".tar.gz"))
270 (sha256
271 (base32
272 "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
273 (modules '((guix build utils)))
274 (snippet
275 '(substitute* "Makefile"
276 (("^CC = .*$") "CC = gcc")
277 (("^CPP = .*$") "CPP = g++")
278 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
279 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
280 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
281 (patches (list (search-patch "bowtie-fix-makefile.patch")))))
282 (build-system gnu-build-system)
283 (inputs `(("perl" ,perl)
284 ("perl-clone" ,perl-clone)
285 ("perl-test-deep" ,perl-test-deep)
286 ("perl-test-simple" ,perl-test-simple)
287 ("python" ,python-2)))
288 (arguments
289 '(#:make-flags '("allall")
290 #:phases
291 (alist-delete
292 'configure
293 (alist-replace
294 'install
295 (lambda* (#:key outputs #:allow-other-keys)
296 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
297 (mkdir-p bin)
298 (for-each (lambda (file)
299 (copy-file file (string-append bin file)))
300 (find-files "." "bowtie2.*"))))
301 (alist-replace
302 'check
303 (lambda* (#:key outputs #:allow-other-keys)
304 (system* "perl"
305 "scripts/test/simple_tests.pl"
306 "--bowtie2=./bowtie2"
307 "--bowtie2-build=./bowtie2-build"))
308 %standard-phases)))))
309 (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
310 (synopsis "Fast and sensitive nucleotide sequence read aligner")
311 (description
312 "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
313 reads to long reference sequences. It is particularly good at aligning reads
314 of about 50 up to 100s or 1,000s of characters, and particularly good at
315 aligning to relatively long (e.g. mammalian) genomes. Bowtie 2 indexes the
316 genome with an FM Index to keep its memory footprint small: for the human
317 genome, its memory footprint is typically around 3.2 GB. Bowtie 2 supports
318 gapped, local, and paired-end alignment modes.")
319 (supported-systems '("x86_64-linux"))
320 (license license:gpl3+)))
321
322 (define-public bwa
323 (package
324 (name "bwa")
325 (version "0.7.12")
326 (source (origin
327 (method url-fetch)
328 (uri (string-append "mirror://sourceforge/bio-bwa/bwa-"
329 version ".tar.bz2"))
330 (sha256
331 (base32
332 "1330dpqncv0px3pbhjzz1gwgg39kkcv2r9qp2xs0sixf8z8wl7bh"))))
333 (build-system gnu-build-system)
334 (arguments
335 '(#:tests? #f ;no "check" target
336 #:phases
337 (alist-replace
338 'install
339 (lambda* (#:key outputs #:allow-other-keys)
340 (let ((bin (string-append
341 (assoc-ref outputs "out") "/bin"))
342 (doc (string-append
343 (assoc-ref outputs "out") "/share/doc/bwa"))
344 (man (string-append
345 (assoc-ref outputs "out") "/share/man/man1")))
346 (mkdir-p bin)
347 (mkdir-p doc)
348 (mkdir-p man)
349 (copy-file "bwa" (string-append bin "/bwa"))
350 (copy-file "README.md" (string-append doc "/README.md"))
351 (copy-file "bwa.1" (string-append man "/bwa.1"))))
352 ;; no "configure" script
353 (alist-delete 'configure %standard-phases))))
354 (inputs `(("zlib" ,zlib)))
355 (home-page "http://bio-bwa.sourceforge.net/")
356 (synopsis "Burrows-Wheeler sequence aligner")
357 (description
358 "BWA is a software package for mapping low-divergent sequences against a
359 large reference genome, such as the human genome. It consists of three
360 algorithms: BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm is
361 designed for Illumina sequence reads up to 100bp, while the rest two for
362 longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar
363 features such as long-read support and split alignment, but BWA-MEM, which is
364 the latest, is generally recommended for high-quality queries as it is faster
365 and more accurate. BWA-MEM also has better performance than BWA-backtrack for
366 70-100bp Illumina reads.")
367 (license license:gpl3+)))
368
369 (define-public python2-bx-python
370 (package
371 (name "python2-bx-python")
372 (version "0.7.2")
373 (source (origin
374 (method url-fetch)
375 (uri (string-append
376 "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
377 version ".tar.gz"))
378 (sha256
379 (base32
380 "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
381 (modules '((guix build utils)))
382 (snippet
383 '(substitute* "setup.py"
384 ;; remove dependency on outdated "distribute" module
385 (("^from distribute_setup import use_setuptools") "")
386 (("^use_setuptools\\(\\)") "")))))
387 (build-system python-build-system)
388 (arguments
389 `(#:tests? #f ;tests fail because test data are not included
390 #:python ,python-2))
391 (inputs
392 `(("python-numpy" ,python2-numpy)
393 ("zlib" ,zlib)))
394 (native-inputs
395 `(("python-nose" ,python2-nose)
396 ("python-setuptools" ,python2-setuptools)))
397 (home-page "http://bitbucket.org/james_taylor/bx-python/")
398 (synopsis "Tools for manipulating biological data")
399 (description
400 "bx-python provides tools for manipulating biological data, particularly
401 multiple sequence alignments.")
402 (license license:expat)))
403
404 (define-public clipper
405 (package
406 (name "clipper")
407 (version "0.3.0")
408 (source (origin
409 (method url-fetch)
410 (uri (string-append
411 "https://github.com/YeoLab/clipper/archive/"
412 version ".tar.gz"))
413 (sha256
414 (base32
415 "1q7jpimsqln7ic44i8v2rx2haj5wvik8hc1s2syd31zcn0xk1iyq"))
416 (modules '((guix build utils)))
417 (snippet
418 ;; remove unnecessary setup dependency
419 '(substitute* "setup.py"
420 (("setup_requires = .*") "")))))
421 (build-system python-build-system)
422 (arguments `(#:python ,python-2)) ; only Python 2 is supported
423 (inputs
424 `(("htseq" ,htseq)
425 ("python-pybedtools" ,python2-pybedtools)
426 ("python-cython" ,python2-cython)
427 ("python-scikit-learn" ,python2-scikit-learn)
428 ("python-matplotlib" ,python2-matplotlib)
429 ("python-pysam" ,python2-pysam)
430 ("python-numpy" ,python2-numpy)
431 ("python-scipy" ,python2-scipy)))
432 (native-inputs
433 `(("python-mock" ,python2-mock) ; for tests
434 ("python-pytz" ,python2-pytz) ; for tests
435 ("python-setuptools" ,python2-setuptools)))
436 (home-page "https://github.com/YeoLab/clipper")
437 (synopsis "CLIP peak enrichment recognition")
438 (description
439 "CLIPper is a tool to define peaks in CLIP-seq datasets.")
440 (license license:gpl2)))
441
442 (define-public couger
443 (package
444 (name "couger")
445 (version "1.8.2")
446 (source (origin
447 (method url-fetch)
448 (uri (string-append
449 "http://couger.oit.duke.edu/static/assets/COUGER"
450 version ".zip"))
451 (sha256
452 (base32
453 "04p2b14nmhzxw5h72mpzdhalv21bx4w9b87z0wpw0xzxpysyncmq"))))
454 (build-system gnu-build-system)
455 (arguments
456 `(#:tests? #f
457 #:phases
458 (modify-phases %standard-phases
459 (delete 'configure)
460 (delete 'build)
461 (replace
462 'install
463 (lambda* (#:key outputs #:allow-other-keys)
464 (let ((out (assoc-ref outputs "out")))
465 (copy-recursively "src" (string-append out "/src"))
466 (mkdir (string-append out "/bin"))
467 ;; Add "src" directory to module lookup path.
468 (substitute* "couger"
469 (("from argparse")
470 (string-append "import sys\nsys.path.append(\""
471 out "\")\nfrom argparse")))
472 (copy-file "couger" (string-append out "/bin/couger")))
473 #t))
474 (add-after
475 'install 'wrap-program
476 (lambda* (#:key inputs outputs #:allow-other-keys)
477 ;; Make sure 'couger' runs with the correct PYTHONPATH.
478 (let* ((out (assoc-ref outputs "out"))
479 (path (getenv "PYTHONPATH")))
480 (wrap-program (string-append out "/bin/couger")
481 `("PYTHONPATH" ":" prefix (,path))))
482 #t)))))
483 (inputs
484 `(("python" ,python-2)
485 ("python2-pillow" ,python2-pillow)
486 ("python2-numpy" ,python2-numpy)
487 ("python2-scipy" ,python2-scipy)
488 ("python2-matplotlib" ,python2-matplotlib)))
489 (propagated-inputs
490 `(("r" ,r)
491 ("libsvm" ,libsvm)
492 ("randomjungle" ,randomjungle)))
493 (native-inputs
494 `(("unzip" ,unzip)))
495 (home-page "http://couger.oit.duke.edu")
496 (synopsis "Identify co-factors in sets of genomic regions")
497 (description
498 "COUGER can be applied to any two sets of genomic regions bound by
499 paralogous TFs (e.g., regions derived from ChIP-seq experiments) to identify
500 putative co-factors that provide specificity to each TF. The framework
501 determines the genomic targets uniquely-bound by each TF, and identifies a
502 small set of co-factors that best explain the in vivo binding differences
503 between the two TFs.
504
505 COUGER uses classification algorithms (support vector machines and random
506 forests) with features that reflect the DNA binding specificities of putative
507 co-factors. The features are generated either from high-throughput TF-DNA
508 binding data (from protein binding microarray experiments), or from large
509 collections of DNA motifs.")
510 (license license:gpl3+)))
511
512 (define-public clustal-omega
513 (package
514 (name "clustal-omega")
515 (version "1.2.1")
516 (source (origin
517 (method url-fetch)
518 (uri (string-append
519 "http://www.clustal.org/omega/clustal-omega-"
520 version ".tar.gz"))
521 (sha256
522 (base32
523 "02ibkx0m0iwz8nscg998bh41gg251y56cgh86bvyrii5m8kjgwqf"))))
524 (build-system gnu-build-system)
525 (inputs
526 `(("argtable" ,argtable)))
527 (home-page "http://www.clustal.org/omega/")
528 (synopsis "Multiple sequence aligner for protein and DNA/RNA")
529 (description
530 "Clustal-Omega is a general purpose multiple sequence alignment (MSA)
531 program for protein and DNA/RNA. It produces high quality MSAs and is capable
532 of handling data-sets of hundreds of thousands of sequences in reasonable
533 time.")
534 (license license:gpl2+)))
535
536 (define-public crossmap
537 (package
538 (name "crossmap")
539 (version "0.1.6")
540 (source (origin
541 (method url-fetch)
542 (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
543 version ".tar.gz"))
544 (sha256
545 (base32
546 "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
547 ;; patch has been sent upstream already
548 (patches (list
549 (search-patch "crossmap-allow-system-pysam.patch")))
550 (modules '((guix build utils)))
551 ;; remove bundled copy of pysam
552 (snippet
553 '(delete-file-recursively "lib/pysam"))))
554 (build-system python-build-system)
555 (arguments
556 `(#:python ,python-2
557 #:phases
558 (alist-cons-after
559 'unpack 'set-env
560 (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
561 %standard-phases)))
562 (inputs
563 `(("python-numpy" ,python2-numpy)
564 ("python-pysam" ,python2-pysam)
565 ("zlib" ,zlib)))
566 (native-inputs
567 `(("python-cython" ,python2-cython)
568 ("python-nose" ,python2-nose)
569 ("python-setuptools" ,python2-setuptools)))
570 (home-page "http://crossmap.sourceforge.net/")
571 (synopsis "Convert genome coordinates between assemblies")
572 (description
573 "CrossMap is a program for conversion of genome coordinates or annotation
574 files between different genome assemblies. It supports most commonly used
575 file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
576 (license license:gpl2+)))
577
578 (define-public cutadapt
579 (package
580 (name "cutadapt")
581 (version "1.8")
582 (source (origin
583 (method url-fetch)
584 (uri (string-append
585 "https://github.com/marcelm/cutadapt/archive/v"
586 version ".tar.gz"))
587 (file-name (string-append name "-" version ".tar.gz"))
588 (sha256
589 (base32
590 "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5"))))
591 (build-system python-build-system)
592 (arguments
593 ;; tests must be run after install
594 `(#:phases (alist-cons-after
595 'install 'check
596 (lambda* (#:key inputs outputs #:allow-other-keys)
597 (setenv "PYTHONPATH"
598 (string-append
599 (getenv "PYTHONPATH")
600 ":" (assoc-ref outputs "out")
601 "/lib/python"
602 (string-take (string-take-right
603 (assoc-ref inputs "python") 5) 3)
604 "/site-packages"))
605 (zero? (system* "nosetests" "-P" "tests")))
606 (alist-delete 'check %standard-phases))))
607 (native-inputs
608 `(("python-cython" ,python-cython)
609 ("python-nose" ,python-nose)
610 ("python-setuptools" ,python-setuptools)))
611 (home-page "https://code.google.com/p/cutadapt/")
612 (synopsis "Remove adapter sequences from nucleotide sequencing reads")
613 (description
614 "Cutadapt finds and removes adapter sequences, primers, poly-A tails and
615 other types of unwanted sequence from high-throughput sequencing reads.")
616 (license license:expat)))
617
618 (define-public edirect
619 (package
620 (name "edirect")
621 (version "2.50")
622 (source (origin
623 (method url-fetch)
624 ;; Note: older versions are not retained.
625 (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip")
626 (sha256
627 (base32
628 "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj"))))
629 (build-system perl-build-system)
630 (arguments
631 `(#:tests? #f ;no "check" target
632 #:phases
633 (modify-phases %standard-phases
634 (delete 'configure)
635 (delete 'build)
636 (replace 'install
637 (lambda* (#:key outputs #:allow-other-keys)
638 (let ((target (string-append (assoc-ref outputs "out")
639 "/bin")))
640 (mkdir-p target)
641 (copy-file "edirect.pl"
642 (string-append target "/edirect.pl"))
643 #t)))
644 (add-after
645 'install 'wrap-program
646 (lambda* (#:key inputs outputs #:allow-other-keys)
647 ;; Make sure 'edirect.pl' finds all perl inputs at runtime.
648 (let* ((out (assoc-ref outputs "out"))
649 (path (getenv "PERL5LIB")))
650 (wrap-program (string-append out "/bin/edirect.pl")
651 `("PERL5LIB" ":" prefix (,path)))))))))
652 (inputs
653 `(("perl-html-parser" ,perl-html-parser)
654 ("perl-encode-locale" ,perl-encode-locale)
655 ("perl-file-listing" ,perl-file-listing)
656 ("perl-html-tagset" ,perl-html-tagset)
657 ("perl-html-tree" ,perl-html-tree)
658 ("perl-http-cookies" ,perl-http-cookies)
659 ("perl-http-date" ,perl-http-date)
660 ("perl-http-message" ,perl-http-message)
661 ("perl-http-negotiate" ,perl-http-negotiate)
662 ("perl-lwp-mediatypes" ,perl-lwp-mediatypes)
663 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
664 ("perl-net-http" ,perl-net-http)
665 ("perl-uri" ,perl-uri)
666 ("perl-www-robotrules" ,perl-www-robotrules)
667 ("perl" ,perl)))
668 (native-inputs
669 `(("unzip" ,unzip)))
670 (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288")
671 (synopsis "Tools for accessing the NCBI's set of databases")
672 (description
673 "Entrez Direct (EDirect) is a method for accessing the National Center
674 for Biotechnology Information's (NCBI) set of interconnected
675 databases (publication, sequence, structure, gene, variation, expression,
676 etc.) from a terminal. Functions take search terms from command-line
677 arguments. Individual operations are combined to build multi-step queries.
678 Record retrieval and formatting normally complete the process.
679
680 EDirect also provides an argument-driven function that simplifies the
681 extraction of data from document summaries or other results that are returned
682 in structured XML format. This can eliminate the need for writing custom
683 software to answer ad hoc questions.")
684 (license license:public-domain)))
685
686 (define-public express
687 (package
688 (name "express")
689 (version "1.5.1")
690 (source (origin
691 (method url-fetch)
692 (uri
693 (string-append
694 "http://bio.math.berkeley.edu/eXpress/downloads/express-"
695 version "/express-" version "-src.tgz"))
696 (sha256
697 (base32
698 "03rczxd0gjp2l1jxcmjfmf5j94j77zqyxa6x063zsc585nj40n0c"))))
699 (build-system cmake-build-system)
700 (arguments
701 `(#:tests? #f ;no "check" target
702 #:phases
703 (alist-cons-after
704 'unpack 'use-shared-boost-libs-and-set-bamtools-paths
705 (lambda* (#:key inputs #:allow-other-keys)
706 (substitute* "CMakeLists.txt"
707 (("set\\(Boost_USE_STATIC_LIBS ON\\)")
708 "set(Boost_USE_STATIC_LIBS OFF)")
709 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/bamtools/include")
710 (string-append (assoc-ref inputs "bamtools") "/include/bamtools")))
711 (substitute* "src/CMakeLists.txt"
712 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/\\.\\./bamtools/lib")
713 (string-append (assoc-ref inputs "bamtools") "/lib/bamtools")))
714 #t)
715 %standard-phases)))
716 (inputs
717 `(("boost" ,boost)
718 ("bamtools" ,bamtools)
719 ("protobuf" ,protobuf)
720 ("zlib" ,zlib)))
721 (home-page "http://bio.math.berkeley.edu/eXpress")
722 (synopsis "Streaming quantification for high-throughput genomic sequencing")
723 (description
724 "eXpress is a streaming tool for quantifying the abundances of a set of
725 target sequences from sampled subsequences. Example applications include
726 transcript-level RNA-Seq quantification, allele-specific/haplotype expression
727 analysis (from RNA-Seq), transcription factor binding quantification in
728 ChIP-Seq, and analysis of metagenomic data.")
729 (license license:artistic2.0)))
730
731 (define-public fastx-toolkit
732 (package
733 (name "fastx-toolkit")
734 (version "0.0.14")
735 (source (origin
736 (method url-fetch)
737 (uri
738 (string-append
739 "https://github.com/agordon/fastx_toolkit/releases/download/"
740 version "/fastx_toolkit-" version ".tar.bz2"))
741 (sha256
742 (base32
743 "01jqzw386873sr0pjp1wr4rn8fsga2vxs1qfmicvx1pjr72007wy"))))
744 (build-system gnu-build-system)
745 (inputs
746 `(("libgtextutils" ,libgtextutils)))
747 (native-inputs
748 `(("pkg-config" ,pkg-config)))
749 (home-page "http://hannonlab.cshl.edu/fastx_toolkit/")
750 (synopsis "Tools for FASTA/FASTQ file preprocessing")
751 (description
752 "The FASTX-Toolkit is a collection of command line tools for Short-Reads
753 FASTA/FASTQ files preprocessing.
754
755 Next-Generation sequencing machines usually produce FASTA or FASTQ files,
756 containing multiple short-reads sequences. The main processing of such
757 FASTA/FASTQ files is mapping the sequences to reference genomes. However, it
758 is sometimes more productive to preprocess the files before mapping the
759 sequences to the genome---manipulating the sequences to produce better mapping
760 results. The FASTX-Toolkit tools perform some of these preprocessing tasks.")
761 (license license:agpl3+)))
762
763 (define-public flexbar
764 (package
765 (name "flexbar")
766 (version "2.5")
767 (source (origin
768 (method url-fetch)
769 (uri
770 (string-append "mirror://sourceforge/flexbar/"
771 version "/flexbar_v" version "_src.tgz"))
772 (sha256
773 (base32
774 "13jaykc3y1x8y5nn9j8ljnb79s5y51kyxz46hdmvvjj6qhyympmf"))))
775 (build-system cmake-build-system)
776 (arguments
777 `(#:configure-flags (list
778 (string-append "-DFLEXBAR_BINARY_DIR="
779 (assoc-ref %outputs "out")
780 "/bin/"))
781 #:phases
782 (alist-replace
783 'check
784 (lambda* (#:key outputs #:allow-other-keys)
785 (setenv "PATH" (string-append
786 (assoc-ref outputs "out") "/bin:"
787 (getenv "PATH")))
788 (chdir "../flexbar_v2.5_src/test")
789 (zero? (system* "bash" "flexbar_validate.sh")))
790 (alist-delete 'install %standard-phases))))
791 (inputs
792 `(("tbb" ,tbb)
793 ("zlib" ,zlib)))
794 (native-inputs
795 `(("pkg-config" ,pkg-config)
796 ("seqan" ,seqan)))
797 (home-page "http://flexbar.sourceforge.net")
798 (synopsis "Barcode and adapter removal tool for sequencing platforms")
799 (description
800 "Flexbar preprocesses high-throughput nucleotide sequencing data
801 efficiently. It demultiplexes barcoded runs and removes adapter sequences.
802 Moreover, trimming and filtering features are provided. Flexbar increases
803 read mapping rates and improves genome and transcriptome assemblies. It
804 supports next-generation sequencing data in fasta/q and csfasta/q format from
805 Illumina, Roche 454, and the SOLiD platform.")
806 (license license:gpl3)))
807
808 (define-public grit
809 (package
810 (name "grit")
811 (version "2.0.2")
812 (source (origin
813 (method url-fetch)
814 (uri (string-append
815 "https://github.com/nboley/grit/archive/"
816 version ".tar.gz"))
817 (file-name (string-append name "-" version ".tar.gz"))
818 (sha256
819 (base32
820 "157in84dj70wimbind3x7sy1whs3h57qfgcnj2s6lrd38fbrb7mj"))))
821 (build-system python-build-system)
822 (arguments
823 `(#:python ,python-2
824 #:phases
825 (alist-cons-after
826 'unpack 'generate-from-cython-sources
827 (lambda* (#:key inputs outputs #:allow-other-keys)
828 ;; Delete these C files to force fresh generation from pyx sources.
829 (delete-file "grit/sparsify_support_fns.c")
830 (delete-file "grit/call_peaks_support_fns.c")
831 (substitute* "setup.py"
832 (("Cython.Setup") "Cython.Build")
833 ;; Add numpy include path to fix compilation
834 (("pyx\", \\]")
835 (string-append "pyx\", ], include_dirs = ['"
836 (assoc-ref inputs "python-numpy")
837 "/lib/python2.7/site-packages/numpy/core/include/"
838 "']"))) #t)
839 %standard-phases)))
840 (inputs
841 `(("python-scipy" ,python2-scipy)
842 ("python-numpy" ,python2-numpy)
843 ("python-pysam" ,python2-pysam)
844 ("python-networkx" ,python2-networkx)))
845 (native-inputs
846 `(("python-cython" ,python2-cython)
847 ("python-setuptools" ,python2-setuptools)))
848 (home-page "http://grit-bio.org")
849 (synopsis "Tool for integrative analysis of RNA-seq type assays")
850 (description
851 "GRIT is designed to use RNA-seq, TES, and TSS data to build and quantify
852 full length transcript models. When none of these data sources are available,
853 GRIT can be run by providing a candidate set of TES or TSS sites. In
854 addition, GRIT can merge in reference junctions and gene boundaries. GRIT can
855 also be run in quantification mode, where it uses a provided GTF file and just
856 estimates transcript expression.")
857 (license license:gpl3+)))
858
859 (define-public hisat
860 (package
861 (name "hisat")
862 (version "0.1.4")
863 (source (origin
864 (method url-fetch)
865 (uri (string-append
866 "http://ccb.jhu.edu/software/hisat/downloads/hisat-"
867 version "-beta-source.zip"))
868 (sha256
869 (base32
870 "1k381ydranqxp09yf2y7w1d0chz5d59vb6jchi89hbb0prq19lk5"))))
871 (build-system gnu-build-system)
872 (arguments
873 `(#:tests? #f ;no check target
874 #:make-flags '("allall"
875 ;; Disable unsupported `popcnt' instructions on
876 ;; architectures other than x86_64
877 ,@(if (string-prefix? "x86_64"
878 (or (%current-target-system)
879 (%current-system)))
880 '()
881 '("POPCNT_CAPABILITY=0")))
882 #:phases
883 (alist-cons-after
884 'unpack 'patch-sources
885 (lambda _
886 ;; XXX Cannot use snippet because zip files are not supported
887 (substitute* "Makefile"
888 (("^CC = .*$") "CC = gcc")
889 (("^CPP = .*$") "CPP = g++")
890 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
891 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
892 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\""))
893 (substitute* '("hisat-build" "hisat-inspect")
894 (("/usr/bin/env") (which "env"))))
895 (alist-replace
896 'install
897 (lambda* (#:key outputs #:allow-other-keys)
898 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
899 (mkdir-p bin)
900 (for-each
901 (lambda (file)
902 (copy-file file (string-append bin file)))
903 (find-files
904 "."
905 "hisat(-(build|align|inspect)(-(s|l)(-debug)*)*)*$"))))
906 (alist-delete 'configure %standard-phases)))))
907 (native-inputs
908 `(("unzip" ,unzip)))
909 (inputs
910 `(("perl" ,perl)
911 ("python" ,python)
912 ("zlib" ,zlib)))
913 (home-page "http://ccb.jhu.edu/software/hisat/index.shtml")
914 (synopsis "Hierarchical indexing for spliced alignment of transcripts")
915 (description
916 "HISAT is a fast and sensitive spliced alignment program for mapping
917 RNA-seq reads. In addition to one global FM index that represents a whole
918 genome, HISAT uses a large set of small FM indexes that collectively cover the
919 whole genome. These small indexes (called local indexes) combined with
920 several alignment strategies enable effective alignment of RNA-seq reads, in
921 particular, reads spanning multiple exons.")
922 (license license:gpl3+)))
923
924 (define-public htseq
925 (package
926 (name "htseq")
927 (version "0.6.1")
928 (source (origin
929 (method url-fetch)
930 (uri (string-append
931 "https://pypi.python.org/packages/source/H/HTSeq/HTSeq-"
932 version ".tar.gz"))
933 (sha256
934 (base32
935 "1i85ppf2j2lj12m0x690qq5nn17xxk23pbbx2c83r8ayb5wngzwv"))))
936 (build-system python-build-system)
937 (arguments `(#:python ,python-2)) ; only Python 2 is supported
938 (inputs
939 `(("python-numpy" ,python2-numpy)
940 ("python-setuptools" ,python2-setuptools)))
941 (home-page "http://www-huber.embl.de/users/anders/HTSeq/")
942 (synopsis "Analysing high-throughput sequencing data with Python")
943 (description
944 "HTSeq is a Python package that provides infrastructure to process data
945 from high-throughput sequencing assays.")
946 (license license:gpl3+)))
947
948 (define-public htsjdk
949 (package
950 (name "htsjdk")
951 (version "1.129")
952 (source (origin
953 (method url-fetch)
954 (uri (string-append
955 "https://github.com/samtools/htsjdk/archive/"
956 version ".tar.gz"))
957 (file-name (string-append name "-" version ".tar.gz"))
958 (sha256
959 (base32
960 "0asdk9b8jx2ij7yd6apg9qx03li8q7z3ml0qy2r2qczkra79y6fw"))
961 (modules '((guix build utils)))
962 ;; remove build dependency on git
963 (snippet '(substitute* "build.xml"
964 (("failifexecutionfails=\"true\"")
965 "failifexecutionfails=\"false\"")))))
966 (build-system gnu-build-system)
967 (arguments
968 `(#:modules ((srfi srfi-1)
969 (guix build gnu-build-system)
970 (guix build utils))
971 #:phases (alist-replace
972 'build
973 (lambda _
974 (setenv "JAVA_HOME" (assoc-ref %build-inputs "jdk"))
975 (zero? (system* "ant" "all"
976 (string-append "-Ddist="
977 (assoc-ref %outputs "out")
978 "/share/java/htsjdk/"))))
979 (fold alist-delete %standard-phases
980 '(configure install check)))))
981 (native-inputs
982 `(("ant" ,ant)
983 ("jdk" ,icedtea6 "jdk")))
984 (home-page "http://samtools.github.io/htsjdk/")
985 (synopsis "Java API for high-throughput sequencing data (HTS) formats")
986 (description
987 "HTSJDK is an implementation of a unified Java library for accessing
988 common file formats, such as SAM and VCF, used for high-throughput
989 sequencing (HTS) data. There are also an number of useful utilities for
990 manipulating HTS data.")
991 (license license:expat)))
992
993 (define-public htslib
994 (package
995 (name "htslib")
996 (version "1.2.1")
997 (source (origin
998 (method url-fetch)
999 (uri (string-append
1000 "https://github.com/samtools/htslib/releases/download/"
1001 version "/htslib-" version ".tar.bz2"))
1002 (sha256
1003 (base32
1004 "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx"))))
1005 (build-system gnu-build-system)
1006 (arguments
1007 `(#:phases
1008 (modify-phases %standard-phases
1009 (add-after
1010 'unpack 'patch-tests
1011 (lambda _
1012 (substitute* "test/test.pl"
1013 (("/bin/bash") (which "bash")))
1014 #t)))))
1015 (inputs
1016 `(("zlib" ,zlib)))
1017 (native-inputs
1018 `(("perl" ,perl)))
1019 (home-page "http://www.htslib.org")
1020 (synopsis "C library for reading/writing high-throughput sequencing data")
1021 (description
1022 "HTSlib is a C library for reading/writing high-throughput sequencing
1023 data. It also provides the bgzip, htsfile, and tabix utilities.")
1024 ;; Files under cram/ are released under the modified BSD license;
1025 ;; the rest is released under the Expat license
1026 (license (list license:expat license:bsd-3))))
1027
1028 (define-public macs
1029 (package
1030 (name "macs")
1031 (version "2.1.0.20140616")
1032 (source (origin
1033 (method url-fetch)
1034 (uri (string-append
1035 "https://pypi.python.org/packages/source/M/MACS2/MACS2-"
1036 version ".tar.gz"))
1037 (sha256
1038 (base32
1039 "11lmiw6avqhwn75sn59g4lfkrr2kk20r3rgfbx9xfqb8rg9mi2n6"))))
1040 (build-system python-build-system)
1041 (arguments
1042 `(#:python ,python-2 ; only compatible with Python 2.7
1043 #:tests? #f)) ; no test target
1044 (inputs
1045 `(("python-numpy" ,python2-numpy)))
1046 (native-inputs
1047 `(("python-setuptools" ,python2-setuptools)))
1048 (home-page "http://github.com/taoliu/MACS/")
1049 (synopsis "Model based analysis for ChIP-Seq data")
1050 (description
1051 "MACS is an implementation of a ChIP-Seq analysis algorithm for
1052 identifying transcript factor binding sites named Model-based Analysis of
1053 ChIP-Seq (MACS). MACS captures the influence of genome complexity to evaluate
1054 the significance of enriched ChIP regions and it improves the spatial
1055 resolution of binding sites through combining the information of both
1056 sequencing tag position and orientation.")
1057 (license license:bsd-3)))
1058
1059 (define-public miso
1060 (package
1061 (name "miso")
1062 (version "0.5.3")
1063 (source (origin
1064 (method url-fetch)
1065 (uri (string-append
1066 "http://pypi.python.org/packages/source/m/misopy/misopy-"
1067 version ".tar.gz"))
1068 (sha256
1069 (base32
1070 "0x446867az8ir0z8c1vjqffkp0ma37wm4sylixnkhgawllzx8v5w"))
1071 (modules '((guix build utils)))
1072 ;; use "gcc" instead of "cc" for compilation
1073 (snippet
1074 '(substitute* "setup.py"
1075 (("^defines")
1076 "cc.set_executables(
1077 compiler='gcc',
1078 compiler_so='gcc',
1079 linker_exe='gcc',
1080 linker_so='gcc -shared'); defines")))))
1081 (build-system python-build-system)
1082 (arguments
1083 `(#:python ,python-2 ; only Python 2 is supported
1084 #:tests? #f)) ; no "test" target
1085 (inputs
1086 `(("samtools" ,samtools)
1087 ("python-numpy" ,python2-numpy)
1088 ("python-pysam" ,python2-pysam)
1089 ("python-scipy" ,python2-scipy)
1090 ("python-matplotlib" ,python2-matplotlib)))
1091 (native-inputs
1092 `(("python-setuptools" ,python2-setuptools)))
1093 (home-page "http://genes.mit.edu/burgelab/miso/index.html")
1094 (synopsis "Mixture of Isoforms model for RNA-Seq isoform quantitation")
1095 (description
1096 "MISO (Mixture-of-Isoforms) is a probabilistic framework that quantitates
1097 the expression level of alternatively spliced genes from RNA-Seq data, and
1098 identifies differentially regulated isoforms or exons across samples. By
1099 modeling the generative process by which reads are produced from isoforms in
1100 RNA-Seq, the MISO model uses Bayesian inference to compute the probability
1101 that a read originated from a particular isoform.")
1102 (license license:gpl2)))
1103
1104 (define-public orfm
1105 (package
1106 (name "orfm")
1107 (version "0.3.2")
1108 (source (origin
1109 (method url-fetch)
1110 (uri (string-append
1111 "https://github.com/wwood/OrfM/releases/download/v"
1112 version "/orfm-" version ".tar.gz"))
1113 (sha256
1114 (base32
1115 "00jqvlspj9662ni9r4n1snxfnwkzc02i46g5nk1kwjshi6v3vgg3"))))
1116 (build-system gnu-build-system)
1117 (inputs `(("zlib" ,zlib)))
1118 (synopsis "Simple and not slow open reading frame (ORF) caller")
1119 (description
1120 "An ORF caller finds stretches of DNA that when translated are not
1121 interrupted by stop codons. OrfM finds and prints these ORFs.")
1122 (home-page "https://github.com/wwood/OrfM")
1123 (license license:lgpl3+)))
1124
1125 (define-public python2-pbcore
1126 (package
1127 (name "python2-pbcore")
1128 (version "0.9.3")
1129 (source (origin
1130 (method url-fetch)
1131 (uri (string-append
1132 "https://github.com/PacificBiosciences/pbcore/archive/"
1133 version ".tar.gz"))
1134 (file-name (string-append name "-" version ".tar.gz"))
1135 (sha256
1136 (base32
1137 "1z46rwjac93jm87cbj2zgjg6qvsgs65140wkbbxsvxps7ai4pm09"))))
1138 (build-system python-build-system)
1139 (arguments `(#:python ,python-2)) ; pbcore requires Python 2.7
1140 (inputs
1141 `(("python-cython" ,python2-cython)
1142 ("python-numpy" ,python2-numpy)
1143 ("python-pysam" ,python2-pysam)
1144 ("python-h5py" ,python2-h5py)))
1145 (native-inputs
1146 `(("python-setuptools" ,python2-setuptools)))
1147 (home-page "http://pacificbiosciences.github.io/pbcore/")
1148 (synopsis "Library for reading and writing PacBio data files")
1149 (description
1150 "The pbcore package provides Python APIs for interacting with PacBio data
1151 files and writing bioinformatics applications.")
1152 (license license:bsd-3)))
1153
1154 (define-public pbtranscript-tofu
1155 (let ((commit "c7bbd5472"))
1156 (package
1157 (name "pbtranscript-tofu")
1158 (version (string-append "0.4.1." commit))
1159 (source (origin
1160 (method git-fetch)
1161 (uri (git-reference
1162 (url "https://github.com/PacificBiosciences/cDNA_primer.git")
1163 (commit commit)))
1164 (file-name (string-append name "-" version ".tar.gz"))
1165 (sha256
1166 (base32
1167 "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
1168 (build-system python-build-system)
1169 (arguments
1170 `(#:python ,python-2
1171 ;; With standard flags, the install phase attempts to create a zip'd
1172 ;; egg file, and fails with an error: 'ZIP does not support timestamps
1173 ;; before 1980'
1174 #:configure-flags '("--single-version-externally-managed"
1175 "--record=pbtranscript-tofu.txt")
1176 #:phases
1177 (alist-cons-after
1178 'unpack 'enter-directory-and-clean-up
1179 (lambda _
1180 (chdir "pbtranscript-tofu/pbtranscript/")
1181 ;; Delete clutter
1182 (delete-file-recursively "dist/")
1183 (delete-file-recursively "build/")
1184 (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/")
1185 (delete-file-recursively "pbtools.pbtranscript.egg-info")
1186 (delete-file "Cython-0.20.1.tar.gz")
1187 (delete-file "setuptools_cython-0.2.1-py2.7.egg")
1188 (delete-file "setuptools_cython-0.2.1.tar.gz")
1189 (delete-file "setup.cfg")
1190 (for-each delete-file
1191 (find-files "." "\\.so$"))
1192 ;; files should be writable for install phase
1193 (for-each (lambda (f) (chmod f #o755))
1194 (find-files "." "\\.py$")))
1195 %standard-phases)))
1196 (inputs
1197 `(("python-cython" ,python2-cython)
1198 ("python-numpy" ,python2-numpy)
1199 ("python-bx-python" ,python2-bx-python)
1200 ("python-networkx" ,python2-networkx)
1201 ("python-scipy" ,python2-scipy)
1202 ("python-pbcore" ,python2-pbcore)))
1203 (native-inputs
1204 `(("python-nose" ,python2-nose)
1205 ("python-setuptools" ,python2-setuptools)))
1206 (home-page "https://github.com/PacificBiosciences/cDNA_primer")
1207 (synopsis "Analyze transcriptome data generated with the Iso-Seq protocol")
1208 (description
1209 "pbtranscript-tofu contains scripts to analyze transcriptome data
1210 generated using the PacBio Iso-Seq protocol.")
1211 (license license:bsd-3))))
1212
1213 (define-public rsem
1214 (package
1215 (name "rsem")
1216 (version "1.2.20")
1217 (source
1218 (origin
1219 (method url-fetch)
1220 (uri
1221 (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-"
1222 version ".tar.gz"))
1223 (sha256
1224 (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q"))
1225 (patches (list (search-patch "rsem-makefile.patch")))
1226 (modules '((guix build utils)))
1227 (snippet
1228 '(begin
1229 ;; remove bundled copy of boost
1230 (delete-file-recursively "boost")
1231 #t))))
1232 (build-system gnu-build-system)
1233 (arguments
1234 `(#:tests? #f ;no "check" target
1235 #:phases
1236 (modify-phases %standard-phases
1237 ;; No "configure" script.
1238 ;; Do not build bundled samtools library.
1239 (replace 'configure
1240 (lambda _
1241 (substitute* "Makefile"
1242 (("^all : sam/libbam.a") "all : "))
1243 #t))
1244 (replace 'install
1245 (lambda* (#:key outputs #:allow-other-keys)
1246 (let* ((out (string-append (assoc-ref outputs "out")))
1247 (bin (string-append out "/bin/"))
1248 (perl (string-append out "/lib/perl5/site_perl")))
1249 (mkdir-p bin)
1250 (mkdir-p perl)
1251 (for-each (lambda (file)
1252 (copy-file file
1253 (string-append bin (basename file))))
1254 (find-files "." "rsem-.*"))
1255 (copy-file "rsem_perl_utils.pm"
1256 (string-append perl "/rsem_perl_utils.pm")))
1257 #t))
1258 (add-after
1259 'install 'wrap-program
1260 (lambda* (#:key outputs #:allow-other-keys)
1261 (let ((out (assoc-ref outputs "out")))
1262 (for-each (lambda (prog)
1263 (wrap-program (string-append out "/bin/" prog)
1264 `("PERL5LIB" ":" prefix
1265 (,(string-append out "/lib/perl5/site_perl")))))
1266 '("rsem-plot-transcript-wiggles"
1267 "rsem-calculate-expression"
1268 "rsem-generate-ngvector"
1269 "rsem-run-ebseq"
1270 "rsem-prepare-reference")))
1271 #t)))))
1272 (inputs
1273 `(("boost" ,boost)
1274 ("ncurses" ,ncurses)
1275 ("r" ,r)
1276 ("perl" ,perl)
1277 ("samtools" ,samtools-0.1)
1278 ("zlib" ,zlib)))
1279 (home-page "http://deweylab.biostat.wisc.edu/rsem/")
1280 (synopsis "Estimate gene expression levels from RNA-Seq data")
1281 (description
1282 "RSEM is a software package for estimating gene and isoform expression
1283 levels from RNA-Seq data. The RSEM package provides a user-friendly
1284 interface, supports threads for parallel computation of the EM algorithm,
1285 single-end and paired-end read data, quality scores, variable-length reads and
1286 RSPD estimation. In addition, it provides posterior mean and 95% credibility
1287 interval estimates for expression levels. For visualization, it can generate
1288 BAM and Wiggle files in both transcript-coordinate and genomic-coordinate.")
1289 (license license:gpl3+)))
1290
1291 (define-public rseqc
1292 (package
1293 (name "rseqc")
1294 (version "2.6.1")
1295 (source
1296 (origin
1297 (method url-fetch)
1298 (uri
1299 (string-append "mirror://sourceforge/rseqc/"
1300 version "/RSeQC-" version ".tar.gz"))
1301 (sha256
1302 (base32 "15ly0254yi032qzkdplg00q144qfdsd986gh62829rl5bkxhj330"))
1303 (modules '((guix build utils)))
1304 (snippet
1305 '(begin
1306 ;; remove bundled copy of pysam
1307 (delete-file-recursively "lib/pysam")
1308 (substitute* "setup.py"
1309 ;; remove dependency on outdated "distribute" module
1310 (("^from distribute_setup import use_setuptools") "")
1311 (("^use_setuptools\\(\\)") "")
1312 ;; do not use bundled copy of pysam
1313 (("^have_pysam = False") "have_pysam = True"))))))
1314 (build-system python-build-system)
1315 (arguments `(#:python ,python-2))
1316 (inputs
1317 `(("python-cython" ,python2-cython)
1318 ("python-pysam" ,python2-pysam)
1319 ("python-numpy" ,python2-numpy)
1320 ("python-setuptools" ,python2-setuptools)
1321 ("zlib" ,zlib)))
1322 (native-inputs
1323 `(("python-nose" ,python2-nose)))
1324 (home-page "http://rseqc.sourceforge.net/")
1325 (synopsis "RNA-seq quality control package")
1326 (description
1327 "RSeQC provides a number of modules that can comprehensively evaluate
1328 high throughput sequence data, especially RNA-seq data. Some basic modules
1329 inspect sequence quality, nucleotide composition bias, PCR bias and GC bias,
1330 while RNA-seq specific modules evaluate sequencing saturation, mapped reads
1331 distribution, coverage uniformity, strand specificity, etc.")
1332 (license license:gpl3+)))
1333
1334 (define-public samtools
1335 (package
1336 (name "samtools")
1337 (version "1.1")
1338 (source
1339 (origin
1340 (method url-fetch)
1341 (uri
1342 (string-append "mirror://sourceforge/samtools/"
1343 version "/samtools-" version ".tar.bz2"))
1344 (sha256
1345 (base32
1346 "1y5p2hs4gif891b4ik20275a8xf3qrr1zh9wpysp4g8m0g1jckf2"))))
1347 (build-system gnu-build-system)
1348 (arguments
1349 `(;; There are 87 test failures when building on non-64-bit architectures
1350 ;; due to invalid test data. This has since been fixed upstream (see
1351 ;; <https://github.com/samtools/samtools/pull/307>), but as there has
1352 ;; not been a new release we disable the tests for all non-64-bit
1353 ;; systems.
1354 #:tests? ,(string=? (or (%current-system) (%current-target-system))
1355 "x86_64-linux")
1356 #:make-flags (list "LIBCURSES=-lncurses"
1357 (string-append "prefix=" (assoc-ref %outputs "out")))
1358 #:phases
1359 (alist-cons-after
1360 'unpack
1361 'patch-tests
1362 (lambda* (#:key inputs #:allow-other-keys)
1363 (let ((bash (assoc-ref inputs "bash")))
1364 (substitute* "test/test.pl"
1365 ;; The test script calls out to /bin/bash
1366 (("/bin/bash")
1367 (string-append bash "/bin/bash"))
1368 ;; There are two failing tests upstream relating to the "stats"
1369 ;; subcommand in test_usage_subcommand ("did not have Usage"
1370 ;; and "usage did not mention samtools stats"), so we disable
1371 ;; them.
1372 (("(test_usage_subcommand\\(.*\\);)" cmd)
1373 (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
1374 (alist-cons-after
1375 'install 'install-library
1376 (lambda* (#:key outputs #:allow-other-keys)
1377 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1378 (mkdir-p lib)
1379 (copy-file "libbam.a" (string-append lib "/libbam.a"))))
1380 (alist-delete 'configure %standard-phases)))))
1381 (native-inputs `(("pkg-config" ,pkg-config)))
1382 (inputs `(("ncurses" ,ncurses)
1383 ("perl" ,perl)
1384 ("python" ,python)
1385 ("zlib" ,zlib)))
1386 (home-page "http://samtools.sourceforge.net")
1387 (synopsis "Utilities to efficiently manipulate nucleotide sequence alignments")
1388 (description
1389 "Samtools implements various utilities for post-processing nucleotide
1390 sequence alignments in the SAM, BAM, and CRAM formats, including indexing,
1391 variant calling (in conjunction with bcftools), and a simple alignment
1392 viewer.")
1393 (license license:expat)))
1394
1395 (define-public samtools-0.1
1396 ;; This is the most recent version of the 0.1 line of samtools. The input
1397 ;; and output formats differ greatly from that used and produced by samtools
1398 ;; 1.x and is still used in many bioinformatics pipelines.
1399 (package (inherit samtools)
1400 (version "0.1.19")
1401 (source
1402 (origin
1403 (method url-fetch)
1404 (uri
1405 (string-append "mirror://sourceforge/samtools/"
1406 version "/samtools-" version ".tar.bz2"))
1407 (sha256
1408 (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
1409 (arguments
1410 (substitute-keyword-arguments (package-arguments samtools)
1411 ((#:tests? tests) #f) ;no "check" target
1412 ((#:phases phases)
1413 `(modify-phases ,phases
1414 (replace 'install
1415 (lambda* (#:key outputs #:allow-other-keys)
1416 (let ((bin (string-append
1417 (assoc-ref outputs "out") "/bin")))
1418 (mkdir-p bin)
1419 (copy-file "samtools"
1420 (string-append bin "/samtools")))))
1421 (delete 'patch-tests)))))))
1422
1423 (define-public ngs-sdk
1424 (package
1425 (name "ngs-sdk")
1426 (version "1.1.1")
1427 (source
1428 (origin
1429 (method url-fetch)
1430 (uri
1431 (string-append "https://github.com/ncbi/ngs/archive/"
1432 version ".tar.gz"))
1433 (file-name (string-append name "-" version ".tar.gz"))
1434 (sha256
1435 (base32
1436 "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y"))))
1437 (build-system gnu-build-system)
1438 (arguments
1439 `(#:parallel-build? #f ; not supported
1440 #:tests? #f ; no "check" target
1441 #:phases
1442 (alist-replace
1443 'configure
1444 (lambda* (#:key outputs #:allow-other-keys)
1445 (let ((out (assoc-ref outputs "out")))
1446 ;; The 'configure' script doesn't recognize things like
1447 ;; '--enable-fast-install'.
1448 (zero? (system* "./configure"
1449 (string-append "--build-prefix=" (getcwd) "/build")
1450 (string-append "--prefix=" out)))))
1451 (alist-cons-after
1452 'unpack 'enter-dir
1453 (lambda _ (chdir "ngs-sdk") #t)
1454 %standard-phases))))
1455 (native-inputs `(("perl" ,perl)))
1456 (home-page "https://github.com/ncbi/ngs")
1457 (synopsis "API for accessing Next Generation Sequencing data")
1458 (description
1459 "NGS is a domain-specific API for accessing reads, alignments and pileups
1460 produced from Next Generation Sequencing. The API itself is independent from
1461 any particular back-end implementation, and supports use of multiple back-ends
1462 simultaneously.")
1463 (license license:public-domain)))
1464
1465 (define-public ngs-java
1466 (package (inherit ngs-sdk)
1467 (name "ngs-java")
1468 (arguments
1469 `(,@(substitute-keyword-arguments
1470 `(#:modules ((guix build gnu-build-system)
1471 (guix build utils)
1472 (srfi srfi-1)
1473 (srfi srfi-26))
1474 ,@(package-arguments ngs-sdk))
1475 ((#:phases phases)
1476 `(alist-cons-after
1477 'enter-dir 'fix-java-symlink-installation
1478 (lambda _
1479 ;; Only replace the version suffix, not the version number in
1480 ;; the directory name. Reported here:
1481 ;; https://github.com/ncbi/ngs/pull/4
1482 (substitute* "Makefile.java"
1483 (((string-append "\\$\\(subst "
1484 "(\\$\\(VERSION[^\\)]*\\)),"
1485 "(\\$\\([^\\)]+\\)),"
1486 "(\\$\\([^\\)]+\\)|\\$\\@)"
1487 "\\)")
1488 _ pattern replacement target)
1489 (string-append "$(patsubst "
1490 "%" pattern ","
1491 "%" replacement ","
1492 target ")"))))
1493 (alist-replace
1494 'enter-dir (lambda _ (chdir "ngs-java") #t)
1495 ,phases))))))
1496 (inputs
1497 `(("jdk" ,icedtea6 "jdk")
1498 ("ngs-sdk" ,ngs-sdk)))
1499 (synopsis "Java bindings for NGS SDK")))
1500
1501 (define-public ncbi-vdb
1502 (package
1503 (name "ncbi-vdb")
1504 (version "2.4.5-5")
1505 (source
1506 (origin
1507 (method url-fetch)
1508 (uri
1509 (string-append "https://github.com/ncbi/ncbi-vdb/archive/"
1510 version ".tar.gz"))
1511 (file-name (string-append name "-" version ".tar.gz"))
1512 (sha256
1513 (base32
1514 "1cj8nk6if8sqagv20vx36v566fdvhcaadf0x1ycnbgql6chbs6vy"))))
1515 (build-system gnu-build-system)
1516 (arguments
1517 `(#:parallel-build? #f ; not supported
1518 #:tests? #f ; no "check" target
1519 #:phases
1520 (alist-replace
1521 'configure
1522 (lambda* (#:key inputs outputs #:allow-other-keys)
1523 (let ((out (assoc-ref outputs "out")))
1524 ;; Only replace the version suffix, not the version number in the
1525 ;; directory name; fixed in commit 4dbba5c6a809 (no release yet).
1526 (substitute* "setup/konfigure.perl"
1527 (((string-append "\\$\\(subst "
1528 "(\\$\\(VERSION[^\\)]*\\)),"
1529 "(\\$\\([^\\)]+\\)),"
1530 "(\\$\\([^\\)]+\\)|\\$\\@)"
1531 "\\)")
1532 _ pattern replacement target)
1533 (string-append "$(patsubst "
1534 "%" pattern ","
1535 "%" replacement ","
1536 target ")")))
1537
1538 ;; Override include path for libmagic
1539 (substitute* "setup/package.prl"
1540 (("name => 'magic', Include => '/usr/include'")
1541 (string-append "name=> 'magic', Include => '"
1542 (assoc-ref inputs "libmagic")
1543 "/include" "'")))
1544
1545 ;; Install kdf5 library (needed by sra-tools)
1546 (substitute* "build/Makefile.install"
1547 (("LIBRARIES_TO_INSTALL =")
1548 "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)"))
1549
1550 ;; The 'configure' script doesn't recognize things like
1551 ;; '--enable-fast-install'.
1552 (zero? (system*
1553 "./configure"
1554 (string-append "--build-prefix=" (getcwd) "/build")
1555 (string-append "--prefix=" (assoc-ref outputs "out"))
1556 (string-append "--debug")
1557 (string-append "--with-xml2-prefix="
1558 (assoc-ref inputs "libxml2"))
1559 (string-append "--with-ngs-sdk-prefix="
1560 (assoc-ref inputs "ngs-sdk"))
1561 (string-append "--with-ngs-java-prefix="
1562 (assoc-ref inputs "ngs-java"))
1563 (string-append "--with-hdf5-prefix="
1564 (assoc-ref inputs "hdf5"))))))
1565 (alist-cons-after
1566 'install 'install-interfaces
1567 (lambda* (#:key outputs #:allow-other-keys)
1568 ;; Install interface libraries. On i686 the interface libraries
1569 ;; are installed to "linux/gcc/i386", so we need to use the Linux
1570 ;; architecture name ("i386") instead of the target system prefix
1571 ;; ("i686").
1572 (mkdir (string-append (assoc-ref outputs "out") "/ilib"))
1573 (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/"
1574 ,(system->linux-architecture
1575 (or (%current-target-system)
1576 (%current-system)))
1577 "/rel/ilib")
1578 (string-append (assoc-ref outputs "out")
1579 "/ilib"))
1580 ;; Install interface headers
1581 (copy-recursively "interfaces"
1582 (string-append (assoc-ref outputs "out")
1583 "/include")))
1584 %standard-phases))))
1585 (inputs
1586 `(("libxml2" ,libxml2)
1587 ("ngs-sdk" ,ngs-sdk)
1588 ("ngs-java" ,ngs-java)
1589 ("libmagic" ,file)
1590 ("hdf5" ,hdf5)))
1591 (native-inputs `(("perl" ,perl)))
1592 (home-page "https://github.com/ncbi/ncbi-vdb")
1593 (synopsis "Database engine for genetic information")
1594 (description
1595 "The NCBI-VDB library implements a highly compressed columnar data
1596 warehousing engine that is most often used to store genetic information.
1597 Databases are stored in a portable image within the file system, and can be
1598 accessed/downloaded on demand across HTTP.")
1599 (license license:public-domain)))
1600
1601 (define-public sra-tools
1602 (package
1603 (name "sra-tools")
1604 (version "2.4.5-5")
1605 (source
1606 (origin
1607 (method url-fetch)
1608 (uri
1609 (string-append "https://github.com/ncbi/sra-tools/archive/"
1610 version ".tar.gz"))
1611 (file-name (string-append name "-" version ".tar.gz"))
1612 (sha256
1613 (base32
1614 "11nrnvz7a012f4iryf0wiwrid0h111grsfxbxa9j51h3f2xbvgns"))))
1615 (build-system gnu-build-system)
1616 (arguments
1617 `(#:parallel-build? #f ; not supported
1618 #:tests? #f ; no "check" target
1619 #:phases
1620 (alist-replace
1621 'configure
1622 (lambda* (#:key inputs outputs #:allow-other-keys)
1623 ;; The build system expects a directory containing the sources and
1624 ;; raw build output of ncbi-vdb, including files that are not
1625 ;; installed. Since we are building against an installed version of
1626 ;; ncbi-vdb, the following modifications are needed.
1627 (substitute* "setup/konfigure.perl"
1628 ;; Make the configure script look for the "ilib" directory of
1629 ;; "ncbi-vdb" without first checking for the existence of a
1630 ;; matching library in its "lib" directory.
1631 (("^ my \\$f = File::Spec->catdir\\(\\$libdir, \\$lib\\);")
1632 "my $f = File::Spec->catdir($ilibdir, $ilib);")
1633 ;; Look for interface libraries in ncbi-vdb's "ilib" directory.
1634 (("my \\$ilibdir = File::Spec->catdir\\(\\$builddir, 'ilib'\\);")
1635 "my $ilibdir = File::Spec->catdir($dir, 'ilib');"))
1636
1637 ;; The 'configure' script doesn't recognize things like
1638 ;; '--enable-fast-install'.
1639 (zero? (system*
1640 "./configure"
1641 (string-append "--build-prefix=" (getcwd) "/build")
1642 (string-append "--prefix=" (assoc-ref outputs "out"))
1643 (string-append "--debug")
1644 (string-append "--with-fuse-prefix="
1645 (assoc-ref inputs "fuse"))
1646 (string-append "--with-magic-prefix="
1647 (assoc-ref inputs "libmagic"))
1648 ;; TODO: building with libxml2 fails with linker errors
1649 ;; (string-append "--with-xml2-prefix="
1650 ;; (assoc-ref inputs "libxml2"))
1651 (string-append "--with-ncbi-vdb-sources="
1652 (assoc-ref inputs "ncbi-vdb"))
1653 (string-append "--with-ncbi-vdb-build="
1654 (assoc-ref inputs "ncbi-vdb"))
1655 (string-append "--with-ngs-sdk-prefix="
1656 (assoc-ref inputs "ngs-sdk"))
1657 (string-append "--with-hdf5-prefix="
1658 (assoc-ref inputs "hdf5")))))
1659 %standard-phases)))
1660 (native-inputs `(("perl" ,perl)))
1661 (inputs
1662 `(("ngs-sdk" ,ngs-sdk)
1663 ("ncbi-vdb" ,ncbi-vdb)
1664 ("libmagic" ,file)
1665 ("fuse" ,fuse)
1666 ("hdf5" ,hdf5)
1667 ("zlib" ,zlib)))
1668 (home-page "http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software")
1669 (synopsis "Tools and libraries for reading and writing sequencing data")
1670 (description
1671 "The SRA Toolkit from NCBI is a collection of tools and libraries for
1672 reading of sequencing files from the Sequence Read Archive (SRA) database and
1673 writing files into the .sra format.")
1674 (license license:public-domain)))
1675
1676 (define-public seqan
1677 (package
1678 (name "seqan")
1679 (version "1.4.2")
1680 (source (origin
1681 (method url-fetch)
1682 (uri (string-append "http://packages.seqan.de/seqan-library/"
1683 "seqan-library-" version ".tar.bz2"))
1684 (sha256
1685 (base32
1686 "05s3wrrwn50f81aklfm65i4a749zag1vr8z03k21xm0pdxy47yvp"))))
1687 ;; The documentation is 7.8MB and the includes are 3.6MB heavy, so it
1688 ;; makes sense to split the outputs.
1689 (outputs '("out" "doc"))
1690 (build-system trivial-build-system)
1691 (arguments
1692 `(#:modules ((guix build utils))
1693 #:builder
1694 (begin
1695 (use-modules (guix build utils))
1696 (let ((tar (assoc-ref %build-inputs "tar"))
1697 (bzip (assoc-ref %build-inputs "bzip2"))
1698 (out (assoc-ref %outputs "out"))
1699 (doc (assoc-ref %outputs "doc")))
1700 (setenv "PATH" (string-append tar "/bin:" bzip "/bin"))
1701 (system* "tar" "xvf" (assoc-ref %build-inputs "source"))
1702 (chdir (string-append "seqan-library-" ,version))
1703 (copy-recursively "include" (string-append out "/include"))
1704 (copy-recursively "share" (string-append doc "/share"))))))
1705 (native-inputs
1706 `(("source" ,source)
1707 ("tar" ,tar)
1708 ("bzip2" ,bzip2)))
1709 (home-page "http://www.seqan.de")
1710 (synopsis "Library for nucleotide sequence analysis")
1711 (description
1712 "SeqAn is a C++ library of efficient algorithms and data structures for
1713 the analysis of sequences with the focus on biological data. It contains
1714 algorithms and data structures for string representation and their
1715 manipulation, online and indexed string search, efficient I/O of
1716 bioinformatics file formats, sequence alignment, and more.")
1717 (license license:bsd-3)))
1718
1719 (define-public star
1720 (package
1721 (name "star")
1722 (version "2.4.0j")
1723 (source (origin
1724 (method url-fetch)
1725 (uri (string-append
1726 "https://github.com/alexdobin/STAR/archive/STAR_"
1727 version ".tar.gz"))
1728 (sha256
1729 (base32
1730 "1y3bciych1aw6s7k8sy1saj23dcan9wk4d4f96an499slkxwz712"))
1731 (modules '((guix build utils)))
1732 (snippet
1733 '(substitute* "source/Makefile"
1734 (("/bin/rm") "rm")))))
1735 (build-system gnu-build-system)
1736 (arguments
1737 '(#:tests? #f ;no check target
1738 #:make-flags '("STAR")
1739 #:phases
1740 (alist-cons-after
1741 'unpack 'enter-source-dir (lambda _ (chdir "source"))
1742 (alist-replace
1743 'install
1744 (lambda* (#:key outputs #:allow-other-keys)
1745 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1746 (mkdir-p bin)
1747 (copy-file "STAR" (string-append bin "STAR"))))
1748 (alist-delete
1749 'configure %standard-phases)))))
1750 (native-inputs
1751 `(("vim" ,vim))) ; for xxd
1752 (inputs
1753 `(("zlib" ,zlib)))
1754 (home-page "https://github.com/alexdobin/STAR")
1755 (synopsis "Universal RNA-seq aligner")
1756 (description
1757 "The Spliced Transcripts Alignment to a Reference (STAR) software is
1758 based on a previously undescribed RNA-seq alignment algorithm that uses
1759 sequential maximum mappable seed search in uncompressed suffix arrays followed
1760 by seed clustering and stitching procedure. In addition to unbiased de novo
1761 detection of canonical junctions, STAR can discover non-canonical splices and
1762 chimeric (fusion) transcripts, and is also capable of mapping full-length RNA
1763 sequences.")
1764 ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed.
1765 (license license:gpl3+)))
1766
1767 (define-public subread
1768 (package
1769 (name "subread")
1770 (version "1.4.6-p2")
1771 (source (origin
1772 (method url-fetch)
1773 (uri (string-append
1774 "mirror://sourceforge/subread/subread-"
1775 version "-source.tar.gz"))
1776 (sha256
1777 (base32
1778 "06sv9mpcsdj6p68y15d6gi70lca3lxmzk0dn61hg0kfsa7rxmsr3"))))
1779 (build-system gnu-build-system)
1780 (arguments
1781 `(#:tests? #f ;no "check" target
1782 #:make-flags '("-f" "Makefile.Linux")
1783 #:phases
1784 (alist-cons-after
1785 'unpack 'enter-dir
1786 (lambda _ (chdir "src") #t)
1787 (alist-replace
1788 'install
1789 (lambda* (#:key outputs #:allow-other-keys)
1790 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1791 (mkdir-p bin)
1792 (copy-recursively "../bin" bin)))
1793 ;; no "configure" script
1794 (alist-delete 'configure %standard-phases)))))
1795 (inputs `(("zlib" ,zlib)))
1796 (home-page "http://bioinf.wehi.edu.au/subread-package/")
1797 (synopsis "Tool kit for processing next-gen sequencing data")
1798 (description
1799 "The subread package contains the following tools: subread aligner, a
1800 general-purpose read aligner; subjunc aligner: detecting exon-exon junctions
1801 and mapping RNA-seq reads; featureCounts: counting mapped reads for genomic
1802 features; exactSNP: a SNP caller that discovers SNPs by testing signals
1803 against local background noises.")
1804 (license license:gpl3+)))
1805
1806 (define-public shogun
1807 (package
1808 (name "shogun")
1809 (version "4.0.0")
1810 (source
1811 (origin
1812 (method url-fetch)
1813 (uri (string-append
1814 "ftp://shogun-toolbox.org/shogun/releases/"
1815 (version-major+minor version)
1816 "/sources/shogun-" version ".tar.bz2"))
1817 (sha256
1818 (base32
1819 "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
1820 (modules '((guix build utils)
1821 (ice-9 rdelim)))
1822 (snippet
1823 '(begin
1824 ;; Remove non-free sources and files referencing them
1825 (for-each delete-file
1826 (find-files "src/shogun/classifier/svm/"
1827 "SVMLight\\.(cpp|h)"))
1828 (for-each delete-file
1829 (find-files "examples/undocumented/libshogun/"
1830 (string-append
1831 "(classifier_.*svmlight.*|"
1832 "evaluation_cross_validation_locked_comparison).cpp")))
1833 ;; Remove non-free functions.
1834 (define (delete-ifdefs file)
1835 (with-atomic-file-replacement file
1836 (lambda (in out)
1837 (let loop ((line (read-line in 'concat))
1838 (skipping? #f))
1839 (if (eof-object? line)
1840 #t
1841 (let ((skip-next?
1842 (or (and skipping?
1843 (not (string-prefix?
1844 "#endif //USE_SVMLIGHT" line)))
1845 (string-prefix?
1846 "#ifdef USE_SVMLIGHT" line))))
1847 (when (or (not skipping?)
1848 (and skipping? (not skip-next?)))
1849 (display line out))
1850 (loop (read-line in 'concat) skip-next?)))))))
1851 (for-each delete-ifdefs (find-files "src/shogun/kernel/"
1852 "^Kernel\\.(cpp|h)"))))))
1853 (build-system cmake-build-system)
1854 (arguments
1855 '(#:tests? #f ;no check target
1856 #:phases
1857 (alist-cons-after
1858 'unpack 'delete-broken-symlinks
1859 (lambda _
1860 (for-each delete-file '("applications/arts/data"
1861 "applications/asp/data"
1862 "applications/easysvm/data"
1863 "applications/msplicer/data"
1864 "applications/ocr/data"
1865 "examples/documented/data"
1866 "examples/documented/matlab_static"
1867 "examples/documented/octave_static"
1868 "examples/undocumented/data"
1869 "examples/undocumented/matlab_static"
1870 "examples/undocumented/octave_static"
1871 "tests/integration/data"
1872 "tests/integration/matlab_static"
1873 "tests/integration/octave_static"
1874 "tests/integration/python_modular/tests"))
1875 #t)
1876 (alist-cons-after
1877 'unpack 'change-R-target-path
1878 (lambda* (#:key outputs #:allow-other-keys)
1879 (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
1880 "src/interfaces/r_static/CMakeLists.txt"
1881 "examples/undocumented/r_modular/CMakeLists.txt")
1882 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
1883 (string-append (assoc-ref outputs "out")
1884 "/lib/R/library/")))
1885 #t)
1886 (alist-cons-after
1887 'unpack 'fix-octave-modules
1888 (lambda* (#:key outputs #:allow-other-keys)
1889 (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
1890 "src/interfaces/octave_static/CMakeLists.txt")
1891 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
1892 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
1893
1894 ;; change target directory
1895 (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
1896 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
1897 (string-append (assoc-ref outputs "out")
1898 "/share/octave/packages")))
1899 #t)
1900 (alist-cons-before
1901 'build 'set-HOME
1902 ;; $HOME needs to be set at some point during the build phase
1903 (lambda _ (setenv "HOME" "/tmp") #t)
1904 %standard-phases))))
1905 #:configure-flags
1906 (list "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
1907 ;;"-DJavaModular=ON" ;requires unpackaged jblas
1908 ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
1909 ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
1910 ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
1911 "-DOctaveModular=ON"
1912 "-DOctaveStatic=ON"
1913 "-DPythonModular=ON"
1914 "-DPythonStatic=ON"
1915 "-DRModular=ON"
1916 "-DRStatic=ON"
1917 "-DCmdLineStatic=ON")))
1918 (inputs
1919 `(("python" ,python)
1920 ("numpy" ,python-numpy)
1921 ("r" ,r)
1922 ("octave" ,octave)
1923 ("swig" ,swig)
1924 ("hdf5" ,hdf5)
1925 ("atlas" ,atlas)
1926 ("arpack" ,arpack-ng)
1927 ("lapack" ,lapack)
1928 ("glpk" ,glpk)
1929 ("libxml2" ,libxml2)
1930 ("lzo" ,lzo)
1931 ("zlib" ,zlib)))
1932 (native-inputs
1933 `(("pkg-config" ,pkg-config)))
1934 (home-page "http://shogun-toolbox.org/")
1935 (synopsis "Machine learning toolbox")
1936 (description
1937 "The Shogun Machine learning toolbox provides a wide range of unified and
1938 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
1939 combine multiple data representations, algorithm classes, and general purpose
1940 tools. This enables both rapid prototyping of data pipelines and extensibility
1941 in terms of new algorithms.")
1942 (license license:gpl3+)))
1943
1944 (define-public vcftools
1945 (package
1946 (name "vcftools")
1947 (version "0.1.12b")
1948 (source (origin
1949 (method url-fetch)
1950 (uri (string-append
1951 "mirror://sourceforge/vcftools/vcftools_"
1952 version ".tar.gz"))
1953 (sha256
1954 (base32
1955 "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx"))))
1956 (build-system gnu-build-system)
1957 (arguments
1958 `(#:tests? #f ; no "check" target
1959 #:make-flags (list
1960 "CFLAGS=-O2" ; override "-m64" flag
1961 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1962 (string-append "MANDIR=" (assoc-ref %outputs "out")
1963 "/share/man/man1"))
1964 #:phases
1965 (alist-cons-after
1966 'unpack 'patch-manpage-install
1967 (lambda _
1968 (substitute* "Makefile"
1969 (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1")))
1970 (alist-delete 'configure %standard-phases))))
1971 (inputs
1972 `(("perl" ,perl)
1973 ("zlib" ,zlib)))
1974 (home-page "http://vcftools.sourceforge.net/")
1975 (synopsis "Tools for working with VCF files")
1976 (description
1977 "VCFtools is a program package designed for working with VCF files, such
1978 as those generated by the 1000 Genomes Project. The aim of VCFtools is to
1979 provide easily accessible methods for working with complex genetic variation
1980 data in the form of VCF files.")
1981 ;; The license is declared as LGPLv3 in the README and
1982 ;; at http://vcftools.sourceforge.net/license.html
1983 (license license:lgpl3)))