unipept 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5ef6c84a4836b7b55f5aedadcf694470c89608f
4
- data.tar.gz: 804ec2db29552953e0769ee1ef6df9e005828b8c
3
+ metadata.gz: dc51bfb9426c0e63f031b38e701e8629d2752ca5
4
+ data.tar.gz: 3d09c51e3487bab60beab0bf14382b00d8a517eb
5
5
  SHA512:
6
- metadata.gz: 2377ac480f2dedccb03bb6bc537a07a613e3ddd6b2b7ca59eda6fa25b0831488628fa0598ae28f2efc7d23afbf8a22b9364c0c31bea3b3b7e57fca31f635db2c
7
- data.tar.gz: 7fe190b65377892f52117049a16c390415e6aea6bb9c55e283f5dc29bdd1db02fefa21d81728cd90aaab713e1b1f1a9dfc56c3efbf3bedf772f619e47a6b1f5b
6
+ metadata.gz: dbc63fb2023bcb9b5b09fafe67f01e24565da71aa65893057c21fecd8e1dca895f63561a0e381d19f847149f233cbbd6e91a5311a4be98fd06de0e87ff0ddc10
7
+ data.tar.gz: 0744d0dabccfe1baa1eb5cec427724eff403d16c84324ea8ed58c30599bd853407d253c8deb2ece8ebcec9818aa42c186b54dd24e8cdb1146a5bb8e87ec937f9
data/Gemfile.lock CHANGED
@@ -1,20 +1,20 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (4.0.3)
5
- i18n (~> 0.6, >= 0.6.4)
6
- minitest (~> 4.2)
7
- multi_json (~> 1.3)
4
+ activesupport (4.1.1)
5
+ i18n (~> 0.6, >= 0.6.9)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
8
  thread_safe (~> 0.1)
9
- tzinfo (~> 0.3.37)
10
- addressable (2.3.5)
11
- atomic (1.1.15)
9
+ tzinfo (~> 1.1)
10
+ addressable (2.3.6)
12
11
  builder (3.2.2)
13
- descendants_tracker (0.0.3)
14
- docile (1.1.3)
12
+ descendants_tracker (0.0.4)
13
+ thread_safe (~> 0.3, >= 0.3.1)
14
+ docile (1.1.5)
15
15
  faraday (0.9.0)
16
16
  multipart-post (>= 1.2, < 3)
17
- git (1.2.6)
17
+ git (1.2.7)
18
18
  github_api (0.11.3)
19
19
  addressable (~> 2.3)
20
20
  descendants_tracker (~> 0.0.1)
@@ -23,7 +23,7 @@ GEM
23
23
  multi_json (>= 1.7.5, < 2.0)
24
24
  nokogiri (~> 1.6.0)
25
25
  oauth2
26
- hashie (2.0.5)
26
+ hashie (3.0.0)
27
27
  highline (1.6.21)
28
28
  i18n (0.6.9)
29
29
  jeweler (2.0.1)
@@ -36,39 +36,38 @@ GEM
36
36
  rake
37
37
  rdoc
38
38
  json (1.8.1)
39
- jwt (0.1.11)
40
- multi_json (>= 1.5)
41
- mini_portile (0.5.2)
42
- minitest (4.7.5)
43
- multi_json (1.9.0)
39
+ jwt (1.0.0)
40
+ mini_portile (0.6.0)
41
+ minitest (5.3.5)
42
+ multi_json (1.10.1)
44
43
  multi_xml (0.5.5)
45
44
  multipart-post (2.0.0)
46
- nokogiri (1.6.1)
47
- mini_portile (~> 0.5.0)
48
- oauth2 (0.9.3)
45
+ nokogiri (1.6.2.1)
46
+ mini_portile (= 0.6.0)
47
+ oauth2 (0.9.4)
49
48
  faraday (>= 0.8, < 0.10)
50
- jwt (~> 0.1.8)
49
+ jwt (~> 1.0)
51
50
  multi_json (~> 1.3)
52
51
  multi_xml (~> 0.5)
53
52
  rack (~> 1.2)
54
53
  rack (1.5.2)
55
- rake (10.1.1)
54
+ rake (10.3.2)
56
55
  rdoc (3.12.2)
57
56
  json (~> 1.4)
58
57
  shoulda (3.5.0)
59
58
  shoulda-context (~> 1.0, >= 1.0.1)
60
59
  shoulda-matchers (>= 1.4.1, < 3.0)
61
- shoulda-context (1.1.6)
62
- shoulda-matchers (2.5.0)
60
+ shoulda-context (1.2.1)
61
+ shoulda-matchers (2.6.1)
63
62
  activesupport (>= 3.0.0)
