bio-tm_hmm 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - jruby-19mode # JRuby in 1.9 mode
6
+ - rbx-19mode
7
+ # - 1.8.7
8
+ # - jruby-18mode # JRuby in 1.8 mode
9
+ # - rbx-18mode
10
+
11
+ # uncomment this line if your project needs to run something other than `rake`:
12
+ # script: bundle exec rspec spec
data/Gemfile CHANGED
@@ -2,12 +2,13 @@ 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
5
 
7
6
  # Add dependencies to develop your gem here.
8
7
  # Include everything needed to run rake, tests, features, etc.
9
8
  group :development do
10
- gem "bundler", "~> 1.0.0"
11
- gem "jeweler", "~> 1.5.2"
12
- gem "rcov", ">= 0"
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "jeweler", "~> 1.8.3"
12
+ gem "bundler", ">= 1.0.21"
13
+ gem "bio", ">= 1.4.2"
13
14
  end
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Ben J. Woodcroft
1
+ Copyright (c) 2012 Ben J Woodcroft
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -1,21 +1,56 @@
1
1
  = bio-tm_hmm
2
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
+
3
7
  A bioruby plugin for running TMHMM automatically on multiple sequences in a FASTA file and manipulation of the results
4
8
 
5
- biotm_hmm -f proteome.fasta
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
6
26
 
7
- == Contributing to bio-tm_hmm
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
8
45
 
9
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
10
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
11
- * Fork the project
12
- * Start a feature/bugfix branch
13
- * Commit and push until you are happy with your contribution
14
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
15
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
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
16
52
 
17
53
  == Copyright
18
54
 
19
- Copyright (c) 2011 Ben J. Woodcroft. See LICENSE.txt for
20
- further details.
55
+ Copyright (c) 2012 Ben J Woodcroft. See LICENSE.txt for further details.
21
56
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler'
3
5
  begin
@@ -19,10 +21,7 @@ Jeweler::Tasks.new do |gem|
19
21
  gem.description = %Q{A bioruby plugin for interaction with the transmembrane predictor TMHMM}
20
22
  gem.email = "donttrustben@gmail.com"
21
23
  gem.authors = ["Ben J. Woodcroft"]
22
- # Include your dependencies below. Runtime dependencies are required when using your gem,
23
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
- # gem.add_development_dependency 'rspec', '> 1.2.3'
24
+ # dependencies defined in Gemfile
26
25
  end
27
26
  Jeweler::RubygemsDotOrgTasks.new
28
27
 
@@ -33,16 +32,9 @@ Rake::TestTask.new(:test) do |test|
33
32
  test.verbose = true
34
33
  end
35
34
 
36
- require 'rcov/rcovtask'
37
- Rcov::RcovTask.new do |test|
38
- test.libs << 'test'
39
- test.pattern = 'test/**/test_*.rb'
40
- test.verbose = true
41
- end
42
-
43
35
  task :default => :test
44
36
 
45
- require 'rake/rdoctask'
37
+ require 'rdoc/task'
46
38
  Rake::RDocTask.new do |rdoc|
