forked from ekg/guix-genomics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshasta.scm
181 lines (177 loc) · 7.06 KB
/
shasta.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
(define-module (shasta)
#:use-module (guix packages)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system cmake)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bioinformatics)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages graphviz)
#:use-module (gnu packages image)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz))
(define-public shasta
(package
(name "shasta")
(version "0.7.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/chanzuckerberg/shasta")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"0nqzgmk6p15ir207v0rkxmzrjv97frjwpnqis40qjx1z9w9188ry"))
(patches (search-patches "shasta-make-install-target-configurable.patch"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
(list "-DBUILD_STATIC_EXECUTABLE=OFF"
"-DBUILD_STATIC_LIBRARY=OFF"
"-DBUILD_NATIVE=OFF"
(string-append "-DBUILD_ID=\"Shasta Release " ,version "\""))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'fix-pybind11
(lambda _
(substitute* "dynamicLibrary/CMakeLists.txt"
(("python3 -m pybind11 --includes") "python3-config --includes")
(("/usr/bin/python3-config") "python3-config"))
#t))
(add-after 'unpack 'prepare-for-tests
(lambda _
(rename-file "tests/TinyTest.fasta.gz" "../TinyTest.fasta.gz")
#t))
(add-after 'unpack 'fix-rpath
(lambda _
(substitute* "dynamicExecutable/CMakeLists.txt"
(("set_target_properties\\(shastaDynamicExecutable PROPERTIES INSTALL_RPATH.*$") ""))
#t))
(add-after 'install 'create-symlink
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref %outputs "out")))
(with-directory-excursion (string-append out "/bin")
(symlink "shastaDynamic" "shasta"))
#t)))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "gunzip" "../TinyTest.fasta.gz")
(invoke "dynamicExecutable/shastaDynamic"
"--Align.alignMethod" "3"
"--input" "../TinyTest.fasta"))
#t)))))
(inputs
`(("boost" ,boost)
("libpng" ,libpng)
("python" ,python)
("spoa" ,spoa)
("zlib" ,zlib)))
(native-inputs
`(("blast+" ,blast+)
("graphviz" ,graphviz)
("marginPhase" ,marginPhase)
("pybind11" ,pybind11)
("seqan" ,seqan) ))
(synopsis "De novo assembly from Oxford Nanopore reads")
(description
"The goal of the Shasta long read assembler is to rapidly produce
accurate assembled sequence using as input DNA reads generated by
Oxford Nanopore flow cells. Computational methods used by the Shasta
assembler include: Using a run-length representation of the read
sequence. This makes the assembly process more resilient to errors in
homopolymer repeat counts, which are the most common type of errors in
Oxford Nanopore reads. Using in some phases of the computation a
representation of the read sequence based on markers, a fixed subset
of short k-mers (k ≈ 10).")
(home-page "https://chanzuckerberg.github.io/shasta")
(license license:expat)))
(define-public spoa
(package
(name "spoa")
(version "3.4.0") ; This version for shasta-0.7.0.
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/rvaser/spoa")
(commit version)
(recursive? #t)))
(file-name (git-file-name name version))
(sha256
(base32
"177n64d92hwjqisvpb1s4v3kbqni7wlbw2l16wgddhi0hd25lqkf"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
(list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
"-DCMAKE_C_FLAGS=-O3 -fPIC"
"-DBUILD_SHARED_LIBS=ON"
"-Dspoa_generate_dispatch=ON"
"-Dspoa_optimize_for_native=ON"
"-Dspoa_build_tests=ON")
#:phases
(modify-phases %standard-phases
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "./bin/spoa_test"))
#t)))))
(synopsis "SIMD partial order alignment tool/library")
(description
"@acronym{Spoa, SIMD POA} is a c++ implementation of the @acronym{partial
order alignment, POA} algorithm (as described in
10.1093/bioinformatics/18.3.452) which is used to generate consensus sequences
(as described in 10.1093/bioinformatics/btg109). It supports three alignment
modes: local (Smith-Waterman), global (Needleman-Wunsch) and semi-global
alignment (overlap), and three gap modes: linear, affine and convex (piecewise
affine). It supports Intel SSE4.1+ and AVX2 vectorization (marginally faster
due to high latency shifts).")
(home-page "https://github.com/rvaser/spoa.git")
(license license:expat)))
(define-public marginPhase
(let ((version "0.0.0")
(commit "a58020d2e15d599625b5a41580ca2f609d967421")
(package-revision "2"))
(package
(name "marginPhase")
(version (string-append version "+" (string-take commit 7) "-" package-revision))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/benedictpaten/marginPhase.git")
(commit commit)
(recursive? #t)))
(file-name (git-file-name name version))
(sha256
(base32
"0w0hgz49jak4v2gaypqs1ydxa7mgqa07yvanqk4pgn80lzdhih0p"))))
(build-system cmake-build-system)
(arguments
`(#:tests? #f ; no tests
#:configure-flags
(list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
"-DCMAKE_C_FLAGS=-O3 -fPIC")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'kill-htslib
(lambda _
(substitute* "CMakeLists.txt"
(("COMMAND autoheader")
(string-append "COMMAND autoheader && sed -i 's%/bin/sh%"
(which "sh") "%' ./configure")))
#t)))))
(native-inputs
`(("autoconf" ,autoconf)
("curl" ,curl)
("htslib" ,htslib)
("zlib" ,zlib)))
(synopsis "simultaneous haplotyping and genotyping")
(description "MarginPhase combines haplotyping and genotyping.")
(home-page "https://github.com/rvaser/spoa.git")
(license license:expat))))