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 ;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages bioinformatics)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix packages)
23 #:use-module (guix utils)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system perl)
29 #:use-module (guix build-system python)
30 #:use-module (guix build-system trivial)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages algebra)
33 #:use-module (gnu packages base)
34 #:use-module (gnu packages boost)
35 #:use-module (gnu packages compression)
36 #:use-module (gnu packages cpio)
37 #:use-module (gnu packages file)
38 #:use-module (gnu packages java)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages machine-learning)
41 #:use-module (gnu packages maths)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages perl)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages popt)
46 #:use-module (gnu packages protobuf)
47 #:use-module (gnu packages python)
48 #:use-module (gnu packages statistics)
49 #:use-module (gnu packages swig)
50 #:use-module (gnu packages tbb)
51 #:use-module (gnu packages textutils)
52 #:use-module (gnu packages vim)
53 #:use-module (gnu packages web)
54 #:use-module (gnu packages xml)
55 #:use-module (gnu packages zip))
56
57 (define-public bamtools
58 (package
59 (name "bamtools")
60 (version "2.3.0")
61 (source (origin
62 (method url-fetch)
63 (uri (string-append
64 "https://github.com/pezmaster31/bamtools/archive/v"
65 version ".tar.gz"))
66 (file-name (string-append name "-" version ".tar.gz"))
67 (sha256
68 (base32
69 "1brry29bw2xr2l9pqn240rkqwayg85b8qq78zk2zs6nlspk4d018"))))
70 (build-system cmake-build-system)
71 (arguments
72 `(#:tests? #f ;no "check" target
73 #:phases
74 (modify-phases %standard-phases
75 (add-before
76 'configure 'set-ldflags
77 (lambda* (#:key outputs #:allow-other-keys)
78 (setenv "LDFLAGS"
79 (string-append
80 "-Wl,-rpath="
81 (assoc-ref outputs "out") "/lib/bamtools")))))))
82 (inputs `(("zlib" ,zlib)))
83 (home-page "https://github.com/pezmaster31/bamtools")
84 (synopsis "C++ API and command-line toolkit for working with BAM data")
85 (description
86 "BamTools provides both a C++ API and a command-line toolkit for handling
87 BAM files.")
88 (license license:expat)))
89
90 (define-public bedops
91 (package
92 (name "bedops")
93 (version "2.4.14")
94 (source (origin
95 (method url-fetch)
96 (uri (string-append "https://github.com/bedops/bedops/archive/v"
97 version ".tar.gz"))
98 (file-name (string-append name "-" version ".tar.gz"))
99 (sha256
100 (base32
101 "1kqbac547wyqma81cyky9n7mkgikjpsfd3nnmcm6hpqwanqgh10v"))))
102 (build-system gnu-build-system)
103 (arguments
104 '(#:tests? #f
105 #:make-flags (list (string-append "BINDIR=" %output "/bin"))
106 #:phases
107 (alist-cons-after
108 'unpack 'unpack-tarballs
109 (lambda _
110 ;; FIXME: Bedops includes tarballs of minimally patched upstream
111 ;; libraries jansson, zlib, and bzip2. We cannot just use stock
112 ;; libraries because at least one of the libraries (zlib) is
113 ;; patched to add a C++ function definition (deflateInit2cpp).
114 ;; Until the Bedops developers offer a way to link against system
115 ;; libraries we have to build the in-tree copies of these three
116 ;; libraries.
117
118 ;; See upstream discussion:
119 ;; https://github.com/bedops/bedops/issues/124
120
121 ;; Unpack the tarballs to benefit from shebang patching.
122 (with-directory-excursion "third-party"
123 (and (zero? (system* "tar" "xvf" "jansson-2.6.tar.bz2"))
124 (zero? (system* "tar" "xvf" "zlib-1.2.7.tar.bz2"))
125 (zero? (system* "tar" "xvf" "bzip2-1.0.6.tar.bz2"))))
126 ;; Disable unpacking of tarballs in Makefile.
127 (substitute* "system.mk/Makefile.linux"
128 (("^\tbzcat .*") "\t@echo \"not unpacking\"\n")
129 (("\\./configure") "CONFIG_SHELL=bash ./configure"))
130 (substitute* "third-party/zlib-1.2.7/Makefile.in"
131 (("^SHELL=.*$") "SHELL=bash\n")))
132 (alist-delete 'configure %standard-phases))))
133 (home-page "https://github.com/bedops/bedops")
134 (synopsis "Tools for high-performance genomic feature operations")
135 (description
136 "BEDOPS is a suite of tools to address common questions raised in genomic
137 studies---mostly with regard to overlap and proximity relationships between
138 data sets. It aims to be scalable and flexible, facilitating the efficient
139 and accurate analysis and management of large-scale genomic data.
140
141 BEDOPS provides tools that perform highly efficient and scalable Boolean and
142 other set operations, statistical calculations, archiving, conversion and
143 other management of genomic data of arbitrary scale. Tasks can be easily
144 split by chromosome for distributing whole-genome analyses across a
145 computational cluster.")
146 (license license:gpl2+)))
147
148 (define-public bedtools
149 (package
150 (name "bedtools")
151 (version "2.22.0")
152 (source (origin
153 (method url-fetch)
154 (uri (string-append "https://github.com/arq5x/bedtools2/archive/v"
155 version ".tar.gz"))
156 (file-name (string-append name "-" version ".tar.gz"))
157 (sha256
158 (base32
159 "16aq0w3dmbd0853j32xk9jin4vb6v6fgakfyvrsmsjizzbn3fpfl"))))
160 (build-system gnu-build-system)
161 (native-inputs `(("python" ,python-2)))
162 (inputs `(("samtools" ,samtools)
163 ("zlib" ,zlib)))
164 (arguments
165 '(#:test-target "test"
166 #:phases
167 (alist-cons-after
168 'unpack 'patch-makefile-SHELL-definition
169 (lambda _
170 ;; patch-makefile-SHELL cannot be used here as it does not
171 ;; yet patch definitions with `:='. Since changes to
172 ;; patch-makefile-SHELL result in a full rebuild, features
173 ;; of patch-makefile-SHELL are reimplemented here.
174 (substitute* "Makefile"
175 (("^SHELL := .*$") (string-append "SHELL := " (which "bash") " -e \n"))))
176 (alist-delete
177 'configure
178 (alist-replace
179 'install
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
182 (mkdir-p bin)
183 (for-each (lambda (file)
184 (copy-file file (string-append bin (basename file))))
185 (find-files "bin" ".*"))))
186 %standard-phases)))))
187 (home-page "https://github.com/arq5x/bedtools2")
188 (synopsis "Tools for genome analysis and arithmetic")
189 (description
190 "Collectively, the bedtools utilities are a swiss-army knife of tools for
191 a wide-range of genomics analysis tasks. The most widely-used tools enable
192 genome arithmetic: that is, set theory on the genome. For example, bedtools
193 allows one to intersect, merge, count, complement, and shuffle genomic
194 intervals from multiple files in widely-used genomic file formats such as BAM,
195 BED, GFF/GTF, VCF.")
196 (license license:gpl2)))
197
198 (define-public python2-pybedtools
199 (package
200 (name "python2-pybedtools")
201 (version "0.6.9")
202 (source (origin
203 (method url-fetch)
204 (uri (string-append
205 "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-"
206 version ".tar.gz"))
207 (sha256
208 (base32
209 "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an"))))
210 (build-system python-build-system)
211 (arguments `(#:python ,python-2)) ; no Python 3 support
212 (inputs
213 `(("python-cython" ,python2-cython)
214 ("python-matplotlib" ,python2-matplotlib)))
215 (propagated-inputs
216 `(("bedtools" ,bedtools)
217 ("samtools" ,samtools)))
218 (native-inputs
219 `(("python-pyyaml" ,python2-pyyaml)
220 ("python-nose" ,python2-nose)
221 ("python-setuptools" ,python2-setuptools)))
222 (home-page "https://pythonhosted.org/pybedtools/")
223 (synopsis "Python wrapper for BEDtools programs")
224 (description
225 "pybedtools is a Python wrapper for Aaron Quinlan's BEDtools programs,
226 which are widely used for genomic interval manipulation or \"genome algebra\".
227 pybedtools extends BEDTools by offering feature-level manipulations from with
228 Python.")
229 (license license:gpl2+)))
230
231 (define-public python-biopython
232 (package
233 (name "python-biopython")
234 (version "1.65")
235 (source (origin
236 (method url-fetch)
237 (uri (string-append
238 "http://biopython.org/DIST/biopython-"
239 version ".tar.gz"))
240 (sha256
241 (base32
242 "13m8s9jkrw40zvdp1rl709n6lmgdh4f52aann7gzr6sfp0fwhg26"))))
243 (build-system python-build-system)
244 (inputs
245 `(("python-numpy" ,python-numpy)))
246 (native-inputs
247 `(("python-setuptools" ,python2-setuptools)))
248 (home-page "http://biopython.org/")
249 (synopsis "Tools for biological computation in Python")
250 (description
251 "Biopython is a set of tools for biological computation including parsers
252 for bioinformatics files into Python data structures; interfaces to common
253 bioinformatics programs; a standard sequence class and tools for performing
254 common operations on them; code to perform data classification; code for
255 dealing with alignments; code making it easy to split up parallelizable tasks
256 into separate processes; and more.")
257 (license (license:non-copyleft "http://www.biopython.org/DIST/LICENSE"))))
258
259 (define-public python2-biopython
260 (package (inherit (package-with-python2 python-biopython))
261 (inputs
262 `(("python2-numpy" ,python2-numpy)))))
263
264 (define-public blast+
265 (package
266 (name "blast+")
267 (version "2.2.31")
268 (source (origin
269 (method url-fetch)
270 (uri (string-append
271 "ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/"
272 version "/ncbi-blast-" version "+-src.tar.gz"))
273 (sha256
274 (base32
275 "19gq6as4k1jrgsd26158ads6h7v4jca3h4r5dzg1y0m6ya50x5ph"))
276 (modules '((guix build utils)))
277 (snippet
278 '(begin
279 ;; Remove bundled bzip2 and zlib
280 (delete-file-recursively "c++/src/util/compress/bzip2")
281 (delete-file-recursively "c++/src/util/compress/zlib")
282 (substitute* "c++/src/util/compress/Makefile.in"
283 (("bzip2 zlib api") "api"))
284 ;; Remove useless msbuild directory
285 (delete-file-recursively
286 "c++/src/build-system/project_tree_builder/msbuild")
287 #t))))
288 (build-system gnu-build-system)
289 (arguments
290 `(;; There are three(!) tests for this massive library, and all fail with
291 ;; "unparsable timing stats".
292 ;; ERR [127] -- [util/regexp] test_pcre.sh (unparsable timing stats)
293 ;; ERR [127] -- [serial/datatool] datatool.sh (unparsable timing stats)
294 ;; ERR [127] -- [serial/datatool] datatool_xml.sh (unparsable timing stats)
295 #:tests? #f
296 #:out-of-source? #t
297 #:parallel-build? #f ; not supported
298 #:phases
299 (modify-phases %standard-phases
300 (add-before
301 'configure 'set-HOME
302 ;; $HOME needs to be set at some point during the configure phase
303 (lambda _ (setenv "HOME" "/tmp") #t))
304 (add-after
305 'unpack 'enter-dir
306 (lambda _ (chdir "c++") #t))
307 (add-after
308 'enter-dir 'fix-build-system
309 (lambda _
310 (define (which* cmd)
311 (cond ((string=? cmd "date")
312 ;; make call to "date" deterministic
313 "date -d @0")
314 ((which cmd)
315 => identity)
316 (else
317 (format (current-error-port)
318 "WARNING: Unable to find absolute path for ~s~%"
319 cmd)
320 #f)))
321
322 ;; Rewrite hardcoded paths to various tools
323 (substitute* (append '("src/build-system/configure.ac"
324 "src/build-system/configure"
325 "scripts/common/impl/if_diff.sh"
326 "scripts/common/impl/run_with_lock.sh"
327 "src/build-system/Makefile.configurables.real"
328 "src/build-system/Makefile.in.top"
329 "src/build-system/Makefile.meta.gmake=no"
330 "src/build-system/Makefile.meta.in"
331 "src/build-system/Makefile.meta_l"
332 "src/build-system/Makefile.meta_p"
333 "src/build-system/Makefile.meta_r"
334 "src/build-system/Makefile.mk.in"
335 "src/build-system/Makefile.requirements"
336 "src/build-system/Makefile.rules_with_autodep.in")
337 (find-files "scripts/common/check" "\\.sh$"))
338 (("(/usr/bin/|/bin/)([a-z][-_.a-z]*)" all dir cmd)
339 (or (which* cmd) all)))
340
341 (substitute* (find-files "src/build-system" "^config.*")
342 (("LN_S=/bin/\\$LN_S") (string-append "LN_S=" (which "ln")))
343 (("^PATH=.*") ""))
344
345 ;; rewrite "/var/tmp" in check script
346 (substitute* "scripts/common/check/check_make_unix.sh"
347 (("/var/tmp") "/tmp"))
348
349 ;; do not reset PATH
350 (substitute* (find-files "scripts/common/impl/" "\\.sh$")
351 (("^ *PATH=.*") "")
352 (("action=/bin/") "action=")
353 (("export PATH") ":"))
354 #t))
355 (replace
356 'configure
357 (lambda* (#:key inputs outputs #:allow-other-keys)
358 (let ((out (assoc-ref outputs "out"))
359 (lib (string-append (assoc-ref outputs "lib") "/lib"))
360 (include (string-append (assoc-ref outputs "include")
361 "/include/ncbi-tools++")))
362 ;; The 'configure' script doesn't recognize things like
363 ;; '--enable-fast-install'.
364 (zero? (system* "./configure.orig"
365 (string-append "--with-build-root=" (getcwd) "/build")
366 (string-append "--prefix=" out)
367 (string-append "--libdir=" lib)
368 (string-append "--includedir=" include)
369 (string-append "--with-bz2="
370 (assoc-ref inputs "bzip2"))
371 (string-append "--with-z="
372 (assoc-ref inputs "zlib"))
373 ;; Each library is built twice by default, once
374 ;; with "-static" in its name, and again
375 ;; without.
376 "--without-static"
377 "--with-dll"))))))))
378 (outputs '("out" ; 19 MB
379 "lib" ; 203 MB
380 "include")) ; 32 MB
381 (inputs
382 `(("bzip2" ,bzip2)
383 ("zlib" ,zlib)))
384 (native-inputs
385 `(("cpio" ,cpio)))
386 (home-page "http://blast.ncbi.nlm.nih.gov")
387 (synopsis "Basic local alignment search tool")
388 (description
389 "BLAST is a popular method of performing a DNA or protein sequence
390 similarity search, using heuristics to produce results quickly. It also
391 calculates an “expect value” that estimates how many matches would have
392 occurred at a given score by chance, which can aid a user in judging how much
393 confidence to have in an alignment.")
394 ;; Most of the sources are in the public domain, with the following
395 ;; exceptions:
396 ;; * Expat:
397 ;; * ./c++/include/util/bitset/
398 ;; * ./c++/src/html/ncbi_menu*.js
399 ;; * Boost license:
400 ;; * ./c++/include/util/impl/floating_point_comparison.hpp
401 ;; * LGPL 2+:
402 ;; * ./c++/include/dbapi/driver/odbc/unix_odbc/
403 ;; * ASL 2.0:
404 ;; * ./c++/src/corelib/teamcity_*
405 (license (list license:public-domain
406 license:expat
407 license:boost1.0
408 license:lgpl2.0+
409 license:asl2.0))))
410
411 (define-public bowtie
412 (package
413 (name "bowtie")
414 (version "2.2.4")
415 (source (origin
416 (method url-fetch)
417 (uri (string-append "https://github.com/BenLangmead/bowtie2/archive/v"
418 version ".tar.gz"))
419 (file-name (string-append name "-" version ".tar.gz"))
420 (sha256
421 (base32
422 "15dnbqippwvhyh9zqjhaxkabk7lm1xbh1nvar1x4b5kwm117zijn"))
423 (modules '((guix build utils)))
424 (snippet
425 '(substitute* "Makefile"
426 (("^CC = .*$") "CC = gcc")
427 (("^CPP = .*$") "CPP = g++")
428 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
429 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
430 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\"")))
431 (patches (list (search-patch "bowtie-fix-makefile.patch")))))
432 (build-system gnu-build-system)
433 (inputs `(("perl" ,perl)
434 ("perl-clone" ,perl-clone)
435 ("perl-test-deep" ,perl-test-deep)
436 ("perl-test-simple" ,perl-test-simple)
437 ("python" ,python-2)))
438 (arguments
439 '(#:make-flags '("allall")
440 #:phases
441 (alist-delete
442 'configure
443 (alist-replace
444 'install
445 (lambda* (#:key outputs #:allow-other-keys)
446 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
447 (mkdir-p bin)
448 (for-each (lambda (file)
449 (copy-file file (string-append bin file)))
450 (find-files "." "bowtie2.*"))))
451 (alist-replace
452 'check
453 (lambda* (#:key outputs #:allow-other-keys)
454 (system* "perl"
455 "scripts/test/simple_tests.pl"
456 "--bowtie2=./bowtie2"
457 "--bowtie2-build=./bowtie2-build"))
458 %standard-phases)))))
459 (home-page "http://bowtie-bio.sourceforge.net/bowtie2/index.shtml")
460 (synopsis "Fast and sensitive nucleotide sequence read aligner")
461 (description
462 "Bowtie 2 is a fast and memory-efficient tool for aligning sequencing
463 reads to long reference sequences. It is particularly good at aligning reads
464 of about 50 up to 100s or 1,000s of characters, and particularly good at
465 aligning to relatively long (e.g. mammalian) genomes. Bowtie 2 indexes the
466 genome with an FM Index to keep its memory footprint small: for the human
467 genome, its memory footprint is typically around 3.2 GB. Bowtie 2 supports
468 gapped, local, and paired-end alignment modes.")
469 (supported-systems '("x86_64-linux"))
470 (license license:gpl3+)))
471
472 (define-public bwa
473 (package
474 (name "bwa")
475 (version "0.7.12")
476 (source (origin
477 (method url-fetch)
478 (uri (string-append "mirror://sourceforge/bio-bwa/bwa-"
479 version ".tar.bz2"))
480 (sha256
481 (base32
482 "1330dpqncv0px3pbhjzz1gwgg39kkcv2r9qp2xs0sixf8z8wl7bh"))))
483 (build-system gnu-build-system)
484 (arguments
485 '(#:tests? #f ;no "check" target
486 #:phases
487 (alist-replace
488 'install
489 (lambda* (#:key outputs #:allow-other-keys)
490 (let ((bin (string-append
491 (assoc-ref outputs "out") "/bin"))
492 (doc (string-append
493 (assoc-ref outputs "out") "/share/doc/bwa"))
494 (man (string-append
495 (assoc-ref outputs "out") "/share/man/man1")))
496 (mkdir-p bin)
497 (mkdir-p doc)
498 (mkdir-p man)
499 (copy-file "bwa" (string-append bin "/bwa"))
500 (copy-file "README.md" (string-append doc "/README.md"))
501 (copy-file "bwa.1" (string-append man "/bwa.1"))))
502 ;; no "configure" script
503 (alist-delete 'configure %standard-phases))))
504 (inputs `(("zlib" ,zlib)))
505 (home-page "http://bio-bwa.sourceforge.net/")
506 (synopsis "Burrows-Wheeler sequence aligner")
507 (description
508 "BWA is a software package for mapping low-divergent sequences against a
509 large reference genome, such as the human genome. It consists of three
510 algorithms: BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm is
511 designed for Illumina sequence reads up to 100bp, while the rest two for
512 longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar
513 features such as long-read support and split alignment, but BWA-MEM, which is
514 the latest, is generally recommended for high-quality queries as it is faster
515 and more accurate. BWA-MEM also has better performance than BWA-backtrack for
516 70-100bp Illumina reads.")
517 (license license:gpl3+)))
518
519 (define-public python2-bx-python
520 (package
521 (name "python2-bx-python")
522 (version "0.7.2")
523 (source (origin
524 (method url-fetch)
525 (uri (string-append
526 "https://pypi.python.org/packages/source/b/bx-python/bx-python-"
527 version ".tar.gz"))
528 (sha256
529 (base32
530 "0ld49idhc5zjdvbhvjq1a2qmpjj7h5v58rqr25dzmfq7g34b50xh"))
531 (modules '((guix build utils)))
532 (snippet
533 '(substitute* "setup.py"
534 ;; remove dependency on outdated "distribute" module
535 (("^from distribute_setup import use_setuptools") "")
536 (("^use_setuptools\\(\\)") "")))))
537 (build-system python-build-system)
538 (arguments
539 `(#:tests? #f ;tests fail because test data are not included
540 #:python ,python-2))
541 (inputs
542 `(("python-numpy" ,python2-numpy)
543 ("zlib" ,zlib)))
544 (native-inputs
545 `(("python-nose" ,python2-nose)
546 ("python-setuptools" ,python2-setuptools)))
547 (home-page "http://bitbucket.org/james_taylor/bx-python/")
548 (synopsis "Tools for manipulating biological data")
549 (description
550 "bx-python provides tools for manipulating biological data, particularly
551 multiple sequence alignments.")
552 (license license:expat)))
553
554 (define-public clipper
555 (package
556 (name "clipper")
557 (version "0.3.0")
558 (source (origin
559 (method url-fetch)
560 (uri (string-append
561 "https://github.com/YeoLab/clipper/archive/"
562 version ".tar.gz"))
563 (sha256
564 (base32
565 "1q7jpimsqln7ic44i8v2rx2haj5wvik8hc1s2syd31zcn0xk1iyq"))
566 (modules '((guix build utils)))
567 (snippet
568 ;; remove unnecessary setup dependency
569 '(substitute* "setup.py"
570 (("setup_requires = .*") "")))))
571 (build-system python-build-system)
572 (arguments `(#:python ,python-2)) ; only Python 2 is supported
573 (inputs
574 `(("htseq" ,htseq)
575 ("python-pybedtools" ,python2-pybedtools)
576 ("python-cython" ,python2-cython)
577 ("python-scikit-learn" ,python2-scikit-learn)
578 ("python-matplotlib" ,python2-matplotlib)
579 ("python-pysam" ,python2-pysam)
580 ("python-numpy" ,python2-numpy)
581 ("python-scipy" ,python2-scipy)))
582 (native-inputs
583 `(("python-mock" ,python2-mock) ; for tests
584 ("python-pytz" ,python2-pytz) ; for tests
585 ("python-setuptools" ,python2-setuptools)))
586 (home-page "https://github.com/YeoLab/clipper")
587 (synopsis "CLIP peak enrichment recognition")
588 (description
589 "CLIPper is a tool to define peaks in CLIP-seq datasets.")
590 (license license:gpl2)))
591
592 (define-public couger
593 (package
594 (name "couger")
595 (version "1.8.2")
596 (source (origin
597 (method url-fetch)
598 (uri (string-append
599 "http://couger.oit.duke.edu/static/assets/COUGER"
600 version ".zip"))
601 (sha256
602 (base32
603 "04p2b14nmhzxw5h72mpzdhalv21bx4w9b87z0wpw0xzxpysyncmq"))))
604 (build-system gnu-build-system)
605 (arguments
606 `(#:tests? #f
607 #:phases
608 (modify-phases %standard-phases
609 (delete 'configure)
610 (delete 'build)
611 (replace
612 'install
613 (lambda* (#:key outputs #:allow-other-keys)
614 (let ((out (assoc-ref outputs "out")))
615 (copy-recursively "src" (string-append out "/src"))
616 (mkdir (string-append out "/bin"))
617 ;; Add "src" directory to module lookup path.
618 (substitute* "couger"
619 (("from argparse")
620 (string-append "import sys\nsys.path.append(\""
621 out "\")\nfrom argparse")))
622 (copy-file "couger" (string-append out "/bin/couger")))
623 #t))
624 (add-after
625 'install 'wrap-program
626 (lambda* (#:key inputs outputs #:allow-other-keys)
627 ;; Make sure 'couger' runs with the correct PYTHONPATH.
628 (let* ((out (assoc-ref outputs "out"))
629 (path (getenv "PYTHONPATH")))
630 (wrap-program (string-append out "/bin/couger")
631 `("PYTHONPATH" ":" prefix (,path))))
632 #t)))))
633 (inputs
634 `(("python" ,python-2)
635 ("python2-pillow" ,python2-pillow)
636 ("python2-numpy" ,python2-numpy)
637 ("python2-scipy" ,python2-scipy)
638 ("python2-matplotlib" ,python2-matplotlib)))
639 (propagated-inputs
640 `(("r" ,r)
641 ("libsvm" ,libsvm)
642 ("randomjungle" ,randomjungle)))
643 (native-inputs
644 `(("unzip" ,unzip)))
645 (home-page "http://couger.oit.duke.edu")
646 (synopsis "Identify co-factors in sets of genomic regions")
647 (description
648 "COUGER can be applied to any two sets of genomic regions bound by
649 paralogous TFs (e.g., regions derived from ChIP-seq experiments) to identify
650 putative co-factors that provide specificity to each TF. The framework
651 determines the genomic targets uniquely-bound by each TF, and identifies a
652 small set of co-factors that best explain the in vivo binding differences
653 between the two TFs.
654
655 COUGER uses classification algorithms (support vector machines and random
656 forests) with features that reflect the DNA binding specificities of putative
657 co-factors. The features are generated either from high-throughput TF-DNA
658 binding data (from protein binding microarray experiments), or from large
659 collections of DNA motifs.")
660 (license license:gpl3+)))
661
662 (define-public clustal-omega
663 (package
664 (name "clustal-omega")
665 (version "1.2.1")
666 (source (origin
667 (method url-fetch)
668 (uri (string-append
669 "http://www.clustal.org/omega/clustal-omega-"
670 version ".tar.gz"))
671 (sha256
672 (base32
673 "02ibkx0m0iwz8nscg998bh41gg251y56cgh86bvyrii5m8kjgwqf"))))
674 (build-system gnu-build-system)
675 (inputs
676 `(("argtable" ,argtable)))
677 (home-page "http://www.clustal.org/omega/")
678 (synopsis "Multiple sequence aligner for protein and DNA/RNA")
679 (description
680 "Clustal-Omega is a general purpose multiple sequence alignment (MSA)
681 program for protein and DNA/RNA. It produces high quality MSAs and is capable
682 of handling data-sets of hundreds of thousands of sequences in reasonable
683 time.")
684 (license license:gpl2+)))
685
686 (define-public crossmap
687 (package
688 (name "crossmap")
689 (version "0.1.6")
690 (source (origin
691 (method url-fetch)
692 (uri (string-append "mirror://sourceforge/crossmap/CrossMap-"
693 version ".tar.gz"))
694 (sha256
695 (base32
696 "163hi5gjgij6cndxlvbkp5jjwr0k4wbm9im6d2210278q7k9kpnp"))
697 ;; patch has been sent upstream already
698 (patches (list
699 (search-patch "crossmap-allow-system-pysam.patch")))
700 (modules '((guix build utils)))
701 ;; remove bundled copy of pysam
702 (snippet
703 '(delete-file-recursively "lib/pysam"))))
704 (build-system python-build-system)
705 (arguments
706 `(#:python ,python-2
707 #:phases
708 (alist-cons-after
709 'unpack 'set-env
710 (lambda _ (setenv "CROSSMAP_USE_SYSTEM_PYSAM" "1"))
711 %standard-phases)))
712 (inputs
713 `(("python-numpy" ,python2-numpy)
714 ("python-pysam" ,python2-pysam)
715 ("zlib" ,zlib)))
716 (native-inputs
717 `(("python-cython" ,python2-cython)
718 ("python-nose" ,python2-nose)
719 ("python-setuptools" ,python2-setuptools)))
720 (home-page "http://crossmap.sourceforge.net/")
721 (synopsis "Convert genome coordinates between assemblies")
722 (description
723 "CrossMap is a program for conversion of genome coordinates or annotation
724 files between different genome assemblies. It supports most commonly used
725 file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.")
726 (license license:gpl2+)))
727
728 (define-public cutadapt
729 (package
730 (name "cutadapt")
731 (version "1.8")
732 (source (origin
733 (method url-fetch)
734 (uri (string-append
735 "https://github.com/marcelm/cutadapt/archive/v"
736 version ".tar.gz"))
737 (file-name (string-append name "-" version ".tar.gz"))
738 (sha256
739 (base32
740 "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5"))))
741 (build-system python-build-system)
742 (arguments
743 ;; tests must be run after install
744 `(#:phases (alist-cons-after
745 'install 'check
746 (lambda* (#:key inputs outputs #:allow-other-keys)
747 (setenv "PYTHONPATH"
748 (string-append
749 (getenv "PYTHONPATH")
750 ":" (assoc-ref outputs "out")
751 "/lib/python"
752 (string-take (string-take-right
753 (assoc-ref inputs "python") 5) 3)
754 "/site-packages"))
755 (zero? (system* "nosetests" "-P" "tests")))
756 (alist-delete 'check %standard-phases))))
757 (native-inputs
758 `(("python-cython" ,python-cython)
759 ("python-nose" ,python-nose)
760 ("python-setuptools" ,python-setuptools)))
761 (home-page "https://code.google.com/p/cutadapt/")
762 (synopsis "Remove adapter sequences from nucleotide sequencing reads")
763 (description
764 "Cutadapt finds and removes adapter sequences, primers, poly-A tails and
765 other types of unwanted sequence from high-throughput sequencing reads.")
766 (license license:expat)))
767
768 (define-public diamond
769 (package
770 (name "diamond")
771 (version "0.7.9")
772 (source (origin
773 (method url-fetch)
774 (uri (string-append
775 "https://github.com/bbuchfink/diamond/archive/v"
776 version ".tar.gz"))
777 (file-name (string-append name "-" version ".tar.gz"))
778 (sha256
779 (base32
780 "0hfkcfv9f76h5brbyw9fyvmc0l9cmbsxrcdqk0fa9xv82zj47p15"))
781 (snippet '(begin
782 (delete-file "bin/diamond")
783 #t))))
784 (build-system gnu-build-system)
785 (arguments
786 '(#:tests? #f ;no "check" target
787 #:phases
788 (modify-phases %standard-phases
789 (add-after 'unpack 'enter-source-dir
790 (lambda _
791 (chdir "src")
792 #t))
793 (delete 'configure)
794 (replace 'install
795 (lambda* (#:key outputs #:allow-other-keys)
796 (let ((bin (string-append (assoc-ref outputs "out")
797 "/bin")))
798 (mkdir-p bin)
799 (copy-file "../bin/diamond"
800 (string-append bin "/diamond"))
801 #t))))))
802 (native-inputs
803 `(("bc" ,bc)))
804 (inputs
805 `(("boost" ,boost)
806 ("zlib" ,zlib)))
807 (home-page "https://github.com/bbuchfink/diamond")
808 (synopsis "Accelerated BLAST compatible local sequence aligner")
809 (description
810 "DIAMOND is a BLAST-compatible local aligner for mapping protein and
811 translated DNA query sequences against a protein reference database (BLASTP
812 and BLASTX alignment mode). The speedup over BLAST is up to 20,000 on short
813 reads at a typical sensitivity of 90-99% relative to BLAST depending on the
814 data and settings.")
815 (license (license:non-copyleft "file://src/COPYING"
816 "See src/COPYING in the distribution."))))
817
818 (define-public edirect
819 (package
820 (name "edirect")
821 (version "2.50")
822 (source (origin
823 (method url-fetch)
824 ;; Note: older versions are not retained.
825 (uri "ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/edirect.zip")
826 (sha256
827 (base32
828 "08afhz2ph66h8h381hl1mqyxkdi5nbvzsyj9gfw3jfbdijnpi4qj"))))
829 (build-system perl-build-system)
830 (arguments
831 `(#:tests? #f ;no "check" target
832 #:phases
833 (modify-phases %standard-phases
834 (delete 'configure)
835 (delete 'build)
836 (replace 'install
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let ((target (string-append (assoc-ref outputs "out")
839 "/bin")))
840 (mkdir-p target)
841 (copy-file "edirect.pl"
842 (string-append target "/edirect.pl"))
843 #t)))
844 (add-after
845 'install 'wrap-program
846 (lambda* (#:key inputs outputs #:allow-other-keys)
847 ;; Make sure 'edirect.pl' finds all perl inputs at runtime.
848 (let* ((out (assoc-ref outputs "out"))
849 (path (getenv "PERL5LIB")))
850 (wrap-program (string-append out "/bin/edirect.pl")
851 `("PERL5LIB" ":" prefix (,path)))))))))
852 (inputs
853 `(("perl-html-parser" ,perl-html-parser)
854 ("perl-encode-locale" ,perl-encode-locale)
855 ("perl-file-listing" ,perl-file-listing)
856 ("perl-html-tagset" ,perl-html-tagset)
857 ("perl-html-tree" ,perl-html-tree)
858 ("perl-http-cookies" ,perl-http-cookies)
859 ("perl-http-date" ,perl-http-date)
860 ("perl-http-message" ,perl-http-message)
861 ("perl-http-negotiate" ,perl-http-negotiate)
862 ("perl-lwp-mediatypes" ,perl-lwp-mediatypes)
863 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
864 ("perl-net-http" ,perl-net-http)
865 ("perl-uri" ,perl-uri)
866 ("perl-www-robotrules" ,perl-www-robotrules)
867 ("perl" ,perl)))
868 (native-inputs
869 `(("unzip" ,unzip)))
870 (home-page "http://www.ncbi.nlm.nih.gov/books/NBK179288")
871 (synopsis "Tools for accessing the NCBI's set of databases")
872 (description
873 "Entrez Direct (EDirect) is a method for accessing the National Center
874 for Biotechnology Information's (NCBI) set of interconnected
875 databases (publication, sequence, structure, gene, variation, expression,
876 etc.) from a terminal. Functions take search terms from command-line
877 arguments. Individual operations are combined to build multi-step queries.
878 Record retrieval and formatting normally complete the process.
879
880 EDirect also provides an argument-driven function that simplifies the
881 extraction of data from document summaries or other results that are returned
882 in structured XML format. This can eliminate the need for writing custom
883 software to answer ad hoc questions.")
884 (license license:public-domain)))
885
886 (define-public express
887 (package
888 (name "express")
889 (version "1.5.1")
890 (source (origin
891 (method url-fetch)
892 (uri
893 (string-append
894 "http://bio.math.berkeley.edu/eXpress/downloads/express-"
895 version "/express-" version "-src.tgz"))
896 (sha256
897 (base32
898 "03rczxd0gjp2l1jxcmjfmf5j94j77zqyxa6x063zsc585nj40n0c"))))
899 (build-system cmake-build-system)
900 (arguments
901 `(#:tests? #f ;no "check" target
902 #:phases
903 (alist-cons-after
904 'unpack 'use-shared-boost-libs-and-set-bamtools-paths
905 (lambda* (#:key inputs #:allow-other-keys)
906 (substitute* "CMakeLists.txt"
907 (("set\\(Boost_USE_STATIC_LIBS ON\\)")
908 "set(Boost_USE_STATIC_LIBS OFF)")
909 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/bamtools/include")
910 (string-append (assoc-ref inputs "bamtools") "/include/bamtools")))
911 (substitute* "src/CMakeLists.txt"
912 (("\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/\\.\\./bamtools/lib")
913 (string-append (assoc-ref inputs "bamtools") "/lib/bamtools")))
914 #t)
915 %standard-phases)))
916 (inputs
917 `(("boost" ,boost)
918 ("bamtools" ,bamtools)
919 ("protobuf" ,protobuf)
920 ("zlib" ,zlib)))
921 (home-page "http://bio.math.berkeley.edu/eXpress")
922 (synopsis "Streaming quantification for high-throughput genomic sequencing")
923 (description
924 "eXpress is a streaming tool for quantifying the abundances of a set of
925 target sequences from sampled subsequences. Example applications include
926 transcript-level RNA-Seq quantification, allele-specific/haplotype expression
927 analysis (from RNA-Seq), transcription factor binding quantification in
928 ChIP-Seq, and analysis of metagenomic data.")
929 (license license:artistic2.0)))
930
931 (define-public fasttree
932 (package
933 (name "fasttree")
934 (version "2.1.8")
935 (source (origin
936 (method url-fetch)
937 (uri (string-append
938 "http://www.microbesonline.org/fasttree/FastTree-"
939 version ".c"))
940 (sha256
941 (base32
942 "0dzqc9vr9iiiw21y159xfjl2z90vw0y7r4x6456pcaxiy5hd2wmi"))))
943 (build-system gnu-build-system)
944 (arguments
945 `(#:tests? #f ; no "check" target
946 #:phases
947 (modify-phases %standard-phases
948 (delete 'unpack)
949 (delete 'configure)
950 (replace 'build
951 (lambda* (#:key source #:allow-other-keys)
952 (and (zero? (system* "gcc"
953 "-O3"
954 "-finline-functions"
955 "-funroll-loops"
956 "-Wall"
957 "-o"
958 "FastTree"
959 source
960 "-lm"))
961 (zero? (system* "gcc"
962 "-DOPENMP"
963 "-fopenmp"
964 "-O3"
965 "-finline-functions"
966 "-funroll-loops"
967 "-Wall"
968 "-o"
969 "FastTreeMP"
970 source
971 "-lm")))))
972 (replace 'install
973 (lambda* (#:key outputs #:allow-other-keys)
974 (let ((bin (string-append (assoc-ref outputs "out")
975 "/bin")))
976 (mkdir-p bin)
977 (copy-file "FastTree"
978 (string-append bin "/FastTree"))
979 (copy-file "FastTreeMP"
980 (string-append bin "/FastTreeMP"))
981 #t))))))
982 (home-page "http://www.microbesonline.org/fasttree")
983 (synopsis "Infers approximately-maximum-likelihood phylogenetic trees")
984 (description
985 "FastTree can handle alignments with up to a million of sequences in a
986 reasonable amount of time and memory. For large alignments, FastTree is
987 100-1,000 times faster than PhyML 3.0 or RAxML 7.")
988 (license license:gpl2+)))
989
990 (define-public fastx-toolkit
991 (package
992 (name "fastx-toolkit")
993 (version "0.0.14")
994 (source (origin
995 (method url-fetch)
996 (uri
997 (string-append
998 "https://github.com/agordon/fastx_toolkit/releases/download/"
999 version "/fastx_toolkit-" version ".tar.bz2"))
1000 (sha256
1001 (base32
1002 "01jqzw386873sr0pjp1wr4rn8fsga2vxs1qfmicvx1pjr72007wy"))))
1003 (build-system gnu-build-system)
1004 (inputs
1005 `(("libgtextutils" ,libgtextutils)))
1006 (native-inputs
1007 `(("pkg-config" ,pkg-config)))
1008 (home-page "http://hannonlab.cshl.edu/fastx_toolkit/")
1009 (synopsis "Tools for FASTA/FASTQ file preprocessing")
1010 (description
1011 "The FASTX-Toolkit is a collection of command line tools for Short-Reads
1012 FASTA/FASTQ files preprocessing.
1013
1014 Next-Generation sequencing machines usually produce FASTA or FASTQ files,
1015 containing multiple short-reads sequences. The main processing of such
1016 FASTA/FASTQ files is mapping the sequences to reference genomes. However, it
1017 is sometimes more productive to preprocess the files before mapping the
1018 sequences to the genome---manipulating the sequences to produce better mapping
1019 results. The FASTX-Toolkit tools perform some of these preprocessing tasks.")
1020 (license license:agpl3+)))
1021
1022 (define-public flexbar
1023 (package
1024 (name "flexbar")
1025 (version "2.5")
1026 (source (origin
1027 (method url-fetch)
1028 (uri
1029 (string-append "mirror://sourceforge/flexbar/"
1030 version "/flexbar_v" version "_src.tgz"))
1031 (sha256
1032 (base32
1033 "13jaykc3y1x8y5nn9j8ljnb79s5y51kyxz46hdmvvjj6qhyympmf"))))
1034 (build-system cmake-build-system)
1035 (arguments
1036 `(#:configure-flags (list
1037 (string-append "-DFLEXBAR_BINARY_DIR="
1038 (assoc-ref %outputs "out")
1039 "/bin/"))
1040 #:phases
1041 (alist-replace
1042 'check
1043 (lambda* (#:key outputs #:allow-other-keys)
1044 (setenv "PATH" (string-append
1045 (assoc-ref outputs "out") "/bin:"
1046 (getenv "PATH")))
1047 (chdir "../flexbar_v2.5_src/test")
1048 (zero? (system* "bash" "flexbar_validate.sh")))
1049 (alist-delete 'install %standard-phases))))
1050 (inputs
1051 `(("tbb" ,tbb)
1052 ("zlib" ,zlib)))
1053 (native-inputs
1054 `(("pkg-config" ,pkg-config)
1055 ("seqan" ,seqan)))
1056 (home-page "http://flexbar.sourceforge.net")
1057 (synopsis "Barcode and adapter removal tool for sequencing platforms")
1058 (description
1059 "Flexbar preprocesses high-throughput nucleotide sequencing data
1060 efficiently. It demultiplexes barcoded runs and removes adapter sequences.
1061 Moreover, trimming and filtering features are provided. Flexbar increases
1062 read mapping rates and improves genome and transcriptome assemblies. It
1063 supports next-generation sequencing data in fasta/q and csfasta/q format from
1064 Illumina, Roche 454, and the SOLiD platform.")
1065 (license license:gpl3)))
1066
1067 (define-public grit
1068 (package
1069 (name "grit")
1070 (version "2.0.2")
1071 (source (origin
1072 (method url-fetch)
1073 (uri (string-append
1074 "https://github.com/nboley/grit/archive/"
1075 version ".tar.gz"))
1076 (file-name (string-append name "-" version ".tar.gz"))
1077 (sha256
1078 (base32
1079 "157in84dj70wimbind3x7sy1whs3h57qfgcnj2s6lrd38fbrb7mj"))))
1080 (build-system python-build-system)
1081 (arguments
1082 `(#:python ,python-2
1083 #:phases
1084 (alist-cons-after
1085 'unpack 'generate-from-cython-sources
1086 (lambda* (#:key inputs outputs #:allow-other-keys)
1087 ;; Delete these C files to force fresh generation from pyx sources.
1088 (delete-file "grit/sparsify_support_fns.c")
1089 (delete-file "grit/call_peaks_support_fns.c")
1090 (substitute* "setup.py"
1091 (("Cython.Setup") "Cython.Build")
1092 ;; Add numpy include path to fix compilation
1093 (("pyx\", \\]")
1094 (string-append "pyx\", ], include_dirs = ['"
1095 (assoc-ref inputs "python-numpy")
1096 "/lib/python2.7/site-packages/numpy/core/include/"
1097 "']"))) #t)
1098 %standard-phases)))
1099 (inputs
1100 `(("python-scipy" ,python2-scipy)
1101 ("python-numpy" ,python2-numpy)
1102 ("python-pysam" ,python2-pysam)
1103 ("python-networkx" ,python2-networkx)))
1104 (native-inputs
1105 `(("python-cython" ,python2-cython)
1106 ("python-setuptools" ,python2-setuptools)))
1107 (home-page "http://grit-bio.org")
1108 (synopsis "Tool for integrative analysis of RNA-seq type assays")
1109 (description
1110 "GRIT is designed to use RNA-seq, TES, and TSS data to build and quantify
1111 full length transcript models. When none of these data sources are available,
1112 GRIT can be run by providing a candidate set of TES or TSS sites. In
1113 addition, GRIT can merge in reference junctions and gene boundaries. GRIT can
1114 also be run in quantification mode, where it uses a provided GTF file and just
1115 estimates transcript expression.")
1116 (license license:gpl3+)))
1117
1118 (define-public hisat
1119 (package
1120 (name "hisat")
1121 (version "0.1.4")
1122 (source (origin
1123 (method url-fetch)
1124 (uri (string-append
1125 "http://ccb.jhu.edu/software/hisat/downloads/hisat-"
1126 version "-beta-source.zip"))
1127 (sha256
1128 (base32
1129 "1k381ydranqxp09yf2y7w1d0chz5d59vb6jchi89hbb0prq19lk5"))))
1130 (build-system gnu-build-system)
1131 (arguments
1132 `(#:tests? #f ;no check target
1133 #:make-flags '("allall"
1134 ;; Disable unsupported `popcnt' instructions on
1135 ;; architectures other than x86_64
1136 ,@(if (string-prefix? "x86_64"
1137 (or (%current-target-system)
1138 (%current-system)))
1139 '()
1140 '("POPCNT_CAPABILITY=0")))
1141 #:phases
1142 (alist-cons-after
1143 'unpack 'patch-sources
1144 (lambda _
1145 ;; XXX Cannot use snippet because zip files are not supported
1146 (substitute* "Makefile"
1147 (("^CC = .*$") "CC = gcc")
1148 (("^CPP = .*$") "CPP = g++")
1149 ;; replace BUILD_HOST and BUILD_TIME for deterministic build
1150 (("-DBUILD_HOST=.*") "-DBUILD_HOST=\"\\\"guix\\\"\"")
1151 (("-DBUILD_TIME=.*") "-DBUILD_TIME=\"\\\"0\\\"\""))
1152 (substitute* '("hisat-build" "hisat-inspect")
1153 (("/usr/bin/env") (which "env"))))
1154 (alist-replace
1155 'install
1156 (lambda* (#:key outputs #:allow-other-keys)
1157 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
1158 (mkdir-p bin)
1159 (for-each
1160 (lambda (file)
1161 (copy-file file (string-append bin file)))
1162 (find-files
1163 "."
1164 "hisat(-(build|align|inspect)(-(s|l)(-debug)*)*)*$"))))
1165 (alist-delete 'configure %standard-phases)))))
1166 (native-inputs
1167 `(("unzip" ,unzip)))
1168 (inputs
1169 `(("perl" ,perl)
1170 ("python" ,python)
1171 ("zlib" ,zlib)))
1172 (home-page "http://ccb.jhu.edu/software/hisat/index.shtml")
1173 (synopsis "Hierarchical indexing for spliced alignment of transcripts")
1174 (description
1175 "HISAT is a fast and sensitive spliced alignment program for mapping
1176 RNA-seq reads. In addition to one global FM index that represents a whole
1177 genome, HISAT uses a large set of small FM indexes that collectively cover the
1178 whole genome. These small indexes (called local indexes) combined with
1179 several alignment strategies enable effective alignment of RNA-seq reads, in
1180 particular, reads spanning multiple exons.")
1181 (license license:gpl3+)))
1182
1183 (define-public hmmer
1184 (package
1185 (name "hmmer")
1186 (version "3.1b2")
1187 (source (origin
1188 (method url-fetch)
1189 (uri (string-append
1190 "http://selab.janelia.org/software/hmmer"
1191 (version-prefix version 1) "/"
1192 version "/hmmer-" version ".tar.gz"))
1193 (sha256
1194 (base32
1195 "0djmgc0pfli0jilfx8hql1axhwhqxqb8rxg2r5rg07aw73sfs5nx"))))
1196 (build-system gnu-build-system)
1197 (native-inputs `(("perl", perl)))
1198 (home-page "http://hmmer.janelia.org")
1199 (synopsis "Biosequence analysis using profile hidden Markov models")
1200 (description
1201 "HMMER is used for searching sequence databases for homologs of protein
1202 sequences, and for making protein sequence alignments. It implements methods
1203 using probabilistic models called profile hidden Markov models (profile
1204 HMMs).")
1205 (license (list license:gpl3+
1206 ;; The bundled library 'easel' is distributed
1207 ;; under The Janelia Farm Software License.
1208 (license:non-copyleft
1209 "file://easel/LICENSE"
1210 "See easel/LICENSE in the distribution.")))))
1211
1212 (define-public htseq
1213 (package
1214 (name "htseq")
1215 (version "0.6.1")
1216 (source (origin
1217 (method url-fetch)
1218 (uri (string-append
1219 "https://pypi.python.org/packages/source/H/HTSeq/HTSeq-"
1220 version ".tar.gz"))
1221 (sha256
1222 (base32
1223 "1i85ppf2j2lj12m0x690qq5nn17xxk23pbbx2c83r8ayb5wngzwv"))))
1224 (build-system python-build-system)
1225 (arguments `(#:python ,python-2)) ; only Python 2 is supported
1226 (inputs
1227 `(("python-numpy" ,python2-numpy)
1228 ("python-setuptools" ,python2-setuptools)))
1229 (home-page "http://www-huber.embl.de/users/anders/HTSeq/")
1230 (synopsis "Analysing high-throughput sequencing data with Python")
1231 (description
1232 "HTSeq is a Python package that provides infrastructure to process data
1233 from high-throughput sequencing assays.")
1234 (license license:gpl3+)))
1235
1236 (define-public htsjdk
1237 (package
1238 (name "htsjdk")
1239 (version "1.129")
1240 (source (origin
1241 (method url-fetch)
1242 (uri (string-append
1243 "https://github.com/samtools/htsjdk/archive/"
1244 version ".tar.gz"))
1245 (file-name (string-append name "-" version ".tar.gz"))
1246 (sha256
1247 (base32
1248 "0asdk9b8jx2ij7yd6apg9qx03li8q7z3ml0qy2r2qczkra79y6fw"))
1249 (modules '((guix build utils)))
1250 ;; remove build dependency on git
1251 (snippet '(substitute* "build.xml"
1252 (("failifexecutionfails=\"true\"")
1253 "failifexecutionfails=\"false\"")))))
1254 (build-system gnu-build-system)
1255 (arguments
1256 `(#:modules ((srfi srfi-1)
1257 (guix build gnu-build-system)
1258 (guix build utils))
1259 #:phases (alist-replace
1260 'build
1261 (lambda _
1262 (setenv "JAVA_HOME" (assoc-ref %build-inputs "jdk"))
1263 (zero? (system* "ant" "all"
1264 (string-append "-Ddist="
1265 (assoc-ref %outputs "out")
1266 "/share/java/htsjdk/"))))
1267 (fold alist-delete %standard-phases
1268 '(configure install check)))))
1269 (native-inputs
1270 `(("ant" ,ant)
1271 ("jdk" ,icedtea6 "jdk")))
1272 (home-page "http://samtools.github.io/htsjdk/")
1273 (synopsis "Java API for high-throughput sequencing data (HTS) formats")
1274 (description
1275 "HTSJDK is an implementation of a unified Java library for accessing
1276 common file formats, such as SAM and VCF, used for high-throughput
1277 sequencing (HTS) data. There are also an number of useful utilities for
1278 manipulating HTS data.")
1279 (license license:expat)))
1280
1281 (define-public htslib
1282 (package
1283 (name "htslib")
1284 (version "1.2.1")
1285 (source (origin
1286 (method url-fetch)
1287 (uri (string-append
1288 "https://github.com/samtools/htslib/releases/download/"
1289 version "/htslib-" version ".tar.bz2"))
1290 (sha256
1291 (base32
1292 "1c32ssscbnjwfw3dra140fq7riarp2x990qxybh34nr1p5r17nxx"))))
1293 (build-system gnu-build-system)
1294 (arguments
1295 `(#:phases
1296 (modify-phases %standard-phases
1297 (add-after
1298 'unpack 'patch-tests
1299 (lambda _
1300 (substitute* "test/test.pl"
1301 (("/bin/bash") (which "bash")))
1302 #t)))))
1303 (inputs
1304 `(("zlib" ,zlib)))
1305 (native-inputs
1306 `(("perl" ,perl)))
1307 (home-page "http://www.htslib.org")
1308 (synopsis "C library for reading/writing high-throughput sequencing data")
1309 (description
1310 "HTSlib is a C library for reading/writing high-throughput sequencing
1311 data. It also provides the bgzip, htsfile, and tabix utilities.")
1312 ;; Files under cram/ are released under the modified BSD license;
1313 ;; the rest is released under the Expat license
1314 (license (list license:expat license:bsd-3))))
1315
1316 (define-public idr
1317 (package
1318 (name "idr")
1319 (version "2.0.0")
1320 (source (origin
1321 (method url-fetch)
1322 (uri (string-append
1323 "https://github.com/nboley/idr/archive/"
1324 version ".tar.gz"))
1325 (file-name (string-append name "-" version ".tar.gz"))
1326 (sha256
1327 (base32
1328 "1k3x44biak00aiv3hpm1yd6nn4hhp7n0qnbs3zh2q9sw7qr1qj5r"))))
1329 (build-system python-build-system)
1330 (arguments
1331 `(#:phases
1332 (modify-phases %standard-phases
1333 (add-after
1334 'install 'wrap-program
1335 (lambda* (#:key inputs outputs #:allow-other-keys)
1336 (let* ((out (assoc-ref outputs "out"))
1337 (python-version (string-take (string-take-right
1338 (assoc-ref inputs "python") 5) 3))
1339 (path (string-join
1340 (map (lambda (name)
1341 (string-append (assoc-ref inputs name)
1342 "/lib/python" python-version
1343 "/site-packages"))
1344 '("python-scipy"
1345 "python-numpy"
1346 "python-matplotlib"))
1347 ":")))
1348 (wrap-program (string-append out "/bin/idr")
1349 `("PYTHONPATH" ":" prefix (,path))))
1350 #t)))))
1351 (inputs
1352 `(("python-scipy" ,python-scipy)
1353 ("python-numpy" ,python-numpy)
1354 ("python-matplotlib" ,python-matplotlib)))
1355 (native-inputs
1356 `(("python-cython" ,python-cython)
1357 ("python-setuptools" ,python-setuptools)))
1358 (home-page "https://github.com/nboley/idr")
1359 (synopsis "Tool to measure the irreproducible discovery rate (IDR)")
1360 (description
1361 "The IDR (Irreproducible Discovery Rate) framework is a unified approach
1362 to measure the reproducibility of findings identified from replicate
1363 experiments and provide highly stable thresholds based on reproducibility.")
1364 (license license:gpl3+)))
1365
1366 (define-public macs
1367 (package
1368 (name "macs")
1369 (version "2.1.0.20140616")
1370 (source (origin
1371 (method url-fetch)
1372 (uri (string-append
1373 "https://pypi.python.org/packages/source/M/MACS2/MACS2-"
1374 version ".tar.gz"))
1375 (sha256
1376 (base32
1377 "11lmiw6avqhwn75sn59g4lfkrr2kk20r3rgfbx9xfqb8rg9mi2n6"))))
1378 (build-system python-build-system)
1379 (arguments
1380 `(#:python ,python-2 ; only compatible with Python 2.7
1381 #:tests? #f)) ; no test target
1382 (inputs
1383 `(("python-numpy" ,python2-numpy)))
1384 (native-inputs
1385 `(("python-setuptools" ,python2-setuptools)))
1386 (home-page "http://github.com/taoliu/MACS/")
1387 (synopsis "Model based analysis for ChIP-Seq data")
1388 (description
1389 "MACS is an implementation of a ChIP-Seq analysis algorithm for
1390 identifying transcript factor binding sites named Model-based Analysis of
1391 ChIP-Seq (MACS). MACS captures the influence of genome complexity to evaluate
1392 the significance of enriched ChIP regions and it improves the spatial
1393 resolution of binding sites through combining the information of both
1394 sequencing tag position and orientation.")
1395 (license license:bsd-3)))
1396
1397
1398 (define-public metabat
1399 (package
1400 (name "metabat")
1401 (version "0.26.1")
1402 (source (origin
1403 (method url-fetch)
1404 (uri (string-append
1405 "https://bitbucket.org/berkeleylab/metabat/get/"
1406 version ".tar.bz2"))
1407 (file-name (string-append name "-" version ".tar.bz2"))
1408 (sha256
1409 (base32
1410 "0vgrhbaxg4dkxyax2kbigak7w0arhqvw0szwp6gd9wmyilc44kfa"))))
1411 (build-system gnu-build-system)
1412 (arguments
1413 `(#:phases
1414 (modify-phases %standard-phases
1415 (add-after 'unpack 'fix-includes
1416 (lambda _
1417 (substitute* "SConstruct"
1418 (("/include/bam/bam.h")
1419 "/include/samtools/bam.h"))
1420 (substitute* "src/BamUtils.h"
1421 (("^#include \"bam/bam\\.h\"")
1422 "#include \"samtools/bam.h\"")
1423 (("^#include \"bam/sam\\.h\"")
1424 "#include \"samtools/sam.h\""))
1425 (substitute* "src/KseqReader.h"
1426 (("^#include \"bam/kseq\\.h\"")
1427 "#include \"samtools/kseq.h\""))
1428 #t))
1429 (add-after 'unpack 'fix-scons
1430 (lambda _
1431 (substitute* "SConstruct" ; Do not distribute README
1432 (("^env\\.Install\\(idir_prefix, 'README\\.md'\\)")
1433 ""))
1434 #t))
1435 (delete 'configure)
1436 (replace 'build
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (mkdir (assoc-ref outputs "out"))
1439 (zero? (system* "scons"
1440 (string-append
1441 "PREFIX="
1442 (assoc-ref outputs "out"))
1443 (string-append
1444 "HTSLIB_DIR="
1445 (assoc-ref inputs "htslib"))
1446 (string-append
1447 "SAMTOOLS_DIR="
1448 (assoc-ref inputs "samtools"))
1449 (string-append
1450 "BOOST_ROOT="
1451 (assoc-ref inputs "boost"))
1452 "install"))))
1453 ;; check and install carried out during build phase
1454 (delete 'check)
1455 (delete 'install))))
1456 (inputs
1457 `(("zlib" ,zlib)
1458 ("perl" ,perl)
1459 ("samtools" ,samtools)
1460 ("htslib" ,htslib)
1461 ("boost" ,boost)))
1462 (native-inputs
1463 `(("scons" ,scons)))
1464 (home-page "https://bitbucket.org/berkeleylab/metabat")
1465 (synopsis
1466 "Reconstruction of single genomes from complex microbial communities")
1467 (description
1468 "Grouping large genomic fragments assembled from shotgun metagenomic
1469 sequences to deconvolute complex microbial communities, or metagenome binning,
1470 enables the study of individual organisms and their interactions. MetaBAT is
1471 an automated metagenome binning software, which integrates empirical
1472 probabilistic distances of genome abundance and tetranucleotide frequency.")
1473 (license (license:non-copyleft "file://license.txt"
1474 "See license.txt in the distribution."))))
1475
1476 (define-public miso
1477 (package
1478 (name "miso")
1479 (version "0.5.3")
1480 (source (origin
1481 (method url-fetch)
1482 (uri (string-append
1483 "https://pypi.python.org/packages/source/m/misopy/misopy-"
1484 version ".tar.gz"))
1485 (sha256
1486 (base32
1487 "0x446867az8ir0z8c1vjqffkp0ma37wm4sylixnkhgawllzx8v5w"))
1488 (modules '((guix build utils)))
1489 (snippet
1490 '(substitute* "setup.py"
1491 ;; Use setuptools, or else the executables are not
1492 ;; installed.
1493 (("distutils.core") "setuptools")
1494 ;; use "gcc" instead of "cc" for compilation
1495 (("^defines")
1496 "cc.set_executables(
1497 compiler='gcc',
1498 compiler_so='gcc',
1499 linker_exe='gcc',
1500 linker_so='gcc -shared'); defines")))))
1501 (build-system python-build-system)
1502 (arguments
1503 `(#:python ,python-2 ; only Python 2 is supported
1504 #:tests? #f)) ; no "test" target
1505 (inputs
1506 `(("samtools" ,samtools)
1507 ("python-numpy" ,python2-numpy)
1508 ("python-pysam" ,python2-pysam)
1509 ("python-scipy" ,python2-scipy)
1510 ("python-matplotlib" ,python2-matplotlib)))
1511 (native-inputs
1512 `(("python-mock" ,python2-mock) ;for tests
1513 ("python-pytz" ,python2-pytz) ;for tests
1514 ("python-setuptools" ,python2-setuptools)))
1515 (home-page "http://genes.mit.edu/burgelab/miso/index.html")
1516 (synopsis "Mixture of Isoforms model for RNA-Seq isoform quantitation")
1517 (description
1518 "MISO (Mixture-of-Isoforms) is a probabilistic framework that quantitates
1519 the expression level of alternatively spliced genes from RNA-Seq data, and
1520 identifies differentially regulated isoforms or exons across samples. By
1521 modeling the generative process by which reads are produced from isoforms in
1522 RNA-Seq, the MISO model uses Bayesian inference to compute the probability
1523 that a read originated from a particular isoform.")
1524 (license license:gpl2)))
1525
1526 (define-public orfm
1527 (package
1528 (name "orfm")
1529 (version "0.4.1")
1530 (source (origin
1531 (method url-fetch)
1532 (uri (string-append
1533 "https://github.com/wwood/OrfM/releases/download/v"
1534 version "/orfm-" version ".tar.gz"))
1535 (sha256
1536 (base32
1537 "05fmw145snk646ly076zby0fjav0k7ysbclck5d4s9pmgcfpijc2"))))
1538 (build-system gnu-build-system)
1539 (inputs `(("zlib" ,zlib)))
1540 (synopsis "Simple and not slow open reading frame (ORF) caller")
1541 (description
1542 "An ORF caller finds stretches of DNA that when translated are not
1543 interrupted by stop codons. OrfM finds and prints these ORFs.")
1544 (home-page "https://github.com/wwood/OrfM")
1545 (license license:lgpl3+)))
1546
1547 (define-public python2-pbcore
1548 (package
1549 (name "python2-pbcore")
1550 (version "0.9.3")
1551 (source (origin
1552 (method url-fetch)
1553 (uri (string-append
1554 "https://github.com/PacificBiosciences/pbcore/archive/"
1555 version ".tar.gz"))
1556 (file-name (string-append name "-" version ".tar.gz"))
1557 (sha256
1558 (base32
1559 "1z46rwjac93jm87cbj2zgjg6qvsgs65140wkbbxsvxps7ai4pm09"))))
1560 (build-system python-build-system)
1561 (arguments `(#:python ,python-2)) ; pbcore requires Python 2.7
1562 (inputs
1563 `(("python-cython" ,python2-cython)
1564 ("python-numpy" ,python2-numpy)
1565 ("python-pysam" ,python2-pysam)
1566 ("python-h5py" ,python2-h5py)))
1567 (native-inputs
1568 `(("python-setuptools" ,python2-setuptools)))
1569 (home-page "http://pacificbiosciences.github.io/pbcore/")
1570 (synopsis "Library for reading and writing PacBio data files")
1571 (description
1572 "The pbcore package provides Python APIs for interacting with PacBio data
1573 files and writing bioinformatics applications.")
1574 (license license:bsd-3)))
1575
1576 (define-public python2-warpedlmm
1577 (package
1578 (name "python2-warpedlmm")
1579 (version "0.21")
1580 (source
1581 (origin
1582 (method url-fetch)
1583 (uri (string-append
1584 "https://pypi.python.org/packages/source/W/WarpedLMM/WarpedLMM-"
1585 version ".zip"))
1586 (sha256
1587 (base32
1588 "1agfz6zqa8nc6cw47yh0s3y14gkpa9wqazwcj7mwwj3ffnw39p3j"))))
1589 (build-system python-build-system)
1590 (arguments
1591 `(#:python ,python-2 ; requires Python 2.7
1592 #:phases
1593 (modify-phases %standard-phases
1594 (add-after
1595 'install 'remove-bin-directory
1596 (lambda* (#:key outputs #:allow-other-keys)
1597 ;; The "bin" directory only contains wrappers for running
1598 ;; the module tests. They are not needed after the
1599 ;; "check" phase.
1600 (delete-file-recursively
1601 (string-append (assoc-ref outputs "out") "/bin"))
1602 #t)))))
1603 (propagated-inputs
1604 `(("python-scipy" ,python2-scipy)
1605 ("python-numpy" ,python2-numpy)
1606 ("python-matplotlib" ,python2-matplotlib)
1607 ("python-fastlmm" ,python2-fastlmm)
1608 ("python-pandas" ,python2-pandas)
1609 ("python-pysnptools" ,python2-pysnptools)))
1610 (native-inputs
1611 `(("python-setuptools" ,python2-setuptools)
1612 ("python-mock" ,python2-mock)
1613 ("python-nose" ,python2-nose)
1614 ("unzip" ,unzip)))
1615 (home-page "https://github.com/PMBio/warpedLMM")
1616 (synopsis "Implementation of warped linear mixed models")
1617 (description
1618 "WarpedLMM is a Python implementation of the warped linear mixed model,
1619 which automatically learns an optimal warping function (or transformation) for
1620 the phenotype as it models the data.")
1621 (license license:asl2.0)))
1622
1623 (define-public pbtranscript-tofu
1624 (let ((commit "c7bbd5472"))
1625 (package
1626 (name "pbtranscript-tofu")
1627 (version (string-append "0.4.1." commit))
1628 (source (origin
1629 (method git-fetch)
1630 (uri (git-reference
1631 (url "https://github.com/PacificBiosciences/cDNA_primer.git")
1632 (commit commit)))
1633 (file-name (string-append name "-" version ".tar.gz"))
1634 (sha256
1635 (base32
1636 "148xkzi689c49g6fdhckp6mnmj2qhjdf1j4wifm6ja7ij95d7fxx"))))
1637 (build-system python-build-system)
1638 (arguments
1639 `(#:python ,python-2
1640 ;; With standard flags, the install phase attempts to create a zip'd
1641 ;; egg file, and fails with an error: 'ZIP does not support timestamps
1642 ;; before 1980'
1643 #:configure-flags '("--single-version-externally-managed"
1644 "--record=pbtranscript-tofu.txt")
1645 #:phases
1646 (alist-cons-after
1647 'unpack 'enter-directory-and-clean-up
1648 (lambda _
1649 (chdir "pbtranscript-tofu/pbtranscript/")
1650 ;; Delete clutter
1651 (delete-file-recursively "dist/")
1652 (delete-file-recursively "build/")
1653 (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/")
1654 (delete-file-recursively "pbtools.pbtranscript.egg-info")
1655 (delete-file "Cython-0.20.1.tar.gz")
1656 (delete-file "setuptools_cython-0.2.1-py2.7.egg")
1657 (delete-file "setuptools_cython-0.2.1.tar.gz")
1658 (delete-file "setup.cfg")
1659 (for-each delete-file
1660 (find-files "." "\\.so$"))
1661 ;; files should be writable for install phase
1662 (for-each (lambda (f) (chmod f #o755))
1663 (find-files "." "\\.py$")))
1664 %standard-phases)))
1665 (inputs
1666 `(("python-cython" ,python2-cython)
1667 ("python-numpy" ,python2-numpy)
1668 ("python-bx-python" ,python2-bx-python)
1669 ("python-networkx" ,python2-networkx)
1670 ("python-scipy" ,python2-scipy)
1671 ("python-pbcore" ,python2-pbcore)))
1672 (native-inputs
1673 `(("python-nose" ,python2-nose)
1674 ("python-setuptools" ,python2-setuptools)))
1675 (home-page "https://github.com/PacificBiosciences/cDNA_primer")
1676 (synopsis "Analyze transcriptome data generated with the Iso-Seq protocol")
1677 (description
1678 "pbtranscript-tofu contains scripts to analyze transcriptome data
1679 generated using the PacBio Iso-Seq protocol.")
1680 (license license:bsd-3))))
1681
1682 (define-public prodigal
1683 (package
1684 (name "prodigal")
1685 (version "2.6.2")
1686 (source (origin
1687 (method url-fetch)
1688 (uri (string-append
1689 "https://github.com/hyattpd/Prodigal/archive/v"
1690 version ".tar.gz"))
1691 (file-name (string-append name "-" version ".tar.gz"))
1692 (sha256
1693 (base32
1694 "0m8sb0fg6lmxrlpzna0am6svbnlmd3dckrhgzxxgb3gxr5fyj284"))))
1695 (build-system gnu-build-system)
1696 (arguments
1697 `(#:tests? #f ;no check target
1698 #:make-flags (list (string-append "INSTALLDIR="
1699 (assoc-ref %outputs "out")
1700 "/bin"))
1701 #:phases
1702 (modify-phases %standard-phases
1703 (delete 'configure))))
1704 (home-page "http://prodigal.ornl.gov")
1705 (synopsis "Protein-coding gene prediction for Archaea and Bacteria")
1706 (description
1707 "Prodigal runs smoothly on finished genomes, draft genomes, and
1708 metagenomes, providing gene predictions in GFF3, Genbank, or Sequin table
1709 format. It runs quickly, in an unsupervised fashion, handles gaps, handles
1710 partial genes, and identifies translation initiation sites.")
1711 (license license:gpl3+)))
1712
1713 (define-public rsem
1714 (package
1715 (name "rsem")
1716 (version "1.2.20")
1717 (source
1718 (origin
1719 (method url-fetch)
1720 (uri
1721 (string-append "http://deweylab.biostat.wisc.edu/rsem/src/rsem-"
1722 version ".tar.gz"))
1723 (sha256
1724 (base32 "0nzdc0j0hjllhsd5f2xli95dafm3nawskigs140xzvjk67xh0r9q"))
1725 (patches (list (search-patch "rsem-makefile.patch")))
1726 (modules '((guix build utils)))
1727 (snippet
1728 '(begin
1729 ;; remove bundled copy of boost
1730 (delete-file-recursively "boost")
1731 #t))))
1732 (build-system gnu-build-system)
1733 (arguments
1734 `(#:tests? #f ;no "check" target
1735 #:phases
1736 (modify-phases %standard-phases
1737 ;; No "configure" script.
1738 ;; Do not build bundled samtools library.
1739 (replace 'configure
1740 (lambda _
1741 (substitute* "Makefile"
1742 (("^all : sam/libbam.a") "all : "))
1743 #t))
1744 (replace 'install
1745 (lambda* (#:key outputs #:allow-other-keys)
1746 (let* ((out (string-append (assoc-ref outputs "out")))
1747 (bin (string-append out "/bin/"))
1748 (perl (string-append out "/lib/perl5/site_perl")))
1749 (mkdir-p bin)
1750 (mkdir-p perl)
1751 (for-each (lambda (file)
1752 (copy-file file
1753 (string-append bin (basename file))))
1754 (find-files "." "rsem-.*"))
1755 (copy-file "rsem_perl_utils.pm"
1756 (string-append perl "/rsem_perl_utils.pm")))
1757 #t))
1758 (add-after
1759 'install 'wrap-program
1760 (lambda* (#:key outputs #:allow-other-keys)
1761 (let ((out (assoc-ref outputs "out")))
1762 (for-each (lambda (prog)
1763 (wrap-program (string-append out "/bin/" prog)
1764 `("PERL5LIB" ":" prefix
1765 (,(string-append out "/lib/perl5/site_perl")))))
1766 '("rsem-plot-transcript-wiggles"
1767 "rsem-calculate-expression"
1768 "rsem-generate-ngvector"
1769 "rsem-run-ebseq"
1770 "rsem-prepare-reference")))
1771 #t)))))
1772 (inputs
1773 `(("boost" ,boost)
1774 ("ncurses" ,ncurses)
1775 ("r" ,r)
1776 ("perl" ,perl)
1777 ("samtools" ,samtools-0.1)
1778 ("zlib" ,zlib)))
1779 (home-page "http://deweylab.biostat.wisc.edu/rsem/")
1780 (synopsis "Estimate gene expression levels from RNA-Seq data")
1781 (description
1782 "RSEM is a software package for estimating gene and isoform expression
1783 levels from RNA-Seq data. The RSEM package provides a user-friendly
1784 interface, supports threads for parallel computation of the EM algorithm,
1785 single-end and paired-end read data, quality scores, variable-length reads and
1786 RSPD estimation. In addition, it provides posterior mean and 95% credibility
1787 interval estimates for expression levels. For visualization, it can generate
1788 BAM and Wiggle files in both transcript-coordinate and genomic-coordinate.")
1789 (license license:gpl3+)))
1790
1791 (define-public rseqc
1792 (package
1793 (name "rseqc")
1794 (version "2.6.1")
1795 (source
1796 (origin
1797 (method url-fetch)
1798 (uri
1799 (string-append "mirror://sourceforge/rseqc/"
1800 version "/RSeQC-" version ".tar.gz"))
1801 (sha256
1802 (base32 "15ly0254yi032qzkdplg00q144qfdsd986gh62829rl5bkxhj330"))
1803 (modules '((guix build utils)))
1804 (snippet
1805 '(begin
1806 ;; remove bundled copy of pysam
1807 (delete-file-recursively "lib/pysam")
1808 (substitute* "setup.py"
1809 ;; remove dependency on outdated "distribute" module
1810 (("^from distribute_setup import use_setuptools") "")
1811 (("^use_setuptools\\(\\)") "")
1812 ;; do not use bundled copy of pysam
1813 (("^have_pysam = False") "have_pysam = True"))))))
1814 (build-system python-build-system)
1815 (arguments `(#:python ,python-2))
1816 (inputs
1817 `(("python-cython" ,python2-cython)
1818 ("python-pysam" ,python2-pysam)
1819 ("python-numpy" ,python2-numpy)
1820 ("python-setuptools" ,python2-setuptools)
1821 ("zlib" ,zlib)))
1822 (native-inputs
1823 `(("python-nose" ,python2-nose)))
1824 (home-page "http://rseqc.sourceforge.net/")
1825 (synopsis "RNA-seq quality control package")
1826 (description
1827 "RSeQC provides a number of modules that can comprehensively evaluate
1828 high throughput sequence data, especially RNA-seq data. Some basic modules
1829 inspect sequence quality, nucleotide composition bias, PCR bias and GC bias,
1830 while RNA-seq specific modules evaluate sequencing saturation, mapped reads
1831 distribution, coverage uniformity, strand specificity, etc.")
1832 (license license:gpl3+)))
1833
1834 (define-public samtools
1835 (package
1836 (name "samtools")
1837 (version "1.2")
1838 (source
1839 (origin
1840 (method url-fetch)
1841 (uri
1842 (string-append "mirror://sourceforge/samtools/"
1843 version "/samtools-" version ".tar.bz2"))
1844 (sha256
1845 (base32
1846 "1akdqb685pk9xk1nb6sa9aq8xssjjhvvc06kp4cpdqvz2157l3j2"))))
1847 (build-system gnu-build-system)
1848 (arguments
1849 `(;; There are 87 test failures when building on non-64-bit architectures
1850 ;; due to invalid test data. This has since been fixed upstream (see
1851 ;; <https://github.com/samtools/samtools/pull/307>), but as there has
1852 ;; not been a new release we disable the tests for all non-64-bit
1853 ;; systems.
1854 #:tests? ,(string=? (or (%current-system) (%current-target-system))
1855 "x86_64-linux")
1856 #:modules ((ice-9 ftw)
1857 (ice-9 regex)
1858 (guix build gnu-build-system)
1859 (guix build utils))
1860 #:make-flags (list "LIBCURSES=-lncurses"
1861 (string-append "prefix=" (assoc-ref %outputs "out")))
1862 #:phases
1863 (alist-cons-after
1864 'unpack
1865 'patch-tests
1866 (lambda* (#:key inputs #:allow-other-keys)
1867 (let ((bash (assoc-ref inputs "bash")))
1868 (substitute* "test/test.pl"
1869 ;; The test script calls out to /bin/bash
1870 (("/bin/bash")
1871 (string-append bash "/bin/bash"))
1872 ;; There are two failing tests upstream relating to the "stats"
1873 ;; subcommand in test_usage_subcommand ("did not have Usage"
1874 ;; and "usage did not mention samtools stats"), so we disable
1875 ;; them.
1876 (("(test_usage_subcommand\\(.*\\);)" cmd)
1877 (string-append "unless ($subcommand eq 'stats') {" cmd "};")))))
1878 (alist-cons-after
1879 'install 'install-library
1880 (lambda* (#:key outputs #:allow-other-keys)
1881 (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
1882 (mkdir-p lib)
1883 (copy-file "libbam.a" (string-append lib "/libbam.a"))))
1884 (alist-cons-after
1885 'install 'install-headers
1886 (lambda* (#:key outputs #:allow-other-keys)
1887 (let ((include (string-append (assoc-ref outputs "out")
1888 "/include/samtools/")))
1889 (mkdir-p include)
1890 (for-each (lambda (file)
1891 (copy-file file (string-append include
1892 (basename file))))
1893 (scandir "." (lambda (name) (string-match "\\.h$" name))))
1894 #t))
1895 (alist-delete 'configure %standard-phases))))))
1896 (native-inputs `(("pkg-config" ,pkg-config)))
1897 (inputs `(("ncurses" ,ncurses)
1898 ("perl" ,perl)
1899 ("python" ,python)
1900 ("zlib" ,zlib)))
1901 (home-page "http://samtools.sourceforge.net")
1902 (synopsis "Utilities to efficiently manipulate nucleotide sequence alignments")
1903 (description
1904 "Samtools implements various utilities for post-processing nucleotide
1905 sequence alignments in the SAM, BAM, and CRAM formats, including indexing,
1906 variant calling (in conjunction with bcftools), and a simple alignment
1907 viewer.")
1908 (license license:expat)))
1909
1910 (define-public samtools-0.1
1911 ;; This is the most recent version of the 0.1 line of samtools. The input
1912 ;; and output formats differ greatly from that used and produced by samtools
1913 ;; 1.x and is still used in many bioinformatics pipelines.
1914 (package (inherit samtools)
1915 (version "0.1.19")
1916 (source
1917 (origin
1918 (method url-fetch)
1919 (uri
1920 (string-append "mirror://sourceforge/samtools/"
1921 version "/samtools-" version ".tar.bz2"))
1922 (sha256
1923 (base32 "1m33xsfwz0s8qi45lylagfllqg7fphf4dr0780rsvw75av9wk06h"))))
1924 (arguments
1925 (substitute-keyword-arguments (package-arguments samtools)
1926 ((#:tests? tests) #f) ;no "check" target
1927 ((#:phases phases)
1928 `(modify-phases ,phases
1929 (replace 'install
1930 (lambda* (#:key outputs #:allow-other-keys)
1931 (let ((bin (string-append
1932 (assoc-ref outputs "out") "/bin")))
1933 (mkdir-p bin)
1934 (copy-file "samtools"
1935 (string-append bin "/samtools")))))
1936 (delete 'patch-tests)))))))
1937
1938 (define-public ngs-sdk
1939 (package
1940 (name "ngs-sdk")
1941 (version "1.1.1")
1942 (source
1943 (origin
1944 (method url-fetch)
1945 (uri
1946 (string-append "https://github.com/ncbi/ngs/archive/"
1947 version ".tar.gz"))
1948 (file-name (string-append name "-" version ".tar.gz"))
1949 (sha256
1950 (base32
1951 "1x58gpm574n0xmk2a98gmikbgycq78ia0bvnb42k5ck34fmd5v8y"))))
1952 (build-system gnu-build-system)
1953 (arguments
1954 `(#:parallel-build? #f ; not supported
1955 #:tests? #f ; no "check" target
1956 #:phases
1957 (alist-replace
1958 'configure
1959 (lambda* (#:key outputs #:allow-other-keys)
1960 (let ((out (assoc-ref outputs "out")))
1961 ;; The 'configure' script doesn't recognize things like
1962 ;; '--enable-fast-install'.
1963 (zero? (system* "./configure"
1964 (string-append "--build-prefix=" (getcwd) "/build")
1965 (string-append "--prefix=" out)))))
1966 (alist-cons-after
1967 'unpack 'enter-dir
1968 (lambda _ (chdir "ngs-sdk") #t)
1969 %standard-phases))))
1970 (native-inputs `(("perl" ,perl)))
1971 (home-page "https://github.com/ncbi/ngs")
1972 (synopsis "API for accessing Next Generation Sequencing data")
1973 (description
1974 "NGS is a domain-specific API for accessing reads, alignments and pileups
1975 produced from Next Generation Sequencing. The API itself is independent from
1976 any particular back-end implementation, and supports use of multiple back-ends
1977 simultaneously.")
1978 (license license:public-domain)))
1979
1980 (define-public ngs-java
1981 (package (inherit ngs-sdk)
1982 (name "ngs-java")
1983 (arguments
1984 `(,@(substitute-keyword-arguments
1985 `(#:modules ((guix build gnu-build-system)
1986 (guix build utils)
1987 (srfi srfi-1)
1988 (srfi srfi-26))
1989 ,@(package-arguments ngs-sdk))
1990 ((#:phases phases)
1991 `(alist-cons-after
1992 'enter-dir 'fix-java-symlink-installation
1993 (lambda _
1994 ;; Only replace the version suffix, not the version number in
1995 ;; the directory name. Reported here:
1996 ;; https://github.com/ncbi/ngs/pull/4
1997 (substitute* "Makefile.java"
1998 (((string-append "\\$\\(subst "
1999 "(\\$\\(VERSION[^\\)]*\\)),"
2000 "(\\$\\([^\\)]+\\)),"
2001 "(\\$\\([^\\)]+\\)|\\$\\@)"
2002 "\\)")
2003 _ pattern replacement target)
2004 (string-append "$(patsubst "
2005 "%" pattern ","
2006 "%" replacement ","
2007 target ")"))))
2008 (alist-replace
2009 'enter-dir (lambda _ (chdir "ngs-java") #t)
2010 ,phases))))))
2011 (inputs
2012 `(("jdk" ,icedtea6 "jdk")
2013 ("ngs-sdk" ,ngs-sdk)))
2014 (synopsis "Java bindings for NGS SDK")))
2015
2016 (define-public ncbi-vdb
2017 (package
2018 (name "ncbi-vdb")
2019 (version "2.4.5-5")
2020 (source
2021 (origin
2022 (method url-fetch)
2023 (uri
2024 (string-append "https://github.com/ncbi/ncbi-vdb/archive/"
2025 version ".tar.gz"))
2026 (file-name (string-append name "-" version ".tar.gz"))
2027 (sha256
2028 (base32
2029 "1cj8nk6if8sqagv20vx36v566fdvhcaadf0x1ycnbgql6chbs6vy"))))
2030 (build-system gnu-build-system)
2031 (arguments
2032 `(#:parallel-build? #f ; not supported
2033 #:tests? #f ; no "check" target
2034 #:phases
2035 (alist-replace
2036 'configure
2037 (lambda* (#:key inputs outputs #:allow-other-keys)
2038 (let ((out (assoc-ref outputs "out")))
2039 ;; Only replace the version suffix, not the version number in the
2040 ;; directory name; fixed in commit 4dbba5c6a809 (no release yet).
2041 (substitute* "setup/konfigure.perl"
2042 (((string-append "\\$\\(subst "
2043 "(\\$\\(VERSION[^\\)]*\\)),"
2044 "(\\$\\([^\\)]+\\)),"
2045 "(\\$\\([^\\)]+\\)|\\$\\@)"
2046 "\\)")
2047 _ pattern replacement target)
2048 (string-append "$(patsubst "
2049 "%" pattern ","
2050 "%" replacement ","
2051 target ")")))
2052
2053 ;; Override include path for libmagic
2054 (substitute* "setup/package.prl"
2055 (("name => 'magic', Include => '/usr/include'")
2056 (string-append "name=> 'magic', Include => '"
2057 (assoc-ref inputs "libmagic")
2058 "/include" "'")))
2059
2060 ;; Install kdf5 library (needed by sra-tools)
2061 (substitute* "build/Makefile.install"
2062 (("LIBRARIES_TO_INSTALL =")
2063 "LIBRARIES_TO_INSTALL = kdf5.$(VERSION_LIBX) kdf5.$(VERSION_SHLX)"))
2064
2065 ;; The 'configure' script doesn't recognize things like
2066 ;; '--enable-fast-install'.
2067 (zero? (system*
2068 "./configure"
2069 (string-append "--build-prefix=" (getcwd) "/build")
2070 (string-append "--prefix=" (assoc-ref outputs "out"))
2071 (string-append "--debug")
2072 (string-append "--with-xml2-prefix="
2073 (assoc-ref inputs "libxml2"))
2074 (string-append "--with-ngs-sdk-prefix="
2075 (assoc-ref inputs "ngs-sdk"))
2076 (string-append "--with-ngs-java-prefix="
2077 (assoc-ref inputs "ngs-java"))
2078 (string-append "--with-hdf5-prefix="
2079 (assoc-ref inputs "hdf5"))))))
2080 (alist-cons-after
2081 'install 'install-interfaces
2082 (lambda* (#:key outputs #:allow-other-keys)
2083 ;; Install interface libraries. On i686 the interface libraries
2084 ;; are installed to "linux/gcc/i386", so we need to use the Linux
2085 ;; architecture name ("i386") instead of the target system prefix
2086 ;; ("i686").
2087 (mkdir (string-append (assoc-ref outputs "out") "/ilib"))
2088 (copy-recursively (string-append "build/ncbi-vdb/linux/gcc/"
2089 ,(system->linux-architecture
2090 (or (%current-target-system)
2091 (%current-system)))
2092 "/rel/ilib")
2093 (string-append (assoc-ref outputs "out")
2094 "/ilib"))
2095 ;; Install interface headers
2096 (copy-recursively "interfaces"
2097 (string-append (assoc-ref outputs "out")
2098 "/include")))
2099 %standard-phases))))
2100 (inputs
2101 `(("libxml2" ,libxml2)
2102 ("ngs-sdk" ,ngs-sdk)
2103 ("ngs-java" ,ngs-java)
2104 ("libmagic" ,file)
2105 ("hdf5" ,hdf5)))
2106 (native-inputs `(("perl" ,perl)))
2107 (home-page "https://github.com/ncbi/ncbi-vdb")
2108 (synopsis "Database engine for genetic information")
2109 (description
2110 "The NCBI-VDB library implements a highly compressed columnar data
2111 warehousing engine that is most often used to store genetic information.
2112 Databases are stored in a portable image within the file system, and can be
2113 accessed/downloaded on demand across HTTP.")
2114 (license license:public-domain)))
2115
2116 (define-public plink
2117 (package
2118 (name "plink")
2119 (version "1.07")
2120 (source
2121 (origin
2122 (method url-fetch)
2123 (uri (string-append
2124 "http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-"
2125 version "-src.zip"))
2126 (sha256
2127 (base32 "0as8gxm4pjyc8dxmm1sl873rrd7wn5qs0l29nqfnl31x8i467xaa"))
2128 (patches (list (search-patch "plink-1.07-unclobber-i.patch")))))
2129 (build-system gnu-build-system)
2130 (arguments
2131 '(#:tests? #f ;no "check" target
2132 #:make-flags (list (string-append "LIB_LAPACK="
2133 (assoc-ref %build-inputs "lapack")
2134 "/lib/liblapack.so")
2135 "WITH_LAPACK=1"
2136 "FORCE_DYNAMIC=1"
2137 ;; disable phoning home
2138 "WITH_WEBCHECK=")
2139 #:phases
2140 (modify-phases %standard-phases
2141 ;; no "configure" script
2142 (delete 'configure)
2143 (replace 'install
2144 (lambda* (#:key outputs #:allow-other-keys)
2145 (let ((bin (string-append (assoc-ref outputs "out")
2146 "/bin/")))
2147 (mkdir-p bin)
2148 (copy-file "plink" (string-append bin "plink"))
2149 #t))))))
2150 (inputs
2151 `(("zlib" ,zlib)
2152 ("lapack" ,lapack)))
2153 (native-inputs
2154 `(("unzip" ,unzip)))
2155 (home-page "http://pngu.mgh.harvard.edu/~purcell/plink/")
2156 (synopsis "Whole genome association analysis toolset")
2157 (description
2158 "PLINK is a whole genome association analysis toolset, designed to
2159 perform a range of basic, large-scale analyses in a computationally efficient
2160 manner. The focus of PLINK is purely on analysis of genotype/phenotype data,
2161 so there is no support for steps prior to this (e.g. study design and
2162 planning, generating genotype or CNV calls from raw data). Through
2163 integration with gPLINK and Haploview, there is some support for the
2164 subsequent visualization, annotation and storage of results.")
2165 ;; Code is released under GPLv2, except for fisher.h, which is under
2166 ;; LGPLv2.1+
2167 (license (list license:gpl2 license:lgpl2.1+))))
2168
2169 (define-public preseq
2170 (package
2171 (name "preseq")
2172 (version "1.0.2")
2173 (source (origin
2174 (method url-fetch)
2175 (uri
2176 (string-append "http://smithlabresearch.org/downloads/preseq-"
2177 version ".tar.bz2"))
2178 (sha256
2179 (base32 "0r7sw07p6nv8ygvc17gd78lisbw5336v3vhs86b5wv8mw3pwqksc"))
2180 (patches (list (search-patch "preseq-1.0.2-install-to-PREFIX.patch")
2181 (search-patch "preseq-1.0.2-link-with-libbam.patch")))
2182 (modules '((guix build utils)))
2183 (snippet
2184 ;; Remove bundled samtools.
2185 '(delete-file-recursively "preseq-master/samtools"))))
2186 (build-system gnu-build-system)
2187 (arguments
2188 `(#:tests? #f ;no "check" target
2189 #:phases
2190 (modify-phases %standard-phases
2191 (add-after
2192 'unpack 'enter-dir
2193 (lambda _
2194 (chdir "preseq-master")
2195 #t))
2196 (add-after
2197 'enter-dir 'use-samtools-headers
2198 (lambda _
2199 (substitute* '("smithlab_cpp/SAM.cpp"
2200 "smithlab_cpp/SAM.hpp")
2201 (("sam.h") "samtools/sam.h"))
2202 #t))
2203 (delete 'configure))
2204 #:make-flags (list (string-append "PREFIX="
2205 (assoc-ref %outputs "out"))
2206 (string-append "LIBBAM="
2207 (assoc-ref %build-inputs "samtools")
2208 "/lib/libbam.a"))))
2209 (inputs
2210 `(("gsl" ,gsl)
2211 ("samtools" ,samtools-0.1)
2212 ("zlib" ,zlib)))
2213 (home-page "http://smithlabresearch.org/software/preseq/")
2214 (synopsis "Program for analyzing library complexity")
2215 (description
2216 "The preseq package is aimed at predicting and estimating the complexity
2217 of a genomic sequencing library, equivalent to predicting and estimating the
2218 number of redundant reads from a given sequencing depth and how many will be
2219 expected from additional sequencing using an initial sequencing experiment.
2220 The estimates can then be used to examine the utility of further sequencing,
2221 optimize the sequencing depth, or to screen multiple libraries to avoid low
2222 complexity samples.")
2223 (license license:gpl3+)))
2224
2225 (define-public sra-tools
2226 (package
2227 (name "sra-tools")
2228 (version "2.4.5-5")
2229 (source
2230 (origin
2231 (method url-fetch)
2232 (uri
2233 (string-append "https://github.com/ncbi/sra-tools/archive/"
2234 version ".tar.gz"))
2235 (file-name (string-append name "-" version ".tar.gz"))
2236 (sha256
2237 (base32
2238 "11nrnvz7a012f4iryf0wiwrid0h111grsfxbxa9j51h3f2xbvgns"))))
2239 (build-system gnu-build-system)
2240 (arguments
2241 `(#:parallel-build? #f ; not supported
2242 #:tests? #f ; no "check" target
2243 #:phases
2244 (alist-replace
2245 'configure
2246 (lambda* (#:key inputs outputs #:allow-other-keys)
2247 ;; The build system expects a directory containing the sources and
2248 ;; raw build output of ncbi-vdb, including files that are not
2249 ;; installed. Since we are building against an installed version of
2250 ;; ncbi-vdb, the following modifications are needed.
2251 (substitute* "setup/konfigure.perl"
2252 ;; Make the configure script look for the "ilib" directory of
2253 ;; "ncbi-vdb" without first checking for the existence of a
2254 ;; matching library in its "lib" directory.
2255 (("^ my \\$f = File::Spec->catdir\\(\\$libdir, \\$lib\\);")
2256 "my $f = File::Spec->catdir($ilibdir, $ilib);")
2257 ;; Look for interface libraries in ncbi-vdb's "ilib" directory.
2258 (("my \\$ilibdir = File::Spec->catdir\\(\\$builddir, 'ilib'\\);")
2259 "my $ilibdir = File::Spec->catdir($dir, 'ilib');"))
2260
2261 ;; The 'configure' script doesn't recognize things like
2262 ;; '--enable-fast-install'.
2263 (zero? (system*
2264 "./configure"
2265 (string-append "--build-prefix=" (getcwd) "/build")
2266 (string-append "--prefix=" (assoc-ref outputs "out"))
2267 (string-append "--debug")
2268 (string-append "--with-fuse-prefix="
2269 (assoc-ref inputs "fuse"))
2270 (string-append "--with-magic-prefix="
2271 (assoc-ref inputs "libmagic"))
2272 ;; TODO: building with libxml2 fails with linker errors
2273 ;; (string-append "--with-xml2-prefix="
2274 ;; (assoc-ref inputs "libxml2"))
2275 (string-append "--with-ncbi-vdb-sources="
2276 (assoc-ref inputs "ncbi-vdb"))
2277 (string-append "--with-ncbi-vdb-build="
2278 (assoc-ref inputs "ncbi-vdb"))
2279 (string-append "--with-ngs-sdk-prefix="
2280 (assoc-ref inputs "ngs-sdk"))
2281 (string-append "--with-hdf5-prefix="
2282 (assoc-ref inputs "hdf5")))))
2283 %standard-phases)))
2284 (native-inputs `(("perl" ,perl)))
2285 (inputs
2286 `(("ngs-sdk" ,ngs-sdk)
2287 ("ncbi-vdb" ,ncbi-vdb)
2288 ("libmagic" ,file)
2289 ("fuse" ,fuse)
2290 ("hdf5" ,hdf5)
2291 ("zlib" ,zlib)))
2292 (home-page "http://www.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software")
2293 (synopsis "Tools and libraries for reading and writing sequencing data")
2294 (description
2295 "The SRA Toolkit from NCBI is a collection of tools and libraries for
2296 reading of sequencing files from the Sequence Read Archive (SRA) database and
2297 writing files into the .sra format.")
2298 (license license:public-domain)))
2299
2300 (define-public seqan
2301 (package
2302 (name "seqan")
2303 (version "1.4.2")
2304 (source (origin
2305 (method url-fetch)
2306 (uri (string-append "http://packages.seqan.de/seqan-library/"
2307 "seqan-library-" version ".tar.bz2"))
2308 (sha256
2309 (base32
2310 "05s3wrrwn50f81aklfm65i4a749zag1vr8z03k21xm0pdxy47yvp"))))
2311 ;; The documentation is 7.8MB and the includes are 3.6MB heavy, so it
2312 ;; makes sense to split the outputs.
2313 (outputs '("out" "doc"))
2314 (build-system trivial-build-system)
2315 (arguments
2316 `(#:modules ((guix build utils))
2317 #:builder
2318 (begin
2319 (use-modules (guix build utils))
2320 (let ((tar (assoc-ref %build-inputs "tar"))
2321 (bzip (assoc-ref %build-inputs "bzip2"))
2322 (out (assoc-ref %outputs "out"))
2323 (doc (assoc-ref %outputs "doc")))
2324 (setenv "PATH" (string-append tar "/bin:" bzip "/bin"))
2325 (system* "tar" "xvf" (assoc-ref %build-inputs "source"))
2326 (chdir (string-append "seqan-library-" ,version))
2327 (copy-recursively "include" (string-append out "/include"))
2328 (copy-recursively "share" (string-append doc "/share"))))))
2329 (native-inputs
2330 `(("source" ,source)
2331 ("tar" ,tar)
2332 ("bzip2" ,bzip2)))
2333 (home-page "http://www.seqan.de")
2334 (synopsis "Library for nucleotide sequence analysis")
2335 (description
2336 "SeqAn is a C++ library of efficient algorithms and data structures for
2337 the analysis of sequences with the focus on biological data. It contains
2338 algorithms and data structures for string representation and their
2339 manipulation, online and indexed string search, efficient I/O of
2340 bioinformatics file formats, sequence alignment, and more.")
2341 (license license:bsd-3)))
2342
2343 (define-public star
2344 (package
2345 (name "star")
2346 (version "2.4.2a")
2347 (source (origin
2348 (method url-fetch)
2349 (uri (string-append
2350 "https://github.com/alexdobin/STAR/archive/STAR_"
2351 version ".tar.gz"))
2352 (sha256
2353 (base32
2354 "1c3rnm7r5l0kl3d04gl1g7938xqf1c2l0mla87rlplqg1hcns5mc"))
2355 (modules '((guix build utils)))
2356 (snippet
2357 '(substitute* "source/Makefile"
2358 (("/bin/rm") "rm")))))
2359 (build-system gnu-build-system)
2360 (arguments
2361 '(#:tests? #f ;no check target
2362 #:make-flags '("STAR")
2363 #:phases
2364 (alist-cons-after
2365 'unpack 'enter-source-dir (lambda _ (chdir "source"))
2366 (alist-replace
2367 'install
2368 (lambda* (#:key outputs #:allow-other-keys)
2369 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
2370 (mkdir-p bin)
2371 (copy-file "STAR" (string-append bin "STAR"))))
2372 (alist-delete
2373 'configure %standard-phases)))))
2374 (native-inputs
2375 `(("vim" ,vim))) ; for xxd
2376 (inputs
2377 `(("zlib" ,zlib)))
2378 (home-page "https://github.com/alexdobin/STAR")
2379 (synopsis "Universal RNA-seq aligner")
2380 (description
2381 "The Spliced Transcripts Alignment to a Reference (STAR) software is
2382 based on a previously undescribed RNA-seq alignment algorithm that uses
2383 sequential maximum mappable seed search in uncompressed suffix arrays followed
2384 by seed clustering and stitching procedure. In addition to unbiased de novo
2385 detection of canonical junctions, STAR can discover non-canonical splices and
2386 chimeric (fusion) transcripts, and is also capable of mapping full-length RNA
2387 sequences.")
2388 ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed.
2389 (license license:gpl3+)))
2390
2391 (define-public subread
2392 (package
2393 (name "subread")
2394 (version "1.4.6-p2")
2395 (source (origin
2396 (method url-fetch)
2397 (uri (string-append
2398 "mirror://sourceforge/subread/subread-"
2399 version "-source.tar.gz"))
2400 (sha256
2401 (base32
2402 "06sv9mpcsdj6p68y15d6gi70lca3lxmzk0dn61hg0kfsa7rxmsr3"))))
2403 (build-system gnu-build-system)
2404 (arguments
2405 `(#:tests? #f ;no "check" target
2406 #:make-flags '("-f" "Makefile.Linux")
2407 #:phases
2408 (alist-cons-after
2409 'unpack 'enter-dir
2410 (lambda _ (chdir "src") #t)
2411 (alist-replace
2412 'install
2413 (lambda* (#:key outputs #:allow-other-keys)
2414 (let ((bin (string-append (assoc-ref outputs "out") "/bin/")))
2415 (mkdir-p bin)
2416 (copy-recursively "../bin" bin)))
2417 ;; no "configure" script
2418 (alist-delete 'configure %standard-phases)))))
2419 (inputs `(("zlib" ,zlib)))
2420 (home-page "http://bioinf.wehi.edu.au/subread-package/")
2421 (synopsis "Tool kit for processing next-gen sequencing data")
2422 (description
2423 "The subread package contains the following tools: subread aligner, a
2424 general-purpose read aligner; subjunc aligner: detecting exon-exon junctions
2425 and mapping RNA-seq reads; featureCounts: counting mapped reads for genomic
2426 features; exactSNP: a SNP caller that discovers SNPs by testing signals
2427 against local background noises.")
2428 (license license:gpl3+)))
2429
2430 (define-public shogun
2431 (package
2432 (name "shogun")
2433 (version "4.0.0")
2434 (source
2435 (origin
2436 (method url-fetch)
2437 (uri (string-append
2438 "ftp://shogun-toolbox.org/shogun/releases/"
2439 (version-major+minor version)
2440 "/sources/shogun-" version ".tar.bz2"))
2441 (sha256
2442 (base32
2443 "159nlijnb7mnrv9za80wnm1shwvy45hgrqzn51hxy7gw4z6d6fdb"))
2444 (modules '((guix build utils)
2445 (ice-9 rdelim)))
2446 (snippet
2447 '(begin
2448 ;; Remove non-free sources and files referencing them
2449 (for-each delete-file
2450 (find-files "src/shogun/classifier/svm/"
2451 "SVMLight\\.(cpp|h)"))
2452 (for-each delete-file
2453 (find-files "examples/undocumented/libshogun/"
2454 (string-append
2455 "(classifier_.*svmlight.*|"
2456 "evaluation_cross_validation_locked_comparison).cpp")))
2457 ;; Remove non-free functions.
2458 (define (delete-ifdefs file)
2459 (with-atomic-file-replacement file
2460 (lambda (in out)
2461 (let loop ((line (read-line in 'concat))
2462 (skipping? #f))
2463 (if (eof-object? line)
2464 #t
2465 (let ((skip-next?
2466 (or (and skipping?
2467 (not (string-prefix?
2468 "#endif //USE_SVMLIGHT" line)))
2469 (string-prefix?
2470 "#ifdef USE_SVMLIGHT" line))))
2471 (when (or (not skipping?)
2472 (and skipping? (not skip-next?)))
2473 (display line out))
2474 (loop (read-line in 'concat) skip-next?)))))))
2475 (for-each delete-ifdefs (find-files "src/shogun/kernel/"
2476 "^Kernel\\.(cpp|h)"))))))
2477 (build-system cmake-build-system)
2478 (arguments
2479 '(#:tests? #f ;no check target
2480 #:phases
2481 (alist-cons-after
2482 'unpack 'delete-broken-symlinks
2483 (lambda _
2484 (for-each delete-file '("applications/arts/data"
2485 "applications/asp/data"
2486 "applications/easysvm/data"
2487 "applications/msplicer/data"
2488 "applications/ocr/data"
2489 "examples/documented/data"
2490 "examples/documented/matlab_static"
2491 "examples/documented/octave_static"
2492 "examples/undocumented/data"
2493 "examples/undocumented/matlab_static"
2494 "examples/undocumented/octave_static"
2495 "tests/integration/data"
2496 "tests/integration/matlab_static"
2497 "tests/integration/octave_static"
2498 "tests/integration/python_modular/tests"))
2499 #t)
2500 (alist-cons-after
2501 'unpack 'change-R-target-path
2502 (lambda* (#:key outputs #:allow-other-keys)
2503 (substitute* '("src/interfaces/r_modular/CMakeLists.txt"
2504 "src/interfaces/r_static/CMakeLists.txt"
2505 "examples/undocumented/r_modular/CMakeLists.txt")
2506 (("\\$\\{R_COMPONENT_LIB_PATH\\}")
2507 (string-append (assoc-ref outputs "out")
2508 "/lib/R/library/")))
2509 #t)
2510 (alist-cons-after
2511 'unpack 'fix-octave-modules
2512 (lambda* (#:key outputs #:allow-other-keys)
2513 (substitute* '("src/interfaces/octave_modular/CMakeLists.txt"
2514 "src/interfaces/octave_static/CMakeLists.txt")
2515 (("^include_directories\\(\\$\\{OCTAVE_INCLUDE_DIRS\\}")
2516 "include_directories(${OCTAVE_INCLUDE_DIRS} ${OCTAVE_INCLUDE_DIRS}/octave"))
2517
2518 ;; change target directory
2519 (substitute* "src/interfaces/octave_modular/CMakeLists.txt"
2520 (("\\$\\{OCTAVE_OCT_LOCAL_API_FILE_DIR\\}")
2521 (string-append (assoc-ref outputs "out")
2522 "/share/octave/packages")))
2523 #t)
2524 (alist-cons-before
2525 'build 'set-HOME
2526 ;; $HOME needs to be set at some point during the build phase
2527 (lambda _ (setenv "HOME" "/tmp") #t)
2528 %standard-phases))))
2529 #:configure-flags
2530 (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
2531 "-DUSE_SVMLIGHT=OFF" ;disable proprietary SVMLIGHT
2532 ;;"-DJavaModular=ON" ;requires unpackaged jblas
2533 ;;"-DRubyModular=ON" ;requires unpackaged ruby-narray
2534 ;;"-DPerlModular=ON" ;"FindPerlLibs" does not exist
2535 ;;"-DLuaModular=ON" ;fails because lua doesn't build pkgconfig file
2536 "-DOctaveModular=ON"
2537 "-DOctaveStatic=ON"
2538 "-DPythonModular=ON"
2539 "-DPythonStatic=ON"
2540 "-DRModular=ON"
2541 "-DRStatic=ON"
2542 "-DCmdLineStatic=ON")))
2543 (inputs
2544 `(("python" ,python)
2545 ("numpy" ,python-numpy)
2546 ("r" ,r)
2547 ("octave" ,octave)
2548 ("swig" ,swig)
2549 ("hdf5" ,hdf5)
2550 ("atlas" ,atlas)
2551 ("arpack" ,arpack-ng)
2552 ("lapack" ,lapack)
2553 ("glpk" ,glpk)
2554 ("libxml2" ,libxml2)
2555 ("lzo" ,lzo)
2556 ("zlib" ,zlib)))
2557 (native-inputs
2558 `(("pkg-config" ,pkg-config)))
2559 (home-page "http://shogun-toolbox.org/")
2560 (synopsis "Machine learning toolbox")
2561 (description
2562 "The Shogun Machine learning toolbox provides a wide range of unified and
2563 efficient Machine Learning (ML) methods. The toolbox seamlessly allows to
2564 combine multiple data representations, algorithm classes, and general purpose
2565 tools. This enables both rapid prototyping of data pipelines and extensibility
2566 in terms of new algorithms.")
2567 (license license:gpl3+)))
2568
2569 (define-public vcftools
2570 (package
2571 (name "vcftools")
2572 (version "0.1.12b")
2573 (source (origin
2574 (method url-fetch)
2575 (uri (string-append
2576 "mirror://sourceforge/vcftools/vcftools_"
2577 version ".tar.gz"))
2578 (sha256
2579 (base32
2580 "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx"))))
2581 (build-system gnu-build-system)
2582 (arguments
2583 `(#:tests? #f ; no "check" target
2584 #:make-flags (list
2585 "CFLAGS=-O2" ; override "-m64" flag
2586 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2587 (string-append "MANDIR=" (assoc-ref %outputs "out")
2588 "/share/man/man1"))
2589 #:phases
2590 (alist-cons-after
2591 'unpack 'patch-manpage-install
2592 (lambda _
2593 (substitute* "Makefile"
2594 (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1")))
2595 (alist-delete 'configure %standard-phases))))
2596 (inputs
2597 `(("perl" ,perl)
2598 ("zlib" ,zlib)))
2599 (home-page "http://vcftools.sourceforge.net/")
2600 (synopsis "Tools for working with VCF files")
2601 (description
2602 "VCFtools is a program package designed for working with VCF files, such
2603 as those generated by the 1000 Genomes Project. The aim of VCFtools is to
2604 provide easily accessible methods for working with complex genetic variation
2605 data in the form of VCF files.")
2606 ;; The license is declared as LGPLv3 in the README and
2607 ;; at http://vcftools.sourceforge.net/license.html
2608 (license license:lgpl3)))