47
39
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
40
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
data/bin/bio-tm_hmm ADDED
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Author:: Ben J. Woodcroft
4
+ # Copyright:: 2011
5
+ # License:: The Ruby License
6
+
7
+ require 'rubygems'
8
+ require 'bio'
9
+ require 'bio-tm_hmm'
10
+ require 'optparse'
11
+
12
+ # If being run directly instead of being require'd,
13
+ # output one transmembrane per line, and
14
+ # indicate that a particular protein has no transmembrane domain
15
+ options = {
16
+ :filter_in => false,
17
+ :filter_out => false,
18
+ }
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|
26
+ options[:filter_in] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
27
+ 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
+ end
31
+ end
32
+ o.parse!
33
+
34
+ runner = Bio::TMHMM::TmHmmWrapper.new
35
+
36
+ Bio::FlatFile.auto(ARGF).each do |seq|
37
+ result = runner.calculate(seq.seq)
38
+ name = seq.definition
39
+
40
+ # Default output - a description of the TMDs for each input aaseq
41
+ if options[:filter_in] == false and options[:filter_out] == false
42
+ if result.has_domain?
43
+ # At least one TMD found. Output each on a separate line
44
+ result.transmembrane_domains.each do |tmd|
45
+ puts [
46
+ name,
47
+ result.transmembrane_type,
48
+ tmd.start,
49
+ tmd.stop,
50
+ tmd.orientation
51
+ ].join("\t")
52
+ end
53
+ else
54
+ puts [
55
+ name,
56
+ 'No Transmembrane Domain Found'
57
+ ].join("\t")
58
+ end
59
+
60
+ elsif options[:filter_in] != false
61
+ if result.transmembrane_domains.length >= options[:filter_in]
62
+ puts seq
63
+ end
64
+ elsif options[:filter_out] != false
65
+ unless result.transmembrane_domains.length >= options[:filter_out]
66
+ puts seq
67
+ end
68
+ end
69
+ end
data/bio-tm_hmm.gemspec CHANGED
@@ -4,28 +4,28 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{bio-tm_hmm}
8
- s.version = "0.2.0"
7
+ s.name = "bio-tm_hmm"
8
+ s.version = "0.2.1"
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 = %q{2011-04-06}
13
- s.default_executable = %q{biotm_hmm}
14
- s.description = %q{A bioruby plugin for interaction with the transmembrane predictor TMHMM}
15
- s.email = %q{donttrustben@gmail.com}
16
- s.executables = ["biotm_hmm"]
12
+ s.date = "2012-05-03"
13
+ s.description = "A bioruby plugin for interaction with the transmembrane predictor TMHMM"
14
+ s.email = "donttrustben@gmail.com"
15
+ s.executables = ["bio-tm_hmm"]
17
16
  s.extra_rdoc_files = [
18
17
  "LICENSE.txt",
19
18
  "README.rdoc"
20
19
  ]
21
20
  s.files = [
22
21
  ".document",
22
+ ".travis.yml",
23
23
  "Gemfile",
24
24
  "LICENSE.txt",
25
25
  "README.rdoc",
26
26
  "Rakefile",
27
27
  "VERSION",
28
- "bin/biotm_hmm",
28
+ "bin/bio-tm_hmm",
29
29
  "bio-tm_hmm.gemspec",
30
30
  "lib/bio-tm_hmm.rb",
31
31
  "lib/bio/appl/tmhmm/tmhmm_runner.rb",
@@ -35,36 +35,34 @@ Gem::Specification.new do |s|
35
35
  "test/test_tm_hmm_wrapper.rb",
36
36
  "test/test_transmembrane.rb"
37
37
  ]
38
- s.homepage = %q{http://github.com/wwood/bioruby-tm_hmm}
38
+ s.homepage = "http://github.com/wwood/bioruby-tm_hmm"
39
39
  s.licenses = ["MIT"]
40
40
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.6.2}
42
- s.summary = %q{A bioruby plugin for interaction with the transmembrane predictor TMHMM}
43
- s.test_files = [
44
- "test/helper.rb",
45
- "test/test_tm_hmm_wrapper.rb",
46
- "test/test_transmembrane.rb"
47
- ]
41
+ s.rubygems_version = "1.8.21"
42
+ s.summary = "A bioruby plugin for interaction with the transmembrane predictor TMHMM"
48
43
 
49
44
  if s.respond_to? :specification_version then
50
45
  s.specification_version = 3
51
46
 
52
47
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
- s.add_runtime_dependency(%q<bio>, [">= 1.4.1"])
54
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
55
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
56
- s.add_development_dependency(%q<rcov>, [">= 0"])
48
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
49
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
51
+ s.add_development_dependency(%q<bundler>, [">= 1.0.21"])
52
+ s.add_development_dependency(%q<bio>, [">= 1.4.2"])
57
53
  else
