bin/fasta_util in fasta_util-0.4.0 vs bin/fasta_util in fasta_util-0.5.0
- old
+ new
@@ -61,10 +61,10 @@
method_option :defline_grep, :aliases => '-d', :type => :string, :default => '', :desc => "A regular expression, used to search the entry's definition line."
method_option :definitions_file, :aliases => '-f', :type => :string, :default => '', :desc => "A file with definitions to match, one per line."
def filter(filename)
invoke :filecheck
invoke :filecheck, [options.definitions_file]
- requested_definitions = File.open(options.definitions_file).map{|definition| definition.strip}
+ requested_definitions = File.open(options.definitions_file).map{|definition| definition.strip} if options.definitions_file
Bio::FlatFile.open(filename).each do |entry|
passed = true
passed &&= (entry.length >= options.length_cutoff)
passed &&= (entry.definition.match(Regexp.new(options.defline_grep)))
passed &&= (requested_definitions.include? entry.definition)