class Bio::Fasta::Report::FastaFormat10Splitter
Splitter for Bio::FlatFile
Public Class Methods
new(klass, bstream)
click to toggle source
creates a new splitter object
Calls superclass method
Bio::FlatFile::Splitter::Template::new
# File lib/bio/appl/fasta/format10.rb 23 def initialize(klass, bstream) 24 super(klass, bstream) 25 @delimiter = '>>>' 26 @real_delimiter = /^\s*\d+\>\>\>\z/ 27 end
Public Instance Methods
get_entry()
click to toggle source
gets an entry
# File lib/bio/appl/fasta/format10.rb 35 def get_entry 36 p0 = stream_pos() 37 pieces = [] 38 overrun = nil 39 first = true 40 while e = stream.gets(@delimiter) 41 pieces.push e 42 if @real_delimiter =~ e then 43 if first then 44 first = nil 45 else 46 overrun = $& 47 break 48 end 49 end 50 end 51 52 ent = (pieces.empty? ? nil : pieces.join('')) 53 if ent and overrun then 54 ent[-overrun.length, overrun.length] = '' 55 stream.ungets(overrun) 56 end 57 58 p1 = stream_pos() 59 self.entry_start_pos = p0 60 self.entry = ent 61 self.entry_ended_pos = p1 62 return ent 63 end
skip_leader()
click to toggle source
do nothing and returns nil
# File lib/bio/appl/fasta/format10.rb 30 def skip_leader 31 nil 32 end