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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
{ stdenv, callPackage, buildPerlPackage, fetchurl, fetchFromGitHub, perlPackages, R, bwa, samtools, pkgconfig, zlib, htslib, curl, bzip2, lzma, gnutls, nettle, gmp, p11-kit, libtasn1, perl, psmisc, time, vcftools, rWrapper, rPackages }:
let
ascat = fetchurl {
url = "https://raw.githubusercontent.com/Crick-CancerGenomics/ascat/v2.5.1/ASCAT/R/ascat.R";
sha256 = "1rja9s6rksmi0kc6lhx1vr5yqv2xazgxdlwc7mbj2m881x8nngb1";
};
libmaus2 = stdenv.mkDerivation rec {
name = "libmaus-${version}";
version = "2.0.499-release-20180606122508";
src = fetchFromGitHub {
owner = "gt1";
repo = "libmaus2";
rev = version;
sha256 = "1rk2f3jirn84vgsfml4c8pr6vl5s0xbds1d0givb5pvjmc6jz61x";
};
buildInputs = [ zlib ];
};
biobambam2 = stdenv.mkDerivation rec {
name = "biobambam-${version}";
version = "2.0.87-release-20180301132713";
src = fetchFromGitHub {
owner = "gt1";
repo = "biobambam2";
rev = version;
sha256 = "1hjh6kl62hr9afi6fa6x563823lmmmijh1y2204db0nfnaybnrn6";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libmaus2 zlib ];
};
libBigWig = stdenv.mkDerivation rec {
name = "libBigWig-${version}";
version = "0.4.2";
src = fetchFromGitHub {
owner = "dpryan79";
repo = "libBigWig";
rev = version;
sha256 = "0h2smg24v5srdcqzrmz2g23cmlp4va465mgx8r2z571sfz8pv454";
};
buildInputs = [ curl ];
makeFlags = [ "prefix=$(out)" ];
};
cgpBigWig = stdenv.mkDerivation rec {
name = "cgpBigWig-${version}";
version = "1.0.2";
src = fetchFromGitHub {
owner = "cancerit";
repo = "cgpBigWig";
rev = version;
sha256 = "1piprbibmrwbh524plp9s35z5cf1yk7713dxsdik2qv363p6pfsa";
};
buildInputs = [ htslib libBigWig curl bzip2 lzma gnutls libtasn1 nettle gmp p11-kit ];
configurePhase = ''
cd c
patchShebangs .
'';
makeFlags = [ "HTSLIB=${htslib}" "LIBBIGWIG=${libBigWig}" ];
installPhase = ''
mkdir -p $out
cp -r ../bin $out
'';
};
BioDBHTS = buildPerlPackage rec {
name = "Bio-DB-HTS-${version}";
version = "2.11";
src = fetchFromGitHub {
owner = "Ensembl";
repo = "Bio-DB-HTS";
rev = version;
sha256 = "0n60vmsd39pz6zbkwz78fdzsmfg8dxgwx0m166vm8515q446922c";
};
nativeBuildInputs = with perlPackages; [ ModuleBuild ];
buildInputs = [ htslib zlib ];
#propagatedBuildInputs = [ BioRootVersion ];
configurePhase = ''
export HTSLIB_DIR=${htslib}
sed -i 's|"-Wl,-rpath,\$hts_lib",||' Build.PL
perl ./Build.PL --install_base=$out
'';
buildPhase = ''
./Build
'';
installPhase = ''
./Build install
mkdir -p $out/lib/perl5/site_perl/${perl.version}
mv $out/lib/perl5/x86_64-linux-thread-multi $out/lib/perl5/site_perl/${perl.version}
'';
};
BioPerl = buildPerlPackage rec {
name = "BioPerl-1.7.4";
src = fetchurl {
url = "mirror://cpan/authors/id/C/CD/CDRAUG/${name}.tar.gz";
sha256 = "0yvhgifs8g9rwdcq84zw4b005nq2jml6c75zgjscv6d2pd3lj1ss";
};
propagatedBuildInputs = with perlPackages; [ DBI DataStag Error GD Graph HTTPMessage HTTPMessage IOstringy IOString IPCRun LWP ListMoreUtils SetScalar TestMost TestRequiresInternet URI XMLDOM XMLDOMXPath XMLLibXML XMLLibXML libxml_perl XMLSAX XMLSAXBase XMLSAXWriter XMLTwig XMLWriter YAML DBFile ];
nativeBuildInputs = with perlPackages; [ TestException TestWarn TestDifferences TestDeep ];
};
DataStag = buildPerlPackage rec {
name = "Data-Stag-0.14";
src = fetchurl {
url = "mirror://cpan/authors/id/C/CM/CMUNGALL/${name}.tar.gz";
sha256 = "0ncf4l39ka23nb01jlm6rzxdb5pqbip01x0m38bnvf1gim825caa";
};
propagatedBuildInputs = with perlPackages; [ IOString Graph XMLLibXSLT ];
};
XMLDOMXPath = buildPerlPackage rec {
name = "XML-DOM-XPath-0.14";
src = fetchurl {
url = "mirror://cpan/authors/id/M/MI/MIROD/${name}.tar.gz";
sha256 = "1si9m1pqih3ibbd6jnw69fh98dd4krxpx90p65x9j4aja55afwq1";
};
propagatedBuildInputs = with perlPackages; [ XMLDOM XMLXPathEngine ];
doCheck = false;
};
pcapCore = buildPerlPackage rec {
name = "PCAP-core-${version}";
version = "4.2.3";
src = fetchFromGitHub {
owner = "cancerit";
repo = "PCAP-core";
rev = version;
sha256 = "0ia9z0k4jpa02596smivpkw85vi9sv7sbxnysv7jdyh2g1rv1s5c";
};
nativeBuildInputs = with perlPackages; [ TestFatal TestWarn ];
propagatedBuildInputs = with perlPackages; [
bwa
samtools
biobambam2
cgpBigWig
ConstFast
FileWhich
IPCSystemSimple
CaptureTiny
TermUI
BioDBHTS
DataUUID
YAML
BioPerl
JSON
psmisc
];
preConfigure = ''
sed -i 's|/usr/bin/time|${time}/bin/time|' lib/PCAP/Threaded.pm
sed -i 's|/bin/bash|${stdenv.shell}|' lib/PCAP/Threaded.pm
'';
};
cgpVcf = buildPerlPackage rec {
name = "cgpVCF-${version}";
version = "2.0.4";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "cancerit";
repo = "cgpVcf";
rev = "v${version}";
sha256 = "0j8spk02v4l0nrqsa42d57djb4nm71daz5hvlm5fwakfq8037yx4";
};
nativeBuildInputs = with perlPackages; [ TestFatal TestWarn ];
propagatedBuildInputs = with perlPackages; [
ConstFast
samtools
vcftools
DataUUID
DateTime
IPCSystemSimple
];
};
BDebug = buildPerlPackage rec {
name = "B-Debug-1.26";
src = fetchurl {
url = "mirror://cpan/authors/id/R/RU/RURBAN/${name}.tar.gz";
sha256 = "0fhdaxpkirgnwivd0a7x83dvfwqbngsq2rcfwvfxipgh6i8kyvcd";
};
};
DevelCover = buildPerlPackage rec {
name = "Devel-Cover-1.31";
src = fetchurl {
url = "mirror://cpan/authors/id/P/PJ/PJCJ/${name}.tar.gz";
sha256 = "0wsd7fkpy5qwnz68hz624frnbqii5igg6l2q7n1mx1lh32vn0kcr";
};
nativeBuildInputs = with perlPackages; [ BDebug ];
doCheck = false;
};
alleleCount = stdenv.mkDerivation rec {
name = "alleleCount-${version}";
version = "4.0.1";
src = fetchFromGitHub {
owner = "cancerit";
repo = "alleleCount";
rev = "v${version}";
sha256 = "0nkwnjqglgshzhlmz1r0khdjai9mfz4ih8bzrzg0g18d1725k6gp";
};
buildInputs = [ htslib perl zlib bzip2 lzma ];
preConfigure = "cd c";
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin
'';
};
alleleCountPerl = buildPerlPackage rec {
name = "alleleCount.pl-${version}";
version = "4.0.1";
src = fetchFromGitHub {
owner = "cancerit";
repo = "alleleCount";
rev = "v${version}";
sha256 = "0nkwnjqglgshzhlmz1r0khdjai9mfz4ih8bzrzg0g18d1725k6gp";
};
preConfigure = ''
cd perl
'';
nativeBuildInputs = with perlPackages; [
TestFatal
];
propagatedBuildInputs = with perlPackages; [
ConstFast
DevelCover
FileSlurp
FileWhich
PodCoverage
TryTiny
alleleCount
IPCSystemSimple
];
};
ascatR = rWrapper.overrideAttrs (attrs: {
packages = with rPackages; [ RColorBrewer ];
});
ascatNGS = buildPerlPackage rec {
name = "ascatNGS-${version}";
version = "4.1.2";
src = fetchFromGitHub {
owner = "cancerit";
repo = "ascatNgs";
rev = "v${version}";
sha256 = "0qc1wp37k2c9vya992cfiphp2jpp8hvfvqz5ydi2d5b71prfaw82";
};
preConfigure = ''
cd perl
cp ${ascat} share/ascat/ascat.R
'';
nativeBuildInputs = with perlPackages; [ TestFatal TestWarn ];
propagatedBuildInputs = with perlPackages; [
ascatR
FileShareDirInstall
pcapCore
FileShareDir
cgpVcf
alleleCountPerl
];
};
in
ascatNGS
|