iroki 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7dc31c2808eb188a480ce2027daa72a6024e913
4
- data.tar.gz: d8a7ec7990c34342fb7505e0aaeae2167f7e67ce
3
+ metadata.gz: 95a7ef76c36216350d0b539cd3e4b259e725e588
4
+ data.tar.gz: 9701c392d7bbba6e02bccafe2d12461567a8c5dd
5
5
  SHA512:
6
- metadata.gz: e3d183860b306f6a9b6036099f2a14375a20587e69dee9bf2b59926416e37e2b329ff0b82dcb64f716bb4ccebb3ff8cf9a8d1ab80c64d72b5fc64cd2ef8d02c1
7
- data.tar.gz: 595cd8111b7ad59f16798ffbe53d7cee12eedfafb48752bd524fd7532065285042d5373e66a918ad6f49e59fa954fbf2043199406a47924e321b0649382d4ec6
6
+ metadata.gz: 8a9a52dd9d3937beb6dabd144ce98599bc67d30a2f0fed0b094f94aa68e7f044f26d3c725db11e941ea497c39319cda26b6c82532fc1c1c5d6fcb41a730c6338
7
+ data.tar.gz: d3aed5abfb0cd2b89c06e0e963e47414c7ff082b46d55c467ab5746c85c317b9ff08d97cf682b6e0c75817a72e0f857662ebc7fcbeb660612ac6dce82446578a
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.2.4
1
+ ruby-2.3.1
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.4
3
+ - 2.3.1
4
4
  before_install: gem install bundler -v 1.11.2
data/README.md CHANGED
@@ -131,3 +131,7 @@ Add `reorder_nodes` script.
131
131
  ### 0.0.13 ###
132
132
 
133
133
  - Handle bad command line input
134
+
135
+ ### 0.0.14 ###
136
+
137
+ - Add more specs and various improvements
data/iroki.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = ">= 2.2.4"
22
+ spec.required_ruby_version = ">= 2.3.1"
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.11"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
data/lib/iroki/biom.rb CHANGED
@@ -23,11 +23,22 @@ module Iroki
23
23
  def parse
24
24
  samples = []
25
25
  counts = []
26
+ lineno = -1
27
+ first_line_count = -1
26
28
 
27
- self.each_line do |line|
29
+ self.each_line.with_index do |line, idx|
28
30
  unless line.start_with? "#"
31
+ lineno += 1
29
32
  sample, *the_counts = line.chomp.split "\t"
30
33
 
34
+ if lineno.zero?
35
+ first_line_count = the_counts.count
36
+ else
37
+ abort_unless first_line_count == the_counts.count,
38
+ "The biom file has rows with different " +
39
+ "numbers of columns"
40
+ end
41
+
31
42
  samples << sample
32
43
 
33
44
  if the_counts.length == 1
@@ -698,7 +698,7 @@ module Iroki
698
698
  WHITE = HSL.from_fraction WHITE_HUE, FULLY_SATURATED, PURE_LIGHT
699
699
 
700
700
  DARK_GREEN = RGB.by_hex(COLORS["darkgreen"])
701
- GRAY = RGB.by_hex(COLORS["gray"])
701
+ GRAY = RGB.by_hex(COLORS["gray"])
702
702
 
703
703
  def self.get_tag str, palette=nil
704
704
  if str.hex?
@@ -725,13 +725,10 @@ module Iroki
725
725
  colors = COLORS
726
726
  end
727
727
 
728
- if colors.has_key? col
729
- hex = colors[col]
730
- else
731
- # if passed color other than one defined, return black
732
- hex = colors["black"]
733
- end
728
+ abort_unless colors.has_key?(col),
729
+ "Color '#{col}' is not defined."
734
730
 
731
+ hex = colors[col]
735
732
  %Q{[&!color="#{hex.upcase}"]}
736
733
  end
737
734
  end
@@ -22,6 +22,10 @@ module Iroki
22
22
  attr_accessor :counts, :rel_abunds
23
23
 
24
24
  def initialize samples, counts, single_color=false
25
+ abort_unless samples.count == counts.count,
26
+ "Samples (#{samples.count}) and counts " +
27
+ "#{counts.count} are different size."
28
+
25
29
  @single_color = single_color
26
30
  @samples = samples
27
31
  @counts = counts
@@ -55,7 +55,7 @@ module Iroki
55
55
 
56
56
 
57
57
  patterns = {}
58
- Object::File.open(fname).each_line do |line|
58
+ Object::File.open(fname, "rt").each_line do |line|
59
59
  unless line.start_with? "#"
60
60
  label_tag = ""
61
61
  branch_tag = ""
@@ -131,7 +131,7 @@ module Iroki
131
131
  check_file fname, :name_map
132
132
 
133
133
  name_map = {}
134
- Object::File.open(fname).each_line do |line|
134
+ Object::File.open(fname, "rt").each_line do |line|
135
135
  unless line.start_with? "#"
136
136
  oldname, newname = line.chomp.split "\t"
137
137
 
@@ -98,7 +98,7 @@ module Iroki
98
98
  exact_matching: exact,
99
99
  auto_color: auto_color_hash
100
100
  else
101
- samples, counts, is_single_group = Biom.open(biom_f).parse
101
+ samples, counts, is_single_group = Biom.open(biom_f, "rt").parse
102
102
 
103
103
  if is_single_group
104
104
  patterns = SingleGroupGradient.new(samples, counts, single_color).patterns
data/lib/iroki/version.rb CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  # Library metadata
20
20
  module Iroki
21
- VERSION = "0.0.13"
21
+ VERSION = "0.0.14"
22
22
  COPYRIGHT = "2015 - 2016 Ryan Moore"
23
23
  CONTACT = "moorer@udel.edu"
24
24
  WEBSITE = "https://github.com/mooreryan/iroki"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iroki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Moore
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-03 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -222,7 +222,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
223
  - - ">="
224
224
  - !ruby/object:Gem::Version
225
- version: 2.2.4
225
+ version: 2.3.1
226
226
  required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  requirements:
228
228
  - - ">="
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.4.8
233
+ rubygems_version: 2.5.1
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Command line app and library code for Iroki, a phylogenetic tree customization