1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 swig,
6 cython,
7 matplotlib,
8 numpy,
9 pandas,
10 pysam,
11 setuptools,
12 pytestCheckHook,
13 nix-update-script,
14}:
15buildPythonPackage rec {
16 pname = "htseq";
17 version = "2.0.9";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "htseq";
22 repo = "htseq";
23 rev = "release_${version}";
24 hash = "sha256-i83BY7/p98/pfYzebolNW/6yNwtb2R5ARCSG3rAq2/M=";
25 };
26
27 nativeBuildInputs = [ swig ];
28
29 build-system = [
30 cython
31 numpy
32 pysam
33 setuptools
34 ];
35
36 dependencies = [
37 numpy
38 pysam
39 ];
40
41 optional-dependencies = {
42 htseq-qa = [ matplotlib ];
43 };
44
45 pythonImportsCheck = [ "HTSeq" ];
46
47 nativeCheckInputs = [
48 pandas
49 pytestCheckHook
50 ]
51 ++ optional-dependencies.htseq-qa;
52
53 preCheck = ''
54 rm -r src HTSeq
55 export PATH=$out/bin:$PATH
56 '';
57
58 passthru.updateScript = nix-update-script {
59 extraArgs = [
60 "--version-regex"
61 "release_(.+)"
62 ];
63 };
64
65 meta = with lib; {
66 homepage = "https://htseq.readthedocs.io/";
67 description = "Framework to work with high-throughput sequencing data";
68 maintainers = with maintainers; [ unode ];
69 };
70}