58
- s.add_dependency(%q<bio>, [">= 1.4.1"])
59
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
61
- s.add_dependency(%q<rcov>, [">= 0"])
54
+ s.add_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
57
+ s.add_dependency(%q<bundler>, [">= 1.0.21"])
58
+ s.add_dependency(%q<bio>, [">= 1.4.2"])
62
59
  end
63
60
  else
64
- s.add_dependency(%q<bio>, [">= 1.4.1"])
65
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
67
- s.add_dependency(%q<rcov>, [">= 0"])
61
+ s.add_dependency(%q<shoulda>, [">= 0"])
62
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
63
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
64
+ s.add_dependency(%q<bundler>, [">= 1.0.21"])
65
+ s.add_dependency(%q<bio>, [">= 1.4.2"])
68
66
  end
69
67
  end
70
68
 
@@ -1,3 +1,35 @@
1
+
2
+ # Monkey-patch Array#pair in
3
+ class Array
4
+ # Return an array of all pairs of elements from this array (each is an array).
5
+ # If another_array is not nil, then do pairwise between this array and that (but not within each)
6
+ #
7
+ # NOT thread safe.
8
+ def pairs(another_array = nil)
9
+ pairs = []
10
+
11
+ if another_array #between this array and the next
12
+ (0..length-1).each do |index1|
13
+ (0..another_array.length-1).each do |index2|
14
+ pairs.push [self[index1], another_array[index2]]
15
+ end
16
+ end
17
+ else # within this array only
18
+ (0..length-1).each do |index1|
19
+ index2 = index1+1
20
+ while index2 < length
21
+ pairs.push [self[index1], self[index2]]
22
+ index2 += 1
23
+ end
24
+ end
25
+ end
26
+
27
+ return pairs
28
+ end
29
+ end
30
+
31
+
32
+
1
33
  # a simple class to represent a transmembrane domain, and a transmembrane domain containing protein
2
34
  module Bio
3
35
  module Transmembrane
@@ -51,6 +83,16 @@ module Bio
51
83
  def each
52
84
  @transmembrane_domains.each{|t| yield t}
53
85
  end
86
+
87
+ def residue_number_contained?(residue_number)
88
+ contained = false
89
+ @transmembrane_domains.each do |tmd|
90
+ if tmd.start <= residue_number and tmd.stop >= residue_number
91
+ contained = true
92
+ end
93
+ end
94
+ contained
95
+ end
54
96
  end
55
97
 
56
98
  class OrientedTransmembraneDomainProtein<TransmembraneProtein
@@ -138,8 +180,16 @@ module Bio
138
180
  end
139
181
  end
140
182
 
183
+ # From Predicting transmembrane protein topology with a hidden markov model: application to complete g
184
+ #
185
+ # Another signal shown to be associated with transmembrane helices is
186
+ # the abundance of positively charged residues in the part of the
187
+ # sequence on the cytoplasmic side of the membrane, “the positive inside
188
+ # rule” (von Heijne 1986) and (von Heijne 1994).
189
+ #
190
+ # So, inside means cytosolic. So outside_in means type I transmembrane domain protein
141
191
  class OrientedTransmembraneDomain<TransmembraneDomainDefinition
142
- # The orientation can either be inside out (like a type II transmembrane domain protein)
192
+ # The orientation can either be inside out (like a type II transmembrane domain protein)
143
193
  INSIDE_OUT = 'inside_out'
144
194
  # Or outside in, like a type I transmembrane domain protein)
145
195
  OUTSIDE_IN = 'outside_in'
@@ -116,5 +116,31 @@ module Transmembrane
116
116
  assert_equal 1, tmd1.overlap_length(tmd2)
117
117
  assert_equal((3..3), tmd1.intersection(tmd2))
118
118
  end
