lederhosen 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/lederhosen.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "lederhosen"
8
- s.version = "1.3.3"
8
+ s.version = "1.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Austin G. Davis-Richardson"]
12
- s.date = "2012-11-26"
12
+ s.date = "2012-12-03"
13
13
  s.description = "Various tools for OTU clustering"
14
14
  s.email = "harekrishna@gmail.com"
15
15
  s.executables = ["lederhosen"]
@@ -28,14 +28,13 @@ module Lederhosen
28
28
  #
29
29
  # - :taxcollector
30
30
  # - :greengenes
31
- #
31
+ #
32
32
  def detect_taxonomy_format(taxonomy)
33
- # greengenes has a number as the first item in the header
34
- # so let's just go with that
35
- if taxonomy.split.first =~ /^[\d*]/
36
- :greengenes
37
- else
33
+ # taxcollector taxonomy starts with a open square bracked
34
+ if taxonomy =~ /^\[/
38
35
  :taxcollector
36
+ else
37
+ :greengenes
39
38
  end
40
39
  end
41
40
 
@@ -3,7 +3,7 @@ module Lederhosen
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
5
  CODENAME = 'Dirndl' # changes for minor versions
6
- PATCH = 3
6
+ PATCH = 4
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH].join('.')
9
9
  end
@@ -4,15 +4,20 @@ lederhosen = Lederhosen::CLI.new
4
4
 
5
5
  describe 'no_tasks' do
6
6
 
7
- let(:greengenes_taxonomy) { '124 U55236.1 Methanobrevibacter thaueri str. CW k__Archaea; p__Euryarchaeota; c__Methanobacteria; o__Methanobacteriales; f__Methanobacteriaceae; g__Methanobrevibacter; Unclassified; otu_127' }
8
- let(:taxcollector_taxonomy) { '[0]Bacteria;[1]Actinobacteria;[2]Actinobacteria;[3]null;[4]null;[5]null;[6]bacterium_TH3;[7]bacterium_TH3;[8]bacterium_TH3|M79434|8 ' }
7
+ let(:greengenes_taxonomies) { ['124 U55236.1 Methanobrevibacter thaueri str. CW k__Archaea; p__Euryarchaeota; c__Methanobacteria; o__Methanobacteriales; f__Methanobacteriaceae; g__Methanobrevibacter; Unclassified; otu_127',
8
+ 'k__Bacteria;p__Proteobacteria;c__Gammaproteobacteria;o__Enterobacteriales;f__Enterobacteriaceae;g__Rahnella;s__' ]}
9
+ let(:taxcollector_taxonomies) { ['[0]Bacteria;[1]Actinobacteria;[2]Actinobacteria;[3]null;[4]null;[5]null;[6]bacterium_TH3;[7]bacterium_TH3;[8]bacterium_TH3|M79434|8'] }
9
10
 
10
11
  it '#detect_taxonomy_format should recognize GreenGenes' do
11
- lederhosen.detect_taxonomy_format(greengenes_taxonomy).should == :greengenes
12
+ greengenes_taxonomies.each do |greengenes_taxonomy|
13
+ lederhosen.detect_taxonomy_format(greengenes_taxonomy).should == :greengenes
14
+ end
12
15
  end
13
16
 
14
17
  it '#detect_taxonomy_format should recognize TaxCollector' do
15
- lederhosen.detect_taxonomy_format(taxcollector_taxonomy).should == :taxcollector
18
+ taxcollector_taxonomies.each do |taxcollector_taxonomy|
19
+ lederhosen.detect_taxonomy_format(taxcollector_taxonomy).should == :taxcollector
20
+ end
16
21
  end
17
22
 
18
23
  it '#detect_taxonomy_format should fail on unknown formats' do
@@ -20,30 +25,38 @@ describe 'no_tasks' do
20
25
  end
21
26
 
22
27
  it '#parse_taxonomy_taxcollector should parse taxcollector taxonomy' do
23
- taxonomy = lederhosen.parse_taxonomy_taxcollector(taxcollector_taxonomy)
24
- taxonomy['original'].should == taxcollector_taxonomy
25
-
26
- levels = %w{domain phylum class order family genus species kingdom original}
28
+ taxcollector_taxonomies.each do |taxcollector_taxonomy|
29
+ taxonomy = lederhosen.parse_taxonomy_taxcollector(taxcollector_taxonomy)
30
+ taxonomy['original'].should == taxcollector_taxonomy
31
+
32
+ levels = %w{domain phylum class order family genus species kingdom original}
27
33
 
28
- taxonomy.keys.each do |v|
29
- levels.should include v
34
+ taxonomy.keys.each do |v|
35
+ levels.should include v
36
+ end
30
37
  end
31
38
  end
32
39
 
33
40
  it '#parse_taxonomy_greengenes should parse greengenes taxonomy' do
34
- taxonomy = lederhosen.parse_taxonomy_greengenes(greengenes_taxonomy)
35
- levels = %w{domain phylum class order family genus species kingdom original}
41
+ greengenes_taxonomies.each do |greengenes_taxonomy|
42
+ taxonomy = lederhosen.parse_taxonomy_greengenes(greengenes_taxonomy)
43
+ levels = %w{domain phylum class order family genus species kingdom original}
36
44
 
37
- taxonomy.keys.each do |v|
38
- levels.should include v
45
+ taxonomy.keys.each do |v|
46
+ levels.should include v
47
+ end
39
48
  end
40
49
  end
41
50
 
42
51
  it '#parse_taxonomy should automatically detect and parse greengenes taxonomy' do
43
- lederhosen.parse_taxonomy(greengenes_taxonomy).should_not be_nil
52
+ greengenes_taxonomies.each do |greengenes_taxonomy|
53
+ lederhosen.parse_taxonomy(greengenes_taxonomy).should_not be_nil
54
+ end
44
55
  end
45
56
 
46
57
  it '#parse_taxonomy should automatically detect and parse taxcollector taxonomy' do
47
- lederhosen.parse_taxonomy(taxcollector_taxonomy).should_not be_nil
58
+ taxcollector_taxonomies.each do |taxcollector_taxonomy|
59
+ lederhosen.parse_taxonomy(taxcollector_taxonomy).should_not be_nil
60
+ end
48
61
  end
49
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lederhosen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
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-11-26 00:00:00.000000000 Z
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dna
@@ -160,7 +160,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  segments:
162
162
  - 0
163
- hash: 154104254980930156
163
+ hash: 2143498304454718392
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  none: false
166
166
  requirements: