Skip to content
Browse files

documentation changes, run travis CI so it works

  • Loading branch information...
1 parent 5eeff59 commit 81c958fd40d5218b61ed7b05dd5b0683a98becf0 @wwood committed
Showing with 22 additions and 60 deletions.
  1. +1 −1 .travis.yml
  2. +9 −2 README.md
  3. +5 −0 Rakefile
  4. +7 −5 bin/bio-tm_hmm
  5. +0 −52 test/test_tm_hmm_wrapper.rb
View
2 .travis.yml
@@ -9,4 +9,4 @@ rvm:
# - rbx-18mode
# uncomment this line if your project needs to run something other than `rake`:
-# script: bundle exec rspec spec
+script: bundle exec rake test_without_tmhmm
View
11 README.md
@@ -13,7 +13,14 @@ gem install bio-tm_hmm
## Usage
```
-bio-tm_hmm my.fasta
+Usage: bio-tm_hmm [-f NUM] [-g NUM] [fasta_filename]
+
+ fasta file can also be piped in on STDIN.
+ without arguments, a description of the transmembrane domains is printed out for each input sequence
+ -f MIN_TRANSMEMBRANE_DOMAINS, Print those sequences that have at _least_ MIN_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.
+ --filter-in
+ -g MAX_TRANSMEMBRANE_DOMAINS, Print those sequences that have at _most_ MAX_TRANSMEMBRANE_DOMAINS transmembrane domain(s). Prints out the sequences in FASTA format.
+ --filter-out
```
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.
@@ -47,7 +54,7 @@ The BioRuby community is on IRC server: irc.freenode.org, channel: #bioruby.
If you use this software, please cite:
-[Organellar proteomics reveals hundreds of novel nuclear proteins in the malaria parasite Plasmodium falciparum](genomebiology.com/2012/13/11/R108)
+[Organellar proteomics reveals hundreds of novel nuclear proteins in the malaria parasite Plasmodium falciparum](http://genomebiology.com/2012/13/11/R108)
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
View
5 Rakefile
@@ -31,6 +31,11 @@ Rake::TestTask.new(:test) do |test|
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
+Rake::TestTask.new(:test_without_tmhmm) do |test|
+ test.libs << 'lib' << 'test'
+ test.test_files = FileList['test/test*.rb'].reject{|f| f=='test/test_tm_hmm_wrapper.rb'}
+ test.verbose = true
+end
task :default => :test
View
12 bin/bio-tm_hmm
@@ -17,11 +17,13 @@ options = {
:filter_out => false,
}
o = OptionParser.new do |opts|
- opts.banner = ['',
- 'Usage: tm_hmm_wrapper.rb [-fg] [fasta_filename]','',
- "\tfasta file can also be piped in on STDIN.",
- "\twithout arguments, a description of the transmembranes is printed out for each input sequence",''
- ].join("\n")
+ opts.banner = "
+ Usage: #{File.basename __FILE__} [-f NUM] [-g NUM] [fasta_filename]
+
+ Fasta file can be piped in on STDIN, or specified as the first unqualified argument.
+
+ Without arguments, a description of the transmembrane domains is printed out for each input sequence\n\n"
+
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|
options[:filter_in] = m.to_i #gets set to 0 when optional MIN_TRANSMEMBRANE_DOMAINS is omitted
end
View
52 test/test_tm_hmm_wrapper.rb
@@ -3,58 +3,6 @@
class TmHmmWrapperTest < Test::Unit::TestCase
include Bio::Transmembrane
-
- def test_parser
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0635c len=555 ExpAA=0.00 First60=0.00 PredHel=0 Topology=o')
- assert result
- assert_equal false, result.has_domain?
-
- # test a single TMD
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0685c len=324 ExpAA=20.36 First60=0.00 PredHel=1 Topology=o281-303i')
- assert result
- assert_equal 1, result.transmembrane_domains.length
- assert_equal 281, result.transmembrane_domains[0].start
- assert_equal 303, result.transmembrane_domains[0].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
- result.transmembrane_domains[0].orientation
- assert result.transmembrane_type_1?
- assert_equal false, result.transmembrane_type_2?
-
- # test 2 TMD
- result = Bio::TMHMM::TmHmmResult.create_from_short_line('PFA0680c len=209 ExpAA=43.03 First60=0.02 PredHel=2 Topology=i137-159o164-183i')
- assert result
- assert_equal 2, result.transmembrane_domains.length
- assert_equal 137, result.transmembrane_domains[0].start
- assert_equal 159, result.transmembrane_domains[0].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
- result.transmembrane_domains[0].orientation
- assert_equal 164, result.transmembrane_domains[1].start
- assert_equal 183, result.transmembrane_domains[1].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
- result.transmembrane_domains[1].orientation
- assert_equal false, result.transmembrane_type_1?
- assert_equal false, result.transmembrane_type_2?
-
- # test 3 TMD
- 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')
- assert result
- assert_equal 4, result.transmembrane_domains.length
- assert_equal 22, result.transmembrane_domains[0].start
- assert_equal 44, result.transmembrane_domains[0].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::INSIDE_OUT,
- result.transmembrane_domains[0].orientation
- assert_equal 185, result.transmembrane_domains[1].start
- assert_equal 207, result.transmembrane_domains[1].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
- result.transmembrane_domains[1].orientation
- assert_equal 259, result.transmembrane_domains[3].start
- assert_equal 281, result.transmembrane_domains[3].stop
- assert_equal Bio::Transmembrane::OrientedTransmembraneDomain::OUTSIDE_IN,
- result.transmembrane_domains[3].orientation
- assert_equal false, result.transmembrane_type_1?
- assert_equal false, result.transmembrane_type_2?
- end
-
def test_wrapper
prog = Bio::TMHMM::TmHmmWrapper.new
seq = Bio::FlatFile.auto(File.join(File.dirname(__FILE__),'data','falciparum1.fa')).next_entry

0 comments on commit 81c958f

Please sign in to comment.
Something went wrong with that request. Please try again.