1{ lib
2, fetchFromGitHub
3, fetchpatch
4, rPackages
5, buildPythonPackage
6, biopython
7, numpy
8, scipy
9, scikit-learn
10, pandas
11, matplotlib
12, reportlab
13, pysam
14, future
15, pillow
16, pomegranate
17, pyfaidx
18, python
19, pythonOlder
20, R
21}:
22
23buildPythonPackage rec {
24 pname = "cnvkit";
25 version = "0.9.10";
26 format = "setuptools";
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchFromGitHub {
31 owner = "etal";
32 repo = "cnvkit";
33 rev = "refs/tags/v${version}";
34 hash = "sha256-mCQXo3abwC06x/g51UBshqUk3dpqEVNUvx+cJ/EdYGQ=";
35 };
36
37 postPatch = ''
38 # see https://github.com/etal/cnvkit/issues/589
39 substituteInPlace setup.py \
40 --replace 'joblib < 1.0' 'joblib'
41 # see https://github.com/etal/cnvkit/issues/680
42 substituteInPlace test/test_io.py \
43 --replace 'test_read_vcf' 'dont_test_read_vcf'
44 '';
45
46 propagatedBuildInputs = [
47 biopython
48 numpy
49 scipy
50 scikit-learn
51 pandas
52 matplotlib
53 reportlab
54 pyfaidx
55 pysam
56 future
57 pillow
58 pomegranate
59 rPackages.DNAcopy
60 ];
61
62 nativeCheckInputs = [ R ];
63
64 checkPhase = ''
65 pushd test/
66 ${python.interpreter} test_io.py
67 ${python.interpreter} test_genome.py
68 ${python.interpreter} test_cnvlib.py
69 ${python.interpreter} test_commands.py
70 ${python.interpreter} test_r.py
71 popd # test/
72 '';
73
74 pythonImportsCheck = [
75 "cnvlib"
76 ];
77
78 meta = with lib; {
79 homepage = "https://cnvkit.readthedocs.io";
80 description = "A Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data";
81 changelog = "https://github.com/etal/cnvkit/releases/tag/v${version}";
82 license = licenses.asl20;
83 maintainers = [ maintainers.jbedo ];
84 };
85}