Class Bio::Fasta::Report::FastaFormat10Splitter
In: lib/bio/appl/fasta/format10.rb
Parent: Bio::FlatFile::Splitter::Template

Splitter for Bio::FlatFile

Methods

get_entry   new   skip_leader  

Public Class methods

creates a new splitter object

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 23
23:     def initialize(klass, bstream)
24:       super(klass, bstream)
25:       @delimiter = '>>>'
26:       @real_delimiter = /^\s*\d+\>\>\>\z/
27:     end

Public Instance methods

gets an entry

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 35
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

do nothing and returns nil

[Source]

    # File lib/bio/appl/fasta/format10.rb, line 30
30:     def skip_leader
31:       nil
32:     end

[Validate]