Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# Instructions:http://www.ensembl.org/info/docs/api/api_installation.html,
2# Do not use https://github.com/Ensembl/ensembl-vep/archive/release/${version}.zip
3# We cannot use INSTALL.pl but it’s not that bad:install the dependencies and copies the .pm files should be ok
4{
5 lib,
6 htslib,
7 perlPackages,
8 stdenv,
9 fetchFromGitHub,
10 perl,
11 makeWrapper,
12}:
13
14let
15 version = "110";
16 customInstallPhase = ''
17 mkdir -p $out/${perl.libPrefix}/${perl.version}/
18 tests=$(find modules/ -mindepth 1 -maxdepth 1 -type d | grep -v t)
19 cp -r $tests $out/${perl.libPrefix}/${perl.version}/
20 '';
21
22 ensemblGit =
23 name: sha256:
24 # Copy modules directly
25 stdenv.mkDerivation {
26 inherit name version;
27 src = fetchFromGitHub {
28 inherit sha256 version;
29 owner = "Ensembl";
30 repo = name;
31 rev = "release/${version}";
32 };
33 installPhase = ''
34 runHook preInstall
35
36 ${customInstallPhase}
37
38 runHook postInstall'';
39 };
40
41 vepPlugins = fetchFromGitHub {
42 owner = "Ensembl";
43 repo = "VEP_plugins";
44 rev = "8f271c4848338dc7d504881ff71fdf2892c3d096";
45 sha256 = "sha256-LbaXwLFDP3m1QhRHwO9uh36BEFHE2NzL4xdxTb7/S5Q=";
46 };
47
48 # Install ensembl-xs, faster run using re-implementation in C of some of the Perl subroutines
49 ensembl-xs = perlPackages.buildPerlPackage rec {
50 pname = "ensembl-xs";
51 version = "2.3.2";
52 src = fetchFromGitHub {
53 inherit version;
54 owner = "Ensembl";
55 repo = "ensembl-xs";
56 rev = version;
57 sha256 = "1qqnski532f4bz32wxbqd9w1sz40rjh81ipp9p02k3rlaf1gp1fa";
58 };
59 # PREFIX is important
60 configurePhase = ''
61 runHook preConfigure
62
63 perl Makefile.PL PREFIX=$out INSTALLDIRS=site
64
65 runHook postConfigure
66 '';
67 # Test do not work -- wrong include path
68 doCheck = false;
69 };
70
71 # it contains compiled versions of certain key subroutines used in VEP
72 ensembl = ensemblGit "ensembl" "sha256-ZhI4VNxIY+53RX2uYRNlFeo/ydAmlwGx00WDXaxv6h4=";
73 ensembl-io = ensemblGit "ensembl-io" "sha256-r3RvN5U2kcyghoKM0XuiBRe54t1U4FaZ0QEeYIFiG0w=";
74 ensembl-variation = ensemblGit "ensembl-variation" "sha256-UjrLHF9EqI+Mp+SZR4sLNZUCGiA/UYhoFWtpwiKF8tM=";
75 ensembl-funcgen = ensemblGit "ensembl-funcgen" "sha256-a9hxLBoXJsF5JWuRdpyOac1u033M8ivEjEQecuncghs=";
76in
77perlPackages.buildPerlModule rec {
78 inherit version;
79 pname = "vep";
80 buildInputs =
81 (with perlPackages; [
82 ArchiveZip
83 BioBigFile
84 BioDBHTS
85 BioExtAlign
86 BioPerl
87 DBI
88 DBDmysql
89 LWP
90 JSON
91 ])
92 ++ [
93 ensembl-xs
94 ensembl
95 ensembl-funcgen
96 ensembl-io
97 ensembl-variation
98 ];
99 propagatedBuildInputs = [ htslib ];
100 src = fetchFromGitHub {
101 owner = "Ensembl";
102 repo = "ensembl-${pname}";
103 rev = "release/${version}";
104 sha256 = "sha256-6lRdWV2ispl+mpBhkZez/d9PxOw1fkNUWeG8mUIqBJc=";
105 };
106
107 nativeBuildInputs = [ makeWrapper ];
108 dontBuild = true;
109 doCheck = false;
110
111 outputs = [ "out" ];
112
113 installPhase = ''
114 runHook preInstall
115
116 mkdir -p $out/bin
117 install -D -m755 filter_vep vep $out/bin/
118
119 wrapProgram $out/bin/vep \
120 --prefix PERL5LIB : $out/${perl.libPrefix}/${perl.version}/ \
121 --add-flags "--dir_plugins ${vepPlugins}"
122
123 wrapProgram $out/bin/filter_vep \
124 --prefix PERL5LIB : $out/${perl.libPrefix}/${perl.version}/
125 ${customInstallPhase}
126
127 runHook postInstall
128 '';
129
130 meta = {
131 homepage = "https://www.ensembl.org/info/docs/tools/vep/index.html";
132 description = "Annotate genetics variants based on genes, transcripts, and protein sequence, as well as regulatory regions";
133 license = lib.licenses.asl20;
134 mainProgram = "vep";
135 maintainers = with lib.maintainers; [ apraga ];
136 platforms = lib.platforms.unix;
137 };
138}