Method: Bio::FlatFile#autodetect

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

#autodetect(lines = 31, ad = AutoDetect.default) ⇒ Object

Performs determination of database class (file format). Pre-reads lines lines for format determination (default 31 lines). If fails, returns nil or false. Otherwise, returns database class.

The method can be called anytime if you want (but not recommended). This might be useful if input file is a mixture of muitiple format data.



429
430
431
432
433
434
435
436
# File 'lib/bio/io/flatfile.rb', line 429

def autodetect(lines = 31, ad = AutoDetect.default)
  if r = ad.autodetect_flatfile(self, lines)
    self.dbclass = r
  else
    self.dbclass = nil unless self.dbclass
  end
  r
end