1{
2 lib,
3 fetchFromGitHub,
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.11";
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-tlR1LsR+M1nkzk3CgrkkNcSGP3juv25GXddWDDWJ5ao=";
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 = [ "cnvlib" ];
75
76 meta = with lib; {
77 homepage = "https://cnvkit.readthedocs.io";
78 description = "Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data";
79 changelog = "https://github.com/etal/cnvkit/releases/tag/v${version}";
80 license = licenses.asl20;
81 maintainers = [ maintainers.jbedo ];
82 };
83}