diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2025-02-06 17:42:09 +0100 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2025-02-06 17:49:48 +0100 |
| commit | 67bec9b0b21723625ec8cd87c62dfea7aedf100b (patch) | |
| tree | bbc40c85b97cfeeea1b36d8d6f78bfc3a589e84d | |
| parent | b643e805b596f57a17d73e450256efb03ebe1b28 (diff) | |
bioconductor: Add r-rbioformats.
* guix-science/packages/bioconductor.scm (r-rbioformats): New variable.
| -rw-r--r-- | guix-science/packages/bioconductor.scm | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/guix-science/packages/bioconductor.scm b/guix-science/packages/bioconductor.scm index f22c492..9123ddf 100644 --- a/guix-science/packages/bioconductor.scm +++ b/guix-science/packages/bioconductor.scm | |||
| @@ -23,8 +23,10 @@ | |||
| 23 | #:use-module (guix build-system r) | 23 | #:use-module (guix build-system r) |
| 24 | #:use-module (gnu packages) | 24 | #:use-module (gnu packages) |
| 25 | #:use-module (gnu packages bioconductor) | 25 | #:use-module (gnu packages bioconductor) |
| 26 | #:use-module (gnu packages compression) | ||
| 26 | #:use-module (gnu packages cran) | 27 | #:use-module (gnu packages cran) |
| 27 | #:use-module (guix-science packages cran) | 28 | #:use-module (guix-science packages cran) |
| 29 | #:use-module (gnu packages java) | ||
| 28 | #:use-module (gnu packages statistics) | 30 | #:use-module (gnu packages statistics) |
| 29 | #:use-module (gnu packages web)) | 31 | #:use-module (gnu packages web)) |
| 30 | 32 | ||
| @@ -131,3 +133,75 @@ classes. Special attention is given to single-cell data in a | |||
| 131 | @code{SingleCellExperiment} object with visualization of | 133 | @code{SingleCellExperiment} object with visualization of |
| 132 | dimensionality reduction results.") | 134 | dimensionality reduction results.") |
| 133 | (license license:expat))) | 135 | (license license:expat))) |
| 136 | |||
| 137 | (define-public r-rbioformats | ||
| 138 | (package | ||
| 139 | (name "r-rbioformats") | ||
| 140 | (version "1.6.0") | ||
| 141 | (source | ||
| 142 | (origin | ||
| 143 | (method url-fetch) | ||
| 144 | (uri (bioconductor-uri "RBioFormats" version)) | ||
| 145 | (sha256 | ||
| 146 | (base32 "0vqpr5g6v96gnfpznx09pwzcj4n2230hqh8hiip3m3pbnxicilnx")) | ||
| 147 | (snippet '(delete-file "inst/java/RBioFormats.jar")))) | ||
| 148 | (properties `((upstream-name . "RBioFormats"))) | ||
| 149 | (build-system r-build-system) | ||
| 150 | (arguments | ||
| 151 | (list | ||
| 152 | #:modules | ||
| 153 | '((guix build r-build-system) | ||
| 154 | ((guix build ant-build-system) #:prefix ant:) | ||
| 155 | (guix build utils)) | ||
| 156 | #:imported-modules | ||
| 157 | `((guix build ant-build-system) | ||
| 158 | ,@%r-build-system-modules) | ||
| 159 | #:phases | ||
| 160 | #~(modify-phases %standard-phases | ||
| 161 | (add-after 'unpack 'build-jar | ||
| 162 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 163 | (let ((jar (assoc-ref inputs "bioformats_package.jar"))) | ||
| 164 | (with-directory-excursion "java" | ||
| 165 | (mkdir "build") | ||
| 166 | (invoke "javac" "-d" "./build" "-cp" jar | ||
| 167 | "RBioFormats.java") | ||
| 168 | (with-directory-excursion "build" | ||
| 169 | (apply invoke "jar" "cvf" "../../inst/java/RBioFormats.jar" | ||
| 170 | (find-files "."))))))) | ||
| 171 | (add-after 'install 'strip-jar-timestamps | ||
| 172 | (assoc-ref ant:%standard-phases 'strip-jar-timestamps)) | ||
| 173 | (add-after 'unpack 'fix-jar-location | ||
| 174 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 175 | (let ((jar (assoc-ref inputs "bioformats_package.jar")) | ||
| 176 | (target (string-append #$output "/share/bioformats_package_7.3.0.jar"))) | ||
| 177 | (mkdir-p (dirname target)) | ||
| 178 | (copy-file jar target) | ||
| 179 | (substitute* "R/zzz.R" | ||
| 180 | (("cache_dir <-" m) | ||
| 181 | (string-append "if (file.exists(file.path(\"" (dirname target) | ||
| 182 | "\", jar_filename))) { return(file.path(\"" | ||
| 183 | (dirname target) "\", \"" | ||
| 184 | (basename target) "\")); }\n" | ||
| 185 | m)))))) | ||
| 186 | (add-after 'unpack 'fix-tests | ||
| 187 | (lambda _ | ||
| 188 | (substitute* "tests/testthat/test-utils.R" | ||
| 189 | (("6") "7"))))))) | ||
| 190 | (inputs (list (list openjdk11 "jdk"))) | ||
| 191 | (propagated-inputs (list r-ebimage r-rjava r-s4vectors)) | ||
| 192 | (native-inputs | ||
| 193 | (list r-knitr | ||
| 194 | r-testthat | ||
| 195 | zip | ||
| 196 | (origin | ||
| 197 | (method url-fetch) | ||
| 198 | ;; The exact version is mentioned in DESCRIPTION. | ||
| 199 | (uri "https://github.com/ome/bioformats/releases/download/v7.3.0/bioformats_package.jar") | ||
| 200 | (sha256 | ||
| 201 | (base32 "11bagd1jydc0alv609q48b6xxrysqb7mk3kvq2rypgnvyfzdgcib"))))) | ||
| 202 | (home-page "https://github.com/aoles/RBioFormats") | ||
| 203 | (synopsis "R interface to Bio-Formats") | ||
| 204 | (description | ||
| 205 | "This is an R package which interfaces with the OME Bio-Formats Java | ||
| 206 | library to allow reading of proprietary microscopy image data and metadata.") | ||
| 207 | (license license:gpl3))) | ||
