1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # dependencies
7 appdirs,
8 keras,
9 mhcgnomes,
10 numpy,
11 pandas,
12 pyyaml,
13 scikit-learn,
14 tensorflow,
15 tf-keras,
16 tqdm,
17
18 # tests
19 pytestCheckHook,
20}:
21
22buildPythonPackage rec {
23 pname = "mhcflurry";
24 version = "2.1.5";
25 pyproject = true;
26
27 src = fetchFromGitHub {
28 owner = "openvax";
29 repo = "mhcflurry";
30 tag = "v${version}";
31 hash = "sha256-TNb3oKZvgBuXoSwsTuEJjFKEVZyHynazuPInj7wVKs8=";
32 };
33
34 # keras and tensorflow are not in the official setup.py requirements but are required for the CLI utilities to run.
35 dependencies = [
36 appdirs
37 keras
38 mhcgnomes
39 numpy
40 pandas
41 pyyaml
42 scikit-learn
43 tensorflow
44 tf-keras
45 tqdm
46 ];
47
48 nativeCheckInputs = [
49 pytestCheckHook
50 ];
51
52 disabledTests = [
53 # RuntimeError: Missing MHCflurry downloadable file: /homeless-shelter/.local...
54 "test_a1_mage_epitope_downloaded_models"
55 "test_a1_titin_epitope_downloaded_models"
56 "test_a2_hiv_epitope_downloaded_models"
57 "test_basic"
58 "test_caching"
59 "test_class1_neural_network_a0205_training_accuracy"
60 "test_commandline_sequences"
61 "test_correlation"
62 "test_csv"
63 "test_downloaded_predictor_gives_percentile_ranks"
64 "test_downloaded_predictor_invalid_peptides"
65 "test_downloaded_predictor_is_savable"
66 "test_downloaded_predictor_is_serializable"
67 "test_downloaded_predictor_small"
68 "test_downloaded_predictor"
69 "test_fasta_50nm"
70 "test_fasta_best"
71 "test_fasta"
72 "test_merge"
73 "test_no_csv"
74 "test_on_hpv"
75 "test_run_cluster_parallelism"
76 "test_run_parallel"
77 "test_run_serial"
78 "test_speed_allele_specific"
79 "test_speed_pan_allele"
80 ];
81
82 disabledTestPaths = [
83 # RuntimeError: Missing MHCflurry downloadable file: /homeless-shelter/.local...
84 "test/test_changing_allele_representations.py"
85 "test/test_class1_affinity_predictor.py"
86 "test/test_class1_pan.py"
87 ];
88
89 pythonImportsCheck = [ "mhcflurry" ];
90
91 meta = {
92 description = "Peptide-MHC I binding affinity prediction";
93 homepage = "https://github.com/openvax/mhcflurry";
94 changelog = "https://github.com/openvax/mhcflurry/releases/tag/v${version}";
95 license = lib.licenses.asl20;
96 maintainers = with lib.maintainers; [ samuela ];
97 };
98}