forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blat.rb
38 lines (33 loc) · 1.2 KB
/
blat.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Blat < Formula
homepage "http://genome.ucsc.edu/FAQ/FAQblat.html"
# doi "10.1101/gr.229202"
# tag "bioinformatics"
url "http://users.soe.ucsc.edu/~kent/src/blatSrc35.zip"
sha1 "a2cae7407e512166bf7b1ed300db9be6649693bd"
bottle do
root_url "https://homebrew.bintray.com/bottles-science"
cellar :any
revision 1
sha256 "7e1ae73487db28bca75585482ccf50f206468f714365730af8dae7cc1c892ef2" => :yosemite
sha256 "fc541ee6ebb3f895b2e9700431325687c9a95bf2ab55a0d6fcafa95110d30c29" => :mavericks
sha256 "c21f79a061ee6d0594f1f35b743e99e84c6d1a604f34c738ea32370a1234864b" => :mountain_lion
end
depends_on "libpng" => :build
def install
ENV.append_to_cflags "-I#{Formula["libpng"].opt_include}"
bin.mkpath
system "make", "MACHTYPE=#{`uname -m`.chomp}", "BINDIR=#{bin}"
end
test do
(testpath/"db.fa").write <<-EOF.undent
>gi|5524211|gb|AAD44166.1| cytochrome b [Elephas maximus maximus]
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
EOF
(testpath/"query.fa").write <<-EOF.undent
>spam
CLYTHIGRNIYYGSY
EOF
system "#{bin}/blat", "-prot", "db.fa", "query.fa", "out.fa"
system "grep", "spam", "out.fa"
end
end