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