Class | Bio::Blast::Report::BlastXmlSplitter
In: | lib/bio/appl/blast/report.rb
Parent: | Bio::FlatFile::Splitter::Default

Flatfile splitter for NCBI BLAST XML format. It is internally used when reading BLAST XML. Normally, users do not need to use it directly.

### Methods

entry entry_ended_pos entry_start_pos get_entry get_parsed_entry new rewind skip_leader

### Public Class methods

new(klass, bstream)

creates a new splitter object

[Source]

         # File lib/bio/appl/blast/report.rb, line 486
    486:     def initialize(klass, bstream)
    487:       super(klass, bstream)
    488:       @parsed_entries = []
    489:       @raw_unsupported = false
    490:     end

### Public Instance methods

entry()

current raw entry as a String

[Source]

         # File lib/bio/appl/blast/report.rb, line 531
    531:     def entry
    532:       raise 'not supported for new BLAST XML format' if @raw_unsupported
    533:       super
    534:     end

entry_ended_pos()

(end position of the entry) + 1

[Source]

         # File lib/bio/appl/blast/report.rb, line 545
    545:     def entry_ended_pos
    546:       if entry_pos_flag then
    547:         raise 'not supported for new BLAST XML format' if @raw_unsupported
    548:       end
    549:       super
    550:     end

entry_start_pos()

start position of the entry

[Source]

         # File lib/bio/appl/blast/report.rb, line 537
    537:     def entry_start_pos
    538:       if entry_pos_flag then
    539:         raise 'not supported for new BLAST XML format' if @raw_unsupported
    540:       end
    541:       super
    542:     end

get_entry()

get an entry and return the entry as a string

[Source]

         # File lib/bio/appl/blast/report.rb, line 506
    506:     def get_entry
    507:       if @parsed_entries.empty? then
    508:         @raw_unsupported = false
    509:         ent = super
    510:         prepare_parsed_entries(ent)
    511:         self.parsed_entry = @parsed_entries.shift
    512:       else
    513:         raise 'not supported for new BLAST XML format'
    514:       end
    515:       ent
    516:     end

get_parsed_entry()

get an entry as a Bio::Blast::Report object

[Source]

         # File lib/bio/appl/blast/report.rb, line 519
    519:     def get_parsed_entry
    520:       if @parsed_entries.empty? then
    521:         ent = get_entry
    522:       else
    523:         self.parsed_entry = @parsed_entries.shift
    524:         self.entry = nil
    525:         @raw_unsupported = true
    526:       end
    527:       self.parsed_entry
    528:     end

rewind()

rewinds

[Source]

         # File lib/bio/appl/blast/report.rb, line 493
    493:     def rewind
    494:       ret = super
    495:       @parsed_entries.clear
    496:       @raw_unsupported = false
    497:       ret
    498:     end

skip_leader()

do nothing

[Source]

         # File lib/bio/appl/blast/report.rb, line 501
    501:     def skip_leader
    502:       nil
    503:     end

[Validate]