Archived
1
0
Fork 0

gnu: bismark: Update to 0.24.1.

* gnu/packages/bioinformatics.scm (bismark): Update to 0.24.1.
[source]: Delete bundled plot.ly.
[arguments]: Use plain list; remove trailing #T from build phases; adjust
'replace-plotly.js phase to account for use of script tags; adjust 'install
phase to install documentation in markdown format; add 'configure phase for
replacing references to tools.
[inputs]: Add bowtie, hisat2, minimap2, and samtools.
This commit is contained in:
Ricardo Wurmus 2023-07-05 16:38:24 +02:00
parent 961ffca1c7
commit df5bf65f26
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -12300,7 +12300,7 @@ Browser.")
(define-public bismark (define-public bismark
(package (package
(name "bismark") (name "bismark")
(version "0.20.1") (version "0.24.1")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -12310,34 +12310,61 @@ Browser.")
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"0xchm3rgilj6vfjnyzfzzymfd7djr64sbrmrvs3njbwi66jqbzw9")))) "0j4dy33769f0jr2w1brb710zxwpg3zwjlnvlcpi5pr6mqc8dkg8n"))
(snippet '(delete-file "plotly/plot.ly"))))
(build-system perl-build-system) (build-system perl-build-system)
(arguments (arguments
`(#:tests? #f ; there are no tests (list
#:modules ((guix build utils) #:tests? #f ; there are no tests
#:modules '((guix build utils)
(ice-9 popen) (ice-9 popen)
(srfi srfi-26) (srfi srfi-26)
(guix build perl-build-system)) (guix build perl-build-system))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
;; The bundled plotly.js is minified.
(add-after 'unpack 'replace-plotly.js (add-after 'unpack 'replace-plotly.js
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((file (assoc-ref inputs "plotly.js")) (let* ((share (string-append #$output "/share/bismark"))
(file (assoc-ref inputs "plotly.js"))
(installed "plotly/plotly.js")) (installed "plotly/plotly.js"))
;; The bundled plotly.js is minified.
(let ((minified (open-pipe* OPEN_READ "uglifyjs" file))) (let ((minified (open-pipe* OPEN_READ "uglifyjs" file)))
(call-with-output-file installed (call-with-output-file installed
(cut dump-port minified <>)))) (cut dump-port minified <>)))
#t)) (substitute* "bismark2report"
(delete 'configure) (("plotly_template.tpl")
(string-append share "/plotly/plotly_template.tpl"))
(("my \\$plotly_code = read_report_template\\('plot.ly'\\);")
(string-append "\
my $plotly_code = read_report_template('" share "/plotly/plotly.js');
$plotly_code = \"<script>\" . $plotly_code . \"</script>\";"))))))
(replace 'configure
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "bismark"
(("\\(\\!system \"which samtools >/dev/null 2>&1\"\\)")
"(\"true\")")
(("\\$samtools_path = `which samtools`;")
(string-append "$samtools_path = '"
(search-input-file inputs "/bin/samtools")
"';"))
(("\\$path_to_bowtie2 = 'bowtie2'")
(string-append "$path_to_bowtie2 = '"
(search-input-file inputs "/bin/bowtie2")
"'"))
(("\\$path_to_hisat2 = 'hisat2'")
(string-append "$path_to_hisat2 = '"
(search-input-file inputs "/bin/hisat2")
"'"))
(("\\$path_to_minimap2 = 'minimap2'")
(string-append "$path_to_minimap2 = '"
(search-input-file inputs "/bin/minimap2")
"'")))))
(delete 'build) (delete 'build)
(replace 'install (replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((bin (string-append #$output "/bin"))
(bin (string-append out "/bin")) (share (string-append #$output "/share/bismark"))
(share (string-append out "/share/bismark")) (docdir (string-append #$output "/share/doc/bismark"))
(docdir (string-append out "/share/doc/bismark"))
(docs '("Docs/Bismark_User_Guide.html"))
(scripts '("bismark" (scripts '("bismark"
"bismark_genome_preparation" "bismark_genome_preparation"
"bismark_methylation_extractor" "bismark_methylation_extractor"
@ -12349,17 +12376,12 @@ Browser.")
"bam2nuc" "bam2nuc"
"bismark2summary" "bismark2summary"
"NOMe_filtering"))) "NOMe_filtering")))
(substitute* "bismark2report"
(("\\$RealBin/plotly")
(string-append share "/plotly")))
(mkdir-p share) (mkdir-p share)
(mkdir-p docdir) (mkdir-p docdir)
(mkdir-p bin) (mkdir-p bin)
(for-each (lambda (file) (install-file file bin)) (for-each (lambda (file) (install-file file bin))
scripts) scripts)
(for-each (lambda (file) (install-file file docdir)) (copy-recursively "docs" docdir)
docs)
(copy-recursively "Docs/Images" (string-append docdir "/Images"))
(copy-recursively "plotly" (copy-recursively "plotly"
(string-append share "/plotly")) (string-append share "/plotly"))
@ -12369,10 +12391,9 @@ Browser.")
scripts) scripts)
(("\"gunzip -c") (("\"gunzip -c")
(string-append "\"" (assoc-ref inputs "gzip") (string-append "\"" (assoc-ref inputs "gzip")
"/bin/gunzip -c"))) "/bin/gunzip -c")))))))))
#t))))))
(inputs (inputs
(list gzip perl-carp perl-getopt-long)) (list bowtie gzip hisat2 minimap2 perl-carp perl-getopt-long samtools))
(native-inputs (native-inputs
`(("plotly.js" `(("plotly.js"
,(origin ,(origin