1{
2 lib,
3 fetchFromGitHub,
4 python3Packages,
5 runtimeShell,
6 bcftools,
7 htslib,
8}:
9
10let
11 ssshtest = fetchFromGitHub {
12 owner = "ryanlayer";
13 repo = "ssshtest";
14 rev = "d21f7f928a167fca6e2eb31616673444d15e6fd0";
15 hash = "sha256-zecZHEnfhDtT44VMbHLHOhRtNsIMWeaBASupVXtmrks=";
16 };
17in
18python3Packages.buildPythonApplication rec {
19 pname = "truvari";
20 version = "4.2.2";
21 pyproject = true;
22
23 src = fetchFromGitHub {
24 owner = "ACEnglish";
25 repo = "truvari";
26 rev = "v${version}";
27 hash = "sha256-SFBVatcVavBfQtFbBcXifBX3YnKsxJS669vCcyjsBA4=";
28 };
29
30 postPatch = ''
31 substituteInPlace truvari/utils.py \
32 --replace "/bin/bash" "${runtimeShell}"
33 patchShebangs repo_utils/test_files
34 '';
35
36 build-system = [
37 python3Packages.setuptools
38 ];
39
40 dependencies = with python3Packages; [
41 pywfa
42 rich
43 edlib
44 pysam
45 intervaltree
46 joblib
47 numpy
48 pytabix
49 bwapy
50 pandas
51 pyabpoa
52 ];
53
54 makeWrapperArgs = [
55 "--prefix"
56 "PATH"
57 ":"
58 (lib.makeBinPath [
59 bcftools
60 htslib
61 ])
62 ];
63
64 pythonImportsCheck = [ "truvari" ];
65
66 nativeCheckInputs = [
67 bcftools
68 htslib
69 ]
70 ++ (with python3Packages; [
71 coverage
72 ]);
73
74 checkPhase = ''
75 runHook preCheck
76
77 ln -s ${ssshtest}/ssshtest .
78 bash repo_utils/truvari_ssshtests.sh
79
80 runHook postCheck
81 '';
82
83 meta = with lib; {
84 description = "Structural variant comparison tool for VCFs";
85 homepage = "https://github.com/ACEnglish/truvari";
86 changelog = "https://github.com/ACEnglish/truvari/releases/tag/${src.rev}";
87 license = licenses.mit;
88 maintainers = with maintainers; [
89 natsukium
90 scalavision
91 ];
92 longDescription = ''
93 Truvari is a benchmarking tool for comparison sets of SVs.
94 It can calculate the recall, precision, and f-measure of a
95 vcf from a given structural variant caller. The tool
96 is created by Spiral Genetics.
97 '';
98 };
99}