2018-02-02 01:24:06 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bzip2
|
|
|
|
, bcftools
|
|
|
|
, curl
|
|
|
|
, cython
|
|
|
|
, htslib
|
|
|
|
, lzma
|
|
|
|
, pytest
|
|
|
|
, samtools
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pysam";
|
2020-02-17 15:22:13 +00:00
|
|
|
version = "0.15.4";
|
2018-02-02 01:24:06 +00:00
|
|
|
|
|
|
|
# Fetching from GitHub instead of PyPi cause the 0.13 src release on PyPi is
|
|
|
|
# missing some files which cause test failures.
|
|
|
|
# Tracked at: https://github.com/pysam-developers/pysam/issues/616
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pysam-developers";
|
|
|
|
repo = "pysam";
|
|
|
|
rev = "v${version}";
|
2020-02-17 15:22:13 +00:00
|
|
|
sha256 = "04w6h6mv6lsr74hj9gy4r2laifcbhgl2bjcr4r1l9r73xdd45mdy";
|
2018-02-02 01:24:06 +00:00
|
|
|
};
|
|
|
|
|
2020-02-17 15:22:13 +00:00
|
|
|
nativeBuildInputs = [ samtools ];
|
2018-02-02 01:24:06 +00:00
|
|
|
buildInputs = [ bzip2 curl cython lzma zlib ];
|
|
|
|
|
2020-02-17 15:22:13 +00:00
|
|
|
checkInputs = [ pytest bcftools htslib ];
|
2018-02-02 01:24:06 +00:00
|
|
|
checkPhase = "py.test";
|
|
|
|
|
2020-02-17 15:22:13 +00:00
|
|
|
# tests require samtools<=1.9
|
|
|
|
doCheck = false;
|
|
|
|
preCheck = ''
|
2018-02-02 01:24:06 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
make -C tests/pysam_data
|
|
|
|
make -C tests/cbcf_data
|
|
|
|
'';
|
|
|
|
|
2020-02-17 15:22:13 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pysam"
|
|
|
|
"pysam.bcftools"
|
|
|
|
"pysam.libcutils"
|
|
|
|
"pysam.libcvcf"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2018-02-02 01:24:06 +00:00
|
|
|
description = "A python module for reading, manipulating and writing genome data sets";
|
2020-02-17 15:22:13 +00:00
|
|
|
homepage = "https://pysam.readthedocs.io/";
|
|
|
|
maintainers = with maintainers; [ unode ];
|
|
|
|
license = licenses.mit;
|
2018-02-02 01:24:06 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|