fasta_util 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -6,7 +6,7 @@ GEM
6
6
  bundler (~> 1.0.0)
7
7
  git (>= 1.2.5)
8
8
  rake
9
- rake (0.8.7)
9
+ rake (0.9.2)
10
10
  rcov (0.9.9)
11
11
  shoulda (2.11.3)
12
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.4.0
data/bin/fasta_util CHANGED
@@ -5,7 +5,7 @@ require 'set'
5
5
 
6
6
  class FastaUtility < Thor
7
7
  include Thor::Actions
8
- Struct.new("Stats", :sum, :l50, :n50, :count, :mean, :median)
8
+ Struct.new("Stats", :sum, :l50, :n50, :max, :mean, :median, :min, :count)
9
9
 
10
10
  no_tasks do
11
11
  def stats(lengths)
@@ -16,8 +16,10 @@ class FastaUtility < Thor
16
16
  stats[:sum] = lengths.inject(:+)
17
17
  stats[:l50] = lengths.find{|length| (temp_sum += length) > stats[:sum]/2.0}
18
18
  stats[:n50] = lengths.count{|length| length >= stats[:l50]}
19
+ stats[:max] = lengths.max
19
20
  stats[:mean] = stats[:sum].to_f/lengths.length
20
21
  stats[:median] = (lengths.length % 2 == 0) ? (lengths[lengths.length/2-1] + lengths[lengths.length/2])/2.0 : lengths[lengths.length/2]
22
+ stats[:min] = lengths.min
21
23
  stats[:count] = lengths.count
22
24
  return stats
23
25
  end
data/fasta_util.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fasta_util}
8
- s.version = "0.3.1"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["robsyme"]
12
- s.date = %q{2011-05-09}
12
+ s.date = %q{2011-07-07}
13
13
  s.default_executable = %q{fasta_util}
14
14
  s.description = %q{Easy fasta filtering, wrapping, calculating common statistics, sorting etc. Based on the fasta_tool script that I think was written by Jason Stajich.}
15
15
  s.email = %q{rob.syme@gmail.com}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fasta_util
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - robsyme
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-09 00:00:00 +08:00
13
+ date: 2011-07-07 00:00:00 +08:00
14
14
  default_executable: fasta_util
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - ">="
127
127
  - !ruby/object:Gem::Version
128
- hash: 2929691451831770963
128
+ hash: 4438515197359890059
129
129
  segments:
130
130
  - 0
131
131
  version: "0"