119
+
120
+ def test_residue_contained?
121
+ p = TransmembraneProtein.new
122
+
123
+ # test none
124
+ p.transmembrane_domains = []
125
+ assert_equal false, p.residue_number_contained?(5)
126
+
127
+ # test one
128
+ p.transmembrane_domains = [TransmembraneDomainDefinition.new(5,8)]
129
+ assert p.residue_number_contained?(5)
130
+ assert p.residue_number_contained?(6)
131
+ assert p.residue_number_contained?(8)
132
+ assert_equal false, p.residue_number_contained?(4)
133
+ assert_equal false, p.residue_number_contained?(9)
134
+
135
+ # test 3
136
+ p.transmembrane_domains = [
137
+ TransmembraneDomainDefinition.new(1,10),
138
+ TransmembraneDomainDefinition.new(90,100),
139
+ TransmembraneDomainDefinition.new(16,24),
140
+ ]
141
+ assert p.residue_number_contained?(5)
142
+ assert p.residue_number_contained?(95)
143
+ assert_equal false, p.residue_number_contained?(150)
144
+ end
119
145
  end
120
146
  end
metadata CHANGED
@@ -1,102 +1,113 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: bio-tm_hmm
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ben J. Woodcroft
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-04-06 00:00:00 +10:00
19
- default_executable: biotm_hmm
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- type: :runtime
23
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2012-05-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: shoulda
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 5
29
- segments:
30
- - 1
31
- - 4
32
- - 1
33
- version: 1.4.1
34
- name: bio
35
- version_requirements: *id001
36
- prerelease: false
37
- - !ruby/object:Gem::Dependency
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
38
22
  type: :development
39
- requirement: &id002 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
40
25
  none: false
41
- requirements:
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rdoc
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
42
35
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 23
45
- segments:
46
- - 1
47
- - 0
48
- - 0
49
- version: 1.0.0
50
- name: bundler
51
- version_requirements: *id002
52
- prerelease: false
53
- - !ruby/object:Gem::Dependency
36
+ - !ruby/object:Gem::Version
37
+ version: '3.12'
54
38
  type: :development
55
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
56
41
  none: false
57
- requirements:
42
+ requirements:
58
43
  - - ~>
59
- - !ruby/object:Gem::Version
60
- hash: 7
61
- segments:
62
- - 1
63
- - 5
64
- - 2
65
- version: 1.5.2
44
+ - !ruby/object:Gem::Version
45
+ version: '3.12'
46
+ - !ruby/object:Gem::Dependency
66
47
  name: jeweler
67
- version_requirements: *id003
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.8.3
54
+ type: :development
68
55
  prerelease: false
69
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.8.3
62
+ - !ruby/object:Gem::Dependency
63
+ name: bundler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: 1.0.21
70
70
  type: :development
71
- requirement: &id004 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
72
73
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
80
- name: rcov
81
- version_requirements: *id004
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.0.21
78
+ - !ruby/object:Gem::Dependency
79
+ name: bio
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: 1.4.2
86
+ type: :development
82
87
  prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: 1.4.2
83
94
  description: A bioruby plugin for interaction with the transmembrane predictor TMHMM
84
95
  email: donttrustben@gmail.com
85
- executables:
86
- - biotm_hmm
96
+ executables:
97
+ - bio-tm_hmm
87
98
  extensions: []
88
-
89
- extra_rdoc_files:
99
+ extra_rdoc_files:
90
100
  - LICENSE.txt
91
101
  - README.rdoc
92
- files:
102
+ files:
93
103
  - .document
104
+ - .travis.yml
94
105
  - Gemfile
95
106
  - LICENSE.txt
96
107
  - README.rdoc
97
108
  - Rakefile
98
109
  - VERSION
99
- - bin/biotm_hmm
110
+ - bin/bio-tm_hmm
100
111
  - bio-tm_hmm.gemspec
101
112
  - lib/bio-tm_hmm.rb
102
113
  - lib/bio/appl/tmhmm/tmhmm_runner.rb
