From f1d249105763e68c11fa77227e2075d44dc122fb Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 19 Sep 2020 01:59:07 +0100 Subject: [PATCH 1/5] bwa: include static library and some key headers in output --- pkgs/applications/science/biology/bwa/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/biology/bwa/default.nix b/pkgs/applications/science/biology/bwa/default.nix index e478c104edef..7212b42198c4 100644 --- a/pkgs/applications/science/biology/bwa/default.nix +++ b/pkgs/applications/science/biology/bwa/default.nix @@ -11,8 +11,15 @@ stdenv.mkDerivation rec { buildInputs = [ zlib ]; + # it's unclear which headers are intended to be part of the public interface + # so we may find ourselves having to add more here over time installPhase = '' - install -vD bwa $out/bin/bwa + install -vD -t $out/bin bwa + install -vD -t $out/lib libbwa.a + install -vD -t $out/include bntseq.h + install -vD -t $out/include bwa.h + install -vD -t $out/include bwamem.h + install -vD -t $out/include bwt.h ''; meta = with stdenv.lib; { From ccf46455001dc730a642cb05a5c967bb877f1dbd Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 19 Sep 2020 13:57:40 +0100 Subject: [PATCH 2/5] pythonPackages.bwapy: init at 0.1.4 --- .../python-modules/bwapy/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/bwapy/default.nix diff --git a/pkgs/development/python-modules/bwapy/default.nix b/pkgs/development/python-modules/bwapy/default.nix new file mode 100644 index 000000000000..31884074defd --- /dev/null +++ b/pkgs/development/python-modules/bwapy/default.nix @@ -0,0 +1,42 @@ +{ stdenv +, buildPythonPackage +, pythonOlder +, fetchPypi +, bwa +, cffi +, zlib +}: + +buildPythonPackage rec { + pname = "bwapy"; + version = "0.1.4"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "090qwx3vl729zn3a7sksbviyg04kc71gpbm3nd8dalqp673x1npw"; + }; + postPatch = '' + # replace bundled bwa + rm -r bwa/* + cp ${bwa}/lib/*.a ${bwa}/include/*.h bwa/ + + substituteInPlace setup.py \ + --replace 'setuptools>=49.2.0' 'setuptools' + ''; + + buildInputs = [ zlib bwa ]; + + propagatedBuildInputs = [ cffi ]; + + # no tests + doCheck = false; + pythonImportsCheck = [ "bwapy" ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/ACEnglish/acebinf"; + description = "Python bindings to bwa mem aligner"; + license = licenses.mpl20; + maintainers = with maintainers; [ ris ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 92f8b9690cb2..e67ac553827c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -979,6 +979,8 @@ in { bx-python = callPackage ../development/python-modules/bx-python { inherit (pkgs) zlib; }; + bwapy = callPackage ../development/python-modules/bwapy { }; + bytecode = callPackage ../development/python-modules/bytecode { }; bz2file = callPackage ../development/python-modules/bz2file { }; From 4543e549918e15195ddf304236c8b76307b80490 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 19 Sep 2020 14:01:25 +0100 Subject: [PATCH 3/5] pythonPackages.pytabix: init at 0.1 --- .../python-modules/pytabix/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/python-modules/pytabix/default.nix diff --git a/pkgs/development/python-modules/pytabix/default.nix b/pkgs/development/python-modules/pytabix/default.nix new file mode 100644 index 000000000000..eb21ca198180 --- /dev/null +++ b/pkgs/development/python-modules/pytabix/default.nix @@ -0,0 +1,32 @@ +{ stdenv +, buildPythonPackage +, isPy3k +, fetchPypi +, zlib +}: + +buildPythonPackage rec { + pname = "pytabix"; + version = "0.1"; + + src = fetchPypi { + inherit pname version; + sha256 = "1ldp5r4ggskji6qx4bp2qxy2vrvb3fam03ksn0gq2hdxgrlg2x07"; + }; + + buildInputs = [ zlib ]; + + doCheck = !isPy3k; + preCheck = '' + substituteInPlace test/test.py \ + --replace 'test_remote_file' 'dont_test_remote_file' + ''; + pythonImportsCheck = [ "tabix" ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/slowkow/pytabix"; + description = "Python interface for tabix"; + license = licenses.mit; + maintainers = with maintainers; [ ris ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e67ac553827c..25f90583d7c1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5415,6 +5415,8 @@ in { pysvn = callPackage ../development/python-modules/pysvn { }; + pytabix = callPackage ../development/python-modules/pytabix { }; + pytado = callPackage ../development/python-modules/pytado { }; pytaglib = callPackage ../development/python-modules/pytaglib { }; From e61102d5c24b103d7eb075efa9c36f064c19d82d Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 19 Sep 2020 14:02:03 +0100 Subject: [PATCH 4/5] pythonPackages.acebinf: init at 1.0.2 --- .../python-modules/acebinf/default.nix | 28 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/development/python-modules/acebinf/default.nix diff --git a/pkgs/development/python-modules/acebinf/default.nix b/pkgs/development/python-modules/acebinf/default.nix new file mode 100644 index 000000000000..78810de1740d --- /dev/null +++ b/pkgs/development/python-modules/acebinf/default.nix @@ -0,0 +1,28 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pyvcf +}: + +buildPythonPackage rec { + pname = "ACEBinf"; + version = "1.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "1168pny671l6zfm2vv1pwspnflmzi7f4v8yldjl7zlz0b9cm5zlz"; + }; + + buildInputs = [ pyvcf ]; + + # no tests + doCheck = false; + pythonImportsCheck = [ "acebinf" ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/ACEnglish/acebinf"; + description = "Collection of simple utilities used when building bioinformatics tools"; + license = licenses.unlicense; + maintainers = with maintainers; [ ris ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 25f90583d7c1..a70c8bbcbb99 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -150,6 +150,8 @@ in { accupy = callPackage ../development/python-modules/accupy { }; + acebinf = callPackage ../development/python-modules/acebinf { }; + acme = callPackage ../development/python-modules/acme { }; acme-tiny = callPackage ../development/python-modules/acme-tiny { }; From ecd588683028b29c92c61b9f1cf685431482efd4 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 19 Sep 2020 14:04:52 +0100 Subject: [PATCH 5/5] truvari: 1.3.4 -> 2.0.2, fixing build seeing it has no tests, use pythonImportsCheck in an attempt to detect total breakage, even though it's not intended to be used as an importable module --- .../science/biology/truvari/default.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/science/biology/truvari/default.nix b/pkgs/applications/science/biology/truvari/default.nix index 84cc9909a48d..fffeca2c740c 100644 --- a/pkgs/applications/science/biology/truvari/default.nix +++ b/pkgs/applications/science/biology/truvari/default.nix @@ -5,13 +5,13 @@ python3Packages.buildPythonApplication rec { pname = "truvari"; - version = "1.3.4"; + version = "2.0.2"; src = fetchFromGitHub { owner = "spiralgenetics"; repo = "truvari"; rev = "v${version}"; - sha256 = "1bph7v48s7pyfagz8a2fzl5fycjliqzn5lcbv3m2bp2ih1f1gd1v"; + sha256 = "0lp1wnldjv92k4ncga1h0icb0dpjsrx427vggg40x04a7kp9lwx0"; }; propagatedBuildInputs = with python3Packages; [ @@ -21,15 +21,16 @@ python3Packages.buildPythonApplication rec { pysam pyfaidx intervaltree + pytabix + acebinf + bwapy + joblib + pandas ]; - prePatch = '' - substituteInPlace ./setup.py \ - --replace '"progressbar2==3.41.0",' '"progressbar2",' \ - --replace '"pysam==0.15.2",' '"pysam",' \ - --replace '"pyfaidx==0.5.5.2",' '"pyfaidx",' \ - --replace '"intervaltree==3.0.2",' '"intervaltree",' - ''; + # no tests + doCheck = false; + pythonImportsCheck = [ "truvari" ]; meta = with lib; { description = "Structural variant comparison tool for VCFs";