unipept 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -1
- data/Gemfile +5 -3
- data/Gemfile.lock +59 -68
- data/Rakefile +21 -18
- data/VERSION +1 -1
- data/lib/batch_iterator.rb +2 -2
- data/lib/commands/peptfilter.rb +1 -1
- data/lib/commands/unipept/api_runner.rb +8 -9
- data/lib/commands/unipept/config.rb +1 -1
- data/lib/commands/unipept/taxa2lca.rb +3 -3
- data/lib/configuration.rb +5 -5
- data/lib/formatters.rb +5 -5
- data/test/commands/test_peptfilter.rb +1 -1
- data/test/commands/test_prot2pept.rb +1 -1
- data/test/commands/test_unipept.rb +3 -3
- data/test/commands/test_uniprot.rb +2 -2
- data/test/commands/unipept/test_api_runner.rb +26 -24
- data/test/commands/unipept/test_config.rb +4 -4
- data/test/commands/unipept/test_pept2lca.rb +18 -18
- data/test/commands/unipept/test_pept2prot.rb +12 -12
- data/test/commands/unipept/test_pept2taxa.rb +12 -12
- data/test/commands/unipept/test_taxa2lca.rb +8 -8
- data/test/commands/unipept/test_taxonomy.rb +12 -12
- data/test/helper.rb +4 -4
- data/test/test_batch_iterator.rb +1 -1
- data/test/test_formatters.rb +5 -4
- data/unipept.gemspec +33 -35
- metadata +10 -23
@@ -22,14 +22,14 @@ module Unipept
|
|
22
22
|
Commands::Unipept.run(%w(taxa2lca -h))
|
23
23
|
end
|
24
24
|
end
|
25
|
-
assert(out.include?
|
25
|
+
assert(out.include?('show help for this command'))
|
26
26
|
|
27
27
|
out, _err = capture_io_while do
|
28
28
|
assert_raises SystemExit do
|
29
29
|
Commands::Unipept.run(%w(taxa2lca --help))
|
30
30
|
end
|
31
31
|
end
|
32
|
-
assert(out.include?
|
32
|
+
assert(out.include?('show help for this command'))
|
33
33
|
end
|
34
34
|
|
35
35
|
def test_run
|
@@ -38,8 +38,8 @@ module Unipept
|
|
38
38
|
end
|
39
39
|
lines = out.each_line
|
40
40
|
assert_equal('', err)
|
41
|
-
assert(lines.next.start_with?
|
42
|
-
assert(lines.next.start_with?
|
41
|
+
assert(lines.next.start_with?('taxon_id,taxon_name,taxon_rank'))
|
42
|
+
assert(lines.next.start_with?('1678,Bifidobacterium,genus'))
|
43
43
|
end
|
44
44
|
|
45
45
|
def test_run_xml
|
@@ -49,8 +49,8 @@ module Unipept
|
|
49
49
|
lines = out.each_line
|
50
50
|
output = lines.to_a.join('').chomp
|
51
51
|
assert_equal('', err)
|
52
|
-
assert(output.start_with?
|
53
|
-
assert(output.end_with?
|
52
|
+
assert(output.start_with?('<results>'))
|
53
|
+
assert(output.end_with?('</results>'))
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_run_json
|
@@ -60,8 +60,8 @@ module Unipept
|
|
60
60
|
lines = out.each_line
|
61
61
|
output = lines.to_a.join('').chomp
|
62
62
|
assert_equal('', err)
|
63
|
-
assert(output.start_with?
|
64
|
-
assert(output.end_with?
|
63
|
+
assert(output.start_with?('['))
|
64
|
+
assert(output.end_with?(']'))
|
65
65
|
assert(!output.include?('}{'))
|
66
66
|
assert(!output.include?(']['))
|
67
67
|
end
|
@@ -20,14 +20,14 @@ module Unipept
|
|
20
20
|
Commands::Unipept.run(%w(taxonomy -h))
|
21
21
|
end
|
22
22
|
end
|
23
|
-
assert(out.include?
|
23
|
+
assert(out.include?('show help for this command'))
|
24
24
|
|
25
25
|
out, _err = capture_io_while do
|
26
26
|
assert_raises SystemExit do
|
27
27
|
Commands::Unipept.run(%w(taxonomy --help))
|
28
28
|
end
|
29
29
|
end
|
30
|
-
assert(out.include?
|
30
|
+
assert(out.include?('show help for this command'))
|
31
31
|
end
|
32
32
|
|
33
33
|
def test_run
|
@@ -36,8 +36,8 @@ module Unipept
|
|
36
36
|
end
|
37
37
|
lines = out.each_line
|
38
38
|
assert_equal('', err)
|
39
|
-
assert(lines.next.start_with?
|
40
|
-
assert(lines.next.start_with?
|
39
|
+
assert(lines.next.start_with?('taxon_id,taxon_name,taxon_rank'))
|
40
|
+
assert(lines.next.start_with?('1,root,no rank'))
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_run_with_fasta_multiple_batches
|
@@ -46,7 +46,7 @@ module Unipept
|
|
46
46
|
end
|
47
47
|
lines = out.each_line
|
48
48
|
assert_equal('', err)
|
49
|
-
assert(lines.next.start_with?
|
49
|
+
assert(lines.next.start_with?('fasta_header,taxon_id,taxon_name,taxon_rank'))
|
50
50
|
assert(lines.count { |line| line.start_with? '>test,1,' } >= 1)
|
51
51
|
assert(lines.count { |line| line.start_with? '>test,216816,' } >= 1)
|
52
52
|
assert(lines.count { |line| line.start_with? '>tost,1,' } >= 1)
|
@@ -58,7 +58,7 @@ module Unipept
|
|
58
58
|
end
|
59
59
|
lines = out.each_line
|
60
60
|
assert_equal('', err)
|
61
|
-
assert(lines.next.start_with?
|
61
|
+
assert(lines.next.start_with?('fasta_header,taxon_id,taxon_name'))
|
62
62
|
assert(lines.count { |line| line.start_with? '>test,1,' } >= 1)
|
63
63
|
assert(lines.count { |line| line.start_with? '>test,216816,' } >= 1)
|
64
64
|
assert(lines.count { |line| line.start_with? '>tost,1,' } >= 1)
|
@@ -71,10 +71,10 @@ module Unipept
|
|
71
71
|
lines = out.each_line
|
72
72
|
assert_equal('', err)
|
73
73
|
output = lines.to_a.join('').chomp
|
74
|
-
assert(output.start_with?
|
75
|
-
assert(output.end_with?
|
74
|
+
assert(output.start_with?('['))
|
75
|
+
assert(output.end_with?(']'))
|
76
76
|
assert(!output.include?('}{'))
|
77
|
-
assert(output.include?
|
77
|
+
assert(output.include?('fasta_header'))
|
78
78
|
end
|
79
79
|
|
80
80
|
def test_run_with_fasta_multiple_batches_xml
|
@@ -84,9 +84,9 @@ module Unipept
|
|
84
84
|
lines = out.each_line
|
85
85
|
assert_equal('', err)
|
86
86
|
output = lines.to_a.join('').chomp
|
87
|
-
assert(output.start_with?
|
88
|
-
assert(output.end_with?
|
89
|
-
assert(output.include?
|
87
|
+
assert(output.start_with?('<results>'))
|
88
|
+
assert(output.end_with?('</results>'))
|
89
|
+
assert(output.include?('<fasta_header>'))
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
data/test/helper.rb
CHANGED
@@ -33,18 +33,18 @@ module Unipept
|
|
33
33
|
FileUtils.rm_rf(@tmp_dir)
|
34
34
|
end
|
35
35
|
|
36
|
-
def capture_io_with_input(input
|
36
|
+
def capture_io_with_input(input)
|
37
37
|
capture_io_while do
|
38
38
|
input = input.join("\n") if input.is_a? Array
|
39
39
|
$stdin.write(input)
|
40
40
|
$stdin.rewind
|
41
|
-
|
41
|
+
yield
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
-
def capture_io_while
|
45
|
+
def capture_io_while
|
46
46
|
orig_io = capture_io
|
47
|
-
|
47
|
+
yield
|
48
48
|
[$stdout.string, $stderr.string]
|
49
49
|
ensure
|
50
50
|
uncapture_io(*orig_io)
|
data/test/test_batch_iterator.rb
CHANGED
data/test/test_formatters.rb
CHANGED
@@ -4,9 +4,9 @@ module Unipept
|
|
4
4
|
class FormattersTestCase < Unipept::TestCase
|
5
5
|
def test_available_formatters
|
6
6
|
formatters = Formatter.available
|
7
|
-
assert(formatters.include?
|
8
|
-
assert(formatters.include?
|
9
|
-
assert(formatters.include?
|
7
|
+
assert(formatters.include?('json'))
|
8
|
+
assert(formatters.include?('csv'))
|
9
|
+
assert(formatters.include?('xml'))
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_default_formatter
|
@@ -16,7 +16,7 @@ module Unipept
|
|
16
16
|
def test_formatter_registration
|
17
17
|
assert(!(Formatter.available.include? 'test'))
|
18
18
|
Formatter.register(:test)
|
19
|
-
assert(Formatter.available.include?
|
19
|
+
assert(Formatter.available.include?('test'))
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_new_for_format
|
@@ -73,6 +73,7 @@ module Unipept
|
|
73
73
|
def f.integrate_fasta_headers(_a, _b)
|
74
74
|
puts 'header'
|
75
75
|
end
|
76
|
+
|
76
77
|
def f.convert(_a, _b)
|
77
78
|
'body'
|
78
79
|
end
|
data/unipept.gemspec
CHANGED
@@ -2,19 +2,19 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: unipept 1.1.
|
5
|
+
# stub: unipept 1.1.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "unipept"
|
9
|
-
s.version = "1.1.
|
8
|
+
s.name = "unipept".freeze
|
9
|
+
s.version = "1.1.3"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Toon Willems", "Bart Mesuere", "Tom Naessens"]
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Toon Willems".freeze, "Bart Mesuere".freeze, "Tom Naessens".freeze]
|
14
14
|
s.date = "2017-01-17"
|
15
|
-
s.description = "
|
16
|
-
s.email = "unipept@ugent.be"
|
17
|
-
s.executables = ["unipept", "prot2pept", "peptfilter", "uniprot"]
|
15
|
+
s.description = " Command line interface to the Unipept (http://unipept.ugent.be) web services\n (pept2lca, taxa2lca, pept2taxa, pept2prot and taxonomy) and some utility\n commands for handling proteins using the command line.\n".freeze
|
16
|
+
s.email = "unipept@ugent.be".freeze
|
17
|
+
s.executables = ["unipept".freeze, "prot2pept".freeze, "peptfilter".freeze, "uniprot".freeze]
|
18
18
|
s.extra_rdoc_files = [
|
19
19
|
"LICENSE.txt",
|
20
20
|
"README.md"
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.files = [
|
23
23
|
".document",
|
24
24
|
".rubocop.yml",
|
25
|
+
".ruby-version",
|
25
26
|
".travis.yml",
|
26
27
|
"Gemfile",
|
27
28
|
"Gemfile.lock",
|
@@ -74,40 +75,37 @@ Gem::Specification.new do |s|
|
|
74
75
|
"test/test_server_message.rb",
|
75
76
|
"unipept.gemspec"
|
76
77
|
]
|
77
|
-
s.homepage = "http://unipept.ugent.be"
|
78
|
-
s.licenses = ["MIT"]
|
79
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
|
80
|
-
s.rubygems_version = "2.
|
81
|
-
s.summary = "Command line interface to Unipept web services."
|
78
|
+
s.homepage = "http://unipept.ugent.be".freeze
|
79
|
+
s.licenses = ["MIT".freeze]
|
80
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze)
|
81
|
+
s.rubygems_version = "2.6.8".freeze
|
82
|
+
s.summary = "Command line interface to Unipept web services.".freeze
|
82
83
|
|
83
84
|
if s.respond_to? :specification_version then
|
84
85
|
s.specification_version = 4
|
85
86
|
|
86
87
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
87
|
-
s.add_runtime_dependency(%q<cri
|
88
|
-
s.add_runtime_dependency(%q<typhoeus
|
89
|
-
s.add_development_dependency(%q<rake
|
90
|
-
s.add_development_dependency(%q<minitest
|
91
|
-
s.add_development_dependency(%q<rubocop
|
92
|
-
s.add_development_dependency(%q<
|
93
|
-
s.add_development_dependency(%q<coveralls>, ["~> 0"])
|
88
|
+
s.add_runtime_dependency(%q<cri>.freeze, ["~> 2.7"])
|
89
|
+
s.add_runtime_dependency(%q<typhoeus>.freeze, ["~> 1.1"])
|
90
|
+
s.add_development_dependency(%q<rake>.freeze, ["~> 10.4"])
|
91
|
+
s.add_development_dependency(%q<minitest>.freeze, ["~> 5.7"])
|
92
|
+
s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.32"])
|
93
|
+
s.add_development_dependency(%q<coveralls>.freeze, ["~> 0"])
|
94
94
|
else
|
95
|
-
s.add_dependency(%q<cri
|
96
|
-
s.add_dependency(%q<typhoeus
|
97
|
-
s.add_dependency(%q<rake
|
98
|
-
s.add_dependency(%q<minitest
|
99
|
-
s.add_dependency(%q<rubocop
|
100
|
-
s.add_dependency(%q<
|
101
|
-
s.add_dependency(%q<coveralls>, ["~> 0"])
|
95
|
+
s.add_dependency(%q<cri>.freeze, ["~> 2.7"])
|
96
|
+
s.add_dependency(%q<typhoeus>.freeze, ["~> 1.1"])
|
97
|
+
s.add_dependency(%q<rake>.freeze, ["~> 10.4"])
|
98
|
+
s.add_dependency(%q<minitest>.freeze, ["~> 5.7"])
|
99
|
+
s.add_dependency(%q<rubocop>.freeze, ["~> 0.32"])
|
100
|
+
s.add_dependency(%q<coveralls>.freeze, ["~> 0"])
|
102
101
|
end
|
103
102
|
else
|
104
|
-
s.add_dependency(%q<cri
|
105
|
-
s.add_dependency(%q<typhoeus
|
106
|
-
s.add_dependency(%q<rake
|
107
|
-
s.add_dependency(%q<minitest
|
108
|
-
s.add_dependency(%q<rubocop
|
109
|
-
s.add_dependency(%q<
|
110
|
-
s.add_dependency(%q<coveralls>, ["~> 0"])
|
103
|
+
s.add_dependency(%q<cri>.freeze, ["~> 2.7"])
|
104
|
+
s.add_dependency(%q<typhoeus>.freeze, ["~> 1.1"])
|
105
|
+
s.add_dependency(%q<rake>.freeze, ["~> 10.4"])
|
106
|
+
s.add_dependency(%q<minitest>.freeze, ["~> 5.7"])
|
107
|
+
s.add_dependency(%q<rubocop>.freeze, ["~> 0.32"])
|
108
|
+
s.add_dependency(%q<coveralls>.freeze, ["~> 0"])
|
111
109
|
end
|
112
110
|
end
|
113
111
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unipept
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toon Willems
|
@@ -30,16 +30,16 @@ dependencies:
|
|
30
30
|
name: typhoeus
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - "~>"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: '1.1'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: '1.1'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rake
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,20 +82,6 @@ dependencies:
|
|
82
82
|
- - "~>"
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0.32'
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: jeweler
|
87
|
-
requirement: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
89
|
-
- - "~>"
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version: '2.0'
|
92
|
-
type: :development
|
93
|
-
prerelease: false
|
94
|
-
version_requirements: !ruby/object:Gem::Requirement
|
95
|
-
requirements:
|
96
|
-
- - "~>"
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
version: '2.0'
|
99
85
|
- !ruby/object:Gem::Dependency
|
100
86
|
name: coveralls
|
101
87
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,9 +97,9 @@ dependencies:
|
|
111
97
|
- !ruby/object:Gem::Version
|
112
98
|
version: '0'
|
113
99
|
description: |2
|
114
|
-
|
115
|
-
|
116
|
-
|
100
|
+
Command line interface to the Unipept (http://unipept.ugent.be) web services
|
101
|
+
(pept2lca, taxa2lca, pept2taxa, pept2prot and taxonomy) and some utility
|
102
|
+
commands for handling proteins using the command line.
|
117
103
|
email: unipept@ugent.be
|
118
104
|
executables:
|
119
105
|
- unipept
|
@@ -127,6 +113,7 @@ extra_rdoc_files:
|
|
127
113
|
files:
|
128
114
|
- ".document"
|
129
115
|
- ".rubocop.yml"
|
116
|
+
- ".ruby-version"
|
130
117
|
- ".travis.yml"
|
131
118
|
- Gemfile
|
132
119
|
- Gemfile.lock
|
@@ -198,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
185
|
version: '0'
|
199
186
|
requirements: []
|
200
187
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.
|
188
|
+
rubygems_version: 2.6.8
|
202
189
|
signing_key:
|
203
190
|
specification_version: 4
|
204
191
|
summary: Command line interface to Unipept web services.
|