summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavid Afkhami <navid.afkhami@mdc-berlin.de>2024-02-13 13:49:33 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-02-13 17:18:52 +0100
commit2da76d86b13ac5ae8fdb7ddd9df76a9212b8e2c2 (patch)
treee66094189ffafcd529f3e49ba0f8adad45961c0d
parent0ca0ab8bbd8ee46848cc21fcffbdd4d545ebfcfa (diff)
machine-learning: Add python-alphafold.
* guix-science/packages/machine-learning.scm (python-alphafold): New variable. Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
-rw-r--r--guix-science/packages/machine-learning.scm82
1 files changed, 82 insertions, 0 deletions
diff --git a/guix-science/packages/machine-learning.scm b/guix-science/packages/machine-learning.scm
index 40e10af..e5479a5 100644
--- a/guix-science/packages/machine-learning.scm
+++ b/guix-science/packages/machine-learning.scm
@@ -17,6 +17,7 @@
17(define-module (guix-science packages machine-learning) 17(define-module (guix-science packages machine-learning)
18 #:use-module ((guix licenses) #:prefix license:) 18 #:use-module ((guix licenses) #:prefix license:)
19 #:use-module (gnu packages assembly) 19 #:use-module (gnu packages assembly)
20 #:use-module (gnu packages bioinformatics)
20 #:use-module (gnu packages check) 21 #:use-module (gnu packages check)
21 #:use-module (gnu packages compression) 22 #:use-module (gnu packages compression)
22 #:use-module (gnu packages cpp) 23 #:use-module (gnu packages cpp)
@@ -51,8 +52,89 @@
51 #:use-module (guix utils) 52 #:use-module (guix utils)
52 #:use-module (guix-science build-system bazel) 53 #:use-module (guix-science build-system bazel)
53 #:use-module (guix-science packages bazel) 54 #:use-module (guix-science packages bazel)
55 #:use-module (guix-science packages machine-learning)
54 #:use-module (guix-science packages python)) 56 #:use-module (guix-science packages python))
55 57
58(define-public python-alphafold
59 (package
60 (name "python-alphafold")
61 (version "2.3.2")
62 (source
63 (origin
64 (method git-fetch)
65 (uri (git-reference
66 (url "https://github.com/google-deepmind/alphafold")
67 (commit (string-append "v" version))))
68 (file-name (git-file-name name version))
69 (sha256
70 (base32 "1c82v3l3m52cfmjj7lm0z3k423lrb6y7d5baq4kcj4gfxnh7qiya"))))
71 (build-system pyproject-build-system)
72 (arguments
73 (list
74 #:test-flags
75 '(list "-k" (string-append
76 ;; These fail because of absl argument parsing.
77 ;; They seem to be harmless.
78 "not test_end_to_end_no_relax"
79 " and not test_end_to_end_relax"
80 ;; I/O operation on closed file
81 " and not test_overwrite_b_factors"
82 ;; XXX These tests fail to minimize (at least
83 ;; without GPU). This could be an actual problem.
84 " and not test_unresolved_violations"
85 " and not test_iterative_relax"
86 " and not test_multiple_disulfides_target"
87 " and not test_process"))
88 #:phases
89 '(modify-phases %standard-phases
90 (add-after 'unpack 'install-chemical-props
91 (lambda* (#:key inputs #:allow-other-keys)
92 (copy-file (assoc-ref inputs "chemical-props")
93 "alphafold/common/stereo_chemical_props.txt")))
94 (add-after 'unpack 'fix-requirements
95 (lambda _
96 (substitute* "setup.py"
97 (("tensorflow-cpu") "tensorflow"))
98 (substitute* "requirements.txt"
99 (("tensorflow-cpu==.*") "tensorflow\n"))))
100 (add-after 'unpack 'openmm-compatibility
101 (lambda _
102 (substitute* '("alphafold/relax/amber_minimize.py"
103 "alphafold/relax/cleanup_test.py"
104 "alphafold/relax/cleanup.py")
105 (("from simtk import openmm") "import openmm")
106 (("simtk\\.openmm") "openmm")))))))
107 (propagated-inputs (list openmm
108 python-absl-py
109 python-biopython
110 python-chex
111 python-dm-haiku
112 python-dm-tree
113 python-immutabledict
114 python-jax
115 python-ml-collections
116 python-pandas
117 python-pdbfixer
118 python-scipy
119 python-tensorflow))
120 (native-inputs
121 `(("python-mock" ,python-mock)
122 ("python-numpy" ,python-numpy)
123 ("python-pytest" ,python-pytest)
124 ("chemical-props"
125 ,(origin
126 (method url-fetch)
127 (uri "https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt")
128 (sha256
129 (base32 "0lclq057sbs57d07lqqckhkhhk9s6r2zmj6yzv7ng4dlxschhl94"))))))
130 (home-page "https://alphafold.ebi.ac.uk/")
131 (synopsis "Predict protein 3D structure from amino acid sequence")
132 (description
133 "AlphaFold is an AI system developed by DeepMind that predicts a
134protein’s 3D structure from its amino acid sequence. It regularly
135achieves accuracy competitive with experiment.")
136 (license license:asl2.0)))
137
56(define-public python-flax 138(define-public python-flax
57 (package 139 (package
58 (name "python-flax") 140 (name "python-flax")