1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
3 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
4 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages chemistry)
24 #:use-module (guix packages)
25 #:use-module (guix utils)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages algebra)
31 #:use-module (gnu packages boost)
32 #:use-module (gnu packages compression)
33 #:use-module (gnu packages documentation)
34 #:use-module (gnu packages gl)
35 #:use-module (gnu packages gv)
36 #:use-module (gnu packages maths)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages python-xyz)
40 #:use-module (gnu packages qt)
41 #:use-module (gnu packages xml)
42 #:use-module (guix build-system cmake)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system python))
46 (define-public avogadro
54 (url "https://github.com/cryos/avogadro.git")
57 (base32 "0258py3lkba85qhs5ynancinyym61vlp0zaq9yrfs3hhnhpzv9n2"))
58 (file-name (git-file-name name version))
60 (search-patches "avogadro-eigen3-update.patch"
61 "avogadro-python-eigen-lib.patch"
62 "avogadro-boost148.patch"))))
63 (build-system cmake-build-system)
67 (list "-DENABLE_GLSL=ON"
68 (string-append "-DPYTHON_LIBRARIES="
69 (assoc-ref %build-inputs "python")
71 (string-append "-DPYTHON_INCLUDE_DIRS="
72 (assoc-ref %build-inputs "python")
75 (package-version python))))
77 (modify-phases %standard-phases
78 (add-after 'unpack 'patch-python-lib-path
79 (lambda* (#:key outputs #:allow-other-keys)
80 ;; This is necessary to install the Python module in the correct
82 (substitute* "libavogadro/src/python/CMakeLists.txt"
83 (("^EXECUTE_PROCESS.*$") "")
84 (("^.*from sys import stdout.*$") "")
85 (("^.*OUTPUT_VARIABLE.*")
86 (string-append "set(PYTHON_LIB_PATH \""
87 (assoc-ref outputs "out")
90 (package-version python))
91 "/site-packages\")")))
93 (add-after 'install 'wrap-program
94 (lambda* (#:key inputs outputs #:allow-other-keys)
95 ;; Make sure 'avogadro' runs with the correct PYTHONPATH.
96 (let* ((out (assoc-ref outputs "out")))
99 (assoc-ref outputs "out")
101 ,(version-major+minor
102 (package-version python))
104 (getenv "PYTHONPATH")))
105 (wrap-program (string-append out "/bin/avogadro")
106 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
109 `(("doxygen" ,doxygen)
110 ("pkg-config" ,pkg-config)))
115 ("openbabel" ,openbabel)
117 ("python-numpy" ,python2-numpy)
118 ("python-pyqt" ,python2-pyqt-4)
119 ("python-sip" ,python2-sip)
122 (home-page "https://avogadro.cc")
123 (synopsis "Advanced molecule editor")
125 "Avogadro is an advanced molecule editor and visualizer designed for use
126 in computational chemistry, molecular modeling, bioinformatics, materials
127 science, and related areas. It offers flexible high quality rendering and a
128 powerful plugin architecture.")
129 (license license:gpl2+)))
131 (define-public domainfinder
133 (name "domainfinder")
138 (uri (string-append "https://bitbucket.org/khinsen/"
139 "domainfinder/downloads/DomainFinder-"
143 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
144 (build-system python-build-system)
146 `(("python-mmtk" ,python2-mmtk)))
151 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder.html")
152 (synopsis "Analysis of dynamical domains in proteins")
153 (description "DomainFinder is an interactive program for the determination
154 and characterization of dynamical domains in proteins. It can infer dynamical
155 domains by comparing two protein structures, or from normal mode analysis on a
156 single structure. The software is currently not actively maintained and works
157 only with Python 2 and NumPy < 1.9.")
158 (license license:cecill-c)))
166 (uri (string-append "http://www.inchi-trust.org/download/"
167 (string-join (string-split version #\.) "")
171 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
172 (file-name (string-append name "-" version ".zip"))))
173 (build-system gnu-build-system)
175 '(#:tests? #f ; no check target
177 (modify-phases %standard-phases
178 (delete 'configure) ; no configure script
179 (add-before 'build 'chdir-to-build-directory
180 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
181 (add-after 'build 'build-library
183 (chdir "../../../INCHI_API/libinchi/gcc")
186 (lambda* (#:key inputs outputs #:allow-other-keys)
187 (let* ((out (assoc-ref outputs "out"))
188 (bin (string-append out "/bin"))
189 (doc (string-append out "/share/doc/inchi"))
190 (include-dir (string-append out "/include/inchi"))
191 (lib (string-append out "/lib/inchi"))
192 (inchi-doc (assoc-ref inputs "inchi-doc"))
193 (unzip (string-append (assoc-ref inputs "unzip")
197 (with-directory-excursion "INCHI_EXE/bin/Linux"
198 (rename-file "inchi-1" "inchi")
199 (install-file "inchi" bin))
200 ;; Install libraries.
201 (with-directory-excursion "INCHI_API/bin/Linux"
202 (for-each (lambda (file)
203 (install-file file lib))
204 (find-files "." "libinchi\\.so\\.1\\.*")))
205 ;; Install header files.
206 (with-directory-excursion "INCHI_BASE/src"
207 (for-each (lambda (file)
208 (install-file file include-dir))
209 (find-files "." "\\.h$")))
210 ;; Install documentation.
212 (invoke unzip "-j" "-d" doc inchi-doc)
219 (uri (string-append "http://www.inchi-trust.org/download/"
220 (string-join (string-split version #\.) "")
224 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
225 (file-name (string-append name "-" version ".zip"))))))
226 (home-page "https://www.inchi-trust.org")
227 (synopsis "Utility for manipulating machine-readable chemical structures")
229 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
230 chemical structures into machine-readable strings of information. InChIs are
231 unique to the compound they describe and can encode absolute stereochemistry
232 making chemicals and chemistry machine-readable and discoverable. A simple
233 analogy is that InChI is the bar-code for chemistry and chemical structures.")
234 (license (license:non-copyleft
236 "See LICENCE in the distribution."))))
238 (define with-numpy-1.8
239 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
241 (define-public nmoldyn
249 (url "https://github.com/khinsen/nMOLDYN3")
250 (commit (string-append "v" version))))
251 (file-name (git-file-name name version))
254 "016h4bqg419p6s7bcx55q5iik91gqmk26hbnfgj2j6zl0j36w51r"))))
255 (build-system python-build-system)
257 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
258 ("python-scientific" ,python2-scientific)
262 `(("python-mmtk" ,python2-mmtk)))
265 #:tests? #f ; No test suite
267 (modify-phases %standard-phases
268 (add-before 'build 'create-linux2-directory
270 (mkdir-p "nMOLDYN/linux2")))
271 (add-before 'build 'change-PDF-viewer
272 (lambda* (#:key inputs #:allow-other-keys)
273 (substitute* "nMOLDYN/Preferences.py"
274 ;; Set the paths for external executables, substituting
276 ;; There is also vmd_path, but VMD is not free software
277 ;; and Guix contains currently no free molecular viewer that
278 ;; could be substituted.
279 (("PREFERENCES\\['acroread_path'\\] = ''")
280 (format "PREFERENCES['acroread_path'] = '~a'"
282 (("PREFERENCES\\['ncdump_path'\\] = ''")
283 (format "PREFERENCES['ncdump_path'] = '~a'"
285 (("PREFERENCES\\['ncgen_path'\\] = ''")
286 (format "PREFERENCES['ncgen_path'] = '~a'"
288 (("PREFERENCES\\['task_manager_path'\\] = ''")
289 (format "PREFERENCES['task_manager_path'] = '~a'"
290 (which "task_manager")))
291 ;; Show documentation as PDF
292 (("PREFERENCES\\['documentation_style'\\] = 'html'")
293 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
294 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN.html")
295 (synopsis "Analysis software for Molecular Dynamics trajectories")
296 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
297 simulations. It is especially designed for the computation and decomposition of
298 neutron scattering spectra, but also computes other quantities. The software
299 is currently not actively maintained and works only with Python 2 and
301 (license license:cecill)))
303 (define-public openbabel
309 (uri (string-append "mirror://sourceforge/" name "/" name "/"
310 version "/" name "-" version ".tar.gz"))
313 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
315 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
316 (build-system cmake-build-system)
319 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
320 (string-append "-DINCHI_LIBRARY="
321 (assoc-ref %build-inputs "inchi")
322 "/lib/inchi/libinchi.so.1")
323 (string-append "-DINCHI_INCLUDE_DIR="
324 (assoc-ref %build-inputs "inchi") "/include/inchi"))
325 #:test-target "test"))
327 `(("pkg-config" ,pkg-config)))
333 (home-page "http://openbabel.org/wiki/Main_Page")
334 (synopsis "Chemistry data manipulation toolbox")
336 "Open Babel is a chemical toolbox designed to speak the many languages of
337 chemical data. It's a collaborative project allowing anyone to search, convert,
338 analyze, or store data from molecular modeling, chemistry, solid-state
339 materials, biochemistry, or related areas.")
340 (license license:gpl2)))