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.

2409 lines
102 KiB

7 years ago
10 months ago
7 years ago
10 months ago
2 years ago
10 months ago
2 years ago
7 years ago
2 years ago
10 months ago
2 years ago
2 years ago
2 years ago
11 months ago
2 years ago
7 years ago
2 years ago
7 years ago
7 years ago
2 years ago
10 months ago
11 months ago
2 years ago
2 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 years ago
11 months ago
2 years ago
11 months ago
2 years ago
11 months ago
2 years ago
2 years ago
11 months ago
11 months ago
2 years ago
11 months ago
2 years ago
2 years ago
11 months ago
11 months ago
11 months ago
2 years ago
11 months ago
2 years ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
  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 hg-download)
  9. #:use-module (guix build-system ant)
  10. #:use-module (guix build-system cargo)
  11. #:use-module (guix build-system cmake)
  12. #:use-module (guix build-system gnu)
  13. #:use-module (guix build-system meson)
  14. #:use-module (guix build-system python)
  15. #:use-module (guix build-system trivial)
  16. #:use-module (guix build-system waf)
  17. #:use-module (gnu packages)
  18. #:use-module (gn packages crates-io)
  19. #:use-module (gn packages java)
  20. #:use-module (gn packages python)
  21. #:use-module (gn packages twint)
  22. #:use-module (gnu packages algebra)
  23. #:use-module (gnu packages autotools)
  24. #:use-module (gnu packages base)
  25. #:use-module (gnu packages bash)
  26. #:use-module (gnu packages bioconductor)
  27. #:use-module (gnu packages bioinformatics)
  28. #:use-module (gnu packages boost)
  29. #:use-module (gnu packages check)
  30. #:use-module (gnu packages cmake)
  31. #:use-module (gnu packages compression)
  32. #:use-module (gnu packages cran)
  33. #:use-module (gnu packages crates-io)
  34. #:use-module (gnu packages curl)
  35. #:use-module (gnu packages databases)
  36. #:use-module (gnu packages datastructures)
  37. #:use-module (gnu packages elf)
  38. #:use-module (gnu packages fontutils)
  39. #:use-module (gnu packages gcc)
  40. #:use-module (gnu packages ghostscript)
  41. #:use-module (gnu packages gtk)
  42. #:use-module (gnu packages guile)
  43. #:use-module (gnu packages image)
  44. #:use-module (gnu packages imagemagick)
  45. #:use-module (gnu packages jemalloc)
  46. #:use-module (gnu packages linux)
  47. #:use-module (gnu packages machine-learning)
  48. #:use-module (gnu packages maths)
  49. #:use-module (gnu packages mpi)
  50. #:use-module (gnu packages ncurses)
  51. #:use-module (gnu packages perl)
  52. #:use-module (gnu packages pkg-config)
  53. #:use-module (gnu packages protobuf)
  54. #:use-module (gnu packages python)
  55. #:use-module (gnu packages python-science)
  56. #:use-module (gnu packages python-web)
  57. #:use-module (gnu packages python-xyz)
  58. #:use-module (gnu packages rdf)
  59. #:use-module (gnu packages readline)
  60. #:use-module (gnu packages rsync)
  61. #:use-module (gnu packages ruby)
  62. #:use-module (gnu packages rust)
  63. #:use-module (gnu packages serialization)
  64. #:use-module (gnu packages shells)
  65. #:use-module (gnu packages statistics)
  66. #:use-module (gnu packages tcl)
  67. #:use-module (gnu packages time)
  68. #:use-module (gnu packages tls)
  69. #:use-module (gnu packages vim)
  70. #:use-module (gnu packages web))
  71. (define-public contra
  72. (package
  73. (name "contra")
  74. (version "2.0.6")
  75. (source (origin
  76. (method url-fetch)
  77. (uri (string-append
  78. "mirror://sourceforge/contra-cnv/CONTRA.V"
  79. (version-major+minor version) "/CONTRA.v" version ".tar.gz"))
  80. (sha256
  81. (base32
  82. "0agpcm2xh5f0i9n9sx1kvln6mzdksddmh11bvzj6bh76yw5pnw91"))
  83. (modules '((guix build utils)))
  84. (snippet
  85. '(begin
  86. (delete-file "BEDTools.v2.11.2.tar.gz") #t))))
  87. (build-system gnu-build-system)
  88. (propagated-inputs
  89. `(("python" ,python-2)
  90. ("r" ,r)
  91. ;; ("r-dnacopy" ,r-dnacopy) <-- missing in Pjotr's tree
  92. ("bedtools" ,bedtools)
  93. ("samtools" ,samtools)))
  94. (arguments
  95. `(#:tests? #f ; There are no tests.
  96. #:phases
  97. (modify-phases %standard-phases
  98. (delete 'configure)
  99. (delete 'build) ; We can use Guix's BEDtools instead.
  100. (replace 'install
  101. (lambda* (#:key outputs #:allow-other-keys)
  102. (let* ((out (assoc-ref outputs "out"))
  103. (bin (string-append out "/bin"))
  104. (doc (string-append out "/share/doc/contra")))
  105. (copy-recursively "scripts" (string-append bin "/scripts"))
  106. (install-file "contra.py" bin)
  107. (install-file "baseline.py" bin)
  108. ;; There's only a pre-built PDF available.
  109. (install-file "CONTRA_User_Guide.2.0.pdf" doc))
  110. #t)))))
  111. (home-page "http://contra-cnv.sourceforge.net/")
  112. (synopsis "Tool for copy number variation (CNV) detection for targeted
  113. resequencing data")
  114. (description "CONTRA is a tool for copy number variation (CNV) detection
  115. for targeted resequencing data such as those from whole-exome capture data.
  116. CONTRA calls copy number gains and losses for each target region with key
  117. strategies including the use of base-level log-ratios to remove GC-content
  118. bias, correction for an imbalanced library size effect on log-ratios, and the
  119. estimation of log-ratio variations via binning and interpolation. It takes
  120. standard alignment formats (BAM/SAM) and outputs in variant call format
  121. (VCF 4.0) for easy integration with other next generation sequencing analysis
  122. package.")
  123. (license license:gpl3+)))
  124. (define boost-delly
  125. (package (inherit boost)
  126. (name "boost-delly")
  127. (version "1.57.0")
  128. (source (origin
  129. (method url-fetch)
  130. (uri (string-append
  131. "mirror://sourceforge/boost/boost_"
  132. (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
  133. ".tar.bz2"))
  134. (sha256
  135. (base32
  136. "0rs94vdmg34bwwj23fllva6mhrml2i7mvmlb11zyrk1k5818q34i"))))))
  137. (define-public delly
  138. (package
  139. (name "delly")
  140. (version "0.7.2")
  141. (source (origin
  142. (method url-fetch)
  143. (uri (string-append "https://github.com/tobiasrausch/delly/archive/v"
  144. version ".tar.gz"))
  145. (sha256
  146. (base32 "173mmg43dbxqkyq0kiffz63xbmggr2kzd55mwxci9yfh5md1zprn"))
  147. (patches (list (search-patch "delly-use-system-libraries.patch")))))
  148. (build-system gnu-build-system)
  149. (native-inputs
  150. `(("python" ,python-2)))
  151. (inputs
  152. `(("boost" ,boost-delly) ; Use version 1.57.0 instead.
  153. ("htslib" ,htslib)
  154. ("zlib" ,zlib)
  155. ("bzip2" ,bzip2)))
  156. (arguments
  157. `(#:tests? #f ; There are no tests to run.
  158. #:phases
  159. (modify-phases %standard-phases
  160. (delete 'configure) ; There is no configure phase.
  161. (replace 'install
  162. (lambda _
  163. (let ((bin (string-append (assoc-ref %outputs "out") "/bin")))
  164. (install-file "src/cov" bin)
  165. (install-file "src/delly" bin)
  166. (install-file "src/extract" bin)
  167. (install-file "src/iover" bin)
  168. (install-file "src/stats" bin)))))))
  169. (home-page "https://github.com/tobiasrausch/delly")
  170. (synopsis "Integrated structural variant prediction method")
  171. (description "Delly is an integrated structural variant prediction method
  172. that can discover and genotype deletions, tandem duplications, inversions and
  173. translocations at single-nucleotide resolution in short-read massively parallel
  174. sequencing data. It uses paired-ends and split-reads to sensitively and
  175. accurately delineate genomic rearrangements throughout the genome. Structural
  176. variants can be visualized using Delly-maze and Delly-suave.")
  177. (license license:gpl3)))
  178. (define-public freec
  179. (package
  180. (name "control-freec")
  181. (version "8.7")
  182. (source (origin
  183. (method url-fetch)
  184. (uri "http://bioinfo-out.curie.fr/projects/freec/src/FREEC_Linux64.tar.gz")
  185. (file-name (string-append name "-" version ".tar.gz"))
  186. (sha256
  187. (base32 "12sl7gxbklhvv0687qjhml1z4lwpcn159zcyxvawvclsrzqjmv0h"))))
  188. (build-system gnu-build-system)
  189. ;; The source code's filename indicates only a 64-bit Linux build.
  190. ;; We need to investigate whether this is true.
  191. (supported-systems '("x86_64-linux"))
  192. (arguments
  193. `(#:phases
  194. (modify-phases %standard-phases
  195. ;; There's no configure phase because there are no external
  196. ;; dependencies.
  197. (delete 'configure)
  198. ;; There are no tests.
  199. (delete 'check)
  200. (replace
  201. 'unpack
  202. (lambda* (#:key source #:allow-other-keys)
  203. (and
  204. (zero? (system* "mkdir" "source"))
  205. (with-directory-excursion "source"
  206. (zero? (system* "tar" "xvf" source))))))
  207. (replace
  208. 'build
  209. (lambda* (#:key inputs #:allow-other-keys)
  210. (with-directory-excursion "source"
  211. (zero? (system* "make")))))
  212. (replace
  213. 'install
  214. (lambda* (#:key outputs #:allow-other-keys)
  215. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  216. (install-file "source/freec" bin)))))))
  217. (home-page "http://bioinfo-out.curie.fr/projects/freec/")
  218. (synopsis "Tool for detection of copy-number changes and allelic imbalances
  219. (including LOH) using deep-sequencing data")
  220. (description "Control-FREEC automatically computes, normalizes, segments
  221. copy number and beta allele frequency (BAF) profiles, then calls copy number
  222. alterations and LOH. The control (matched normal) sample is optional for whole
  223. genome sequencing data but mandatory for whole exome or targeted sequencing
  224. data. For whole genome sequencing data analysis, the program can also use
  225. mappability data (files created by GEM). ")
  226. (license license:gpl2+)))
  227. (define-public plink2
  228. (package
  229. (name "plink2")
  230. (version "1.90b3")
  231. (source
  232. (origin
  233. (method url-fetch)
  234. ;; https://github.com/chrchang/plink-ng/archive/v1.90b3.tar.gz
  235. (uri (string-append
  236. "https://github.com/chrchang/plink-ng/archive/v"
  237. version ".tar.gz"))
  238. (sha256
  239. (base32 "03fzib1al5qkr9vxv63wxmv6y2pfb1rmir0h8jpi72r87hczqjig"))
  240. (patches (list (search-patch "plink-ng-Makefile-zlib.patch")))))
  241. (build-system gnu-build-system)
  242. (arguments
  243. '(#:tests? #f ;no "check" target
  244. #:phases
  245. (modify-phases %standard-phases
  246. (delete 'configure)
  247. (replace 'build
  248. (lambda _
  249. (zero? (system* "make" "-f" "Makefile.std"))
  250. ))
  251. (replace 'install
  252. (lambda* (#:key outputs #:allow-other-keys)
  253. (let ((bin (string-append (assoc-ref outputs "out")
  254. "/bin/")))
  255. (install-file "plink2" bin)
  256. #t))))))
  257. (inputs
  258. `(("zlib" ,zlib)
  259. ("openblas" ,openblas)
  260. ;; ("atlas" ,atlas)
  261. ;; ("lapack" ,lapack)
  262. ("gfortran" ,gfortran)
  263. ))
  264. (native-inputs
  265. `(("unzip" ,unzip)))
  266. (home-page "https://www.cog-genomics.org/plink2")
  267. (synopsis "Whole genome association analysis toolset")
  268. (description
  269. "PLINK is a whole genome association analysis toolset, designed to
  270. perform a range of basic, large-scale analyses in a computationally efficient
  271. manner. The focus of PLINK is purely on analysis of genotype/phenotype data,
  272. so there is no support for steps prior to this (e.g. study design and
  273. planning, generating genotype or CNV calls from raw data). Through
  274. integration with gPLINK and Haploview, there is some support for the
  275. subsequent visualization, annotation and storage of results.")
  276. ;; Code is released under GPLv2, except for fisher.h, which is under
  277. ;; LGPLv2.1+
  278. (license (list license:gpl2 license:lgpl2.1+))))
  279. (define-public plink-ng-gn
  280. (let ((commit "5d1db4313ba0cc976562da233db4aced78975d10"))
  281. (package
  282. (name "plink-ng-gn")
  283. (version (string-append "1.90b3-" commit )) ; Aug 11, 2016
  284. (source (origin
  285. (method git-fetch)
  286. (uri (git-reference
  287. (url "https://github.com/genenetwork/plink-ng.git")
  288. (commit commit)))
  289. (file-name (string-append name "-" commit))
  290. (sha256
  291. (base32
  292. "1366li3ks9076bblvd1rpzkjq4j8f8f08lhga4c1ckrkil3xww4m"))))
  293. ;; no longer (patches (list (search-patch "plink-ng-Makefile-zlib-git.patch")))))
  294. (inputs
  295. `(("zlib" ,zlib)
  296. ("openblas" ,openblas)
  297. ;; ("atlas" ,atlas) ; openblas replaces atlas
  298. ("lapack" ,lapack) ; lapack is disabled in GUIX openblas
  299. ;; ("gfortran" ,gfortran)
  300. ;; ("python" ,python-2) ;; for tests - currently disabled
  301. ))
  302. (native-inputs
  303. `(("unzip" ,unzip)))
  304. (build-system gnu-build-system)
  305. (arguments
  306. '(#:tests? #f ;no "check" target. Some of the python-based tests fail
  307. #:phases
  308. (modify-phases %standard-phases
  309. (delete 'configure)
  310. (replace 'build
  311. (lambda _
  312. (zero? (system* "make" "-f" "Makefile.guix"))
  313. ))
  314. (replace 'install
  315. (lambda* (#:key outputs #:allow-other-keys)
  316. (let ((bin (string-append (assoc-ref outputs "out")
  317. "/bin/")))
  318. (install-file "plink2" bin)
  319. #t))))))
  320. (home-page "https://www.cog-genomics.org/plink2")
  321. (synopsis "Whole genome association analysis toolset")
  322. (description
  323. "PLINK is a whole genome association analysis toolset, designed to
  324. perform a range of basic, large-scale analyses in a computationally efficient
  325. manner. The focus of PLINK is purely on analysis of genotype/phenotype data,
  326. so there is no support for steps prior to this (e.g. study design and
  327. planning, generating genotype or CNV calls from raw data). Through
  328. integration with gPLINK and Haploview, there is some support for the
  329. subsequent visualization, annotation and storage of results.")
  330. (license license:gpl3+))))
  331. (define-public pindel
  332. (package
  333. (name "pindel")
  334. (version "0.2.5b8")
  335. (source (origin
  336. (method git-fetch)
  337. (uri (git-reference
  338. (url "https://github.com/genome/pindel.git")
  339. (commit (string-append "v" version))))
  340. (file-name (git-file-name name version))
  341. (sha256
  342. (base32 "16a32fbgv1n58nfcxa1nyphrdrad80sgpinfa9p028n6plwycpww"))))
  343. (build-system gnu-build-system)
  344. (inputs
  345. `(("samtools" ,samtools)
  346. ("htslib" ,htslib)
  347. ("zlib" ,zlib)))
  348. (native-inputs
  349. `(("cppcheck" ,cppcheck)
  350. ("python" ,python-2)
  351. ("perl" ,perl)))
  352. (arguments
  353. `(#:phases
  354. (modify-phases %standard-phases
  355. (delete 'configure) ; There is no configure phase.
  356. ;; The build phase needs to run 'make' twice for the reasons described
  357. ;; below.
  358. (replace 'build
  359. (lambda* (#:key inputs #:allow-other-keys)
  360. ;; The first run creates a Makefile.local file. Make will report
  361. ;; the failure to find Makefile.local, but we can ignore this error.
  362. (system* "make" (string-append "SAMTOOLS=" (assoc-ref inputs "samtools")))
  363. ;; The second run actually compiles the program. Now Makefile.local
  364. ;; is available, and we should treat an exiting make with an error as
  365. ;; a true error.
  366. (invoke "make")))
  367. (replace 'install
  368. (lambda* (#:key outputs #:allow-other-keys)
  369. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  370. (install-file "src/pindel" bin)
  371. (install-file "src/pindel2vcf" bin)
  372. (install-file "src/pindel2vcf4tcga" bin)
  373. (install-file "src/sam2pindel" bin))))
  374. ;; There are multiple test targets, so in order to run all
  375. ;; tests, we must run the separate make targets.
  376. (replace 'check
  377. (lambda _
  378. (for-each (lambda (target)
  379. (invoke "make" target))
  380. '("acceptance-tests" "coverage-tests" "cppcheck"
  381. "functional-tests" "regression-tests")))))))
  382. (home-page "https://github.com/genome/pindel")
  383. (synopsis "Structural variants detector for next-gen sequencing data")
  384. (description "Pindel can detect breakpoints of large deletions, medium sized
  385. insertions, inversions, tandem duplications and other structural variants at
  386. single-based resolution from next-gen sequence data. It uses a pattern growth
  387. approach to identify the breakpoints of these variants from paired-end short
  388. reads.")
  389. (license license:gpl3+)))
  390. (define-public varscan
  391. (package
  392. (name "varscan")
  393. (version "2.4.1")
  394. (source (origin
  395. (method url-fetch)
  396. (uri (string-append
  397. "https://github.com/dkoboldt/varscan/releases/download/v"
  398. version "/VarScan.v" version ".source.jar"))
  399. (sha256
  400. (base32 "0y45ympkza7qwcbcisg006286pwjbr5978n03hx5nvl09f0mapk8"))))
  401. (build-system ant-build-system)
  402. (arguments
  403. `(#:tests? #f ; build.xml does not exist
  404. #:phases
  405. (modify-phases %standard-phases
  406. (replace 'unpack
  407. (lambda _
  408. (mkdir "source")
  409. (chdir "source")
  410. ;; Unpack the Java archive containing the source files.
  411. (invoke "jar" "xf" (assoc-ref %build-inputs "source"))
  412. ;; Remove existing compiled output.
  413. (with-directory-excursion "net/sf/varscan/"
  414. (for-each (lambda (file)
  415. (delete-file file))
  416. (find-files "." "^.java$" #:directories? #f)))
  417. #t))
  418. (replace 'build
  419. (lambda _
  420. ;; Compile the source files.
  421. (with-directory-excursion "net/sf/varscan/"
  422. (for-each (lambda (file)
  423. (invoke "javac" file))
  424. (find-files "." ".java$" #:directories? #f)))
  425. ;; Construct the new Java archive.
  426. (apply invoke "jar" "cfm"
  427. (string-append "varscan-" ,version ".jar")
  428. "META-INF/MANIFEST.MF"
  429. (find-files "net/sf/varscan" ".java$"))))
  430. (replace 'install
  431. (lambda* (#:key outputs #:allow-other-keys)
  432. (let ((out (string-append (assoc-ref outputs "out")
  433. "/share/java/varscan/")))
  434. (install-file (string-append "varscan-" ,version ".jar") out))
  435. #t)))))
  436. (home-page "https://dkoboldt.github.io/varscan/")
  437. (synopsis "Variant detection in massively parallel sequencing data")
  438. (description "Variant detection in massively parallel sequencing data.")
  439. ;; Free for non-commercial use by academic, government, and
  440. ;; non-profit/not-for-profit institutions
  441. (license license:non-copyleft)))
  442. (define-public edirect-gn
  443. (deprecated-package "edirect-gn" edirect))
  444. (define-public gfaffix
  445. (package
  446. (name "gfaffix")
  447. (version "0.1.2")
  448. (source
  449. (origin
  450. (method git-fetch)
  451. (uri (git-reference
  452. (url "https://github.com/marschall-lab/GFAffix")
  453. (commit version)))
  454. (file-name (git-file-name name version))
  455. (sha256
  456. (base32 "0xpzi0zvaa4pajs4vbp3vkwj2ha8pi62ly7bd8cpf3fi6r32pgdz"))
  457. (modules '((guix build utils)))
  458. (snippet
  459. '(begin
  460. (substitute* "Cargo.toml"
  461. (("^handlegraph.*") "handlegraph = \"0.7\"\n"))))))
  462. (build-system cargo-build-system)
  463. (arguments
  464. `(#:rust ,(if (> (string->number (version-major+minor (package-version rust-1.49)))
  465. (string->number (version-major+minor (package-version rust))))
  466. rust-1.49
  467. rust)
  468. #:cargo-inputs
  469. (("rust-clap" ,rust-clap-3)
  470. ("rust-rustc-hash" ,rust-rustc-hash-1)
  471. ("rust-regex" ,rust-regex-1)
  472. ("rust-handlegraph" ,rust-handlegraph-0.7)
  473. ("rust-gfa" ,rust-gfa-0.10)
  474. ("rust-quick-csv", rust-quick-csv-0.1)
  475. ("rust-log" ,rust-log-0.4)
  476. ("rust-env-logger" ,rust-env-logger-0.7))
  477. #:phases
  478. (modify-phases %standard-phases
  479. (add-after 'unpack 'adjust-dependency-version
  480. (lambda* (#:key inputs #:allow-other-keys)
  481. (let ((handlebar-version ,(package-version rust-handlegraph-0.7)))
  482. (substitute* "Cargo.toml"
  483. (("\"0.7\"")
  484. (string-append "{ version = \"" handlebar-version "\" }")))
  485. #t))))))
  486. (home-page "https://github.com/marschall-lab/GFAffix")
  487. (synopsis "Identify walk-preserving shared affixes in variation graphs")
  488. (description
  489. "GFAffix identifies walk-preserving shared affixes in variation graphs and
  490. collapses them into a non-redundant graph structure.")
  491. (license license:expat)))
  492. (define-public pangenie
  493. (let ((commit "1f3d2d247702e8c90620b8b1c5f6ea866c9aab19") ; April 30, 2021
  494. (revision "1"))
  495. (package
  496. (name "pangenie")
  497. (version (git-version "0.0.0" revision commit))
  498. (source (origin
  499. (method git-fetch)
  500. (uri (git-reference
  501. (url "https://bitbucket.org/jana_ebler/pangenie.git")
  502. (commit commit)))
  503. (file-name (git-file-name name version))
  504. (sha256
  505. (base32 "0qp15dfngg37lk64yn2q8kglkazdwi1vpfr2r783bcx5pywr4n5w"))))
  506. (build-system cmake-build-system)
  507. (arguments
  508. `(#:configure-flags (list (string-append "-DCMAKE_BUILD_RPATH="
  509. (assoc-ref %outputs "out") "/lib"))
  510. #:phases
  511. (modify-phases %standard-phases
  512. (replace 'check
  513. (lambda* (#:key tests? #:allow-other-keys)
  514. (when tests?
  515. (invoke "make" "-C" "tests"))
  516. #t))
  517. (replace 'install
  518. (lambda* (#:key outputs #:allow-other-keys)
  519. (let ((out (assoc-ref outputs "out")))
  520. (with-directory-excursion "src"
  521. (install-file "PanGenie" (string-append out "/bin"))
  522. (install-file "PanGenie-graph" (string-append out "/bin"))
  523. (install-file "libPanGenieLib.so" (string-append out "/lib"))
  524. )
  525. #t))))))
  526. (native-inputs
  527. `(("pkg-config" ,pkg-config)))
  528. (inputs
  529. `(("jellyfish" ,jellyfish)))
  530. (home-page "https://bitbucket.org/jana_ebler")
  531. (synopsis "Genotyping based on k-mers and pangenome graphs")
  532. (description
  533. "This package provides a genotyper for various types of genetic variants
  534. (such as SNPs, indels and structural variants). Genotypes are computed based on
  535. read k-mer counts and a panel of known haplotypes. A description of the method
  536. can be found @url{https://www.biorxiv.org/content/10.1101/2020.11.11.378133v1,
  537. here}.")
  538. (license license:expat))))
  539. (define-public pbsim2
  540. (let ((commit "e71f7892aea0bd3c963b4f1f5628db4f830ee475") ; Dec 2, 2020
  541. (revision "1"))
  542. (package
  543. (name "pbsim2")
  544. (version (git-version "0.0.0" revision commit))
  545. (source (origin
  546. (method git-fetch)
  547. (uri (git-reference
  548. (url "https://github.com/yukiteruono/pbsim2")
  549. (commit commit)))
  550. (file-name (git-file-name name version))
  551. (sha256
  552. (base32 "13d3mhdp3rs58w14j9a5sbda4q8k9vzic7rgfa8223m7cm5ih6y7"))))
  553. (build-system gnu-build-system)
  554. (home-page "https://github.com/yukiteruono/pbsim2")
  555. (synopsis "Simulator for long read sequencers")
  556. (description "PBSIM simulates @acronym{Continuous Long Reads, CLRs} of
  557. PacBio, and Nanopore reads. In it sampling-based and model-based simulations
  558. are implemented.")
  559. (license license:gpl2))))
  560. (define-public pirs
  561. (let ((commit "bee9b594f4d0e10580aae77ec411cecec4a77219") ; Sept 7, 2017
  562. (revision "1"))
  563. (package
  564. (name "pirs")
  565. (version (git-version "2.0.2" revision commit))
  566. (source (origin
  567. (method git-fetch)
  568. (uri (git-reference
  569. (url "https://github.com/galaxy001/pirs")
  570. (commit commit)))
  571. (file-name (git-file-name name version))
  572. (sha256
  573. (base32 "0pn74h98cqcr5qayp4riss982n4272p35y5dp472cmqpwjjil9cd"))))
  574. (build-system gnu-build-system)
  575. (arguments
  576. `(#:configure-flags (list "--enable-pirs-diploid"
  577. ;; TODO: Enable after core-updates merge, late 2021.
  578. ;,@(if (not (or (target-x86-64?)
  579. ; (target-x86-32?)))
  580. ; `("--disable-sse2")
  581. ; '())
  582. )
  583. #:phases
  584. (modify-phases %standard-phases
  585. (add-before 'bootstrap 'chdir
  586. (lambda _
  587. (chdir "src")))
  588. (add-after 'unpack 'patch-source
  589. (lambda* (#:key outputs #:allow-other-keys)
  590. (let ((out (assoc-ref outputs "out")))
  591. (substitute* "src/configure.ac"
  592. (("ssse2") "sse2"))
  593. (substitute* "src/stator/gcContCvgBias/Makefile"
  594. (("gzstream.o ") "")
  595. (("-lz")"-lgzstream -lz")
  596. (("-static") "")
  597. (("-mtune=generic") ""))
  598. (substitute* "src/pirs/gccMakefile"
  599. (("/usr/local") out)))))
  600. (replace 'check
  601. (lambda* (#:key tests? test-target #:allow-other-keys #:rest args)
  602. (when tests?
  603. (apply (assoc-ref %standard-phases 'check) args)
  604. (with-directory-excursion "stator/gcContCvgBias"
  605. ; ((assoc-ref %standard-phases 'check)
  606. ; #:test-target "test" args))
  607. (invoke "make" "test")))))
  608. (add-after 'build 'build-more
  609. (lambda* (#:key #:allow-other-keys #:rest args)
  610. (with-directory-excursion "stator/gcContCvgBias"
  611. (apply (assoc-ref %standard-phases 'build) args))))
  612. (replace 'install
  613. (lambda* (#:key outputs #:allow-other-keys #:rest args)
  614. (let ((out (assoc-ref outputs "out")))
  615. (apply (assoc-ref %standard-phases 'install) args)
  616. (with-directory-excursion "stator/gcContCvgBias"
  617. ;(apply (assoc-ref %standard-phases 'install) args)
  618. (install-file "gc_coverage_bias" (string-append out "/bin")))))))))
  619. (inputs
  620. `(("gnuplot" ,gnuplot)
  621. ("perl" ,perl)
  622. ("zlib" ,zlib)))
  623. (native-inputs
  624. `(("autoconf" ,autoconf)
  625. ("automake" ,automake)
  626. ("boost" ,boost)
  627. ("gzstream" ,gzstream)
  628. ("libtool" ,libtool)))
  629. (home-page "https://github.com/galaxy001/pirs")
  630. (synopsis "Profile based Illumina pair-end Reads Simulator")
  631. (description "@code{pIRS} is a program for simulating paired-end reads
  632. from a reference genome. It is optimized for simulating reads similar to those
  633. generated from the Illumina platform.")
  634. (license license:gpl2))))
  635. ;; TODO: Unbundle zlib, bamtools, tclap
  636. (define-public sniffles
  637. (package
  638. (name "sniffles")
  639. (version "1.0.11")
  640. (source (origin
  641. (method git-fetch)
  642. (uri (git-reference
  643. (url "https://github.com/fritzsedlazeck/Sniffles.git")
  644. (commit version)))
  645. (file-name (git-file-name name version))
  646. (sha256
  647. (base32 "0rkwqn1ycckfzrg2wdid4cqahq8q2jmmgi7vvl8qxgpsihqfbq0j"))))
  648. (build-system cmake-build-system)
  649. (arguments
  650. `(#:phases
  651. (modify-phases %standard-phases
  652. (replace 'install
  653. (lambda* (#:key outputs #:allow-other-keys)
  654. (let ((out (assoc-ref outputs "out")))
  655. (install-file (string-append "../source/bin/sniffles-core-"
  656. ,version "/sniffles")
  657. (string-append out "/bin")))
  658. #t))
  659. (replace 'check
  660. (lambda _
  661. (with-directory-excursion "../source/test_set"
  662. (for-each make-file-writable (find-files "."))
  663. (invoke (string-append "../bin/sniffles-core-" ,version "/sniffles")
  664. "-m" "reads_region.bam" "-v" "test.vcf")))))))
  665. (native-inputs
  666. `(("zlib" ,zlib)))
  667. (home-page "https://github.com/fritzsedlazeck/Sniffles")
  668. (synopsis "Structural variation caller using third generation sequencing")
  669. (description
  670. "Sniffles is a structural variation caller using third generation sequencing
  671. (PacBio or Oxford Nanopore). It detects all types of SVs (10bp+) using evidence
  672. from split-read alignments, high-mismatch regions, and coverage analysis.")
  673. (license license:expat)))
  674. ;; TODO: Unbundle Complete-Striped-Smith-Waterman-Library
  675. (define-public ngmlr
  676. (package
  677. (name "ngmlr")
  678. (version "0.2.7")
  679. (source (origin
  680. (method git-fetch)
  681. (uri (git-reference
  682. (url "https://github.com/philres/ngmlr.git")
  683. (commit (string-append "v" version))))
  684. (file-name (git-file-name name version))
  685. (sha256
  686. (base32 "0lmsy8w0kxbyfnrln7lxgmnx3d82sv2b20n2yw5742rvfhq1v31n"))))
  687. (build-system cmake-build-system)
  688. (arguments
  689. `(#:phases
  690. (modify-phases %standard-phases
  691. (add-after 'patch-source-shebangs 'patch-more-tools
  692. (lambda* (#:key inputs #:allow-other-keys)
  693. (let ((bed (assoc-ref inputs "bedtools"))
  694. (sam (assoc-ref inputs "samtools")))
  695. (substitute* (find-files "test" "\\.sh$")
  696. (("bedtools") (string-append bed "/bin/bedtools"))
  697. (("samtools") (string-append sam "/bin/samtools")))
  698. #t)))
  699. (replace 'check
  700. (lambda _
  701. (with-directory-excursion "../source"
  702. (invoke "sh" "test/test_travis.sh")))))))
  703. (native-inputs
  704. `(("bedtools" ,bedtools)
  705. ("samtools" ,samtools)))
  706. (inputs
  707. `(("zlib" ,zlib)))
  708. (home-page "https://github.com/philres/ngmlr")
  709. (synopsis "Long-read mapper designed to align PacBio or Oxford Nanopore")
  710. (description
  711. "NGMLR is a long-read mapper designed to align PacBio or Oxford Nanopore
  712. (standard and ultra-long) to a reference genome with a focus on reads that span
  713. structural variations.")
  714. (license license:expat)))
  715. (define-public svim
  716. (package
  717. (name "svim")
  718. (version "1.2.0")
  719. (source (origin
  720. (method git-fetch)
  721. (uri (git-reference
  722. (url "https://github.com/eldariont/svim.git")
  723. (commit (string-append "v" version))))
  724. (file-name (git-file-name name version))
  725. (sha256
  726. (base32 "08j02in9jbq41b67dna1apnc3y30i37v44d1khml1xlx0iga720s"))))
  727. (build-system python-build-system)
  728. (arguments
  729. '(#:phases
  730. (modify-phases %standard-phases
  731. (replace 'check
  732. (lambda _
  733. (invoke "python3" "-m" "unittest" "discover" "-s" "src/"))))))
  734. (propagated-inputs
  735. `(("python-matplotlib" ,python-matplotlib)
  736. ("python-numpy" ,python-numpy)
  737. ("python-pysam" ,python-pysam)
  738. ("python-scipy" ,python-scipy)
  739. ("minimap2" ,minimap2)
  740. ("ngmlr" ,ngmlr)
  741. ("samtools" ,samtools)))
  742. (home-page "https://github.com/eldariont/svim")
  743. (synopsis "Structural Variant Identification Method using Long Reads")
  744. (description
  745. "SVIM (pronounced SWIM) is a structural variant caller for long reads. It
  746. is able to detect, classify and genotype five different classes of structural
  747. variants. Unlike existing methods, SVIM integrates information from across the
  748. genome to precisely distinguish similar events, such as tandem and interspersed
  749. duplications and novel element insertions.")
  750. (license license:gpl3)))
  751. (define-public bamaddrg
  752. (let ((commit "3fccbf057eef21f6304fade6c306c5bb64158865") ; May 26, 2012
  753. (revision "1"))
  754. (package
  755. (name "bamaddrg")
  756. (version (git-version "0.0.0" revision commit))
  757. (source (origin
  758. (method git-fetch)
  759. (uri (git-reference
  760. (url "https://github.com/ekg/bamaddrg.git")
  761. (commit commit)))
  762. (file-name (git-file-name name version))
  763. (sha256
  764. (base32 "14hq66cc7f4cssagb6079fmd2i6hfr9vmpcw5vi5kzsqr3ifc5yk"))))
  765. (build-system gnu-build-system)
  766. (arguments
  767. `(#:tests? #f ; no tests
  768. #:phases
  769. (modify-phases %standard-phases
  770. (delete 'configure)
  771. ;; The Makefile wants to vendor bamtools' source so we mimic it.
  772. (replace 'build
  773. (lambda* (#:key inputs #:allow-other-keys)
  774. (let ((bam (assoc-ref inputs "bamtools")))
  775. (apply invoke
  776. `("g++" "-O3"
  777. ,(string-append "-I" bam "/include/bamtools")
  778. ,(string-append "-L" bam "/lib/libbamtools.a")
  779. "bamaddrg.cpp" "-o" "bamaddrg" "-lbamtools" "-lz")))
  780. #t))
  781. (replace 'install
  782. (lambda* (#:key outputs #:allow-other-keys)
  783. (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
  784. (install-file "bamaddrg" bin)
  785. #t))))))
  786. (native-inputs
  787. `(("bamtools" ,bamtools)))
  788. (inputs
  789. `(("zlib" ,zlib)))
  790. (home-page "https://github.com/ekg/bamaddrg")
  791. (synopsis "Adds read groups to input BAM files, streams BAM output on stdout")
  792. (description
  793. "This is intended for use \"fixing up\" RG tags on the fly so that they
  794. reflect the source file from which the aligment originated from. This allows
  795. the \"safe\" merging of many files from many individuals into one stream,
  796. suitable for input into downstream processing systems such as freebayes (
  797. population variant detector).")
  798. (license #f)))) ; no license listed
  799. (define-public qctool
  800. (let ((changeset "73662f5f6e1e6efe75796bc64e342fb5d5d35e54") ; May 30, 2019
  801. (revision "1"))
  802. (package
  803. (name "qctool")
  804. (version (string-append "2.0.5-" revision "." (string-take changeset 7)))
  805. (source
  806. (origin
  807. (method hg-fetch)
  808. (uri (hg-reference
  809. (url "https://bitbucket.org/gavinband/qctool")
  810. (changeset changeset)))
  811. (file-name (string-append name "-" version "-checkout"))
  812. (sha256
  813. (base32 "0lcir6jdw1gsi1l0yrsyqgrb8dryxxw3gyncfx5bx34qbhd6f5dv"))))
  814. (build-system waf-build-system)
  815. (arguments
  816. `(#:python ,python-2
  817. #:tests? #f ; no check command
  818. #:phases
  819. (modify-phases %standard-phases
  820. (add-after 'unpack 'rename-waf
  821. (lambda _
  822. (rename-file "waf-1.5.18" "waf")
  823. #t)))))
  824. (native-inputs
  825. `(("readline" ,readline)
  826. ("zlib" ,zlib)))
  827. (inputs
  828. `(("lapack" ,lapack)
  829. ("openblas" ,openblas)))
  830. (home-page "https://www.well.ox.ac.uk/~gav/qctool_v2/")
  831. (synopsis "Quality control and analysis of gwas datasets")
  832. (description
  833. "QCTOOL is a command-line utility program for manipulation and quality
  834. control of gwas datasets and other genome-wide data. QCTOOL can be used
  835. @enumerate
  836. @item To compute per-variant and per-sample QC metrics.
  837. @item To filter out samples or variants.
  838. @item To merge datasets in various ways.
  839. @item To convert dataset between file formats. (In particular QCTOOL can read
  840. and write BGEN files, including full support for the BGEN v1.2 format that has
  841. been used for the UK Biobank imputed data full release).
  842. @item To manipulate datasets in various ways - e.g. by updating data fields or
  843. aligning alleles to a reference sequence based on information in a strand file.
  844. @item To annotate variants with information from BED files, sequence from FASTA
  845. files, or with genetic map positions.
  846. @item To compute LD metrics between variants.
  847. @item To compare genotypes for individuals typed or imputed or phased in
  848. different datasets.
  849. @item To compute between-sample relatedness and principal components.
  850. @item To compute 'genetic risk predictor' scores.
  851. @end enumerate")
  852. (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt")))))
  853. (define-public rn6-assembly-error-app
  854. (package
  855. (name "rn6-assembly-error-app")
  856. (version "0.12")
  857. (source (origin
  858. (method git-fetch)
  859. (uri (git-reference
  860. (url "https://github.com/chen42/rn6_assembly_error_app.git")
  861. (commit (string-append "v" version))))
  862. (file-name (git-file-name name version))
  863. (sha256
  864. (base32 "0ilmn6w0l17041dlizf4dy4pqn26k7956k7fjx4fvssb525g4gi6"))))
  865. (build-system trivial-build-system)
  866. (arguments
  867. `(#:modules ((guix build utils))
  868. #:builder
  869. (begin
  870. (use-modules (guix build utils))
  871. (let* ((out (assoc-ref %outputs "out"))
  872. (targetdir (string-append out "/share/" ,name))
  873. (app (string-append out "/bin/" ,name))
  874. (Rbin (string-append (assoc-ref %build-inputs "r-min")
  875. "/bin/Rscript"))
  876. (convert (string-append (assoc-ref %build-inputs "imagemagick")
  877. "/bin/convert"))
  878. (cp (string-append (assoc-ref %build-inputs "coreutils")
  879. "/bin/cp"))
  880. (source (assoc-ref %build-inputs "source")))
  881. (copy-recursively source targetdir)
  882. (substitute* (string-append targetdir "/server.r")
  883. ;; This version is ideal for deploying with the included PNGs.
  884. ;; But we want all of them, so we use a local copy in shepherd's $HOME.
  885. ;;(("./pngs") (string-append targetdir "/pngs"))
  886. (("./pngs") "/home/shepherd/rn6app/pngs")
  887. (("cp") cp)
  888. (("convert") convert))
  889. (mkdir-p (string-append out "/bin"))
  890. (call-with-output-file app
  891. (lambda (port)
  892. (format port
  893. "#!~a
  894. library(shiny)
  895. setwd(\"~a\")
  896. runApp(launch.browser=0, port=4202)~%\n"
  897. Rbin targetdir)))
  898. (chmod app #o555)
  899. #t))))
  900. (native-inputs `(("source" ,source)))
  901. (inputs
  902. `(("coreutils" ,coreutils-minimal)
  903. ("imagemagick" ,imagemagick)
  904. ("r-min" ,r-minimal)))
  905. (propagated-inputs
  906. `(("freetype" ,freetype)
  907. ("r" ,r)
  908. ("r-ggplot2" ,r-ggplot2)
  909. ("r-shiny" ,r-shiny)))
  910. (home-page "http://rn6err.opar.io/")
  911. (synopsis "Display potential assembly errors in rn6")
  912. (description
  913. "Display potential assembly errors in rn6.")
  914. (license license:expat)))
  915. (define-public bxd-power-calculator-app
  916. (let ((commit "7cdd73daa9a7aa79af1de04dc314c325f9706fb8")
  917. (revision "1"))
  918. (package
  919. (name "bxd-power-calculator-app")
  920. (version (git-version "0.7" revision commit))
  921. (source (origin
  922. (method git-fetch)
  923. (uri (git-reference
  924. (url "https://github.com/Dashbrook/BXD_power_calculator_app/")
  925. (commit commit)))
  926. (file-name (git-file-name name version))
  927. (sha256
  928. (base32 "0vdfilzy78jalkh9w9xxvarnzgnlaz943crmhlds8bcrvwbmf6yh"))))
  929. (build-system trivial-build-system)
  930. (arguments
  931. `(#:modules ((guix build utils))
  932. #:builder
  933. (begin
  934. (use-modules (guix build utils))
  935. (let* ((out (assoc-ref %outputs "out"))
  936. (targetdir (string-append out "/share/" ,name))
  937. (app (string-append out "/bin/" ,name))
  938. (Rbin (string-append (assoc-ref %build-inputs "r-min")
  939. "/bin/Rscript"))
  940. (datasets (assoc-ref %build-inputs "datasets"))
  941. (source (assoc-ref %build-inputs "source")))
  942. (copy-recursively source targetdir)
  943. (mkdir-p (string-append out "/bin"))
  944. (call-with-output-file app
  945. (lambda (port)
  946. (format port
  947. "#!~a
  948. library(shiny)
  949. setwd(\"~a\")
  950. runApp(launch.browser=0, port=3978)~%\n"
  951. Rbin targetdir)))
  952. (chmod app #o555)
  953. (substitute* (string-append targetdir "/server.R")
  954. (("read.csv.*")
  955. (string-append "read.csv(url(\"file://" datasets "\"), header = TRUE)\n")))
  956. #t))))
  957. (native-inputs `(("source" ,source)))
  958. (propagated-inputs
  959. `(("r" ,r)
  960. ("r-data-table" ,r-data-table)
  961. ("r-dt" ,r-dt)
  962. ("r-dplyr" ,r-dplyr)
  963. ("r-ggplot2" ,r-ggplot2)
  964. ("r-rcolorbrewer" ,r-rcolorbrewer)
  965. ("r-shiny" ,r-shiny)))
  966. (inputs
  967. `(("r-min" ,r-minimal)
  968. ;; Also available from ipfs
  969. ;; ipfs get Qma3LWJBoks77btTmp6rn6jGSBcuBoPgcPCmofY2RRKEKf
  970. ("datasets" ,(origin
  971. (method url-fetch)
  972. (uri "https://web.archive.org/web/20191016132922/http://individual.utoronto.ca/D_Ashbrook/Effect_size_analysis_heritability_28th_Nov_2018_recalc.csv")
  973. (sha256
  974. (base32
  975. "1ldr9infavd0vak8n8ry9smcnrir3xgs1bahmmx7n2csx4n6qx2x"))))))
  976. (home-page "https://dashbrook1.shinyapps.io/bxd_power_calculator_app/")
  977. (synopsis "Visualize probability (beta) of detecting a QTL")
  978. (description
  979. "The BXD power app seeks to provide a quick and easy graphical interface
  980. for users to calculate the theortical power to detect an effect in a two parent
  981. recombinant inbred population. A power calculator such as this is needed as all
  982. grants require a calculation of the applications power to detect the effect of
  983. interest, and this app can provide values and figures for applicants to use.")
  984. (license license:gpl3))))
  985. (define-public singlecellrshiny
  986. (let ((commit "bdca74f4819d11e8fe7b15d9ab91b853f6542f7a")
  987. (revision "3"))
  988. (package
  989. (name "singlecellrshiny")
  990. (version (git-version "0.0.0" revision commit))
  991. (source (origin
  992. (method git-fetch)
  993. (uri (git-reference
  994. (url "https://github.com/genenetwork/singleCellRshiny")
  995. (commit commit)))
  996. (file-name (git-file-name name version))
  997. (sha256
  998. (base32 "1rxj933s9p9r7358vnp15f7ag6c0j65r4hgr8kyirfhmp1i8xdlw"))))
  999. (build-system trivial-build-system)
  1000. (arguments
  1001. `(#:modules ((guix build utils))
  1002. #:builder
  1003. (begin
  1004. (use-modules (guix build utils))
  1005. (let* ((out (assoc-ref %outputs "out"))
  1006. (targetdir (string-append out "/share/" ,name))
  1007. (app (string-append out "/bin/" ,name))
  1008. (Rbin (string-append (assoc-ref %build-inputs "r-min")
  1009. "/bin/Rscript"))
  1010. (top1001 (assoc-ref %build-inputs "RobTop1001.csv"))
  1011. (celltypes (assoc-ref %build-inputs "CellTypes_RGC_Master_08Dec2018.csv"))
  1012. (800-H1 (assoc-ref %build-inputs "800-H1-H20-RNA-Seq.csv"))
  1013. (source (assoc-ref %build-inputs "source")))
  1014. (copy-recursively source targetdir)
  1015. (substitute* (string-append targetdir "/app.R")
  1016. ;; As seen in https://github.com/genenetwork/singleCellRshiny/commit/6b2a344dd0d02f65228ad8c350bac0ced5850d05.patch
  1017. (("library\\(DT\\)") "library(DT)\nlibrary(multtest)"))
  1018. (substitute* (string-append targetdir "/global.R")
  1019. (("800-H1-H20-RNA-Seq-SingleCell-Retina-OMRF-03-29-19_FPKM_v2_SiamakPlay.csv") 800-H1)
  1020. (("CellTypes_RGC_Master_08Dec2018.csv") celltypes)
  1021. (("RobTop1001.csv") top1001)
  1022. ;; As seen in https://github.com/genenetwork/singleCellRshiny/commit/6b2a344dd0d02f65228ad8c350bac0ced5850d05.patch
  1023. (("dim\\(sc.object.1") "dim(sc.object"))
  1024. (mkdir-p (string-append out "/bin"))
  1025. (call-with-output-file app
  1026. (lambda (port)
  1027. (format port
  1028. "#!~a
  1029. library(shiny)
  1030. setwd(\"~a\")
  1031. runApp(launch.browser=0, port=4208)~%\n"
  1032. Rbin targetdir)))
  1033. (chmod app #o555)
  1034. #t))))
  1035. (inputs
  1036. `(("r-min" ,r-minimal)
  1037. ("RobTop1001.csv"
  1038. ,(origin
  1039. (method url-fetch)
  1040. (uri "https://archive.org/download/celltypesrgcmaster08dec2018/RobTop1001.csv")
  1041. (file-name "RobTop1001.csv")
  1042. (sha256
  1043. (base32 "0pa73kc1p8417sjvvvhp9xsbh2h8g7h85pnmm16mnv4wjalhq0gn"))))
  1044. ("CellTypes_RGC_Master_08Dec2018.csv"
  1045. ,(origin
  1046. (method url-fetch)
  1047. (uri "https://archive.org/download/celltypesrgcmaster08dec2018/CellTypes_RGC_Master_08Dec2018.csv")
  1048. (file-name "CellTypes_RGC_Master_08Dec2018.csv")
  1049. (sha256
  1050. (base32 "0y411968np1f5g21iym9xc9yj5c1jsn94rpkwkxh9pw2z43gvghn"))))
  1051. ("800-H1-H20-RNA-Seq.csv"
  1052. ,(origin
  1053. (method url-fetch)
  1054. (uri "https://archive.org/download/celltypesrgcmaster08dec2018/800-H1-H20-RNA-Seq-SingleCell-Retina-OMRF-03-29-19_FPKM_v2_SiamakPlay.csv")
  1055. (file-name "800-H1-H20-RNA-Seq-SingleCell-Retina-OMRF-03-29-19_FPKM_v2_SiamakPlay.csv")
  1056. (sha256
  1057. (base32 "1b1y4lfs8drypm04i1rypbmk67rdqgs27nfh05pwnv3sja2nanam"))))))
  1058. (propagated-inputs
  1059. `(("r" ,r)
  1060. ("r-dt" ,r-dt)
  1061. ("r-multtest" ,r-multtest)
  1062. ("r-seurat" ,r-seurat)
  1063. ("r-shiny" ,r-shiny)))
  1064. (home-page "http://singlecell.opar.io/")
  1065. (synopsis "RNA sequencing data analysis")
  1066. (description
  1067. "This is the R-Shiny programs to run some basic single cell RNA sequencing
  1068. (scRNA-seq) data analysis.")
  1069. (license license:agpl3))))
  1070. (define-public seqwish-0.1
  1071. (package
  1072. (name "seqwish")
  1073. (version "0.1")
  1074. (source (origin
  1075. (method git-fetch)
  1076. (uri (git-reference
  1077. (url "https://github.com/ekg/seqwish.git")
  1078. (commit (string-append "v" version))))
  1079. (file-name (git-file-name name version))
  1080. (sha256
  1081. (base32
  1082. "1gp72cmi13hbkmwwhgckmxkbx8w644jc5l6dvvvxdbl6sk8xsi5r"))))
  1083. (build-system gnu-build-system)
  1084. (arguments
  1085. `(#:phases
  1086. (modify-phases %standard-phases
  1087. (delete 'configure)
  1088. (replace 'build
  1089. (lambda* (#:key inputs #:allow-other-keys)
  1090. (let ((sdsl-lite (assoc-ref inputs "sdsl-lite"))
  1091. (sufsort (assoc-ref inputs "sufsort"))
  1092. (bsort (assoc-ref inputs "bsort"))
  1093. (mmap_allocator (assoc-ref inputs "mmap-allocator"))
  1094. (tayweeargs (assoc-ref inputs "tayweeargs-source"))
  1095. (gzipreader (assoc-ref inputs "gzipreader-source"))
  1096. (mmmultimap (assoc-ref inputs "mmmultimap-source"))
  1097. (iitii (assoc-ref inputs "iitii-source"))
  1098. (ips4o (assoc-ref inputs "ips4o-source")))
  1099. (apply invoke "g++" "-o" "seqwish"
  1100. "-O3" "-g" "-std=c++14" "-fopenmp"
  1101. "-latomic" "-lz"
  1102. (string-append "-I" sdsl-lite "/include")
  1103. (string-append "-I" sdsl-lite "/include/sdsl")
  1104. (string-append "-I" bsort "/include")
  1105. (string-append "-I" tayweeargs)
  1106. (string-append "-I" gzipreader)
  1107. (string-append "-I" mmmultimap "/src")
  1108. (string-append "-I" iitii "/src")
  1109. (string-append "-I" mmap_allocator "/include")
  1110. (string-append "-I" ips4o)
  1111. (append
  1112. (find-files "src" ".")
  1113. (list
  1114. (string-append sdsl-lite "/lib/libsdsl.so")
  1115. (string-append sufsort "/lib/libdivsufsort.so")
  1116. (string-append sufsort "/lib/libdivsufsort64.so")
  1117. (string-append mmap_allocator "/lib/libmmap_allocator.a")
  1118. (string-append bsort "/lib/libbsort.a")))))))
  1119. (replace 'check
  1120. (lambda _
  1121. ;; Add seqwish to the PATH for the tests.
  1122. (setenv "PATH" (string-append (getcwd) ":" (getenv "PATH")))
  1123. (with-directory-excursion "test"
  1124. (invoke "make"))))
  1125. (replace 'install
  1126. (lambda* (#:key outputs #:allow-other-keys)
  1127. (let ((out (assoc-ref outputs "out")))
  1128. (install-file "seqwish" (string-append out "/bin")))
  1129. #t)))))
  1130. (inputs
  1131. `(("bsort" ,ekg-bsort)
  1132. ("mmap-allocator" ,ekg-mmap-allocator)
  1133. ("openmpi" ,openmpi)
  1134. ("sdsl-lite" ,sdsl-lite)
  1135. ("sufsort" ,libdivsufsort)
  1136. ("zlib" ,zlib)))
  1137. (native-inputs
  1138. `(("prove" ,perl)
  1139. ("tayweeargs-source" ,(origin
  1140. (method git-fetch)
  1141. (uri (git-reference
  1142. (url "https://github.com/Taywee/args.git")
  1143. (commit "3de44ec671db452cc0c4ef86399b108939768abb")))
  1144. (file-name "tayweeargs-source-for-seqwish")
  1145. (sha256
  1146. (base32
  1147. "1v8kq1gvl5waysrfp0s58881rx39mnf3ifdsl6pb3y3c4zaki2xh"))))
  1148. ("gzipreader-source" ,(origin
  1149. (method git-fetch)
  1150. (uri (git-reference
  1151. (url "https://github.com/gatoravi/gzip_reader.git")
  1152. (commit "0ef26c0399e926087f9d6c4a56067a7bf1fc4f5e")))
  1153. (file-name "gzipreader-source-for-seqwish")
  1154. (sha256
  1155. (base32
  1156. "1wy84ksx900840c06w0f1mgzvr7zsfsgxq1b0jdjh8qka26z1r17"))))
  1157. ("mmmultimap-source" ,(origin
  1158. (method git-fetch)
  1159. (uri (git-reference
  1160. (url "https://github.com/ekg/mmmultimap.git")
  1161. (commit "88c734c36563048b0f3acc04dd8856f19e02b75f")))
  1162. (file-name "mmmultimap-source-for-seqwish")
  1163. (sha256
  1164. (base32
  1165. "06mnf3bd32s3ngxkl573ylg2qsvlw80r1ksdwamx3fzxa1a5yls0"))))
  1166. ("iitii-source" ,(origin
  1167. (method git-fetch)
  1168. (uri (git-reference
  1169. (url "https://github.com/ekg/iitii.git")
  1170. (commit "85209e07a3ee403fb6557387a7f897cd76be4406")))
  1171. (file-name "iitii-source-for-seqwish")
  1172. (sha256
  1173. (base32
  1174. "0sszvffkswf89nkbjmjg3wjwqvy2w0d3wgy3ngy33ma4sy4s025s"))))
  1175. ("ips4o-source" ,(origin
  1176. (method git-fetch)
  1177. (uri (git-reference
  1178. (url "https://github.com/SaschaWitt/ips4o.git")
  1179. (commit "bff3ccf0bf349497f2bb10f825d160b792236367")))
  1180. (file-name "ips4o-source-for-seqwish")
  1181. (sha256
  1182. (base32
  1183. "0yjfvrkiwgmy5cn0a7b9j8jwc3zp0l8j4dl5n0jgz68pdnhlp96h"))))))
  1184. (home-page "https://github.com/ekg/seqwish")
  1185. (synopsis "Alignment to variation graph inducer")
  1186. (description "Seqwish implements a lossless conversion from pairwise
  1187. alignments between sequences to a variation graph encoding the sequences and
  1188. their alignments. As input we typically take all-versus-all alignments, but the
  1189. exact structure of the alignment set may be defined in an application specific
  1190. way. This algorithm uses a series of disk-backed sorts and passes over the
  1191. alignment and sequence inputs to allow the graph to be constructed from very
  1192. large inputs that are commonly encountered when working with large numbers of
  1193. noisy input sequences. Memory usage during construction and traversal is
  1194. limited by the use of sorted disk-backed arrays and succinct rank/select
  1195. dictionaries to record a queryable version of the graph.")
  1196. (license license:expat)))
  1197. (define ekg-bsort
  1198. (let ((commit "c3ab0d3308424030e0a000645a26d2c10a59a124")
  1199. (revision "1"))
  1200. (package
  1201. (name "bsort")
  1202. (version (git-version "0.0.0" revision commit))
  1203. (source
  1204. (origin
  1205. (method git-fetch)
  1206. (uri (git-reference
  1207. (url "https://github.com/ekg/bsort.git")
  1208. (commit commit)))
  1209. (file-name (git-file-name name version))
  1210. (sha256
  1211. (base32
  1212. "0dgpflzcp3vdhbjwbjw347czi86gyk73hxcwjdqnaqh5vg61bdb6"))))
  1213. (build-system cmake-build-system)
  1214. (arguments
  1215. '(#:tests? #f ; no test target
  1216. #:out-of-source? #f
  1217. #:phases
  1218. (modify-phases %standard-phases
  1219. (replace 'install
  1220. (lambda* (#:key outputs #:allow-other-keys)
  1221. (let ((out (assoc-ref outputs "out")))
  1222. (install-file "bin/bsort" (string-append out "/bin"))
  1223. (install-file "src/bsort.hpp" (string-append out "/include"))
  1224. (install-file "lib/libbsort.a" (string-append out "/lib")))
  1225. #t)))))
  1226. (home-page "")
  1227. (synopsis "")
  1228. (description "")
  1229. (license license:gpl2))))
  1230. (define ekg-mmap-allocator
  1231. (let ((commit "ed61daf094de1c2e1adbe8306287ad52da5f0264")
  1232. (revision "1"))
  1233. (package
  1234. (name "mmap-allocator")
  1235. (version (git-version "0.10.1" revision commit))
  1236. (source
  1237. (origin
  1238. (method git-fetch)
  1239. (uri (git-reference
  1240. (url "https://github.com/ekg/mmap_allocator.git")
  1241. (commit commit)))
  1242. (file-name (git-file-name name version))
  1243. (sha256
  1244. (base32
  1245. "1f30b2kpwwzh6333s0qi5samk458ghbnvyycf6rwx6n6j7xswhbw"))))
  1246. (build-system gnu-build-system)
  1247. (arguments
  1248. '(#:phases
  1249. (modify-phases %standard-phases
  1250. (delete 'configure) ; no configure script
  1251. (add-before 'install 'pre-install
  1252. (lambda* (#:key outputs #:allow-other-keys)
  1253. (let ((out (assoc-ref outputs "out")))
  1254. (substitute* "Makefile"
  1255. (("HEADERS=") "HEADERS=mmappable_vector.h ")
  1256. (("/usr") out))
  1257. (mkdir-p (string-append out "/lib"))
  1258. (mkdir (string-append out "/include"))
  1259. #t))))
  1260. #:test-target "test"))
  1261. (home-page "")
  1262. (synopsis "")
  1263. (description "")
  1264. (license license:lgpl2.0+)))) ; README just says "lpgl".
  1265. ;; TODO: Unbundle BBHash, concurrentqueue, parallel-hashmap zstr
  1266. (define-public graphaligner
  1267. (package
  1268. (name "graphaligner")
  1269. (version "1.0.10")
  1270. (source (origin
  1271. (method url-fetch)
  1272. (uri (string-append "https://github.com/maickrau/GraphAligner/files/"
  1273. "3879798/GraphAligner.tar.gz"))
  1274. (file-name (string-append name "-" version ".tar.gz"))
  1275. (sha256
  1276. (base32 "0sk0cfjw44wslmlgplzwcqi0w4862vhf75p4x6syalvyi34pw3ck"))))
  1277. (build-system gnu-build-system)
  1278. (arguments
  1279. `(#:tests? #f ; no tests
  1280. #:make-flags '("all")
  1281. #:phases
  1282. (modify-phases %standard-phases
  1283. (add-after 'unpack 'patch-source
  1284. (lambda* (#:key inputs #:allow-other-keys)
  1285. (let ((sdsl (assoc-ref inputs "sdsl-lite")))
  1286. (substitute* "makefile"
  1287. (("VERSION .*") (string-append "VERSION = " ,version "\n"))))
  1288. #t))
  1289. (delete 'configure) ; no configure phase
  1290. (replace 'install
  1291. (lambda* (#:key outputs #:allow-other-keys)
  1292. (let ((out (assoc-ref outputs "out")))
  1293. (for-each
  1294. (lambda (program)
  1295. (install-file program (string-append out "/bin")))
  1296. (find-files "bin" "."))
  1297. (for-each
  1298. (lambda (header)
  1299. (install-file header (string-append out "/include")))
  1300. (find-files "src" "\\.h(pp)?$")))
  1301. #t)))))
  1302. (native-inputs
  1303. `(("pkg-config" ,pkg-config)
  1304. ("protobuf" ,protobuf "static")
  1305. ("sdsl-lite" ,sdsl-lite)
  1306. ("sparsehash" ,sparsehash)
  1307. ("zlib" ,zlib "static")))
  1308. (inputs
  1309. `(("boost" ,boost-static)
  1310. ("jemalloc" ,jemalloc)
  1311. ("libdivsufsort" ,libdivsufsort)
  1312. ("mummer" ,mummer)
  1313. ("protobuf" ,protobuf)
  1314. ("zlib" ,zlib)))
  1315. (home-page "https://github.com/maickrau/GraphAligner")
  1316. (synopsis "Seed-and-extend program for aligning genome graphs")
  1317. (description "Seed-and-extend program for aligning long error-prone reads to
  1318. genome graphs. For a description of the bitvector alignment extension
  1319. algorithm, see
  1320. @url{https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btz162/5372677
  1321. here}.")
  1322. (license license:expat)))
  1323. (define-public mummer
  1324. (package
  1325. (name "mummer")
  1326. (version "4.0.0beta2")
  1327. (source
  1328. (origin
  1329. (method url-fetch)
  1330. (uri (string-append "https://github.com/mummer4/mummer/releases/"
  1331. "download/v" version "/mummer-" version ".tar.gz"))
  1332. (sha256
  1333. (base32
  1334. "14qvrmf0gkl4alnh8zgxlzmvwc027arfawl96i7jk75z33j7dknf"))))
  1335. (build-system gnu-build-system)
  1336. (inputs
  1337. `(("gnuplot" ,gnuplot)
  1338. ("perl" ,perl)))
  1339. (home-page "http://mummer.sourceforge.net/")
  1340. (synopsis "Efficient sequence alignment of full genomes")
  1341. (description "MUMmer is a versatil alignment tool for DNA and protein sequences.")
  1342. (license license:artistic2.0)))
  1343. (define-public diagnostic-slider
  1344. (let ((commit "514d65d4982133e4869e578c5553fced4c6d506c")
  1345. (revision "1"))
  1346. (package
  1347. (name "diagnostic-slider")
  1348. (version (git-version "0.0.0" revision commit))
  1349. (source (origin
  1350. (method git-fetch)
  1351. (uri (git-reference
  1352. (url "https://github.com/sens/diagnostic-slider")
  1353. (commit commit)))
  1354. (file-name (git-file-name name version))
  1355. (sha256
  1356. (base32 "04g8if32g8syg6v0bd3jjn05i3d394nx8i3ccl0883p8mlmdvlmx"))))
  1357. (build-system trivial-build-system)
  1358. (arguments
  1359. `(#:modules ((guix build utils))
  1360. #:builder
  1361. (begin
  1362. (use-modules (guix build utils))
  1363. (let* ((out (assoc-ref %outputs "out"))
  1364. (targetdir (string-append out "/share/" ,name))
  1365. (app (string-append out "/bin/" ,name))
  1366. (Rbin (string-append (assoc-ref %build-inputs "r-min")
  1367. "/bin/Rscript"))
  1368. (source (assoc-ref %build-inputs "source")))
  1369. (copy-recursively source targetdir)
  1370. (mkdir-p (string-append out "/bin"))
  1371. (call-with-output-file app
  1372. (lambda (port)
  1373. (format port
  1374. "#!~a
  1375. library(shiny)
  1376. setwd(\"~a\")
  1377. runApp(launch.browser=0, port=4206)~%\n"
  1378. Rbin targetdir)))
  1379. (chmod app #o555)
  1380. #t))))
  1381. (native-inputs
  1382. `(("source" ,source)))
  1383. (inputs
  1384. `(("r-min" ,r-minimal)))
  1385. (propagated-inputs
  1386. `(("r" ,r)
  1387. ("r-shiny" ,r-shiny)))
  1388. (home-page "https://github.com/sens/diagnostic-slider")
  1389. (synopsis "")
  1390. (description
  1391. "")
  1392. (license #f))))
  1393. (define-public clustalw
  1394. (package
  1395. (name "clustalw")
  1396. (version "2.1")
  1397. (source (origin
  1398. (method url-fetch)
  1399. (uri "http://www.clustal.org/download/current/clustalw-2.1.tar.gz")
  1400. (file-name (string-append name "-" version ".tar.gz"))
  1401. (sha256
  1402. (base32 "11llyj08liq0bg6vqan8728qjrbam3xhna2wd6g8rzdbhydhalp0"))))
  1403. (arguments
  1404. `(#:phases
  1405. (modify-phases %standard-phases
  1406. (add-after
  1407. 'install 'post-install
  1408. (lambda* (#:key inputs outputs #:allow-other-keys)
  1409. (let* ((out (assoc-ref outputs "out")))
  1410. (rename-file (string-append out "/bin/clustalw2")
  1411. (string-append out "/bin/clustalw"))
  1412. ))))))
  1413. (build-system gnu-build-system)
  1414. (home-page "http://www.clustal.org/")
  1415. (synopsis "")
  1416. (description
  1417. "")
  1418. (license #f)))
  1419. (define-public python-whatshap
  1420. (package
  1421. (name "python-whatshap")
  1422. (version "1.1")
  1423. (source
  1424. (origin
  1425. (method url-fetch)
  1426. (uri (pypi-uri "whatshap" version))
  1427. (sha256
  1428. (base32 "0vxv6y8sg25yii106j6k55vc5z7n1l1y1nax49dgbarbrvk8cr2f"))))
  1429. (build-system python-build-system)
  1430. (inputs
  1431. `(("python-biopython" ,python-biopython)
  1432. ("python-networkx" ,python-networkx)
  1433. ("python-pyfaidx" ,python-pyfaidx)
  1434. ("python-pysam" ,python-pysam)
  1435. ("python-scipy" ,python-scipy)
  1436. ("python-xopen" ,python-xopen)))
  1437. (native-inputs
  1438. `(("python-cython" ,python-cython)
  1439. ("python-setuptools-scm" ,python-setuptools-scm)))
  1440. (home-page "https://github.com/whatshap/whatshap/")
  1441. (synopsis "Read-based phasing of genomic variants")
  1442. (description
  1443. "WhatsHap is a software for phasing genomic variants using DNA sequencing
  1444. reads, also called read-based phasing or haplotype assembly. It is especially
  1445. suitable for long reads, but works also well with short reads.")
  1446. (license license:expat)))
  1447. (define-public bh20-seq-resource
  1448. (let ((commit "ae4cb3c2cf7103bbc84f52618bb755d7ce25775b")
  1449. (revision "3"))
  1450. (package
  1451. (name "bh20-seq-resource")
  1452. (version (git-version "1.0" revision commit))
  1453. (source (origin
  1454. (method git-fetch)
  1455. (uri (git-reference
  1456. (url "https://github.com/arvados/bh20-seq-resource")
  1457. (commit commit)))
  1458. (file-name (git-file-name name version))
  1459. (sha256
  1460. (base32 "1k0gsz4yc8l5znanzd094g2jp40ksbpa9667zr31ayrjx6labz02"))
  1461. (modules '((guix build utils)))
  1462. (snippet
  1463. '(begin
  1464. (substitute* "setup.py"
  1465. (("py-dateutil") "python-dateutil"))
  1466. #t))))
  1467. (build-system python-build-system)
  1468. (propagated-inputs
  1469. `(("python-arvados-python-client" ,python-arvados-python-client)
  1470. ("python-dateutil" ,python-dateutil)
  1471. ("python-flask" ,python-flask)
  1472. ("python-magic" ,python-magic)
  1473. ("python-pyyaml" ,python-pyyaml)
  1474. ("python-pycurl" ,python-pycurl)
  1475. ("python-pyshex" ,python-pyshex)
  1476. ("python-redis" ,python-redis)
  1477. ("python-ruaml.yaml" ,python38-ruaml.yaml-0.15.76)
  1478. ("clustalw" ,clustalw)
  1479. ("python-schema-salad" ,python-schema-salad)
  1480. ("python-twint" ,python-twint)
  1481. ;; and for the service
  1482. ("python" ,python)
  1483. ("gunicorn" ,gunicorn)))
  1484. (native-inputs
  1485. `(("git" ,(@ (gnu packages version-control) git))
  1486. ("python-oauth2client" ,python-oauth2client)
  1487. ("python-pytest" ,python-pytest-4)
  1488. ("python-pytest-runner" ,python-pytest-runner-2)
  1489. ("python-uritemplate" ,python-uritemplate)))
  1490. (home-page "https://github.com/arvados/bh20-seq-resource")
  1491. (synopsis
  1492. "Tool to upload SARS-CoV-19 sequences and service to kick off analysis")
  1493. (description "This repository provides a sequence uploader for the
  1494. COVID-19 Virtual Biohackathon's Public Sequence Resource project. You can use
  1495. it to upload the genomes of SARS-CoV-2 samples to make them publicly and freely
  1496. available to other researchers.")
  1497. (license license:asl2.0))))
  1498. (define-public python-scanpy-git
  1499. (let ((commit "590d42309f9ed6550d7b887039990edfc1ac7648") ; April 22, 2020
  1500. (revision "1"))
  1501. (package
  1502. (inherit python-scanpy)
  1503. (name "python-scanpy-git")
  1504. (version (git-version "1.4.6" revision commit))
  1505. (source
  1506. (origin
  1507. (method git-fetch)
  1508. (uri (git-reference
  1509. (url "https://github.com/theislab/scanpy")
  1510. (commit commit)))
  1511. (file-name (git-file-name "python-scanpy" version))
  1512. (sha256
  1513. (base32 "0z3pk9vh4b7fqq7fs262i6z0pm1dnn6bf49a4r7r73k6gjj6namd"))))
  1514. (arguments
  1515. (substitute-keyword-arguments (package-arguments python-scanpy)
  1516. ((#:phases phases)
  1517. `(modify-phases ,phases
  1518. (add-before 'build 'fix-build
  1519. (lambda* (#:key inputs outputs #:allow-other-keys)
  1520. (let ((out (assoc-ref outputs "out"))
  1521. (pyv (python-version (assoc-ref inputs "python"))))
  1522. (substitute* "setup.py"
  1523. (("use_scm_version=True") "use_scm_version=False"))
  1524. (substitute* "scanpy/__init__.py"
  1525. (("__version__.*")
  1526. (string-append "__version__ = '" ,version "'\n")))
  1527. (mkdir-p
  1528. (string-append out "/lib/python" pyv "/site-packages"))
  1529. (setenv "PYTHONPATH"
  1530. (string-append out
  1531. "/lib/python" pyv "/site-packages/:"
  1532. (getenv "PYTHONPATH"))))
  1533. ;; These tests fail on this git revision
  1534. (delete-file "scanpy/tests/test_neighbors_key_added.py")
  1535. (delete-file "scanpy/tests/test_pca.py")
  1536. #t)))))))))
  1537. (define-public vg
  1538. (package
  1539. (name "vg")
  1540. (version "1.33.0")
  1541. (source
  1542. (origin
  1543. (method url-fetch)
  1544. (uri (string-append "https://github.com/vgteam/vg/releases/download/v"
  1545. version "/vg-v" version ".tar.gz"))
  1546. (sha256
  1547. (base32
  1548. "1pd4gdqb3ar0r1igzhf730kh9x0wj5l4shmjxz0j2mj78wy8y2sg"))
  1549. (modules '((guix build utils)))
  1550. (snippet
  1551. '(begin
  1552. ;; List all the options, makes it easier to try to remove them.
  1553. ;(delete-file-recursively "deps/BBHash")
  1554. ;(delete-file-recursively "deps/DYNAMIC")
  1555. ;(delete-file-recursively "deps/FlameGraph")
  1556. ;(delete-file-recursively "deps/atomic_queue")
  1557. ;(delete-file-recursively "deps/backward-cpp")
  1558. (delete-file-recursively "deps/bash-tap")
  1559. ;(delete-file-recursively "deps/dozeu")
  1560. (delete-file-recursively "deps/elfutils")
  1561. ;(delete-file-recursively "deps/fastahack") ; Fasta.o
  1562. ;(delete-file-recursively "deps/fermi-lite")
  1563. ;(delete-file-recursively "deps/gbwt")
  1564. (delete-file-recursively "deps/gbwt/deps")
  1565. ;(delete-file-recursively "deps/gbwtgraph")
  1566. (delete-file-recursively "deps/gbwtgraph/deps")
  1567. ;(delete-file-recursively "deps/gcsa2")
  1568. ;(delete-file-recursively "deps/gfakluge")
  1569. ;(delete-file-recursively "deps/gssw")
  1570. (delete-file-recursively "deps/htslib")
  1571. ;(delete-file-recursively "deps/ips4o")
  1572. (delete-file-recursively "deps/jemalloc")
  1573. ;(delete-file-recursively "deps/libVCFH")
  1574. ;(delete-file-recursively "deps/libbdsg")
  1575. ;(delete-file-recursively "deps/libbdsg/bdsg/deps")
  1576. (delete-file-recursively "deps/libbdsg/bdsg/deps/BBHash")
  1577. (delete-file-recursively "deps/libbdsg/bdsg/deps/DYNAMIC")
  1578. ;(delete-file-recursively "deps/libbdsg/bdsg/deps/hopscotch-map")
  1579. (delete-file-recursively "deps/libbdsg/bdsg/deps/libhandlegraph")
  1580. (delete-file-recursively "deps/libbdsg/bdsg/deps/pybind11")
  1581. (delete-file-recursively "deps/libbdsg/bdsg/deps/sdsl-lite")
  1582. (delete-file-recursively "deps/libbdsg/bdsg/deps/sparsepp")
  1583. ;(delete-file-recursively "deps/libdeflate")
  1584. ;(delete-file-recursively "deps/libhandlegraph")
  1585. ;(delete-file-recursively "deps/libvgio")
  1586. ;(delete-file-recursively "deps/libvgio/deps") ; libhandlegraph
  1587. ;(delete-file-recursively "deps/lru_cache")
  1588. ;(delete-file-recursively "deps/mio")
  1589. ;(delete-file-recursively "deps/mmmultimap")
  1590. (delete-file-recursively "deps/mmmultimap/deps/DYNAMIC")
  1591. (delete-file-recursively "deps/mmmultimap/deps/args")
  1592. (delete-file-recursively "deps/mmmultimap/deps/atomic_queue")
  1593. ;(delete-file-recursively "deps/mmmultimap/deps/hopscotch-map")
  1594. (delete-file-recursively "deps/mmmultimap/deps/ips4o")
  1595. (delete-file-recursively "deps/mmmultimap/deps/mio")
  1596. ;(delete-file-recursively "deps/mmmultimap/deps/paryfor")
  1597. (delete-file-recursively "deps/mmmultimap/deps/sdsl-lite")
  1598. ;(delete-file-recursively "deps/pinchesAndCacti")
  1599. ;(delete-file-recursively "deps/progress_bar")
  1600. (delete-file-recursively "deps/raptor")
  1601. ;(delete-file-recursively "deps/sdsl-lite")
  1602. (delete-file-recursively "deps/snappy")
  1603. ;(delete-file-recursively "deps/sonLib")
  1604. (delete-file-recursively "deps/sparsehash")
  1605. ;(delete-file-recursively "deps/sparsepp")
  1606. ;(delete-file-recursively "deps/ssw")
  1607. ;(delete-file-recursively "deps/structures")
  1608. ;(delete-file-recursively "deps/sublinear-Li-Stephens")
  1609. (delete-file-recursively "deps/sublinear-Li-Stephens/deps")
  1610. (delete-file-recursively "deps/tabixpp")
  1611. (delete-file-recursively "deps/vcflib")
  1612. ;(delete-file-recursively "deps/xg")
  1613. (delete-file-recursively "deps/xg/deps")
  1614. ;; libvgio doesn't search the correct include directory.
  1615. (copy-recursively "deps/libhandlegraph/src/include/handlegraph"
  1616. "deps/libvgio/include/handlegraph")
  1617. #t))))
  1618. (build-system gnu-build-system)
  1619. (arguments
  1620. '(#:phases
  1621. (modify-phases %standard-phases
  1622. (delete 'configure) ; no configure script
  1623. (add-after 'unpack 'patch-source
  1624. (lambda* (#:key inputs #:allow-other-keys)
  1625. (substitute* "Makefile"
  1626. ;; PKG_CONFIG_DEPS needs to be substituted to actually link to everything.
  1627. (("cairo jansson")
  1628. "cairo htslib jansson libdw libelf protobuf raptor2 sdsl-lite tabixpp vcflib")
  1629. ;; Skip the part where we link static libraries special. It doesn't like the changes we make
  1630. (("-Wl,-B.*") "\n")
  1631. (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libtabixpp\\.a") "$(LIB_DIR)/libtabixpp.a")
  1632. ((" \\$\\(LIB_DIR\\)/libtabixpp\\.a")
  1633. (string-append " " (assoc-ref inputs "tabixpp") "/lib/libtabixpp.so"))
  1634. (("\\$\\(LIB_DIR\\)/pkgconfig/tabixpp\\.pc")
  1635. (string-append " " (assoc-ref inputs "tabixpp") "/lib/pkgconfig/tabixpp.pc"))
  1636. (("\\$\\(CWD\\)/\\$\\(LIB_DIR\\)/libhts\\.a") "$(LIB_DIR)/libhts.a")
  1637. ((" \\$\\(LIB_DIR\\)/libhts\\.a")
  1638. (string-append " " (assoc-ref inputs "htslib") "/lib/libhts.so"))
  1639. (("\\$\\(LIB_DIR\\)/pkgconfig/htslib\\.pc")
  1640. (string-append " " (assoc-ref inputs "htslib") "/lib/pkgconfig/htslib.pc"))
  1641. ((" \\$\\(LIB_DIR\\)/libvcflib.a")
  1642. (string-append " " (assoc-ref inputs "vcflib") "/lib/libvcflib.so"))
  1643. ((" \\$\\(BIN_DIR\\)/vcf2tsv")
  1644. (string-append " " (assoc-ref inputs "vcflib") "/bin/vcf2tsv"))
  1645. ((" \\$\\(VCFLIB_DIR\\)/bin/vcf2tsv")
  1646. (string-append " " (assoc-ref inputs "vcflib") "/bin/vcf2tsv"))
  1647. ((" \\$\\(FASTAHACK_DIR\\)/fastahack")
  1648. (string-append " " (assoc-ref inputs "fastahack") "/bin/fastahack"))
  1649. ((" \\$\\(FASTAHACK_DIR\\)/bin/fastahack")
  1650. (string-append " " (assoc-ref inputs "fastahack") "/bin/fastahack"))
  1651. ((" \\$\\(LIB_DIR\\)/libsnappy.a")
  1652. (string-append " " (assoc-ref inputs "snappy") "/lib/libsnappy.so"))
  1653. ;; Only link against the libraries in the elfutils package.
  1654. (("-ldwfl -ldw -ldwelf -lelf -lebl") "-ldw -lelf")
  1655. ((" \\$\\(LIB_DIR\\)/libelf.a")
  1656. (string-append " " (assoc-ref inputs "elfutils") "/lib/libelf.so"))
  1657. ((" \\$\\(LIB_DIR\\)/libdw.a")
  1658. (string-append " " (assoc-ref inputs "elfutils") "/lib/libdw.so"))
  1659. ;; We need the Make.helper file in SDSL_DIR for gcsa2
  1660. ;((" \\$\\(LIB_DIR\\)/libsdsl.a")
  1661. ; (string-append " " (assoc-ref inputs "sdsl-lite") "/lib/libsdsl.so"))
  1662. ((" \\$\\(LIB_DIR\\)/libdivsufsort.a")
  1663. (string-append " " (assoc-ref inputs "libdivsufsort") "/lib/libdivsufsort.so"))
  1664. ((" \\$\\(LIB_DIR\\)/libdivsufsort64.a")
  1665. (string-append " " (assoc-ref inputs "libdivsufsort") "/lib/libdivsufsort64.so"))
  1666. ((" \\$\\(LIB_DIR\\)/libjemalloc.a")
  1667. (string-append " " (assoc-ref inputs "jemalloc") "/lib/libjemalloc.so"))
  1668. ((" \\$\\(INC_DIR\\)/sparsehash")
  1669. (string-append " " (assoc-ref inputs "sparsehash") "/include/sparsehash"))
  1670. ((" \\$\\(INC_DIR\\)/raptor2")
  1671. (string-append " " (assoc-ref inputs "raptor2") "/include/raptor2"))
  1672. ((" \\$\\(LIB_DIR\\)/libraptor2.a")
  1673. (string-append " " (assoc-ref inputs "raptor2") "/lib/libraptor2.so"))
  1674. ((" \\$\\(BIN_DIR\\)/rapper")
  1675. (string-append " " (assoc-ref inputs "raptor2") "/bin/rapper")))
  1676. ;; vcf2tsv shows up in a couple of other places
  1677. (substitute* "test/t/02_vg_construct.t"
  1678. (("../deps/vcflib/bin/vcf2tsv") (which "vcf2tsv")))
  1679. #t))
  1680. (add-after 'unpack 'fix-fastahack-dependency
  1681. (lambda _
  1682. (substitute* "src/aligner.hpp"
  1683. (("Fasta.h") "fastahack/Fasta.h"))
  1684. #t))
  1685. (add-after 'unpack 'fix-hopscotch-dependency
  1686. (lambda _
  1687. (substitute* "Makefile"
  1688. ;; The build directory for hopscotch_map-prefix.
  1689. (("rm -Rf build && ") ""))
  1690. ;; Don't try to download hopscotch_map from the internet.
  1691. (substitute* "deps/DYNAMIC/CMakeLists.txt"
  1692. ((".*GIT_REPOSITORY.*")
  1693. "SOURCE_DIR \"../../libbdsg/bdsg/deps/hopscotch-map\"\n")
  1694. ((".*BUILD_IN_SOURCE.*") ""))
  1695. ;; We still need to copy it to the expected location.
  1696. (copy-recursively
  1697. "deps/libbdsg/bdsg/deps/hopscotch-map"
  1698. "deps/DYNAMIC/build/hopscotch_map-prefix/src/hopscotch_map")
  1699. #t))
  1700. (add-after 'unpack 'adjust-tests
  1701. (lambda* (#:key inputs #:allow-other-keys)
  1702. (let ((bash-tap (assoc-ref inputs "bash-tap")))
  1703. (substitute* (find-files "test/t")
  1704. (("BASH_TAP_ROOT.*")
  1705. (string-append "BASH_TAP_ROOT=" bash-tap "/bin\n"))
  1706. ((".*bash-tap-bootstrap")
  1707. (string-append ". " bash-tap "/bin/bash-tap-bootstrap")))
  1708. ;; Lets skip the 4 failing tests for now. They fail with our
  1709. ;; bash-tap and the bundled one.
  1710. (substitute* "test/t/02_vg_construct.t"
  1711. ((".*the graph contains.*") "is $(true) \"\" \"\"\n"))
  1712. (substitute* '("test/t/07_vg_map.t"
  1713. "test/t/33_vg_mpmap.t")
  1714. ((".*node id.*") "is $(true) \"\" \"\"\n"))
  1715. ;; Don't test the docs, we're not providing npm
  1716. (substitute* "Makefile"
  1717. ((".*test-docs.*") ""))
  1718. #t)))
  1719. (add-after 'build 'build-manpages
  1720. (lambda _
  1721. (invoke "make" "man")))
  1722. (replace 'install
  1723. (lambda* (#:key outputs #:allow-other-keys)
  1724. (let ((out (assoc-ref outputs "out")))
  1725. (install-file "bin/vg" (string-append out "/bin"))
  1726. (install-file "lib/libvg.a" (string-append out "/lib"))
  1727. (for-each
  1728. (lambda (file)
  1729. (install-file file (string-append out "/share/man/man1")))
  1730. (find-files "doc/man" "\\.1$"))
  1731. #t))))
  1732. #:test-target "test"))
  1733. (native-inputs
  1734. `(("asciidoctor" ,ruby-asciidoctor)
  1735. ("bash-tap" ,bash-tap)
  1736. ("bc" ,bc)
  1737. ("cmake" ,cmake-minimal)
  1738. ("jq" ,jq)
  1739. ("perl" ,perl)
  1740. ("pkg-config" ,pkg-config)
  1741. ("samtools" ,samtools)
  1742. ("util-linux" ,util-linux)
  1743. ("which" ,which)
  1744. ("xxd" ,xxd)))
  1745. (inputs
  1746. `(("boost" ,boost)
  1747. ("cairo" ,cairo)
  1748. ("curl" ,curl-minimal)
  1749. ("elfutils" ,elfutils)
  1750. ("fastahack" ,fastahack)
  1751. ("htslib" ,htslib)
  1752. ("jansson" ,jansson)
  1753. ("jemalloc" ,jemalloc)
  1754. ("libdivsufsort" ,libdivsufsort)
  1755. ("ncurses" ,ncurses)
  1756. ("protobuf" ,protobuf)
  1757. ("raptor2" ,raptor2)
  1758. ("sdsl-lite" ,sdsl-lite)
  1759. ("smithwaterman" ,smithwaterman)
  1760. ("snappy" ,snappy)
  1761. ("sparsehash" ,sparsehash)
  1762. ("tabixpp" ,tabixpp)
  1763. ("vcflib" ,vcflib)
  1764. ("zlib" ,zlib)))
  1765. (home-page "https://www.biostars.org/t/vg/")
  1766. (synopsis "Tools for working with genome variation graphs")
  1767. (description "Variation graphs provide a succinct encoding of the sequences
  1768. of many genomes. A variation graph (in particular as implemented in vg) is
  1769. composed of:
  1770. @enumerate
  1771. @item nodes, which are labeled by sequences and ids
  1772. @item edges, which connect two nodes via either of their respective ends
  1773. @item paths, describe genomes, sequence alignments, and annotations (such as
  1774. gene models and transcripts) as walks through nodes connected by edges
  1775. @end enumerate
  1776. This model is similar to sequence graphs that have been used in assembly and
  1777. multiple sequence alignment.")
  1778. (license
  1779. (list
  1780. license:expat ; main program
  1781. license:bsd-2 ; deps/xg/deps/ips4o
  1782. license:bsd-3 ; deps/sparsepp, deps/sonLib/C/{impl,inc}
  1783. license:asl2.0 ; deps/sonLib/externalTools/quicktree_1.1, deps/structures
  1784. license:gpl3+ ; all sdsl-lite copies
  1785. license:zlib ; deps/sonLib/externalTools/cutest
  1786. license:boost1.0)))) ; catch.hpp
  1787. (define-public ucsc-genome-browser
  1788. (package
  1789. (name "ucsc-genome-browser")
  1790. (version "413")
  1791. (source (origin
  1792. (method git-fetch)
  1793. (uri (git-reference
  1794. (url "https://genome-source.gi.ucsc.edu/kent.git/")
  1795. (commit (string-append "v" version "_base"))))
  1796. (file-name (git-file-name name version))
  1797. (sha256
  1798. (base32 "1qcjhd4wcajik71z5347fw2sfhfkv0p6y7yldrrkmycw2qhqmpzn"))))
  1799. (build-system gnu-build-system)
  1800. (arguments
  1801. `(#:test-target "test"
  1802. #:parallel-tests? #f ; not supported
  1803. #:phases
  1804. (modify-phases %standard-phases
  1805. (delete 'configure) ; There is no configure phase.
  1806. (add-before 'build 'pre-build
  1807. (lambda* (#:key outputs #:allow-other-keys)
  1808. (let ((out (assoc-ref outputs "out")))
  1809. ;; Start by setting some variables.
  1810. (chdir "src")
  1811. (setenv "CC" ,(cc-for-target))
  1812. (setenv "HOME" (getcwd))
  1813. ;; And here we set the output directories
  1814. (setenv "CGI_BIN" (string-append out "/cgi-bin"))
  1815. (setenv "CGI_BIN_USER" (string-append out "/cgi-bin"))
  1816. (setenv "DOCUMENTROOT" (string-append out "/html"))
  1817. (setenv "DOCUMENTROOT_USER" (string-append out "/html"))
  1818. (setenv "BINDIR" (string-append out "/bin"))
  1819. ;; Now let's fix some errors:
  1820. (mkdir-p (string-append out "/cgi-bin"))
  1821. (substitute* "inc/cgi_build_rules.mk"
  1822. (("rm -f.*") ""))
  1823. (substitute* (cons* "inc/cgi_build_rules.mk"
  1824. (find-files "." "makefile"))
  1825. (("CGI_BIN\\}-\\$\\{USER") "CGI_BIN_USER"))
  1826. ;; Force linking with freetype.
  1827. (substitute* "inc/common.mk"
  1828. (("libpng-config --ldflags") "pkg-config --libs libpng freetype2")
  1829. (("libpng-config --I_opts") "pkg-config --cflags-only-I libpng freetype2")
  1830. (("\\$\\{HG_INC\\}" hg_inc) (string-append hg_inc " -DUSE_FREETYPE")))
  1831. ;; Force the trash location.
  1832. (substitute* (cons*
  1833. "utils/qa/showTracks"
  1834. "webBlat/webBlat.cfg"
  1835. "hg/js/hgTracks.js"
  1836. (find-files "." "\\.c$"))
  1837. ;; This line is specifically needed as-is.
  1838. (("\\.\\./trash") "/var/cache/genome"))
  1839. #t)))
  1840. (add-before 'check 'pre-check
  1841. (lambda* (#:key outputs #:allow-other-keys)
  1842. (let ((out (assoc-ref outputs "out"))
  1843. (triplet ,(gnu-triplet->nix-system (%current-system))))
  1844. (setenv "PATH" (string-append (getenv "PATH")
  1845. ":" out "/bin"))
  1846. (setenv "MACHTYPE"
  1847. (string-take triplet (string-index triplet #\-)))
  1848. (for-each make-file-writable
  1849. (find-files "utils/bedJoinTabOffset/tests"))
  1850. (substitute* '("utils/bamToPsl/tests/makefile"
  1851. "utils/trackDbIndexBb/tests/makefile")
  1852. (("/cluster/bin/bedtools/bedtools") (which "bedtools")))
  1853. ;; These tests fail intermittently:
  1854. (substitute* "utils/vcfFilter/tests/makefile"
  1855. ((" testRenameNoGt ") " ")
  1856. ((" testMinAc1NoGt ") " "))
  1857. ;; These tests can't find their database:
  1858. (substitute* "hg/lib/tests/makefile"
  1859. ((" spDbTest ") " ")
  1860. ((" hdbTest ") " "))
  1861. (substitute* "hg/lib/tests/genePredTests.mk"
  1862. ((" tableTests ") " ")
  1863. ((" compatTblTests ") " "))
  1864. (substitute* "hg/lib/tests/pslReaderTests.mk"
  1865. ((" tableTests") " "))
  1866. (substitute* "hg/lib/tests/makefile"
  1867. ((" annoGratorTest ") " ")
  1868. ((" customTrackTest ") " ")
  1869. ((" hgvsTest") " "))
  1870. (substitute* "hg/autoSql/tests/makefile"
  1871. ((" dbLinkTest ") " ")
  1872. ((" symColsTest ") " "))
  1873. (delete-file "hg/checkTableCoords/tests/makefile")
  1874. (delete-file "hg/hgGetAnn/tests/makefile")
  1875. (substitute* "hg/sqlToXml/makefile"
  1876. ((".*doTest.*") ""))
  1877. (substitute* "hg/utils/genePredFilter/tests/makefile"
  1878. ((" gencodeHackDbTest") " "))
  1879. (substitute* "hg/utils/refSeqGet/tests/makefile"
  1880. (("^test::.*") "test:: mkout\n"))
  1881. (delete-file "hg/utils/vcfToHgvs/tests/makefile")
  1882. (substitute* "hg/bedItemOverlapCount/tests/makefile"
  1883. ((".*RunTest.*") ""))
  1884. ;; Depends on /cluster
  1885. (substitute* "hg/liftOver/tests/makefile"
  1886. (("^test:.*") "test: mkdirs scaffoldEndBug\n"))
  1887. (delete-file "hg/mouseStuff/netToAxt/tests/makefile")
  1888. (substitute* "hg/pslToChain/tests/makefile"
  1889. ((" example1 ") " "))
  1890. ;; Depends on /gbdb
  1891. (delete-file "hg/mouseStuff/chainBridge/tests/makefile")
  1892. ;; Depends on /hive
  1893. (delete-file "hg/utils/genePredToProt/tests/makefile")
  1894. ;; Unclear why this fails
  1895. (delete-file "hg/utils/hgvsToVcf/tests/makefile")
  1896. ;; Wants network
  1897. (substitute* "hg/utils/hubCheck/tests/makefile"
  1898. (("^test::.*") "test:: one two\n"))
  1899. #t)))
  1900. ;; Install happens during the 'build phase.
  1901. ;; Install the website files too
  1902. (replace 'install
  1903. (lambda _
  1904. (invoke "make" "doc-install")
  1905. #t))
  1906. (add-after 'install 'create-hg-conf
  1907. (lambda* (#:key outputs #:allow-other-keys)
  1908. (let ((out (assoc-ref outputs "out")))
  1909. (with-output-to-file (string-append out "/cgi-bin/hg.conf")
  1910. (lambda ()
  1911. (display
  1912. "include /var/lib/genome/hg.conf\n")))
  1913. #t)))
  1914. (add-after 'install 'create-symlink
  1915. (lambda* (#:key inputs #:allow-other-keys)
  1916. (mkdir-p "htdocs")
  1917. ;; Fallback location for fonts.
  1918. (symlink (string-append (assoc-ref inputs "gs-fonts")
  1919. "/share/fonts/type1/ghostscript")
  1920. "htdocs/urw-fonts")
  1921. #t)))))
  1922. (inputs
  1923. `(("freetype" ,freetype)
  1924. ("libpng" ,libpng)
  1925. ("mysql:dev" ,mariadb "dev")
  1926. ("mysql:lib" ,mariadb "lib")
  1927. ("openssl" ,openssl)
  1928. ("perl" ,perl)
  1929. ("python2" ,python-2)
  1930. ("zlib" ,zlib)))
  1931. (native-inputs
  1932. `(("bedtools" ,bedtools)
  1933. ("gs-fonts" ,gs-fonts)
  1934. ("pkg-config" ,pkg-config)
  1935. ("python" ,python)
  1936. ("rsync" ,rsync) ; For installing js files from the source checkout
  1937. ("tcl" ,tcl)
  1938. ("tcsh" ,tcsh)
  1939. ("util-linux:lib" ,util-linux "lib")
  1940. ("which" ,(@ (gnu packages base) which))))
  1941. (home-page "https://www.genome.ucsc.edu/")
  1942. (synopsis "Structural variants detector for next-gen sequencing data")
  1943. (description
  1944. "The UCSC Genome Browser provides a rapid and reliable display of any
  1945. requested portion of genomes at any scale, together with dozens of aligned
  1946. annotation tracks (known genes, predicted genes, ESTs, mRNAs, CpG islands,
  1947. assembly gaps and coverage, chromosomal bands, mouse homologies, and more).
  1948. Half of the annotation tracks are computed at UCSC from publicly available
  1949. sequence data. The remaining tracks are provided by collaborators worldwide.
  1950. Users can also add their own custom tracks to the browser for educational or
  1951. research purposes.
  1952. The Genome Browser stacks annotation tracks beneath genome coordinate positions,
  1953. allowing rapid visual correlation of different types of information. The user
  1954. can look at a whole chromosome to get a feel for gene density, open a specific
  1955. cytogenetic band to see a positionally mapped disease gene candidate, or zoom in
  1956. to a particular gene to view its spliced ESTs and possible alternative splicing.
  1957. The Genome Browser itself does not draw conclusions; rather, it collates all
  1958. relevant information in one location, leaving the exploration and interpretation
  1959. to the user.")
  1960. (license (list
  1961. license:bsd-0 ; kent/src/{utils,lib,inc,tabStorm,parasol,hg/ausoSql,hg/autoXml}
  1962. license:bsd-3 ; these two for bundled htslib-1.3
  1963. license:expat
  1964. (license:non-copyleft
  1965. "https://www.genome.ucsc.edu/license/"
  1966. "Free for academic/non-profit/personal use only.")
  1967. (license:non-copyleft ; Blat, In-Silico PCR
  1968. "http://www.kentinformatics.com/index.html"
  1969. "Free for universities and non-profit institutions.")))))
  1970. (define-public bam2fastx
  1971. (package
  1972. (name "bam2fastx")
  1973. (version "1.3.1")
  1974. (source
  1975. (origin
  1976. (method git-fetch)
  1977. (uri (git-reference
  1978. (url "https://github.com/PacificBiosciences/bam2fastx")
  1979. (commit version)))
  1980. (file-name (git-file-name name version))
  1981. (sha256
  1982. (base32
  1983. "0pyfmvh874w29kaq6gbb1bd86135qs2jc4f8giw98kxw1b2gjdh0"))))
  1984. (build-system meson-build-system)
  1985. (arguments
  1986. `(#:configure-flags '("-Dtests=true")))
  1987. (inputs
  1988. `(("boost" ,boost)
  1989. ;("htslib" ,htslib)
  1990. ("pbbam" ,pbbam)
  1991. ("pbcopper" ,pbcopper)
  1992. ("zlib" ,zlib)))
  1993. (native-inputs
  1994. `(("pkg-config" ,pkg-config)
  1995. ("python-cram" ,python-cram)
  1996. ("python-wrapper" ,python-wrapper)))
  1997. (home-page "https://github.com/PacificBiosciences/bam2fastx")
  1998. (synopsis "Converting and demultiplexing of PacBio BAM files into gzipped fasta and fastq files")
  1999. (description "Conversion of PacBio BAM files into gzipped fasta and fastq files, including splitting of barcoded data.")
  2000. (license license:bsd-3)))
  2001. (define-public pbbam-1
  2002. (package
  2003. (name "pbbam")
  2004. (version "1.6.0")
  2005. (source (origin
  2006. (method git-fetch)
  2007. (uri (git-reference
  2008. (url "https://github.com/PacificBiosciences/pbbam")
  2009. (commit (string-append "v" version))))
  2010. (file-name (git-file-name name version))
  2011. (sha256
  2012. (base32
  2013. "1z3sh9cmrap37ijrm0cv85j92r1xkq6kba2j10mrr4fv7fc9zzfb"))))
  2014. (build-system meson-build-system)
  2015. ;; These libraries are listed as "Required" in the pkg-config file.
  2016. (propagated-inputs
  2017. `(("htslib" ,htslib)
  2018. ("pbcopper" ,pbcopper)
  2019. ("zlib" ,zlib)))
  2020. (inputs
  2021. `(("boost" ,boost)
  2022. ("samtools" ,samtools)))
  2023. (native-inputs
  2024. `(("cram" ,python-cram)
  2025. ("googletest" ,googletest)
  2026. ("pkg-config" ,pkg-config)
  2027. ("python" ,python-wrapper))) ; for tests
  2028. (home-page "https://github.com/PacificBiosciences/pbbam")
  2029. (synopsis "Work with PacBio BAM files")
  2030. (description
  2031. "The pbbam software package provides components to create, query, and
  2032. edit PacBio BAM files and associated indices. These components include a core
  2033. C++ library, bindings for additional languages, and command-line utilities.
  2034. This library is not intended to be used as a general-purpose BAM utility - all
  2035. input and output BAMs must adhere to the PacBio BAM format specification.
  2036. Non-PacBio BAMs will cause exceptions to be thrown.")
  2037. (license license:bsd-3)))
  2038. (define-public pbcopper
  2039. (package
  2040. (name "pbcopper")
  2041. (version "1.9.1")
  2042. (source
  2043. (origin
  2044. (method git-fetch)
  2045. (uri (git-reference
  2046. (url "https://github.com/PacificBiosciences/pbcopper")
  2047. (commit (string-append "v" version))))
  2048. (file-name (git-file-name name version))
  2049. (sha256
  2050. (base32
  2051. "1pphklil5kn1ds796ch41bgvdf7yq03z6w5rgi572s8xg8k5b0xn"))))
  2052. (build-system meson-build-system)
  2053. (arguments
  2054. `(#:phases
  2055. (modify-phases %standard-phases
  2056. (add-after 'unpack 'patch-source
  2057. (lambda _
  2058. (substitute* "meson.build"
  2059. ;; uncomment when upstreaming
  2060. ;(("sse4\\.1") "nosse4.1")
  2061. (("v8\\.2-a") "v8-a"))
  2062. #t)))))
  2063. (inputs
  2064. `(("boost" ,boost)))
  2065. (native-inputs
  2066. `(("googletest" ,googletest)))
  2067. (home-page "https://github.com/PacificBiosciences/pbcopper")
  2068. (synopsis "Data structures, algorithms, and utilities for C++ applications")
  2069. (description "The pbcopper library provides a suite of data structures,
  2070. algorithms, and utilities for PacBio C++ applications.")
  2071. (license license:bsd-3)))
  2072. (define-public pbmm2
  2073. (package
  2074. (name "pbmm2")
  2075. (version "1.4.0")
  2076. (source
  2077. (origin
  2078. (method git-fetch)
  2079. (uri (git-reference
  2080. (url "https://github.com/PacificBiosciences/pbmm2")
  2081. (commit (string-append "v" version))))
  2082. (file-name (git-file-name name version))
  2083. (sha256
  2084. (base32
  2085. "0c01c647c7wvq5jzkf68xsf0bn8mlyw0hbz2fiyirxg7hj05jyac"))))
  2086. (build-system meson-build-system)
  2087. (arguments
  2088. `(#:tests? #f)) ; TODO: Fix later.
  2089. (inputs
  2090. `(("boost" ,boost)
  2091. ("htslib" ,htslib)
  2092. ("minimap2" ,minimap2-for-pbmm2)
  2093. ("pbbam" ,pbbam-1)
  2094. ("pbcopper" ,pbcopper)))
  2095. (native-inputs
  2096. `(("cram" ,python-cram)
  2097. ("googletest" ,googletest)
  2098. ("pkg-config" ,pkg-config)
  2099. ("samtools" ,samtools)
  2100. ("util-linux" ,util-linux)
  2101. ("zlib" ,zlib)))
  2102. (home-page "https://github.com/PacificBiosciences/pbmm2")
  2103. (synopsis "minimap2 frontend for PacBio native data formats")
  2104. (description "pbmm2 is a SMRT C++ wrapper for minimap2's C API. Its purpose is to support native PacBio in- and output, provide sets of recommended parameters, generate sorted output on-the-fly, and postprocess alignments. Sorted output can be used directly for polishing using GenomicConsensus, if BAM has been used as input to pbmm2. Benchmarks show that pbmm2 outperforms BLASR in sequence identity, number of mapped bases, and especially runtime. pbmm2 is the official replacement for BLASR.")
  2105. (license license:bsd-3)))
  2106. (define minimap2-for-pbmm2
  2107. (package
  2108. (name "minimap2")
  2109. (version "2.17")
  2110. (source
  2111. (origin
  2112. (method git-fetch)
  2113. (uri (git-reference
  2114. (url "https://github.com/pacificbiosciences/minimap2")
  2115. (commit (string-append version "-meson"))))
  2116. (file-name (git-file-name "minimap2-for-pbmm2" version))
  2117. (sha256
  2118. (base32
  2119. "1833y6xdcblz7k4fyclryd6lwibsisp4svp2mk9w6ivk64icl6jq"))))
  2120. (build-system meson-build-system)
  2121. (inputs
  2122. `(("zlib" ,zlib)))
  2123. (native-inputs
  2124. `(("pkg-config" ,pkg-config)))
  2125. (home-page "https://lh3.github.io/minimap2/")
  2126. (synopsis "Pairwise aligner for genomic and spliced nucleotide sequences")
  2127. (description "Minimap2 is a versatile sequence alignment program that
  2128. aligns DNA or mRNA sequences against a large reference database. Typical use
  2129. cases include:
  2130. @enumerate
  2131. @item mapping PacBio or Oxford Nanopore genomic reads to the human genome;
  2132. @item finding overlaps between long reads with error rate up to ~15%;
  2133. @item splice-aware alignment of PacBio Iso-Seq or Nanopore cDNA or Direct RNA
  2134. reads against a reference genome;
  2135. @item aligning Illumina single- or paired-end reads;
  2136. @item assembly-to-assembly alignment;
  2137. @item full-genome alignment between two closely related species with
  2138. divergence below ~15%.
  2139. @end enumerate\n")
  2140. (license license:expat)))
  2141. (define-public hap.py
  2142. (package
  2143. (name "hap.py")
  2144. (version "0.3.14")
  2145. (source
  2146. (origin
  2147. (method git-fetch)
  2148. (uri (git-reference
  2149. (url "https://github.com/Illumina/hap.py")
  2150. (commit (string-append "v" version))))
  2151. (file-name (git-file-name name version))
  2152. (sha256
  2153. (base32 "1bnm7s86651p3zf6wahz5pic7n8416fx677kj47lwckr3syp2x1h"))
  2154. (modules '((guix build utils)))
  2155. (snippet
  2156. '(begin
  2157. (delete-file-recursively "external/bcftools.tar.gz")
  2158. (delete-file-recursively "external/boost_subset_1_58_0.tar.bz2")
  2159. (delete-file-recursively "external/htslib.tar.gz")
  2160. ;; TODO: Unbundle jsoncpp.
  2161. ;(delete-file-recursively "external/jsoncpp")
  2162. ;(delete-file-recursively "external/klib")
  2163. (delete-file-recursively "external/samtools.tar.gz")
  2164. (delete-file-recursively "external/virtualenv-12.0.7.tar.gz")
  2165. (delete-file-recursively "external/zlib-1.2.8.tar.gz")
  2166. #t))))
  2167. (build-system cmake-build-system)
  2168. (arguments
  2169. `(#:configure-flags (list "-DBUILD_VCFEVAL=ON")
  2170. #:phases
  2171. (modify-phases %standard-phases
  2172. (add-after 'unpack 'set-package-version
  2173. (lambda _
  2174. (substitute* "CMakeLists.txt"
  2175. (("git describe --tags --always")
  2176. (string-append "echo " ,version)))
  2177. #t))
  2178. ;; A shared library conflicts with boost-static.
  2179. ;; Not using boost-static causes linking errors.
  2180. ;(add-after 'unpack 'build-dynamic-library
  2181. ; (lambda _
  2182. ; (substitute* "src/c++/lib/CMakeLists.txt"
  2183. ; (("STATIC") "SHARED"))
  2184. ; #t))
  2185. (add-after 'unpack 'fix-build
  2186. (lambda* (#:key inputs #:allow-other-keys)
  2187. (let ((zlib (assoc-ref inputs "zlib"))
  2188. (bcftools (assoc-ref inputs "bcftools"))
  2189. (boost (assoc-ref inputs "boost"))
  2190. (htslib (assoc-ref inputs "htslib"))
  2191. (samtools (assoc-ref inputs "samtools")))
  2192. (mkdir-p "external/bin")
  2193. (mkdir-p "external/lib")
  2194. (mkdir-p "external/include")
  2195. (mkdir-p "external/scratch/lib")
  2196. (substitute* "external/make_dependencies.sh"
  2197. (("zlib-1\\.2\\.8/libz\\.a") "lib/libz.so"))
  2198. (substitute* "src/cmake/FindHTSLib.cmake"
  2199. (("libhts\\.a") "libhts.so"))
  2200. (substitute* "CMakeLists.txt"
  2201. (("ZLIB_LIBRARIES .*\\)")
  2202. (string-append "ZLIB_LIBRARIES \"" zlib "/lib/libz.so\")")))
  2203. (setenv "BOOST_ROOT" boost)
  2204. (setenv "LDFLAGS"
  2205. (string-append "-L" (assoc-ref %build-inputs "htslib") "/lib"))
  2206. (symlink (string-append zlib "/lib/libz.so")
  2207. "external/scratch/lib/libz.so")
  2208. (symlink (string-append htslib "/include/htslib")
  2209. "external/include/htslib")
  2210. (symlink (string-append htslib "/lib/libhts.so")
  2211. "external/lib/libhts.so")
  2212. (symlink (string-append htslib "/lib/libhts.so")
  2213. "external/lib/libhts.so.3")
  2214. (symlink (string-append bcftools "/bin/bcftools")
  2215. "external/bin/bcftools")
  2216. (symlink (string-append samtools "/bin/samtools")
  2217. "external/bin/samtools")
  2218. #t)))
  2219. (add-after 'fix-build 'insert-rtg-tools
  2220. (lambda* (#:key inputs #:allow-other-keys)
  2221. (let ((rtg-tools (assoc-ref inputs "rtg-tools"))
  2222. (dest "external/libexec/rtg-tools-install"))
  2223. (mkdir-p (dirname dest))
  2224. (symlink rtg-tools dest)
  2225. #t)))
  2226. (replace 'configure
  2227. (lambda* (#:key outputs (configure-flags '()) (out-of-source? #t)
  2228. build-type target
  2229. #:allow-other-keys)
  2230. "Configure the given package."
  2231. (let* ((out (assoc-ref outputs "out"))
  2232. (abs-srcdir (getcwd))
  2233. (srcdir (if out-of-source?
  2234. (string-append "../" (basename abs-srcdir))
  2235. ".")))
  2236. (format #t "source directory: ~s (relative from build: ~s)~%"
  2237. abs-srcdir srcdir)
  2238. (when out-of-source?
  2239. (mkdir "../build")
  2240. ;; Extra code added here!!
  2241. (copy-recursively "external/scratch" "../build/scratch")
  2242. (copy-recursively "external/libexec" "../build/libexec")
  2243. (copy-recursively "external/lib" "../build/lib")
  2244. (copy-recursively "external/bin" "../build/bin")
  2245. (copy-recursively "external/include" "../build/include")
  2246. (chdir "../build"))
  2247. (format #t "build directory: ~s~%" (getcwd))
  2248. (let ((args `(,srcdir
  2249. ,@(if build-type
  2250. (list (string-append "-DCMAKE_BUILD_TYPE="
  2251. build-type))
  2252. '())
  2253. ,(string-append "-DCMAKE_INSTALL_PREFIX=" out)
  2254. ;; ensure that the libraries are installed into /lib
  2255. "-DCMAKE_INSTALL_LIBDIR=lib"
  2256. ;; add input libraries to rpath
  2257. "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
  2258. ;; add (other) libraries of the project itself to rpath
  2259. ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib")
  2260. ;; enable verbose output from builds
  2261. "-DCMAKE_VERBOSE_MAKEFILE=ON"
  2262. ;; Cross-build
  2263. ,@(if target
  2264. (list (string-append "-DCMAKE_C_COMPILER="
  2265. target "-gcc")
  2266. (string-append "-DCMAKE_CXX_COMPILER="
  2267. target "-g++")
  2268. (if (string-contains target "mingw")
  2269. "-DCMAKE_SYSTEM_NAME=Windows"
  2270. "-DCMAKE_SYSTEM_NAME=Linux"))
  2271. '())
  2272. ,@configure-flags)))
  2273. (format #t "running 'cmake' with arguments ~s~%" args)
  2274. (apply invoke "cmake" args)))))
  2275. (replace 'check
  2276. (lambda* (#:key tests? #:allow-other-keys)
  2277. (when tests?
  2278. (invoke "./bin/test_haplotypes"))
  2279. #t))
  2280. (add-before 'install 'remove-extra-files
  2281. (lambda _
  2282. (delete-file "bin/bcftools")
  2283. (delete-file "bin/samtools")
  2284. (delete-file "bin/test_haplotypes")
  2285. (delete-file "lib/libhts.so")
  2286. (delete-file "lib/libhts.so.3")
  2287. #t))
  2288. (add-after 'install 'wrap-programs
  2289. (lambda* (#:key inputs outputs #:allow-other-keys)
  2290. (let ((out (assoc-ref outputs "out"))
  2291. (bcftools (assoc-ref inputs "bcftools"))
  2292. (samtools (assoc-ref inputs "samtools")))
  2293. (for-each
  2294. (lambda (file)
  2295. (wrap-script file
  2296. `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
  2297. `("PATH" ":" prefix (,(string-append bcftools "/bin")
  2298. ,(string-append samtools "/bin")))))
  2299. (find-files (string-append out "/bin") "\\.py$"))
  2300. #t))))))
  2301. (inputs
  2302. `(("bcftools" ,bcftools)
  2303. ("boost" ,boost-static) ; has to be boost-static
  2304. ("guile" ,guile-3.0) ; for wrap-script
  2305. ("htslib" ,htslib)
  2306. ;; The software specifically states python-2.
  2307. ("python" ,python-2)
  2308. ("python2-bx-python" ,python2-bx-python)
  2309. ("python2-numpy" ,python2-numpy)
  2310. ("python2-pandas" ,python2-pandas)
  2311. ("python2-pysam" ,python2-pysam)
  2312. ("python2-scipy" ,python2-scipy)
  2313. ("rtg-tools" ,rtg-tools)
  2314. ("samtools" ,samtools)
  2315. ("zlib" ,zlib)))
  2316. (home-page "https://github.com/Illumina/hap.py")
  2317. (synopsis "Haplotype VCF comparison tools")
  2318. (description
  2319. "This is a set of programs based on htslib to benchmark variant calls
  2320. against gold standard truth datasets.
  2321. The main two tools are @code{hap.py} (diploid precision/recall evaluation) and
  2322. @code{som.py} (somatic precision/recall evaluation -- this ignores the GT and
  2323. just checks for presence of alleles). Other tools are @code{qfy.py} (which just
  2324. executes the quantification step of the analysis pipeline, this requires a
  2325. GA4GH-intermediate VCF file), and @code{pre.py}, which is @code{hap.py}'s input
  2326. cleaning and variant normalisation step.
  2327. To run the bundled rtg-tools software you will also need java. The
  2328. @code{icedtea:jdk} output should work nicely.")
  2329. (license (list license:expat ; bundled jsoncpp, klib
  2330. license:bsd-2))))