bio-signalp 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 12404869c309796dffa4497c1021158943df36f5
4
+ data.tar.gz: 6a09580eb6dceebb59c6620a12f02cddef5e4143
5
+ SHA512:
6
+ metadata.gz: 741919409e87ba018b96faae87609fe5ae779d780abb49fbce1cb0cd25c9169608347bfd6c68f2c46ff383d8bba4123113954f07c7db2942c7dd708707689acd
7
+ data.tar.gz: 7308fd484feaa9b7a38c2e2038052e2500b0a06c1100209e60e3f4469cdf03de14593c8912dd9938a7432d2ab4ee65a0cf28449e8ec53824e83e1a0d5c8250a1
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile CHANGED
@@ -2,14 +2,14 @@ source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
- gem "bio", ">= 1.4.1"
6
- gem "bio-logger"
5
+ gem "bio", "~>1.4", ">= 1.4.1"
6
+ gem "bio-logger", '~>1.0'
7
7
 
8
8
  # Add dependencies to develop your gem here.
9
9
  # Include everything needed to run rake, tests, features, etc.
10
10
  group :development do
11
- gem "shoulda", ">= 0"
12
- gem "bundler", ">= 1.0.0"
13
- gem "jeweler", ">= 1.6.0"
14
- gem "rdoc", ">= 3.12"
11
+ gem "rspec", "~> 2.8"
12
+ gem "jeweler", "~> 2.0"
13
+ gem "bundler", "~>1.0", ">= 1.0.21"
14
+ gem "rdoc", "~> 3.12"
15
15
  end
data/Rakefile CHANGED
@@ -25,11 +25,10 @@ Jeweler::Tasks.new do |gem|
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
27
27
 
28
- require 'rake/testtask'
29
- Rake::TestTask.new(:test) do |test|
30
- test.libs << 'lib' << 'test'
31
- test.pattern = 'test/**/test_*.rb'
32
- test.verbose = true
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
32
  end
34
33
 
35
- task :default => :test
34
+ task :default => :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -2,14 +2,16 @@
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: bio-signalp 0.3.1 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "bio-signalp"
8
- s.version = "0.3.0"
9
+ s.version = "0.3.1"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Ben J Woodcroft"]
12
- s.date = "2012-08-18"
14
+ s.date = "2014-08-04"
13
15
  s.description = "A wrapper for the signal peptide prediction algorith SignalP. Not very well supported, but seems to work for the author, at least."
14
16
  s.email = "donttrustben near gmail.com"
15
17
  s.executables = ["signalp.rb"]
@@ -19,6 +21,7 @@ Gem::Specification.new do |s|
19
21
  ]
20
22
  s.files = [
21
23
  ".document",
24
+ ".rspec",
22
25
  "Gemfile",
23
26
  "LICENSE.txt",
24
27
  "README.md",
@@ -30,40 +33,39 @@ Gem::Specification.new do |s|
30
33
  "lib/bio/appl/common.rb",
31
34
  "lib/bio/appl/signalp3.rb",
32
35
  "lib/bio/appl/signalp4.rb",
33
- "test/helper.rb",
34
- "test/test_bio-signalp.rb"
36
+ "spec/bio-signalp_spec.rb",
37
+ "spec/spec_helper.rb"
35
38
  ]
36
39
  s.homepage = "http://github.com/wwood/bioruby-signalp"
37
40
  s.licenses = ["MIT"]
38
- s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.24"
41
+ s.rubygems_version = "2.2.2"
40
42
  s.summary = "A wrapper for the signal peptide prediction algorith SignalP"
41
43
 
42
44
  if s.respond_to? :specification_version then
43
- s.specification_version = 3
45
+ s.specification_version = 4
44
46
 
