diff --git a/pkgs/applications/science/biology/truvari/default.nix b/pkgs/applications/science/biology/truvari/default.nix index 412642f523f2..37aa4e8789ab 100644 --- a/pkgs/applications/science/biology/truvari/default.nix +++ b/pkgs/applications/science/biology/truvari/default.nix @@ -1,45 +1,74 @@ { lib , fetchFromGitHub , python3Packages +, runtimeShell +, bcftools +, htslib }: -python3Packages.buildPythonApplication rec { +let + ssshtest = fetchFromGitHub { + owner = "ryanlayer"; + repo = "ssshtest"; + rev = "d21f7f928a167fca6e2eb31616673444d15e6fd0"; + hash = "sha256-zecZHEnfhDtT44VMbHLHOhRtNsIMWeaBASupVXtmrks="; + }; +in python3Packages.buildPythonApplication rec { pname = "truvari"; - version = "2.1.1"; + version = "4.0.0"; src = fetchFromGitHub { - owner = "spiralgenetics"; + owner = "ACEnglish"; repo = "truvari"; rev = "v${version}"; - sha256 = "14nsdbj063qm175xxixs34cihvsiskc9gym8pg7gbwsh13k5a00h"; + hash = "sha256-UJNMKEV5m2jFqnWvkVAtymkcE2TjPIXp7JqRZpMSqsE="; }; postPatch = '' substituteInPlace setup.py \ - --replace 'python-Levenshtein==0.12.1' 'python-Levenshtein>=0.12.1' + --replace "rich==" "rich>=" + substituteInPlace truvari/utils.py \ + --replace "/bin/bash" "${runtimeShell}" + patchShebangs repo_utils/test_files ''; propagatedBuildInputs = with python3Packages; [ - pyvcf - levenshtein - progressbar2 + rich + edlib pysam - pyfaidx intervaltree - pytabix - acebinf - bwapy joblib + numpy + pytabix + bwapy pandas ]; - # no tests - doCheck = false; + makeWrapperArgs = [ + "--prefix" "PATH" ":" (lib.makeBinPath [ bcftools htslib ]) + ]; + pythonImportsCheck = [ "truvari" ]; + nativeCheckInputs = [ + bcftools + htslib + ] ++ (with python3Packages; [ + coverage + ]); + + checkPhase = '' + runHook preCheck + + ln -s ${ssshtest}/ssshtest . + bash repo_utils/truvari_ssshtests.sh + + runHook postCheck + ''; + meta = with lib; { description = "Structural variant comparison tool for VCFs"; - homepage = "https://github.com/spiralgenetics/truvari"; + homepage = "https://github.com/ACEnglish/truvari"; license = licenses.mit; maintainers = with maintainers; [ scalavision ]; longDescription = ''