bio-tm_hmm 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -9,4 +9,4 @@ rvm:
9
9
  # - rbx-18mode
10
10
 
11
11
  # uncomment this line if your project needs to run something other than `rake`:
12
- # script: bundle exec rspec spec
12
+ script: bundle exec rake test_without_tmhmm
data/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # bio-tm_hmm
2
+
3
+ [![Build Status](https://secure.travis-ci.org/wwood/bioruby-sra.png)](http://travis-ci.org/#!/wwood/bioruby-tm_hmm)
4
+
5
+ A bioruby plugin for running the transmembrane domain predictor TMHMM automatically on multiple sequences in a FASTA file and manipulation of the results.
6
+
7
+ ## Installation
8
+
9
+ ```
10
+ gem install bio-tm_hmm
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ Usage: bio-tm_hmm [-f NUM] [-g NUM] [fasta_filename]
17
+
18
+ fasta file can also be piped in on STDIN.
19
+ without arguments, a description of the transmembrane domains is printed out for each input sequence
20
+ -f MIN_TRANSMEMBRANE_DOMAINS, Print those sequences that have at _least_ MIN_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.
21
+ --filter-in
22
+ -g MAX_TRANSMEMBRANE_DOMAINS, Print those sequences that have at _most_ MAX_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.
23
+ --filter-out
24
+ ```
25
+
26
+ Where my.fasta is a FASTA file with one or more protein sequences in it. Output will be a description of the transmembrane domains predicted by TMHMM.
27
+
28
+ Other options include -f for printing out the fasta sequences that have some number of transmembrane domains in them, and ignoring those that don't (converse is -g). For instance, to filter out all sequences that have less than 2 predicted transmembrane domains:
29
+
30
+ ```
31
+ bio-tm_hmm -f 2 <my.fasta
32
+ ```
33
+
34
+ ## Developers
35
+
36
+ To use the library
37
+
38
+ ```
39
+ require 'bio-tm_hmm'
40
+ ```
41
+
42
+ The API doc is online. For more code examples see also the test files in
43
+ the source tree.
44
+
45
+ ## Project home page
46
+
47
+ Information on the source tree, documentation, issues and how to contribute, see
48
+
49
+ http://github.com/wwood/bioruby-tm_hmm
50
+
51
+ The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
52
+
53
+ ## Cite
54
+
55
+ If you use this software, please cite:
56
+
57
+ [Organellar proteomics reveals hundreds of novel nuclear proteins in the malaria parasite Plasmodium falciparum](http://genomebiology.com/2012/13/11/R108)
58
+
59
+ Sophie C Oehring, Ben J Woodcroft, Suzette Moes, Johanna Wetzel, Olivier Dietz, Andreas Pulfer, Chaitali Dekiwadia, Pascal Maeser, Christian Flueck, Kathrin Witmer, Nicolas MB Brancucci, Igor Niederwieser, Paul Jenoe, Stuart A Ralph and Till S Voss
60
+
61
+ Genome Biology 2012, 13:R108 doi:10.1186/gb-2012-13-11-r108
62
+
63
+ ## Biogems.info
64
+
65
+ This Biogem is published at http://biogems.info/index.html#bio-tm_hmm
66
+
67
+ ## Copyright
68
+
69
+ Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
70
+
data/Rakefile CHANGED
@@ -31,6 +31,11 @@ Rake::TestTask.new(:test) do |test|
31
31
  test.pattern = 'test/**/test_*.rb'
32
32
  test.verbose = true
33
33
  end
34
+ Rake::TestTask.new(:test_without_tmhmm) do |test|
35
+ test.libs << 'lib' << 'test'
36
+ test.test_files = FileList['test/test*.rb'].reject{|f| f=='test/test_tm_hmm_wrapper.rb'}
37
+ test.verbose = true
38
+ end
34
39
 
35
40
  task :default => :test
36
41
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/bin/bio-tm_hmm CHANGED
@@ -17,16 +17,22 @@ options = {
17
17
  :filter_out => false,
18
18
  }
19
19
  o = OptionParser.new do |opts|
20
- opts.banner = ['',
21
- 'Usage: tm_hmm_wrapper.rb [-fg] [fasta_filename]','',
22
- "\tfasta file can also be piped in on STDIN.",
23
- "\twithout arguments, a description of the transmembranes is printed out for each input sequence",''
24
- ].join("\n")
25
- opts.on('-f','--filter-in [MIN_TRANSMEMBRANE_DOMAINS]','Print those sequences that have a transmembrane domain. If MIN_TRANSMEMBRANE_DOMAINS is defined, only those proteins with that many TMDs or more are printed out') do |m|
20
+ opts.banner = "
21
+ Usage: #{File.basename __FILE__} [-f NUM] [-g NUM] [fasta_filename]
22
+
23
+ Fasta file can be piped in on STDIN, or specified as the first unqualified argument.
24
+
25
+ Without arguments, a description of the transmembrane domains is printed out for each input sequence\n\n"
26
+
27
+ opts.on('-f','--filter-in MIN_TRANSMEMBRANE_DOMAINS','Print those sequences that have at _least_ MIN_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.') do |m|
26
28
  options[:filter_in] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
27
29
  end
28
- opts.on('-g','--filter-out [MIN_TRANSMEMBRANE_DOMAINS]','Print those sequences that do NOT have a transmembrane domain. If MIN_TRANSMEMBRANE_DOMAINS is defined, only those proteins with that many TMDs or more are filtered out') do |m|
29
- options[:filter_out] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
30
+ opts.on('-g','--filter-out MAX_TRANSMEMBRANE_DOMAINS','Print those sequences that have at _most_ MAX_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.') do |m|
31
+ if m.nil?
32
+ options[:filter_out] = 1
33
+ else
34
+ options[:filter_out] = m.to_i
35
+ end
30
36
  end
31
37
  end
32
38
  o.parse!
@@ -39,6 +45,7 @@ Bio::FlatFile.auto(ARGF).each do |seq|
39
45
 
40
46
  # Default output - a description of the TMDs for each input aaseq
41
47
  if options[:filter_in] == false and options[:filter_out] == false
48
+ p result
42
49
  if result.has_domain?
43
50
  # At least one TMD found. Output each on a separate line
44
51
  result.transmembrane_domains.each do |tmd|
@@ -62,7 +69,7 @@ Bio::FlatFile.auto(ARGF).each do |seq|
62
69
  puts seq
63
70
  end
64
71
  elsif options[:filter_out] != false
65
- unless result.transmembrane_domains.length >= options[:filter_out]
72
+ unless result.transmembrane_domains.length > options[:filter_out]
66
73
  puts seq
67
74
  end
68
75
  end
data/bio-tm_hmm.gemspec CHANGED
@@ -5,24 +5,24 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "bio-tm_hmm"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben J. Woodcroft"]
12
- s.date = "2012-05-03"
12
+ s.date = "2012-12-01"
13
13
  s.description = "A bioruby plugin for interaction with the transmembrane predictor TMHMM"
14
14
  s.email = "donttrustben@gmail.com"
15
15
  s.executables = ["bio-tm_hmm"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
- "README.rdoc"
18
+ "README.md"
19
19
  ]
20
20
  s.files = [
21
21
  ".document",
22
22
  ".travis.yml",
23
23
  "Gemfile",
24
24
  "LICENSE.txt",
25
- "README.rdoc",
25
+ "README.md",
26
26
  "Rakefile",
27
27
  "VERSION",
28
28
  "bin/bio-tm_hmm",
@@ -32,13 +32,14 @@ Gem::Specification.new do |s|
32
32
  "lib/bio/transmembrane.rb",
33
33
  "test/data/falciparum1.fa",
34
34
  "test/helper.rb",
35
+ "test/test_tm_hmm_parser.rb",
35
36
  "test/test_tm_hmm_wrapper.rb",
36
37
  "test/test_transmembrane.rb"
37
38
  ]
38
39
  s.homepage = "http://github.com/wwood/bioruby-tm_hmm"
39
40
  s.licenses = ["MIT"]
40
41
  s.require_paths = ["lib"]
41
- s.rubygems_version = "1.8.21"
42
+ s.rubygems_version = "1.8.24"
42
43
  s.summary = "A bioruby plugin for interaction with the transmembrane predictor TMHMM"
43
44
 
44
45
  if s.respond_to? :specification_version then
@@ -0,0 +1,57 @@
1
+ require 'bio'
2
+ require 'helper'
3
+
4
+ class TmHmmParserTest < Test::Unit::TestCase
5
+ include Bio::Transmembrane
6
+
7
+ def test_parser
8
+ result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0635c len=555 ExpAA=0.00 First60=0.00 PredHel=0 Topology=o')
9
+ assert result
10
+ assert_equal false, result.has_domain?
11
+
12
+ # test a single TMD
13
+ result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0685c len=324 ExpAA=20.36 First60=0.00 PredHel=1 Topology=o281-303i')
14
+ assert result
15
+ assert_equal 1, result.transmembrane_domains.length
16
+ assert_equal 281, result.transmembrane_domains[0].start
17
+ assert_equal 303, result.transmembrane_domains[0].stop
18
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
19
+ result.transmembrane_domains[0].orientation
20
+ assert result.transmembrane_type_1?
21
+ assert_equal false, result.transmembrane_type_2?
22
+
23
+ # test 2 TMD
24
+ result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0680c len=209 ExpAA=43.03 First60=0.02 PredHel=2 Topology=i137-159o164-183i')
25
+ assert result
26
+ assert_equal 2, result.transmembrane_domains.length
27
+ assert_equal 137, result.transmembrane_domains[0].start
28
+ assert_equal 159, result.transmembrane_domains[0].stop
29
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
30
+ result.transmembrane_domains[0].orientation
31
+ assert_equal 164, result.transmembrane_domains[1].start
32
+ assert_equal 183, result.transmembrane_domains[1].stop
33
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
34
+ result.transmembrane_domains[1].orientation
35
+ assert_equal false, result.transmembrane_type_1?
36
+ assert_equal false, result.transmembrane_type_2?
37
+
38
+ # test 3 TMD
39
+ result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0705c len=282 ExpAA=90.97 First60=22.20 PredHel=4 Topology=i22-44o185-207i212-234o259-281i')
40
+ assert result
41
+ assert_equal 4, result.transmembrane_domains.length
42
+ assert_equal 22, result.transmembrane_domains[0].start
43
+ assert_equal 44, result.transmembrane_domains[0].stop
44
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
45
+ result.transmembrane_domains[0].orientation
46
+ assert_equal 185, result.transmembrane_domains[1].start
47
+ assert_equal 207, result.transmembrane_domains[1].stop
48
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
49
+ result.transmembrane_domains[1].orientation
50
+ assert_equal 259, result.transmembrane_domains[3].start
51
+ assert_equal 281, result.transmembrane_domains[3].stop
52
+ assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
53
+ result.transmembrane_domains[3].orientation
54
+ assert_equal false, result.transmembrane_type_1?
55
+ assert_equal false, result.transmembrane_type_2?
56
+ end
57
+ end
@@ -3,58 +3,6 @@ require 'helper'
3
3
 
4
4
  class TmHmmWrapperTest < Test::Unit::TestCase
5
5
  include Bio::Transmembrane
6
-
7
- def test_parser
8
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0635c len=555 ExpAA=0.00 First60=0.00 PredHel=0 Topology=o')
9
- assert result
10
- assert_equal false, result.has_domain?
11
-
12
- # test a single TMD
13
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0685c len=324 ExpAA=20.36 First60=0.00 PredHel=1 Topology=o281-303i')
14
- assert result
15
- assert_equal 1, result.transmembrane_domains.length
16
- assert_equal 281, result.transmembrane_domains[0].start
17
- assert_equal 303, result.transmembrane_domains[0].stop
18
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
19
- result.transmembrane_domains[0].orientation
20
- assert result.transmembrane_type_1?
21
- assert_equal false, result.transmembrane_type_2?
22
-
23
- # test 2 TMD
24
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0680c len=209 ExpAA=43.03 First60=0.02 PredHel=2 Topology=i137-159o164-183i')
25
- assert result
26
- assert_equal 2, result.transmembrane_domains.length
27
- assert_equal 137, result.transmembrane_domains[0].start
28
- assert_equal 159, result.transmembrane_domains[0].stop
29
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
30
- result.transmembrane_domains[0].orientation
31
- assert_equal 164, result.transmembrane_domains[1].start
32
- assert_equal 183, result.transmembrane_domains[1].stop
33
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
34
- result.transmembrane_domains[1].orientation
35
- assert_equal false, result.transmembrane_type_1?
36
- assert_equal false, result.transmembrane_type_2?
37
-
38
- # test 3 TMD
39
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0705c len=282 ExpAA=90.97 First60=22.20 PredHel=4 Topology=i22-44o185-207i212-234o259-281i')
40
- assert result
41
- assert_equal 4, result.transmembrane_domains.length
42
- assert_equal 22, result.transmembrane_domains[0].start
43
- assert_equal 44, result.transmembrane_domains[0].stop
44
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
45
- result.transmembrane_domains[0].orientation
46
- assert_equal 185, result.transmembrane_domains[1].start
47
- assert_equal 207, result.transmembrane_domains[1].stop
48
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
49
- result.transmembrane_domains[1].orientation
50
- assert_equal 259, result.transmembrane_domains[3].start
51
- assert_equal 281, result.transmembrane_domains[3].stop
52
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
53
- result.transmembrane_domains[3].orientation
54
- assert_equal false, result.transmembrane_type_1?
55
- assert_equal false, result.transmembrane_type_2?
56
- end
57
-
58
6
  def test_wrapper
59
7
  prog = Bio::TMHMM::TmHmmWrapper.new
60
8
  seq = Bio::FlatFile.auto(File.join(File.dirname(__FILE__),'data','falciparum1.fa')).next_entry
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-tm_hmm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-03 00:00:00.000000000 Z
12
+ date: 2012-12-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
@@ -98,13 +98,13 @@ executables:
98
98
  extensions: []
99
99
  extra_rdoc_files:
100
100
  - LICENSE.txt
101
- - README.rdoc
101
+ - README.md
102
102
  files:
103
103
  - .document
104
104
  - .travis.yml
105
105
  - Gemfile
106
106
  - LICENSE.txt
107
- - README.rdoc
107
+ - README.md
108
108
  - Rakefile
109
109
  - VERSION
110
110
  - bin/bio-tm_hmm
@@ -114,6 +114,7 @@ files:
114
114
  - lib/bio/transmembrane.rb
115
115
  - test/data/falciparum1.fa
116
116
  - test/helper.rb
117
+ - test/test_tm_hmm_parser.rb
117
118
  - test/test_tm_hmm_wrapper.rb
118
119
  - test/test_transmembrane.rb
119
120
  homepage: http://github.com/wwood/bioruby-tm_hmm
@@ -131,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
132
  version: '0'
132
133
  segments:
133
134
  - 0
134
- hash: 1004564205
135
+ hash: 24340783
135
136
  required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  none: false
137
138
  requirements:
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  version: '0'
141
142
  requirements: []
142
143
  rubyforge_project:
143
- rubygems_version: 1.8.21
144
+ rubygems_version: 1.8.24
144
145
  signing_key:
145
146
  specification_version: 3
146
147
  summary: A bioruby plugin for interaction with the transmembrane predictor TMHMM
data/README.rdoc DELETED
@@ -1,56 +0,0 @@
1
- = bio-tm_hmm
2
-
3
- {<img
4
- src="https://secure.travis-ci.org/wwood/bioruby-tm_hmm.png"
5
- />}[http://travis-ci.org/#!/wwood/bioruby-tm_hmm]
6
-
7
- A bioruby plugin for running TMHMM automatically on multiple sequences in a FASTA file and manipulation of the results
8
-
9
- Note: this software is under active development!
10
-
11
- == Installation
12
-
13
- gem install bio-tm_hmm
14
-
15
- == Usage
16
-
17
- bio-tm_hmm my.fasta
18
-
19
- Where my.fasta is a FASTA file with one or more protein sequences in it. Output will be a description of the transmembrane domains predicted by TMHMM.
20
-
21
- Other options include -f for printing out the fasta sequences that have some number of transmembrane domains in them, and ignoring those that done (converse is -g)
22
-
23
- bio-tm_hmm -f 2 <my.fasta
24
-
25
- == Developers
26
-
27
- To use the library
28
-
29
- require 'bio-tm_hmm'
30
-
31
- The API doc is online. For more code examples see also the test files in
32
- the source tree.
33
-
34
- == Project home page
35
-
36
- Information on the source tree, documentation, issues and how to contribute, see
37
-
38
- http://github.com/wwood/bioruby-tm_hmm
39
-
40
- The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
41
-
42
- == Cite
43
-
44
- If you use this software, please cite one of
45
-
46
- * [BioRuby: bioinformatics software for the Ruby programming language](http://dx.doi.org/10.1093/bioinformatics/btq475)
47
- * [Biogem: an effective tool-based approach for scaling up open source software development in bioinformatics](http://dx.doi.org/10.1093/bioinformatics/bts080)
48
-
49
- == Biogems.info
50
-
51
- This Biogem is published at http://biogems.info/index.html#bio-tm_hmm
52
-
53
- == Copyright
54
-
55
- Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
56
-