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 ] ++ optional-dependencies.htseq-qa;
51
52 preCheck = ''
53 rm -r src HTSeq
54 export PATH=$out/bin:$PATH
55 '';
56
57 passthru.updateScript = nix-update-script {
58 extraArgs = [
59 "--version-regex"
60 "release_(.+)"
61 ];
62 };
63
64 meta = with lib; {
65 homepage = "https://htseq.readthedocs.io/";
66 description = "Framework to work with high-throughput sequencing data";
67 maintainers = with maintainers; [ unode ];
68 };
69}