lederhosen 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lederhosen.gemspec +2 -2
- data/lib/lederhosen/cli.rb +10 -0
- data/lib/lederhosen/tasks/add_names.rb +5 -2
- data/lib/lederhosen/version.rb +1 -1
- metadata +4 -4
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 = "0.5.
|
8
|
+
s.version = "0.5.5"
|
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-
|
12
|
+
s.date = "2012-09-05"
|
13
13
|
s.description = "Various tools for OTU clustering"
|
14
14
|
s.email = "harekrishna@gmail.com"
|
15
15
|
s.executables = ["lederhosen"]
|
data/lib/lederhosen/cli.rb
CHANGED
@@ -7,10 +7,20 @@ module Lederhosen
|
|
7
7
|
include Thor::Actions
|
8
8
|
|
9
9
|
no_tasks do
|
10
|
+
|
11
|
+
##
|
12
|
+
# print a status message to $stderr
|
13
|
+
# use for good statuses
|
14
|
+
#
|
10
15
|
def ohai(s)
|
11
16
|
@shell.say_status('okay', s, 'green')
|
12
17
|
end
|
13
18
|
|
19
|
+
##
|
20
|
+
# print a status message to $stderr
|
21
|
+
# use for bad statuses
|
22
|
+
# also exit's with -1 status-code
|
23
|
+
#
|
14
24
|
def ohno(s)
|
15
25
|
@shell.say_status('fail', s, 'red')
|
16
26
|
exit(-1)
|
@@ -49,7 +49,8 @@ module Lederhosen
|
|
49
49
|
|
50
50
|
# Only get first match
|
51
51
|
# TODO something smarter here
|
52
|
-
|
52
|
+
|
53
|
+
cluster_id = "cluster-#{line[0].match(/cluster-(\d*)/)[1]}"
|
53
54
|
next if clusterid_to_name.include? cluster_id
|
54
55
|
|
55
56
|
taxonomic_description = line[1]
|
@@ -58,7 +59,7 @@ module Lederhosen
|
|
58
59
|
# Example:
|
59
60
|
# [0]Bacteria;[1]Actinobacteria;[2]Actinobacteria;[3]Acidimicrobiales;[4]Acidimicrobiaceae;[5]Acidimicrobium;[6]Acidimicrobium_ferrooxidans;
|
60
61
|
# I want to match Actinobacteria given level_no = 2
|
61
|
-
level_name = taxonomic_description.match(/\[#{level_no}\](\w*)[;\[]/)[1] rescue
|
62
|
+
level_name = taxonomic_description.match(/\[#{level_no}\](\w*)[;\[]/)[1] rescue nil
|
62
63
|
|
63
64
|
# keep cluster id if name is 'null' (bad taxonomic description)
|
64
65
|
# but put paranthesis around it so I know
|
@@ -68,6 +69,8 @@ module Lederhosen
|
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
72
|
+
ohai "#{clusterid_to_name.keys.size} clusters were identified"
|
73
|
+
|
71
74
|
# load table, replace cluster names with taxonomic descriptions
|
72
75
|
output = File.open(output, 'w') unless output == $stdout
|
73
76
|
ohai "replacing names in #{table}"
|
data/lib/lederhosen/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lederhosen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 5
|
10
|
+
version: 0.5.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Austin G. Davis-Richardson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-09-05 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
type: :runtime
|