64
63
  simplecov (0.8.2)
65
64
  docile (~> 1.1.0)
66
65
  multi_json
67
66
  simplecov-html (~> 0.8.0)
68
67
  simplecov-html (0.8.0)
69
- thread_safe (0.2.0)
70
- atomic (>= 1.1.7, < 2)
71
- tzinfo (0.3.39)
68
+ thread_safe (0.3.4)
69
+ tzinfo (1.2.1)
70
+ thread_safe (~> 0.1)
72
71
 
73
72
  PLATFORMS
74
73
  ruby
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.5.7
data/bin/prot2pept CHANGED
@@ -9,7 +9,7 @@ root_cmd = Cri::Command.new_basic_root.modify do
9
9
  run do |opts, args, cmd|
10
10
  pattern = opts.fetch(:pattern, "([KR])([^P])")
11
11
  # decide if we have FASTA input
12
- fasta_header = gets
12
+ fasta_header = $stdin.gets
13
13
  if fasta_header.start_with? '>'
14
14
  # fasta input, need to join lines
15
15
  while !$stdin.eof?
data/bin/unipept CHANGED
@@ -66,7 +66,7 @@ root_cmd = Cri::Command.new_basic_root.modify do
66
66
  option :f, :format, "output format (available: #{Unipept::Formatter.available.join "," }) (default: #{Unipept::Formatter.default})", :argument => :required
67
67
 
68
68
  # Configuration options
69
- option nil, "config-host", "Override host setting", argument: :required
69
+ option nil, "host", "Override host setting", argument: :required
70
70
 
71
71
  run do |opts, args, cmd|
72
72
  if opts[:version]
data/bin/uniprot CHANGED
@@ -16,14 +16,18 @@ def get_uniprot_entry(arg, fasta = false)
16
16
  end
17
17
  end
18
18
 
19
- fasta = ARGV.delete "--fasta"
20
-
21
- if ARGV.empty?
22
- STDIN.each_line do |pept|
23
- get_uniprot_entry(pept.chomp, fasta)
24
- end
25
- else
26
- ARGV.each do |pept|
27
- get_uniprot_entry(pept, fasta)
19
+ root_cmd = Cri::Command.new_basic_root.modify do
20
+ name 'uniprot'
21
+ description 'Download protein sequence from uniprot.org'
22
+ required :f, :format, "specify output format (available: fasta, plain)"
23
+ run do |opts, args, cmd|
24
+ fasta = opts[:format] == 'fasta'
25
+ iterator = args.empty? ? $stdin.each_line : args
26
+ iterator.each do |pept|
27
+ get_uniprot_entry(pept.chomp, fasta)
28
+ end
28
29
  end
29
30
  end
31
+
32
+ # run_this runs this command without subcommands! Absolutely needed here
33
+ root_cmd.run_this(ARGV)
@@ -13,8 +13,8 @@ module Unipept
13
13
 
14
14
  def set_configuration
15
15
  # find host in opts first
16
- if options[:'config-host']
17
- host = options[:'config-host']
16
+ if options[:host]
17
+ host = options[:host]
18
18
  else
19
19
  host = @configuration['host']
20
20
  end
@@ -86,8 +86,8 @@ module Unipept
86
86
  peptides = input_iterator
87
87
 
88
88
  filter_list = options[:select] ? options[:select] : []
89
- filter_list = filter_list.map {|f| glob_to_regex(f) }
90
- output = STDOUT.tty? ? STDOUT : STDERR
89
+ # Parse filter list: convert to regex and split on commas
90
+ filter_list = filter_list.map { |f| f.include?(",") ? f.split(",") : f }.flatten.map { |f| glob_to_regex(f) }
91
91
 
92
92
  batch_order = Unipept::BatchOrder.new
93
93
 
@@ -214,9 +214,9 @@ module Unipept
214
214
 
215
215
  private
216
216
 
217
- def glob_to_regex(glob_string)
218
- # only implement * -> . for now
219
- Regexp.new glob_string.gsub("*", ".*")
217
+ def glob_to_regex(string)
218
+ /^#{string.gsub('*','.*')}$/
220
219
  end
220
+
221
221
  end
222
222
  end
data/unipept.gemspec CHANGED
@@ -2,11 +2,11 @@
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 0.5.6 ruby lib
5
+ # stub: unipept 0.5.7 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "unipept"
9
- s.version = "0.5.6"
9
+ s.version = "0.5.7"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
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: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toon Willems