You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1251 lines
54 KiB

  1. ;; Bioinformatics module
  2. (define-module (gn packages bioinformatics)
  3. #:use-module ((guix licenses) #:prefix license:)
  4. #:use-module (guix packages)
  5. #:use-module (guix utils)
  6. #:use-module (guix download)
  7. #:use-module (guix git-download)
  8. #:use-module (guix build-system ant)
  9. #:use-module (guix build-system gnu)
  10. #:use-module (guix build-system cmake)
  11. #:use-module (guix build-system perl)
  12. #:use-module (guix build-system python)
  13. ;; #:use-module (guix build-system ruby)
  14. #:use-module (guix build-system r)
  15. #:use-module (guix build-system trivial)
  16. #:use-module (gn packages statistics)
  17. #:use-module (gnu packages)
  18. #:use-module (gnu packages autotools)
  19. #:use-module (gnu packages algebra)
  20. #:use-module (gnu packages base)
  21. #:use-module (gnu packages bioinformatics)
  22. #:use-module (gnu packages boost)
  23. #:use-module (gnu packages compression)
  24. #:use-module (gnu packages databases)
  25. #:use-module (gnu packages check)
  26. #:use-module (gnu packages cmake)
  27. #:use-module (gnu packages compression)
  28. #:use-module (gnu packages cpio)
  29. #:use-module (gnu packages curl)
  30. #:use-module (gnu packages doxygen)
  31. #:use-module (gnu packages datastructures)
  32. #:use-module (gnu packages check)
  33. #:use-module (gnu packages file)
  34. #:use-module (gnu packages gawk)
  35. #:use-module (gnu packages gcc)
  36. #:use-module (gnu packages graphviz)
  37. #:use-module (gnu packages java)
  38. #:use-module (gnu packages linux)
  39. #:use-module (gn packages ldc)
  40. #:use-module (gnu packages machine-learning)
  41. #:use-module (gnu packages maths)
  42. #:use-module (gnu packages mpi)
  43. #:use-module (gnu packages ncurses)
  44. #:use-module (gnu packages node)
  45. #:use-module (gnu packages parallel)
  46. #:use-module (gnu packages pcre)
  47. #:use-module (gnu packages perl)
  48. #:use-module (gnu packages pkg-config)
  49. #:use-module (gnu packages popt)
  50. #:use-module (gnu packages protobuf)
  51. #:use-module (gnu packages python)
  52. #:use-module (gnu packages ruby)
  53. #:use-module (gnu packages statistics)
  54. #:use-module (gnu packages tbb)
  55. #:use-module (gnu packages textutils)
  56. #:use-module (gnu packages time)
  57. #:use-module (gnu packages tls)
  58. #:use-module (gnu packages vim)
  59. #:use-module (gnu packages web)
  60. #:use-module (gnu packages xml)
  61. #:use-module (gnu packages zip)
  62. #:use-module (gnu packages bootstrap)
  63. #:use-module (srfi srfi-1))
  64. (define-public contra
  65. (package
  66. (name "contra")
  67. (version "2.0.6")
  68. (source (origin
  69. (method url-fetch)
  70. (uri (string-append
  71. "mirror://sourceforge/contra-cnv/CONTRA.v" version ".tar.gz"))
  72. (sha256
  73. (base32
  74. "0agpcm2xh5f0i9n9sx1kvln6mzdksddmh11bvzj6bh76yw5pnw91"))))
  75. (build-system gnu-build-system)
  76. (propagated-inputs
  77. `(("python" ,python-2)
  78. ("r" ,r)
  79. ;; ("r-dnacopy" ,r-dnacopy) <-- missing in Pjotr's tree
  80. ("bedtools" ,bedtools)
  81. ("samtools" ,samtools)))
  82. (arguments
  83. `(#:tests? #f ; There are no tests.
  84. #:phases
  85. (modify-phases %standard-phases
  86. (delete 'configure)
  87. (delete 'build) ; We can use Guix's BEDtools instead.
  88. (replace 'install
  89. (lambda _
  90. (let* ((out (assoc-ref %outputs "out"))
  91. (bin (string-append out "/bin"))
  92. (doc (string-append out "/share/doc/contra")))
  93. (mkdir-p bin)
  94. (mkdir-p doc)
  95. (and
  96. (zero? (system* "cp" "--recursive" "scripts" bin))
  97. (zero? (system* "cp" "contra.py" bin))
  98. (zero? (system* "cp" "baseline.py" bin))
  99. ;; There's only a pre-built PDF available.
  100. (zero? (system* "cp" "CONTRA_User_Guide.2.0.pdf" doc)))))))))
  101. (home-page "http://contra-cnv.sourceforge.net/")
  102. (synopsis "Tool for copy number variation (CNV) detection for targeted
  103. resequencing data")
  104. (description "CONTRA is a tool for copy number variation (CNV) detection
  105. for targeted resequencing data such as those from whole-exome capture data.
  106. CONTRA calls copy number gains and losses for each target region with key
  107. strategies including the use of base-level log-ratios to remove GC-content
  108. bias, correction for an imbalanced library size effect on log-ratios, and the
  109. estimation of log-ratio variations via binning and interpolation. It takes
  110. standard alignment formats (BAM/SAM) and outputs in variant call format
  111. (VCF 4.0) for easy integration with other next generation sequencing analysis
  112. package.")
  113. (license license:gpl3+)))
  114. (define boost-delly
  115. (package (inherit boost)
  116. (name "boost-delly")
  117. (version "1.57.0")
  118. (source (origin
  119. (method url-fetch)
  120. (uri (string-append
  121. "mirror://sourceforge/boost/boost_"
  122. (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
  123. ".tar.bz2"))
  124. (sha256
  125. (base32
  126. "0rs94vdmg34bwwj23fllva6mhrml2i7mvmlb11zyrk1k5818q34i"))))))
  127. (define-public delly
  128. (package
  129. (name "delly")
  130. (version "0.7.2")
  131. (source (origin
  132. (method url-fetch)
  133. (uri (string-append "https://github.com/tobiasrausch/delly/archive/v"
  134. version ".tar.gz"))
  135. (sha256
  136. (base32 "173mmg43dbxqkyq0kiffz63xbmggr2kzd55mwxci9yfh5md1zprn"))
  137. (patches (list (search-patch "delly-use-system-libraries.patch")))))
  138. (build-system gnu-build-system)
  139. (native-inputs
  140. `(("python" ,python-2)))
  141. (inputs
  142. `(("boost" ,boost-delly) ; Use version 1.57.0 instead.
  143. ("htslib" ,htslib)
  144. ("zlib" ,zlib)
  145. ("bzip2" ,bzip2)))
  146. (arguments
  147. `(#:tests? #f ; There are no tests to run.
  148. #:phases
  149. (modify-phases %standard-phases
  150. (delete 'configure) ; There is no configure phase.
  151. (replace 'install
  152. (lambda _
  153. (let ((bin (string-append (assoc-ref %outputs "out") "/bin")))
  154. (install-file "src/cov" bin)
  155. (install-file "src/delly" bin)
  156. (install-file "src/extract" bin)
  157. (install-file "src/iover" bin)
  158. (install-file "src/stats" bin)))))))
  159. (home-page "https://github.com/tobiasrausch/delly")
  160. (synopsis "Integrated structural variant prediction method")
  161. (description "Delly is an integrated structural variant prediction method
  162. that can discover and genotype deletions, tandem duplications, inversions and
  163. translocations at single-nucleotide resolution in short-read massively parallel
  164. sequencing data. It uses paired-ends and split-reads to sensitively and
  165. accurately delineate genomic rearrangements throughout the genome. Structural
  166. variants can be visualized using Delly-maze and Delly-suave.")
  167. (license license:gpl3)))
  168. (define-public freec
  169. (package
  170. (name "control-freec")
  171. (version "8.7")
  172. (source (origin
  173. (method url-fetch)
  174. (uri "http://bioinfo-out.curie.fr/projects/freec/src/FREEC_Linux64.tar.gz")
  175. (file-name (string-append name "-" version ".tar.gz"))
  176. (sha256
  177. (base32 "12sl7gxbklhvv0687qjhml1z4lwpcn159zcyxvawvclsrzqjmv0h"))))
  178. (build-system gnu-build-system)
  179. ;; The source code's filename indicates only a 64-bit Linux build.
  180. ;; We need to investigate whether this is true.
  181. (supported-systems '("x86_64-linux"))
  182. (arguments
  183. `(#:phases
  184. (modify-phases %standard-phases
  185. ;; There's no configure phase because there are no external
  186. ;; dependencies.
  187. (delete 'configure)
  188. ;; There are no tests.
  189. (delete 'check)
  190. (replace
  191. 'unpack
  192. (lambda* (#:key source #:allow-other-keys)
  193. (and
  194. (zero? (system* "mkdir" "source"))
  195. (with-directory-excursion "source"
  196. (zero? (system* "tar" "xvf" source))))))
  197. (replace
  198. 'build
  199. (lambda* (#:key inputs #:allow-other-keys)
  200. (with-directory-excursion "source"
  201. (zero? (system* "make")))))
  202. (replace
  203. 'install
  204. (lambda* (#:key outputs #:allow-other-keys)
  205. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  206. (install-file "source/freec" bin)))))))
  207. (home-page "http://bioinfo-out.curie.fr/projects/freec/")
  208. (synopsis "Tool for detection of copy-number changes and allelic imbalances
  209. (including LOH) using deep-sequencing data")
  210. (description "Control-FREEC automatically computes, normalizes, segments
  211. copy number and beta allele frequency (BAF) profiles, then calls copy number
  212. alterations and LOH. The control (matched normal) sample is optional for whole
  213. genome sequencing data but mandatory for whole exome or targeted sequencing
  214. data. For whole genome sequencing data analysis, the program can also use
  215. mappability data (files created by GEM). ")
  216. (license license:gpl2+)))
  217. (define-public tabixpp
  218. (package
  219. (name "tabixpp")
  220. (version "1.0.0")
  221. (source (origin
  222. (method url-fetch)
  223. (uri (string-append "https://github.com/ekg/tabixpp/archive/v"
  224. version ".tar.gz"))
  225. (file-name (string-append name "-" version ".tar.gz"))
  226. (sha256
  227. (base32 "1s0lgks7qlvlhvcjhi2wm18nnza1bwcnic44ij7z8wfg88h4ivwn"))))
  228. (build-system gnu-build-system)
  229. (inputs
  230. `(("htslib" ,htslib)
  231. ("zlib" ,zlib)))
  232. (arguments
  233. `(#:tests? #f ; There are no tests to run.
  234. #:phases
  235. (modify-phases %standard-phases
  236. (delete 'configure) ; There is no configure phase.
  237. ;; The build phase needs overriding the location of htslib.
  238. (replace 'build
  239. (lambda* (#:key inputs #:allow-other-keys)
  240. (let ((htslib-ref (assoc-ref inputs "htslib")))
  241. (zero?
  242. (system* "make"
  243. (string-append "HTS_LIB=" htslib-ref "/lib/libhts.a")
  244. "HTS_HEADERS=" ; No need to check for headers here.
  245. (string-append "LIBPATH=-L. -L" htslib-ref "/include"))))))
  246. (replace 'install
  247. (lambda* (#:key outputs #:allow-other-keys)
  248. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  249. (install-file "tabix++" bin)))))))
  250. (home-page "https://github.com/ekg/tabixpp")
  251. (synopsis "C++ wrapper around tabix project")
  252. (description "This is a C++ wrapper around the Tabix project which abstracts
  253. some of the details of opening and jumping in tabix-indexed files.")
  254. (license license:expat)))
  255. ;; This version works with FreeBayes while the released version doesn't. The
  256. ;; released creates a variable with the name "vcf" somewhere, which is also the
  257. ;; name of a namespace in vcflib.
  258. (define-public tabixpp-freebayes
  259. (let ((commit "bbc63a49acc52212199f92e9e3b8fba0a593e3f7"))
  260. (package (inherit tabixpp)
  261. (name "tabixpp-freebayes")
  262. (version (string-append "0-1." (string-take commit 7)))
  263. (source (origin
  264. (method url-fetch)
  265. (uri (string-append "https://github.com/ekg/tabixpp/archive/"
  266. commit ".tar.gz"))
  267. (file-name (string-append name "-" version "-checkout.tar.gz"))
  268. (sha256
  269. (base32 "1s06wmpgj4my4pik5kp2lc42hzzazbp5ism2y4i2ajp2y1c68g77")))))))
  270. (define-public smithwaterman
  271. ;; TODO: Upgrading smithwaterman breaks FreeBayes.
  272. (let ((commit "203218b47d45ac56ef234716f1bd4c741b289be1"))
  273. (package
  274. (name "smithwaterman")
  275. (version (string-append "0-1." (string-take commit 7)))
  276. (source (origin
  277. (method url-fetch)
  278. (uri (string-append "https://github.com/ekg/smithwaterman/archive/"
  279. commit ".tar.gz"))
  280. (file-name (string-append name "-" version "-checkout.tar.gz"))
  281. (sha256
  282. (base32 "1lkxy4xkjn96l70jdbsrlm687jhisgw4il0xr2dm33qwcclzzm3b"))))
  283. (build-system gnu-build-system)
  284. (arguments
  285. `(#:tests? #f ; There are no tests to run.
  286. #:phases
  287. (modify-phases %standard-phases
  288. (delete 'configure) ; There is no configure phase.
  289. (replace 'install
  290. (lambda* (#:key outputs #:allow-other-keys)
  291. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  292. (install-file "smithwaterman" bin)))))))
  293. (home-page "https://github.com/ekg/smithwaterman")
  294. (synopsis "Implementation of the Smith-Waterman algorithm")
  295. (description "Implementation of the Smith-Waterman algorithm.")
  296. ;; The project contains a license file for the GPLv2. The source files
  297. ;; do not contain a license notice, so GPLv2-only is assumed here.
  298. (license license:gpl2))))
  299. (define-public multichoose
  300. (package
  301. (name "multichoose")
  302. (version "1.0.3")
  303. (source (origin
  304. (method url-fetch)
  305. (uri (string-append "https://github.com/ekg/multichoose/archive/v"
  306. version ".tar.gz"))
  307. (file-name (string-append name "-" version ".tar.gz"))
  308. (sha256
  309. (base32 "0xy86vvr3qrs4l81qis7ia1q2hnqv0xcb4a1n60smxbhqqis5w3l"))))
  310. (build-system gnu-build-system)
  311. (native-inputs
  312. `(("python" ,python-2)
  313. ("node" ,node)))
  314. (arguments
  315. `(#:tests? #f ; There are no tests to run.
  316. #:phases
  317. (modify-phases %standard-phases
  318. (delete 'configure) ; There is no configure phase.
  319. (replace 'install
  320. (lambda* (#:key outputs #:allow-other-keys)
  321. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  322. ;; TODO: There are Python modules for these programs too.
  323. (install-file "multichoose" bin)
  324. (install-file "multipermute" bin)))))))
  325. (home-page "https://github.com/ekg/multichoose")
  326. (synopsis "Library for efficient loopless multiset combination generation
  327. algorithm")
  328. (description "A library implements an efficient loopless multiset
  329. combination generation algorithm which is (approximately) described in
  330. \"Loopless algorithms for generating permutations, combinations, and other
  331. combinatorial configurations.\" G Ehrlich - Journal of the ACM (JACM),
  332. 1973. (Algorithm 7.)")
  333. (license license:expat)))
  334. (define-public fsom
  335. (let ((commit "a6ef318fbd347c53189384aef7f670c0e6ce89a3"))
  336. (package
  337. (name "fsom")
  338. (version (string-append "0-1." (string-take commit 7)))
  339. (source (origin
  340. (method url-fetch)
  341. (uri (string-append "https://github.com/ekg/fsom/archive/"
  342. "a6ef318fbd347c53189384aef7f670c0e6ce89a3" ".tar.gz"))
  343. (file-name (string-append name "-" version "-checkout.tar.gz"))
  344. (sha256
  345. (base32 "0q6b57ppxfvsm5cqmmbfmjpn5qvx2zi5pamvp3yh8gpmmz8cfbl3"))))
  346. (build-system gnu-build-system)
  347. (arguments
  348. `(#:tests? #f ; There are no tests to run.
  349. #:phases
  350. (modify-phases %standard-phases
  351. (delete 'configure) ; There is no configure phase.
  352. (replace 'install
  353. (lambda* (#:key outputs #:allow-other-keys)
  354. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  355. (install-file "fsom" bin)))))))
  356. (home-page "https://github.com/ekg/fsom")
  357. (synopsis "Program for managing SOM (Self-Organizing Maps) neural networks")
  358. (description "Program for managing SOM (Self-Organizing Maps) neural networks.")
  359. (license license:gpl3))))
  360. (define-public filevercmp
  361. (let ((commit "1a9b779b93d0b244040274794d402106907b71b7"))
  362. (package
  363. (name "filevercmp")
  364. (version (string-append "0-1." (string-take commit 7)))
  365. (source (origin
  366. (method url-fetch)
  367. (uri (string-append "https://github.com/ekg/filevercmp/archive/"
  368. commit ".tar.gz"))
  369. (file-name "filevercmp-src.tar.gz")
  370. (sha256
  371. (base32 "0yp5jswf5j2pqc6517x277s4s6h1ss99v57kxw9gy0jkfl3yh450"))))
  372. (build-system gnu-build-system)
  373. (arguments
  374. `(#:tests? #f ; There are no tests to run.
  375. #:phases
  376. (modify-phases %standard-phases
  377. (delete 'configure) ; There is no configure phase.
  378. (replace 'install
  379. (lambda* (#:key outputs #:allow-other-keys)
  380. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  381. (install-file "filevercmp" bin)))))))
  382. (home-page "https://github.com/ekg/filevercmp")
  383. (synopsis "Program to compare version strings")
  384. (description "A program to compare version strings. It intends to be a
  385. replacement for strverscmp.")
  386. (license license:gpl3+))))
  387. (define-public fastahack
  388. (let ((commit "c68cebb4f2e5d5d2b70cf08fbdf1944e9ab2c2dd"))
  389. (package
  390. (name "fastahack")
  391. (version (string-append "0-1." (string-take commit 7)))
  392. (source (origin
  393. (method url-fetch)
  394. (uri (string-append "https://github.com/ekg/fastahack/archive/"
  395. commit ".tar.gz"))
  396. (file-name (string-append name "-" version "-checkout.tar.gz"))
  397. (sha256
  398. (base32 "0j25lcl3jk1kls66zzxjfyq5ir6sfcvqrdwfcva61y3ajc9ssay2"))))
  399. (build-system gnu-build-system)
  400. (arguments
  401. `(#:tests? #f ; There are no tests to run.
  402. #:phases
  403. (modify-phases %standard-phases
  404. (delete 'configure) ; There is no configure phase.
  405. (replace 'install
  406. (lambda* (#:key outputs #:allow-other-keys)
  407. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  408. (install-file "fastahack" bin)))))))
  409. (home-page "https://github.com/ekg/fastahack")
  410. (synopsis "Program for indexing and sequence extraction from FASTA files")
  411. (description "Fastahack is a small application for indexing and extracting
  412. sequences and subsequences from FASTA files. The included Fasta.cpp library
  413. provides a FASTA reader and indexer that can be embeddedinto applications which
  414. would benefit from directly reading subsequences from FASTA files. The library
  415. automatically handles index file generation and use.")
  416. ;; There is no specific license for fastahack.
  417. ;; A part of the program is licensed GPLv2.
  418. (license (list license:non-copyleft license:gpl2)))))
  419. (define-public vcflib
  420. (let ((commit "3ce827d8ebf89bb3bdc097ee0fe7f46f9f30d5fb"))
  421. (package
  422. (name "vcflib")
  423. (version (string-append "1.0.2-1." (string-take commit 7)))
  424. (source
  425. (origin
  426. (method url-fetch)
  427. (uri (string-append "https://github.com/vcflib/vcflib/archive/"
  428. "5ac091365fdc716cc47cc5410bb97ee5dc2a2c92" ".tar.gz"))
  429. (file-name "vcflib-5ac0913.tar.gz")
  430. (sha256
  431. (base32 "0ywshwpif059z5h0g7zzrdfzzdj2gr8xvwlwcsdxrms3p9iy35h8"))))
  432. (build-system gnu-build-system)
  433. (native-inputs
  434. `(("htslib" ,htslib)
  435. ("zlib" ,zlib)
  436. ("python" ,python-2)
  437. ("perl" ,perl)
  438. ("r" ,r)
  439. ("node" ,node)
  440. ("tabixpp-src" ,(package-source tabixpp-freebayes))
  441. ("smithwaterman-src" ,(package-source smithwaterman))
  442. ("multichoose-src" ,(package-source multichoose))
  443. ("fsom-src" ,(package-source fsom))
  444. ("filevercmp-src" ,(package-source filevercmp))
  445. ("fastahack-src" ,(package-source fastahack))
  446. ("intervaltree-src"
  447. ,(origin
  448. (method url-fetch)
  449. (uri (string-append
  450. "https://github.com/ekg/intervaltree/archive/"
  451. "dbb4c513d1ad3baac516fc1484c995daf9b42838" ".tar.gz"))
  452. (file-name "intervaltree-src.tar.gz")
  453. (sha256
  454. (base32 "19prwpn2wxsrijp5svfqvfcxl5nj7zdhm3jycd5kqhl9nifpmcks"))))))
  455. (arguments
  456. `(#:tests? #f
  457. #:phases
  458. (modify-phases %standard-phases
  459. (delete 'configure)
  460. (delete 'check)
  461. (add-after 'unpack 'unpack-submodule-sources
  462. (lambda* (#:key inputs #:allow-other-keys)
  463. (let ((unpack (lambda (source target)
  464. (with-directory-excursion target
  465. (zero? (system* "tar" "xvf"
  466. (assoc-ref inputs source)
  467. "--strip-components=1"))))))
  468. (and
  469. (unpack "intervaltree-src" "intervaltree")
  470. (unpack "fastahack-src" "fastahack")
  471. (unpack "filevercmp-src" "filevercmp")
  472. (unpack "fsom-src" "fsom")
  473. (unpack "multichoose-src" "multichoose")
  474. (unpack "smithwaterman-src" "smithwaterman")
  475. (unpack "tabixpp-src" "tabixpp")))))
  476. (add-after 'unpack-submodule-sources 'fix-makefile
  477. (lambda* (#:key inputs #:allow-other-keys)
  478. (substitute* '("Makefile")
  479. (("^GIT_VERSION.*") "GIT_VERSION = v1.0.0"))))
  480. (replace
  481. 'build
  482. (lambda* (#:key inputs make-flags #:allow-other-keys)
  483. (with-directory-excursion "tabixpp"
  484. (zero? (system* "make")))
  485. (zero? (system* "make" "CC=gcc"
  486. (string-append "CFLAGS=\"" "-Itabixpp "
  487. "-I" (assoc-ref inputs "htslib") "/include " "\"") "all"))))
  488. (replace
  489. 'install
  490. (lambda* (#:key outputs #:allow-other-keys)
  491. (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
  492. ;;(include (string-append (assoc-ref outputs "out") "/include"))
  493. (lib (string-append (assoc-ref outputs "out") "/lib")))
  494. (for-each (lambda (file)
  495. (install-file file bin))
  496. (find-files "bin" ".*"))
  497. ;; The header files do not correspond to libvcflib.a, therefore
  498. ;; I left them out.
  499. ;;(for-each (lambda (file)
  500. ;; (install-file file include))
  501. ;; (find-files "src" "\\.h$"))
  502. (install-file "libvcflib.a" lib)))))))
  503. (home-page "https://github.com/vcflib/vcflib/")
  504. (synopsis "Library for parsing and manipulating VCF files")
  505. (description "Vcflib provides methods to manipulate and interpret
  506. sequence variation as it can be described by VCF. It is both an API for parsing
  507. and operating on records of genomic variation as it can be described by the VCF
  508. format, and a collection of command-line utilities for executing complex
  509. manipulations on VCF files.")
  510. (license license:expat))))
  511. (define-public bash-tap
  512. (package
  513. (name "bash-tap")
  514. (version "1.0.2")
  515. (source (origin
  516. (method url-fetch)
  517. (uri (string-append "https://github.com/illusori/bash-tap/archive/"
  518. version ".tar.gz"))
  519. (file-name (string-append name "-" version ".tar.gz"))
  520. (sha256
  521. (base32 "0qs1qi38bl3ns4mpagcawv618dsk2q1lgrbddgvs0wl3ia12cyz5"))))
  522. (build-system trivial-build-system)
  523. (native-inputs `(("source" ,source)
  524. ("tar" ,tar)
  525. ("gzip" ,gzip)))
  526. (arguments
  527. `(#:modules ((guix build utils))
  528. #:builder (begin
  529. (use-modules (guix build utils))
  530. (let ((tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar"))
  531. (path (string-append (assoc-ref %build-inputs "gzip") "/bin"))
  532. (bin (string-append %output "/bin"))
  533. (source (string-append (assoc-ref %build-inputs "source"))))
  534. (setenv "PATH" path)
  535. (mkdir-p bin)
  536. (with-directory-excursion bin
  537. (zero? (system* tar "xvf" source
  538. "--strip-components=1"
  539. "--no-anchored"
  540. "bash-tap"
  541. "bash-tap-bootstrap"
  542. "bash-tap-mock")))))))
  543. (home-page "http://www.illusori.co.uk/projects/bash-tap/")
  544. (synopsis "Bash port of a Test::More/Test::Builder-style TAP-compliant
  545. test library")
  546. (description "Bash TAP is a TAP-compliant Test::More-style testing library
  547. for Bash shell scripts and functions. Along with the Test::More-style testing
  548. helpers it provides helper functions for mocking commands and functions and
  549. in-process output capturing.")
  550. ;; The author didn't specify a license.
  551. (license license:public-domain)))
  552. (define-public freebayes
  553. (let ((commit "3ce827d8ebf89bb3bdc097ee0fe7f46f9f30d5fb")
  554. (revision "1"))
  555. (package
  556. (name "freebayes")
  557. (version (string-append "1.0.2-" revision "." (string-take commit 7)))
  558. (source (origin
  559. (method git-fetch)
  560. (uri (git-reference
  561. (url "https://github.com/ekg/freebayes.git")
  562. (commit commit)))
  563. (file-name (string-append name "-" version "-checkout"))
  564. (sha256
  565. (base32 "1sbzwmcbn78ybymjnhwk7qc5r912azy5vqz2y7y81616yc3ba2a2"))))
  566. (build-system gnu-build-system)
  567. (inputs
  568. `(("zlib" ,zlib)
  569. ("htslib" ,htslib)))
  570. (native-inputs
  571. `(("bc" ,bc) ; Needed for running tests.
  572. ("samtools" ,samtools) ; Needed for running tests.
  573. ("parallel" ,parallel) ; Needed for running tests.
  574. ("procps" ,procps) ; Needed for running tests.
  575. ("bamtools" ,bamtools)
  576. ("cmake" ,cmake)
  577. ("python" ,python-2)
  578. ("node" ,node)
  579. ("r" ,r)
  580. ("perl" ,perl)
  581. ("bamtools-src" ,(package-source bamtools))
  582. ("vcflib-src" ,(package-source vcflib))
  583. ;; These are submodules for the vcflib version used in freebayes
  584. ("tabixpp-src" ,(package-source tabixpp-freebayes))
  585. ("smithwaterman-src" ,(package-source smithwaterman))
  586. ("multichoose-src" ,(package-source multichoose))
  587. ("fsom-src" ,(package-source fsom))
  588. ("filevercmp-src" ,(package-source filevercmp))
  589. ("fastahack-src" ,(package-source fastahack))
  590. ("intervaltree-src"
  591. ,(origin
  592. (method url-fetch)
  593. (uri (string-append
  594. "https://github.com/ekg/intervaltree/archive/"
  595. "dbb4c513d1ad3baac516fc1484c995daf9b42838" ".tar.gz"))
  596. (file-name "intervaltree-src.tar.gz")
  597. (sha256
  598. (base32 "19prwpn2wxsrijp5svfqvfcxl5nj7zdhm3jycd5kqhl9nifpmcks"))))
  599. ;; These submodules are needed to run the tests.
  600. ("bash-tap-src" ,(package-source bash-tap))
  601. ;; ,(origin
  602. ;; (method url-fetch)
  603. ;; (uri (string-append "https://github.com/illusori/bash-tap/archive/"
  604. ;; "c38fbfa401600cc81ccda66bfc0da3ea56288d03" ".tar.gz"))
  605. ;; (file-name "bash-tap-src.tar.gz")
  606. ;; (sha256
  607. ;; (base32 "07ijb1p0aa65ajpg9nkghc183iha6lwiydkckay8pghapa01j6nz"))))
  608. ("test-simple-bash-src"
  609. ,(origin
  610. (method url-fetch)
  611. (uri (string-append "https://github.com/ingydotnet/test-simple-bash/archive/"
  612. "124673ff204b01c8e96b7fc9f9b32ee35d898acc" ".tar.gz"))
  613. (file-name "test-simple-bash-src.tar.gz")
  614. (sha256
  615. (base32 "016xf3wbgqbav9dncvfdx5k0f10z5xwq8jdszajzmcvnhz5wis14"))))))
  616. (arguments
  617. `(#:phases
  618. (modify-phases %standard-phases
  619. (delete 'configure)
  620. (add-after 'unpack 'unpack-submodule-sources
  621. (lambda* (#:key inputs #:allow-other-keys)
  622. (let ((unpack (lambda (source target)
  623. (with-directory-excursion target
  624. (zero? (system* "tar" "xvf"
  625. (assoc-ref inputs source)
  626. "--strip-components=1"))))))
  627. (and
  628. (unpack "bamtools-src" "bamtools")
  629. (unpack "vcflib-src" "vcflib")
  630. ;;(unpack "intervaltree-src" "intervaltree")
  631. (unpack "fastahack-src" "vcflib/fastahack")
  632. (unpack "filevercmp-src" "vcflib/filevercmp")
  633. (unpack "fsom-src" "vcflib/fsom")
  634. (unpack "intervaltree-src" "vcflib/intervaltree")
  635. (unpack "multichoose-src" "vcflib/multichoose")
  636. (unpack "smithwaterman-src" "vcflib/smithwaterman")
  637. (unpack "tabixpp-src" "vcflib/tabixpp")
  638. (unpack "test-simple-bash-src" "test/test-simple-bash")
  639. (unpack "bash-tap-src" "test/bash-tap")))))
  640. (add-after 'unpack-submodule-sources 'fix-makefile
  641. (lambda* (#:key inputs #:allow-other-keys)
  642. ;; We don't have the .git folder to get the version tag from.
  643. ;; For this checkout of the code, it's v1.0.0.
  644. (substitute* '("vcflib/Makefile")
  645. (("^GIT_VERSION.*") "GIT_VERSION = v1.0.0"))))
  646. (replace 'build
  647. (lambda* (#:key inputs make-flags #:allow-other-keys)
  648. (and
  649. ;; Compile Bamtools before compiling the main project.
  650. (with-directory-excursion "bamtools"
  651. (system* "mkdir" "build")
  652. (with-directory-excursion "build"
  653. (and (zero? (system* "cmake" "../"))
  654. (zero? (system* "make")))))
  655. ;; Compile vcflib before we compiling the main project.
  656. (with-directory-excursion "vcflib"
  657. (with-directory-excursion "tabixpp"
  658. (let ((htslib-ref (assoc-ref inputs "htslib")))
  659. (zero?
  660. (system* "make" "HTS_HEADERS="
  661. (string-append "HTS_LIB=" htslib-ref "/lib/libhts.a")
  662. (string-append "LIBPATH=-L. -L" htslib-ref "/include")))))
  663. (zero? (system* "make" "CC=gcc"
  664. (string-append "CFLAGS=\"" "-Itabixpp "
  665. "-I" (assoc-ref inputs "htslib") "/include " "\"") "all")))
  666. (with-directory-excursion "src"
  667. (zero? (system* "make"))))))
  668. (replace 'install
  669. (lambda* (#:key outputs #:allow-other-keys)
  670. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  671. (install-file "bin/freebayes" bin)
  672. (install-file "bin/bamleftalign" bin))))
  673. ;; There are three tests that fail. All because of the -P
  674. ;; (--perl-regexp) option in grep, which is not compiled into the
  675. ;; version of grep in Guix.
  676. (replace 'check
  677. (lambda* (#:key inputs #:allow-other-keys)
  678. (system* "make" "test"))))))
  679. (home-page "https://github.com/ekg/freebayes")
  680. (synopsis "Haplotype-based variant detector")
  681. (description "FreeBayes is a Bayesian genetic variant detector designed to
  682. find small polymorphisms, specifically SNPs (single-nucleotide polymorphisms),
  683. indels (insertions and deletions), MNPs (multi-nucleotide polymorphisms), and
  684. complex events (composite insertion and substitution events) smaller than the
  685. length of a short-read sequencing alignment.")
  686. (license license:expat))))
  687. (define-public r-biocpreprocesscore
  688. (package
  689. (name "r-biocpreprocesscore")
  690. (version "1.34.0")
  691. (source (origin
  692. (method url-fetch)
  693. (uri (bioconductor-uri "preprocessCore" version))
  694. (sha256
  695. (base32
  696. "0bcfi26ahs4ybagvz29vlp1wldhhbwwh73xz6v6xb07nakyzb6cf"))))
  697. (properties
  698. `((upstream-name . "BiocpreprocessCore")
  699. (r-repository . bioconductor)))
  700. (build-system r-build-system)
  701. (home-page "http://bioconductor.org/packages/preprocessCore")
  702. (synopsis "Preprocess functions for Bioconductor")
  703. (description
  704. "A library of core preprocessing routines.")
  705. (license license:lgpl2.0+)))
  706. (define-public r-wgcna
  707. (let ((commit "425bc170cc0873ddbd414675ac40f6d4d724c7cb"))
  708. (package
  709. (name "r-wgcna")
  710. (version (string-append "1.49-" commit))
  711. (source (origin
  712. (method git-fetch)
  713. (uri (git-reference
  714. ;; (url "https://github.com/genenetwork/WGCNA.git")
  715. (url "https://github.com/pjotrp/WGCNA.git")
  716. (commit commit)))
  717. (file-name (string-append name "-" commit))
  718. (sha256
  719. (base32
  720. "1zqnsb8s3065rq1y2y3l79zi8wmdwjkcjls96ypycrb7pmdil58j"))))
  721. (properties `((upstream-name . "WGCNA")))
  722. (build-system r-build-system)
  723. (propagated-inputs
  724. `( ;; ("r-annotationdbi" ,r-annotationdbi)
  725. ; ("r-biocparallel" ,r-biocparallel)
  726. ("r-doparallel" ,r-doparallel)
  727. ("r-dynamictreecut" ,r-dynamictreecut)
  728. ("r-fastcluster" ,r-fastcluster)
  729. ("r-foreach" ,r-foreach)
  730. ("r-go-db" ,r-go-db)
  731. ; ("r-grdevices" ,r-grdevices)
  732. ("r-hmisc" ,r-hmisc)
  733. ("r-impute" ,r-impute)
  734. ("r-matrixstats" ,r-matrixstats)
  735. ; ("r-parallel" ,r-parallel)
  736. ("r-biocpreprocesscore" ,r-biocpreprocesscore)
  737. ; ("r-splines" ,r-splines)
  738. ; ("r-stats" ,r-stats)
  739. ; ("r-survival" ,r-survival)
  740. ; ("r-utils" ,r-utils)
  741. ))
  742. (arguments
  743. `(
  744. #:tests? #f)) ; no 'setup.py test'
  745. (home-page
  746. "http://www.genetics.ucla.edu/labs/horvath/CoexpressionNetwork/Rpackages/WGCNA/")
  747. (synopsis
  748. "Weighted gene correlation network analysis (wgcna)")
  749. (description
  750. "Functions necessary to perform Weighted Correlation Network
  751. Analysis on high-dimensional data. Includes functions for rudimentary
  752. data cleaning, construction of correlation networks, module
  753. identification, summarization, and relating of variables and modules
  754. to sample traits. Also includes a number of utility functions for
  755. data manipulation and visualization.")
  756. (license license:gpl2+))))
  757. (define-public plink2
  758. (package
  759. (name "plink2")
  760. (version "1.90b3")
  761. (source
  762. (origin
  763. (method url-fetch)
  764. ;; https://github.com/chrchang/plink-ng/archive/v1.90b3.tar.gz
  765. (uri (string-append
  766. "https://github.com/chrchang/plink-ng/archive/v"
  767. version ".tar.gz"))
  768. (sha256
  769. (base32 "03fzib1al5qkr9vxv63wxmv6y2pfb1rmir0h8jpi72r87hczqjig"))
  770. (patches (list (search-patch "plink-ng-Makefile-zlib.patch")))))
  771. (build-system gnu-build-system)
  772. (arguments
  773. '(#:tests? #f ;no "check" target
  774. #:phases
  775. (modify-phases %standard-phases
  776. (delete 'configure)
  777. (replace 'build
  778. (lambda _
  779. (zero? (system* "make" "-f" "Makefile.std"))
  780. ))
  781. (replace 'install
  782. (lambda* (#:key outputs #:allow-other-keys)
  783. (let ((bin (string-append (assoc-ref outputs "out")
  784. "/bin/")))
  785. (install-file "plink2" bin)
  786. #t))))))
  787. (inputs
  788. `(("zlib" ,zlib)
  789. ("openblas" ,openblas)
  790. ;; ("atlas" ,atlas)
  791. ;; ("lapack" ,lapack)
  792. ("gfortran" ,gfortran)
  793. ))
  794. (native-inputs
  795. `(("unzip" ,unzip)))
  796. (home-page "https://www.cog-genomics.org/plink2")
  797. (synopsis "Whole genome association analysis toolset")
  798. (description
  799. "PLINK is a whole genome association analysis toolset, designed to
  800. perform a range of basic, large-scale analyses in a computationally efficient
  801. manner. The focus of PLINK is purely on analysis of genotype/phenotype data,
  802. so there is no support for steps prior to this (e.g. study design and
  803. planning, generating genotype or CNV calls from raw data). Through
  804. integration with gPLINK and Haploview, there is some support for the
  805. subsequent visualization, annotation and storage of results.")
  806. ;; Code is released under GPLv2, except for fisher.h, which is under
  807. ;; LGPLv2.1+
  808. (license (list license:gpl2 license:lgpl2.1+))))
  809. (define-public plink-ng
  810. (let ((commit "5d1db4313ba0cc976562da233db4aced78975d10"))
  811. (package
  812. (name "plink-ng")
  813. (version (string-append "1.90b3-" commit )) ; Aug 11, 2016
  814. (source (origin
  815. (method git-fetch)
  816. (uri (git-reference
  817. (url "https://github.com/genenetwork/plink-ng.git")
  818. (commit commit)))
  819. (file-name (string-append name "-" commit))
  820. (sha256
  821. (base32
  822. "1366li3ks9076bblvd1rpzkjq4j8f8f08lhga4c1ckrkil3xww4m"))))
  823. ;; no longer (patches (list (search-patch "plink-ng-Makefile-zlib-git.patch")))))
  824. (inputs
  825. `(("zlib" ,zlib)
  826. ("openblas" ,openblas)
  827. ;; ("atlas" ,atlas) ; openblas replaces atlas
  828. ("lapack" ,lapack) ; lapack is disabled in GUIX openblas
  829. ;; ("gfortran" ,gfortran)
  830. ;; ("python" ,python-2) ;; for tests - currently disabled
  831. ))
  832. (native-inputs
  833. `(("unzip" ,unzip)))
  834. (build-system gnu-build-system)
  835. (arguments
  836. '(#:tests? #f ;no "check" target. Some of the python-based tests fail
  837. #:phases
  838. (modify-phases %standard-phases
  839. (delete 'configure)
  840. (replace 'build
  841. (lambda _
  842. (zero? (system* "make" "-f" "Makefile.guix"))
  843. ))
  844. (replace 'install
  845. (lambda* (#:key outputs #:allow-other-keys)
  846. (let ((bin (string-append (assoc-ref outputs "out")
  847. "/bin/")))
  848. (install-file "plink2" bin)
  849. #t))))))
  850. (home-page "https://www.cog-genomics.org/plink2")
  851. (synopsis "Whole genome association analysis toolset")
  852. (description
  853. "PLINK is a whole genome association analysis toolset, designed to
  854. perform a range of basic, large-scale analyses in a computationally efficient
  855. manner. The focus of PLINK is purely on analysis of genotype/phenotype data,
  856. so there is no support for steps prior to this (e.g. study design and
  857. planning, generating genotype or CNV calls from raw data). Through
  858. integration with gPLINK and Haploview, there is some support for the
  859. subsequent visualization, annotation and storage of results.")
  860. (license license:gpl3+))))
  861. (define-public gemma-git
  862. (let ((commit "2de4bfab3"))
  863. (package
  864. (name "gemma-git")
  865. (version (string-append "0.9.5-" commit ))
  866. (source (origin
  867. (method git-fetch)
  868. (uri (git-reference
  869. (url "https://github.com/genenetwork/GEMMA.git")
  870. (commit commit)))
  871. (file-name (string-append name "-" commit))
  872. (sha256
  873. (base32
  874. "1drffdgwbzgiw9sf55ghl3zjv58f8i9kfz0zys5mp6n06syp4ira"))))
  875. (inputs `(
  876. ("gsl" ,gsl)
  877. ("lapack" ,lapack)
  878. ("zlib" ,zlib)
  879. ))
  880. (build-system gnu-build-system)
  881. (arguments
  882. `(#:make-flags '(" FORCE_DYNAMIC=1")
  883. #:phases
  884. (modify-phases %standard-phases
  885. (delete 'configure)
  886. (add-before 'build 'bin-mkdir
  887. (lambda _
  888. (mkdir-p "bin")
  889. ))
  890. (replace 'install
  891. (lambda* (#:key outputs #:allow-other-keys)
  892. (let ((out (assoc-ref outputs "out")))
  893. (install-file "bin/gemma" (string-append out "/bin"))))))
  894. #:tests? #f))
  895. (home-page "")
  896. (synopsis "Tool for genome-wide efficient mixed model association")
  897. (description "GEMMA is the software implementing the Genome-wide
  898. Efficient Mixed Model Association algorithm for a standard linear
  899. mixed model and some of its close relatives for genome-wide
  900. association studies (GWAS).")
  901. (license license:gpl3))))
  902. (define-public sambamba
  903. (let ((commit "91096e78c81162f855b1044a4b2d41895bd27262"))
  904. (package
  905. (name "sambamba")
  906. (version (string-append "0.6.6-pre2-" (string-take commit 7)))
  907. (source (origin
  908. (method git-fetch)
  909. (uri (git-reference
  910. (url "https://github.com/pjotrp/sambamba.git")
  911. (commit commit)))
  912. (file-name (string-append name "-" version "-checkout"))
  913. (sha256
  914. (base32
  915. "0d7d0f3ri8qi5r9wq2wy9wzkr1wm68alfsn20q61lqzrfrfwm93k"))))
  916. (build-system gnu-build-system)
  917. (outputs '("out"
  918. "debug"))
  919. (native-inputs
  920. `(("ldc" ,ldc)
  921. ("lz4" ,lz4)
  922. ("zlib" ,zlib)
  923. ("coreutils" ,coreutils) ; for env
  924. ("perl" ,perl) ; Needed for htslib
  925. ("ruby" ,ruby) ; Needed for htslib
  926. ("python" ,python-2) ; Needed for htslib
  927. ("gcc" ,gcc)
  928. ("which" ,which)
  929. ("htslib-src"
  930. ,(origin
  931. (method url-fetch)
  932. (uri "https://github.com/lomereiter/htslib/archive/2f3c3ea7b301f9b45737a793c0b2dcf0240e5ee5.tar.gz")
  933. ;;(uri "https://github.com/samtools/htslib/archive/1.3.tar.gz")
  934. (file-name "htslib-0.2.0-rc10-271-g2f3c3ea-dirty.tar.gz")
  935. (sha256
  936. (base32 "0bl6w856afnbgdsw8bybsxpqsyf2ba3f12rqh47hhpxvv866g08w"))))
  937. ;;(base32 "1bqkif7yrqmiqak5yb74kgpb2lsdlg7y344qa1xkdg7k1l4m86i9"))
  938. ;;(patches (list (search-patch "htslib-add-cram_to_bam.patch")))))
  939. ("biod-src"
  940. ,(origin
  941. (method git-fetch)
  942. (uri (git-reference
  943. (url "https://github.com/biod/BioD.git")
  944. (commit "1248586b54af4bd4dfb28ebfebfc6bf012e7a587")))
  945. (file-name (string-append "biod-src-" (string-take commit 7) "-checkout"))
  946. (sha256
  947. (base32 "1m8hi1n7x0ri4l6s9i0x6jg4z4v94xrfdzp7mbizdipfag0m17g3"))))))
  948. (arguments
  949. `(#:tests? #f ; no tests available
  950. #:phases
  951. (modify-phases %standard-phases
  952. (delete 'configure)
  953. (delete 'check)
  954. (add-after 'unpack 'unpack-htslib-sources
  955. (lambda* (#:key inputs #:allow-other-keys)
  956. ;; The current build compiles htslib statically into the
  957. ;; executable. On top of that, we need to patch the latest
  958. ;; version of htslib to have it working with Sambamba.
  959. (and (with-directory-excursion "htslib"
  960. (zero? (system* "tar" "xvf" (assoc-ref inputs "htslib-src")
  961. "--strip-components=1")))
  962. ;; (zero? (system* "cp" "--recursive" (string-append (assoc-ref inputs "biod-src") "/*") "BioD/")))))
  963. (copy-recursively (assoc-ref inputs "biod-src") "BioD"))))
  964. (replace
  965. 'build
  966. (lambda* (#:key inputs make-flags #:allow-other-keys)
  967. (zero? (system* "make" "-f" "Makefile.guix" "guix-debug"
  968. (string-append "LDC_LIB_PATH="
  969. (assoc-ref inputs "ldc")
  970. "/lib")))))
  971. (replace
  972. 'install
  973. (lambda* (#:key outputs #:allow-other-keys)
  974. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  975. (install-file "build/sambamba" bin)))))))
  976. (home-page "https://github.com/lomereiter/sambamba")
  977. (synopsis "Fast tool for working with SAM, BAM and CRAM files written in D.")
  978. (description
  979. "Sambamba is a high performance modern robust and fast
  980. tool (and library), written in the D programming language, for working
  981. with SAM, BAM and CRAM files. Current parallelised functionality is
  982. an important subset of samtools functionality, including view, index,
  983. sort, markdup, and depth.")
  984. (license license:gpl2+))))
  985. (define-public vcflib
  986. (let ((commit "3ce827d8ebf89bb3bdc097ee0fe7f46f9f30d5fb"))
  987. (package
  988. (name "vcflib")
  989. (version (string-append "v1.0.2-" (string-take commit 7)))
  990. (source
  991. (origin
  992. (method url-fetch)
  993. (uri (string-append "https://github.com/vcflib/vcflib/archive/"
  994. "5ac091365fdc716cc47cc5410bb97ee5dc2a2c92" ".tar.gz"))
  995. (file-name "vcflib-5ac0913.tar.gz")
  996. (sha256
  997. (base32 "0ywshwpif059z5h0g7zzrdfzzdj2gr8xvwlwcsdxrms3p9iy35h8"))))
  998. (build-system gnu-build-system)
  999. (native-inputs
  1000. `(("htslib" ,htslib)
  1001. ("zlib" ,zlib)
  1002. ("python" ,python-2)
  1003. ("perl" ,perl)
  1004. ("tabixpp-src"
  1005. ,(origin
  1006. (method url-fetch)
  1007. (uri (string-append "https://github.com/ekg/tabixpp/archive/"
  1008. "bbc63a49acc52212199f92e9e3b8fba0a593e3f7" ".tar.gz"))
  1009. (file-name "tabixpp-src.tar.gz")
  1010. (sha256
  1011. (base32 "1s06wmpgj4my4pik5kp2lc42hzzazbp5ism2y4i2ajp2y1c68g77"))))
  1012. ("intervaltree-src"
  1013. ,(origin
  1014. (method url-fetch)
  1015. (uri (string-append
  1016. "https://github.com/ekg/intervaltree/archive/"
  1017. "dbb4c513d1ad3baac516fc1484c995daf9b42838" ".tar.gz"))
  1018. (file-name "intervaltree-src.tar.gz")
  1019. (sha256
  1020. (base32 "19prwpn2wxsrijp5svfqvfcxl5nj7zdhm3jycd5kqhl9nifpmcks"))))
  1021. ("smithwaterman-src"
  1022. ,(origin
  1023. (method url-fetch)
  1024. (uri (string-append "https://github.com/ekg/smithwaterman/archive/"
  1025. "203218b47d45ac56ef234716f1bd4c741b289be1" ".tar.gz"))
  1026. (file-name "smithwaterman-src.tar.gz")
  1027. (sha256
  1028. (base32 "1lkxy4xkjn96l70jdbsrlm687jhisgw4il0xr2dm33qwcclzzm3b"))))
  1029. ("multichoose-src"
  1030. ,(origin
  1031. (method url-fetch)
  1032. (uri (string-append "https://github.com/ekg/multichoose/archive/"
  1033. "73d35daa18bf35729b9ba758041a9247a72484a5" ".tar.gz"))
  1034. (file-name "multichoose-src.tar.gz")
  1035. (sha256
  1036. (base32 "07aizwdabmlnjaq4p3v0vsasgz1xzxid8xcxcw3paq8kh9c1099i"))))
  1037. ("fsom-src"
  1038. ,(origin
  1039. (method url-fetch)
  1040. (uri (string-append "https://github.com/ekg/fsom/archive/"
  1041. "a6ef318fbd347c53189384aef7f670c0e6ce89a3" ".tar.gz"))
  1042. (file-name "fsom-src.tar.gz")
  1043. (sha256
  1044. (base32 "0q6b57ppxfvsm5cqmmbfmjpn5qvx2zi5pamvp3yh8gpmmz8cfbl3"))))
  1045. ("filevercmp-src"
  1046. ,(origin
  1047. (method url-fetch)
  1048. (uri (string-append "https://github.com/ekg/filevercmp/archive/"
  1049. "1a9b779b93d0b244040274794d402106907b71b7" ".tar.gz"))
  1050. (file-name "filevercmp-src.tar.gz")
  1051. (sha256
  1052. (base32 "0yp5jswf5j2pqc6517x277s4s6h1ss99v57kxw9gy0jkfl3yh450"))))
  1053. ("fastahack-src"
  1054. ,(origin
  1055. (method url-fetch)
  1056. (uri (string-append "https://github.com/ekg/fastahack/archive/"
  1057. "c68cebb4f2e5d5d2b70cf08fbdf1944e9ab2c2dd" ".tar.gz"))
  1058. (file-name "fastahack-src.tar.gz")
  1059. (sha256
  1060. (base32 "0j25lcl3jk1kls66zzxjfyq5ir6sfcvqrdwfcva61y3ajc9ssay2"))))))
  1061. (arguments
  1062. `(#:tests? #f
  1063. #:phases
  1064. (modify-phases %standard-phases
  1065. (delete 'configure)
  1066. (delete 'check)
  1067. (add-after 'unpack 'unpack-submodule-sources
  1068. (lambda* (#:key inputs #:allow-other-keys)
  1069. (let ((unpack (lambda (source target)
  1070. (with-directory-excursion target
  1071. (zero? (system* "tar" "xvf"
  1072. (assoc-ref inputs source)
  1073. "--strip-components=1"))))))
  1074. (and
  1075. (unpack "intervaltree-src" "intervaltree")
  1076. (unpack "fastahack-src" "fastahack")
  1077. (unpack "filevercmp-src" "filevercmp")
  1078. (unpack "fsom-src" "fsom")
  1079. (unpack "intervaltree-src" "intervaltree")
  1080. (unpack "multichoose-src" "multichoose")
  1081. (unpack "smithwaterman-src" "smithwaterman")
  1082. (unpack "tabixpp-src" "tabixpp")))))
  1083. (add-after 'unpack-submodule-sources 'fix-makefile
  1084. (lambda* (#:key inputs #:allow-other-keys)
  1085. (substitute* '("Makefile")
  1086. (("^GIT_VERSION.*") "GIT_VERSION = v1.0.0"))))
  1087. (replace
  1088. 'build
  1089. (lambda* (#:key inputs make-flags #:allow-other-keys)
  1090. (with-directory-excursion "tabixpp"
  1091. (zero? (system* "make")))
  1092. (zero? (system* "make" "CC=gcc"
  1093. (string-append "CFLAGS=\"" "-Itabixpp "
  1094. "-I" (assoc-ref inputs "htslib") "/include " "\"") "all"))))
  1095. (replace
  1096. 'install
  1097. (lambda* (#:key outputs #:allow-other-keys)
  1098. (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
  1099. (lib (string-append (assoc-ref outputs "out") "/lib")))
  1100. (for-each (lambda (file)
  1101. (install-file file bin))
  1102. (find-files "bin" ".*"))
  1103. (install-file "libvcflib.a" lib)))))))
  1104. (home-page "https://github.com/vcflib/vcflib/")
  1105. (synopsis "Library for parsing and manipulating VCF files")
  1106. (description "Vcflib provides methods to manipulate and interpret
  1107. sequence variation as it can be described by VCF. It is both an API for parsing
  1108. and operating on records of genomic variation as it can be described by the VCF
  1109. format, and a collection of command-line utilities for executing complex
  1110. manipulations on VCF files.")
  1111. (license license:expat))))
  1112. (define-public pindel
  1113. (package
  1114. (name "pindel")
  1115. (version "0.2.5b8")
  1116. (source (origin
  1117. (method url-fetch)
  1118. (uri (string-append "https://github.com/genome/pindel/archive/v"
  1119. version ".tar.gz"))
  1120. (file-name (string-append name "-" version ".tar.gz"))
  1121. (sha256
  1122. (base32 "06bsf0psxwf7h5p3j97xkh9k5qrwhxh6xn942y1j1m2inyhgs8bz"))))
  1123. (build-system gnu-build-system)
  1124. (inputs
  1125. `(("samtools" ,samtools)
  1126. ("htslib" ,htslib)
  1127. ("zlib" ,zlib)))
  1128. (native-inputs
  1129. `(("cppcheck" ,cppcheck)
  1130. ("python" ,python-2)
  1131. ("perl" ,perl)))
  1132. (arguments
  1133. `(#:phases
  1134. (modify-phases %standard-phases
  1135. (delete 'configure) ; There is no configure phase.
  1136. ;; The build phase needs to run 'make' twice for the reasons described
  1137. ;; below.
  1138. (replace 'build
  1139. (lambda* (#:key inputs #:allow-other-keys)
  1140. ;; The first run creates a Makefile.local file. Make will report
  1141. ;; the failure to find Makefile.local, but we can ignore this error.
  1142. (system* "make" (string-append "SAMTOOLS=" (assoc-ref inputs "samtools")))
  1143. ;; The second run actually compiles the program. Now Makefile.local
  1144. ;; is available, and we should treat an exiting make with an error as
  1145. ;; a true error.
  1146. (zero? (system* "make"))))
  1147. (replace 'install
  1148. (lambda* (#:key outputs #:allow-other-keys)
  1149. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  1150. (install-file "src/pindel" bin)
  1151. (install-file "src/pindel2vcf" bin)
  1152. (install-file "src/pindel2vcf4tcga" bin)
  1153. (install-file "src/sam2pindel" bin))))
  1154. ;; There are multiple test targets, so in order to run all
  1155. ;; tests, we must run the separate make targets.
  1156. (replace 'check
  1157. (lambda* (#:key inputs #:allow-other-keys)
  1158. (and
  1159. (zero? (system* "make" "acceptance-tests"))
  1160. (zero? (system* "make" "coverage-tests"))
  1161. (zero? (system* "make" "cppcheck"))
  1162. (zero? (system* "make" "functional-tests"))
  1163. (zero? (system* "make" "regression-tests"))))))))
  1164. (home-page "https://github.com/genome/pindel")
  1165. (synopsis "Structural variants detector for next-gen sequencing data")
  1166. (description "Pindel can detect breakpoints of large deletions, medium sized
  1167. insertions, inversions, tandem duplications and other structural variants at
  1168. single-based resolution from next-gen sequence data. It uses a pattern growth
  1169. approach to identify the breakpoints of these variants from paired-end short
  1170. reads.")
  1171. (license license:gpl3+)))
  1172. (define-public varscan
  1173. (package
  1174. (name "varscan")
  1175. (version "2.4.1")
  1176. (source (origin
  1177. (method url-fetch)
  1178. (uri (string-append
  1179. "https://github.com/dkoboldt/varscan/releases/download/v"
  1180. version "/VarScan.v" version ".source.jar"))
  1181. (sha256
  1182. (base32 "0y45ympkza7qwcbcisg006286pwjbr5978n03hx5nvl09f0mapk8"))))
  1183. (build-system ant-build-system)
  1184. (arguments
  1185. `(#:phases
  1186. (modify-phases %standard-phases
  1187. (replace 'unpack
  1188. (lambda _
  1189. (mkdir "source")
  1190. (chdir "source")
  1191. (and
  1192. ;; Unpack the Java archive containing the source files.
  1193. (zero? (system* "jar" "xf" (assoc-ref %build-inputs "source")))
  1194. ;; Remove existing compiled output.
  1195. (with-directory-excursion "net/sf/varscan/"
  1196. (for-each (lambda (file)
  1197. (unless (string= (string-take-right file 5) ".java")
  1198. (zero? (system* "rm" file))))
  1199. (find-files "." #:directories? #f))))))
  1200. (replace 'build
  1201. (lambda _
  1202. (let ((classes '()))
  1203. (and
  1204. ;; Compile the source files.
  1205. (with-directory-excursion "net/sf/varscan/"
  1206. (for-each (lambda (file)
  1207. (when (string= (string-take-right file 5) ".java")
  1208. (zero? (system* "javac" file))
  1209. (cons ))
  1210. (find-files "." #:directories? #f)))
  1211. ;; Construct the new Java archive.
  1212. (zero? (system* "jar" "cfm" "varscan-2.4.1.jar"
  1213. "META-INF/MANIFEST.MF"
  1214. "net/sf/varscan/*.java")))))))
  1215. (replace 'install
  1216. (lambda _
  1217. (let ((out (string-append (assoc-ref %outputs "out")
  1218. "/share/java/varscan/")))
  1219. (mkdir-p out)
  1220. (install-file "varscan-2.4.1.jar" out)))))))
  1221. (home-page "http://dkoboldt.github.io/varscan/")
  1222. (synopsis "Variant detection in massively parallel sequencing data")
  1223. (description "")
  1224. ;; Free for non-commercial use by academic, government, and
  1225. ;; non-profit/not-for-profit institutions
  1226. (license license:non-copyleft)))