45
47
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
- s.add_runtime_dependency(%q<bio>, [">= 1.4.1"])
47
- s.add_runtime_dependency(%q<bio-logger>, [">= 0"])
48
- s.add_development_dependency(%q<shoulda>, [">= 0"])
49
- s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
50
- s.add_development_dependency(%q<jeweler>, [">= 1.6.0"])
51
- s.add_development_dependency(%q<rdoc>, [">= 3.12"])
48
+ s.add_runtime_dependency(%q<bio>, [">= 1.4.1", "~> 1.4"])
49
+ s.add_runtime_dependency(%q<bio-logger>, ["~> 1.0"])
50
+ s.add_development_dependency(%q<rspec>, ["~> 2.8"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
52
+ s.add_development_dependency(%q<bundler>, [">= 1.0.21", "~> 1.0"])
53
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
52
54
  else
53
- s.add_dependency(%q<bio>, [">= 1.4.1"])
54
- s.add_dependency(%q<bio-logger>, [">= 0"])
55
- s.add_dependency(%q<shoulda>, [">= 0"])
56
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
57
- s.add_dependency(%q<jeweler>, [">= 1.6.0"])
58
- s.add_dependency(%q<rdoc>, [">= 3.12"])
55
+ s.add_dependency(%q<bio>, [">= 1.4.1", "~> 1.4"])
56
+ s.add_dependency(%q<bio-logger>, ["~> 1.0"])
57
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
58
+ s.add_dependency(%q<jeweler>, ["~> 2.0"])
59
+ s.add_dependency(%q<bundler>, [">= 1.0.21", "~> 1.0"])
60
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
59
61
  end
60
62
  else
61
- s.add_dependency(%q<bio>, [">= 1.4.1"])
62
- s.add_dependency(%q<bio-logger>, [">= 0"])
63
- s.add_dependency(%q<shoulda>, [">= 0"])
64
- s.add_dependency(%q<bundler>, [">= 1.0.0"])
65
- s.add_dependency(%q<jeweler>, [">= 1.6.0"])
66
- s.add_dependency(%q<rdoc>, [">= 3.12"])
63
+ s.add_dependency(%q<bio>, [">= 1.4.1", "~> 1.4"])
64
+ s.add_dependency(%q<bio-logger>, ["~> 1.0"])
65
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
66
+ s.add_dependency(%q<jeweler>, ["~> 2.0"])
67
+ s.add_dependency(%q<bundler>, [">= 1.0.21", "~> 1.0"])
68
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
67
69
  end
68
70
  end
69
71
 
@@ -2,12 +2,12 @@ module Bio
2
2
  module SignalP
3
3
  NUM_FIELDS_IN_VERSION3_SHORT_OUTPUT = 21
4
4
  NUM_FIELDS_IN_VERSION4_SHORT_OUTPUT = 12
5
-
5
+
6
6
  class Wrapper
7
7
  def log
8
8
  log = Bio::Log::LoggerPlus['bio-signalp']
9
9
  end
10
-
10
+
11
11
  # Given an amino acid sequence, return a SignalP Result
12
12
  # representing it taken from the file. The version of SignalP used
13
13
  # is auto-detected (versions 3 and 4 are supported)
@@ -18,35 +18,35 @@ module Bio
18
18
  # Returns nil if the sequence is empty
19
19
  def calculate(sequence, options={})
20
20
  return nil if sequence.nil? or sequence == ''
21
-
21
+
22
22
  default_options = {
23
23
  :binary_path => 'signalp'
24
24
  }
25
25
  options = default_options.merge options
26
26
  raise "Unexpected option parameters passed in #{options.inspect}" unless options.length == default_options.length
27
27
  options[:binary_path] ||= default_options[:binary_path] #in case nil is passed here
28
-
28
+
29
29
  # This command needs to work with all versions of SignalP (currently v3 and v4)
30
30
  command = "#{options[:binary_path]} -f short -t euk"
31
31
  log.debug "Running signalp command: #{command}" if log.debug?
32
32
  Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
33
33
  stdin.puts '>wrapperSeq'
34
- stdin.puts "#{sequence}"
34
+ stdin.puts "#{sequence[0..500]}" #Only give the first 500 amino acids because v3 fails on massive aaseqs
35
35
  stdin.close
36
-
36
+
37
37
  result = stdout.readlines
38
38
  error = stderr.readlines
39
-
39
+
40
40
  unless error.empty?
41
41
  raise Exception, "There appears to be a problem while running signalp:\n#{error}"
42
42
  end
43
-
43
+
44
44
  # Error checking
45
45
  num_expected_result_lines = 3
46
46
  unless result.length == num_expected_result_lines
47
47
  raise Exception, "Unexpected number of lines found in SignalP output (#{result.length}, expected #{num_expected_result_lines}):\n#{result}"
48
48
  end
49
-
49
+
50
50
  splits = result[2].strip.split(/[ \t]+/)
51
51
  if splits.length == NUM_FIELDS_IN_VERSION3_SHORT_OUTPUT
52
52
  # SignalP 3 detected, use that
@@ -63,7 +63,7 @@ module Bio
63
63
  end
64
64
  end
65
65
  end
66
-
66
+
67
67
  # A module for methods common to different SignalP version Result classes.
68
68
  module Common
69
69
  # Given an amino acid sequence (as a string),
@@ -76,7 +76,7 @@ module Bio
76
76
  return sequence
77
77
  end
78
78
  end
79
-
79
+
80
80
  # Simple method: 'Y' => true, 'N' => false, else nil
81
81
  def to_bool(string)
82
82
  if string === 'Y'
@@ -89,4 +89,4 @@ module Bio
89
89
  end
90
90
  end
91
91
  end
92
- end
92
+ end
@@ -0,0 +1,162 @@
1
+ require 'spec_helper'
2
+ require 'open3'
3
+
4
+ SIGNALP3_PATH = File.join(ENV['HOME'],'bioinfo','signalp-3.0','signalp')
5
+ SIGNALP4_PATH = File.join(ENV['HOME'],'bioinfo','signalp-4.0','signalp')
6
+ SIGNALP_BINARIES = [
7
+ SIGNALP3_PATH,
8
+ SIGNALP4_PATH,
9
+ ]
10
+
11
+ describe 'bio-signalp library' do
12
+ def setup
13
+ log_name = 'bio-signalp'
14
+ Bio::Log::CLI.logger('stderr')
15
+ #Bio::Log::CLI.configure(log_name) # when commented out no debug is printed out
16
+ end
17
+
18
+ it "positive control" do
19
+ # Known to have a signal peptide
20
+ acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
21
+
22
+ Bio::SignalP::Wrapper.new.calculate(acp_sequence).signal?.should == true
23
+ end
24
+
25
+ it "negative control" do
26
+ # Known to have a signal peptide
27
+ non_signal_sequence = 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'
28
+
29
+ Bio::SignalP::Wrapper.new.calculate(non_signal_sequence).signal?.should == false
30
+ end
31
+
32
+ it 'work with different SignalP versions, this test is specific to Ben\'s machines probably' do
33
+ binaries = {
34
+ SIGNALP_BINARIES[0] => Bio::SignalP::Version3::Result,
35
+ SIGNALP_BINARIES[1] => Bio::SignalP::Version4::Result,
36
+ }
37
+ binaries.each do |binary, clazz|
38
+ acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
39
+ positive_result = Bio::SignalP::Wrapper.new.calculate(acp_sequence, :binary_path => binary)
40
+ positive_result.signal?.should == true
41
+ positive_result.should be_kind_of(clazz)
42
+ positive_result.cleavage_site.should == 17
43
+ positive_result.cleave(acp_sequence).should == 'FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
44
+ non_signal_sequence = 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'
45
+ Bio::SignalP::Wrapper.new.calculate(non_signal_sequence, :binary_path => binary).signal?.should == false
46
+ end
47
+ end
48
+
49
+ it 'give different predictions for v3 and v4' do
50
+ different = <<EOF
51
+ MMKGMVEAAVKWMKAGLPLRILKLVLYAKVIDGDLQGHSLRRFSEVLKTFTELKERYEMQ
52
+ LLLPKAVPLEFDVYLSFSEEDKEVAKVIREKLSGAKDGVRIYDSSHQGINKDTVFQEDMY
53
+ SIMMKSARVVTVLSPNYLRNKACIEQYNIALCCNRRALRDMLAPIYVDSVEMMPTYMGLV
54
+ QYVDCRPHDPSKIGEACSQLTVSLSVTFHTELRVAEFDPLRYDVFLSYSHRDTEKANRFV
55
+ EMLQKLAPDLKLFFDVQELKTGKSWQRTLYHSIDGSRCMLALISEPYLKSAVCQEEFALA
56
+ QAKHCAKGKQHLQLISICLDDLDTIQPEFTHIPMVKGTPDVFDDMVKTVCPAVIQWLNGE
57
+ RVDQTETIKTLFDDQNITTLSADAEMEKFRQSHFQKEFGTQDSLISSKSPFPPKLSDILP
58
+ EPGKEVKDKRPKSASDCDLIFSYHSDDEKYVSFIVKILQLNAPSLKVKAVCSDENKLSAF
59
+ ERAHCIVPVLSPNYLESPECVEEFHIAIWRQRISNPEAGALLPICVHTLPQKPTYFHLVQ
60
+ SAVSMTDGIWAQLSGQHNFGLPQKIVDFSLAAGKTPLSQVDMLALYMAAYYILKRFAKAR
61
+ SCKEVEFSMKPALFNIMKLQEQIKQLTQPDYTDQLCKTLLEIHFNDIPDSWREGGHYLRP
62
+ KEPEDTTPAIMAPVEGASDSQTHNALNERTQDSSGKDKSEVQGEKAQRSASEGVSHDTVQ
63
+ QMDQDHDLKAAQGQDTAEGQDAAEGQDSEGGQDSEGGWDSDGGRDSVGNKTDAEKITGNH
64
+ GDEGGDGQVGGSEESKEKTEDEDEDISKRNRAPRSVACVCL
65
+ EOF
66
+ Bio::SignalP::Wrapper.new.calculate(different, :binary_path => SIGNALP3_PATH).signal?.should == true
67
+ Bio::SignalP::Wrapper.new.calculate(different, :binary_path => SIGNALP4_PATH).signal?.should == false
68
+ end
69
+
70
+ it 'work when given a very large sequence for signalp 3' do
71
+ big_seq = 'MTPEMPNPLDPSLAFNMAPGDVQLATGPQQPAAVFASPLQDAMVKPTQAQIPLHHENDKGNQELGPDRDQVYHIRTTSFKSL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ATNYAAISGKKPRDKRIFRGRIACLQIFDRALTGRQLRAIKRKCFRARPSPTTPPPVLPLLVAVYPLDRINGVRDISPRRCPTGRRSNVGYAPGPDGRKDGATRFFGNAGSYIEIPNNGKLDTMVSTTILLWAYHEGLKGPLVNYRPGPGWGVNVWMMGPRTLLARFVRRDGVFTKAVMVTSRKIRYRAWNYFGATYDYKTGVAKLWVNSRLLVVQSIGRFRLATNYPIRLGARRNGKRFFKGRMFCLQIYSRALSRKEILAARSSCFRRFPTTTPTRKTKTPTTTPSPTRPKGPFRAAAFYPLNYLSRGRDRSLFRNPPGILGYVRSAPGPDKLPGGSYQFYGRPDSYIYLPNRGKLDTRKSISIIAWIRNDGGAGPIFHYMPNGWGVYLWMLSSNTVGVRFTRRQRRASTTMLSSRVITPHKWQYIAATYDYISGDARLYLDGNVIARKRLGRIRLATNYPVRIGAKKRDRRNFRGRISCVMVFDVALNSNQIARRKKRCFRRGPRGPSEKVCEPKIDLVFVVDACSENDRFTKANFRRVKNFLIGLIGDFVVSSKKVRISLVLFAQYPKLVLRFSTKKAFVFRIIRNMKLVCGARYSGAALKYAYRQILQRTTRKPVLVMMTTGGSRDDVRGPTALINRKRVETFAIGVGRRYSFRELQYIATDPRHVYTAAFRNLGSTVKLLKRKICKSDTLYHPA'
72
+ Bio::SignalP::Wrapper.new.calculate(big_seq, :binary_path => SIGNALP3_PATH).signal?.should == false
73
+ end
74
+ end
75
+
76
+ describe 'bio-signalp script' do
77
+ # Known to have a signal peptide
78
+ acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
79
+
80
+ it "positive control" do
81
+ command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
82
+
83
+ Open3.popen3(command) do |stdin, stdout, stderr|
84
+ stdin.puts '>positive'
85
+ stdin.puts acp_sequence
86
+ stdin.close
87
+
88
+ @result = stdout.readlines # convert to string?
89
+ @error = stderr.readlines
90
+ end
91
+ @result.should == [">positive\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n"]
92
+ @error.should == []
93
+ end
94
+
95
+ it "return gracefully when empty sequences are given" do
96
+ command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
97
+
98
+ Open3.popen3(command) do |stdin, stdout, stderr|
99
+ stdin.puts '>positive'
100
+ stdin.puts acp_sequence
101
+ stdin.puts '>empty'
102
+ stdin.puts '>positive2'
103
+ stdin.puts acp_sequence
104
+ stdin.close
105
+
106
+ @result = stdout.readlines # convert to string?
107
+ @error = stderr.readlines
108
+ end
109
+ @result.should == [">positive\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n",
110
+ ">positive2\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n"]
111
+ @error.should == ["Unexpected empty sequence detected, ignoring: empty\n"]
112
+ end
113
+
114
+
115
+
116
+
117
+ it 'give the right -s output for signalp 3' do
118
+ command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
119
+
120
+ # This also tests the -b flag
121
+ command = "#{command} -b #{SIGNALP3_PATH} -s"
122
+ Open3.popen3(command) do |stdin, stdout, stderr|
123
+ stdin.puts '>positive'
124
+ stdin.puts acp_sequence
125
+ stdin.close
126
+
127
+ @result = stdout.readlines # convert to string?
128
+ @error = stderr.readlines
129
+ end
130
+
131
+ expected = [
132
+ "Name\tNN Prediction\tHMM Prediction\n",
133
+ "positive\tT\tT\n"
134
+ ]
135
+ @result.should == expected
136
+ @error.should == []
137
+ end
138
+
139
+
140
+
141
+
142
+ it 'give the right -s output for signalp 4' do
143
+ command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
144
+
145
+ command = "#{command} -b #{SIGNALP4_PATH} -s"
146
+ Open3.popen3(command) do |stdin, stdout, stderr|
147
+ stdin.puts '>positive'
148
+ stdin.puts acp_sequence
149
+ stdin.close
150
+
151
+ @result = stdout.readlines # convert to string?
152
+ @error = stderr.readlines
153
+ end
154
+
155
+ expected = [
156
+ "Name\tPredicted?\n",
157
+ "positive\tT\n"
158
+ ]
159
+ @result.should == expected
160
+ @error.should == []
161
+ end
162
+ end
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+
4
+ require 'rspec'
5
+ require 'bio-signalp'
6
+
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
+
11
+ RSpec.configure do |config|
12
+
13
+ end
metadata CHANGED
@@ -1,110 +1,109 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-signalp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ben J Woodcroft
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-18 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bio
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.4.1
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '1.4'
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.4.1
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.4'
30
33
  - !ruby/object:Gem::Dependency
31
34
  name: bio-logger
32
35
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
36
  requirements:
35
- - - ! '>='
37
+ - - "~>"
36
38
  - !ruby/object:Gem::Version
37
- version: '0'
39
+ version: '1.0'
38
40
  type: :runtime
39
41
  prerelease: false
40
42
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
43
  requirements:
43
- - - ! '>='
44
+ - - "~>"
44
45
  - !ruby/object:Gem::Version
45
- version: '0'
46
+ version: '1.0'
46
47
  - !ruby/object:Gem::Dependency
47
- name: shoulda
48
+ name: rspec
48
49
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '2.8'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
57
  requirements:
59
- - - ! '>='
58
+ - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '0'
60
+ version: '2.8'
62
61
  - !ruby/object:Gem::Dependency
63
- name: bundler
62
+ name: jeweler
64
63
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
64
  requirements:
67
- - - ! '>='
65
+ - - "~>"
68
66
  - !ruby/object:Gem::Version
69
- version: 1.0.0
67
+ version: '2.0'
70
68
  type: :development
71
69
  prerelease: false
72
70
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
71
  requirements:
75
- - - ! '>='
72
+ - - "~>"
76
73
  - !ruby/object:Gem::Version
77
- version: 1.0.0
74
+ version: '2.0'
78
75
  - !ruby/object:Gem::Dependency
79
- name: jeweler
76
+ name: bundler
80
77
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
78
  requirements:
83
- - - ! '>='
79
+ - - ">="
84
80
  - !ruby/object:Gem::Version
85
- version: 1.6.0
81
+ version: 1.0.21
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '1.0'
86
85
  type: :development
87
86
  prerelease: false
88
87
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
88
  requirements:
91
- - - ! '>='
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 1.0.21
92
+ - - "~>"
92
93
  - !ruby/object:Gem::Version
93
- version: 1.6.0
94
+ version: '1.0'
94
95
  - !ruby/object:Gem::Dependency
95
96
  name: rdoc
96
97
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
98
  requirements:
99
- - - ! '>='
99
+ - - "~>"
100
100
  - !ruby/object:Gem::Version
101
101
  version: '3.12'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
105
  requirements:
107
- - - ! '>='
106
+ - - "~>"
108
107
  - !ruby/object:Gem::Version
109
108
  version: '3.12'
110
109
  description: A wrapper for the signal peptide prediction algorith SignalP. Not very
@@ -117,7 +116,8 @@ extra_rdoc_files:
117
116
  - LICENSE.txt
118
117
  - README.md
119
118
  files:
120
- - .document
119
+ - ".document"
120
+ - ".rspec"
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - README.md
@@ -129,34 +129,30 @@ files:
129
129
  - lib/bio/appl/common.rb
130
130
  - lib/bio/appl/signalp3.rb
131
131
  - lib/bio/appl/signalp4.rb
132
- - test/helper.rb
133
- - test/test_bio-signalp.rb
132
+ - spec/bio-signalp_spec.rb
133
+ - spec/spec_helper.rb
134
134
  homepage: http://github.com/wwood/bioruby-signalp
135
135
  licenses:
136
136
  - MIT
137
+ metadata: {}
137
138
  post_install_message:
138
139
  rdoc_options: []
139
140
  require_paths:
140
141
  - lib
141
142
  required_ruby_version: !ruby/object:Gem::Requirement
142
- none: false
143
143
  requirements:
144
- - - ! '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
- segments:
148
- - 0
149
- hash: -969867473
150
147
  required_rubygems_version: !ruby/object:Gem::Requirement
151
- none: false
152
148
  requirements:
153
- - - ! '>='
149
+ - - ">="
154
150
  - !ruby/object:Gem::Version
155
151
  version: '0'
156
152
  requirements: []
157
153
  rubyforge_project:
158
- rubygems_version: 1.8.24
154
+ rubygems_version: 2.2.2
159
155
  signing_key:
160
- specification_version: 3
156
+ specification_version: 4
161
157
  summary: A wrapper for the signal peptide prediction algorith SignalP
162
158
  test_files: []
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'bio-signalp'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,159 +0,0 @@
1
- require 'helper'
2
- require 'open3'
3
-
4
- @@signalp3_path = File.join(ENV['HOME'],'bioinfo','signalp-3.0','signalp')
5
- @@signalp4_path = File.join(ENV['HOME'],'bioinfo','signalp-4.0','signalp')
6
- @@binaries = [
7
- @@signalp3_path,
8
- @@signalp4_path,
9
- ]
10
-
11
- class TestBioSignalp < Test::Unit::TestCase
12
- def setup
13
- log_name = 'bio-signalp'
14
- Bio::Log::CLI.logger('stderr')
15
- #Bio::Log::CLI.configure(log_name) # when commented out no debug is printed out
16
- end
17
-
18
- should "positive control" do
19
- # Known to have a signal peptide
20
- acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
21
-
22
- assert_equal true, Bio::SignalP::Wrapper.new.calculate(acp_sequence).signal?
23
- end
24
-
25
- should "negative control" do
26
- # Known to have a signal peptide
27
- non_signal_sequence = 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'
28
-
29
- assert_equal false, Bio::SignalP::Wrapper.new.calculate(non_signal_sequence).signal?
30
- end
31
-
32
- should 'work with different SignalP versions, this test is specific to Ben\'s machines probably' do
33
- binaries = {
34
- @@binaries[0] => Bio::SignalP::Version3::Result,
35
- @@binaries[1] => Bio::SignalP::Version4::Result,
36
- }
37
- binaries.each do |binary, clazz|
38
- acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
39
- positive_result = Bio::SignalP::Wrapper.new.calculate(acp_sequence, :binary_path => binary)
40
- assert_equal true, positive_result.signal?, binary
41
- assert_kind_of clazz, positive_result, binary
42
- assert_equal 17, positive_result.cleavage_site, binary
43
- assert_equal 'FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ',
44
- positive_result.cleave(acp_sequence), binary
45
- non_signal_sequence = 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'
46
- assert_equal false, Bio::SignalP::Wrapper.new.calculate(non_signal_sequence, :binary_path => binary).signal?, binary
47
- end
48
- end
49
-
50
- should 'give different predictions for v3 and v4' do
51
- different = <<EOF
52
- MMKGMVEAAVKWMKAGLPLRILKLVLYAKVIDGDLQGHSLRRFSEVLKTFTELKERYEMQ
53
- LLLPKAVPLEFDVYLSFSEEDKEVAKVIREKLSGAKDGVRIYDSSHQGINKDTVFQEDMY
54
- SIMMKSARVVTVLSPNYLRNKACIEQYNIALCCNRRALRDMLAPIYVDSVEMMPTYMGLV
55
- QYVDCRPHDPSKIGEACSQLTVSLSVTFHTELRVAEFDPLRYDVFLSYSHRDTEKANRFV
56
- EMLQKLAPDLKLFFDVQELKTGKSWQRTLYHSIDGSRCMLALISEPYLKSAVCQEEFALA
57
- QAKHCAKGKQHLQLISICLDDLDTIQPEFTHIPMVKGTPDVFDDMVKTVCPAVIQWLNGE
58
- RVDQTETIKTLFDDQNITTLSADAEMEKFRQSHFQKEFGTQDSLISSKSPFPPKLSDILP
59
- EPGKEVKDKRPKSASDCDLIFSYHSDDEKYVSFIVKILQLNAPSLKVKAVCSDENKLSAF
60
- ERAHCIVPVLSPNYLESPECVEEFHIAIWRQRISNPEAGALLPICVHTLPQKPTYFHLVQ
61
- SAVSMTDGIWAQLSGQHNFGLPQKIVDFSLAAGKTPLSQVDMLALYMAAYYILKRFAKAR
62
- SCKEVEFSMKPALFNIMKLQEQIKQLTQPDYTDQLCKTLLEIHFNDIPDSWREGGHYLRP
63
- KEPEDTTPAIMAPVEGASDSQTHNALNERTQDSSGKDKSEVQGEKAQRSASEGVSHDTVQ
64
- QMDQDHDLKAAQGQDTAEGQDAAEGQDSEGGQDSEGGWDSDGGRDSVGNKTDAEKITGNH
65
- GDEGGDGQVGGSEESKEKTEDEDEDISKRNRAPRSVACVCL
66
- EOF
67
- assert_equal true, Bio::SignalP::Wrapper.new.calculate(different, :binary_path => @@signalp3_path).signal?
68
- assert_equal false, Bio::SignalP::Wrapper.new.calculate(different, :binary_path => @@signalp4_path).signal?
69
- end
70
- end
71
-
72
- class TestSignalPScript < Test::Unit::TestCase
73
- # Known to have a signal peptide
74
- acp_sequence = 'MKILLLCIIFLYYVNAFKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ'
75
-
76
- should "positive control" do
77
- command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
78
-
79
- Open3.popen3(command) do |stdin, stdout, stderr|
80
- stdin.puts '>positive'
81
- stdin.puts acp_sequence
82
- stdin.close
83
-
84
- @result = stdout.readlines # convert to string?
85
- @error = stderr.readlines
86
- end
87
- assert_equal [">positive\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n"], @result
88
- assert_equal [], @error
89
- end
90
-
91
- should "return gracefully when empty sequences are given" do
92
- command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
93
-
94
- Open3.popen3(command) do |stdin, stdout, stderr|
95
- stdin.puts '>positive'
96
- stdin.puts acp_sequence
97
- stdin.puts '>empty'
98
- stdin.puts '>positive2'
99
- stdin.puts acp_sequence
100
- stdin.close
101
-
102
- @result = stdout.readlines # convert to string?
103
- @error = stderr.readlines
104
- end
105
- assert_equal [">positive\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n",
106
- ">positive2\n", "FKNTQKDGVSLQILKKKRSNQVNFLNRKNDYNLIKNKNPSSSLKSTFDDIKKIISKQLSVEEDKIQMNSNFTKDLGADSLDLVELIMALEEKFNVTISDQDALKINTVQDAIDYIEKNNKQ\n"], @result
107
- assert_equal ["Unexpected empty sequence detected, ignoring: empty\n"], @error
108
- end
109
-
110
-
111
-
112
-
113
- should 'give the right -s output for signalp 3' do
114
- command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
115
-
116
- # This also tests the -b flag
117
- command = "#{command} -b #{@@signalp3_path} -s"
118
- Open3.popen3(command) do |stdin, stdout, stderr|
119
- stdin.puts '>positive'
120
- stdin.puts acp_sequence
121
- stdin.close
122
-
123
- @result = stdout.readlines # convert to string?
124
- @error = stderr.readlines
125
- end
126
-
127
- expected = [
128
- "Name\tNN Prediction\tHMM Prediction\n",
129
- "positive\tT\tT\n"
130
- ]
131
- assert_equal expected, @result
132
- assert_equal [], @error
133
- end
134
-
135
-
136
-
137
-
138
- should 'give the right -s output for signalp 4' do
139
- command = File.join(File.dirname(__FILE__),'..','bin','signalp.rb')
140
-
141
- command = "#{command} -b #{@@signalp4_path} -s"
142
- Open3.popen3(command) do |stdin, stdout, stderr|
143
- stdin.puts '>positive'
144
- stdin.puts acp_sequence
145
- stdin.close
146
-
147
- @result = stdout.readlines # convert to string?
148
- @error = stderr.readlines
149
- end
150
-
151
- expected = [
152
- "Name\tPredicted?\n",
153
- "positive\tT\n"
154
- ]
155
- assert_equal [], @error
156
- assert_equal expected, @result
157
- end
158
-
159
- end