unipept 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/uniprot +12 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e2b134dc5a0b633c5d3aba0b1e21e290dc821c3
|
4
|
+
data.tar.gz: 63972b5c62b6272f9fe27ef0145739e0a152d535
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e66de364e9a572a17e9ae32c1cc3a3c18aa002f22d9a22525f6c610619e814cf277cc7c9a25c599ae401cf586e0b996aec9ed52e435648bd807eee073b91a2c
|
7
|
+
data.tar.gz: 135dce274a849f9dff3ffd94cf7a04d25a7f32c0066ec80a7e1c38e1486bd2041b40d9de1a7e811a868e97e07444bc1c21a4dcd35c52c7267246b536fe92bfb3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
data/bin/uniprot
CHANGED
@@ -1,23 +1,29 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require '
|
2
|
+
require 'typhoeus'
|
3
3
|
require 'cri'
|
4
4
|
|
5
5
|
Signal.trap("PIPE", "EXIT")
|
6
6
|
Signal.trap("INT", "EXIT")
|
7
7
|
|
8
|
-
def get_uniprot_entry(arg)
|
9
|
-
resp =
|
8
|
+
def get_uniprot_entry(arg, fasta = false)
|
9
|
+
resp = Typhoeus.get("http://www.uniprot.org/uniprot/#{arg}.fasta")
|
10
10
|
if resp.success?
|
11
|
-
|
11
|
+
if fasta
|
12
|
+
puts resp.response_body
|
13
|
+
else
|
14
|
+
puts resp.response_body.lines.map(&:chomp)[1..-1].join("")
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
19
|
+
fasta = ARGV.delete "--fasta"
|
20
|
+
|
15
21
|
if ARGV.empty?
|
16
22
|
STDIN.each_line do |pept|
|
17
|
-
get_uniprot_entry(pept.chomp)
|
23
|
+
get_uniprot_entry(pept.chomp, fasta)
|
18
24
|
end
|
19
25
|
else
|
20
26
|
ARGV.each do |pept|
|
21
|
-
get_uniprot_entry(pept)
|
27
|
+
get_uniprot_entry(pept, fasta)
|
22
28
|
end
|
23
29
|
end
|