@@ -105,41 +116,32 @@ files:
105
116
  - test/helper.rb
106
117
  - test/test_tm_hmm_wrapper.rb
107
118
  - test/test_transmembrane.rb
108
- has_rdoc: true
109
119
  homepage: http://github.com/wwood/bioruby-tm_hmm
110
- licenses:
120
+ licenses:
111
121
  - MIT
112
122
  post_install_message:
113
123
  rdoc_options: []
114
-
115
- require_paths:
124
+ require_paths:
116
125
  - lib
117
- required_ruby_version: !ruby/object:Gem::Requirement
126
+ required_ruby_version: !ruby/object:Gem::Requirement
118
127
  none: false
119
- requirements:
120
- - - ">="
121
- - !ruby/object:Gem::Version
122
- hash: 3
123
- segments:
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ segments:
124
133
  - 0
125
- version: "0"
126
- required_rubygems_version: !ruby/object:Gem::Requirement
134
+ hash: 1004564205
135
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
136
  none: false
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- hash: 3
132
- segments:
133
- - 0
134
- version: "0"
137
+ requirements:
138
+ - - ! '>='
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
135
141
  requirements: []
136
-
137
142
  rubyforge_project:
138
- rubygems_version: 1.6.2
143
+ rubygems_version: 1.8.21
139
144
  signing_key:
140
145
  specification_version: 3
141
146
  summary: A bioruby plugin for interaction with the transmembrane predictor TMHMM
142
- test_files:
143
- - test/helper.rb
144
- - test/test_tm_hmm_wrapper.rb
145
- - test/test_transmembrane.rb
147
+ test_files: []
data/bin/biotm_hmm DELETED
@@ -1,72 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # Author:: Ben J. Woodcroft
4
- # Copyright:: 2011
5
- # License:: The Ruby License
6
-
7
- require 'rubygems'
8
- require 'bio'
9
- require 'bio-tm_hmm'
10
- require 'optparse'
11
-
12
- # If being run directly instead of being require'd,
13
- # output one transmembrane per line, and
14
- # indicate that a particular protein has no transmembrane domain
15
- if $0 == __FILE__
16
- options = {
17
- :filter_in => false,
18
- :filter_out => false,
19
- }
20
- o = OptionParser.new do |opts|
21
- opts.banner = [
22
- 'Usage: tm_hmm_wrapper.rb [-fg] [fasta_filename]',
23
- "\tfasta file can also be piped in on STDIN.",
24
- "\twithout arguments, a description of the transmembranes is printed out for each input sequence"
25
- ]
26
- 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|
27
- options[:filter_in] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
28
- end
29
- 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|
30
- options[:filter_out] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
31
- end
32
- end
33
- o.parse!
34
-
35
- runner = Bio::TMHMM::TmHmmWrapper.new
36
-
37
- Bio::FlatFile.auto(ARGF).each do |seq|
38
- result = runner.calculate(seq.seq)
39
- name = seq.definition
40
-
41
- # Default output - a description of the TMDs for each input aaseq
42
- if options[:filter_in] == false and options[:filter_out] == false
43
- if result.has_domain?
44
- # At least one TMD found. Output each on a separate line
45
- result.transmembrane_domains.each do |tmd|
46
- puts [
47
- name,
48
- result.transmembrane_type,
49
- tmd.start,
50
- tmd.stop,
51
- tmd.orientation
52
- ].join("\t")
53
- end
54
- else
55
- puts [
56
- name,
57
- 'No Transmembrane Domain Found'
58
- ].join("\t")
59
- end
60
-
61
- elsif options[:filter_in] != false
62
- if result.transmembrane_domains.length >= options[:filter_in]
63
- puts seq
64
- end
65
- elsif options[:filter_out] != false
66
- unless result.transmembrane_domains.length >= options[:filter_out]
67
- puts seq
68
- end
69
- end
70
- end
71
- end
72
-