gnu: Add u-boot-cubietruck.
[jackhill/guix/guix.git] / gnu / packages / chemistry.scm
CommitLineData
73114e30
KH
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
a49eb85c 3;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
73114e30
KH
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages chemistry)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
348edd91 24 #:use-module (gnu packages algebra)
a49eb85c 25 #:use-module (gnu packages compression)
f250a868
KH
26 #:use-module (gnu packages gv)
27 #:use-module (gnu packages maths)
348edd91 28 #:use-module (gnu packages pkg-config)
73114e30 29 #:use-module (gnu packages python)
348edd91
KK
30 #:use-module (gnu packages xml)
31 #:use-module (guix build-system cmake)
a49eb85c 32 #:use-module (guix build-system gnu)
73114e30
KH
33 #:use-module (guix build-system python))
34
35(define-public domainfinder
36 (package
37 (name "domainfinder")
38 (version "2.0.5")
39 (source
40 (origin
41 (method url-fetch)
42 (uri (string-append "https://bitbucket.org/khinsen/"
43 "domainfinder/downloads/DomainFinder-"
44 version ".tar.gz"))
45 (sha256
46 (base32
47 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
48 (build-system python-build-system)
49 (inputs
50 `(("python-mmtk" ,python2-mmtk)))
51 (arguments
52 `(#:python ,python-2
53 ;; No test suite
54 #:tests? #f))
55 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder")
56 (synopsis "Analysis of dynamical domains in proteins")
57 (description "DomainFinder is an interactive program for the determination
58and characterization of dynamical domains in proteins. It can infer dynamical
59domains by comparing two protein structures, or from normal mode analysis on a
60single structure. The software is currently not actively maintained and works
61only with Python 2 and NumPy < 1.9.")
62 (license license:cecill-c)))
f250a868 63
a49eb85c
KK
64(define-public inchi
65 (package
66 (name "inchi")
67 (version "1.05")
68 (source (origin
69 (method url-fetch)
70 (uri (string-append "http://www.inchi-trust.org/download/"
71 (string-join (string-split version #\.) "")
72 "/INCHI-1-SRC.zip"))
73 (sha256
74 (base32
75 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
76 (file-name (string-append name "-" version ".zip"))))
77 (build-system gnu-build-system)
78 (arguments
79 '(#:tests? #f ; no check target
80 #:phases
81 (modify-phases %standard-phases
82 (delete 'configure) ; no configure script
83 (add-before 'build 'chdir-to-build-directory
84 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
85 (add-after 'build 'build-library
86 (lambda _
87 (chdir "../../../INCHI_API/libinchi/gcc")
88 (invoke "make")))
89 (replace 'install
90 (lambda* (#:key inputs outputs #:allow-other-keys)
91 (let* ((out (assoc-ref outputs "out"))
92 (bin (string-append out "/bin"))
93 (doc (string-append out "/share/doc/inchi"))
94 (include-dir (string-append out "/include/inchi"))
95 (lib (string-append out "/lib/inchi"))
96 (inchi-doc (assoc-ref inputs "inchi-doc"))
97 (unzip (string-append (assoc-ref inputs "unzip")
98 "/bin/unzip")))
99 (chdir "../../..")
100 ;; Install binary.
101 (with-directory-excursion "INCHI_EXE/bin/Linux"
102 (rename-file "inchi-1" "inchi")
103 (install-file "inchi" bin))
104 ;; Install libraries.
105 (with-directory-excursion "INCHI_API/bin/Linux"
106 (for-each (lambda (file)
107 (install-file file lib))
108 (find-files "." "libinchi\\.so\\.1\\.*")))
109 ;; Install header files.
110 (with-directory-excursion "INCHI_BASE/src"
111 (for-each (lambda (file)
112 (install-file file include-dir))
113 (find-files "." "\\.h$")))
114 ;; Install documentation.
115 (mkdir-p doc)
116 (invoke unzip "-j" "-d" doc inchi-doc)
117 #t))))))
118 (native-inputs
119 `(("unzip" ,unzip)
120 ("inchi-doc"
121 ,(origin
122 (method url-fetch)
123 (uri (string-append "http://www.inchi-trust.org/download/"
124 (string-join (string-split version #\.) "")
125 "/INCHI-1-DOC.zip"))
126 (sha256
127 (base32
128 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
129 (file-name (string-append name "-" version ".zip"))))))
130 (home-page "https://www.inchi-trust.org")
131 (synopsis "Utility for manipulating machine-readable chemical structures")
132 (description
133 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
134chemical structures into machine-readable strings of information. InChIs are
135unique to the compound they describe and can encode absolute stereochemistry
136making chemicals and chemistry machine-readable and discoverable. A simple
137analogy is that InChI is the bar-code for chemistry and chemical structures.")
138 (license (license:non-copyleft
139 "file://LICENCE"
140 "See LICENCE in the distribution."))))
141
f250a868
KH
142(define with-numpy-1.8
143 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
144
145(define-public nmoldyn
146 (package
147 (name "nmoldyn")
148 (version "3.0.11")
149 (source
150 (origin
151 (method url-fetch)
152 (uri (string-append "https://bitbucket.org/khinsen/"
153 "nmoldyn3/downloads/nMOLDYN-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1mvmz3lkr217kdrd8cvdr1d82y58wp1403c9rnd943mijgq8xb5a"))))
158 (build-system python-build-system)
159 (inputs
160 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
c695fb76
TGR
161 ("python-scientific" ,python2-scientific)
162 ("netcdf" ,netcdf)
f250a868
KH
163 ("gv" ,gv)))
164 (propagated-inputs
165 `(("python-mmtk" ,python2-mmtk)))
166 (arguments
167 `(#:python ,python-2
168 #:tests? #f ; No test suite
169 #:phases
170 (modify-phases %standard-phases
171 (add-before 'build 'create-linux2-directory
172 (lambda _
173 (mkdir-p "nMOLDYN/linux2")))
174 (add-before 'build 'change-PDF-viewer
175 (lambda* (#:key inputs #:allow-other-keys)
176 (substitute* "nMOLDYN/Preferences.py"
177 ;; Set the paths for external executables, substituting
178 ;; gv for acroread.
179 ;; There is also vmd_path, but VMD is not free software
180 ;; and Guix contains currently no free molecular viewer that
181 ;; could be substituted.
182 (("PREFERENCES\\['acroread_path'\\] = ''")
183 (format "PREFERENCES['acroread_path'] = '~a'"
184 (which "gv")))
185 (("PREFERENCES\\['ncdump_path'\\] = ''")
186 (format "PREFERENCES['ncdump_path'] = '~a'"
187 (which "ncdump")))
188 (("PREFERENCES\\['ncgen_path'\\] = ''")
189 (format "PREFERENCES['ncgen_path'] = '~a'"
190 (which "ncgen3")))
191 (("PREFERENCES\\['task_manager_path'\\] = ''")
192 (format "PREFERENCES['task_manager_path'] = '~a'"
193 (which "task_manager")))
194 ;; Show documentation as PDF
195 (("PREFERENCES\\['documentation_style'\\] = 'html'")
196 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
197 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN/")
198 (synopsis "Analysis software for Molecular Dynamics trajectories")
199 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
200simulations. It is especially designed for the computation and decomposition of
201neutron scattering spectra, but also computes other quantities. The software
202is currently not actively maintained and works only with Python 2 and
203NumPy < 1.9.")
204 (license license:cecill)))
348edd91
KK
205
206(define-public openbabel
207 (package
208 (name "openbabel")
209 (version "2.4.1")
210 (source (origin
211 (method url-fetch)
212 (uri (string-append "mirror://sourceforge/" name "/" name "/"
213 version "/" name "-" version ".tar.gz"))
214 (sha256
215 (base32
eb5ece73
KK
216 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
217 (patches
218 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
348edd91
KK
219 (build-system cmake-build-system)
220 (arguments
221 `(#:configure-flags
222 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
223 (string-append "-DINCHI_LIBRARY="
224 (assoc-ref %build-inputs "inchi")
225 "/lib/inchi/libinchi.so.1")
226 (string-append "-DINCHI_INCLUDE_DIR="
227 (assoc-ref %build-inputs "inchi") "/include/inchi"))
228 #:test-target "test"))
229 (native-inputs
230 `(("pkg-config" ,pkg-config)))
231 (inputs
232 `(("eigen" ,eigen)
233 ("inchi" ,inchi)
234 ("libxml2" ,libxml2)
235 ("zlib" ,zlib)))
236 (home-page "http://openbabel.org/wiki/Main_Page")
237 (synopsis "Chemistry data manipulation toolbox")
238 (description
239 "Open Babel is a chemical toolbox designed to speak the many languages of
240chemical data. It's a collaborative project allowing anyone to search, convert,
241analyze, or store data from molecular modeling, chemistry, solid-state
242materials, biochemistry, or related areas.")
243 (license license:gpl2)))