homebrew-core/Formula/picard-tools.rb

35 lines
991 B
Ruby

class PicardTools < Formula
desc "Tools for manipulating HTS data and formats"
homepage "https://broadinstitute.github.io/picard/"
url "https://github.com/broadinstitute/picard/releases/download/2.23.4/picard.jar"
sha256 "f82c35e1d1e738a3ea0af5d157e72ae9d65cf695f8a26bf264532801fab2e475"
license "MIT"
livecheck do
url "https://github.com/broadinstitute/picard/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end
bottle :unneeded
depends_on "openjdk"
def install
libexec.install "picard.jar"
(bin/"picard").write <<~EOS
#!/bin/bash
exec "#{Formula["openjdk"].opt_bin}/java" $JAVA_OPTS -jar "#{libexec}/picard.jar" "$@"
EOS
end
test do
(testpath/"test.fasta").write <<~EOS
>U00096.2:1-70
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCT
CTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
EOS
cmd = "#{bin}/picard NormalizeFasta I=test.fasta O=/dev/stdout"
assert_match "TCTCTG", shell_output(cmd)
end
end