fasta_util 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/fasta_util +4 -0
  3. data/fasta_util.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
data/bin/fasta_util CHANGED
@@ -56,12 +56,16 @@ class FastaUtility < Thor
56
56
  method_option :length_cutoff, :aliases => '-l', :type => :numeric, :default => 0, :desc => 'Only entries with length >= cutoff will be returned.'
57
57
  method_option :inverse_match, :aliases => '-v', :type => :boolean, :desc => "Return the inverse of the match after all the other filters have been applied."
58
58
  method_option :defline_grep, :aliases => '-d', :type => :string, :default => '', :desc => "A regular expression, used to search the entry's definition line."
59
+ method_option :definitions_file, :aliases => '-f', :type => :string, :default => '', :desc => "A file with definitions to match, one per line."
59
60
  def filter(filename)
60
61
  invoke :filecheck
62
+ invoke :filecheck, [options.definitions_file]
63
+ requested_definitions = File.open(options.definitions_file).map{|definition| definition.strip}
61
64
  Bio::FlatFile.open(filename).each do |entry|
62
65
  passed = true
63
66
  passed &&= (entry.length >= options.length_cutoff)
64
67
  passed &&= (entry.definition.match(Regexp.new(options.defline_grep)))
68
+ passed &&= (requested_definitions.include? entry.definition)
65
69
  passed = !passed if options.inverse_match
66
70
  puts entry if passed
67
71
  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.2.2"
8
+ s.version = "0.2.3"
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-02-18}
12
+ s.date = %q{2011-03-09}
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.2.2
5
+ version: 0.2.3
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-02-18 00:00:00 +08:00
13
+ date: 2011-03-09 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: -443172315906729972
128
+ hash: 1980362110866900024
129
129
  segments:
130
130
  - 0
131
131
  version: "0"