Method: Bio::Blast::Fastacmd#each_entry

Defined in:
lib/bio/io/fastacmd.rb

#each_entryObject Also known as: each

Iterates over all sequences in the database.

fastacmd.each_entry do |fasta|
  p [ fasta.definition[0..30], fasta.seq.size ]
end

Returns

a Bio::FastaFormat object for each iteration



130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/bio/io/fastacmd.rb', line 130

def each_entry
  cmd = [ @fastacmd, '-d', @database, '-D', '1' ]
  Bio::Command.call_command(cmd) do |io|
    io.close_write
    Bio::FlatFile.open(Bio::FastaFormat, io) do |f|
      f.each_entry do |entry|
        yield entry
      end
    end
  end
  self
end