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.
parent
961ffca1c7
commit
df5bf65f26
|
@ -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,69 +12310,90 @@ 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* ((share (string-append #$output "/share/bismark"))
|
||||||
(let* ((file (assoc-ref inputs "plotly.js"))
|
(file (assoc-ref inputs "plotly.js"))
|
||||||
(installed "plotly/plotly.js"))
|
(installed "plotly/plotly.js"))
|
||||||
(let ((minified (open-pipe* OPEN_READ "uglifyjs" file)))
|
;; The bundled plotly.js is minified.
|
||||||
(call-with-output-file installed
|
(let ((minified (open-pipe* OPEN_READ "uglifyjs" file)))
|
||||||
(cut dump-port minified <>))))
|
(call-with-output-file installed
|
||||||
#t))
|
(cut dump-port minified <>)))
|
||||||
(delete 'configure)
|
(substitute* "bismark2report"
|
||||||
(delete 'build)
|
(("plotly_template.tpl")
|
||||||
(replace 'install
|
(string-append share "/plotly/plotly_template.tpl"))
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(("my \\$plotly_code = read_report_template\\('plot.ly'\\);")
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(string-append "\
|
||||||
(bin (string-append out "/bin"))
|
my $plotly_code = read_report_template('" share "/plotly/plotly.js');
|
||||||
(share (string-append out "/share/bismark"))
|
$plotly_code = \"<script>\" . $plotly_code . \"</script>\";"))))))
|
||||||
(docdir (string-append out "/share/doc/bismark"))
|
(replace 'configure
|
||||||
(docs '("Docs/Bismark_User_Guide.html"))
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(scripts '("bismark"
|
(substitute* "bismark"
|
||||||
"bismark_genome_preparation"
|
(("\\(\\!system \"which samtools >/dev/null 2>&1\"\\)")
|
||||||
"bismark_methylation_extractor"
|
"(\"true\")")
|
||||||
"bismark2bedGraph"
|
(("\\$samtools_path = `which samtools`;")
|
||||||
"bismark2report"
|
(string-append "$samtools_path = '"
|
||||||
"coverage2cytosine"
|
(search-input-file inputs "/bin/samtools")
|
||||||
"deduplicate_bismark"
|
"';"))
|
||||||
"filter_non_conversion"
|
(("\\$path_to_bowtie2 = 'bowtie2'")
|
||||||
"bam2nuc"
|
(string-append "$path_to_bowtie2 = '"
|
||||||
"bismark2summary"
|
(search-input-file inputs "/bin/bowtie2")
|
||||||
"NOMe_filtering")))
|
"'"))
|
||||||
(substitute* "bismark2report"
|
(("\\$path_to_hisat2 = 'hisat2'")
|
||||||
(("\\$RealBin/plotly")
|
(string-append "$path_to_hisat2 = '"
|
||||||
(string-append share "/plotly")))
|
(search-input-file inputs "/bin/hisat2")
|
||||||
(mkdir-p share)
|
"'"))
|
||||||
(mkdir-p docdir)
|
(("\\$path_to_minimap2 = 'minimap2'")
|
||||||
(mkdir-p bin)
|
(string-append "$path_to_minimap2 = '"
|
||||||
(for-each (lambda (file) (install-file file bin))
|
(search-input-file inputs "/bin/minimap2")
|
||||||
scripts)
|
"'")))))
|
||||||
(for-each (lambda (file) (install-file file docdir))
|
(delete 'build)
|
||||||
docs)
|
(replace 'install
|
||||||
(copy-recursively "Docs/Images" (string-append docdir "/Images"))
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(copy-recursively "plotly"
|
(let* ((bin (string-append #$output "/bin"))
|
||||||
(string-append share "/plotly"))
|
(share (string-append #$output "/share/bismark"))
|
||||||
|
(docdir (string-append #$output "/share/doc/bismark"))
|
||||||
|
(scripts '("bismark"
|
||||||
|
"bismark_genome_preparation"
|
||||||
|
"bismark_methylation_extractor"
|
||||||
|
"bismark2bedGraph"
|
||||||
|
"bismark2report"
|
||||||
|
"coverage2cytosine"
|
||||||
|
"deduplicate_bismark"
|
||||||
|
"filter_non_conversion"
|
||||||
|
"bam2nuc"
|
||||||
|
"bismark2summary"
|
||||||
|
"NOMe_filtering")))
|
||||||
|
(mkdir-p share)
|
||||||
|
(mkdir-p docdir)
|
||||||
|
(mkdir-p bin)
|
||||||
|
(for-each (lambda (file) (install-file file bin))
|
||||||
|
scripts)
|
||||||
|
(copy-recursively "docs" docdir)
|
||||||
|
(copy-recursively "plotly"
|
||||||
|
(string-append share "/plotly"))
|
||||||
|
|
||||||
;; Fix references to gunzip
|
;; Fix references to gunzip
|
||||||
(substitute* (map (lambda (file)
|
(substitute* (map (lambda (file)
|
||||||
(string-append bin "/" file))
|
(string-append bin "/" file))
|
||||||
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
|
||||||
|
|
Reference in New Issue